mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 01:50:40 +02:00
datastream is only for 10g for eiger atm, its mentioned in comments. accordingly handled in receiver. This is better solution, in case it was disabled in 10g, and not possible to set enable in 1g mode, which is given to the receiver
This commit is contained in:
parent
75f98b27a3
commit
f9a88b0f79
@ -1924,7 +1924,7 @@ class Detector(CppDetectorApi):
|
|||||||
def datastream(self):
|
def datastream(self):
|
||||||
"""
|
"""
|
||||||
datastream [left|right] [0, 1]
|
datastream [left|right] [0, 1]
|
||||||
[Eiger] Enables or disables data streaming from left or/and right side of detector. 1 (enabled) by default.
|
[Eiger] Enables or disables data streaming from left or/and right side of detector for 10GbE mode. 1 (enabled) by default.
|
||||||
"""
|
"""
|
||||||
result = {}
|
result = {}
|
||||||
for port in [defs.LEFT, defs.RIGHT]:
|
for port in [defs.LEFT, defs.RIGHT]:
|
||||||
|
@ -2105,6 +2105,9 @@ int setDataStream(enum portPosition port, int enable) {
|
|||||||
LOG(logERROR, ("Invalid setDataStream enable argument: %d\n", enable));
|
LOG(logERROR, ("Invalid setDataStream enable argument: %d\n", enable));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
LOG(logINFO,
|
||||||
|
("%s 10GbE %s datastream\n", (enable ? "Enabling" : "Disabling"),
|
||||||
|
(port == LEFT ? "left" : "right")));
|
||||||
#ifdef VIRTUAL
|
#ifdef VIRTUAL
|
||||||
if (port == LEFT) {
|
if (port == LEFT) {
|
||||||
eiger_virtual_left_datastream = enable;
|
eiger_virtual_left_datastream = enable;
|
||||||
|
@ -8266,9 +8266,6 @@ int get_datastream(int file_des) {
|
|||||||
"Only left and right allowed\n",
|
"Only left and right allowed\n",
|
||||||
arg);
|
arg);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else if (enableTenGigabitEthernet(GET_FLAG) == 0) {
|
|
||||||
retval = 1;
|
|
||||||
LOG(logINFO, ("Datastream always enabled for 1g\n"));
|
|
||||||
} else {
|
} else {
|
||||||
ret = getDataStream(arg, &retval);
|
ret = getDataStream(arg, &retval);
|
||||||
LOG(logDEBUG1, ("datastream (%s) retval: %u\n",
|
LOG(logDEBUG1, ("datastream (%s) retval: %u\n",
|
||||||
@ -8315,14 +8312,6 @@ int set_datastream(int file_des) {
|
|||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess, "Could not %s. Invalid enable %d. \n", msg, enable);
|
sprintf(mess, "Could not %s. Invalid enable %d. \n", msg, enable);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else if (enableTenGigabitEthernet(GET_FLAG) == 0 && enable == 0) {
|
|
||||||
ret = FAIL;
|
|
||||||
sprintf(mess,
|
|
||||||
"Could not %s. Disabling is only enabled in 10g mode.\n",
|
|
||||||
msg);
|
|
||||||
LOG(logERROR, (mess));
|
|
||||||
} else if (enableTenGigabitEthernet(GET_FLAG) == 0 && enable == 1) {
|
|
||||||
LOG(logINFO, ("Datastream always enabled for 1g\n"));
|
|
||||||
} else {
|
} else {
|
||||||
ret = setDataStream(port, enable);
|
ret = setDataStream(port, enable);
|
||||||
if (ret == FAIL) {
|
if (ret == FAIL) {
|
||||||
|
@ -1147,8 +1147,8 @@ class Detector {
|
|||||||
Result<bool> getDataStream(const defs::portPosition port,
|
Result<bool> getDataStream(const defs::portPosition port,
|
||||||
Positions pos = {}) const;
|
Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger] enable or disable data streaming from left or right of detector.
|
/** [Eiger] enable or disable data streaming from left or right of detector
|
||||||
* Default: enabled
|
* for 10GbE. Default: enabled
|
||||||
*/
|
*/
|
||||||
void setDataStream(const defs::portPosition port, const bool enable,
|
void setDataStream(const defs::portPosition port, const bool enable,
|
||||||
Positions pos = {});
|
Positions pos = {});
|
||||||
|
@ -1804,7 +1804,9 @@ std::string CmdProxy::DataStream(int action) {
|
|||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[left|right] [0, 1]\n\t[Eiger] Enables or disables data "
|
os << "[left|right] [0, 1]\n\t[Eiger] Enables or disables data "
|
||||||
"streaming from left or/and right side of detector. 1 (enabled) "
|
"streaming from left or/and right side of detector for 10 GbE "
|
||||||
|
"mode. "
|
||||||
|
"1 (enabled) "
|
||||||
"by default."
|
"by default."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
|
@ -1466,6 +1466,21 @@ void Implementation::setTenGigaEnable(const bool b) {
|
|||||||
|
|
||||||
generalData->SetTenGigaEnable(b);
|
generalData->SetTenGigaEnable(b);
|
||||||
SetupFifoStructure();
|
SetupFifoStructure();
|
||||||
|
|
||||||
|
// datastream can be disabled/enabled only for Eiger 10GbE
|
||||||
|
if (detType == EIGER) {
|
||||||
|
if (!b) {
|
||||||
|
detectorDataStream[LEFT] = 1;
|
||||||
|
detectorDataStream[RIGHT] = 1;
|
||||||
|
} else {
|
||||||
|
detectorDataStream[LEFT] = detectorDataStream10GbE[LEFT];
|
||||||
|
detectorDataStream[RIGHT] = detectorDataStream10GbE[RIGHT];
|
||||||
|
}
|
||||||
|
LOG(logINFO) << "Detector datastream updated [Left: "
|
||||||
|
<< sls::ToString(detectorDataStream[LEFT])
|
||||||
|
<< ", Right: "
|
||||||
|
<< sls::ToString(detectorDataStream[RIGHT]) << "]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
LOG(logINFO) << "Ten Giga: " << (tengigaEnable ? "enabled" : "disabled");
|
LOG(logINFO) << "Ten Giga: " << (tengigaEnable ? "enabled" : "disabled");
|
||||||
LOG(logINFO) << "Packets per Frame: " << (generalData->packetsPerFrame);
|
LOG(logINFO) << "Packets per Frame: " << (generalData->packetsPerFrame);
|
||||||
@ -1532,9 +1547,9 @@ bool Implementation::getDetectorDataStream(const portPosition port) const {
|
|||||||
void Implementation::setDetectorDataStream(const portPosition port,
|
void Implementation::setDetectorDataStream(const portPosition port,
|
||||||
const bool enable) {
|
const bool enable) {
|
||||||
int index = (port == LEFT ? 0 : 1);
|
int index = (port == LEFT ? 0 : 1);
|
||||||
detectorDataStream[index] = enable;
|
detectorDataStream10GbE[index] = enable;
|
||||||
LOG(logINFO) << "Detector datastream (" << sls::ToString(port)
|
LOG(logINFO) << "Detector 10GbE datastream (" << sls::ToString(port)
|
||||||
<< " Port): " << sls::ToString(detectorDataStream[index]);
|
<< " Port): " << sls::ToString(detectorDataStream10GbE[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Implementation::getReadNRows() const { return readNRows; }
|
int Implementation::getReadNRows() const { return readNRows; }
|
||||||
|
@ -356,6 +356,7 @@ class Implementation : private virtual slsDetectorDefs {
|
|||||||
bool quadEnable{false};
|
bool quadEnable{false};
|
||||||
bool activated{true};
|
bool activated{true};
|
||||||
std::array<bool, 2> detectorDataStream = {{true, true}};
|
std::array<bool, 2> detectorDataStream = {{true, true}};
|
||||||
|
std::array<bool, 2> detectorDataStream10GbE = {{true, true}};
|
||||||
int readNRows{0};
|
int readNRows{0};
|
||||||
int thresholdEnergyeV{-1};
|
int thresholdEnergyeV{-1};
|
||||||
std::array<int, 3> thresholdAllEnergyeV = {{-1, -1, -1}};
|
std::array<int, 3> thresholdAllEnergyeV = {{-1, -1, -1}};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user