rx_zmqstartfnum, not tested

This commit is contained in:
2020-07-16 12:18:18 +02:00
parent ca298580f3
commit 67bb0dff1a
12 changed files with 94 additions and 6 deletions

View File

@ -807,6 +807,7 @@ class CmdProxy {
/* ZMQ Streaming Parameters (Receiver<->Client) */
{"rx_datastream", &CmdProxy::rx_datastream},
{"rx_readfreq", &CmdProxy::rx_readfreq},
{"rx_zmqstartfnum", &CmdProxy::rx_zmqstartfnum},
{"rx_zmqport", &CmdProxy::rx_zmqport},
{"zmqport", &CmdProxy::zmqport},
{"rx_zmqip", &CmdProxy::rx_zmqip},
@ -1784,6 +1785,10 @@ class CmdProxy {
"[nth frame]\n\tStream out every nth frame. Default is 1. 0 means "
"streaming every 200 ms and discarding frames in this interval.");
INTEGER_COMMAND(
rx_zmqstartfnum, getRxZmqStartingFrame, setRxZmqStartingFrame, StringTo<int>,
"[fnum]\n\tThe starting frame index to stream out. 0 by default, which streams the first frame in an acquisition, and then depending on the rx zmq frequency/ timer");
INTEGER_COMMAND(
rx_zmqport, getRxZmqPort, setRxZmqPort, StringTo<int>,
"[port]\n\tZmq port for data to be streamed out of the receiver. Also "

View File

@ -954,6 +954,14 @@ void Detector::setRxZmqTimer(int time_in_ms, Positions pos) {
pimpl->Parallel(&Module::setReceiverStreamingTimer, pos, time_in_ms);
}
Result<int> Detector::getRxZmqStartingFrame(Positions pos) const {
return pimpl->Parallel(&Module::getReceiverStreamingStartingFrame, pos);
}
void Detector::setRxZmqStartingFrame(int fnum, Positions pos) {
pimpl->Parallel(&Module::setReceiverStreamingStartingFrame, pos, fnum);
}
Result<int> Detector::getRxZmqPort(Positions pos) const {
return pimpl->Parallel(&Module::getReceiverStreamingPort, pos);
}

View File

@ -967,6 +967,18 @@ void Module::setReceiverStreamingTimer(int time_in_ms) {
sendToReceiver<int>(F_RECEIVER_STREAMING_TIMER, time_in_ms);
}
int Module::getReceiverStreamingStartingFrame() {
return sendToReceiver<int>(F_GET_RECEIVER_STREAMING_START_FNUM);
}
void Module::setReceiverStreamingStartingFrame(int fnum) {
if (fnum < 0) {
throw RuntimeError("Invalid streaming starting frame number " +
std::to_string(fnum));
}
sendToReceiver(F_SET_RECEIVER_STREAMING_START_FNUM, fnum, nullptr);
}
int Module::getReceiverStreamingPort() {
return sendToReceiver<int>(F_GET_RECEIVER_STREAMING_PORT);
}

View File

@ -274,6 +274,8 @@ class Module : public virtual slsDetectorDefs {
void setReceiverStreamingFrequency(int freq);
int getReceiverStreamingTimer();
void setReceiverStreamingTimer(int time_in_ms = 200);
int getReceiverStreamingStartingFrame();
void setReceiverStreamingStartingFrame(int fnum);
int getReceiverStreamingPort();
void setReceiverStreamingPort(int port);
sls::IpAddr getReceiverStreamingIP();