From 5784ce82315be1047f3ceb52f70677b097684746 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Wed, 11 Mar 2020 16:16:15 +0100 Subject: [PATCH] slsDetector -> Module --- .../test-integrationDectector.cpp | 28 +- slsDetectorSoftware/CMakeLists.txt | 2 +- slsDetectorSoftware/src/Detector.cpp | 668 ++++++++--------- slsDetectorSoftware/src/DetectorImpl.cpp | 48 +- slsDetectorSoftware/src/DetectorImpl.h | 17 +- .../src/{slsDetector.cpp => Module.cpp} | 680 +++++++++--------- .../src/{slsDetector.h => Module.h} | 16 +- 7 files changed, 734 insertions(+), 725 deletions(-) rename slsDetectorSoftware/src/{slsDetector.cpp => Module.cpp} (86%) rename slsDetectorSoftware/src/{slsDetector.h => Module.h} (99%) diff --git a/integrationTests/test-integrationDectector.cpp b/integrationTests/test-integrationDectector.cpp index ec63afab1..9453e3e3e 100755 --- a/integrationTests/test-integrationDectector.cpp +++ b/integrationTests/test-integrationDectector.cpp @@ -4,7 +4,7 @@ #include "ClientSocket.h" #include "logger.h" #include "DetectorImpl.h" -#include "slsDetector.h" +#include "Module.h" #include "sls_detector_defs.h" #include "Timer.h" @@ -23,10 +23,10 @@ // extern dt type; TEST_CASE("Single detector no receiver", "[.integration][.single]") { - auto t = slsDetector::getTypeFromDetector(test::hostname); + auto t = Module::getTypeFromDetector(test::hostname); CHECK(t == test::type); - slsDetector d(t); + Module d(t); CHECK(d.getDetectorTypeAsEnum() == t); CHECK(d.getDetectorTypeAsString() == test::detector_type); @@ -51,7 +51,7 @@ TEST_CASE("Set control port then create a new object with this control port", int new_cport = 1993; int new_sport = 2000; { - slsDetector d(test::type); + Module d(test::type); d.setHostname(test::hostname); CHECK(d.getControlPort() == old_cport); d.setControlPort(new_cport); @@ -60,7 +60,7 @@ TEST_CASE("Set control port then create a new object with this control port", d.freeSharedMemory(); } { - slsDetector d(test::type); + Module d(test::type); d.setHostname(test::hostname); d.setControlPort(new_cport); d.setStopPort(new_sport); @@ -73,7 +73,7 @@ TEST_CASE("Set control port then create a new object with this control port", d.freeSharedMemory(); } - slsDetector d(test::type); + Module d(test::type); d.setHostname(test::hostname); CHECK(d.getStopPort() == DEFAULT_PORTNO + 1); d.freeSharedMemory(); @@ -86,11 +86,11 @@ TEST_CASE("single EIGER detector no receiver basic set and get", SingleDetectorConfig c; // Read type by connecting to the detector - auto type = slsDetector::getTypeFromDetector(c.hostname); + auto type = Module::getTypeFromDetector(c.hostname); CHECK(type == c.type_enum); - // Create slsDetector of said type and set hostname and detector online - slsDetector d(type); + // Create Module of said type and set hostname and detector online + Module d(type); CHECK(d.getDetectorTypeAsEnum() == type); CHECK(d.getDetectorTypeAsString() == c.type_string); @@ -133,7 +133,7 @@ TEST_CASE("single EIGER detector no receiver basic set and get", TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") { - slsDetector d(test::type); + Module d(test::type); d.setHostname(test::hostname); // Check that detector server is unlocked then lock @@ -155,7 +155,7 @@ TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") { } TEST_CASE("Set settings", "[.integration][.single]"){ - slsDetector d(test::type); + Module d(test::type); d.setHostname(test::hostname); CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD); } @@ -185,7 +185,7 @@ TEST_CASE("Timer functions", "[.integration][cli]") { // MEASURED_SUBPERIOD, /**< measured subperiod */ // MAX_TIMERS - slsDetector d(test::type); + Module d(test::type); d.setHostname(test::hostname); // Number of frames @@ -226,8 +226,8 @@ TEST_CASE("Timer functions", "[.integration][cli]") { // TEST_CASE("Aquire", "[.integration][eiger]"){ // SingleDetectorConfig c; -// auto type = slsDetector::getTypeFromDetector(c.hostname); -// slsDetector d(type); +// auto type = Module::getTypeFromDetector(c.hostname); +// Module d(type); // d.setHostname(c.hostname); // auto period = 1000000000; diff --git a/slsDetectorSoftware/CMakeLists.txt b/slsDetectorSoftware/CMakeLists.txt index a5183ef79..945c0319c 100755 --- a/slsDetectorSoftware/CMakeLists.txt +++ b/slsDetectorSoftware/CMakeLists.txt @@ -1,7 +1,7 @@ set(SOURCES src/DetectorImpl.cpp src/slsDetectorUsers.cpp - src/slsDetector.cpp + src/Module.cpp src/Detector.cpp src/CmdProxy.cpp src/CmdParser.cpp diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 78a7de660..8c09b2546 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -5,7 +5,7 @@ #include "detectorData.h" #include "logger.h" #include "DetectorImpl.h" -#include "slsDetector.h" +#include "Module.h" #include "sls_detector_defs.h" #include @@ -83,7 +83,7 @@ void Detector::loadParameters(const std::string &fname) { } Result Detector::getHostname(Positions pos) const { - return pimpl->Parallel(&slsDetector::getHostname, pos); + return pimpl->Parallel(&Module::getHostname, pos); } void Detector::setHostname(const std::vector &hostname) { @@ -105,23 +105,23 @@ int64_t Detector::getClientVersion() const { } Result Detector::getFirmwareVersion(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFirmwareVersion, pos); + return pimpl->Parallel(&Module::getFirmwareVersion, pos); } Result Detector::getDetectorServerVersion(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDetectorServerVersion, pos); + return pimpl->Parallel(&Module::getDetectorServerVersion, pos); } Result Detector::getSerialNumber(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSerialNumber, pos); + return pimpl->Parallel(&Module::getSerialNumber, pos); } Result Detector::getReceiverVersion(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverSoftwareVersion, pos); + return pimpl->Parallel(&Module::getReceiverSoftwareVersion, pos); } Result Detector::getDetectorType(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDetectorType, pos); + return pimpl->Parallel(&Module::getDetectorType, pos); } int Detector::size() const { return pimpl->size(); } @@ -133,7 +133,7 @@ defs::xy Detector::getModuleGeometry() const { } Result Detector::getModuleSize(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfChannels, pos); + return pimpl->Parallel(&Module::getNumberOfChannels, pos); } defs::xy Detector::getDetectorSize() const { @@ -145,11 +145,11 @@ void Detector::setDetectorSize(const defs::xy value) { } Result Detector::getSettings(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSettings, pos); + return pimpl->Parallel(&Module::getSettings, pos); } void Detector::setSettings(const defs::detectorSettings value, Positions pos) { - pimpl->Parallel(&slsDetector::setSettings, pos, value); + pimpl->Parallel(&Module::setSettings, pos, value); } // Callback @@ -169,73 +169,73 @@ void Detector::registerDataCallback(void (*func)(detectorData *, uint64_t, // Acquisition Parameters Result Detector::getNumberOfFrames(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfFrames, pos); + return pimpl->Parallel(&Module::getNumberOfFrames, pos); } void Detector::setNumberOfFrames(int64_t value) { - pimpl->Parallel(&slsDetector::setNumberOfFrames, {}, value); + pimpl->Parallel(&Module::setNumberOfFrames, {}, value); } Result Detector::getNumberOfTriggers(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfTriggers, pos); + return pimpl->Parallel(&Module::getNumberOfTriggers, pos); } void Detector::setNumberOfTriggers(int64_t value) { - pimpl->Parallel(&slsDetector::setNumberOfTriggers, {}, value); + pimpl->Parallel(&Module::setNumberOfTriggers, {}, value); } Result Detector::getExptime(Positions pos) const { - return pimpl->Parallel(&slsDetector::getExptime, pos); + return pimpl->Parallel(&Module::getExptime, pos); } void Detector::setExptime(ns t, Positions pos) { - pimpl->Parallel(&slsDetector::setExptime, pos, t.count()); + pimpl->Parallel(&Module::setExptime, pos, t.count()); } Result Detector::getPeriod(Positions pos) const { - return pimpl->Parallel(&slsDetector::getPeriod, pos); + return pimpl->Parallel(&Module::getPeriod, pos); } void Detector::setPeriod(ns t, Positions pos) { - pimpl->Parallel(&slsDetector::setPeriod, pos, t.count()); + pimpl->Parallel(&Module::setPeriod, pos, t.count()); } Result Detector::getDelayAfterTrigger(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDelayAfterTrigger, pos); + return pimpl->Parallel(&Module::getDelayAfterTrigger, pos); } void Detector::setDelayAfterTrigger(ns value, Positions pos) { - pimpl->Parallel(&slsDetector::setDelayAfterTrigger, pos, value.count()); + pimpl->Parallel(&Module::setDelayAfterTrigger, pos, value.count()); } Result Detector::getNumberOfFramesLeft(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfFramesLeft, pos); + return pimpl->Parallel(&Module::getNumberOfFramesLeft, pos); } Result Detector::getNumberOfTriggersLeft(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfTriggersLeft, pos); + return pimpl->Parallel(&Module::getNumberOfTriggersLeft, pos); } Result Detector::getDelayAfterTriggerLeft(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDelayAfterTriggerLeft, pos); + return pimpl->Parallel(&Module::getDelayAfterTriggerLeft, pos); } Result Detector::getPeriodLeft(Positions pos) const { - return pimpl->Parallel(&slsDetector::getPeriodLeft, pos); + return pimpl->Parallel(&Module::getPeriodLeft, pos); } Result Detector::getTimingMode(Positions pos) const { - return pimpl->Parallel(&slsDetector::setTimingMode, pos, + return pimpl->Parallel(&Module::setTimingMode, pos, defs::GET_TIMING_MODE); } void Detector::setTimingMode(defs::timingMode value, Positions pos) { - pimpl->Parallel(&slsDetector::setTimingMode, pos, value); + pimpl->Parallel(&Module::setTimingMode, pos, value); } Result Detector::getSpeed(Positions pos) const { auto res = - pimpl->Parallel(&slsDetector::getClockDivider, pos, defs::RUN_CLOCK); + pimpl->Parallel(&Module::getClockDivider, pos, defs::RUN_CLOCK); Result speedResult(res.size()); for (unsigned int i = 0; i < res.size(); ++i) { speedResult[i] = static_cast(res[i]); @@ -244,117 +244,117 @@ Result Detector::getSpeed(Positions pos) const { } void Detector::setSpeed(defs::speedLevel value, Positions pos) { - pimpl->Parallel(&slsDetector::setClockDivider, pos, defs::RUN_CLOCK, + pimpl->Parallel(&Module::setClockDivider, pos, defs::RUN_CLOCK, static_cast(value)); } Result Detector::getADCPhase(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClockPhase, pos, defs::ADC_CLOCK, + return pimpl->Parallel(&Module::getClockPhase, pos, defs::ADC_CLOCK, false); } void Detector::setADCPhase(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setClockPhase, pos, defs::ADC_CLOCK, value, + pimpl->Parallel(&Module::setClockPhase, pos, defs::ADC_CLOCK, value, false); } Result Detector::getMaxADCPhaseShift(Positions pos) const { - return pimpl->Parallel(&slsDetector::getMaxClockPhaseShift, pos, + return pimpl->Parallel(&Module::getMaxClockPhaseShift, pos, defs::ADC_CLOCK); } Result Detector::getADCPhaseInDegrees(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClockPhase, pos, defs::ADC_CLOCK, + return pimpl->Parallel(&Module::getClockPhase, pos, defs::ADC_CLOCK, true); } void Detector::setADCPhaseInDegrees(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setClockPhase, pos, defs::ADC_CLOCK, value, + pimpl->Parallel(&Module::setClockPhase, pos, defs::ADC_CLOCK, value, true); } Result Detector::getDBITPhase(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClockPhase, pos, defs::DBIT_CLOCK, + return pimpl->Parallel(&Module::getClockPhase, pos, defs::DBIT_CLOCK, false); } void Detector::setDBITPhase(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setClockPhase, pos, defs::DBIT_CLOCK, value, + pimpl->Parallel(&Module::setClockPhase, pos, defs::DBIT_CLOCK, value, false); } Result Detector::getMaxDBITPhaseShift(Positions pos) const { - return pimpl->Parallel(&slsDetector::getMaxClockPhaseShift, pos, + return pimpl->Parallel(&Module::getMaxClockPhaseShift, pos, defs::DBIT_CLOCK); } Result Detector::getDBITPhaseInDegrees(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClockPhase, pos, defs::DBIT_CLOCK, + return pimpl->Parallel(&Module::getClockPhase, pos, defs::DBIT_CLOCK, true); } void Detector::setDBITPhaseInDegrees(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setClockPhase, pos, defs::DBIT_CLOCK, value, + pimpl->Parallel(&Module::setClockPhase, pos, defs::DBIT_CLOCK, value, true); } Result Detector::getClockFrequency(int clkIndex, Positions pos) { - return pimpl->Parallel(&slsDetector::getClockFrequency, pos, clkIndex); + return pimpl->Parallel(&Module::getClockFrequency, pos, clkIndex); } void Detector::setClockFrequency(int clkIndex, int value, Positions pos) { - pimpl->Parallel(&slsDetector::setClockFrequency, pos, clkIndex, value); + pimpl->Parallel(&Module::setClockFrequency, pos, clkIndex, value); } Result Detector::getClockPhase(int clkIndex, Positions pos) { - return pimpl->Parallel(&slsDetector::getClockPhase, pos, clkIndex, false); + return pimpl->Parallel(&Module::getClockPhase, pos, clkIndex, false); } void Detector::setClockPhase(int clkIndex, int value, Positions pos) { - pimpl->Parallel(&slsDetector::setClockPhase, pos, clkIndex, value, false); + pimpl->Parallel(&Module::setClockPhase, pos, clkIndex, value, false); } Result Detector::getMaxClockPhaseShift(int clkIndex, Positions pos) { - return pimpl->Parallel(&slsDetector::getMaxClockPhaseShift, pos, clkIndex); + return pimpl->Parallel(&Module::getMaxClockPhaseShift, pos, clkIndex); } Result Detector::getClockPhaseinDegrees(int clkIndex, Positions pos) { - return pimpl->Parallel(&slsDetector::getClockPhase, pos, clkIndex, true); + return pimpl->Parallel(&Module::getClockPhase, pos, clkIndex, true); } void Detector::setClockPhaseinDegrees(int clkIndex, int value, Positions pos) { - pimpl->Parallel(&slsDetector::setClockPhase, pos, clkIndex, value, true); + pimpl->Parallel(&Module::setClockPhase, pos, clkIndex, value, true); } Result Detector::getClockDivider(int clkIndex, Positions pos) { - return pimpl->Parallel(&slsDetector::getClockDivider, pos, clkIndex); + return pimpl->Parallel(&Module::getClockDivider, pos, clkIndex); } void Detector::setClockDivider(int clkIndex, int value, Positions pos) { - pimpl->Parallel(&slsDetector::setClockDivider, pos, clkIndex, value); + pimpl->Parallel(&Module::setClockDivider, pos, clkIndex, value); } Result Detector::getHighVoltage(Positions pos) const { - return pimpl->Parallel(&slsDetector::setDAC, pos, -1, defs::HIGH_VOLTAGE, + return pimpl->Parallel(&Module::setDAC, pos, -1, defs::HIGH_VOLTAGE, 0); } void Detector::setHighVoltage(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setDAC, pos, value, defs::HIGH_VOLTAGE, 0); + pimpl->Parallel(&Module::setDAC, pos, value, defs::HIGH_VOLTAGE, 0); } Result Detector::getPowerChip(Positions pos) const { - return pimpl->Parallel(&slsDetector::powerChip, pos, -1); + return pimpl->Parallel(&Module::powerChip, pos, -1); } void Detector::setPowerChip(bool on, Positions pos) { if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) { for (int i = 0; i != pimpl->size(); ++i) { - pimpl->Parallel(&slsDetector::powerChip, {i}, static_cast(on)); + pimpl->Parallel(&Module::powerChip, {i}, static_cast(on)); usleep(1000 * 1000); } } else { - pimpl->Parallel(&slsDetector::powerChip, pos, static_cast(on)); + pimpl->Parallel(&Module::powerChip, pos, static_cast(on)); } } @@ -375,7 +375,7 @@ Result Detector::getTemperature(defs::dacIndex index, default: throw RuntimeError("Unknown Temperature Index"); } - auto res = pimpl->Parallel(&slsDetector::getADC, pos, index); + auto res = pimpl->Parallel(&Module::getADC, pos, index); switch (getDetectorType().squash()) { case defs::EIGER: case defs::JUNGFRAU: @@ -391,21 +391,21 @@ Result Detector::getTemperature(defs::dacIndex index, Result Detector::getDAC(defs::dacIndex index, bool mV, Positions pos) const { - return pimpl->Parallel(&slsDetector::setDAC, pos, -1, index, mV); + return pimpl->Parallel(&Module::setDAC, pos, -1, index, mV); } void Detector::setDAC(defs::dacIndex index, int value, bool mV, Positions pos) { - pimpl->Parallel(&slsDetector::setDAC, pos, value, index, mV); + pimpl->Parallel(&Module::setDAC, pos, value, index, mV); } Result Detector::getOnChipDAC(defs::dacIndex index, int chipIndex, Positions pos) const { - return pimpl->Parallel(&slsDetector::getOnChipDAC, pos, index, chipIndex); + return pimpl->Parallel(&Module::getOnChipDAC, pos, index, chipIndex); } void Detector::setOnChipDAC(defs::dacIndex index, int chipIndex, int value, Positions pos) { - pimpl->Parallel(&slsDetector::setOnChipDAC, pos, index, chipIndex, value); + pimpl->Parallel(&Module::setOnChipDAC, pos, index, chipIndex, value); } // Acquisition @@ -415,62 +415,62 @@ void Detector::acquire() { pimpl->acquire(); } void Detector::clearAcquiringFlag() { pimpl->setAcquiringFlag(0); } void Detector::startReceiver() { - pimpl->Parallel(&slsDetector::startReceiver, {}); + pimpl->Parallel(&Module::startReceiver, {}); } void Detector::stopReceiver() { - pimpl->Parallel(&slsDetector::stopReceiver, {}); + pimpl->Parallel(&Module::stopReceiver, {}); } void Detector::startDetector() { if (getDetectorType().squash() == defs::EIGER) { - pimpl->Parallel(&slsDetector::prepareAcquisition, {}); + pimpl->Parallel(&Module::prepareAcquisition, {}); } - pimpl->Parallel(&slsDetector::startAcquisition, {}); + pimpl->Parallel(&Module::startAcquisition, {}); } void Detector::stopDetector() { - pimpl->Parallel(&slsDetector::stopAcquisition, {}); + pimpl->Parallel(&Module::stopAcquisition, {}); } Result Detector::getDetectorStatus(Positions pos) const { - return pimpl->Parallel(&slsDetector::getRunStatus, pos); + return pimpl->Parallel(&Module::getRunStatus, pos); } Result Detector::getReceiverStatus(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverStatus, pos); + return pimpl->Parallel(&Module::getReceiverStatus, pos); } Result Detector::getFramesCaught(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos); + return pimpl->Parallel(&Module::getFramesCaughtByReceiver, pos); } Result> Detector::getNumMissingPackets(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumMissingPackets, pos); + return pimpl->Parallel(&Module::getNumMissingPackets, pos); } Result Detector::getStartingFrameNumber(Positions pos) const { - return pimpl->Parallel(&slsDetector::getStartingFrameNumber, pos); + return pimpl->Parallel(&Module::getStartingFrameNumber, pos); } void Detector::setStartingFrameNumber(uint64_t value, Positions pos) { - pimpl->Parallel(&slsDetector::setStartingFrameNumber, pos, value); + pimpl->Parallel(&Module::setStartingFrameNumber, pos, value); } void Detector::sendSoftwareTrigger(Positions pos) { - pimpl->Parallel(&slsDetector::sendSoftwareTrigger, pos); + pimpl->Parallel(&Module::sendSoftwareTrigger, pos); } // Network Configuration (Detector<->Receiver) Result Detector::getNumberofUDPInterfaces(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberofUDPInterfaces, pos); + return pimpl->Parallel(&Module::getNumberofUDPInterfaces, pos); } void Detector::setNumberofUDPInterfaces(int n, Positions pos) { int previouslyClientStreaming = pimpl->enableDataStreamingToClient(); bool previouslyReceiverStreaming = getRxZmqDataStream(pos).squash(true); - pimpl->Parallel(&slsDetector::setNumberofUDPInterfaces, pos, n); + pimpl->Parallel(&Module::setNumberofUDPInterfaces, pos, n); // redo the zmq sockets if enabled if (previouslyClientStreaming != 0) { pimpl->enableDataStreamingToClient(0); @@ -483,171 +483,171 @@ void Detector::setNumberofUDPInterfaces(int n, Positions pos) { } Result Detector::getSelectedUDPInterface(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSelectedUDPInterface, pos); + return pimpl->Parallel(&Module::getSelectedUDPInterface, pos); } void Detector::selectUDPInterface(int interface, Positions pos) { - pimpl->Parallel(&slsDetector::selectUDPInterface, pos, interface); + pimpl->Parallel(&Module::selectUDPInterface, pos, interface); } Result Detector::getSourceUDPIP(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSourceUDPIP, pos); + return pimpl->Parallel(&Module::getSourceUDPIP, pos); } void Detector::setSourceUDPIP(const IpAddr ip, Positions pos) { - pimpl->Parallel(&slsDetector::setSourceUDPIP, pos, ip); + pimpl->Parallel(&Module::setSourceUDPIP, pos, ip); } Result Detector::getSourceUDPIP2(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSourceUDPIP2, pos); + return pimpl->Parallel(&Module::getSourceUDPIP2, pos); } void Detector::setSourceUDPIP2(const IpAddr ip, Positions pos) { - pimpl->Parallel(&slsDetector::setSourceUDPIP2, pos, ip); + pimpl->Parallel(&Module::setSourceUDPIP2, pos, ip); } Result Detector::getSourceUDPMAC(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSourceUDPMAC, pos); + return pimpl->Parallel(&Module::getSourceUDPMAC, pos); } void Detector::setSourceUDPMAC(const MacAddr mac, Positions pos) { - pimpl->Parallel(&slsDetector::setSourceUDPMAC, pos, mac); + pimpl->Parallel(&Module::setSourceUDPMAC, pos, mac); } Result Detector::getSourceUDPMAC2(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSourceUDPMAC2, pos); + return pimpl->Parallel(&Module::getSourceUDPMAC2, pos); } void Detector::setSourceUDPMAC2(const MacAddr mac, Positions pos) { - pimpl->Parallel(&slsDetector::setSourceUDPMAC2, pos, mac); + pimpl->Parallel(&Module::setSourceUDPMAC2, pos, mac); } Result Detector::getDestinationUDPIP(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDestinationUDPIP, pos); + return pimpl->Parallel(&Module::getDestinationUDPIP, pos); } void Detector::setDestinationUDPIP(const IpAddr ip, Positions pos) { - pimpl->Parallel(&slsDetector::setDestinationUDPIP, pos, ip); + pimpl->Parallel(&Module::setDestinationUDPIP, pos, ip); } Result Detector::getDestinationUDPIP2(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDestinationUDPIP2, pos); + return pimpl->Parallel(&Module::getDestinationUDPIP2, pos); } void Detector::setDestinationUDPIP2(const IpAddr ip, Positions pos) { - pimpl->Parallel(&slsDetector::setDestinationUDPIP2, pos, ip); + pimpl->Parallel(&Module::setDestinationUDPIP2, pos, ip); } Result Detector::getDestinationUDPMAC(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDestinationUDPMAC, pos); + return pimpl->Parallel(&Module::getDestinationUDPMAC, pos); } void Detector::setDestinationUDPMAC(const MacAddr mac, Positions pos) { - pimpl->Parallel(&slsDetector::setDestinationUDPMAC, pos, mac); + pimpl->Parallel(&Module::setDestinationUDPMAC, pos, mac); } Result Detector::getDestinationUDPMAC2(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDestinationUDPMAC2, pos); + return pimpl->Parallel(&Module::getDestinationUDPMAC2, pos); } void Detector::setDestinationUDPMAC2(const MacAddr mac, Positions pos) { - pimpl->Parallel(&slsDetector::setDestinationUDPMAC2, pos, mac); + pimpl->Parallel(&Module::setDestinationUDPMAC2, pos, mac); } Result Detector::getDestinationUDPPort(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDestinationUDPPort, pos); + return pimpl->Parallel(&Module::getDestinationUDPPort, pos); } void Detector::setDestinationUDPPort(int port, int module_id) { if (module_id == -1) { std::vector port_list = getPortNumbers(port); for (int idet = 0; idet < size(); ++idet) { - pimpl->Parallel(&slsDetector::setDestinationUDPPort, {idet}, + pimpl->Parallel(&Module::setDestinationUDPPort, {idet}, port_list[idet]); } } else { - pimpl->Parallel(&slsDetector::setDestinationUDPPort, {module_id}, port); + pimpl->Parallel(&Module::setDestinationUDPPort, {module_id}, port); } } Result Detector::getDestinationUDPPort2(Positions pos) const { - return pimpl->Parallel(&slsDetector::getDestinationUDPPort2, pos); + return pimpl->Parallel(&Module::getDestinationUDPPort2, pos); } void Detector::setDestinationUDPPort2(int port, int module_id) { if (module_id == -1) { std::vector port_list = getPortNumbers(port); for (int idet = 0; idet < size(); ++idet) { - pimpl->Parallel(&slsDetector::setDestinationUDPPort2, {idet}, + pimpl->Parallel(&Module::setDestinationUDPPort2, {idet}, port_list[idet]); } } else { - pimpl->Parallel(&slsDetector::setDestinationUDPPort2, {module_id}, + pimpl->Parallel(&Module::setDestinationUDPPort2, {module_id}, port); } } Result Detector::printRxConfiguration(Positions pos) const { - return pimpl->Parallel(&slsDetector::printReceiverConfiguration, pos); + return pimpl->Parallel(&Module::printReceiverConfiguration, pos); } Result Detector::getTenGiga(Positions pos) const { - return pimpl->Parallel(&slsDetector::enableTenGigabitEthernet, pos, -1); + return pimpl->Parallel(&Module::enableTenGigabitEthernet, pos, -1); } void Detector::setTenGiga(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::enableTenGigabitEthernet, pos, + pimpl->Parallel(&Module::enableTenGigabitEthernet, pos, static_cast(value)); } Result Detector::getTenGigaFlowControl(Positions pos) const { - return pimpl->Parallel(&slsDetector::getTenGigaFlowControl, pos); + return pimpl->Parallel(&Module::getTenGigaFlowControl, pos); } void Detector::setTenGigaFlowControl(bool enable, Positions pos) { - pimpl->Parallel(&slsDetector::setTenGigaFlowControl, pos, enable); + pimpl->Parallel(&Module::setTenGigaFlowControl, pos, enable); } Result Detector::getTransmissionDelayFrame(Positions pos) const { - return pimpl->Parallel(&slsDetector::getTransmissionDelayFrame, pos); + return pimpl->Parallel(&Module::getTransmissionDelayFrame, pos); } void Detector::setTransmissionDelayFrame(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setTransmissionDelayFrame, pos, value); + pimpl->Parallel(&Module::setTransmissionDelayFrame, pos, value); } Result Detector::getTransmissionDelayLeft(Positions pos) const { - return pimpl->Parallel(&slsDetector::getTransmissionDelayLeft, pos); + return pimpl->Parallel(&Module::getTransmissionDelayLeft, pos); } void Detector::setTransmissionDelayLeft(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setTransmissionDelayLeft, pos, value); + pimpl->Parallel(&Module::setTransmissionDelayLeft, pos, value); } Result Detector::getTransmissionDelayRight(Positions pos) const { - return pimpl->Parallel(&slsDetector::getTransmissionDelayRight, pos); + return pimpl->Parallel(&Module::getTransmissionDelayRight, pos); } void Detector::setTransmissionDelayRight(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setTransmissionDelayRight, pos, value); + pimpl->Parallel(&Module::setTransmissionDelayRight, pos, value); } // Receiver Result Detector::getUseReceiverFlag(Positions pos) const { - return pimpl->Parallel(&slsDetector::getUseReceiverFlag, pos); + return pimpl->Parallel(&Module::getUseReceiverFlag, pos); } Result Detector::getRxHostname(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverHostname, pos); + return pimpl->Parallel(&Module::getReceiverHostname, pos); } void Detector::setRxHostname(const std::string &receiver, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverHostname, pos, receiver); + pimpl->Parallel(&Module::setReceiverHostname, pos, receiver); } Result Detector::getRxPort(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverPort, pos); + return pimpl->Parallel(&Module::getReceiverPort, pos); } void Detector::setRxPort(int port, int module_id) { @@ -657,195 +657,195 @@ void Detector::setRxPort(int port, int module_id) { it = port++; } for (int idet = 0; idet < size(); ++idet) { - pimpl->Parallel(&slsDetector::setReceiverPort, {idet}, + pimpl->Parallel(&Module::setReceiverPort, {idet}, port_list[idet]); } } else { - pimpl->Parallel(&slsDetector::setReceiverPort, {module_id}, port); + pimpl->Parallel(&Module::setReceiverPort, {module_id}, port); } } Result Detector::getRxFifoDepth(Positions pos) const { - return pimpl->Parallel(&slsDetector::setReceiverFifoDepth, pos, -1); + return pimpl->Parallel(&Module::setReceiverFifoDepth, pos, -1); } void Detector::setRxFifoDepth(int nframes, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverFifoDepth, pos, nframes); + pimpl->Parallel(&Module::setReceiverFifoDepth, pos, nframes); } Result Detector::getRxSilentMode(Positions pos) const { - return pimpl->Parallel(&slsDetector::setReceiverSilentMode, pos, -1); + return pimpl->Parallel(&Module::setReceiverSilentMode, pos, -1); } void Detector::setRxSilentMode(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverSilentMode, pos, + pimpl->Parallel(&Module::setReceiverSilentMode, pos, static_cast(value)); } Result Detector::getRxFrameDiscardPolicy(Positions pos) const { - return pimpl->Parallel(&slsDetector::setReceiverFramesDiscardPolicy, pos, + return pimpl->Parallel(&Module::setReceiverFramesDiscardPolicy, pos, defs::GET_FRAME_DISCARD_POLICY); } void Detector::setRxFrameDiscardPolicy(defs::frameDiscardPolicy f, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverFramesDiscardPolicy, pos, f); + pimpl->Parallel(&Module::setReceiverFramesDiscardPolicy, pos, f); } Result Detector::getPartialFramesPadding(Positions pos) const { - return pimpl->Parallel(&slsDetector::getPartialFramesPadding, pos); + return pimpl->Parallel(&Module::getPartialFramesPadding, pos); } void Detector::setPartialFramesPadding(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setPartialFramesPadding, pos, value); + pimpl->Parallel(&Module::setPartialFramesPadding, pos, value); } Result Detector::getRxUDPSocketBufferSize(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverUDPSocketBufferSize, pos); + return pimpl->Parallel(&Module::getReceiverUDPSocketBufferSize, pos); } void Detector::setRxUDPSocketBufferSize(int64_t udpsockbufsize, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverUDPSocketBufferSize, pos, + pimpl->Parallel(&Module::setReceiverUDPSocketBufferSize, pos, udpsockbufsize); } Result Detector::getRxRealUDPSocketBufferSize(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverRealUDPSocketBufferSize, + return pimpl->Parallel(&Module::getReceiverRealUDPSocketBufferSize, pos); } Result Detector::getRxLock(Positions pos) { - return pimpl->Parallel(&slsDetector::lockReceiver, pos, -1); + return pimpl->Parallel(&Module::lockReceiver, pos, -1); } void Detector::setRxLock(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::lockReceiver, pos, static_cast(value)); + pimpl->Parallel(&Module::lockReceiver, pos, static_cast(value)); } Result Detector::getRxLastClientIP(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverLastClientIP, pos); + return pimpl->Parallel(&Module::getReceiverLastClientIP, pos); } // File Result Detector::getFileFormat(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFileFormat, pos); + return pimpl->Parallel(&Module::getFileFormat, pos); } void Detector::setFileFormat(defs::fileFormat f, Positions pos) { - pimpl->Parallel(&slsDetector::setFileFormat, pos, f); + pimpl->Parallel(&Module::setFileFormat, pos, f); } Result Detector::getFilePath(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFilePath, pos); + return pimpl->Parallel(&Module::getFilePath, pos); } void Detector::setFilePath(const std::string &fpath, Positions pos) { - pimpl->Parallel(&slsDetector::setFilePath, pos, fpath); + pimpl->Parallel(&Module::setFilePath, pos, fpath); } Result Detector::getFileNamePrefix(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFileName, pos); + return pimpl->Parallel(&Module::getFileName, pos); } void Detector::setFileNamePrefix(const std::string &fname, Positions pos) { - pimpl->Parallel(&slsDetector::setFileName, pos, fname); + pimpl->Parallel(&Module::setFileName, pos, fname); } Result Detector::getAcquisitionIndex(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFileIndex, pos); + return pimpl->Parallel(&Module::getFileIndex, pos); } void Detector::setAcquisitionIndex(int64_t i, Positions pos) { - pimpl->Parallel(&slsDetector::setFileIndex, pos, i); + pimpl->Parallel(&Module::setFileIndex, pos, i); } Result Detector::getFileWrite(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFileWrite, pos); + return pimpl->Parallel(&Module::getFileWrite, pos); } void Detector::setFileWrite(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setFileWrite, pos, value); + pimpl->Parallel(&Module::setFileWrite, pos, value); } void Detector::setMasterFileWrite(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setMasterFileWrite, pos, value); + pimpl->Parallel(&Module::setMasterFileWrite, pos, value); } Result Detector::getMasterFileWrite(Positions pos) const { - return pimpl->Parallel(&slsDetector::getMasterFileWrite, pos); + return pimpl->Parallel(&Module::getMasterFileWrite, pos); } Result Detector::getFileOverWrite(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFileOverWrite, pos); + return pimpl->Parallel(&Module::getFileOverWrite, pos); } void Detector::setFileOverWrite(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setFileOverWrite, pos, value); + pimpl->Parallel(&Module::setFileOverWrite, pos, value); } Result Detector::getFramesPerFile(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFramesPerFile, pos); + return pimpl->Parallel(&Module::getFramesPerFile, pos); } void Detector::setFramesPerFile(int n, Positions pos) { - pimpl->Parallel(&slsDetector::setFramesPerFile, pos, n); + pimpl->Parallel(&Module::setFramesPerFile, pos, n); } // Zmq Streaming (Receiver<->Client) Result Detector::getRxZmqDataStream(Positions pos) const { - return pimpl->Parallel(&slsDetector::enableDataStreamingFromReceiver, pos, + return pimpl->Parallel(&Module::enableDataStreamingFromReceiver, pos, -1); } void Detector::setRxZmqDataStream(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::enableDataStreamingFromReceiver, pos, + pimpl->Parallel(&Module::enableDataStreamingFromReceiver, pos, static_cast(value)); } Result Detector::getRxZmqFrequency(Positions pos) const { - return pimpl->Parallel(&slsDetector::setReceiverStreamingFrequency, pos, + return pimpl->Parallel(&Module::setReceiverStreamingFrequency, pos, -1); } void Detector::setRxZmqFrequency(int freq, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverStreamingFrequency, pos, freq); + pimpl->Parallel(&Module::setReceiverStreamingFrequency, pos, freq); } Result Detector::getRxZmqTimer(Positions pos) const { - return pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, -1); + return pimpl->Parallel(&Module::setReceiverStreamingTimer, pos, -1); } void Detector::setRxZmqTimer(int time_in_ms, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, time_in_ms); + pimpl->Parallel(&Module::setReceiverStreamingTimer, pos, time_in_ms); } Result Detector::getRxZmqPort(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverStreamingPort, pos); + return pimpl->Parallel(&Module::getReceiverStreamingPort, pos); } void Detector::setRxZmqPort(int port, int module_id) { if (module_id == -1) { std::vector port_list = getPortNumbers(port); for (int idet = 0; idet < size(); ++idet) { - pimpl->Parallel(&slsDetector::setReceiverStreamingPort, {idet}, + pimpl->Parallel(&Module::setReceiverStreamingPort, {idet}, port_list[idet]); } } else { - pimpl->Parallel(&slsDetector::setReceiverStreamingPort, {module_id}, + pimpl->Parallel(&Module::setReceiverStreamingPort, {module_id}, port); } } Result Detector::getRxZmqIP(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverStreamingIP, pos); + return pimpl->Parallel(&Module::getReceiverStreamingIP, pos); } void Detector::setRxZmqIP(const IpAddr ip, Positions pos) { bool previouslyReceiverStreaming = getRxZmqDataStream(pos).squash(false); - pimpl->Parallel(&slsDetector::setReceiverStreamingIP, pos, ip); + pimpl->Parallel(&Module::setReceiverStreamingIP, pos, ip); if (previouslyReceiverStreaming) { setRxZmqDataStream(false, pos); setRxZmqDataStream(true, pos); @@ -853,29 +853,29 @@ void Detector::setRxZmqIP(const IpAddr ip, Positions pos) { } Result Detector::getClientZmqPort(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClientStreamingPort, pos); + return pimpl->Parallel(&Module::getClientStreamingPort, pos); } void Detector::setClientZmqPort(int port, int module_id) { if (module_id == -1) { std::vector port_list = getPortNumbers(port); for (int idet = 0; idet < size(); ++idet) { - pimpl->Parallel(&slsDetector::setClientStreamingPort, {idet}, + pimpl->Parallel(&Module::setClientStreamingPort, {idet}, port_list[idet]); } } else { - pimpl->Parallel(&slsDetector::setClientStreamingPort, {module_id}, + pimpl->Parallel(&Module::setClientStreamingPort, {module_id}, port); } } Result Detector::getClientZmqIp(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClientStreamingIP, pos); + return pimpl->Parallel(&Module::getClientStreamingIP, pos); } void Detector::setClientZmqIp(const IpAddr ip, Positions pos) { int previouslyClientStreaming = pimpl->enableDataStreamingToClient(-1); - pimpl->Parallel(&slsDetector::setClientStreamingIP, pos, ip); + pimpl->Parallel(&Module::setClientStreamingIP, pos, ip); if (previouslyClientStreaming != 0) { pimpl->enableDataStreamingToClient(0); pimpl->enableDataStreamingToClient(1); @@ -885,54 +885,54 @@ void Detector::setClientZmqIp(const IpAddr ip, Positions pos) { // Eiger Specific Result Detector::getDynamicRange(Positions pos) const { - return pimpl->Parallel(&slsDetector::setDynamicRange, pos, -1); + return pimpl->Parallel(&Module::setDynamicRange, pos, -1); } void Detector::setDynamicRange(int value) { - pimpl->Parallel(&slsDetector::setDynamicRange, {}, value); + pimpl->Parallel(&Module::setDynamicRange, {}, value); } Result Detector::getSubExptime(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSubExptime, pos); + return pimpl->Parallel(&Module::getSubExptime, pos); } void Detector::setSubExptime(ns t, Positions pos) { - pimpl->Parallel(&slsDetector::setSubExptime, pos, t.count()); + pimpl->Parallel(&Module::setSubExptime, pos, t.count()); } Result Detector::getSubDeadTime(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSubDeadTime, pos); + return pimpl->Parallel(&Module::getSubDeadTime, pos); } void Detector::setSubDeadTime(ns value, Positions pos) { - pimpl->Parallel(&slsDetector::setSubDeadTime, pos, value.count()); + pimpl->Parallel(&Module::setSubDeadTime, pos, value.count()); } Result Detector::getThresholdEnergy(Positions pos) const { - return pimpl->Parallel(&slsDetector::getThresholdEnergy, pos); + return pimpl->Parallel(&Module::getThresholdEnergy, pos); } void Detector::setThresholdEnergy(int threshold_ev, defs::detectorSettings settings, bool trimbits, Positions pos) { - pimpl->Parallel(&slsDetector::setThresholdEnergy, pos, threshold_ev, + pimpl->Parallel(&Module::setThresholdEnergy, pos, threshold_ev, settings, static_cast(trimbits)); } Result Detector::getSettingsPath(Positions pos) const { - return pimpl->Parallel(&slsDetector::getSettingsDir, pos); + return pimpl->Parallel(&Module::getSettingsDir, pos); } void Detector::setSettingsPath(const std::string &value, Positions pos) { - pimpl->Parallel(&slsDetector::setSettingsDir, pos, value); + pimpl->Parallel(&Module::setSettingsDir, pos, value); } void Detector::loadTrimbits(const std::string &fname, Positions pos) { - pimpl->Parallel(&slsDetector::loadSettingsFile, pos, fname); + pimpl->Parallel(&Module::loadSettingsFile, pos, fname); } Result Detector::getRxAddGapPixels(Positions pos) const { - return pimpl->Parallel(&slsDetector::enableGapPixels, pos, -1); + return pimpl->Parallel(&Module::enableGapPixels, pos, -1); } void Detector::setRxAddGapPixels(bool enable) { @@ -940,109 +940,109 @@ void Detector::setRxAddGapPixels(bool enable) { } Result Detector::getParallelMode(Positions pos) const { - return pimpl->Parallel(&slsDetector::getParallelMode, pos); + return pimpl->Parallel(&Module::getParallelMode, pos); } void Detector::setParallelMode(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setParallelMode, pos, value); + pimpl->Parallel(&Module::setParallelMode, pos, value); } Result Detector::getOverFlowMode(Positions pos) const { - return pimpl->Parallel(&slsDetector::getOverFlowMode, pos); + return pimpl->Parallel(&Module::getOverFlowMode, pos); } void Detector::setOverFlowMode(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setOverFlowMode, pos, value); + pimpl->Parallel(&Module::setOverFlowMode, pos, value); } Result Detector::getStoreInRamMode(Positions pos) const { - return pimpl->Parallel(&slsDetector::getStoreInRamMode, pos); + return pimpl->Parallel(&Module::getStoreInRamMode, pos); } void Detector::setStoreInRamMode(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setStoreInRamMode, pos, value); + pimpl->Parallel(&Module::setStoreInRamMode, pos, value); } Result Detector::getBottom(Positions pos) const { - return pimpl->Parallel(&slsDetector::getFlippedDataX, pos); + return pimpl->Parallel(&Module::getFlippedDataX, pos); } void Detector::setBottom(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setFlippedDataX, pos, + pimpl->Parallel(&Module::setFlippedDataX, pos, static_cast(value)); } Result Detector::getAllTrimbits(Positions pos) const { - return pimpl->Parallel(&slsDetector::setAllTrimbits, pos, -1); + return pimpl->Parallel(&Module::setAllTrimbits, pos, -1); } void Detector::setAllTrimbits(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setAllTrimbits, pos, value); + pimpl->Parallel(&Module::setAllTrimbits, pos, value); } Result> Detector::getTrimEnergies(Positions pos) const { - return pimpl->Parallel(&slsDetector::getTrimEn, pos); + return pimpl->Parallel(&Module::getTrimEn, pos); } void Detector::setTrimEnergies(std::vector energies, Positions pos) { - pimpl->Parallel(&slsDetector::setTrimEn, pos, energies); + pimpl->Parallel(&Module::setTrimEn, pos, energies); } Result Detector::getRateCorrection(Positions pos) const { - return pimpl->Parallel(&slsDetector::getRateCorrection, pos); + return pimpl->Parallel(&Module::getRateCorrection, pos); } void Detector::setDefaultRateCorrection(Positions pos) { - pimpl->Parallel(&slsDetector::setDefaultRateCorrection, pos); + pimpl->Parallel(&Module::setDefaultRateCorrection, pos); } void Detector::setRateCorrection(ns dead_time, Positions pos) { - pimpl->Parallel(&slsDetector::setRateCorrection, pos, dead_time.count()); + pimpl->Parallel(&Module::setRateCorrection, pos, dead_time.count()); } Result Detector::getPartialReadout(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReadNLines, pos); + return pimpl->Parallel(&Module::getReadNLines, pos); } void Detector::setPartialReadout(const int lines, Positions pos) { - pimpl->Parallel(&slsDetector::setReadNLines, pos, lines); + pimpl->Parallel(&Module::setReadNLines, pos, lines); } Result Detector::getInterruptSubframe(Positions pos) const { - return pimpl->Parallel(&slsDetector::getInterruptSubframe, pos); + return pimpl->Parallel(&Module::getInterruptSubframe, pos); } void Detector::setInterruptSubframe(const bool enable, Positions pos) { - pimpl->Parallel(&slsDetector::setInterruptSubframe, pos, enable); + pimpl->Parallel(&Module::setInterruptSubframe, pos, enable); } Result Detector::getMeasuredPeriod(Positions pos) const { - return pimpl->Parallel(&slsDetector::getMeasuredPeriod, pos); + return pimpl->Parallel(&Module::getMeasuredPeriod, pos); } Result Detector::getMeasuredSubFramePeriod(Positions pos) const { - return pimpl->Parallel(&slsDetector::getMeasuredSubFramePeriod, pos); + return pimpl->Parallel(&Module::getMeasuredSubFramePeriod, pos); } Result Detector::getActive(Positions pos) const { - return pimpl->Parallel(&slsDetector::activate, pos, -1); + return pimpl->Parallel(&Module::activate, pos, -1); } void Detector::setActive(bool active, Positions pos) { - pimpl->Parallel(&slsDetector::activate, pos, static_cast(active)); + pimpl->Parallel(&Module::activate, pos, static_cast(active)); } Result Detector::getRxPadDeactivatedMode(Positions pos) const { - return pimpl->Parallel(&slsDetector::setDeactivatedRxrPaddingMode, pos, -1); + return pimpl->Parallel(&Module::setDeactivatedRxrPaddingMode, pos, -1); } void Detector::setRxPadDeactivatedMode(bool pad, Positions pos) { - pimpl->Parallel(&slsDetector::setDeactivatedRxrPaddingMode, pos, + pimpl->Parallel(&Module::setDeactivatedRxrPaddingMode, pos, static_cast(pad)); } Result Detector::getPartialReset(Positions pos) const { - auto res = pimpl->Parallel(&slsDetector::setCounterBit, pos, -1); + auto res = pimpl->Parallel(&Module::setCounterBit, pos, -1); Result t(res.size()); for (unsigned int i = 0; i < res.size(); ++i) { t[i] = !res[i]; @@ -1051,23 +1051,23 @@ Result Detector::getPartialReset(Positions pos) const { } void Detector::setPartialReset(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setCounterBit, pos, !value); + pimpl->Parallel(&Module::setCounterBit, pos, !value); } void Detector::pulsePixel(int n, defs::xy pixel, Positions pos) { - pimpl->Parallel(&slsDetector::pulsePixel, pos, n, pixel.x, pixel.y); + pimpl->Parallel(&Module::pulsePixel, pos, n, pixel.x, pixel.y); } void Detector::pulsePixelNMove(int n, defs::xy pixel, Positions pos) { - pimpl->Parallel(&slsDetector::pulsePixelNMove, pos, n, pixel.x, pixel.y); + pimpl->Parallel(&Module::pulsePixelNMove, pos, n, pixel.x, pixel.y); } void Detector::pulseChip(int n, Positions pos) { - pimpl->Parallel(&slsDetector::pulseChip, pos, n); + pimpl->Parallel(&Module::pulseChip, pos, n); } Result Detector::getQuad(Positions pos) const { - return pimpl->Parallel(&slsDetector::getQuad, pos); + return pimpl->Parallel(&Module::getQuad, pos); } void Detector::setQuad(const bool enable) { @@ -1075,13 +1075,13 @@ void Detector::setQuad(const bool enable) { throw RuntimeError("Cannot set Quad type as it is available only for 1 " "Eiger Quad Half module."); } - pimpl->Parallel(&slsDetector::setQuad, {}, enable); + pimpl->Parallel(&Module::setQuad, {}, enable); } // Jungfrau Specific Result Detector::getThresholdTemperature(Positions pos) const { - auto res = pimpl->Parallel(&slsDetector::setThresholdTemperature, pos, -1); + auto res = pimpl->Parallel(&Module::setThresholdTemperature, pos, -1); for (auto &it : res) { it /= 1000; } @@ -1089,218 +1089,218 @@ Result Detector::getThresholdTemperature(Positions pos) const { } void Detector::setThresholdTemperature(int temp, Positions pos) { - pimpl->Parallel(&slsDetector::setThresholdTemperature, pos, temp * 1000); + pimpl->Parallel(&Module::setThresholdTemperature, pos, temp * 1000); } Result Detector::getTemperatureControl(Positions pos) const { - return pimpl->Parallel(&slsDetector::setTemperatureControl, pos, -1); + return pimpl->Parallel(&Module::setTemperatureControl, pos, -1); } void Detector::setTemperatureControl(bool enable, Positions pos) { - pimpl->Parallel(&slsDetector::setTemperatureControl, pos, + pimpl->Parallel(&Module::setTemperatureControl, pos, static_cast(enable)); } Result Detector::getTemperatureEvent(Positions pos) const { - return pimpl->Parallel(&slsDetector::setTemperatureEvent, pos, -1); + return pimpl->Parallel(&Module::setTemperatureEvent, pos, -1); } void Detector::resetTemperatureEvent(Positions pos) { - pimpl->Parallel(&slsDetector::setTemperatureEvent, pos, 0); + pimpl->Parallel(&Module::setTemperatureEvent, pos, 0); } Result Detector::getAutoCompDisable(Positions pos) const { - return pimpl->Parallel(&slsDetector::setAutoComparatorDisableMode, pos, -1); + return pimpl->Parallel(&Module::setAutoComparatorDisableMode, pos, -1); } void Detector::setAutoCompDisable(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setAutoComparatorDisableMode, pos, + pimpl->Parallel(&Module::setAutoComparatorDisableMode, pos, static_cast(value)); } Result Detector::getNumberOfAdditionalStorageCells(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfAdditionalStorageCells, + return pimpl->Parallel(&Module::getNumberOfAdditionalStorageCells, pos); } void Detector::setNumberOfAdditionalStorageCells(int value) { - pimpl->Parallel(&slsDetector::setNumberOfAdditionalStorageCells, {}, value); + pimpl->Parallel(&Module::setNumberOfAdditionalStorageCells, {}, value); } Result Detector::getStorageCellStart(Positions pos) const { - return pimpl->Parallel(&slsDetector::setStoragecellStart, pos, -1); + return pimpl->Parallel(&Module::setStoragecellStart, pos, -1); } void Detector::setStoragecellStart(int cell, Positions pos) { - pimpl->Parallel(&slsDetector::setStoragecellStart, pos, cell); + pimpl->Parallel(&Module::setStoragecellStart, pos, cell); } Result Detector::getStorageCellDelay(Positions pos) const { - return pimpl->Parallel(&slsDetector::getStorageCellDelay, pos); + return pimpl->Parallel(&Module::getStorageCellDelay, pos); } void Detector::setStorageCellDelay(ns value, Positions pos) { - pimpl->Parallel(&slsDetector::setStorageCellDelay, pos, value.count()); + pimpl->Parallel(&Module::setStorageCellDelay, pos, value.count()); } // Gotthard Specific Result Detector::getROI(Positions pos) const { - return pimpl->Parallel(&slsDetector::getROI, pos); + return pimpl->Parallel(&Module::getROI, pos); } void Detector::setROI(defs::ROI value, int module_id) { if (module_id < 0 && size() > 1) { throw RuntimeError("Cannot set ROI for all modules simultaneously"); } - pimpl->Parallel(&slsDetector::setROI, {module_id}, value); + pimpl->Parallel(&Module::setROI, {module_id}, value); } void Detector::clearROI(Positions pos) { - pimpl->Parallel(&slsDetector::clearROI, pos); + pimpl->Parallel(&Module::clearROI, pos); } Result Detector::getExptimeLeft(Positions pos) const { - return pimpl->Parallel(&slsDetector::getExptimeLeft, pos); + return pimpl->Parallel(&Module::getExptimeLeft, pos); } Result Detector::getExternalSignalFlags(Positions pos) const { - return pimpl->Parallel(&slsDetector::setExternalSignalFlags, pos, + return pimpl->Parallel(&Module::setExternalSignalFlags, pos, defs::GET_EXTERNAL_SIGNAL_FLAG); } void Detector::setExternalSignalFlags(defs::externalSignalFlag value, Positions pos) { - pimpl->Parallel(&slsDetector::setExternalSignalFlags, pos, value); + pimpl->Parallel(&Module::setExternalSignalFlags, pos, value); } Result Detector::getImageTestMode(Positions pos) { - return pimpl->Parallel(&slsDetector::getImageTestMode, pos); + return pimpl->Parallel(&Module::getImageTestMode, pos); } void Detector::setImageTestMode(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setImageTestMode, pos, value); + pimpl->Parallel(&Module::setImageTestMode, pos, value); } // Gotthard2 Specific Result Detector::getNumberOfBursts(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfBursts, pos); + return pimpl->Parallel(&Module::getNumberOfBursts, pos); } void Detector::setNumberOfBursts(int64_t value) { - pimpl->Parallel(&slsDetector::setNumberOfBursts, {}, value); + pimpl->Parallel(&Module::setNumberOfBursts, {}, value); } Result Detector::getBurstPeriod(Positions pos) const { - return pimpl->Parallel(&slsDetector::getBurstPeriod, pos); + return pimpl->Parallel(&Module::getBurstPeriod, pos); } void Detector::setBurstPeriod(ns value, Positions pos) { - pimpl->Parallel(&slsDetector::setBurstPeriod, pos, value.count()); + pimpl->Parallel(&Module::setBurstPeriod, pos, value.count()); } Result> Detector::getInjectChannel(Positions pos) { - return pimpl->Parallel(&slsDetector::getInjectChannel, pos); + return pimpl->Parallel(&Module::getInjectChannel, pos); } void Detector::setInjectChannel(const int offsetChannel, const int incrementChannel, Positions pos) { - pimpl->Parallel(&slsDetector::setInjectChannel, pos, offsetChannel, incrementChannel); + pimpl->Parallel(&Module::setInjectChannel, pos, offsetChannel, incrementChannel); } Result> Detector::getVetoPhoton(const int chipIndex, Positions pos) { - return pimpl->Parallel(&slsDetector::getVetoPhoton, pos, chipIndex); + return pimpl->Parallel(&Module::getVetoPhoton, pos, chipIndex); } void Detector::setVetoPhoton(const int chipIndex, const int numPhotons, const int energy, const std::string& fname, Positions pos) { - pimpl->Parallel(&slsDetector::setVetoPhoton, pos, chipIndex, numPhotons, energy, fname); + pimpl->Parallel(&Module::setVetoPhoton, pos, chipIndex, numPhotons, energy, fname); } void Detector::setVetoReference(const int gainIndex, const int value, Positions pos) { - pimpl->Parallel(&slsDetector::setVetoReference, pos, gainIndex, value); + pimpl->Parallel(&Module::setVetoReference, pos, gainIndex, value); } Result Detector::getBurstMode(Positions pos) { - return pimpl->Parallel(&slsDetector::getBurstMode, pos); + return pimpl->Parallel(&Module::getBurstMode, pos); } void Detector::setBurstMode(defs::burstMode value, Positions pos) { - pimpl->Parallel(&slsDetector::setBurstMode, pos, value); + pimpl->Parallel(&Module::setBurstMode, pos, value); } Result Detector::getCurrentSource(Positions pos) const { - return pimpl->Parallel(&slsDetector::getCurrentSource, pos); + return pimpl->Parallel(&Module::getCurrentSource, pos); } void Detector::setCurrentSource(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setCurrentSource, pos, value); + pimpl->Parallel(&Module::setCurrentSource, pos, value); } Result Detector::getTimingSource(Positions pos) const { - return pimpl->Parallel(&slsDetector::getTimingSource, pos); + return pimpl->Parallel(&Module::getTimingSource, pos); } void Detector::setTimingSource(defs::timingSourceType value, Positions pos) { - pimpl->Parallel(&slsDetector::setTimingSource, pos, value); + pimpl->Parallel(&Module::setTimingSource, pos, value); } // Mythen3 Specific Result Detector::getCounterMask(Positions pos) const { - return pimpl->Parallel(&slsDetector::getCounterMask, pos); + return pimpl->Parallel(&Module::getCounterMask, pos); } void Detector::setCounterMask(uint32_t countermask, Positions pos) { - pimpl->Parallel(&slsDetector::setCounterMask, pos, countermask); + pimpl->Parallel(&Module::setCounterMask, pos, countermask); } // CTB/ Moench Specific Result Detector::getNumberOfAnalogSamples(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfAnalogSamples, pos); + return pimpl->Parallel(&Module::getNumberOfAnalogSamples, pos); } void Detector::setNumberOfAnalogSamples(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setNumberOfAnalogSamples, pos, value); + pimpl->Parallel(&Module::setNumberOfAnalogSamples, pos, value); } Result Detector::getADCClock(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClockFrequency, pos, + return pimpl->Parallel(&Module::getClockFrequency, pos, defs::ADC_CLOCK); } void Detector::setADCClock(int value_in_MHz, Positions pos) { - pimpl->Parallel(&slsDetector::setClockFrequency, pos, defs::ADC_CLOCK, + pimpl->Parallel(&Module::setClockFrequency, pos, defs::ADC_CLOCK, value_in_MHz); } Result Detector::getRUNClock(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClockFrequency, pos, + return pimpl->Parallel(&Module::getClockFrequency, pos, defs::RUN_CLOCK); } void Detector::setRUNClock(int value_in_MHz, Positions pos) { - pimpl->Parallel(&slsDetector::setClockFrequency, pos, defs::RUN_CLOCK, + pimpl->Parallel(&Module::setClockFrequency, pos, defs::RUN_CLOCK, value_in_MHz); } Result Detector::getSYNCClock(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClockFrequency, pos, + return pimpl->Parallel(&Module::getClockFrequency, pos, defs::SYNC_CLOCK); } Result Detector::getADCPipeline(Positions pos) const { - return pimpl->Parallel(&slsDetector::getPipeline, pos, defs::ADC_CLOCK); + return pimpl->Parallel(&Module::getPipeline, pos, defs::ADC_CLOCK); } void Detector::setADCPipeline(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setPipeline, pos, defs::ADC_CLOCK, value); + pimpl->Parallel(&Module::setPipeline, pos, defs::ADC_CLOCK, value); } Result Detector::getDBITPipeline(Positions pos) const { - return pimpl->Parallel(&slsDetector::getPipeline, pos, defs::DBIT_CLOCK); + return pimpl->Parallel(&Module::getPipeline, pos, defs::DBIT_CLOCK); } Result Detector::getVoltage(defs::dacIndex index, Positions pos) const { @@ -1316,7 +1316,7 @@ Result Detector::getVoltage(defs::dacIndex index, Positions pos) const { default: throw RuntimeError("Unknown Voltage Index"); } - return pimpl->Parallel(&slsDetector::setDAC, pos, -1, index, 1); + return pimpl->Parallel(&Module::setDAC, pos, -1, index, 1); } void Detector::setVoltage(defs::dacIndex index, int value, Positions pos) { @@ -1332,56 +1332,56 @@ void Detector::setVoltage(defs::dacIndex index, int value, Positions pos) { default: throw RuntimeError("Unknown Voltage Index"); } - pimpl->Parallel(&slsDetector::setDAC, pos, value, index, 1); + pimpl->Parallel(&Module::setDAC, pos, value, index, 1); } Result Detector::getADCEnableMask(Positions pos) const { - return pimpl->Parallel(&slsDetector::getADCEnableMask, pos); + return pimpl->Parallel(&Module::getADCEnableMask, pos); } void Detector::setADCEnableMask(uint32_t mask, Positions pos) { - pimpl->Parallel(&slsDetector::setADCEnableMask, pos, mask); + pimpl->Parallel(&Module::setADCEnableMask, pos, mask); } Result Detector::getTenGigaADCEnableMask(Positions pos) const { - return pimpl->Parallel(&slsDetector::getTenGigaADCEnableMask, pos); + return pimpl->Parallel(&Module::getTenGigaADCEnableMask, pos); } void Detector::setTenGigaADCEnableMask(uint32_t mask, Positions pos) { - pimpl->Parallel(&slsDetector::setTenGigaADCEnableMask, pos, mask); + pimpl->Parallel(&Module::setTenGigaADCEnableMask, pos, mask); } // CTB Specific Result Detector::getNumberOfDigitalSamples(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfDigitalSamples, pos); + return pimpl->Parallel(&Module::getNumberOfDigitalSamples, pos); } void Detector::setNumberOfDigitalSamples(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setNumberOfDigitalSamples, pos, value); + pimpl->Parallel(&Module::setNumberOfDigitalSamples, pos, value); } Result Detector::getReadoutMode(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReadoutMode, pos); + return pimpl->Parallel(&Module::getReadoutMode, pos); } void Detector::setReadoutMode(defs::readoutMode value, Positions pos) { - pimpl->Parallel(&slsDetector::setReadoutMode, pos, value); + pimpl->Parallel(&Module::setReadoutMode, pos, value); } Result Detector::getDBITClock(Positions pos) const { - return pimpl->Parallel(&slsDetector::getClockFrequency, pos, + return pimpl->Parallel(&Module::getClockFrequency, pos, defs::DBIT_CLOCK); } void Detector::setDBITClock(int value_in_MHz, Positions pos) { - pimpl->Parallel(&slsDetector::setClockFrequency, pos, defs::DBIT_CLOCK, + pimpl->Parallel(&Module::setClockFrequency, pos, defs::DBIT_CLOCK, value_in_MHz); } void Detector::setDBITPipeline(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setPipeline, pos, defs::DBIT_CLOCK, value); + pimpl->Parallel(&Module::setPipeline, pos, defs::DBIT_CLOCK, value); } Result Detector::getMeasuredVoltage(defs::dacIndex index, @@ -1397,7 +1397,7 @@ Result Detector::getMeasuredVoltage(defs::dacIndex index, default: throw RuntimeError("Unknown Voltage Index"); } - return pimpl->Parallel(&slsDetector::getADC, pos, index); + return pimpl->Parallel(&Module::getADC, pos, index); } Result Detector::getMeasuredCurrent(defs::dacIndex index, @@ -1412,58 +1412,58 @@ Result Detector::getMeasuredCurrent(defs::dacIndex index, default: throw RuntimeError("Unknown Current Index"); } - return pimpl->Parallel(&slsDetector::getADC, pos, index); + return pimpl->Parallel(&Module::getADC, pos, index); } Result Detector::getSlowADC(defs::dacIndex index, Positions pos) const { if (index < defs::SLOW_ADC0 || index > defs::SLOW_ADC7) { throw RuntimeError("Unknown Slow ADC Index"); } - return pimpl->Parallel(&slsDetector::getADC, pos, index); + return pimpl->Parallel(&Module::getADC, pos, index); } Result Detector::getExternalSamplingSource(Positions pos) const { - return pimpl->Parallel(&slsDetector::getExternalSamplingSource, pos); + return pimpl->Parallel(&Module::getExternalSamplingSource, pos); } void Detector::setExternalSamplingSource(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setExternalSamplingSource, pos, value); + pimpl->Parallel(&Module::setExternalSamplingSource, pos, value); } Result Detector::getExternalSampling(Positions pos) const { - return pimpl->Parallel(&slsDetector::getExternalSampling, pos); + return pimpl->Parallel(&Module::getExternalSampling, pos); } void Detector::setExternalSampling(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setExternalSampling, pos, value); + pimpl->Parallel(&Module::setExternalSampling, pos, value); } Result> Detector::getRxDbitList(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverDbitList, pos); + return pimpl->Parallel(&Module::getReceiverDbitList, pos); } void Detector::setRxDbitList(const std::vector& list, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverDbitList, pos, list); + pimpl->Parallel(&Module::setReceiverDbitList, pos, list); } Result Detector::getRxDbitOffset(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverDbitOffset, pos); + return pimpl->Parallel(&Module::getReceiverDbitOffset, pos); } void Detector::setRxDbitOffset(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setReceiverDbitOffset, pos, value); + pimpl->Parallel(&Module::setReceiverDbitOffset, pos, value); } void Detector::setDigitalIODelay(uint64_t pinMask, int delay, Positions pos) { - pimpl->Parallel(&slsDetector::setDigitalIODelay, pos, pinMask, delay); + pimpl->Parallel(&Module::setDigitalIODelay, pos, pinMask, delay); } Result Detector::getLEDEnable(Positions pos) const { - return pimpl->Parallel(&slsDetector::setLEDEnable, pos, -1); + return pimpl->Parallel(&Module::setLEDEnable, pos, -1); } void Detector::setLEDEnable(bool enable, Positions pos) { - pimpl->Parallel(&slsDetector::setLEDEnable, pos, static_cast(enable)); + pimpl->Parallel(&Module::setLEDEnable, pos, static_cast(enable)); } // Pattern @@ -1475,7 +1475,7 @@ void Detector::savePattern(const std::string &fname) { throw RuntimeError("Could not create file to save pattern"); } // get pattern limits - auto r = pimpl->Parallel(&slsDetector::setPatternLoopAddresses, {}, -1, -1, -1) + auto r = pimpl->Parallel(&Module::setPatternLoopAddresses, {}, -1, -1, -1) .tsquash("Inconsistent pattern limits"); CmdProxy proxy(this); @@ -1511,110 +1511,110 @@ void Detector::savePattern(const std::string &fname) { } void Detector::setPattern(const std::string &fname, Positions pos) { - pimpl->Parallel(&slsDetector::setPattern, pos, fname); + pimpl->Parallel(&Module::setPattern, pos, fname); } Result Detector::getPatternIOControl(Positions pos) const { - return pimpl->Parallel(&slsDetector::setPatternIOControl, pos, -1); + return pimpl->Parallel(&Module::setPatternIOControl, pos, -1); } void Detector::setPatternIOControl(uint64_t word, Positions pos) { - pimpl->Parallel(&slsDetector::setPatternIOControl, pos, word); + pimpl->Parallel(&Module::setPatternIOControl, pos, word); } Result Detector::getPatternClockControl(Positions pos) const { - return pimpl->Parallel(&slsDetector::setPatternClockControl, pos, -1); + return pimpl->Parallel(&Module::setPatternClockControl, pos, -1); } void Detector::setPatternClockControl(uint64_t word, Positions pos) { - pimpl->Parallel(&slsDetector::setPatternClockControl, pos, word); + pimpl->Parallel(&Module::setPatternClockControl, pos, word); } Result Detector::getPatternWord(int addr, Positions pos) { - return pimpl->Parallel(&slsDetector::setPatternWord, pos, addr, -1); + return pimpl->Parallel(&Module::setPatternWord, pos, addr, -1); } void Detector::setPatternWord(int addr, uint64_t word, Positions pos) { - pimpl->Parallel(&slsDetector::setPatternWord, pos, addr, word); + pimpl->Parallel(&Module::setPatternWord, pos, addr, word); } Result> Detector::getPatternLoopAddresses(int level, Positions pos) const { - return pimpl->Parallel(&slsDetector::setPatternLoopAddresses, pos, level, + return pimpl->Parallel(&Module::setPatternLoopAddresses, pos, level, -1, -1); } void Detector::setPatternLoopAddresses(int level, int start, int stop, Positions pos) { - pimpl->Parallel(&slsDetector::setPatternLoopAddresses, pos, level, start, + pimpl->Parallel(&Module::setPatternLoopAddresses, pos, level, start, stop); } Result Detector::getPatternLoopCycles(int level, Positions pos) const { - return pimpl->Parallel(&slsDetector::setPatternLoopCycles, pos, level, -1); + return pimpl->Parallel(&Module::setPatternLoopCycles, pos, level, -1); } void Detector::setPatternLoopCycles(int level, int n, Positions pos) { - pimpl->Parallel(&slsDetector::setPatternLoopCycles, pos, level, n); + pimpl->Parallel(&Module::setPatternLoopCycles, pos, level, n); } Result Detector::getPatternWaitAddr(int level, Positions pos) const { - return pimpl->Parallel(&slsDetector::setPatternWaitAddr, pos, level, -1); + return pimpl->Parallel(&Module::setPatternWaitAddr, pos, level, -1); } void Detector::setPatternWaitAddr(int level, int addr, Positions pos) { - pimpl->Parallel(&slsDetector::setPatternWaitAddr, pos, level, addr); + pimpl->Parallel(&Module::setPatternWaitAddr, pos, level, addr); } Result Detector::getPatternWaitTime(int level, Positions pos) const { - return pimpl->Parallel(&slsDetector::setPatternWaitTime, pos, level, -1); + return pimpl->Parallel(&Module::setPatternWaitTime, pos, level, -1); } void Detector::setPatternWaitTime(int level, uint64_t t, Positions pos) { - pimpl->Parallel(&slsDetector::setPatternWaitTime, pos, level, t); + pimpl->Parallel(&Module::setPatternWaitTime, pos, level, t); } Result Detector::getPatternMask(Positions pos) { - return pimpl->Parallel(&slsDetector::getPatternMask, pos); + return pimpl->Parallel(&Module::getPatternMask, pos); } void Detector::setPatternMask(uint64_t mask, Positions pos) { - pimpl->Parallel(&slsDetector::setPatternMask, pos, mask); + pimpl->Parallel(&Module::setPatternMask, pos, mask); } Result Detector::getPatternBitMask(Positions pos) const { - return pimpl->Parallel(&slsDetector::getPatternBitMask, pos); + return pimpl->Parallel(&Module::getPatternBitMask, pos); } void Detector::setPatternBitMask(uint64_t mask, Positions pos) { - pimpl->Parallel(&slsDetector::setPatternBitMask, pos, mask); + pimpl->Parallel(&Module::setPatternBitMask, pos, mask); } // Moench Result Detector::getAdditionalJsonHeader(Positions pos) const { - return pimpl->Parallel(&slsDetector::getAdditionalJsonHeader, pos); + return pimpl->Parallel(&Module::getAdditionalJsonHeader, pos); } void Detector::setAdditionalJsonHeader(const std::string &jsonheader, Positions pos) { - pimpl->Parallel(&slsDetector::setAdditionalJsonHeader, pos, jsonheader); + pimpl->Parallel(&Module::setAdditionalJsonHeader, pos, jsonheader); } Result Detector::getAdditionalJsonParameter(const std::string &key, Positions pos) const { - return pimpl->Parallel(&slsDetector::getAdditionalJsonParameter, pos, key); + return pimpl->Parallel(&Module::getAdditionalJsonParameter, pos, key); } void Detector::setAdditionalJsonParameter(const std::string &key, const std::string &value, Positions pos) { - pimpl->Parallel(&slsDetector::setAdditionalJsonParameter, pos, key, value); + pimpl->Parallel(&Module::setAdditionalJsonParameter, pos, key, value); } Result Detector::getDetectorMinMaxEnergyThreshold(const bool isEmax, Positions pos) const { - auto res = pimpl->Parallel(&slsDetector::getAdditionalJsonParameter, pos, + auto res = pimpl->Parallel(&Module::getAdditionalJsonParameter, pos, isEmax ? "emax" : "emin"); Result intResult(res.size()); try { @@ -1631,12 +1631,12 @@ Result Detector::getDetectorMinMaxEnergyThreshold(const bool isEmax, void Detector::setDetectorMinMaxEnergyThreshold(const bool isEmax, const int value, Positions pos) { - pimpl->Parallel(&slsDetector::setAdditionalJsonParameter, pos, + pimpl->Parallel(&Module::setAdditionalJsonParameter, pos, isEmax ? "emax" : "emin", std::to_string(value)); } Result Detector::getFrameMode(Positions pos) const { - auto res = pimpl->Parallel(&slsDetector::getAdditionalJsonParameter, pos, + auto res = pimpl->Parallel(&Module::getAdditionalJsonParameter, pos, "frameMode"); Result intResult(res.size()); try { @@ -1652,12 +1652,12 @@ Result Detector::getFrameMode(Positions pos) const { } void Detector::setFrameMode(defs::frameModeType value, Positions pos) { - pimpl->Parallel(&slsDetector::setAdditionalJsonParameter, pos, "frameMode", + pimpl->Parallel(&Module::setAdditionalJsonParameter, pos, "frameMode", sls::ToString(value)); } Result Detector::getDetectorMode(Positions pos) const { - auto res = pimpl->Parallel(&slsDetector::getAdditionalJsonParameter, pos, + auto res = pimpl->Parallel(&Module::getAdditionalJsonParameter, pos, "detectorMode"); Result intResult(res.size()); try { @@ -1673,7 +1673,7 @@ Result Detector::getDetectorMode(Positions pos) const { } void Detector::setDetectorMode(defs::detectorModeType value, Positions pos) { - pimpl->Parallel(&slsDetector::setAdditionalJsonParameter, pos, + pimpl->Parallel(&Module::setAdditionalJsonParameter, pos, "detectorMode", sls::ToString(value)); } @@ -1681,58 +1681,58 @@ void Detector::setDetectorMode(defs::detectorModeType value, Positions pos) { void Detector::programFPGA(const std::string &fname, Positions pos) { std::vector buffer = pimpl->readProgrammingFile(fname); - pimpl->Parallel(&slsDetector::programFPGA, pos, buffer); + pimpl->Parallel(&Module::programFPGA, pos, buffer); } void Detector::resetFPGA(Positions pos) { - pimpl->Parallel(&slsDetector::resetFPGA, pos); + pimpl->Parallel(&Module::resetFPGA, pos); } void Detector::copyDetectorServer(const std::string &fname, const std::string &hostname, Positions pos) { - pimpl->Parallel(&slsDetector::copyDetectorServer, pos, fname, hostname); + pimpl->Parallel(&Module::copyDetectorServer, pos, fname, hostname); rebootController(pos); } void Detector::rebootController(Positions pos) { - pimpl->Parallel(&slsDetector::rebootController, pos); + pimpl->Parallel(&Module::rebootController, pos); } void Detector::updateFirmwareAndServer(const std::string &sname, const std::string &hostname, const std::string &fname, Positions pos) { - pimpl->Parallel(&slsDetector::copyDetectorServer, pos, sname, hostname); + pimpl->Parallel(&Module::copyDetectorServer, pos, sname, hostname); programFPGA(fname, pos); rebootController(pos); } Result Detector::readRegister(uint32_t addr, Positions pos) const { - return pimpl->Parallel(&slsDetector::readRegister, pos, addr); + return pimpl->Parallel(&Module::readRegister, pos, addr); } void Detector::writeRegister(uint32_t addr, uint32_t val, Positions pos) { - pimpl->Parallel(&slsDetector::writeRegister, pos, addr, val); + pimpl->Parallel(&Module::writeRegister, pos, addr, val); } void Detector::setBit(uint32_t addr, int bitnr, Positions pos) { - pimpl->Parallel(&slsDetector::setBit, pos, addr, bitnr); + pimpl->Parallel(&Module::setBit, pos, addr, bitnr); } void Detector::clearBit(uint32_t addr, int bitnr, Positions pos) { - pimpl->Parallel(&slsDetector::clearBit, pos, addr, bitnr); + pimpl->Parallel(&Module::clearBit, pos, addr, bitnr); } void Detector::executeFirmwareTest(Positions pos) { - pimpl->Parallel(&slsDetector::executeFirmwareTest, pos); + pimpl->Parallel(&Module::executeFirmwareTest, pos); } void Detector::executeBusTest(Positions pos) { - pimpl->Parallel(&slsDetector::executeBusTest, pos); + pimpl->Parallel(&Module::executeBusTest, pos); } void Detector::writeAdcRegister(uint32_t addr, uint32_t value, Positions pos) { - pimpl->Parallel(&slsDetector::writeAdcRegister, pos, addr, value); + pimpl->Parallel(&Module::writeAdcRegister, pos, addr, value); } bool Detector::getInitialChecks() const { @@ -1744,63 +1744,63 @@ void Detector::setInitialChecks(const bool value) { } Result Detector::getADCInvert(Positions pos) const { - return pimpl->Parallel(&slsDetector::getADCInvert, pos); + return pimpl->Parallel(&Module::getADCInvert, pos); } void Detector::setADCInvert(uint32_t value, Positions pos) { - pimpl->Parallel(&slsDetector::setADCInvert, pos, value); + pimpl->Parallel(&Module::setADCInvert, pos, value); } // Insignificant Result Detector::getControlPort(Positions pos) const { - return pimpl->Parallel(&slsDetector::getControlPort, pos); + return pimpl->Parallel(&Module::getControlPort, pos); } void Detector::setControlPort(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setControlPort, pos, value); + pimpl->Parallel(&Module::setControlPort, pos, value); } Result Detector::getStopPort(Positions pos) const { - return pimpl->Parallel(&slsDetector::getStopPort, pos); + return pimpl->Parallel(&Module::getStopPort, pos); } void Detector::setStopPort(int value, Positions pos) { - pimpl->Parallel(&slsDetector::setStopPort, pos, value); + pimpl->Parallel(&Module::setStopPort, pos, value); } Result Detector::getDetectorLock(Positions pos) const { - return pimpl->Parallel(&slsDetector::lockServer, pos, -1); + return pimpl->Parallel(&Module::lockServer, pos, -1); } void Detector::setDetectorLock(bool lock, Positions pos) { - pimpl->Parallel(&slsDetector::lockServer, pos, static_cast(lock)); + pimpl->Parallel(&Module::lockServer, pos, static_cast(lock)); } Result Detector::getLastClientIP(Positions pos) const { - return pimpl->Parallel(&slsDetector::getLastClientIP, pos); + return pimpl->Parallel(&Module::getLastClientIP, pos); } void Detector::executeCommand(const std::string &value, Positions pos) { - pimpl->Parallel(&slsDetector::execCommand, pos, value); + pimpl->Parallel(&Module::execCommand, pos, value); } Result Detector::getNumberOfFramesFromStart(Positions pos) const { - return pimpl->Parallel(&slsDetector::getNumberOfFramesFromStart, pos); + return pimpl->Parallel(&Module::getNumberOfFramesFromStart, pos); } Result Detector::getActualTime(Positions pos) const { - return pimpl->Parallel(&slsDetector::getActualTime, pos); + return pimpl->Parallel(&Module::getActualTime, pos); } Result Detector::getMeasurementTime(Positions pos) const { - return pimpl->Parallel(&slsDetector::getMeasurementTime, pos); + return pimpl->Parallel(&Module::getMeasurementTime, pos); } std::string Detector::getUserDetails() const { return pimpl->getUserDetails(); } Result Detector::getRxCurrentFrameIndex(Positions pos) const { - return pimpl->Parallel(&slsDetector::getReceiverCurrentFrameIndex, pos); + return pimpl->Parallel(&Module::getReceiverCurrentFrameIndex, pos); } std::vector Detector::getPortNumbers(int start_port) { diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 7e49614b0..863daf6d7 100755 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -4,7 +4,7 @@ #include "detectorData.h" #include "file_utils.h" #include "logger.h" -#include "slsDetector.h" +#include "Module.h" #include "sls_detector_exceptions.h" #include "versionAPI.h" @@ -172,7 +172,7 @@ void DetectorImpl::initializeMembers(bool verify) { for (int i = 0; i < multi_shm()->numberOfDetectors; i++) { try { detectors.push_back( - sls::make_unique(multiId, i, verify)); + sls::make_unique(multiId, i, verify)); } catch (...) { detectors.clear(); throw; @@ -275,17 +275,17 @@ void DetectorImpl::addSlsDetector(const std::string &hostname) { } // get type by connecting - detectorType type = slsDetector::getTypeFromDetector(host, port); + detectorType type = Module::getTypeFromDetector(host, port); auto pos = detectors.size(); detectors.emplace_back( - sls::make_unique(type, multiId, pos, false)); + sls::make_unique(type, multiId, pos, false)); multi_shm()->numberOfDetectors = detectors.size(); detectors[pos]->setControlPort(port); detectors[pos]->setStopPort(port + 1); detectors[pos]->setHostname(host, multi_shm()->initialChecks); // detector type updated by now multi_shm()->multiDetectorType = - Parallel(&slsDetector::getDetectorType, {}) + Parallel(&Module::getDetectorType, {}) .tsquash("Inconsistent detector types."); // for moench and ctb detectors[pos]->updateNumberOfChannels(); @@ -345,10 +345,10 @@ void DetectorImpl::setNumberOfChannels(const slsDetectorDefs::xy c) { } void DetectorImpl::setGapPixelsinReceiver(bool enable) { - Parallel(&slsDetector::enableGapPixels, {}, static_cast(enable)); + Parallel(&Module::enableGapPixels, {}, static_cast(enable)); // update number of channels Result res = - Parallel(&slsDetector::getNumberOfChannels, {}); + Parallel(&Module::getNumberOfChannels, {}); multi_shm()->numberOfChannels.x = 0; multi_shm()->numberOfChannels.y = 0; for (auto &it : res) { @@ -377,7 +377,7 @@ int DetectorImpl::createReceivingDataSockets(const bool destroy) { if (multi_shm()->multiDetectorType == EIGER) { numSocketsPerDetector = 2; } - if (Parallel(&slsDetector::getNumberofUDPInterfacesFromShm, {}).squash() == + if (Parallel(&Module::getNumberofUDPInterfacesFromShm, {}).squash() == 2) { numSocketsPerDetector = 2; } @@ -419,7 +419,7 @@ void DetectorImpl::readFrameFromReceiver() { bool quadEnable = false; bool eiger = false; bool numInterfaces = - Parallel(&slsDetector::getNumberofUDPInterfacesFromShm, {}) + Parallel(&Module::getNumberofUDPInterfacesFromShm, {}) .squash(); // cannot pick up from zmq bool runningList[zmqSocket.size()], connectList[zmqSocket.size()]; @@ -829,7 +829,7 @@ void DetectorImpl::savePattern(const std::string &fname) { // throw RuntimeError("Could not create file to save pattern"); // } // // get pattern limits - // auto r = Parallel(&slsDetector::setPatternLoopAddresses, {}, -1, -1, -1) + // auto r = Parallel(&Module::setPatternLoopAddresses, {}, -1, -1, -1) // .tsquash("Inconsistent pattern limits"); // // pattern words // for (int i = r[0]; i <= r[1]; ++i) { @@ -879,7 +879,7 @@ void DetectorImpl::registerDataCallback(void (*userCallback)(detectorData *, } double DetectorImpl::setTotalProgress() { - int64_t tot = Parallel(&slsDetector::getTotalNumFramesToReceive, {}) + int64_t tot = Parallel(&Module::getTotalNumFramesToReceive, {}) .tsquash("Inconsistent number of total frames (#frames x #triggers(or bursts) x #storage cells)"); if (tot == 0) { throw RuntimeError("Invalid Total Number of frames (0)"); @@ -929,15 +929,15 @@ int DetectorImpl::acquire() { sem_init(&sem_endRTAcquisition, 1, 0); bool receiver = - Parallel(&slsDetector::getUseReceiverFlag, {}).squash(false); + Parallel(&Module::getUseReceiverFlag, {}).squash(false); progressIndex = 0; setJoinThreadFlag(false); // verify receiver is idle if (receiver) { - if (Parallel(&slsDetector::getReceiverStatus, {}).squash(ERROR) != + if (Parallel(&Module::getReceiverStatus, {}).squash(ERROR) != IDLE) { - Parallel(&slsDetector::stopReceiver, {}); + Parallel(&Module::stopReceiver, {}); } } setTotalProgress(); @@ -946,7 +946,7 @@ int DetectorImpl::acquire() { // start receiver if (receiver) { - Parallel(&slsDetector::startReceiver, {}); + Parallel(&Module::startReceiver, {}); // let processing thread listen to these packets sem_post(&sem_newRTAcquisition); } @@ -954,24 +954,24 @@ int DetectorImpl::acquire() { // start and read all try { if (multi_shm()->multiDetectorType == EIGER) { - Parallel(&slsDetector::prepareAcquisition, {}); + Parallel(&Module::prepareAcquisition, {}); } - Parallel(&slsDetector::startAndReadAll, {}); + Parallel(&Module::startAndReadAll, {}); } catch (...) { - Parallel(&slsDetector::stopReceiver, {}); + Parallel(&Module::stopReceiver, {}); throw; } // stop receiver if (receiver) { - Parallel(&slsDetector::stopReceiver, {}); + Parallel(&Module::stopReceiver, {}); if (dataReady != nullptr) { sem_wait(&sem_endRTAcquisition); // waits for receiver's } // external process to be // done sending data to gui - Parallel(&slsDetector::incrementFileIndex, {}); + Parallel(&Module::incrementFileIndex, {}); } // waiting for the data processing thread to finish! @@ -982,7 +982,7 @@ int DetectorImpl::acquire() { if (acquisition_finished != nullptr) { // same status for all, else error int status = static_cast(ERROR); - auto t = Parallel(&slsDetector::getRunStatus, {}); + auto t = Parallel(&Module::getRunStatus, {}); if (t.equal()) status = t.front(); acquisition_finished(getCurrentProgress(), status, acqFinished_p); @@ -1010,7 +1010,7 @@ void DetectorImpl::startProcessingThread() { } void DetectorImpl::processData() { - if (Parallel(&slsDetector::getUseReceiverFlag, {}).squash(false)) { + if (Parallel(&Module::getUseReceiverFlag, {}).squash(false)) { if (dataReady != nullptr) { readFrameFromReceiver(); } @@ -1023,11 +1023,11 @@ void DetectorImpl::processData() { if (fgetc(stdin) == 'q') { LOG(logINFO) << "Caught the command to stop acquisition"; - Parallel(&slsDetector::stopAcquisition, {}); + Parallel(&Module::stopAcquisition, {}); } } // get progress - caught = Parallel(&slsDetector::getFramesCaughtByReceiver, {0}) + caught = Parallel(&Module::getFramesCaughtByReceiver, {0}) .squash(); // updating progress diff --git a/slsDetectorSoftware/src/DetectorImpl.h b/slsDetectorSoftware/src/DetectorImpl.h index f2bc44270..822deed95 100755 --- a/slsDetectorSoftware/src/DetectorImpl.h +++ b/slsDetectorSoftware/src/DetectorImpl.h @@ -5,7 +5,10 @@ #include "logger.h" #include "sls_detector_defs.h" -class slsDetector; +namespace sls{ + class Module; +} + class ZmqSocket; class detectorData; @@ -87,7 +90,7 @@ class DetectorImpl : public virtual slsDetectorDefs { template struct NonDeduced { using type = CT; }; template - sls::Result Parallel(RT (slsDetector::*somefunc)(CT...), + sls::Result Parallel(RT (sls::Module::*somefunc)(CT...), std::vector positions, typename NonDeduced::type... Args) { @@ -115,7 +118,7 @@ class DetectorImpl : public virtual slsDetectorDefs { } template - sls::Result Parallel(RT (slsDetector::*somefunc)(CT...) const, + sls::Result Parallel(RT (sls::Module::*somefunc)(CT...) const, std::vector positions, typename NonDeduced::type... Args) const { @@ -143,7 +146,7 @@ class DetectorImpl : public virtual slsDetectorDefs { } template - void Parallel(void (slsDetector::*somefunc)(CT...), + void Parallel(void (sls::Module::*somefunc)(CT...), std::vector positions, typename NonDeduced::type... Args) { @@ -168,7 +171,7 @@ class DetectorImpl : public virtual slsDetectorDefs { } template - void Parallel(void (slsDetector::*somefunc)(CT...) const, + void Parallel(void (sls::Module::*somefunc)(CT...) const, std::vector positions, typename NonDeduced::type... Args) const { @@ -404,8 +407,8 @@ class DetectorImpl : public virtual slsDetectorDefs { /** Shared Memory object */ sls::SharedMemory multi_shm{0, -1}; - /** pointers to the slsDetector structures */ - std::vector> detectors; + /** pointers to the Module structures */ + std::vector> detectors; /** data streaming (down stream) enabled in client (zmq sckets created) */ bool client_downstream{false}; diff --git a/slsDetectorSoftware/src/slsDetector.cpp b/slsDetectorSoftware/src/Module.cpp similarity index 86% rename from slsDetectorSoftware/src/slsDetector.cpp rename to slsDetectorSoftware/src/Module.cpp index 90c68dc92..2cf1b3f6f 100755 --- a/slsDetectorSoftware/src/slsDetector.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1,4 +1,4 @@ -#include "slsDetector.h" +#include "Module.h" #include "ClientSocket.h" #include "SharedMemory.h" #include "ToString.h" @@ -22,10 +22,10 @@ #include -using namespace sls; +namespace sls{ // create shm -slsDetector::slsDetector(detectorType type, int multi_id, int det_id, +Module::Module(detectorType type, int multi_id, int det_id, bool verify) : detId(det_id), shm(multi_id, det_id) { @@ -41,7 +41,7 @@ slsDetector::slsDetector(detectorType type, int multi_id, int det_id, } // pick up from shm -slsDetector::slsDetector(int multi_id, int det_id, bool verify) +Module::Module(int multi_id, int det_id, bool verify) : detId(det_id), shm(multi_id, det_id) { // getDetectorType From shm will check if it was already existing @@ -49,13 +49,13 @@ slsDetector::slsDetector(int multi_id, int det_id, bool verify) initSharedMemory(type, multi_id, verify); } -slsDetector::~slsDetector() = default; +Module::~Module() = default; -bool slsDetector::isFixedPatternSharedMemoryCompatible() { +bool Module::isFixedPatternSharedMemoryCompatible() { return (shm()->shmversion >= SLS_SHMAPIVERSION); } -void slsDetector::checkDetectorVersionCompatibility() { +void Module::checkDetectorVersionCompatibility() { int fnum = F_CHECK_VERSION; int64_t arg = 0; @@ -94,7 +94,7 @@ void slsDetector::checkDetectorVersionCompatibility() { sendToDetectorStop(fnum, arg, nullptr); } -void slsDetector::checkReceiverVersionCompatibility() { +void Module::checkReceiverVersionCompatibility() { // TODO! Verify that this works as intended when version don't match int64_t arg = APIRECEIVER; LOG(logDEBUG1) @@ -103,21 +103,21 @@ void slsDetector::checkReceiverVersionCompatibility() { sendToReceiver(F_RECEIVER_CHECK_VERSION, arg, nullptr); } -int64_t slsDetector::getFirmwareVersion() { +int64_t Module::getFirmwareVersion() { int64_t retval = -1; sendToDetector(F_GET_FIRMWARE_VERSION, nullptr, retval); LOG(logDEBUG1) << "firmware version: 0x" << std::hex << retval << std::dec; return retval; } -int64_t slsDetector::getDetectorServerVersion() { +int64_t Module::getDetectorServerVersion() { int64_t retval = -1; sendToDetector(F_GET_SERVER_VERSION, nullptr, retval); LOG(logDEBUG1) << "firmware version: 0x" << std::hex << retval << std::dec; return retval; } -int64_t slsDetector::getSerialNumber() { +int64_t Module::getSerialNumber() { int64_t retval = -1; sendToDetector(F_GET_SERIAL_NUMBER, nullptr, retval); LOG(logDEBUG1) << "firmware version: 0x" << std::hex << retval << std::dec; @@ -125,7 +125,7 @@ int64_t slsDetector::getSerialNumber() { } -int64_t slsDetector::getReceiverSoftwareVersion() const { +int64_t Module::getReceiverSoftwareVersion() const { LOG(logDEBUG1) << "Getting receiver software version"; int64_t retval = -1; if (shm()->useReceiverFlag) { @@ -134,7 +134,7 @@ int64_t slsDetector::getReceiverSoftwareVersion() const { return retval; } -void slsDetector::sendToDetector(int fnum, const void *args, size_t args_size, +void Module::sendToDetector(int fnum, const void *args, size_t args_size, void *retval, size_t retval_size) { auto client = DetectorSocket(shm()->hostname, shm()->controlPort); auto ret = @@ -146,32 +146,32 @@ void slsDetector::sendToDetector(int fnum, const void *args, size_t args_size, } template -void slsDetector::sendToDetector(int fnum, const Arg &args, Ret &retval) { +void Module::sendToDetector(int fnum, const Arg &args, Ret &retval) { sendToDetector(fnum, &args, sizeof(args), &retval, sizeof(retval)); } template -void slsDetector::sendToDetector(int fnum, const Arg &args, std::nullptr_t) { +void Module::sendToDetector(int fnum, const Arg &args, std::nullptr_t) { sendToDetector(fnum, &args, sizeof(args), nullptr, 0); } template -void slsDetector::sendToDetector(int fnum, std::nullptr_t, Ret &retval) { +void Module::sendToDetector(int fnum, std::nullptr_t, Ret &retval) { sendToDetector(fnum, nullptr, 0, &retval, sizeof(retval)); } -void slsDetector::sendToDetector(int fnum) { +void Module::sendToDetector(int fnum) { sendToDetector(fnum, nullptr, 0, nullptr, 0); } -void slsDetector::sendToDetectorStop(int fnum, const void *args, +void Module::sendToDetectorStop(int fnum, const void *args, size_t args_size, void *retval, size_t retval_size) { - static_cast(*this).sendToDetectorStop( + static_cast(*this).sendToDetectorStop( fnum, args, args_size, retval, retval_size); } -void slsDetector::sendToDetectorStop(int fnum, const void *args, +void Module::sendToDetectorStop(int fnum, const void *args, size_t args_size, void *retval, size_t retval_size) const { auto stop = DetectorSocket(shm()->hostname, shm()->stopPort); @@ -180,54 +180,54 @@ void slsDetector::sendToDetectorStop(int fnum, const void *args, } template -void slsDetector::sendToDetectorStop(int fnum, const Arg &args, Ret &retval) { +void Module::sendToDetectorStop(int fnum, const Arg &args, Ret &retval) { sendToDetectorStop(fnum, &args, sizeof(args), &retval, sizeof(retval)); } template -void slsDetector::sendToDetectorStop(int fnum, const Arg &args, +void Module::sendToDetectorStop(int fnum, const Arg &args, Ret &retval) const { sendToDetectorStop(fnum, &args, sizeof(args), &retval, sizeof(retval)); } template -void slsDetector::sendToDetectorStop(int fnum, const Arg &args, +void Module::sendToDetectorStop(int fnum, const Arg &args, std::nullptr_t) { sendToDetectorStop(fnum, &args, sizeof(args), nullptr, 0); } template -void slsDetector::sendToDetectorStop(int fnum, const Arg &args, +void Module::sendToDetectorStop(int fnum, const Arg &args, std::nullptr_t) const { sendToDetectorStop(fnum, &args, sizeof(args), nullptr, 0); } template -void slsDetector::sendToDetectorStop(int fnum, std::nullptr_t, Ret &retval) { +void Module::sendToDetectorStop(int fnum, std::nullptr_t, Ret &retval) { sendToDetectorStop(fnum, nullptr, 0, &retval, sizeof(retval)); } template -void slsDetector::sendToDetectorStop(int fnum, std::nullptr_t, +void Module::sendToDetectorStop(int fnum, std::nullptr_t, Ret &retval) const { sendToDetectorStop(fnum, nullptr, 0, &retval, sizeof(retval)); } -void slsDetector::sendToDetectorStop(int fnum) { +void Module::sendToDetectorStop(int fnum) { sendToDetectorStop(fnum, nullptr, 0, nullptr, 0); } -void slsDetector::sendToDetectorStop(int fnum) const { +void Module::sendToDetectorStop(int fnum) const { sendToDetectorStop(fnum, nullptr, 0, nullptr, 0); } -void slsDetector::sendToReceiver(int fnum, const void *args, size_t args_size, +void Module::sendToReceiver(int fnum, const void *args, size_t args_size, void *retval, size_t retval_size) { - static_cast(*this).sendToReceiver( + static_cast(*this).sendToReceiver( fnum, args, args_size, retval, retval_size); } -void slsDetector::sendToReceiver(int fnum, const void *args, size_t args_size, +void Module::sendToReceiver(int fnum, const void *args, size_t args_size, void *retval, size_t retval_size) const { auto receiver = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort); receiver.sendCommandThenRead(fnum, args, args_size, retval, retval_size); @@ -235,51 +235,51 @@ void slsDetector::sendToReceiver(int fnum, const void *args, size_t args_size, } template -void slsDetector::sendToReceiver(int fnum, const Arg &args, Ret &retval) { +void Module::sendToReceiver(int fnum, const Arg &args, Ret &retval) { sendToReceiver(fnum, &args, sizeof(args), &retval, sizeof(retval)); } template -void slsDetector::sendToReceiver(int fnum, const Arg &args, Ret &retval) const { +void Module::sendToReceiver(int fnum, const Arg &args, Ret &retval) const { sendToReceiver(fnum, &args, sizeof(args), &retval, sizeof(retval)); } template -void slsDetector::sendToReceiver(int fnum, const Arg &args, std::nullptr_t) { +void Module::sendToReceiver(int fnum, const Arg &args, std::nullptr_t) { sendToReceiver(fnum, &args, sizeof(args), nullptr, 0); } template -void slsDetector::sendToReceiver(int fnum, const Arg &args, +void Module::sendToReceiver(int fnum, const Arg &args, std::nullptr_t) const { sendToReceiver(fnum, &args, sizeof(args), nullptr, 0); } template -void slsDetector::sendToReceiver(int fnum, std::nullptr_t, Ret &retval) { +void Module::sendToReceiver(int fnum, std::nullptr_t, Ret &retval) { sendToReceiver(fnum, nullptr, 0, &retval, sizeof(retval)); } template -void slsDetector::sendToReceiver(int fnum, std::nullptr_t, Ret &retval) const { +void Module::sendToReceiver(int fnum, std::nullptr_t, Ret &retval) const { sendToReceiver(fnum, nullptr, 0, &retval, sizeof(retval)); } -void slsDetector::sendToReceiver(int fnum) { +void Module::sendToReceiver(int fnum) { sendToReceiver(fnum, nullptr, 0, nullptr, 0); } -void slsDetector::sendToReceiver(int fnum) const { +void Module::sendToReceiver(int fnum) const { sendToReceiver(fnum, nullptr, 0, nullptr, 0); } -void slsDetector::freeSharedMemory() { +void Module::freeSharedMemory() { if (shm.IsExisting()) { shm.RemoveSharedMemory(); } } -void slsDetector::setHostname(const std::string &hostname, const bool initialChecks) { +void Module::setHostname(const std::string &hostname, const bool initialChecks) { sls::strcpy_safe(shm()->hostname, hostname.c_str()); auto client = DetectorSocket(shm()->hostname, shm()->controlPort); client.close(); @@ -299,9 +299,9 @@ void slsDetector::setHostname(const std::string &hostname, const bool initialChe updateCachedDetectorVariables(); } -std::string slsDetector::getHostname() const { return shm()->hostname; } +std::string Module::getHostname() const { return shm()->hostname; } -void slsDetector::initSharedMemory(detectorType type, int multi_id, +void Module::initSharedMemory(detectorType type, int multi_id, bool verify) { shm = SharedMemory(multi_id, detId); if (!shm.IsExisting()) { @@ -320,7 +320,7 @@ void slsDetector::initSharedMemory(detectorType type, int multi_id, } } -void slsDetector::initializeDetectorStructure(detectorType type) { +void Module::initializeDetectorStructure(detectorType type) { shm()->shmversion = SLS_SHMVERSION; memset(shm()->hostname, 0, MAX_STR_LENGTH); shm()->myDetectorType = type; @@ -404,7 +404,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) { shm()->nGappixels.y = parameters.nGappixelsY; } -int slsDetector::sendModule(sls_detector_module *myMod, +int Module::sendModule(sls_detector_module *myMod, sls::ClientSocket &client) { TLogLevel level = logDEBUG1; LOG(level) << "Sending Module"; @@ -459,7 +459,7 @@ int slsDetector::sendModule(sls_detector_module *myMod, return ts; } -int slsDetector::receiveModule(sls_detector_module *myMod, +int Module::receiveModule(sls_detector_module *myMod, sls::ClientSocket &client) { int ts = 0; ts += client.Receive(&(myMod->serialnumber), sizeof(myMod->serialnumber)); @@ -484,7 +484,7 @@ int slsDetector::receiveModule(sls_detector_module *myMod, return ts; } -slsDetectorDefs::detectorType slsDetector::getDetectorTypeFromShm(int multi_id, +slsDetectorDefs::detectorType Module::getDetectorTypeFromShm(int multi_id, bool verify) { if (!shm.IsExisting()) { throw SharedMemoryError("Shared memory " + shm.GetName() + @@ -508,7 +508,7 @@ slsDetectorDefs::detectorType slsDetector::getDetectorTypeFromShm(int multi_id, // static function slsDetectorDefs::detectorType -slsDetector::getTypeFromDetector(const std::string &hostname, int cport) { +Module::getTypeFromDetector(const std::string &hostname, int cport) { int fnum = F_GET_DETECTOR_TYPE; int ret = FAIL; detectorType retval = GENERIC; @@ -521,7 +521,7 @@ slsDetector::getTypeFromDetector(const std::string &hostname, int cport) { return retval; } -int slsDetector::setDetectorType(detectorType const type) { +int Module::setDetectorType(detectorType const type) { int fnum = F_GET_DETECTOR_TYPE; detectorType retval = GENERIC; LOG(logDEBUG1) << "Setting detector type to " << type; @@ -542,11 +542,11 @@ int slsDetector::setDetectorType(detectorType const type) { return retval; } -slsDetectorDefs::detectorType slsDetector::getDetectorType() const { +slsDetectorDefs::detectorType Module::getDetectorType() const { return shm()->myDetectorType; } -void slsDetector::updateNumberOfChannels() { +void Module::updateNumberOfChannels() { if (shm()->myDetectorType == CHIPTESTBOARD || shm()->myDetectorType == MOENCH) { LOG(logDEBUG1) << "Updating number of channels"; @@ -558,7 +558,7 @@ void slsDetector::updateNumberOfChannels() { } } -slsDetectorDefs::xy slsDetector::getNumberOfChannels() const { +slsDetectorDefs::xy Module::getNumberOfChannels() const { slsDetectorDefs::xy coord{}; coord.x = (shm()->nChan.x * shm()->nChip.x + shm()->gappixels * shm()->nGappixels.x); @@ -567,7 +567,7 @@ slsDetectorDefs::xy slsDetector::getNumberOfChannels() const { return coord; } -bool slsDetector::getQuad() { +bool Module::getQuad() { int retval = -1; LOG(logDEBUG1) << "Getting Quad Type"; sendToDetector(F_GET_QUAD, nullptr, retval); @@ -575,7 +575,7 @@ bool slsDetector::getQuad() { return retval != 0; } -void slsDetector::setQuad(const bool enable) { +void Module::setQuad(const bool enable) { int value = enable ? 1 : 0; LOG(logDEBUG1) << "Setting Quad type to " << value; sendToDetector(F_SET_QUAD, value, nullptr); @@ -585,7 +585,7 @@ void slsDetector::setQuad(const bool enable) { } } -void slsDetector::setReadNLines(const int value) { +void Module::setReadNLines(const int value) { LOG(logDEBUG1) << "Setting read n lines to " << value; sendToDetector(F_SET_READ_N_LINES, value, nullptr); LOG(logDEBUG1) << "Setting read n lines to " << value @@ -595,7 +595,7 @@ void slsDetector::setReadNLines(const int value) { } } -int slsDetector::getReadNLines() { +int Module::getReadNLines() { int retval = -1; LOG(logDEBUG1) << "Getting read n lines"; sendToDetector(F_GET_READ_N_LINES, nullptr, retval); @@ -603,14 +603,14 @@ int slsDetector::getReadNLines() { return retval; } -void slsDetector::updateMultiSize(slsDetectorDefs::xy det) { +void Module::updateMultiSize(slsDetectorDefs::xy det) { shm()->multiSize = det; int args[2] = {shm()->multiSize.y, detId}; sendToDetector(F_SET_POSITION, args, nullptr); } -int slsDetector::setControlPort(int port_number) { +int Module::setControlPort(int port_number) { int retval = -1; LOG(logDEBUG1) << "Setting control port to " << port_number; if (port_number >= 0 && port_number != shm()->controlPort) { @@ -625,7 +625,7 @@ int slsDetector::setControlPort(int port_number) { return shm()->controlPort; } -int slsDetector::setStopPort(int port_number) { +int Module::setStopPort(int port_number) { int retval = -1; LOG(logDEBUG1) << "Setting stop port to " << port_number; if (port_number >= 0 && port_number != shm()->stopPort) { @@ -640,7 +640,7 @@ int slsDetector::setStopPort(int port_number) { return shm()->stopPort; } -int slsDetector::setReceiverPort(int port_number) { +int Module::setReceiverPort(int port_number) { LOG(logDEBUG1) << "Setting reciever port to " << port_number; if (port_number >= 0 && port_number != shm()->rxTCPPort) { if (shm()->useReceiverFlag) { @@ -656,13 +656,13 @@ int slsDetector::setReceiverPort(int port_number) { return shm()->rxTCPPort; } -int slsDetector::getReceiverPort() const { return shm()->rxTCPPort; } +int Module::getReceiverPort() const { return shm()->rxTCPPort; } -int slsDetector::getControlPort() const { return shm()->controlPort; } +int Module::getControlPort() const { return shm()->controlPort; } -int slsDetector::getStopPort() const { return shm()->stopPort; } +int Module::getStopPort() const { return shm()->stopPort; } -bool slsDetector::lockServer(int lock) { +bool Module::lockServer(int lock) { int retval = -1; LOG(logDEBUG1) << "Setting detector server lock to " << lock; sendToDetector(F_LOCK_SERVER, lock, retval); @@ -670,7 +670,7 @@ bool slsDetector::lockServer(int lock) { return retval == 1; } -sls::IpAddr slsDetector::getLastClientIP() { +sls::IpAddr Module::getLastClientIP() { sls::IpAddr retval; LOG(logDEBUG1) << "Getting last client ip to detector server"; sendToDetector(F_GET_LAST_CLIENT_IP, nullptr, retval); @@ -678,13 +678,13 @@ sls::IpAddr slsDetector::getLastClientIP() { return retval; } -void slsDetector::exitServer() { +void Module::exitServer() { LOG(logDEBUG1) << "Sending exit command to detector server"; sendToDetector(F_EXIT_SERVER); LOG(logINFO) << "Shutting down the Detector server"; } -void slsDetector::execCommand(const std::string &cmd) { +void Module::execCommand(const std::string &cmd) { char arg[MAX_STR_LENGTH]{}; char retval[MAX_STR_LENGTH]{}; sls::strcpy_safe(arg, cmd.c_str()); @@ -695,7 +695,7 @@ void slsDetector::execCommand(const std::string &cmd) { } } -void slsDetector::updateCachedDetectorVariables() { +void Module::updateCachedDetectorVariables() { int fnum = F_UPDATE_CLIENT; LOG(logDEBUG1) << "Sending update client to detector server"; auto client = DetectorSocket(shm()->hostname, shm()->controlPort); @@ -771,7 +771,7 @@ void slsDetector::updateCachedDetectorVariables() { } } -std::vector slsDetector::getConfigFileCommands() { +std::vector Module::getConfigFileCommands() { std::vector base{"hostname", "port", "stopport", "settingsdir", "fpath", "lock", "zmqport", "rx_zmqport", "zmqip", @@ -845,13 +845,13 @@ std::vector slsDetector::getConfigFileCommands() { return commands; } -slsDetectorDefs::detectorSettings slsDetector::getSettings() { +slsDetectorDefs::detectorSettings Module::getSettings() { return sendSettingsOnly(GET_SETTINGS); } slsDetectorDefs::detectorSettings -slsDetector::setSettings(detectorSettings isettings) { - LOG(logDEBUG1) << "slsDetector setSettings " << isettings; +Module::setSettings(detectorSettings isettings) { + LOG(logDEBUG1) << "Module setSettings " << isettings; if (isettings == -1) { return getSettings(); @@ -881,7 +881,7 @@ slsDetector::setSettings(detectorSettings isettings) { } slsDetectorDefs::detectorSettings -slsDetector::sendSettingsOnly(detectorSettings isettings) { +Module::sendSettingsOnly(detectorSettings isettings) { int arg = static_cast(isettings); int retval = -1; LOG(logDEBUG1) << "Setting settings to " << arg; @@ -891,7 +891,7 @@ slsDetector::sendSettingsOnly(detectorSettings isettings) { return shm()->currentSettings; } -int slsDetector::getThresholdEnergy() { +int Module::getThresholdEnergy() { // moench - get threshold energy from processor (due to different clients, // diff shm) if (shm()->myDetectorType == MOENCH) { @@ -915,7 +915,7 @@ int slsDetector::getThresholdEnergy() { return retval; } -int slsDetector::setThresholdEnergy(int e_eV, detectorSettings isettings, +int Module::setThresholdEnergy(int e_eV, detectorSettings isettings, int tb) { // check as there is client processing @@ -937,7 +937,7 @@ int slsDetector::setThresholdEnergy(int e_eV, detectorSettings isettings, "Set threshold energy not implemented for this detector"); } -void slsDetector::setThresholdEnergyAndSettings(int e_eV, +void Module::setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings, int tb) { @@ -998,7 +998,7 @@ void slsDetector::setThresholdEnergyAndSettings(int e_eV, } } -std::string slsDetector::getTrimbitFilename(detectorSettings s, int e_eV) { +std::string Module::getTrimbitFilename(detectorSettings s, int e_eV) { std::string ssettings; switch (s) { case STANDARD: @@ -1029,16 +1029,16 @@ std::string slsDetector::getTrimbitFilename(detectorSettings s, int e_eV) { return ostfn.str(); } -std::string slsDetector::getSettingsDir() { +std::string Module::getSettingsDir() { return std::string(shm()->settingsDir); } -std::string slsDetector::setSettingsDir(const std::string &dir) { +std::string Module::setSettingsDir(const std::string &dir) { sls::strcpy_safe(shm()->settingsDir, dir.c_str()); return shm()->settingsDir; } -void slsDetector::loadSettingsFile(const std::string &fname) { +void Module::loadSettingsFile(const std::string &fname) { std::string fn = fname; std::ostringstream ostfn; ostfn << fname; @@ -1057,7 +1057,7 @@ void slsDetector::loadSettingsFile(const std::string &fname) { setModule(myMod); } -void slsDetector::saveSettingsFile(const std::string &fname) { +void Module::saveSettingsFile(const std::string &fname) { std::string fn = fname; std::ostringstream ostfn; ostfn << fname; @@ -1072,7 +1072,7 @@ void slsDetector::saveSettingsFile(const std::string &fname) { writeSettingsFile(fn, myMod); } -slsDetectorDefs::runStatus slsDetector::getRunStatus() const { +slsDetectorDefs::runStatus Module::getRunStatus() const { runStatus retval = ERROR; LOG(logDEBUG1) << "Getting status"; sendToDetectorStop(F_GET_RUN_STATUS, nullptr, retval); @@ -1080,20 +1080,20 @@ slsDetectorDefs::runStatus slsDetector::getRunStatus() const { return retval; } -void slsDetector::prepareAcquisition() { +void Module::prepareAcquisition() { LOG(logDEBUG1) << "Preparing Detector for Acquisition"; sendToDetector(F_PREPARE_ACQUISITION); LOG(logDEBUG1) << "Prepare Acquisition successful"; } -void slsDetector::startAcquisition() { +void Module::startAcquisition() { LOG(logDEBUG1) << "Starting Acquisition"; shm()->stoppedFlag = false; sendToDetector(F_START_ACQUISITION); LOG(logDEBUG1) << "Starting Acquisition successful"; } -void slsDetector::stopAcquisition() { +void Module::stopAcquisition() { // get status before stopping acquisition runStatus s = ERROR, r = ERROR; if (shm()->rxUpstream) { @@ -1110,37 +1110,37 @@ void slsDetector::stopAcquisition() { } } -void slsDetector::sendSoftwareTrigger() { +void Module::sendSoftwareTrigger() { LOG(logDEBUG1) << "Sending software trigger"; sendToDetectorStop(F_SOFTWARE_TRIGGER); LOG(logDEBUG1) << "Sending software trigger successful"; } -void slsDetector::startAndReadAll() { +void Module::startAndReadAll() { LOG(logDEBUG1) << "Starting and reading all frames"; shm()->stoppedFlag = false; sendToDetector(F_START_AND_READ_ALL); LOG(logDEBUG1) << "Detector successfully finished acquisition"; } -void slsDetector::startReadOut() { +void Module::startReadOut() { LOG(logDEBUG1) << "Starting readout"; sendToDetector(F_START_READOUT); LOG(logDEBUG1) << "Starting detector readout successful"; } -void slsDetector::readAll() { +void Module::readAll() { LOG(logDEBUG1) << "Reading all frames"; sendToDetector(F_READ_ALL); LOG(logDEBUG1) << "Detector successfully finished reading all frames"; } -void slsDetector::setStartingFrameNumber(uint64_t value) { +void Module::setStartingFrameNumber(uint64_t value) { LOG(logDEBUG1) << "Setting starting frame number to " << value; sendToDetector(F_SET_STARTING_FRAME_NUMBER, value, nullptr); } -uint64_t slsDetector::getStartingFrameNumber() { +uint64_t Module::getStartingFrameNumber() { uint64_t retval = -1; LOG(logDEBUG1) << "Getting starting frame number"; sendToDetector(F_GET_STARTING_FRAME_NUMBER, nullptr, retval); @@ -1148,7 +1148,7 @@ uint64_t slsDetector::getStartingFrameNumber() { return retval; } -int64_t slsDetector::getTotalNumFramesToReceive() { +int64_t Module::getTotalNumFramesToReceive() { int64_t repeats = shm()->nTriggers; // gotthard2 & auto & burst mode, use nBursts instead of nTriggers if (shm()->myDetectorType == GOTTHARD2) { @@ -1159,7 +1159,7 @@ int64_t slsDetector::getTotalNumFramesToReceive() { return (shm()->nFrames * repeats * (int64_t)(shm()->nAddStorageCells + 1)); } -void slsDetector::sendTotalNumFramestoReceiver() { +void Module::sendTotalNumFramestoReceiver() { if (shm()->useReceiverFlag) { int64_t arg = getTotalNumFramesToReceive(); LOG(logDEBUG1) << "Sending total number of frames (#f x #t x #s) to Receiver: " << arg; @@ -1167,7 +1167,7 @@ void slsDetector::sendTotalNumFramestoReceiver() { } } -int64_t slsDetector::getNumberOfFrames() { +int64_t Module::getNumberOfFrames() { int64_t retval = -1; sendToDetector(F_GET_NUM_FRAMES, nullptr, retval); LOG(logDEBUG1) << "number of frames :" << retval; @@ -1178,14 +1178,14 @@ int64_t slsDetector::getNumberOfFrames() { return shm()->nFrames; } -void slsDetector::setNumberOfFrames(int64_t value) { +void Module::setNumberOfFrames(int64_t value) { LOG(logDEBUG1) << "Setting number of frames to " << value; sendToDetector(F_SET_NUM_FRAMES, value, nullptr); shm()->nFrames = value; sendTotalNumFramestoReceiver(); } -int64_t slsDetector::getNumberOfTriggers() { +int64_t Module::getNumberOfTriggers() { int64_t retval = -1; sendToDetector(F_GET_NUM_TRIGGERS, nullptr, retval); LOG(logDEBUG1) << "number of triggers :" << retval; @@ -1196,14 +1196,14 @@ int64_t slsDetector::getNumberOfTriggers() { return shm()->nTriggers; } -void slsDetector::setNumberOfTriggers(int64_t value) { +void Module::setNumberOfTriggers(int64_t value) { LOG(logDEBUG1) << "Setting number of triggers to " << value; sendToDetector(F_SET_NUM_TRIGGERS, value, nullptr); shm()->nTriggers = value; sendTotalNumFramestoReceiver(); } -int64_t slsDetector::getNumberOfBursts() { +int64_t Module::getNumberOfBursts() { int64_t retval = -1; sendToDetector(F_GET_NUM_BURSTS, nullptr, retval); LOG(logDEBUG1) << "number of bursts :" << retval; @@ -1214,14 +1214,14 @@ int64_t slsDetector::getNumberOfBursts() { return shm()->nBursts; } -void slsDetector::setNumberOfBursts(int64_t value) { +void Module::setNumberOfBursts(int64_t value) { LOG(logDEBUG1) << "Setting number of bursts to " << value; sendToDetector(F_SET_NUM_BURSTS, value, nullptr); shm()->nBursts = value; sendTotalNumFramestoReceiver(); } -int slsDetector::getNumberOfAdditionalStorageCells() { +int Module::getNumberOfAdditionalStorageCells() { int prevVal = shm()->nAddStorageCells; int retval = -1; sendToDetector(F_GET_NUM_ADDITIONAL_STORAGE_CELLS, nullptr, retval); @@ -1233,21 +1233,21 @@ int slsDetector::getNumberOfAdditionalStorageCells() { return shm()->nAddStorageCells; } -void slsDetector::setNumberOfAdditionalStorageCells(int value) { +void Module::setNumberOfAdditionalStorageCells(int value) { LOG(logDEBUG1) << "Setting number of storage cells to " << value; sendToDetector(F_SET_NUM_ADDITIONAL_STORAGE_CELLS, value, nullptr); shm()->nAddStorageCells = value; sendTotalNumFramestoReceiver(); } -int slsDetector::getNumberOfAnalogSamples() { +int Module::getNumberOfAnalogSamples() { int retval = -1; sendToDetector(F_GET_NUM_ANALOG_SAMPLES, nullptr, retval); LOG(logDEBUG1) << "number of analog samples :" << retval; return retval; } -void slsDetector::setNumberOfAnalogSamples(int value) { +void Module::setNumberOfAnalogSamples(int value) { LOG(logDEBUG1) << "Setting number of analog samples to " << value; sendToDetector(F_SET_NUM_ANALOG_SAMPLES, value, nullptr); // update #nchan, as it depends on #samples, adcmask @@ -1258,14 +1258,14 @@ void slsDetector::setNumberOfAnalogSamples(int value) { } } -int slsDetector::getNumberOfDigitalSamples() { +int Module::getNumberOfDigitalSamples() { int retval = -1; sendToDetector(F_GET_NUM_DIGITAL_SAMPLES, nullptr, retval); LOG(logDEBUG1) << "number of digital samples :" << retval; return retval; } -void slsDetector::setNumberOfDigitalSamples(int value) { +void Module::setNumberOfDigitalSamples(int value) { LOG(logDEBUG1) << "Setting number of digital samples to " << value; sendToDetector(F_SET_NUM_DIGITAL_SAMPLES, value, nullptr); // update #nchan, as it depends on #samples, adcmask @@ -1276,14 +1276,14 @@ void slsDetector::setNumberOfDigitalSamples(int value) { } } -int64_t slsDetector::getExptime() { +int64_t Module::getExptime() { int64_t retval = -1; sendToDetector(F_GET_EXPTIME, nullptr, retval); LOG(logDEBUG1) << "exptime :" << retval << "ns"; return retval; } -void slsDetector::setExptime(int64_t value) { +void Module::setExptime(int64_t value) { int64_t prevVal = value; if (shm()->myDetectorType == EIGER) { prevVal = getExptime(); @@ -1302,14 +1302,14 @@ void slsDetector::setExptime(int64_t value) { } } -int64_t slsDetector::getPeriod() { +int64_t Module::getPeriod() { int64_t retval = -1; sendToDetector(F_GET_PERIOD, nullptr, retval); LOG(logDEBUG1) << "period :" << retval << "ns"; return retval; } -void slsDetector::setPeriod(int64_t value) { +void Module::setPeriod(int64_t value) { LOG(logDEBUG1) << "Setting period to " << value << "ns"; sendToDetector(F_SET_PERIOD, value, nullptr); if (shm()->useReceiverFlag) { @@ -1318,38 +1318,38 @@ void slsDetector::setPeriod(int64_t value) { } } -int64_t slsDetector::getDelayAfterTrigger() { +int64_t Module::getDelayAfterTrigger() { int64_t retval = -1; sendToDetector(F_GET_DELAY_AFTER_TRIGGER, nullptr, retval); LOG(logDEBUG1) << "delay after trigger :" << retval << "ns"; return retval; } -void slsDetector::setDelayAfterTrigger(int64_t value) { +void Module::setDelayAfterTrigger(int64_t value) { LOG(logDEBUG1) << "Setting delay after trigger to " << value << "ns"; sendToDetector(F_SET_DELAY_AFTER_TRIGGER, value, nullptr); } -int64_t slsDetector::getBurstPeriod() { +int64_t Module::getBurstPeriod() { int64_t retval = -1; sendToDetector(F_GET_BURST_PERIOD, nullptr, retval); LOG(logDEBUG1) << "burst period :" << retval << "ns"; return retval; } -void slsDetector::setBurstPeriod(int64_t value) { +void Module::setBurstPeriod(int64_t value) { LOG(logDEBUG1) << "Setting burst period to " << value << "ns"; sendToDetector(F_SET_BURST_PERIOD, value, nullptr); } -int64_t slsDetector::getSubExptime() { +int64_t Module::getSubExptime() { int64_t retval = -1; sendToDetector(F_GET_SUB_EXPTIME, nullptr, retval); LOG(logDEBUG1) << "sub exptime :" << retval << "ns"; return retval; } -void slsDetector::setSubExptime(int64_t value) { +void Module::setSubExptime(int64_t value) { int64_t prevVal = value; if (shm()->myDetectorType == EIGER) { prevVal = getSubExptime(); @@ -1368,14 +1368,14 @@ void slsDetector::setSubExptime(int64_t value) { } } -int64_t slsDetector::getSubDeadTime() { +int64_t Module::getSubDeadTime() { int64_t retval = -1; sendToDetector(F_GET_SUB_DEADTIME, nullptr, retval); LOG(logDEBUG1) << "sub deadtime :" << retval << "ns"; return retval; } -void slsDetector::setSubDeadTime(int64_t value) { +void Module::setSubDeadTime(int64_t value) { LOG(logDEBUG1) << "Setting sub deadtime to " << value << "ns"; sendToDetector(F_SET_SUB_DEADTIME, value, nullptr); if (shm()->useReceiverFlag) { @@ -1384,89 +1384,89 @@ void slsDetector::setSubDeadTime(int64_t value) { } } -int64_t slsDetector::getStorageCellDelay() { +int64_t Module::getStorageCellDelay() { int64_t retval = -1; sendToDetector(F_GET_STORAGE_CELL_DELAY, nullptr, retval); LOG(logDEBUG1) << "storage cell delay :" << retval; return retval; } -void slsDetector::setStorageCellDelay(int64_t value) { +void Module::setStorageCellDelay(int64_t value) { LOG(logDEBUG1) << "Setting storage cell delay to " << value << "ns"; sendToDetector(F_SET_STORAGE_CELL_DELAY, value, nullptr); } -int64_t slsDetector::getNumberOfFramesLeft() const { +int64_t Module::getNumberOfFramesLeft() const { int64_t retval = -1; sendToDetectorStop(F_GET_FRAMES_LEFT, nullptr, retval); LOG(logDEBUG1) << "number of frames left :" << retval; return retval; } -int64_t slsDetector::getNumberOfTriggersLeft() const { +int64_t Module::getNumberOfTriggersLeft() const { int64_t retval = -1; sendToDetectorStop(F_GET_TRIGGERS_LEFT, nullptr, retval); LOG(logDEBUG1) << "number of triggers left :" << retval; return retval; } -int64_t slsDetector::getDelayAfterTriggerLeft() const { +int64_t Module::getDelayAfterTriggerLeft() const { int64_t retval = -1; sendToDetectorStop(F_GET_DELAY_AFTER_TRIGGER_LEFT, nullptr, retval); LOG(logDEBUG1) << "delay after trigger left :" << retval << "ns"; return retval; } -int64_t slsDetector::getExptimeLeft() const { +int64_t Module::getExptimeLeft() const { int64_t retval = -1; sendToDetectorStop(F_GET_EXPTIME_LEFT, nullptr, retval); LOG(logDEBUG1) << "exptime left :" << retval << "ns"; return retval; } -int64_t slsDetector::getPeriodLeft() const { +int64_t Module::getPeriodLeft() const { int64_t retval = -1; sendToDetectorStop(F_GET_PERIOD_LEFT, nullptr, retval); LOG(logDEBUG1) << "period left :" << retval << "ns"; return retval; } -int64_t slsDetector::getMeasuredPeriod() const { +int64_t Module::getMeasuredPeriod() const { int64_t retval = -1; sendToDetectorStop(F_GET_MEASURED_PERIOD, nullptr, retval); LOG(logDEBUG1) << "measured period :" << retval << "ns"; return retval; } -int64_t slsDetector::getMeasuredSubFramePeriod() const { +int64_t Module::getMeasuredSubFramePeriod() const { int64_t retval = -1; sendToDetectorStop(F_GET_MEASURED_SUBPERIOD, nullptr, retval); LOG(logDEBUG1) << "exptime :" << retval << "ns"; return retval; } -int64_t slsDetector::getNumberOfFramesFromStart() const { +int64_t Module::getNumberOfFramesFromStart() const { int64_t retval = -1; sendToDetectorStop(F_GET_FRAMES_FROM_START, nullptr, retval); LOG(logDEBUG1) << "number of frames from start :" << retval; return retval; } -int64_t slsDetector::getActualTime() const { +int64_t Module::getActualTime() const { int64_t retval = -1; sendToDetectorStop(F_GET_ACTUAL_TIME, nullptr, retval); LOG(logDEBUG1) << "actual time :" << retval << "ns"; return retval; } -int64_t slsDetector::getMeasurementTime() const { +int64_t Module::getMeasurementTime() const { int64_t retval = -1; sendToDetectorStop(F_GET_MEASUREMENT_TIME, nullptr, retval); LOG(logDEBUG1) << "measurement time :" << retval << "ns"; return retval; } -slsDetectorDefs::timingMode slsDetector::setTimingMode(timingMode value) { +slsDetectorDefs::timingMode Module::setTimingMode(timingMode value) { int fnum = F_SET_TIMING_MODE; //auto arg = static_cast(pol); timingMode retval = GET_TIMING_MODE; @@ -1477,7 +1477,7 @@ slsDetectorDefs::timingMode slsDetector::setTimingMode(timingMode value) { return retval; } -int slsDetector::setDynamicRange(int n) { +int Module::setDynamicRange(int n) { // TODO! Properly handle fail int prevDr = shm()->dynamicRange; @@ -1510,7 +1510,7 @@ int slsDetector::setDynamicRange(int n) { return shm()->dynamicRange; } -int slsDetector::setDAC(int val, dacIndex index, int mV) { +int Module::setDAC(int val, dacIndex index, int mV) { int args[]{static_cast(index), mV, val}; int retval = -1; LOG(logDEBUG1) << "Setting DAC " << index << " to " << val @@ -1521,7 +1521,7 @@ int slsDetector::setDAC(int val, dacIndex index, int mV) { return retval; } -int slsDetector::getOnChipDAC(slsDetectorDefs::dacIndex index, int chipIndex) { +int Module::getOnChipDAC(slsDetectorDefs::dacIndex index, int chipIndex) { int args[]{static_cast(index), chipIndex}; int retval = -1; sendToDetector(F_GET_ON_CHIP_DAC, args, retval); @@ -1529,13 +1529,13 @@ int slsDetector::getOnChipDAC(slsDetectorDefs::dacIndex index, int chipIndex) { return retval; } -void slsDetector::setOnChipDAC(slsDetectorDefs::dacIndex index, int chipIndex, int value) { +void Module::setOnChipDAC(slsDetectorDefs::dacIndex index, int chipIndex, int value) { int args[]{static_cast(index), chipIndex, value}; LOG(logDEBUG1) << "Setting On chip DAC " << index << " (chip index:" << chipIndex << ") to " << value; sendToDetector(F_SET_ON_CHIP_DAC, args, nullptr); } -int slsDetector::getADC(dacIndex index) { +int Module::getADC(dacIndex index) { int retval = -1; LOG(logDEBUG1) << "Getting ADC " << index; sendToDetector(F_GET_ADC, static_cast(index), retval); @@ -1544,7 +1544,7 @@ int slsDetector::getADC(dacIndex index) { } slsDetectorDefs::externalSignalFlag -slsDetector::setExternalSignalFlags(externalSignalFlag pol) { +Module::setExternalSignalFlags(externalSignalFlag pol) { int fnum = F_SET_EXTERNAL_SIGNAL_FLAG; auto retval = GET_EXTERNAL_SIGNAL_FLAG; LOG(logDEBUG1) << "Setting signal flag to " << pol; @@ -1553,13 +1553,13 @@ slsDetector::setExternalSignalFlags(externalSignalFlag pol) { return retval; } -void slsDetector::setParallelMode(const bool enable) { +void Module::setParallelMode(const bool enable) { int arg = static_cast(enable); LOG(logDEBUG1) << "Setting parallel mode to " << arg; sendToDetector(F_SET_PARALLEL_MODE, arg, nullptr); } -bool slsDetector::getParallelMode() { +bool Module::getParallelMode() { int retval = -1; LOG(logDEBUG1) << "Getting parallel mode"; sendToDetector(F_GET_PARALLEL_MODE, nullptr, retval); @@ -1567,13 +1567,13 @@ bool slsDetector::getParallelMode() { return static_cast(retval); } -void slsDetector::setOverFlowMode(const bool enable) { +void Module::setOverFlowMode(const bool enable) { int arg = static_cast(enable); LOG(logDEBUG1) << "Setting overflow mode to " << arg; sendToDetector(F_SET_OVERFLOW_MODE, arg, nullptr); } -bool slsDetector::getOverFlowMode() { +bool Module::getOverFlowMode() { int retval = -1; LOG(logDEBUG1) << "Getting overflow mode"; sendToDetector(F_GET_OVERFLOW_MODE, nullptr, retval); @@ -1581,13 +1581,13 @@ bool slsDetector::getOverFlowMode() { return static_cast(retval); } -void slsDetector::setStoreInRamMode(const bool enable) { +void Module::setStoreInRamMode(const bool enable) { int arg = static_cast(enable); LOG(logDEBUG1) << "Setting store in ram mode to " << arg; sendToDetector(F_SET_STOREINRAM_MODE, arg, nullptr); } -bool slsDetector::getStoreInRamMode() { +bool Module::getStoreInRamMode() { int retval = -1; LOG(logDEBUG1) << "Getting store in ram mode"; sendToDetector(F_GET_STOREINRAM_MODE, nullptr, retval); @@ -1595,7 +1595,7 @@ bool slsDetector::getStoreInRamMode() { return static_cast(retval); } -void slsDetector::setReadoutMode(const slsDetectorDefs::readoutMode mode) { +void Module::setReadoutMode(const slsDetectorDefs::readoutMode mode) { auto arg = static_cast(mode); LOG(logDEBUG1) << "Setting readout mode to " << arg; sendToDetector(F_SET_READOUT_MODE, arg, nullptr); @@ -1608,7 +1608,7 @@ void slsDetector::setReadoutMode(const slsDetectorDefs::readoutMode mode) { } } -slsDetectorDefs::readoutMode slsDetector::getReadoutMode() { +slsDetectorDefs::readoutMode Module::getReadoutMode() { int retval = -1; LOG(logDEBUG1) << "Getting readout mode"; sendToDetector(F_GET_READOUT_MODE, nullptr, retval); @@ -1616,13 +1616,13 @@ slsDetectorDefs::readoutMode slsDetector::getReadoutMode() { return static_cast(retval); } -void slsDetector::setInterruptSubframe(const bool enable) { +void Module::setInterruptSubframe(const bool enable) { int arg = static_cast(enable); LOG(logDEBUG1) << "Setting Interrupt subframe to " << arg; sendToDetector(F_SET_INTERRUPT_SUBFRAME, arg, nullptr); } -bool slsDetector::getInterruptSubframe() { +bool Module::getInterruptSubframe() { int retval = -1; LOG(logDEBUG1) << "Getting Interrupt subframe"; sendToDetector(F_GET_INTERRUPT_SUBFRAME, nullptr, retval); @@ -1630,7 +1630,7 @@ bool slsDetector::getInterruptSubframe() { return static_cast(retval); } -uint32_t slsDetector::writeRegister(uint32_t addr, uint32_t val) { +uint32_t Module::writeRegister(uint32_t addr, uint32_t val) { uint32_t args[]{addr, val}; uint32_t retval = -1; LOG(logDEBUG1) << "Writing to reg 0x" << std::hex << addr << "data: 0x" @@ -1641,7 +1641,7 @@ uint32_t slsDetector::writeRegister(uint32_t addr, uint32_t val) { return retval; } -uint32_t slsDetector::readRegister(uint32_t addr) { +uint32_t Module::readRegister(uint32_t addr) { uint32_t retval = -1; LOG(logDEBUG1) << "Reading reg 0x" << std::hex << addr << std::dec; sendToDetector(F_READ_REGISTER, addr, retval); @@ -1650,7 +1650,7 @@ uint32_t slsDetector::readRegister(uint32_t addr) { return retval; } -uint32_t slsDetector::setBit(uint32_t addr, int n) { +uint32_t Module::setBit(uint32_t addr, int n) { if (n < 0 || n > 31) { throw RuntimeError("Bit number " + std::to_string(n) + " out of Range"); } else { @@ -1659,7 +1659,7 @@ uint32_t slsDetector::setBit(uint32_t addr, int n) { } } -uint32_t slsDetector::clearBit(uint32_t addr, int n) { +uint32_t Module::clearBit(uint32_t addr, int n) { if (n < 0 || n > 31) { throw RuntimeError("Bit number " + std::to_string(n) + " out of Range"); } else { @@ -1668,7 +1668,7 @@ uint32_t slsDetector::clearBit(uint32_t addr, int n) { } } -std::string slsDetector::setReceiverHostname(const std::string &receiverIP) { +std::string Module::setReceiverHostname(const std::string &receiverIP) { LOG(logDEBUG1) << "Setting up Receiver with " << receiverIP; // recieverIP is none if (receiverIP == "none") { @@ -1783,11 +1783,11 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) { return std::string(shm()->rxHostname); } -std::string slsDetector::getReceiverHostname() const { +std::string Module::getReceiverHostname() const { return std::string(shm()->rxHostname); } -void slsDetector::setSourceUDPMAC(const sls::MacAddr mac) { +void Module::setSourceUDPMAC(const sls::MacAddr mac) { LOG(logDEBUG1) << "Setting source udp mac to " << mac; if (mac == 0) { throw RuntimeError("Invalid source udp mac address"); @@ -1795,7 +1795,7 @@ void slsDetector::setSourceUDPMAC(const sls::MacAddr mac) { sendToDetector(F_SET_SOURCE_UDP_MAC, mac, nullptr); } -sls::MacAddr slsDetector::getSourceUDPMAC() { +sls::MacAddr Module::getSourceUDPMAC() { sls::MacAddr retval(0LU); LOG(logDEBUG1) << "Getting source udp mac"; sendToDetector(F_GET_SOURCE_UDP_MAC, nullptr, retval); @@ -1803,7 +1803,7 @@ sls::MacAddr slsDetector::getSourceUDPMAC() { return retval; } -void slsDetector::setSourceUDPMAC2(const sls::MacAddr mac) { +void Module::setSourceUDPMAC2(const sls::MacAddr mac) { LOG(logDEBUG1) << "Setting source udp mac2 to " << mac; if (mac == 0) { throw RuntimeError("Invalid source udp mac address2"); @@ -1811,7 +1811,7 @@ void slsDetector::setSourceUDPMAC2(const sls::MacAddr mac) { sendToDetector(F_SET_SOURCE_UDP_MAC2, mac, nullptr); } -sls::MacAddr slsDetector::getSourceUDPMAC2() { +sls::MacAddr Module::getSourceUDPMAC2() { sls::MacAddr retval(0LU); LOG(logDEBUG1) << "Getting source udp mac2"; sendToDetector(F_GET_SOURCE_UDP_MAC2, nullptr, retval); @@ -1819,7 +1819,7 @@ sls::MacAddr slsDetector::getSourceUDPMAC2() { return retval; } -void slsDetector::setSourceUDPIP(const IpAddr ip) { +void Module::setSourceUDPIP(const IpAddr ip) { LOG(logDEBUG1) << "Setting source udp ip to " << ip; if (ip == 0) { throw RuntimeError("Invalid source udp ip address"); @@ -1828,7 +1828,7 @@ void slsDetector::setSourceUDPIP(const IpAddr ip) { sendToDetector(F_SET_SOURCE_UDP_IP, ip, nullptr); } -sls::IpAddr slsDetector::getSourceUDPIP() { +sls::IpAddr Module::getSourceUDPIP() { sls::IpAddr retval(0U); LOG(logDEBUG1) << "Getting source udp ip"; sendToDetector(F_GET_SOURCE_UDP_IP, nullptr, retval); @@ -1836,7 +1836,7 @@ sls::IpAddr slsDetector::getSourceUDPIP() { return retval; } -void slsDetector::setSourceUDPIP2(const IpAddr ip) { +void Module::setSourceUDPIP2(const IpAddr ip) { LOG(logDEBUG1) << "Setting source udp ip2 to " << ip; if (ip == 0) { throw RuntimeError("Invalid source udp ip address2"); @@ -1845,7 +1845,7 @@ void slsDetector::setSourceUDPIP2(const IpAddr ip) { sendToDetector(F_SET_SOURCE_UDP_IP2, ip, nullptr); } -sls::IpAddr slsDetector::getSourceUDPIP2() { +sls::IpAddr Module::getSourceUDPIP2() { sls::IpAddr retval(0U); LOG(logDEBUG1) << "Getting source udp ip2"; sendToDetector(F_GET_SOURCE_UDP_IP2, nullptr, retval); @@ -1853,7 +1853,7 @@ sls::IpAddr slsDetector::getSourceUDPIP2() { return retval; } -void slsDetector::setDestinationUDPIP(const IpAddr ip) { +void Module::setDestinationUDPIP(const IpAddr ip) { LOG(logDEBUG1) << "Setting destination udp ip to " << ip; if (ip == 0) { throw RuntimeError("Invalid destination udp ip address"); @@ -1867,7 +1867,7 @@ void slsDetector::setDestinationUDPIP(const IpAddr ip) { } } -sls::IpAddr slsDetector::getDestinationUDPIP() { +sls::IpAddr Module::getDestinationUDPIP() { sls::IpAddr retval(0U); LOG(logDEBUG1) << "Getting destination udp ip"; sendToDetector(F_GET_DEST_UDP_IP, nullptr, retval); @@ -1875,7 +1875,7 @@ sls::IpAddr slsDetector::getDestinationUDPIP() { return retval; } -void slsDetector::updateRxDestinationUDPIP() { +void Module::updateRxDestinationUDPIP() { auto ip = getDestinationUDPIP(); if (ip == 0) { // Hostname could be ip try to decode otherwise look up the hostname @@ -1888,7 +1888,7 @@ void slsDetector::updateRxDestinationUDPIP() { setDestinationUDPIP(ip); } -void slsDetector::setDestinationUDPIP2(const IpAddr ip) { +void Module::setDestinationUDPIP2(const IpAddr ip) { LOG(logDEBUG1) << "Setting destination udp ip2 to " << ip; if (ip == 0) { throw RuntimeError("Invalid destination udp ip address2"); @@ -1903,7 +1903,7 @@ void slsDetector::setDestinationUDPIP2(const IpAddr ip) { } } -sls::IpAddr slsDetector::getDestinationUDPIP2() { +sls::IpAddr Module::getDestinationUDPIP2() { sls::IpAddr retval(0U); LOG(logDEBUG1) << "Getting destination udp ip2"; sendToDetector(F_GET_DEST_UDP_IP2, nullptr, retval); @@ -1911,7 +1911,7 @@ sls::IpAddr slsDetector::getDestinationUDPIP2() { return retval; } -void slsDetector::updateRxDestinationUDPIP2() { +void Module::updateRxDestinationUDPIP2() { auto ip = getDestinationUDPIP2(); if (ip == 0) { // Hostname could be ip try to decode otherwise look up the hostname @@ -1924,7 +1924,7 @@ void slsDetector::updateRxDestinationUDPIP2() { setDestinationUDPIP2(ip); } -void slsDetector::setDestinationUDPMAC(const MacAddr mac) { +void Module::setDestinationUDPMAC(const MacAddr mac) { LOG(logDEBUG1) << "Setting destination udp mac to " << mac; if (mac == 0) { throw RuntimeError("Invalid destination udp mac address"); @@ -1933,7 +1933,7 @@ void slsDetector::setDestinationUDPMAC(const MacAddr mac) { sendToDetector(F_SET_DEST_UDP_MAC, mac, nullptr); } -sls::MacAddr slsDetector::getDestinationUDPMAC() { +sls::MacAddr Module::getDestinationUDPMAC() { sls::MacAddr retval(0LU); LOG(logDEBUG1) << "Getting destination udp mac"; sendToDetector(F_GET_DEST_UDP_MAC, nullptr, retval); @@ -1941,7 +1941,7 @@ sls::MacAddr slsDetector::getDestinationUDPMAC() { return retval; } -void slsDetector::setDestinationUDPMAC2(const MacAddr mac) { +void Module::setDestinationUDPMAC2(const MacAddr mac) { LOG(logDEBUG1) << "Setting destination udp mac2 to " << mac; if (mac == 0) { throw RuntimeError("Invalid desinaion udp mac address2"); @@ -1950,7 +1950,7 @@ void slsDetector::setDestinationUDPMAC2(const MacAddr mac) { sendToDetector(F_SET_DEST_UDP_MAC2, mac, nullptr); } -sls::MacAddr slsDetector::getDestinationUDPMAC2() { +sls::MacAddr Module::getDestinationUDPMAC2() { sls::MacAddr retval(0LU); LOG(logDEBUG1) << "Getting destination udp mac2"; sendToDetector(F_GET_DEST_UDP_MAC2, nullptr, retval); @@ -1958,7 +1958,7 @@ sls::MacAddr slsDetector::getDestinationUDPMAC2() { return retval; } -void slsDetector::setDestinationUDPPort(const int port) { +void Module::setDestinationUDPPort(const int port) { LOG(logDEBUG1) << "Setting destination udp port to " << port; sendToDetector(F_SET_DEST_UDP_PORT, port, nullptr); if (shm()->useReceiverFlag) { @@ -1966,7 +1966,7 @@ void slsDetector::setDestinationUDPPort(const int port) { } } -int slsDetector::getDestinationUDPPort() { +int Module::getDestinationUDPPort() { int retval = -1; LOG(logDEBUG1) << "Getting destination udp port"; sendToDetector(F_GET_DEST_UDP_PORT, nullptr, retval); @@ -1975,7 +1975,7 @@ int slsDetector::getDestinationUDPPort() { return retval; } -void slsDetector::setDestinationUDPPort2(const int port) { +void Module::setDestinationUDPPort2(const int port) { LOG(logDEBUG1) << "Setting destination udp port2 to " << port; sendToDetector(F_SET_DEST_UDP_PORT2, port, nullptr); if (shm()->useReceiverFlag) { @@ -1983,7 +1983,7 @@ void slsDetector::setDestinationUDPPort2(const int port) { } } -int slsDetector::getDestinationUDPPort2() { +int Module::getDestinationUDPPort2() { int retval = -1; LOG(logDEBUG1) << "Getting destination udp port2"; sendToDetector(F_GET_DEST_UDP_PORT2, nullptr, retval); @@ -1991,7 +1991,7 @@ int slsDetector::getDestinationUDPPort2() { return retval; } -void slsDetector::setNumberofUDPInterfaces(int n) { +void Module::setNumberofUDPInterfaces(int n) { LOG(logDEBUG1) << "Setting number of udp interfaces to " << n; sendToDetector(F_SET_NUM_INTERFACES, n, nullptr); shm()->numUDPInterfaces = n; @@ -2000,12 +2000,12 @@ void slsDetector::setNumberofUDPInterfaces(int n) { } } -int slsDetector::getNumberofUDPInterfacesFromShm() { +int Module::getNumberofUDPInterfacesFromShm() { return shm()->numUDPInterfaces; } -int slsDetector::getNumberofUDPInterfaces() { +int Module::getNumberofUDPInterfaces() { int retval = -1; LOG(logDEBUG1) << "Getting number of udp interfaces"; sendToDetector(F_GET_NUM_INTERFACES, nullptr, retval); @@ -2014,12 +2014,12 @@ int slsDetector::getNumberofUDPInterfaces() { return shm()->numUDPInterfaces; } -void slsDetector::selectUDPInterface(int n) { +void Module::selectUDPInterface(int n) { LOG(logDEBUG1) << "Setting selected udp interface to " << n; sendToDetector(F_SET_INTERFACE_SEL, n, nullptr); } -int slsDetector::getSelectedUDPInterface() { +int Module::getSelectedUDPInterface() { int retval = -1; LOG(logDEBUG1) << "Getting selected udp interface"; sendToDetector(F_GET_INTERFACE_SEL, nullptr, retval); @@ -2027,11 +2027,11 @@ int slsDetector::getSelectedUDPInterface() { return retval; } -void slsDetector::setClientStreamingPort(int port) { shm()->zmqport = port; } +void Module::setClientStreamingPort(int port) { shm()->zmqport = port; } -int slsDetector::getClientStreamingPort() { return shm()->zmqport; } +int Module::getClientStreamingPort() { return shm()->zmqport; } -void slsDetector::setReceiverStreamingPort(int port) { +void Module::setReceiverStreamingPort(int port) { int fnum = F_SET_RECEIVER_STREAMING_PORT; int retval = -1; LOG(logDEBUG1) << "Sending receiver streaming port to receiver: " @@ -2045,9 +2045,9 @@ void slsDetector::setReceiverStreamingPort(int port) { } } -int slsDetector::getReceiverStreamingPort() { return shm()->rxZmqport; } +int Module::getReceiverStreamingPort() { return shm()->rxZmqport; } -void slsDetector::setClientStreamingIP(const sls::IpAddr ip) { +void Module::setClientStreamingIP(const sls::IpAddr ip) { LOG(logDEBUG1) << "Setting client zmq ip to " << ip; if (ip == 0) { throw RuntimeError("Invalid client zmq ip address"); @@ -2055,9 +2055,9 @@ void slsDetector::setClientStreamingIP(const sls::IpAddr ip) { shm()->zmqip = ip; } -sls::IpAddr slsDetector::getClientStreamingIP() { return shm()->zmqip; } +sls::IpAddr Module::getClientStreamingIP() { return shm()->zmqip; } -void slsDetector::setReceiverStreamingIP(const sls::IpAddr ip) { +void Module::setReceiverStreamingIP(const sls::IpAddr ip) { LOG(logDEBUG1) << "Setting rx zmq ip to " << ip; if (ip == 0) { throw RuntimeError("Invalid receiver zmq ip address"); @@ -2079,11 +2079,11 @@ void slsDetector::setReceiverStreamingIP(const sls::IpAddr ip) { } } -sls::IpAddr slsDetector::getReceiverStreamingIP() { +sls::IpAddr Module::getReceiverStreamingIP() { return shm()->rxZmqip; } -void slsDetector::updateReceiverStreamingIP() { +void Module::updateReceiverStreamingIP() { auto ip = getReceiverStreamingIP(); if (ip == 0) { // Hostname could be ip try to decode otherwise look up the hostname @@ -2097,58 +2097,58 @@ void slsDetector::updateReceiverStreamingIP() { } -bool slsDetector::getTenGigaFlowControl() { +bool Module::getTenGigaFlowControl() { int retval = -1; sendToDetector(F_GET_TEN_GIGA_FLOW_CONTROL, nullptr, retval); LOG(logDEBUG1) << "ten giga flow control :" << retval; return retval == 1; } -void slsDetector::setTenGigaFlowControl(bool enable) { +void Module::setTenGigaFlowControl(bool enable) { int arg = static_cast(enable); LOG(logDEBUG1) << "Setting ten giga flow control to " << arg; sendToDetector(F_SET_TEN_GIGA_FLOW_CONTROL, arg, nullptr); } -int slsDetector::getTransmissionDelayFrame() { +int Module::getTransmissionDelayFrame() { int retval = -1; sendToDetector(F_GET_TRANSMISSION_DELAY_FRAME, nullptr, retval); LOG(logDEBUG1) << "transmission delay frame :" << retval; return retval; } -void slsDetector::setTransmissionDelayFrame(int value) { +void Module::setTransmissionDelayFrame(int value) { LOG(logDEBUG1) << "Setting transmission delay frame to " << value; sendToDetector(F_SET_TRANSMISSION_DELAY_FRAME, value, nullptr); } -int slsDetector::getTransmissionDelayLeft() { +int Module::getTransmissionDelayLeft() { int retval = -1; sendToDetector(F_GET_TRANSMISSION_DELAY_LEFT, nullptr, retval); LOG(logDEBUG1) << "transmission delay left :" << retval; return retval; } -void slsDetector::setTransmissionDelayLeft(int value) { +void Module::setTransmissionDelayLeft(int value) { LOG(logDEBUG1) << "Setting transmission delay left to " << value; sendToDetector(F_SET_TRANSMISSION_DELAY_LEFT, value, nullptr); } -int slsDetector::getTransmissionDelayRight() { +int Module::getTransmissionDelayRight() { int retval = -1; sendToDetector(F_GET_TRANSMISSION_DELAY_RIGHT, nullptr, retval); LOG(logDEBUG1) << "transmission delay right :" << retval; return retval; } -void slsDetector::setTransmissionDelayRight(int value) { +void Module::setTransmissionDelayRight(int value) { LOG(logDEBUG1) << "Setting transmission delay right to " << value; sendToDetector(F_SET_TRANSMISSION_DELAY_RIGHT, value, nullptr); } std::string -slsDetector::setAdditionalJsonHeader(const std::string &jsonheader) { +Module::setAdditionalJsonHeader(const std::string &jsonheader) { int fnum = F_ADDITIONAL_JSON_HEADER; char args[MAX_STR_LENGTH]{}; char retvals[MAX_STR_LENGTH]{}; @@ -2166,7 +2166,7 @@ slsDetector::setAdditionalJsonHeader(const std::string &jsonheader) { return shm()->rxAdditionalJsonHeader; } -std::string slsDetector::getAdditionalJsonHeader() { +std::string Module::getAdditionalJsonHeader() { int fnum = F_GET_ADDITIONAL_JSON_HEADER; char retvals[MAX_STR_LENGTH]{}; LOG(logDEBUG1) << "Getting additional json header "; @@ -2179,7 +2179,7 @@ std::string slsDetector::getAdditionalJsonHeader() { return std::string(shm()->rxAdditionalJsonHeader); } -std::string slsDetector::setAdditionalJsonParameter(const std::string &key, +std::string Module::setAdditionalJsonParameter(const std::string &key, const std::string &value) { if (key.empty() || value.empty()) { throw RuntimeError( @@ -2234,7 +2234,7 @@ std::string slsDetector::setAdditionalJsonParameter(const std::string &key, return getAdditionalJsonParameter(key); } -std::string slsDetector::getAdditionalJsonParameter(const std::string &key) { +std::string Module::getAdditionalJsonParameter(const std::string &key) { // additional json header is empty if (strlen(shm()->rxAdditionalJsonHeader) == 0U) return std::string(); @@ -2262,7 +2262,7 @@ std::string slsDetector::getAdditionalJsonParameter(const std::string &key) { return std::string(); } -int64_t slsDetector::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize) { +int64_t Module::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize) { LOG(logDEBUG1) << "Sending UDP Socket Buffer size to receiver: " << udpsockbufsize; int64_t retval = -1; @@ -2273,11 +2273,11 @@ int64_t slsDetector::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize) { return retval; } -int64_t slsDetector::getReceiverUDPSocketBufferSize() { +int64_t Module::getReceiverUDPSocketBufferSize() { return setReceiverUDPSocketBufferSize(); } -int64_t slsDetector::getReceiverRealUDPSocketBufferSize() const { +int64_t Module::getReceiverRealUDPSocketBufferSize() const { int64_t retval = -1; LOG(logDEBUG1) << "Getting real UDP Socket Buffer size from receiver"; if (shm()->useReceiverFlag) { @@ -2288,42 +2288,42 @@ int64_t slsDetector::getReceiverRealUDPSocketBufferSize() const { return retval; } -void slsDetector::executeFirmwareTest() { +void Module::executeFirmwareTest() { LOG(logDEBUG1) << "Executing firmware test"; sendToDetector(F_SET_FIRMWARE_TEST); } -void slsDetector::executeBusTest() { +void Module::executeBusTest() { LOG(logDEBUG1) << "Executing bus test"; sendToDetector(F_SET_BUS_TEST); } -int slsDetector::getImageTestMode() { +int Module::getImageTestMode() { int retval = -1; sendToDetector(F_GET_IMAGE_TEST_MODE, nullptr, retval); LOG(logDEBUG1) << "image test mode: " << retval; return retval; } -void slsDetector::setImageTestMode(const int value) { +void Module::setImageTestMode(const int value) { LOG(logDEBUG1) << "Sending image test mode " << value; sendToDetector(F_SET_IMAGE_TEST_MODE, value, nullptr); } -std::array slsDetector::getInjectChannel() { +std::array Module::getInjectChannel() { std::array retvals{}; sendToDetector(F_GET_INJECT_CHANNEL, nullptr, retvals); LOG(logDEBUG1) << "Inject Channel: [offset: " << retvals[0] << ", increment: " << retvals[1] << ']'; return retvals; } -void slsDetector::setInjectChannel(const int offsetChannel, const int incrementChannel) { +void Module::setInjectChannel(const int offsetChannel, const int incrementChannel) { int args[]{offsetChannel, incrementChannel}; LOG(logDEBUG1) << "Setting inject channels [offset: " << offsetChannel << ", increment: " << incrementChannel << ']'; sendToDetector(F_SET_INJECT_CHANNEL, args, nullptr); } -std::vector slsDetector::getVetoPhoton(const int chipIndex) { +std::vector Module::getVetoPhoton(const int chipIndex) { int fnum = F_GET_VETO_PHOTON; int ret = FAIL; auto client = DetectorSocket(shm()->hostname, shm()->controlPort); @@ -2351,7 +2351,7 @@ std::vector slsDetector::getVetoPhoton(const int chipIndex) { } } -void slsDetector::setVetoPhoton(const int chipIndex, const int numPhotons, const int energy, const std::string& fname) { +void Module::setVetoPhoton(const int chipIndex, const int numPhotons, const int energy, const std::string& fname) { if (shm()->myDetectorType != GOTTHARD2) { throw RuntimeError("Set Veto reference is not implemented for this detector"); } @@ -2440,13 +2440,13 @@ void slsDetector::setVetoPhoton(const int chipIndex, const int numPhotons, const } } -void slsDetector::setVetoReference(const int gainIndex, const int value) { +void Module::setVetoReference(const int gainIndex, const int value) { int args[]{gainIndex, value}; LOG(logDEBUG1) << "Setting veto reference [gainIndex: " << gainIndex << ", value: 0x" << std::hex << value << std::dec << ']'; sendToDetector(F_SET_VETO_REFERENCE, args, nullptr); } -slsDetectorDefs::burstMode slsDetector::getBurstMode() { +slsDetectorDefs::burstMode Module::getBurstMode() { int retval = -1; sendToDetector(F_GET_BURST_MODE, nullptr, retval); LOG(logDEBUG1) << "Burst mode:" << retval; @@ -2454,40 +2454,40 @@ slsDetectorDefs::burstMode slsDetector::getBurstMode() { return shm()->burstMode; } -void slsDetector::setBurstMode(slsDetectorDefs::burstMode value) { +void Module::setBurstMode(slsDetectorDefs::burstMode value) { int arg = static_cast(value); LOG(logDEBUG1) << "Setting burst mode to " << arg; sendToDetector(F_SET_BURST_MODE, arg, nullptr); shm()->burstMode = value; } -bool slsDetector::getCurrentSource() { +bool Module::getCurrentSource() { int retval = -1; sendToDetector(F_GET_CURRENT_SOURCE, nullptr, retval); LOG(logDEBUG1) << "Current source enable:" << retval; return static_cast(retval); } -void slsDetector::setCurrentSource(bool value) { +void Module::setCurrentSource(bool value) { int arg = static_cast(value); LOG(logDEBUG1) << "Setting current source enable to " << arg; sendToDetector(F_SET_CURRENT_SOURCE, arg, nullptr); } -slsDetectorDefs::timingSourceType slsDetector::getTimingSource() { +slsDetectorDefs::timingSourceType Module::getTimingSource() { int retval = -1; sendToDetector(F_GET_TIMING_SOURCE, nullptr, retval); LOG(logDEBUG1) << "Timing source:" << retval; return static_cast(retval); } -void slsDetector::setTimingSource(slsDetectorDefs::timingSourceType value) { +void Module::setTimingSource(slsDetectorDefs::timingSourceType value) { int arg = static_cast(value); LOG(logDEBUG1) << "Setting timing source to " << arg; sendToDetector(F_SET_TIMING_SOURCE, arg, nullptr); } -int slsDetector::setCounterBit(int cb) { +int Module::setCounterBit(int cb) { int retval = -1; LOG(logDEBUG1) << "Sending counter bit " << cb; sendToDetector(F_SET_COUNTER_BIT, cb, retval); @@ -2495,7 +2495,7 @@ int slsDetector::setCounterBit(int cb) { return retval; } -void slsDetector::clearROI() { +void Module::clearROI() { LOG(logDEBUG1) << "Clearing ROI"; slsDetectorDefs::ROI arg; arg.xmin = -1; @@ -2503,7 +2503,7 @@ void slsDetector::clearROI() { setROI(arg); } -void slsDetector::setROI(slsDetectorDefs::ROI arg) { +void Module::setROI(slsDetectorDefs::ROI arg) { if (arg.xmin < 0 || arg.xmax >= getNumberOfChannels().x) { arg.xmin = -1; arg.xmax = -1; @@ -2518,7 +2518,7 @@ void slsDetector::setROI(slsDetectorDefs::ROI arg) { } } -slsDetectorDefs::ROI slsDetector::getROI() { +slsDetectorDefs::ROI Module::getROI() { std::array retvals{}; sendToDetector(F_GET_ROI, nullptr, retvals); LOG(logDEBUG1) @@ -2529,7 +2529,7 @@ slsDetectorDefs::ROI slsDetector::getROI() { return retval; } -void slsDetector::setADCEnableMask(uint32_t mask) { +void Module::setADCEnableMask(uint32_t mask) { uint32_t arg = mask; LOG(logDEBUG1) << "Setting ADC Enable mask to 0x" << std::hex << arg << std::dec; @@ -2551,7 +2551,7 @@ void slsDetector::setADCEnableMask(uint32_t mask) { } } -uint32_t slsDetector::getADCEnableMask() { +uint32_t Module::getADCEnableMask() { uint32_t retval = -1; sendToDetector(F_GET_ADC_ENABLE_MASK, nullptr, 0, &retval, sizeof(retval)); LOG(logDEBUG1) << "ADC Enable Mask: 0x" << std::hex << retval @@ -2559,7 +2559,7 @@ uint32_t slsDetector::getADCEnableMask() { return retval; } -void slsDetector::setTenGigaADCEnableMask(uint32_t mask) { +void Module::setTenGigaADCEnableMask(uint32_t mask) { uint32_t arg = mask; LOG(logDEBUG1) << "Setting 10Gb ADC Enable mask to 0x" << std::hex << arg << std::dec; @@ -2581,7 +2581,7 @@ void slsDetector::setTenGigaADCEnableMask(uint32_t mask) { } } -uint32_t slsDetector::getTenGigaADCEnableMask() { +uint32_t Module::getTenGigaADCEnableMask() { uint32_t retval = -1; sendToDetector(F_GET_ADC_ENABLE_MASK_10G, nullptr, 0, &retval, sizeof(retval)); LOG(logDEBUG1) << "10Gb ADC Enable Mask: 0x" << std::hex << retval @@ -2589,13 +2589,13 @@ uint32_t slsDetector::getTenGigaADCEnableMask() { return retval; } -void slsDetector::setADCInvert(uint32_t value) { +void Module::setADCInvert(uint32_t value) { LOG(logDEBUG1) << "Setting ADC Invert to 0x" << std::hex << value << std::dec; sendToDetector(F_SET_ADC_INVERT, value, nullptr); } -uint32_t slsDetector::getADCInvert() { +uint32_t Module::getADCInvert() { uint32_t retval = -1; LOG(logDEBUG1) << "Getting ADC Invert"; sendToDetector(F_GET_ADC_INVERT, nullptr, retval); @@ -2603,7 +2603,7 @@ uint32_t slsDetector::getADCInvert() { return retval; } -int slsDetector::setExternalSamplingSource(int value) { +int Module::setExternalSamplingSource(int value) { int arg = value; int retval = -1; LOG(logDEBUG1) << "Setting External Sampling Source to " << arg; @@ -2612,11 +2612,11 @@ int slsDetector::setExternalSamplingSource(int value) { return retval; } -int slsDetector::getExternalSamplingSource() { +int Module::getExternalSamplingSource() { return setExternalSamplingSource(-1); } -int slsDetector::setExternalSampling(int value) { +int Module::setExternalSampling(int value) { int arg = value; int retval = -1; LOG(logDEBUG1) << "Setting External Sampling to " << arg; @@ -2625,9 +2625,9 @@ int slsDetector::setExternalSampling(int value) { return retval; } -int slsDetector::getExternalSampling() { return setExternalSampling(-1); } +int Module::getExternalSampling() { return setExternalSampling(-1); } -void slsDetector::setReceiverDbitList(const std::vector& list) { +void Module::setReceiverDbitList(const std::vector& list) { LOG(logDEBUG1) << "Setting Receiver Dbit List"; if (list.size() > 64) { @@ -2648,7 +2648,7 @@ void slsDetector::setReceiverDbitList(const std::vector& list) { } } -std::vector slsDetector::getReceiverDbitList() const { +std::vector Module::getReceiverDbitList() const { sls::FixedCapacityContainer retval; LOG(logDEBUG1) << "Getting Receiver Dbit List"; if (shm()->useReceiverFlag) { @@ -2658,7 +2658,7 @@ std::vector slsDetector::getReceiverDbitList() const { return shm()->rxDbitList; } -int slsDetector::setReceiverDbitOffset(int value) { +int Module::setReceiverDbitOffset(int value) { int retval = -1; LOG(logDEBUG1) << "Setting digital bit offset in receiver to " << value; @@ -2672,16 +2672,16 @@ int slsDetector::setReceiverDbitOffset(int value) { return shm()->rxDbitOffset; } -int slsDetector::getReceiverDbitOffset() { return shm()->rxDbitOffset; } +int Module::getReceiverDbitOffset() { return shm()->rxDbitOffset; } -void slsDetector::writeAdcRegister(uint32_t addr, uint32_t val) { +void Module::writeAdcRegister(uint32_t addr, uint32_t val) { uint32_t args[]{addr, val}; LOG(logDEBUG1) << "Writing to ADC register 0x" << std::hex << addr << "data: 0x" << std::hex << val << std::dec; sendToDetector(F_WRITE_ADC_REG, args, nullptr); } -int slsDetector::activate(int enable) { +int Module::activate(int enable) { int retval = -1; LOG(logDEBUG1) << "Setting activate flag to " << enable; sendToDetector(F_ACTIVATE, enable, retval); @@ -2699,7 +2699,7 @@ int slsDetector::activate(int enable) { return static_cast(shm()->activated); } -bool slsDetector::setDeactivatedRxrPaddingMode(int padding) { +bool Module::setDeactivatedRxrPaddingMode(int padding) { int fnum = F_RECEIVER_DEACTIVATED_PADDING_ENABLE; int retval = -1; LOG(logDEBUG1) << "Deactivated Receiver Padding Enable: " << padding; @@ -2713,9 +2713,9 @@ bool slsDetector::setDeactivatedRxrPaddingMode(int padding) { return shm()->rxPadDeactivatedModules; } -bool slsDetector::getFlippedDataX() const { return shm()->flippedDataX; } +bool Module::getFlippedDataX() const { return shm()->flippedDataX; } -void slsDetector::setFlippedDataX(int value) { +void Module::setFlippedDataX(int value) { // replace get with shm value (write to shm right away as it is a det value, // not rx value) if (value > -1) { @@ -2731,7 +2731,7 @@ void slsDetector::setFlippedDataX(int value) { } } -int slsDetector::setAllTrimbits(int val) { +int Module::setAllTrimbits(int val) { int retval = -1; LOG(logDEBUG1) << "Setting all trimbits to " << val; sendToDetector(F_SET_ALL_TRIMBITS, val, retval); @@ -2739,7 +2739,7 @@ int slsDetector::setAllTrimbits(int val) { return retval; } -int slsDetector::enableGapPixels(int val) { +int Module::enableGapPixels(int val) { if (val >= 0) { if (shm()->myDetectorType != EIGER) { throw NotImplementedError( @@ -2757,7 +2757,7 @@ int slsDetector::enableGapPixels(int val) { return shm()->gappixels; } -int slsDetector::setTrimEn(const std::vector& energies) { +int Module::setTrimEn(const std::vector& energies) { if (shm()->myDetectorType != EIGER) { throw RuntimeError("setTrimEn not implemented for this detector."); } @@ -2772,7 +2772,7 @@ int slsDetector::setTrimEn(const std::vector& energies) { return shm()->trimEnergies.size(); } -std::vector slsDetector::getTrimEn() { +std::vector Module::getTrimEn() { if (shm()->myDetectorType != EIGER) { throw RuntimeError("getTrimEn not implemented for this detector."); } @@ -2780,14 +2780,14 @@ std::vector slsDetector::getTrimEn() { shm()->trimEnergies.end()); } -void slsDetector::pulsePixel(int n, int x, int y) { +void Module::pulsePixel(int n, int x, int y) { int args[]{n, x, y}; LOG(logDEBUG1) << "Pulsing pixel " << n << " number of times at (" << x << "," << y << ")"; sendToDetector(F_PULSE_PIXEL, args, nullptr); } -void slsDetector::pulsePixelNMove(int n, int x, int y) { +void Module::pulsePixelNMove(int n, int x, int y) { int args[]{n, x, y}; LOG(logDEBUG1) << "Pulsing pixel " << n << " number of times and move by delta (" << x << "," @@ -2795,12 +2795,12 @@ void slsDetector::pulsePixelNMove(int n, int x, int y) { sendToDetector(F_PULSE_PIXEL_AND_MOVE, args, nullptr); } -void slsDetector::pulseChip(int n_pulses) { +void Module::pulseChip(int n_pulses) { LOG(logDEBUG1) << "Pulsing chip " << n_pulses << " number of times"; sendToDetector(F_PULSE_CHIP, n_pulses, nullptr); } -int slsDetector::setThresholdTemperature(int val) { +int Module::setThresholdTemperature(int val) { int retval = -1; LOG(logDEBUG1) << "Setting threshold temperature to " << val; sendToDetectorStop(F_THRESHOLD_TEMP, val, retval); @@ -2808,7 +2808,7 @@ int slsDetector::setThresholdTemperature(int val) { return retval; } -int slsDetector::setTemperatureControl(int val) { +int Module::setTemperatureControl(int val) { int retval = -1; LOG(logDEBUG1) << "Setting temperature control to " << val; sendToDetectorStop(F_TEMP_CONTROL, val, retval); @@ -2816,7 +2816,7 @@ int slsDetector::setTemperatureControl(int val) { return retval; } -int slsDetector::setTemperatureEvent(int val) { +int Module::setTemperatureEvent(int val) { int retval = -1; LOG(logDEBUG1) << "Setting temperature event to " << val; sendToDetectorStop(F_TEMP_EVENT, val, retval); @@ -2824,7 +2824,7 @@ int slsDetector::setTemperatureEvent(int val) { return retval; } -int slsDetector::setStoragecellStart(int pos) { +int Module::setStoragecellStart(int pos) { int retval = -1; LOG(logDEBUG1) << "Setting storage cell start to " << pos; sendToDetector(F_STORAGE_CELL_START, pos, retval); @@ -2832,7 +2832,7 @@ int slsDetector::setStoragecellStart(int pos) { return retval; } -void slsDetector::programFPGA(std::vector buffer) { +void Module::programFPGA(std::vector buffer) { switch (shm()->myDetectorType) { case JUNGFRAU: case CHIPTESTBOARD: @@ -2848,7 +2848,7 @@ void slsDetector::programFPGA(std::vector buffer) { } } -void slsDetector::programFPGAviaBlackfin(std::vector buffer) { +void Module::programFPGAviaBlackfin(std::vector buffer) { uint64_t filesize = buffer.size(); // send program from memory to detector @@ -2933,7 +2933,7 @@ void slsDetector::programFPGAviaBlackfin(std::vector buffer) { rebootController(); } -void slsDetector::programFPGAviaNios(std::vector buffer) { +void Module::programFPGAviaNios(std::vector buffer) { uint64_t filesize = buffer.size(); int fnum = F_PROGRAM_FPGA; int ret = FAIL; @@ -2967,12 +2967,12 @@ void slsDetector::programFPGAviaNios(std::vector buffer) { rebootController(); } -void slsDetector::resetFPGA() { +void Module::resetFPGA() { LOG(logDEBUG1) << "Sending reset FPGA"; return sendToDetector(F_RESET_FPGA); } -void slsDetector::copyDetectorServer(const std::string &fname, +void Module::copyDetectorServer(const std::string &fname, const std::string &hostname) { char args[2][MAX_STR_LENGTH]{}; sls::strcpy_safe(args[0], fname.c_str()); @@ -2982,13 +2982,13 @@ void slsDetector::copyDetectorServer(const std::string &fname, sendToDetector(F_COPY_DET_SERVER, args, nullptr); } -void slsDetector::rebootController() { +void Module::rebootController() { LOG(logDEBUG1) << "Rebooting Controller"; sendToDetector(F_REBOOT_CONTROLLER, nullptr, nullptr); LOG(logINFO) << "Controller rebooted successfully!"; } -int slsDetector::powerChip(int ival) { +int Module::powerChip(int ival) { int retval = -1; LOG(logDEBUG1) << "Setting power chip to " << ival; sendToDetector(F_POWER_CHIP, ival, retval); @@ -2996,7 +2996,7 @@ int slsDetector::powerChip(int ival) { return retval; } -int slsDetector::setAutoComparatorDisableMode(int ival) { +int Module::setAutoComparatorDisableMode(int ival) { int retval = -1; LOG(logDEBUG1) << "Setting auto comp disable mode to " << ival; sendToDetector(F_AUTO_COMP_DISABLE, ival, retval); @@ -3004,7 +3004,7 @@ int slsDetector::setAutoComparatorDisableMode(int ival) { return retval; } -void slsDetector::setModule(sls_detector_module &module, int tb) { +void Module::setModule(sls_detector_module &module, int tb) { int fnum = F_SET_MODULE; int ret = FAIL; int retval = -1; @@ -3031,7 +3031,7 @@ void slsDetector::setModule(sls_detector_module &module, int tb) { } } -sls_detector_module slsDetector::getModule() { +sls_detector_module Module::getModule() { int fnum = F_GET_MODULE; int ret = FAIL; LOG(logDEBUG1) << "Getting module"; @@ -3045,20 +3045,20 @@ sls_detector_module slsDetector::getModule() { return myMod; } -void slsDetector::setDefaultRateCorrection() { +void Module::setDefaultRateCorrection() { LOG(logDEBUG1) << "Setting Default Rate Correction"; int64_t arg = -1; sendToDetector(F_SET_RATE_CORRECT, arg, nullptr); shm()->deadTime = -1; } -void slsDetector::setRateCorrection(int64_t t) { +void Module::setRateCorrection(int64_t t) { LOG(logDEBUG1) << "Setting Rate Correction to " << t; sendToDetector(F_SET_RATE_CORRECT, t, nullptr); shm()->deadTime = t; } -int64_t slsDetector::getRateCorrection() { +int64_t Module::getRateCorrection() { int64_t retval = -1; LOG(logDEBUG1) << "Getting rate correction"; sendToDetector(F_GET_RATE_CORRECT, nullptr, retval); @@ -3067,7 +3067,7 @@ int64_t slsDetector::getRateCorrection() { return retval; } -void slsDetector::updateRateCorrection() { +void Module::updateRateCorrection() { if (shm()->deadTime != 0) { switch (shm()->dynamicRange) { case 16: @@ -3082,7 +3082,7 @@ void slsDetector::updateRateCorrection() { } } -std::string slsDetector::printReceiverConfiguration() { +std::string Module::printReceiverConfiguration() { std::ostringstream os; os << "\n\nDetector " << detId << "\nReceiver Hostname:\t" << getReceiverHostname(); @@ -3111,9 +3111,9 @@ std::string slsDetector::printReceiverConfiguration() { return os.str(); } -bool slsDetector::getUseReceiverFlag() const { return shm()->useReceiverFlag; } +bool Module::getUseReceiverFlag() const { return shm()->useReceiverFlag; } -int slsDetector::lockReceiver(int lock) { +int Module::lockReceiver(int lock) { LOG(logDEBUG1) << "Setting receiver server lock to " << lock; int retval = -1; if (shm()->useReceiverFlag) { @@ -3123,7 +3123,7 @@ int slsDetector::lockReceiver(int lock) { return retval; } -sls::IpAddr slsDetector::getReceiverLastClientIP() const { +sls::IpAddr Module::getReceiverLastClientIP() const { sls::IpAddr retval; LOG(logDEBUG1) << "Getting last client ip to receiver server"; if (shm()->useReceiverFlag) { @@ -3133,14 +3133,14 @@ sls::IpAddr slsDetector::getReceiverLastClientIP() const { return retval; } -void slsDetector::exitReceiver() { +void Module::exitReceiver() { LOG(logDEBUG1) << "Sending exit command to receiver server"; if (shm()->useReceiverFlag) { sendToReceiver(F_EXIT_RECEIVER); } } -void slsDetector::execReceiverCommand(const std::string &cmd) { +void Module::execReceiverCommand(const std::string &cmd) { char arg[MAX_STR_LENGTH]{}; char retval[MAX_STR_LENGTH]{}; sls::strcpy_safe(arg, cmd.c_str()); @@ -3151,7 +3151,7 @@ void slsDetector::execReceiverCommand(const std::string &cmd) { } } -void slsDetector::updateCachedReceiverVariables() const { +void Module::updateCachedReceiverVariables() const { int fnum = F_UPDATE_RECEIVER_CLIENT; LOG(logDEBUG1) << "Sending update client to receiver server"; @@ -3263,7 +3263,7 @@ void slsDetector::updateCachedReceiverVariables() const { } } -void slsDetector::sendMultiDetectorSize() { +void Module::sendMultiDetectorSize() { int args[]{shm()->multiSize.x, shm()->multiSize.y}; int retval = -1; LOG(logDEBUG1) << "Sending multi detector size to receiver: (" @@ -3275,7 +3275,7 @@ void slsDetector::sendMultiDetectorSize() { } } -void slsDetector::setDetectorId() { +void Module::setDetectorId() { LOG(logDEBUG1) << "Sending detector pos id to receiver: " << detId; if (shm()->useReceiverFlag) { int retval = -1; @@ -3284,7 +3284,7 @@ void slsDetector::setDetectorId() { } } -void slsDetector::setDetectorHostname() { +void Module::setDetectorHostname() { char args[MAX_STR_LENGTH]{}; char retvals[MAX_STR_LENGTH]{}; sls::strcpy_safe(args, shm()->hostname); @@ -3295,9 +3295,9 @@ void slsDetector::setDetectorHostname() { } } -std::string slsDetector::getFilePath() { return shm()->rxFilePath; } +std::string Module::getFilePath() { return shm()->rxFilePath; } -std::string slsDetector::setFilePath(const std::string &path) { +std::string Module::setFilePath(const std::string &path) { if (!path.empty()) { char args[MAX_STR_LENGTH]{}; char retvals[MAX_STR_LENGTH]{}; @@ -3314,9 +3314,9 @@ std::string slsDetector::setFilePath(const std::string &path) { return shm()->rxFilePath; } -std::string slsDetector::getFileName() { return shm()->rxFileName; } +std::string Module::getFileName() { return shm()->rxFileName; } -std::string slsDetector::setFileName(const std::string &fname) { +std::string Module::setFileName(const std::string &fname) { if (!fname.empty()) { char args[MAX_STR_LENGTH]{}; char retvals[MAX_STR_LENGTH]{}; @@ -3333,7 +3333,7 @@ std::string slsDetector::setFileName(const std::string &fname) { return shm()->rxFileName; } -int slsDetector::setFramesPerFile(int n_frames) { +int Module::setFramesPerFile(int n_frames) { if (n_frames >= 0) { LOG(logDEBUG1) << "Setting receiver frames per file to " << n_frames; @@ -3349,10 +3349,10 @@ int slsDetector::setFramesPerFile(int n_frames) { return getFramesPerFile(); } -int slsDetector::getFramesPerFile() const { return shm()->rxFramesPerFile; } +int Module::getFramesPerFile() const { return shm()->rxFramesPerFile; } slsDetectorDefs::frameDiscardPolicy -slsDetector::setReceiverFramesDiscardPolicy(frameDiscardPolicy f) { +Module::setReceiverFramesDiscardPolicy(frameDiscardPolicy f) { int arg = static_cast(f); LOG(logDEBUG1) << "Setting receiver frames discard policy to " << arg; if (shm()->useReceiverFlag) { @@ -3366,7 +3366,7 @@ slsDetector::setReceiverFramesDiscardPolicy(frameDiscardPolicy f) { return shm()->rxFrameDiscardMode; } -bool slsDetector::setPartialFramesPadding(bool padding) { +bool Module::setPartialFramesPadding(bool padding) { int arg = static_cast(padding); int retval = static_cast(padding); LOG(logDEBUG1) << "Setting receiver partial frames enable to " << arg; @@ -3380,11 +3380,11 @@ bool slsDetector::setPartialFramesPadding(bool padding) { return getPartialFramesPadding(); } -bool slsDetector::getPartialFramesPadding() const { +bool Module::getPartialFramesPadding() const { return shm()->rxFramePadding; } -slsDetectorDefs::fileFormat slsDetector::setFileFormat(fileFormat f) { +slsDetectorDefs::fileFormat Module::setFileFormat(fileFormat f) { if (f != GET_FILE_FORMAT) { auto arg = static_cast(f); auto retval = static_cast(-1); @@ -3400,11 +3400,11 @@ slsDetectorDefs::fileFormat slsDetector::setFileFormat(fileFormat f) { return getFileFormat(); } -slsDetectorDefs::fileFormat slsDetector::getFileFormat() const { +slsDetectorDefs::fileFormat Module::getFileFormat() const { return shm()->rxFileFormat; } -int64_t slsDetector::setFileIndex(int64_t file_index) { +int64_t Module::setFileIndex(int64_t file_index) { if (file_index >= 0) { int64_t retval = -1; LOG(logDEBUG1) << "Setting file index to " << file_index; @@ -3419,23 +3419,23 @@ int64_t slsDetector::setFileIndex(int64_t file_index) { return getFileIndex(); } -int64_t slsDetector::getFileIndex() const { return shm()->rxFileIndex; } +int64_t Module::getFileIndex() const { return shm()->rxFileIndex; } -int64_t slsDetector::incrementFileIndex() { +int64_t Module::incrementFileIndex() { if (shm()->rxFileWrite) { return setFileIndex(shm()->rxFileIndex + 1); } return shm()->rxFileIndex; } -void slsDetector::startReceiver() { +void Module::startReceiver() { LOG(logDEBUG1) << "Starting Receiver"; if (shm()->useReceiverFlag) { sendToReceiver(F_START_RECEIVER); } } -void slsDetector::stopReceiver() { +void Module::stopReceiver() { LOG(logDEBUG1) << "Stopping Receiver"; if (shm()->useReceiverFlag) { int arg = static_cast(shm()->stoppedFlag); @@ -3443,7 +3443,7 @@ void slsDetector::stopReceiver() { } } -slsDetectorDefs::runStatus slsDetector::getReceiverStatus() const { +slsDetectorDefs::runStatus Module::getReceiverStatus() const { runStatus retval = ERROR; LOG(logDEBUG1) << "Getting Receiver Status"; if (shm()->useReceiverFlag) { @@ -3453,7 +3453,7 @@ slsDetectorDefs::runStatus slsDetector::getReceiverStatus() const { return retval; } -int64_t slsDetector::getFramesCaughtByReceiver() const { +int64_t Module::getFramesCaughtByReceiver() const { int64_t retval = -1; LOG(logDEBUG1) << "Getting Frames Caught by Receiver"; if (shm()->useReceiverFlag) { @@ -3463,7 +3463,7 @@ int64_t slsDetector::getFramesCaughtByReceiver() const { return retval; } -std::vector slsDetector::getNumMissingPackets() const { +std::vector Module::getNumMissingPackets() const { LOG(logDEBUG1) << "Getting num missing packets"; if (shm()->useReceiverFlag) { int fnum = F_GET_NUM_MISSING_PACKETS; @@ -3493,7 +3493,7 @@ std::vector slsDetector::getNumMissingPackets() const { throw RuntimeError("No receiver to get missing packets."); } -uint64_t slsDetector::getReceiverCurrentFrameIndex() const { +uint64_t Module::getReceiverCurrentFrameIndex() const { uint64_t retval = -1; LOG(logDEBUG1) << "Getting Current Frame Index of Receiver"; if (shm()->useReceiverFlag) { @@ -3503,7 +3503,7 @@ uint64_t slsDetector::getReceiverCurrentFrameIndex() const { return retval; } -bool slsDetector::setFileWrite(bool value) { +bool Module::setFileWrite(bool value) { int arg = static_cast(value); int retval = -1; LOG(logDEBUG1) << "Sending enable file write to receiver: " << arg; @@ -3517,9 +3517,9 @@ bool slsDetector::setFileWrite(bool value) { return getFileWrite(); } -bool slsDetector::getFileWrite() const { return shm()->rxFileWrite; } +bool Module::getFileWrite() const { return shm()->rxFileWrite; } -bool slsDetector::setMasterFileWrite(bool value) { +bool Module::setMasterFileWrite(bool value) { int arg = static_cast(value); int retval = -1; LOG(logDEBUG1) << "Sending enable master file write to receiver: " @@ -3534,11 +3534,11 @@ bool slsDetector::setMasterFileWrite(bool value) { return getMasterFileWrite(); } -bool slsDetector::getMasterFileWrite() const { +bool Module::getMasterFileWrite() const { return shm()->rxMasterFileWrite; } -bool slsDetector::setFileOverWrite(bool value) { +bool Module::setFileOverWrite(bool value) { int arg = static_cast(value); int retval = -1; LOG(logDEBUG1) << "Sending enable file overwrite to receiver: " << arg; @@ -3552,9 +3552,9 @@ bool slsDetector::setFileOverWrite(bool value) { return getFileOverWrite(); } -bool slsDetector::getFileOverWrite() const { return shm()->rxFileOverWrite; } +bool Module::getFileOverWrite() const { return shm()->rxFileOverWrite; } -int slsDetector::setReceiverStreamingFrequency(int freq) { +int Module::setReceiverStreamingFrequency(int freq) { if (freq >= 0) { LOG(logDEBUG1) << "Sending read frequency to receiver: " << freq; if (shm()->useReceiverFlag) { @@ -3569,7 +3569,7 @@ int slsDetector::setReceiverStreamingFrequency(int freq) { return shm()->rxReadFreq; } -int slsDetector::setReceiverStreamingTimer(int time_in_ms) { +int Module::setReceiverStreamingTimer(int time_in_ms) { int retval = -1; LOG(logDEBUG1) << "Sending read timer to receiver: " << time_in_ms; if (shm()->useReceiverFlag) { @@ -3579,7 +3579,7 @@ int slsDetector::setReceiverStreamingTimer(int time_in_ms) { return retval; } -bool slsDetector::enableDataStreamingFromReceiver(int enable) { +bool Module::enableDataStreamingFromReceiver(int enable) { if (enable >= 0) { LOG(logDEBUG1) << "Sending Data Streaming to receiver: " << enable; if (shm()->useReceiverFlag) { @@ -3594,7 +3594,7 @@ bool slsDetector::enableDataStreamingFromReceiver(int enable) { return shm()->rxUpstream; } -bool slsDetector::enableTenGigabitEthernet(int value) { +bool Module::enableTenGigabitEthernet(int value) { int retval = -1; LOG(logDEBUG1) << "Enabling / Disabling 10Gbe: " << value; sendToDetector(F_ENABLE_TEN_GIGA, value, retval); @@ -3609,7 +3609,7 @@ bool slsDetector::enableTenGigabitEthernet(int value) { return static_cast(retval); } -int slsDetector::setReceiverFifoDepth(int n_frames) { +int Module::setReceiverFifoDepth(int n_frames) { int retval = -1; LOG(logDEBUG1) << "Sending Receiver Fifo Depth: " << n_frames; if (shm()->useReceiverFlag) { @@ -3619,7 +3619,7 @@ int slsDetector::setReceiverFifoDepth(int n_frames) { return retval; } -bool slsDetector::setReceiverSilentMode(int value) { +bool Module::setReceiverSilentMode(int value) { LOG(logDEBUG1) << "Sending Receiver Silent Mode: " << value; if (shm()->useReceiverFlag) { int retval = -1; @@ -3632,14 +3632,14 @@ bool slsDetector::setReceiverSilentMode(int value) { return shm()->rxSilentMode; } -void slsDetector::restreamStopFromReceiver() { +void Module::restreamStopFromReceiver() { LOG(logDEBUG1) << "Restream stop dummy from Receiver via zmq"; if (shm()->useReceiverFlag) { sendToReceiver(F_RESTREAM_STOP_FROM_RECEIVER); } } -void slsDetector::setPattern(const std::string &fname) { +void Module::setPattern(const std::string &fname) { uint64_t word; uint64_t addr = 0; FILE *fd = fopen(fname.c_str(), "r"); @@ -3655,7 +3655,7 @@ void slsDetector::setPattern(const std::string &fname) { } } -uint64_t slsDetector::setPatternIOControl(uint64_t word) { +uint64_t Module::setPatternIOControl(uint64_t word) { uint64_t retval = -1; LOG(logDEBUG1) << "Setting Pattern IO Control, word: 0x" << std::hex << word << std::dec; @@ -3664,7 +3664,7 @@ uint64_t slsDetector::setPatternIOControl(uint64_t word) { return retval; } -uint64_t slsDetector::setPatternClockControl(uint64_t word) { +uint64_t Module::setPatternClockControl(uint64_t word) { uint64_t retval = -1; LOG(logDEBUG1) << "Setting Pattern Clock Control, word: 0x" << std::hex << word << std::dec; @@ -3673,7 +3673,7 @@ uint64_t slsDetector::setPatternClockControl(uint64_t word) { return retval; } -uint64_t slsDetector::setPatternWord(int addr, uint64_t word) { +uint64_t Module::setPatternWord(int addr, uint64_t word) { uint64_t args[]{static_cast(addr), word}; uint64_t retval = -1; LOG(logDEBUG1) << "Setting Pattern word, addr: 0x" << std::hex << addr @@ -3683,7 +3683,7 @@ uint64_t slsDetector::setPatternWord(int addr, uint64_t word) { return retval; } -std::array slsDetector::setPatternLoopAddresses(int level, int start, int stop) { +std::array Module::setPatternLoopAddresses(int level, int start, int stop) { int args[]{level, start, stop}; std::array retvals{}; LOG(logDEBUG1) << "Setting Pat Loop Addresses, level: " << level @@ -3693,7 +3693,7 @@ std::array slsDetector::setPatternLoopAddresses(int level, int start, in return retvals; } -int slsDetector::setPatternLoopCycles(int level, int n) { +int Module::setPatternLoopCycles(int level, int n) { int args[]{level, n}; int retval = -1; LOG(logDEBUG1) << "Setting Pat Loop cycles, level: " << level @@ -3703,7 +3703,7 @@ int slsDetector::setPatternLoopCycles(int level, int n) { return retval; } -int slsDetector::setPatternWaitAddr(int level, int addr) { +int Module::setPatternWaitAddr(int level, int addr) { int retval = -1; int args[]{level, addr}; LOG(logDEBUG1) << "Setting Pat Wait Addr, level: " << level @@ -3713,7 +3713,7 @@ int slsDetector::setPatternWaitAddr(int level, int addr) { return retval; } -uint64_t slsDetector::setPatternWaitTime(int level, uint64_t t) { +uint64_t Module::setPatternWaitTime(int level, uint64_t t) { uint64_t retval = -1; uint64_t args[]{static_cast(level), t}; LOG(logDEBUG1) << "Setting Pat Wait Time, level: " << level @@ -3723,14 +3723,14 @@ uint64_t slsDetector::setPatternWaitTime(int level, uint64_t t) { return retval; } -void slsDetector::setPatternMask(uint64_t mask) { +void Module::setPatternMask(uint64_t mask) { LOG(logDEBUG1) << "Setting Pattern Mask " << std::hex << mask << std::dec; sendToDetector(F_SET_PATTERN_MASK, mask, nullptr); LOG(logDEBUG1) << "Pattern Mask successful"; } -uint64_t slsDetector::getPatternMask() { +uint64_t Module::getPatternMask() { uint64_t retval = -1; LOG(logDEBUG1) << "Getting Pattern Mask "; @@ -3739,14 +3739,14 @@ uint64_t slsDetector::getPatternMask() { return retval; } -void slsDetector::setPatternBitMask(uint64_t mask) { +void Module::setPatternBitMask(uint64_t mask) { LOG(logDEBUG1) << "Setting Pattern Bit Mask " << std::hex << mask << std::dec; sendToDetector(F_SET_PATTERN_BIT_MASK, mask, nullptr); LOG(logDEBUG1) << "Pattern Bit Mask successful"; } -uint64_t slsDetector::getPatternBitMask() { +uint64_t Module::getPatternBitMask() { uint64_t retval = -1; LOG(logDEBUG1) << "Getting Pattern Bit Mask "; sendToDetector(F_GET_PATTERN_BIT_MASK, nullptr, retval); @@ -3754,7 +3754,7 @@ uint64_t slsDetector::getPatternBitMask() { return retval; } -int slsDetector::setLEDEnable(int enable) { +int Module::setLEDEnable(int enable) { int retval = -1; LOG(logDEBUG1) << "Sending LED Enable: " << enable; sendToDetector(F_LED, enable, retval); @@ -3762,7 +3762,7 @@ int slsDetector::setLEDEnable(int enable) { return retval; } -void slsDetector::setDigitalIODelay(uint64_t pinMask, int delay) { +void Module::setDigitalIODelay(uint64_t pinMask, int delay) { uint64_t args[]{pinMask, static_cast(delay)}; LOG(logDEBUG1) << "Sending Digital IO Delay, pin mask: " << std::hex << args[0] << ", delay: " << std::dec << args[1] @@ -3771,7 +3771,7 @@ void slsDetector::setDigitalIODelay(uint64_t pinMask, int delay) { LOG(logDEBUG1) << "Digital IO Delay successful"; } -int slsDetector::getClockFrequency(int clkIndex) { +int Module::getClockFrequency(int clkIndex) { int retval = -1; LOG(logDEBUG1) << "Getting Clock " << clkIndex << " frequency"; sendToDetector(F_GET_CLOCK_FREQUENCY, clkIndex, retval); @@ -3779,13 +3779,13 @@ int slsDetector::getClockFrequency(int clkIndex) { return retval; } -void slsDetector::setClockFrequency(int clkIndex, int value) { +void Module::setClockFrequency(int clkIndex, int value) { int args[]{clkIndex, value}; LOG(logDEBUG1) << "Setting Clock " << clkIndex << " frequency to " << value; sendToDetector(F_SET_CLOCK_FREQUENCY, args, nullptr); } -int slsDetector::getClockPhase(int clkIndex, bool inDegrees) { +int Module::getClockPhase(int clkIndex, bool inDegrees) { int args[]{clkIndex, static_cast(inDegrees)}; int retval = -1; LOG(logDEBUG1) << "Getting Clock " << clkIndex << " phase " << (inDegrees ? "in degrees" : ""); @@ -3794,13 +3794,13 @@ int slsDetector::getClockPhase(int clkIndex, bool inDegrees) { return retval; } -void slsDetector::setClockPhase(int clkIndex, int value, bool inDegrees) { +void Module::setClockPhase(int clkIndex, int value, bool inDegrees) { int args[]{clkIndex, value, static_cast(inDegrees)}; LOG(logDEBUG1) << "Setting Clock " << clkIndex << " phase to " << value << (inDegrees ? "degrees" : ""); sendToDetector(F_SET_CLOCK_PHASE, args, nullptr); } -int slsDetector::getMaxClockPhaseShift(int clkIndex) { +int Module::getMaxClockPhaseShift(int clkIndex) { int retval = -1; LOG(logDEBUG1) << "Getting Max Phase Shift for Clock " << clkIndex; sendToDetector(F_GET_MAX_CLOCK_PHASE_SHIFT, clkIndex, retval); @@ -3808,7 +3808,7 @@ int slsDetector::getMaxClockPhaseShift(int clkIndex) { return retval; } -int slsDetector::getClockDivider(int clkIndex) { +int Module::getClockDivider(int clkIndex) { int retval = -1; LOG(logDEBUG1) << "Getting Clock " << clkIndex << " divider"; sendToDetector(F_GET_CLOCK_DIVIDER, clkIndex, retval); @@ -3816,13 +3816,13 @@ int slsDetector::getClockDivider(int clkIndex) { return retval; } -void slsDetector::setClockDivider(int clkIndex, int value) { +void Module::setClockDivider(int clkIndex, int value) { int args[]{clkIndex, value}; LOG(logDEBUG1) << "Setting Clock " << clkIndex << " divider to " << value; sendToDetector(F_SET_CLOCK_DIVIDER, args, nullptr); } -int slsDetector::getPipeline(int clkIndex) { +int Module::getPipeline(int clkIndex) { int retval = -1; LOG(logDEBUG1) << "Getting Clock " << clkIndex << " pipeline"; sendToDetector(F_GET_PIPELINE, clkIndex, retval); @@ -3830,19 +3830,19 @@ int slsDetector::getPipeline(int clkIndex) { return retval; } -void slsDetector::setPipeline(int clkIndex, int value) { +void Module::setPipeline(int clkIndex, int value) { int args[]{clkIndex, value}; LOG(logDEBUG1) << "Setting Clock " << clkIndex << " pipeline to " << value; sendToDetector(F_SET_PIPELINE, args, nullptr); } -void slsDetector::setCounterMask(uint32_t countermask) { +void Module::setCounterMask(uint32_t countermask) { LOG(logDEBUG1) << "Setting Counter mask to " << countermask; sendToDetector(F_SET_COUNTER_MASK, countermask, nullptr); sendNumberofCounterstoReceiver(countermask); } -void slsDetector::sendNumberofCounterstoReceiver(uint32_t countermask) { +void Module::sendNumberofCounterstoReceiver(uint32_t countermask) { if (shm()->useReceiverFlag) { int ncounters = __builtin_popcount(countermask); LOG(logDEBUG1) << "Sending Reciver #counters: " << ncounters; @@ -3850,7 +3850,7 @@ void slsDetector::sendNumberofCounterstoReceiver(uint32_t countermask) { } } -uint32_t slsDetector::getCounterMask() { +uint32_t Module::getCounterMask() { uint32_t retval = 0; sendToDetector(F_GET_COUNTER_MASK, nullptr, retval); LOG(logDEBUG1) << "Received counter mask: " << retval; @@ -3858,7 +3858,7 @@ uint32_t slsDetector::getCounterMask() { } -sls_detector_module slsDetector::interpolateTrim(sls_detector_module *a, +sls_detector_module Module::interpolateTrim(sls_detector_module *a, sls_detector_module *b, const int energy, const int e1, const int e2, int tb) { @@ -3927,7 +3927,7 @@ sls_detector_module slsDetector::interpolateTrim(sls_detector_module *a, return myMod; } -sls_detector_module slsDetector::readSettingsFile(const std::string &fname, +sls_detector_module Module::readSettingsFile(const std::string &fname, int tb) { LOG(logDEBUG1) << "Read settings file " << fname; sls_detector_module myMod(shm()->myDetectorType); @@ -4023,7 +4023,7 @@ sls_detector_module slsDetector::readSettingsFile(const std::string &fname, return myMod; } -void slsDetector::writeSettingsFile(const std::string &fname, +void Module::writeSettingsFile(const std::string &fname, sls_detector_module &mod) { LOG(logDEBUG1) << "Write settings file " << fname; auto names = getSettingsFileDacNames(); @@ -4062,7 +4062,7 @@ void slsDetector::writeSettingsFile(const std::string &fname, outfile.close(); } -std::vector slsDetector::getSettingsFileDacNames() { +std::vector Module::getSettingsFileDacNames() { switch (shm()->myDetectorType) { case GOTTHARD: return {"Vref", "VcascN", "VcascP", "Vout", @@ -4081,3 +4081,5 @@ std::vector slsDetector::getSettingsFileDacNames() { } return {}; } + +}//namespace sls \ No newline at end of file diff --git a/slsDetectorSoftware/src/slsDetector.h b/slsDetectorSoftware/src/Module.h similarity index 99% rename from slsDetectorSoftware/src/slsDetector.h rename to slsDetectorSoftware/src/Module.h index 30ff13f15..cde79c4d1 100755 --- a/slsDetectorSoftware/src/slsDetector.h +++ b/slsDetectorSoftware/src/Module.h @@ -15,6 +15,8 @@ class ServerInterface; #define SLS_SHMAPIVERSION 0x190726 #define SLS_SHMVERSION 0x200309 +namespace sls{ + /** * @short structure allocated in shared memory to store detector settings for * IPC and cache @@ -178,7 +180,7 @@ struct sharedSlsDetector { bool stoppedFlag; }; -class slsDetector : public virtual slsDetectorDefs { +class Module : public virtual slsDetectorDefs { public: /** * Constructor called when creating new shared memory @@ -188,7 +190,7 @@ class slsDetector : public virtual slsDetectorDefs { * @param verify true to verify if shared memory version matches existing * one */ - explicit slsDetector(detectorType type, int multi_id = 0, int det_id = 0, + explicit Module(detectorType type, int multi_id = 0, int det_id = 0, bool verify = true); /** @@ -198,12 +200,12 @@ class slsDetector : public virtual slsDetectorDefs { * @param verify true to verify if shared memory version matches existing * one */ - explicit slsDetector(int multi_id = 0, int det_id = 0, bool verify = true); + explicit Module(int multi_id = 0, int det_id = 0, bool verify = true); /** * Destructor */ - virtual ~slsDetector(); + virtual ~Module(); /** * Returns false if it cannot get fixed pattern from an old version of shm @@ -235,7 +237,7 @@ class slsDetector : public virtual slsDetectorDefs { /** * Free shared memory and delete shared memory structure * occupied by the sharedSlsDetector structure - * Is only safe to call if one deletes the slsDetector object afterward + * Is only safe to call if one deletes the Module object afterward * and frees multi shared memory/updates * thisMultiDetector->numberOfDetectors */ @@ -2083,9 +2085,11 @@ class slsDetector : public virtual slsDetectorDefs { */ std::vector getSettingsFileDacNames(); - /** slsDetector Id or position in the detectors list */ + /** Module Id or position in the detectors list */ const int detId; /** Shared Memory object */ mutable sls::SharedMemory shm{0, 0}; }; + +}// sls \ No newline at end of file