mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-30 18:00:05 +02:00
WIP
This commit is contained in:
parent
6de68eacc2
commit
8d0146949c
@ -224,6 +224,7 @@ Result<int64_t> Detector::getNumberOfTriggers(Positions pos) const {
|
|||||||
|
|
||||||
void Detector::setNumberOfTriggers(int64_t value) {
|
void Detector::setNumberOfTriggers(int64_t value) {
|
||||||
pimpl->Parallel(&Module::setNumberOfTriggers, {}, value);
|
pimpl->Parallel(&Module::setNumberOfTriggers, {}, value);
|
||||||
|
pimpl->Parallel3(&Receiver::setNumberOfTriggers, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<ns> Detector::getExptime(Positions pos) const {
|
Result<ns> Detector::getExptime(Positions pos) const {
|
||||||
@ -231,7 +232,17 @@ Result<ns> Detector::getExptime(Positions pos) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setExptime(ns t, Positions pos) {
|
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());
|
pimpl->Parallel(&Module::setExptime, pos, t.count());
|
||||||
|
if (change) {
|
||||||
|
pimpl->Parallel(&Module::updateRateCorrection, pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<ns> Detector::getPeriod(Positions pos) const {
|
Result<ns> Detector::getPeriod(Positions pos) const {
|
||||||
@ -1303,6 +1314,7 @@ Result<int64_t> Detector::getNumberOfBursts(Positions pos) const {
|
|||||||
|
|
||||||
void Detector::setNumberOfBursts(int64_t value) {
|
void Detector::setNumberOfBursts(int64_t value) {
|
||||||
pimpl->Parallel(&Module::setNumberOfBursts, {}, value);
|
pimpl->Parallel(&Module::setNumberOfBursts, {}, value);
|
||||||
|
pimpl->Parallel3(&Receiver::setNumberOfBursts, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<ns> Detector::getBurstPeriod(Positions pos) const {
|
Result<ns> Detector::getBurstPeriod(Positions pos) const {
|
||||||
@ -1375,6 +1387,7 @@ Result<int> Detector::getNumberOfAnalogSamples(Positions pos) const {
|
|||||||
|
|
||||||
void Detector::setNumberOfAnalogSamples(int value, Positions pos) {
|
void Detector::setNumberOfAnalogSamples(int value, Positions pos) {
|
||||||
pimpl->Parallel(&Module::setNumberOfAnalogSamples, pos, value);
|
pimpl->Parallel(&Module::setNumberOfAnalogSamples, pos, value);
|
||||||
|
pimpl->Parallel3(&Receiver::setNumberOfAnalogSamples, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1472,6 +1485,7 @@ Result<int> Detector::getNumberOfDigitalSamples(Positions pos) const {
|
|||||||
|
|
||||||
void Detector::setNumberOfDigitalSamples(int value, Positions pos) {
|
void Detector::setNumberOfDigitalSamples(int value, Positions pos) {
|
||||||
pimpl->Parallel(&Module::setNumberOfDigitalSamples, pos, value);
|
pimpl->Parallel(&Module::setNumberOfDigitalSamples, pos, value);
|
||||||
|
pimpl->Parallel3(&Receiver::setNumberOfDigitalSamples, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<defs::readoutMode> Detector::getReadoutMode(Positions pos) const {
|
Result<defs::readoutMode> Detector::getReadoutMode(Positions pos) const {
|
||||||
|
@ -1007,10 +1007,6 @@ int64_t Module::getNumberOfTriggers() {
|
|||||||
void Module::setNumberOfTriggers(int64_t value) {
|
void Module::setNumberOfTriggers(int64_t value) {
|
||||||
LOG(logDEBUG1) << "Setting number of triggers to " << value;
|
LOG(logDEBUG1) << "Setting number of triggers to " << value;
|
||||||
sendToDetector(F_SET_NUM_TRIGGERS, value, nullptr);
|
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() {
|
int64_t Module::getNumberOfBursts() {
|
||||||
@ -1023,10 +1019,6 @@ int64_t Module::getNumberOfBursts() {
|
|||||||
void Module::setNumberOfBursts(int64_t value) {
|
void Module::setNumberOfBursts(int64_t value) {
|
||||||
LOG(logDEBUG1) << "Setting number of bursts to " << value;
|
LOG(logDEBUG1) << "Setting number of bursts to " << value;
|
||||||
sendToDetector(F_SET_NUM_BURSTS, value, nullptr);
|
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() {
|
int Module::getNumberOfAdditionalStorageCells() {
|
||||||
@ -1053,10 +1045,6 @@ void Module::setNumberOfAnalogSamples(int value) {
|
|||||||
sendToDetector(F_SET_NUM_ANALOG_SAMPLES, value, nullptr);
|
sendToDetector(F_SET_NUM_ANALOG_SAMPLES, value, nullptr);
|
||||||
// update #nchan, as it depends on #samples, adcmask
|
// update #nchan, as it depends on #samples, adcmask
|
||||||
updateNumberOfChannels();
|
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() {
|
int Module::getNumberOfDigitalSamples() {
|
||||||
@ -1071,10 +1059,6 @@ void Module::setNumberOfDigitalSamples(int value) {
|
|||||||
sendToDetector(F_SET_NUM_DIGITAL_SAMPLES, value, nullptr);
|
sendToDetector(F_SET_NUM_DIGITAL_SAMPLES, value, nullptr);
|
||||||
// update #nchan, as it depends on #samples, adcmask
|
// update #nchan, as it depends on #samples, adcmask
|
||||||
updateNumberOfChannels();
|
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() {
|
int64_t Module::getExptime() {
|
||||||
@ -1082,19 +1066,8 @@ int64_t Module::getExptime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Module::setExptime(int64_t value) {
|
void Module::setExptime(int64_t value) {
|
||||||
int64_t prevVal = value;
|
|
||||||
if (shm()->myDetectorType == EIGER) {
|
|
||||||
prevVal = getExptime();
|
|
||||||
}
|
|
||||||
LOG(logDEBUG1) << "Setting exptime to " << value << "ns";
|
LOG(logDEBUG1) << "Setting exptime to " << value << "ns";
|
||||||
sendToDetector(F_SET_EXPTIME, value, nullptr);
|
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() {
|
int64_t Module::getPeriod() {
|
||||||
|
@ -328,6 +328,31 @@ void Receiver::setNumberOfFrames(int64_t value) {
|
|||||||
sendToReceiver(F_RECEIVER_SET_NUM_FRAMES, value, nullptr);
|
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 */
|
/** Acquisition */
|
||||||
|
|
||||||
void Receiver::start() {
|
void Receiver::start() {
|
||||||
|
@ -66,6 +66,11 @@ namespace sls {
|
|||||||
* *
|
* *
|
||||||
* ************************************************/
|
* ************************************************/
|
||||||
void setNumberOfFrames(int64_t value);
|
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);
|
||||||
|
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user