This commit is contained in:
2021-06-22 20:50:50 +02:00
parent 1a88cbd266
commit 755738a42e
15 changed files with 378 additions and 49 deletions

View File

@ -675,11 +675,11 @@ void Detector::stopReceiver() { pimpl->Parallel(&Module::stopReceiver, {}); }
void Detector::startDetector() {
auto detector_type = getDetectorType().squash();
if (detector_type == defs::MYTHEN3 && size() > 1){
if (detector_type == defs::MYTHEN3 && size() > 1) {
auto is_master = getMaster();
std::vector<int> master;
std::vector<int> slaves;
for(int i=0; i<size(); ++i){
for (int i = 0; i < size(); ++i) {
if (is_master[i])
master.push_back(i);
else
@ -687,17 +687,18 @@ void Detector::startDetector() {
}
pimpl->Parallel(&Module::startAcquisition, slaves);
pimpl->Parallel(&Module::startAcquisition, master);
}else{
} else {
pimpl->Parallel(&Module::startAcquisition, {});
}
}
void Detector::startDetectorReadout() {
pimpl->Parallel(&Module::startReadout, {});
}
void Detector::stopDetector(Positions pos) { pimpl->Parallel(&Module::stopAcquisition, pos); }
void Detector::stopDetector(Positions pos) {
pimpl->Parallel(&Module::stopAcquisition, pos);
}
Result<defs::runStatus> Detector::getDetectorStatus(Positions pos) const {
return pimpl->Parallel(&Module::getRunStatus, pos);
@ -733,8 +734,10 @@ Result<defs::scanParameters> Detector::getScan(Positions pos) const {
}
void Detector::setScan(const defs::scanParameters t) {
if(getDetectorType().squash() == defs::MYTHEN3 && size()>1 && t.enable != 0){
throw DetectorError("Scan is only allowed for single module Mythen 3 because of synchronization");
if (getDetectorType().squash() == defs::MYTHEN3 && size() > 1 &&
t.enable != 0) {
throw DetectorError("Scan is only allowed for single module Mythen 3 "
"because of synchronization");
}
pimpl->Parallel(&Module::setScan, {}, t);
}
@ -1366,6 +1369,15 @@ void Detector::setQuad(const bool enable) {
pimpl->Parallel(&Module::setQuad, {}, enable);
}
Result<bool> Detector::getDataStream(const bool left, Positions pos) const {
return pimpl->Parallel(&Module::getDataStream, pos, left);
}
void Detector::setDataStream(const bool enable, const bool left,
Positions pos) {
pimpl->Parallel(&Module::setDataStream, pos, enable, left);
}
// Jungfrau Specific
Result<int> Detector::getThresholdTemperature(Positions pos) const {
@ -1611,23 +1623,22 @@ Detector::getGateDelayForAllGates(Positions pos) const {
return pimpl->Parallel(&Module::getGateDelayForAllGates, pos);
}
Result<bool> Detector::getMaster(Positions pos) const{
Result<bool> Detector::getMaster(Positions pos) const {
return pimpl->Parallel(&Module::isMaster, pos);
}
Result<int> Detector::getChipStatusRegister(Positions pos) const{
Result<int> Detector::getChipStatusRegister(Positions pos) const {
return pimpl->Parallel(&Module::getChipStatusRegister, pos);
}
void Detector::setGainCaps(int caps, Positions pos){
void Detector::setGainCaps(int caps, Positions pos) {
return pimpl->Parallel(&Module::setGainCaps, pos, caps);
}
Result<int> Detector::getGainCaps(Positions pos){
Result<int> Detector::getGainCaps(Positions pos) {
return pimpl->Parallel(&Module::getGainCaps, pos);
}
// CTB/ Moench Specific
Result<int> Detector::getNumberOfAnalogSamples(Positions pos) const {