diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index eb4cb4f5c..3b299bf88 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -224,6 +224,7 @@ Result Detector::getNumberOfTriggers(Positions pos) const { void Detector::setNumberOfTriggers(int64_t value) { pimpl->Parallel(&Module::setNumberOfTriggers, {}, value); + pimpl->Parallel3(&Receiver::setNumberOfTriggers, value); } Result Detector::getExptime(Positions pos) const { @@ -231,7 +232,17 @@ Result Detector::getExptime(Positions pos) const { } void Detector::setExptime(ns t, Positions pos) { + bool change = false; + if (getDetectorType().squash() == defs::EIGER) { + ns prevVal = getPeriod(pos).squash(); + if (prevVal != t) { + change = true; + } + } pimpl->Parallel(&Module::setExptime, pos, t.count()); + if (change) { + pimpl->Parallel(&Module::updateRateCorrection, pos); + } } Result Detector::getPeriod(Positions pos) const { @@ -1303,6 +1314,7 @@ Result Detector::getNumberOfBursts(Positions pos) const { void Detector::setNumberOfBursts(int64_t value) { pimpl->Parallel(&Module::setNumberOfBursts, {}, value); + pimpl->Parallel3(&Receiver::setNumberOfBursts, value); } Result Detector::getBurstPeriod(Positions pos) const { @@ -1375,6 +1387,7 @@ Result Detector::getNumberOfAnalogSamples(Positions pos) const { void Detector::setNumberOfAnalogSamples(int value, Positions pos) { pimpl->Parallel(&Module::setNumberOfAnalogSamples, pos, value); + pimpl->Parallel3(&Receiver::setNumberOfAnalogSamples, value); } @@ -1472,6 +1485,7 @@ Result Detector::getNumberOfDigitalSamples(Positions pos) const { void Detector::setNumberOfDigitalSamples(int value, Positions pos) { pimpl->Parallel(&Module::setNumberOfDigitalSamples, pos, value); + pimpl->Parallel3(&Receiver::setNumberOfDigitalSamples, value); } Result Detector::getReadoutMode(Positions pos) const { diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index cac959beb..5b934e007 100755 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1007,10 +1007,6 @@ int64_t Module::getNumberOfTriggers() { void Module::setNumberOfTriggers(int64_t value) { LOG(logDEBUG1) << "Setting number of triggers to " << value; sendToDetector(F_SET_NUM_TRIGGERS, value, nullptr); - if (shm()->useReceiver) { - LOG(logDEBUG1) << "Sending number of triggers to Receiver: " << value; - sendToReceiver(F_SET_RECEIVER_NUM_TRIGGERS, value, nullptr); - } } int64_t Module::getNumberOfBursts() { @@ -1023,10 +1019,6 @@ int64_t Module::getNumberOfBursts() { void Module::setNumberOfBursts(int64_t value) { LOG(logDEBUG1) << "Setting number of bursts to " << value; sendToDetector(F_SET_NUM_BURSTS, value, nullptr); - if (shm()->useReceiver) { - LOG(logDEBUG1) << "Sending number of bursts to Receiver: " << value; - sendToReceiver(F_SET_RECEIVER_NUM_BURSTS, value, nullptr); - } } int Module::getNumberOfAdditionalStorageCells() { @@ -1053,10 +1045,6 @@ void Module::setNumberOfAnalogSamples(int value) { sendToDetector(F_SET_NUM_ANALOG_SAMPLES, value, nullptr); // update #nchan, as it depends on #samples, adcmask updateNumberOfChannels(); - if (shm()->useReceiver) { - LOG(logDEBUG1) << "Sending number of analog samples to Receiver: " << value; - sendToReceiver(F_RECEIVER_SET_NUM_ANALOG_SAMPLES, value, nullptr); - } } int Module::getNumberOfDigitalSamples() { @@ -1071,10 +1059,6 @@ void Module::setNumberOfDigitalSamples(int value) { sendToDetector(F_SET_NUM_DIGITAL_SAMPLES, value, nullptr); // update #nchan, as it depends on #samples, adcmask updateNumberOfChannels(); - if (shm()->useReceiver) { - LOG(logDEBUG1) << "Sending number of digital samples to Receiver: " << value; - sendToReceiver(F_RECEIVER_SET_NUM_DIGITAL_SAMPLES, value, nullptr); - } } int64_t Module::getExptime() { @@ -1082,19 +1066,8 @@ int64_t Module::getExptime() { } void Module::setExptime(int64_t value) { - int64_t prevVal = value; - if (shm()->myDetectorType == EIGER) { - prevVal = getExptime(); - } LOG(logDEBUG1) << "Setting exptime to " << value << "ns"; sendToDetector(F_SET_EXPTIME, value, nullptr); - if (shm()->useReceiver) { - LOG(logDEBUG1) << "Sending exptime to Receiver: " << value; - sendToReceiver(F_RECEIVER_SET_EXPTIME, value, nullptr); - } - if (prevVal != value) { - updateRateCorrection(); - } } int64_t Module::getPeriod() { diff --git a/slsDetectorSoftware/src/Receiver.cpp b/slsDetectorSoftware/src/Receiver.cpp index 5a652621a..50923c9a3 100755 --- a/slsDetectorSoftware/src/Receiver.cpp +++ b/slsDetectorSoftware/src/Receiver.cpp @@ -328,6 +328,31 @@ void Receiver::setNumberOfFrames(int64_t value) { sendToReceiver(F_RECEIVER_SET_NUM_FRAMES, value, nullptr); } +void Receiver::setNumberOfTriggers(int64_t value) { + LOG(logDEBUG1) << "Sending number of triggers to Receiver: " << value; + sendToReceiver(F_SET_RECEIVER_NUM_TRIGGERS, value, nullptr); +} + +void Receiver::setNumberOfBursts(int64_t value) { + LOG(logDEBUG1) << "Sending number of bursts to Receiver: " << value; + sendToReceiver(F_SET_RECEIVER_NUM_BURSTS, value, nullptr); +} + +void Receiver::setNumberOfAnalogSamples(int value) { + LOG(logDEBUG1) << "Sending number of analog samples to Receiver: " << value; + sendToReceiver(F_RECEIVER_SET_NUM_ANALOG_SAMPLES, value, nullptr); +} + +void Receiver::setNumberOfDigitalSamples(int value) { + LOG(logDEBUG1) << "Sending number of digital samples to Receiver: " << value; + sendToReceiver(F_RECEIVER_SET_NUM_DIGITAL_SAMPLES, value, nullptr); +} + +void Receiver::setExptime(int64_t value) { + LOG(logDEBUG1) << "Sending exptime to Receiver: " << value; + sendToReceiver(F_RECEIVER_SET_EXPTIME, value, nullptr); +} + /** Acquisition */ void Receiver::start() { diff --git a/slsDetectorSoftware/src/Receiver.h b/slsDetectorSoftware/src/Receiver.h index 53d63181a..623094f38 100755 --- a/slsDetectorSoftware/src/Receiver.h +++ b/slsDetectorSoftware/src/Receiver.h @@ -66,6 +66,11 @@ namespace sls { * * * ************************************************/ void setNumberOfFrames(int64_t value); + void setNumberOfTriggers(int64_t value); + void setNumberOfBursts(int64_t value); + void setNumberOfAnalogSamples(int value); + void setNumberOfDigitalSamples(int value); + void setExptime(int64_t value); /**************************************************