This commit is contained in:
Erik Frojdh 2020-07-28 08:41:45 +02:00
parent 02bda7c533
commit 91652df5b1
2 changed files with 10 additions and 13 deletions

View File

@ -265,28 +265,26 @@ int Module::getDynamicRange() const {
return sendToDetector<int>(F_SET_DYNAMIC_RANGE, GET_FLAG); return sendToDetector<int>(F_SET_DYNAMIC_RANGE, GET_FLAG);
} }
void Module::setDynamicRange(int n) { void Module::setDynamicRange(int dr) {
int prev_val = n; int prev_val = dr;
if (shm()->myDetectorType == EIGER) { if (shm()->myDetectorType == EIGER) {
prev_val = getDynamicRange(); prev_val = getDynamicRange();
} }
auto retval = sendToDetector<int>(F_SET_DYNAMIC_RANGE, n); auto retval = sendToDetector<int>(F_SET_DYNAMIC_RANGE, dr);
if (shm()->useReceiverFlag) { if (shm()->useReceiverFlag) {
int arg = retval; sendToReceiver<int>(F_SET_RECEIVER_DYNAMIC_RANGE, retval);
sendToReceiver<int>(F_SET_RECEIVER_DYNAMIC_RANGE, arg);
} }
// changes in dr // EIGER only, update speed and rate correction when dr changes
if (n != prev_val) { if (dr != prev_val) {
// update speed for usability if (dr == 32) {
if (n == 32) {
LOG(logINFO) << "Setting Clock to Quarter Speed to cope with " LOG(logINFO) << "Setting Clock to Quarter Speed to cope with "
"Dynamic Range of 32"; "Dynamic Range of 32";
setClockDivider(RUN_CLOCK, 2); setClockDivider(RUN_CLOCK, 2);
} else if (prev_val == 32) { } else if (prev_val == 32) {
LOG(logINFO) << "Setting Clock to Full Speed for Dynamic Range of " LOG(logINFO) << "Setting Clock to Full Speed for Dynamic Range of "
<< n; << dr;
setClockDivider(RUN_CLOCK, 0); setClockDivider(RUN_CLOCK, 0);
} }
updateRateCorrection(); updateRateCorrection();
@ -1293,8 +1291,7 @@ int Module::getTemperatureEvent() const {
} }
void Module::resetTemperatureEvent() { void Module::resetTemperatureEvent() {
int arg = 0; sendToDetectorStop<int>(F_TEMP_EVENT, 0);
sendToDetectorStop<int>(F_TEMP_EVENT, arg);
} }
bool Module::getAutoComparatorDisableMode() const{ bool Module::getAutoComparatorDisableMode() const{

View File

@ -126,7 +126,7 @@ class Module : public virtual slsDetectorDefs {
int64_t getDelayAfterTriggerLeft() const; int64_t getDelayAfterTriggerLeft() const;
int64_t getPeriodLeft() const; int64_t getPeriodLeft() const;
int getDynamicRange() const; int getDynamicRange() const;
void setDynamicRange(int n); void setDynamicRange(int dr);
timingMode getTimingMode() const; timingMode getTimingMode() const;
void setTimingMode(timingMode value); void setTimingMode(timingMode value);
int getClockDivider(int clkIndex) const; int getClockDivider(int clkIndex) const;