mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-06 04:40:02 +02:00
fix zmqport and rx_zmqport, must restart zmq streaming
This commit is contained in:
parent
3b619f4488
commit
688fe4e3f7
@ -1042,6 +1042,8 @@ Result<int> Detector::getRxZmqPort(Positions pos) const {
|
||||
}
|
||||
|
||||
void Detector::setRxZmqPort(int port, int module_id) {
|
||||
bool previouslyReceiverStreaming =
|
||||
getRxZmqDataStream(std::vector<int>{module_id}).squash(false);
|
||||
if (module_id == -1) {
|
||||
std::vector<int> port_list = getPortNumbers(port);
|
||||
for (int idet = 0; idet < size(); ++idet) {
|
||||
@ -1051,6 +1053,10 @@ void Detector::setRxZmqPort(int port, int module_id) {
|
||||
} else {
|
||||
pimpl->Parallel(&Module::setReceiverStreamingPort, {module_id}, port);
|
||||
}
|
||||
if (previouslyReceiverStreaming) {
|
||||
setRxZmqDataStream(false, std::vector<int>{module_id});
|
||||
setRxZmqDataStream(true, std::vector<int>{module_id});
|
||||
}
|
||||
}
|
||||
|
||||
Result<IpAddr> Detector::getRxZmqIP(Positions pos) const {
|
||||
@ -1071,6 +1077,7 @@ Result<int> Detector::getClientZmqPort(Positions pos) const {
|
||||
}
|
||||
|
||||
void Detector::setClientZmqPort(int port, int module_id) {
|
||||
int previouslyClientStreaming = pimpl->getDataStreamingToClient();
|
||||
if (module_id == -1) {
|
||||
std::vector<int> port_list = getPortNumbers(port);
|
||||
for (int idet = 0; idet < size(); ++idet) {
|
||||
@ -1080,6 +1087,10 @@ void Detector::setClientZmqPort(int port, int module_id) {
|
||||
} else {
|
||||
pimpl->Parallel(&Module::setClientStreamingPort, {module_id}, port);
|
||||
}
|
||||
if (previouslyClientStreaming != 0) {
|
||||
pimpl->setDataStreamingToClient(false);
|
||||
pimpl->setDataStreamingToClient(true);
|
||||
}
|
||||
}
|
||||
|
||||
Result<IpAddr> Detector::getClientZmqIp(Positions pos) const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user