Readoutflags (#61)

* WIP

* eiger binary back wih versioning

* fixed readout flag in ctbgui, added speedLevel enum

* ctbgui: fixed a print out error

* ctb readout bug fix

* WIP

* WIP

* WIP
This commit is contained in:
Dhanya Thattil
2019-09-02 19:27:27 +02:00
committed by GitHub
parent 221bb65c0e
commit 5bcde789ac
39 changed files with 819 additions and 684 deletions

View File

@ -1,10 +1,10 @@
#include "Detector.h"
#include "container_utils.h"
#include "detectorData.h"
#include "logger.h"
#include "multiSlsDetector.h"
#include "slsDetector.h"
#include "sls_detector_defs.h"
#include "detectorData.h"
namespace sls {
@ -165,13 +165,19 @@ Result<ns> Detector::getDelayAfterTriggerLeft(Positions pos) const {
defs::DELAY_AFTER_TRIGGER);
}
Result<int> Detector::getSpeed(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1,
Result<defs::speedLevel> Detector::getSpeed(Positions pos) const {
auto res = pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1,
0);
Result<defs::speedLevel> speedResult(res.size());
for (size_t i = 0; i < res.size(); ++i) {
speedResult[i] = static_cast<defs::speedLevel>(res[i]);
}
return speedResult;
}
void Detector::setSpeed(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, value, 0);
void Detector::setSpeed(defs::speedLevel value, Positions pos) {
pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER,
static_cast<int>(value), 0);
}
Result<int> Detector::getADCPhase(Positions pos) const {
@ -265,7 +271,7 @@ void Detector::startAcquisition() {
void Detector::stopAcquisition() {
pimpl->Parallel(&slsDetector::stopAcquisition, {});
if (getUseReceiverFlag().squash(true))
if (getUseReceiverFlag().squash(true))
pimpl->Parallel(&slsDetector::stopReceiver, {});
}
@ -640,7 +646,8 @@ void Detector::setRxZmqDataStream(bool enable, Positions pos) {
}
Result<int> Detector::getRxZmqFrequency(Positions pos) const {
return pimpl->Parallel(&slsDetector::setReceiverStreamingFrequency, pos, -1);
return pimpl->Parallel(&slsDetector::setReceiverStreamingFrequency, pos,
-1);
}
void Detector::setRxZmqFrequency(int freq, Positions pos) {
@ -775,33 +782,27 @@ void Detector::setRxAddGapPixels(bool enable) {
}
Result<bool> Detector::getParallelMode(Positions pos) const {
auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
defs::GET_READOUT_FLAGS);
Result<bool> booleanRes(res.size());
for (size_t i = 0; i < res.size(); ++i) {
booleanRes[i] = res[i] & defs::PARALLEL;
}
return booleanRes;
return pimpl->Parallel(&slsDetector::getParallelMode, pos);
}
void Detector::setParallelMode(bool value, Positions pos) {
pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
value ? defs::PARALLEL : defs::NONPARALLEL);
pimpl->Parallel(&slsDetector::setParallelMode, pos, value);
}
Result<bool> Detector::getOverFlowMode(Positions pos) const {
auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
defs::GET_READOUT_FLAGS);
Result<bool> booleanRes(res.size());
for (size_t i = 0; i < res.size(); ++i) {
booleanRes[i] = res[i] & defs::SHOW_OVERFLOW;
}
return booleanRes;
return pimpl->Parallel(&slsDetector::getOverFlowMode, pos);
}
void Detector::setOverFlowMode(bool value, Positions pos) {
pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
value ? defs::SHOW_OVERFLOW : defs::NOOVERFLOW);
pimpl->Parallel(&slsDetector::setOverFlowMode, pos, value);
}
Result<bool> Detector::getStoreInRamMode(Positions pos) const {
return pimpl->Parallel(&slsDetector::getStoreInRamMode, pos);
}
void Detector::setStoreInRamMode(bool value, Positions pos) {
pimpl->Parallel(&slsDetector::setStoreInRamMode, pos, value);
}
Result<bool> Detector::getBottom(Positions pos) const {
@ -1056,39 +1057,12 @@ void Detector::setNumberOfDigitalSamples(int64_t value, Positions pos) {
pimpl->Parallel(&slsDetector::setTimer, pos, defs::DIGITAL_SAMPLES, value);
}
Result<int> Detector::getReadoutMode(Positions pos) const {
auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
defs::GET_READOUT_FLAGS);
for (auto &it : res) {
if (it & defs::ANALOG_AND_DIGITAL) {
it = 2;
} else if (it & defs::DIGITAL_ONLY) {
it = 1;
} else if (it == defs::NORMAL_READOUT) {
it = 0;
} else {
throw RuntimeError("Unknown Signal Type");
}
}
return res;
Result<defs::readoutMode> Detector::getReadoutMode(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReadoutMode, pos);
}
void Detector::setReadoutMode(int value, Positions pos) {
defs::readOutFlags flag;
switch (value) {
case 0:
flag = defs::NORMAL_READOUT;
break;
case 1:
flag = defs::DIGITAL_ONLY;
break;
case 2:
flag = defs::ANALOG_AND_DIGITAL;
break;
default:
throw RuntimeError("Unknown Signal Type");
}
pimpl->Parallel(&slsDetector::setReadOutFlags, pos, flag);
void Detector::setReadoutMode(defs::readoutMode value, Positions pos) {
pimpl->Parallel(&slsDetector::setReadoutMode, pos, value);
}
Result<int> Detector::getDBITPhase(Positions pos) const {