mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-08-06 23:52:28 +02:00
Add rx_streamdummyheader command (#1442)
* add rx_restream_stop command. This allows to send a ZMQ dummy header any time user wants to do so. For example this allows to pre-configure the ZMQ processing software before the acquisition begins. Therefore, the dummy header was adapted in order to contain the fields stored in the receiver.
* renamed command, changed inherit, moved commands to zmq related section
* update filename in restreamstop
* renamed helper function, sorted header fields alphabetically
* fixed fnametostream set
* renamed functions, add SetFileName method, format JSON parameters order
* added python bindings and formatting (does nothing really)
* renamed restream stop functions to stream dummy
* checkout .github files from ed8c885
* release notes
---------
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
This commit is contained in:
@@ -11574,6 +11574,45 @@ std::string Caller::rx_stop(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string Caller::rx_streamdummyheader(int action) {
|
||||
|
||||
std::ostringstream os;
|
||||
// print help
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << R"V0G0N(
|
||||
Sends ZMQ dummy header. The detector related fields are not set, the receiver related fields are set. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
|
||||
// check if action and arguments are valid
|
||||
if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (1 && args.size() != 0) {
|
||||
throw RuntimeError("Wrong number of arguments for action PUT");
|
||||
}
|
||||
|
||||
if (args.size() == 0) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
throw RuntimeError(
|
||||
"INTERNAL ERROR: Invalid action: supported actions are ['PUT']");
|
||||
}
|
||||
|
||||
// generate code for each action
|
||||
if (action == slsDetectorDefs::PUT_ACTION) {
|
||||
if (args.size() == 0) {
|
||||
det->streamRxDummyHeader(std::vector<int>{det_id});
|
||||
os << "successful" << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string Caller::rx_tcpport(int action) {
|
||||
|
||||
std::ostringstream os;
|
||||
|
||||
Reference in New Issue
Block a user