zmq hwm are specified to 2 for gui and restreaming of receiver if all zmq not closed at end of acquiistion

This commit is contained in:
2020-10-08 13:01:01 +02:00
parent c9bba6fbdc
commit 6c1035aa99
21 changed files with 614 additions and 190 deletions

View File

@ -643,7 +643,7 @@ Result<int> Detector::getNumberofUDPInterfaces(Positions pos) const {
}
void Detector::setNumberofUDPInterfaces(int n, Positions pos) {
int previouslyClientStreaming = pimpl->getDataStreamingToClient();
bool previouslyClientStreaming = pimpl->getDataStreamingToClient();
bool useReceiver = getUseReceiverFlag().squash(false);
bool previouslyReceiverStreaming = false;
if (useReceiver) {
@ -656,7 +656,7 @@ void Detector::setNumberofUDPInterfaces(int n, Positions pos) {
setRxZmqPort(startingPort, -1);
}
// redo the zmq sockets if enabled
if (previouslyClientStreaming != 0) {
if (previouslyClientStreaming) {
pimpl->setDataStreamingToClient(false);
pimpl->setDataStreamingToClient(true);
}
@ -1077,7 +1077,7 @@ Result<int> Detector::getClientZmqPort(Positions pos) const {
}
void Detector::setClientZmqPort(int port, int module_id) {
int previouslyClientStreaming = pimpl->getDataStreamingToClient();
bool previouslyClientStreaming = pimpl->getDataStreamingToClient();
if (module_id == -1) {
std::vector<int> port_list = getPortNumbers(port);
for (int idet = 0; idet < size(); ++idet) {
@ -1087,7 +1087,7 @@ void Detector::setClientZmqPort(int port, int module_id) {
} else {
pimpl->Parallel(&Module::setClientStreamingPort, {module_id}, port);
}
if (previouslyClientStreaming != 0) {
if (previouslyClientStreaming) {
pimpl->setDataStreamingToClient(false);
pimpl->setDataStreamingToClient(true);
}
@ -1098,14 +1098,33 @@ Result<IpAddr> Detector::getClientZmqIp(Positions pos) const {
}
void Detector::setClientZmqIp(const IpAddr ip, Positions pos) {
int previouslyClientStreaming = pimpl->getDataStreamingToClient();
bool previouslyClientStreaming = pimpl->getDataStreamingToClient();
pimpl->Parallel(&Module::setClientStreamingIP, pos, ip);
if (previouslyClientStreaming != 0) {
if (previouslyClientStreaming) {
pimpl->setDataStreamingToClient(false);
pimpl->setDataStreamingToClient(true);
}
}
int Detector::getClientZmqHwm() const { return pimpl->getClientStreamingHwm(); }
void Detector::setClientZmqHwm(const int limit) {
pimpl->setClientStreamingHwm(limit);
}
Result<int> Detector::getRxZmqHwm(Positions pos) const {
return pimpl->Parallel(&Module::getReceiverStreamingHwm, pos);
}
void Detector::setRxZmqHwm(const int limit) {
bool previouslyReceiverStreaming = getRxZmqDataStream().squash(false);
pimpl->Parallel(&Module::setReceiverStreamingHwm, {}, limit);
if (previouslyReceiverStreaming) {
setRxZmqDataStream(false, {});
setRxZmqDataStream(true, {});
}
}
// Eiger Specific
Result<ns> Detector::getSubExptime(Positions pos) const {