mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-30 18:00:05 +02:00
WIP, temp fix
This commit is contained in:
parent
c408f9807a
commit
b4c31327d6
@ -747,8 +747,7 @@ Result<std::string> Detector::getRxHostname(const int udpInterface, Positions po
|
||||
}
|
||||
|
||||
void Detector::setRxHostname(const int udpInterface, const std::string &hostname, Positions pos) {
|
||||
int port = 0;
|
||||
pimpl->configureReceiver(udpInterface, pos, hostname, port);
|
||||
pimpl->configureReceiver(udpInterface, pos, hostname);
|
||||
}
|
||||
|
||||
void Detector::setRxHostname(const int udpInterface, const std::string &hostname, const int port,
|
||||
@ -756,7 +755,7 @@ void Detector::setRxHostname(const int udpInterface, const std::string &hostname
|
||||
if (module_id == -1 && size() > 1) {
|
||||
throw sls::RuntimeError("Cannot set same rx_tcpport and rx_hostname for multiple receivers");
|
||||
}
|
||||
pimpl->configureReceiver(udpInterface, {module_id}, hostname, port);
|
||||
pimpl->configureReceiver(udpInterface, module_id, hostname, port);
|
||||
}
|
||||
|
||||
Result<int> Detector::getRxPort(const int udpInterface, Positions pos) const {
|
||||
|
@ -438,7 +438,7 @@ void DetectorImpl::removeReceivers(const int udpInterface) {
|
||||
}
|
||||
|
||||
void DetectorImpl::configureReceiver(const int udpInterface, Positions pos,
|
||||
const std::string &hostname, const int port) {
|
||||
const std::string &hostname) {
|
||||
|
||||
if (Parallel(&Module::getRunStatus, pos).squash(defs::ERROR) == defs::RUNNING) {
|
||||
LOG(logWARNING) << "Acquisition already running, Stopping it.";
|
||||
@ -447,25 +447,50 @@ void DetectorImpl::configureReceiver(const int udpInterface, Positions pos,
|
||||
if (!isReceiverInitialized(udpInterface)) {
|
||||
initReceiver(udpInterface);
|
||||
}
|
||||
auto t = Parallel(&Module::getReceiverParameters, pos);
|
||||
if (udpInterface == 1) {
|
||||
if (port != 0) {
|
||||
Parallel1(&Receiver::setTCPPort, pos, {}, port);
|
||||
}
|
||||
Parallel1(&Receiver::setHostname, pos, {}, hostname);
|
||||
auto t = Parallel(&Module::getReceiverParameters, pos).squash();
|
||||
auto m = Parallel1(&Receiver::configure, pos, {}, t).squash();
|
||||
if (m != 0) {
|
||||
Parallel(&Module::setDestinationUDPMAC, pos, m);
|
||||
for (int iMod = 0; iMod < size(); ++iMod) {
|
||||
auto m = receivers[iMod][0]->configure(t[iMod]);
|
||||
if (m != 0) {
|
||||
detectors[iMod]->setDestinationUDPMAC(m);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (port != 0) {
|
||||
Parallel2(&Receiver::setTCPPort, pos, {}, port);
|
||||
}
|
||||
Parallel2(&Receiver::setHostname, pos, {}, hostname);
|
||||
auto t = Parallel(&Module::getReceiverParameters, pos).squash();
|
||||
auto m = Parallel2(&Receiver::configure, pos, {}, t).squash();
|
||||
for (int iMod = 0; iMod < size(); ++iMod) {
|
||||
auto m = receivers2[iMod][0]->configure(t[iMod]);
|
||||
if (m != 0) {
|
||||
detectors[iMod]->setDestinationUDPMAC2(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DetectorImpl::configureReceiver(const int udpInterface, int module_id,
|
||||
const std::string &hostname, const int port) {
|
||||
|
||||
if (Parallel(&Module::getRunStatus, {}).squash(defs::ERROR) == defs::RUNNING) {
|
||||
LOG(logWARNING) << "Acquisition already running, Stopping it.";
|
||||
Parallel(&Module::stopAcquisition, {});
|
||||
}
|
||||
if (!isReceiverInitialized(udpInterface)) {
|
||||
initReceiver(udpInterface);
|
||||
}
|
||||
auto t = detectors[module_id]->getReceiverParameters();
|
||||
if (udpInterface == 1) {
|
||||
receivers[module_id][0]->setTCPPort(port);
|
||||
receivers[module_id][0]->setHostname(hostname);
|
||||
auto m = receivers[module_id][0]->configure(t);
|
||||
if (m != 0) {
|
||||
Parallel(&Module::setDestinationUDPMAC2, pos, m);
|
||||
detectors[module_id]->setDestinationUDPMAC(m);
|
||||
}
|
||||
} else {
|
||||
receivers2[module_id][0]->setTCPPort(port);
|
||||
receivers2[module_id][0]->setHostname(hostname);
|
||||
auto m = receivers2[module_id][0]->configure(t);
|
||||
if (m != 0) {
|
||||
detectors[module_id]->setDestinationUDPMAC2(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -664,6 +664,8 @@ class DetectorImpl : public virtual slsDetectorDefs {
|
||||
bool isReceiverInitialized(const int udpInterface);
|
||||
void removeReceivers(const int udpInterface);
|
||||
void configureReceiver(const int udpInterface, Positions pos,
|
||||
const std::string &hostname);
|
||||
void configureReceiver(const int udpInterface, int module_id,
|
||||
const std::string &hostname, const int port);
|
||||
|
||||
/** Gets the total number of detectors */
|
||||
|
Loading…
x
Reference in New Issue
Block a user