mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
WIP
This commit is contained in:
parent
b90f9b046f
commit
c4c2866905
@ -757,17 +757,7 @@ Result<bool> Detector::getUseReceiverFlag(Positions pos) const {
|
||||
}
|
||||
|
||||
Result<std::string> Detector::getRxHostname(const int udpInterface, Positions pos) const {
|
||||
// switch (udpInterface) {
|
||||
// case 1:
|
||||
// return pimpl->Parallel1(&Receiver::getHostname, pos, {});
|
||||
// case 2:
|
||||
// return pimpl->Parallel2(&Receiver::getHostname, pos, {});
|
||||
// default:
|
||||
// throw RuntimeError("Invalid udp interface number " +
|
||||
// std::to_string(udpInterface));
|
||||
// }
|
||||
return pimpl->getHostname(pos, udpInterface);
|
||||
// return experimental::Parallel(&Receiver::getHostname, receivers, MaskGenerator(){receivers});
|
||||
return pimpl->getRxHostname(pos, udpInterface);
|
||||
}
|
||||
|
||||
void Detector::setRxHostname(const int udpInterface, const std::string &hostname, Positions pos) {
|
||||
@ -783,21 +773,14 @@ void Detector::setRxHostname(const int udpInterface, const std::string &hostname
|
||||
}
|
||||
|
||||
Result<int> Detector::getRxPort(const int udpInterface, Positions pos) const {
|
||||
switch (udpInterface) {
|
||||
case 1:
|
||||
return pimpl->Parallel1(&Receiver::getTCPPort, pos, {});
|
||||
case 2:
|
||||
return pimpl->Parallel2(&Receiver::getTCPPort, pos, {});
|
||||
default:
|
||||
throw RuntimeError("Invalid udp interface number " +
|
||||
std::to_string(udpInterface));
|
||||
}
|
||||
return pimpl->getRxPort(pos, udpInterface);
|
||||
}
|
||||
|
||||
void Detector::setRxPort(const int udpInterface, int port, int module_id) {
|
||||
if (!pimpl->isReceiverInitialized(udpInterface)) {
|
||||
pimpl->initReceiver(udpInterface);
|
||||
}
|
||||
// return pimpl->setRxPort();
|
||||
if (udpInterface == 1) {
|
||||
if (module_id == -1) {
|
||||
for (int idet = 0; idet < size(); ++idet) {
|
||||
|
@ -315,9 +315,12 @@ void DetectorImpl::setHostname(const std::vector<std::string> &name) {
|
||||
updateDetectorSize();
|
||||
}
|
||||
|
||||
Result<std::string> DetectorImpl::getHostname(Positions pos, int udp_interface){
|
||||
LOG(logWARNING) << ToString(pos) << ": " << udp_interface;
|
||||
return experimental::Parallel(&Receiver::getHostname, receivers, MaskGenerator(pos, udp_interface).mask(receivers));
|
||||
Result<std::string> DetectorImpl::getRxHostname(Positions pos, int udpInterface){
|
||||
return experimental::Parallel(&Receiver::getHostname, receivers, MaskGenerator(pos, udpInterface).mask(receivers));
|
||||
}
|
||||
|
||||
Result<int> DetectorImpl::getRxPort(Positions pos, int udpInterface){
|
||||
return experimental::Parallel(&Receiver::getTCPPort, receivers, MaskGenerator(pos, udpInterface).mask(receivers));
|
||||
}
|
||||
|
||||
void DetectorImpl::setHostname(const std::vector<std::string> &name,
|
||||
|
@ -304,7 +304,8 @@ class DetectorImpl : public virtual slsDetectorDefs {
|
||||
void setHostname(const std::vector<std::string> &name,
|
||||
const std::vector<int> &port);
|
||||
|
||||
Result<std::string> getHostname(Positions pos, int udp_interface);
|
||||
Result<std::string> getRxHostname(Positions pos, int udpInterface);
|
||||
Result<int> getRxPort(Positions pos, int udpInterface);
|
||||
|
||||
int getNumberofReceiversPerModule() const;
|
||||
void initReceiver(const int udpInterface);
|
||||
|
Loading…
x
Reference in New Issue
Block a user