diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index b5d54fdbc..a282fd41f 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -265,28 +265,26 @@ int Module::getDynamicRange() const { return sendToDetector(F_SET_DYNAMIC_RANGE, GET_FLAG); } -void Module::setDynamicRange(int n) { - int prev_val = n; +void Module::setDynamicRange(int dr) { + int prev_val = dr; if (shm()->myDetectorType == EIGER) { prev_val = getDynamicRange(); } - auto retval = sendToDetector(F_SET_DYNAMIC_RANGE, n); + auto retval = sendToDetector(F_SET_DYNAMIC_RANGE, dr); if (shm()->useReceiverFlag) { - int arg = retval; - sendToReceiver(F_SET_RECEIVER_DYNAMIC_RANGE, arg); + sendToReceiver(F_SET_RECEIVER_DYNAMIC_RANGE, retval); } - // changes in dr - if (n != prev_val) { - // update speed for usability - if (n == 32) { + // EIGER only, update speed and rate correction when dr changes + if (dr != prev_val) { + if (dr == 32) { LOG(logINFO) << "Setting Clock to Quarter Speed to cope with " "Dynamic Range of 32"; setClockDivider(RUN_CLOCK, 2); } else if (prev_val == 32) { LOG(logINFO) << "Setting Clock to Full Speed for Dynamic Range of " - << n; + << dr; setClockDivider(RUN_CLOCK, 0); } updateRateCorrection(); @@ -1293,8 +1291,7 @@ int Module::getTemperatureEvent() const { } void Module::resetTemperatureEvent() { - int arg = 0; - sendToDetectorStop(F_TEMP_EVENT, arg); + sendToDetectorStop(F_TEMP_EVENT, 0); } bool Module::getAutoComparatorDisableMode() const{ diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 6a58a5776..a6bc3ee75 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -126,7 +126,7 @@ class Module : public virtual slsDetectorDefs { int64_t getDelayAfterTriggerLeft() const; int64_t getPeriodLeft() const; int getDynamicRange() const; - void setDynamicRange(int n); + void setDynamicRange(int dr); timingMode getTimingMode() const; void setTimingMode(timingMode value); int getClockDivider(int clkIndex) const;