diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index 2e169f8e9..15d241578 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1795,11 +1795,6 @@ class Detector { std::vector getPortNumbers(int start_port); void updateRxRateCorrections(); void setNumberofUDPInterfaces_(int n, Positions pos); - Result getNumberofUDPInterfaces_(Positions pos) const; - Result getDefaultDac_(defs::dacIndex index, - defs::detectorSettings sett, Positions pos = {}); - void setDefaultDac_(defs::dacIndex index, int defaultValue, - defs::detectorSettings sett, Positions pos = {}); }; } // namespace sls diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index db8c4b7b7..7b397efa7 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -621,12 +621,12 @@ std::vector Detector::getDacList() const { } Result Detector::getDefaultDac(defs::dacIndex index, Positions pos) { - return getDefaultDac_(index, defs::UNDEFINED, pos); + return pimpl->getDefaultDac(index, defs::UNDEFINED, pos); } void Detector::setDefaultDac(defs::dacIndex index, int defaultValue, Positions pos) { - setDefaultDac_(index, defaultValue, defs::UNDEFINED, pos); + pimpl->setDefaultDac(index, defaultValue, defs::UNDEFINED, pos); } Result Detector::getDefaultDac(defs::dacIndex index, @@ -635,7 +635,7 @@ Result Detector::getDefaultDac(defs::dacIndex index, if (sett == defs::UNDEFINED) { throw RuntimeError("Invalid settings given for default dac"); } - return getDefaultDac_(index, sett, pos); + return pimpl->getDefaultDac(index, sett, pos); } void Detector::setDefaultDac(defs::dacIndex index, int defaultValue, @@ -643,19 +643,12 @@ void Detector::setDefaultDac(defs::dacIndex index, int defaultValue, if (sett == defs::UNDEFINED) { throw RuntimeError("Invalid settings given for default dac"); } - setDefaultDac_(index, defaultValue, sett, pos); + pimpl->setDefaultDac(index, defaultValue, sett, pos); } -Result Detector::getDefaultDac_(defs::dacIndex index, - defs::detectorSettings sett, - Positions pos) { - return pimpl->Parallel(&Module::getDefaultDac, pos, index, sett); -} -void Detector::setDefaultDac_(defs::dacIndex index, int defaultValue, - defs::detectorSettings sett, Positions pos) { - pimpl->Parallel(&Module::setDefaultDac, pos, index, defaultValue, sett); -} + + void Detector::resetToDefaultDacs(const bool hardReset, Positions pos) { pimpl->Parallel(&Module::resetToDefaultDacs, pos, hardReset); @@ -790,7 +783,7 @@ Result Detector::getNumberofUDPInterfaces(Positions pos) const { "Cannot set number of udp interfaces for this detector."); } // also called by vetostream (for gotthard2) - return getNumberofUDPInterfaces_(pos); + return pimpl->getNumberofUDPInterfaces(pos); } void Detector::setNumberofUDPInterfaces(int n, Positions pos) { @@ -802,10 +795,6 @@ void Detector::setNumberofUDPInterfaces(int n, Positions pos) { setNumberofUDPInterfaces_(n, pos); } -Result Detector::getNumberofUDPInterfaces_(Positions pos) const { - return pimpl->Parallel(&Module::getNumberofUDPInterfaces, pos); -} - void Detector::setNumberofUDPInterfaces_(int n, Positions pos) { bool previouslyClientStreaming = pimpl->getDataStreamingToClient(); bool useReceiver = getUseReceiverFlag().squash(false); @@ -1621,7 +1610,7 @@ Result Detector::getVetoStream(Positions pos) const { // 3gbe auto r3 = pimpl->Parallel(&Module::getVetoStream, pos); // 10gbe (debugging interface) opens 2nd udp interface in receiver - auto r10 = getNumberofUDPInterfaces_(pos); + auto r10 = pimpl->getNumberofUDPInterfaces(pos); Result res(r3.size()); for (unsigned int i = 0; i < res.size(); ++i) { @@ -1641,7 +1630,7 @@ void Detector::setVetoStream(defs::ethernetInterface interface, Positions pos) { pimpl->Parallel(&Module::setVetoStream, pos, i3gbe); // 10gbe (debugging interface) opens 2nd udp interface in receiver - int old_numinterfaces = getNumberofUDPInterfaces_(pos).tsquash( + int old_numinterfaces = pimpl->getNumberofUDPInterfaces(pos).tsquash( "retrieved inconsistent number of udp interfaces"); int numinterfaces = (((interface & defs::ethernetInterface::I10GBE) == defs::ethernetInterface::I10GBE) @@ -2206,7 +2195,7 @@ std::vector Detector::getPortNumbers(int start_port) { break; case defs::JUNGFRAU: case defs::GOTTHARD2: - if (getNumberofUDPInterfaces_({}).squash() == 2) { + if (pimpl->getNumberofUDPInterfaces({}).squash() == 2) { num_sockets_per_detector *= 2; } break; diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 188b53167..e6af420f1 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1369,4 +1369,19 @@ std::vector DetectorImpl::readProgrammingFile(const std::string &fname) { return buffer; } +sls::Result DetectorImpl::getNumberofUDPInterfaces(Positions pos) const { + return Parallel(&Module::getNumberofUDPInterfaces, pos); +} + +sls::Result DetectorImpl::getDefaultDac(defs::dacIndex index, + defs::detectorSettings sett, + Positions pos) { + return Parallel(&Module::getDefaultDac, pos, index, sett); +} + +void DetectorImpl::setDefaultDac(defs::dacIndex index, int defaultValue, + defs::detectorSettings sett, Positions pos) { + Parallel(&Module::setDefaultDac, pos, index, defaultValue, sett); +} + } // namespace sls \ No newline at end of file diff --git a/slsDetectorSoftware/src/DetectorImpl.h b/slsDetectorSoftware/src/DetectorImpl.h index fa34c5ca1..8dd8f519b 100644 --- a/slsDetectorSoftware/src/DetectorImpl.h +++ b/slsDetectorSoftware/src/DetectorImpl.h @@ -291,6 +291,14 @@ class DetectorImpl : public virtual slsDetectorDefs { */ std::vector readProgrammingFile(const std::string &fname); + sls::Result getNumberofUDPInterfaces(Positions pos) const; + void setNumberofUDPInterfaces(int n, Positions pos); + sls::Result getDefaultDac(defs::dacIndex index, + defs::detectorSettings sett, + Positions pos = {}); + void setDefaultDac(defs::dacIndex index, int defaultValue, + defs::detectorSettings sett, Positions pos); + private: /** * Creates/open shared memory, initializes detector structure and members