From 6de68eacc2ff50dd88dd1526b48b328d466bc24c Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 21 Apr 2020 18:48:04 +0200 Subject: [PATCH] WIP --- slsDetectorSoftware/src/Detector.cpp | 3 +++ slsDetectorSoftware/src/Module.cpp | 32 ---------------------------- slsDetectorSoftware/src/Module.h | 11 +--------- slsDetectorSoftware/src/Receiver.cpp | 19 +++++++++++++++++ slsDetectorSoftware/src/Receiver.h | 5 +++++ 5 files changed, 28 insertions(+), 42 deletions(-) diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 39fc128fe..eb4cb4f5c 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -215,6 +215,7 @@ Result Detector::getNumberOfFrames(Positions pos) const { void Detector::setNumberOfFrames(int64_t value) { pimpl->Parallel(&Module::setNumberOfFrames, {}, value); + pimpl->Parallel3(&Receiver::setNumberOfFrames, value); //FIXME } Result Detector::getNumberOfTriggers(Positions pos) const { @@ -1124,6 +1125,7 @@ Result Detector::getPartialReadout(Positions pos) const { void Detector::setPartialReadout(const int lines, Positions pos) { pimpl->Parallel(&Module::setReadNLines, pos, lines); + pimpl->Parallel3(&Receiver::setReadNLines, lines); } Result Detector::getInterruptSubframe(Positions pos) const { @@ -1193,6 +1195,7 @@ void Detector::setQuad(const bool enable) { "Eiger Quad Half module."); } pimpl->Parallel(&Module::setQuad, {}, enable); + pimpl->Parallel3(&Receiver::setQuad, enable); //FIXME } // Jungfrau Specific diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index cd7f3a416..cac959beb 100755 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -115,15 +115,6 @@ void Module::checkDetectorVersionCompatibility() { sendToDetectorStop(fnum, arg, nullptr); } -void Module::checkReceiverVersionCompatibility() { - // TODO! Verify that this works as intended when version don't match - int64_t arg = APIRECEIVER; - LOG(logDEBUG1) - << "Checking version compatibility with receiver with value " - << std::hex << arg << std::dec; - sendToReceiver(F_RECEIVER_CHECK_VERSION, arg, nullptr); -} - int64_t Module::getFirmwareVersion() { int64_t retval = -1; sendToDetector(F_GET_FIRMWARE_VERSION, nullptr, retval); @@ -145,16 +136,6 @@ int64_t Module::getSerialNumber() { return retval; } - -int64_t Module::getReceiverSoftwareVersion() const { - LOG(logDEBUG1) << "Getting receiver software version"; - int64_t retval = -1; - if (shm()->useReceiver) { - sendToReceiver(F_GET_RECEIVER_VERSION, nullptr, retval); - } - return retval; -} - 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); @@ -583,20 +564,11 @@ void Module::setQuad(const bool enable) { int value = enable ? 1 : 0; LOG(logDEBUG1) << "Setting Quad type to " << value; sendToDetector(F_SET_QUAD, value, nullptr); - LOG(logDEBUG1) << "Setting Quad type to " << value << " in Receiver"; - if (shm()->useReceiver) { - sendToReceiver(F_SET_RECEIVER_QUAD, value, nullptr); - } } 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 - << " in Receiver"; - if (shm()->useReceiver) { - sendToReceiver(F_SET_RECEIVER_READ_N_LINES, value, nullptr); - } } int Module::getReadNLines() { @@ -1023,10 +995,6 @@ int64_t Module::getNumberOfFrames() { void Module::setNumberOfFrames(int64_t value) { LOG(logDEBUG1) << "Setting number of frames to " << value; sendToDetector(F_SET_NUM_FRAMES, value, nullptr); - if (shm()->useReceiver) { - LOG(logDEBUG1) << "Sending number of frames to Receiver: " << value; - sendToReceiver(F_RECEIVER_SET_NUM_FRAMES, value, nullptr); - } } int64_t Module::getNumberOfTriggers() { diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 65a9c914f..872f64740 100755 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -125,11 +125,7 @@ class Module : public virtual slsDetectorDefs { void setNumberOfReceivers(const int num); int getNumberOfReceivers2() const; void setNumberOfReceivers2(const int num); - /** - * Check version compatibility with receiver software - */ - void checkReceiverVersionCompatibility(); - + /** * Check version compatibility with detector software */ @@ -141,11 +137,6 @@ class Module : public virtual slsDetectorDefs { int64_t getSerialNumber(); - /** - * Get Receiver Software version - */ - int64_t getReceiverSoftwareVersion() const; - /** * Free shared memory and delete shared memory structure * occupied by the sharedModule structure diff --git a/slsDetectorSoftware/src/Receiver.cpp b/slsDetectorSoftware/src/Receiver.cpp index b62fe775d..5a652621a 100755 --- a/slsDetectorSoftware/src/Receiver.cpp +++ b/slsDetectorSoftware/src/Receiver.cpp @@ -322,6 +322,12 @@ int64_t Receiver::getSoftwareVersion() const { return sendToReceiver(F_GET_RECEIVER_VERSION); } +/** Acquisition Parameters */ +void Receiver::setNumberOfFrames(int64_t value) { + LOG(logDEBUG1) << "Sending number of frames to Receiver: " << value; + sendToReceiver(F_RECEIVER_SET_NUM_FRAMES, value, nullptr); +} + /** Acquisition */ void Receiver::start() { @@ -362,6 +368,19 @@ void Receiver::restreamStop() { } /** Detector Specific */ +// Eiger +void Receiver::setQuad(const bool enable) { + int value = enable ? 1 : 0; + LOG(logDEBUG1) << "Setting Quad type to " << value << " in Receiver"; + sendToReceiver(F_SET_RECEIVER_QUAD, value, nullptr); +} + +void Receiver::setReadNLines(const int value) { + LOG(logDEBUG1) << "Setting read n lines to " << value + << " in Receiver"; + sendToReceiver(F_SET_RECEIVER_READ_N_LINES, value, nullptr); +} + // Moench void Receiver::setAdditionalJsonHeader(const std::map &jsonHeader) { diff --git a/slsDetectorSoftware/src/Receiver.h b/slsDetectorSoftware/src/Receiver.h index 9fe7b9c58..53d63181a 100755 --- a/slsDetectorSoftware/src/Receiver.h +++ b/slsDetectorSoftware/src/Receiver.h @@ -65,6 +65,7 @@ namespace sls { * Acquisition Parameters * * * * ************************************************/ + void setNumberOfFrames(int64_t value); /************************************************** @@ -101,6 +102,10 @@ namespace sls { * Detector Specific * * * * ************************************************/ + // Eiger + void setQuad(const bool enable); + void setReadNLines(const int value); + // Moench /** empty vector deletes entire additional json header */ void setAdditionalJsonHeader(const std::map &jsonHeader);