From e6349d0312f4a5c3be29322590548296eb89b4a4 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Thu, 8 Aug 2019 15:51:21 +0200 Subject: [PATCH] WIP --- slsDetectorSoftware/include/Detector.h | 21 ++++++++++++++ .../include/multiSlsDetector.h | 8 +++--- slsDetectorSoftware/src/Detector.cpp | 28 ++++++++++++++++++- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 306c7de47..4b6c3de06 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -429,6 +429,27 @@ class Detector { // void exitReceiver(int detPos = -1); Result getReceiverLastClientIP(Positions pos = {}) const; + + void setReceiverLock(bool value, Positions pos = {}); + + Result getReceiverLock(Positions pos = {}); + + /** true when receiver is used otherwise false */ + Result getUseReceiverFlag(Positions pos = {}) const; + + void printReceiverConfiguration(Positions pos = {}) const; + + + /** [Eiger] + * @returns deadtime in ns, 0 = disabled + */ + Result getRateCorrection(Positions pos = {}) const; + + /** + * [Eiger] Set Rate correction + * 0 disable correction, <0 set to default, >0 deadtime in ns + */ + void setRateCorrection(int64_t dead_time_ns, Positions pos = {}); }; } // namespace sls \ No newline at end of file diff --git a/slsDetectorSoftware/include/multiSlsDetector.h b/slsDetectorSoftware/include/multiSlsDetector.h index c6376bffb..e4ffe42fb 100755 --- a/slsDetectorSoftware/include/multiSlsDetector.h +++ b/slsDetectorSoftware/include/multiSlsDetector.h @@ -1758,14 +1758,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @param level print level * @param detPos -1 for all detectors in list or specific detector position */ - void printReceiverConfiguration(TLogLevel level = logINFO, int detPos = -1); + void printReceiverConfiguration(TLogLevel level = logINFO, int detPos = -1); // /** * Get receiver online status * @param detPos -1 for all detectors in list or specific detector position * @returns use receiver flag */ - bool getUseReceiverFlag(int detPos = -1); + bool getUseReceiverFlag(int detPos = -1); // /** * Checks if the receiver is really online @@ -1773,7 +1773,7 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @returns empty string if all online, else concatenates hostnames of all * detectors that are offline */ - std::string checkReceiverOnline(int detPos = -1); + std::string checkReceiverOnline(int detPos = -1); //not needed /** * Locks/Unlocks the connection to the receiver @@ -1781,7 +1781,7 @@ class multiSlsDetector : public virtual slsDetectorDefs { * @param detPos -1 for all detectors in list or specific detector position * @returns lock status of the receiver */ - int lockReceiver(int lock = -1, int detPos = -1); + int lockReceiver(int lock = -1, int detPos = -1); // /** * Returns the IP of the last client connecting to the receiver diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 3904eccaf..82d5e0bef 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1,5 +1,6 @@ #include "Detector.h" #include "container_utils.h" +#include "logger.h" #include "multiSlsDetector.h" #include "slsDetector.h" #include "sls_detector_defs.h" @@ -379,8 +380,33 @@ Result Detector::getFramesPerFile(Positions pos) const { return pimpl->Parallel(&slsDetector::getFramesPerFile, pos); } -Result Detector::getReceiverLastClientIP(Positions pos) const{ +Result Detector::getReceiverLastClientIP(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverLastClientIP, pos); } +void Detector::setReceiverLock(bool value, Positions pos) { + pimpl->Parallel(&slsDetector::lockReceiver, pos, static_cast(value)); +} + +Result Detector::getReceiverLock(Positions pos) { + return pimpl->Parallel(&slsDetector::lockReceiver, pos, -1); +} + +Result Detector::getUseReceiverFlag(Positions pos) const { + return pimpl->Parallel(&slsDetector::getUseReceiverFlag, pos); +} + +void Detector::printReceiverConfiguration(Positions pos) const { + pimpl->Parallel(&slsDetector::printReceiverConfiguration, pos, + TLogLevel::logINFO); +} + +Result Detector::getRateCorrection(Positions pos) const { + return pimpl->Parallel(&slsDetector::getRateCorrection, pos); +} + +void Detector::setRateCorrection(int64_t dead_time_ns, Positions pos) { + pimpl->Parallel(&slsDetector::setRateCorrection, pos, dead_time_ns); +} + } // namespace sls \ No newline at end of file