mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-08-07 00:22:25 +02:00
Dev/rx disable datastream port (#1448)
Build and Deploy on local RHEL9 / build (push) Successful in 2m13s
Build on RHEL9 docker image / build (push) Successful in 3m53s
Build and Deploy on local RHEL8 / build (push) Successful in 4m58s
Build on RHEL8 docker image / build (push) Successful in 5m47s
Run Simulator Tests on local RHEL9 / build (push) Successful in 18m55s
Run Simulator Tests on local RHEL8 / build (push) Successful in 22m26s
Build and Deploy on local RHEL9 / build (push) Successful in 2m13s
Build on RHEL9 docker image / build (push) Successful in 3m53s
Build and Deploy on local RHEL8 / build (push) Successful in 4m58s
Build on RHEL8 docker image / build (push) Successful in 5m47s
Run Simulator Tests on local RHEL9 / build (push) Successful in 18m55s
Run Simulator Tests on local RHEL8 / build (push) Successful in 22m26s
- changed
- command from `datastream` to `udp_datastream` to be more specific
- Detector API:
- setNumberofUDPInterfaces(pos) =>setNumberofUDPInterfaces() # no position anymore
- getDataStream(portPosition, pos) =>getUDPDataStream(portPosition, pos)
- setDataStream(portPosition, pos) => setUDPDataStream(portPosition) # no position anymore
- modified the dataprocessing thread:
- if gui or call back, start zmq processing (connecting sockets) before starting receiver (disabled ports sends dummy that the client zmq sockets are not ready for)
- if only progress, starting progress processing thread after startReceiver
-
- added
- Detector API:
- getRxDisabledUDPPortIndices()
- getPortPositionList()
- allow disabling/enabling udp interface in receiver for Jungfrua/Moench when both udp interfaces is enabled (This is to go fast, where only one half of the module matters)
- write ports type and disabled ports to master file (tests for it as well)
- tests for python commands as well
- datastream command to deprecated commands
- refactored tests to make the new parameters fit
* first draft of disabling data port at the receiver side. Todo: master file and stream for gui to use
* updated help in command
* formatting
* md5 unchanged
* fix test, check port position for detector type
* wip, udp port enable metadata in client, to:receiver, zmq streaming
* wip, master attributes
* wip, imple=> save only disabled ports with port index, 1 interface, is empty
* works in file. still needs refactoring
* updated writer versions
* udp ports type pass, disabled with api yet
* fixed disabled ports meta data as well
* fixed in developer via other PR
* renamed.more intuitive
* fix in gui that wont wait for disabled ports
* added tests for master file
* extra tests
* move the master fiel tests into its own tests with the disable marker for github tests
* refactoring
* python test
* more intuitive and doc
* release notes
* example for python
* back to before
* minor documentation fix and sending nports unnecessarily for getRxUDPPortDisableMetadata
* doc
* review fixes, 1. using std::array instead of vector, 2. moving udp_datastream command testing with different values into master attributes testing file because we test the master file
* minor
* review: update help
* progress printed before assigned
* try catch inside hdf5
* auto generated code for CLI and formatting
* missing packets should not be checked at github workflow level
* formatting
* improved python doc for udp_datastream help
* indent doc python done
This commit is contained in:
@@ -2426,82 +2426,6 @@ std::string Caller::dacname(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string Caller::datastream(int action) {
|
||||
|
||||
std::ostringstream os;
|
||||
// print help
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << R"V0G0N([left|right] [0, 1]
|
||||
[Eiger] Enables or disables data streaming from left or/and right side of detector for 10 GbE mode. 1 (enabled) by default. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
|
||||
// check if action and arguments are valid
|
||||
if (action == slsDetectorDefs::GET_ACTION) {
|
||||
if (1 && args.size() != 1) {
|
||||
throw RuntimeError("Wrong number of arguments for action GET");
|
||||
}
|
||||
|
||||
if (args.size() == 1) {
|
||||
try {
|
||||
StringTo<defs::portPosition>(args[0]);
|
||||
} catch (...) {
|
||||
throw RuntimeError(
|
||||
"Could not convert argument 0 to defs::portPosition");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (1 && args.size() != 2) {
|
||||
throw RuntimeError("Wrong number of arguments for action PUT");
|
||||
}
|
||||
|
||||
if (args.size() == 2) {
|
||||
try {
|
||||
StringTo<defs::portPosition>(args[0]);
|
||||
} catch (...) {
|
||||
throw RuntimeError(
|
||||
"Could not convert argument 0 to defs::portPosition");
|
||||
}
|
||||
try {
|
||||
StringTo<bool>(args[1]);
|
||||
} catch (...) {
|
||||
throw RuntimeError("Could not convert argument 1 to bool");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
throw RuntimeError("INTERNAL ERROR: Invalid action: supported actions "
|
||||
"are ['GET', 'PUT']");
|
||||
}
|
||||
|
||||
// generate code for each action
|
||||
if (action == slsDetectorDefs::GET_ACTION) {
|
||||
if (args.size() == 1) {
|
||||
auto arg0 = StringTo<defs::portPosition>(args[0]);
|
||||
auto t = det->getDataStream(arg0, std::vector<int>{det_id});
|
||||
os << OutString(t) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (args.size() == 2) {
|
||||
auto arg0 = StringTo<defs::portPosition>(args[0]);
|
||||
auto arg1 = StringTo<bool>(args[1]);
|
||||
det->setDataStream(arg0, arg1, std::vector<int>{det_id});
|
||||
os << ToString(args) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string Caller::dbitclk(int action) {
|
||||
|
||||
std::ostringstream os;
|
||||
@@ -7052,8 +6976,12 @@ std::string Caller::numinterfaces(int action) {
|
||||
|
||||
if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (args.size() == 1) {
|
||||
if (det_id != -1) {
|
||||
throw RuntimeError(
|
||||
"Cannot execute numinterfaces at module level");
|
||||
}
|
||||
auto arg0 = StringTo<int>(args[0]);
|
||||
det->setNumberofUDPInterfaces(arg0, std::vector<int>{det_id});
|
||||
det->setNumberofUDPInterfaces(arg0);
|
||||
os << args.front() << '\n';
|
||||
}
|
||||
}
|
||||
@@ -14985,6 +14913,83 @@ std::string Caller::udp_cleardst(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string Caller::udp_datastream(int action) {
|
||||
|
||||
std::ostringstream os;
|
||||
// print help
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << R"V0G0N([left|right|top|bottom] [0, 1]
|
||||
Enables or disables UDP data streaming from left or right of 10GbE UDP port of the detector. Options: left, right. Both ports are enabled (1) by default.
|
||||
Enables or disables UDP data streaming from the top or bottom of receiver. This option is available only when numinterfaces is set to 2. Options: top, bottom. Both interfaces are enabled (1) by default. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
|
||||
// check if action and arguments are valid
|
||||
if (action == slsDetectorDefs::GET_ACTION) {
|
||||
if (1 && args.size() != 1) {
|
||||
throw RuntimeError("Wrong number of arguments for action GET");
|
||||
}
|
||||
|
||||
if (args.size() == 1) {
|
||||
try {
|
||||
StringTo<defs::portPosition>(args[0]);
|
||||
} catch (...) {
|
||||
throw RuntimeError(
|
||||
"Could not convert argument 0 to defs::portPosition");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (1 && args.size() != 2) {
|
||||
throw RuntimeError("Wrong number of arguments for action PUT");
|
||||
}
|
||||
|
||||
if (args.size() == 2) {
|
||||
try {
|
||||
StringTo<defs::portPosition>(args[0]);
|
||||
} catch (...) {
|
||||
throw RuntimeError(
|
||||
"Could not convert argument 0 to defs::portPosition");
|
||||
}
|
||||
try {
|
||||
StringTo<bool>(args[1]);
|
||||
} catch (...) {
|
||||
throw RuntimeError("Could not convert argument 1 to bool");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
throw RuntimeError("INTERNAL ERROR: Invalid action: supported actions "
|
||||
"are ['GET', 'PUT']");
|
||||
}
|
||||
|
||||
// generate code for each action
|
||||
if (action == slsDetectorDefs::GET_ACTION) {
|
||||
if (args.size() == 1) {
|
||||
auto arg0 = StringTo<defs::portPosition>(args[0]);
|
||||
auto t = det->getUDPDataStream(arg0, std::vector<int>{det_id});
|
||||
os << OutString(t) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (args.size() == 2) {
|
||||
auto arg0 = StringTo<defs::portPosition>(args[0]);
|
||||
auto arg1 = StringTo<bool>(args[1]);
|
||||
det->setUDPDataStream(arg0, arg1, std::vector<int>{det_id});
|
||||
os << ToString(args) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string Caller::udp_dstlist(int action) {
|
||||
|
||||
std::ostringstream os;
|
||||
|
||||
Reference in New Issue
Block a user