mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-22 09:37:59 +02:00
WIP done
This commit is contained in:
@ -908,6 +908,54 @@ class Detector {
|
||||
|
||||
void setDAC(int value, defs::dacIndex index, bool mV, Positions pos = {});
|
||||
|
||||
Result<defs::externalCommunicationMode> getTimingMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* (Gotthard, Jungfrau, CTB Options: AUTO_TIMING, TRIGGER_EXPOSURE)
|
||||
* (Eiger Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER)
|
||||
*/
|
||||
void setTimingMode(defs::externalCommunicationMode value, Positions pos = {});
|
||||
|
||||
/**
|
||||
* (Gotthard)
|
||||
*/
|
||||
Result<defs::externalSignalFlag> getExternalSignalFlags(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* (Gotthard Options: TRIGGER_IN_RISING_EDGE, TRIGGER_IN_FALLING_EDGE)
|
||||
*/
|
||||
void setExternalSignalFlags(defs::externalSignalFlag value, Positions pos = {});
|
||||
|
||||
/**
|
||||
* (Eiger)
|
||||
*/
|
||||
Result<bool> getParallelMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* (Eiger)
|
||||
*/
|
||||
void setParallelMode(bool value, Positions pos = {});
|
||||
|
||||
/**
|
||||
* (Eiger)
|
||||
*/
|
||||
Result<bool> getOverFlowMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* (Eiger)
|
||||
*/
|
||||
void setOverFlowMode(bool value, Positions pos = {});
|
||||
|
||||
/**
|
||||
* (CTB Options: NORMAL_READOUT = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL = 2)
|
||||
*/
|
||||
Result<int> getSignalType(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* (CTB Options: NORMAL_READOUT = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL = 2)
|
||||
*/
|
||||
void setSignalType(int value, Positions pos = {});
|
||||
|
||||
// Erik
|
||||
|
||||
Result<int> getFramesCaughtByReceiver(Positions pos = {}) const;
|
||||
|
@ -886,7 +886,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
externalCommunicationMode setExternalCommunicationMode(
|
||||
externalCommunicationMode pol = GET_EXTERNAL_COMMUNICATION_MODE,
|
||||
int detPos = -1);
|
||||
int detPos = -1);//
|
||||
|
||||
/**
|
||||
* Set/get external signal flags (to specify triggerinrising edge etc)
|
||||
@ -897,7 +897,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
externalSignalFlag
|
||||
setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG,
|
||||
int detPos = -1);
|
||||
int detPos = -1);//
|
||||
|
||||
/**
|
||||
* Set/get readout flags (Eiger, Mythen)
|
||||
@ -906,7 +906,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns readout flag
|
||||
*/
|
||||
int setReadOutFlags(readOutFlags flag = GET_READOUT_FLAGS, int detPos = -1);
|
||||
int setReadOutFlags(readOutFlags flag = GET_READOUT_FLAGS, int detPos = -1);//
|
||||
|
||||
/**
|
||||
* Set Interrupt last sub frame (Only for Eiger)
|
||||
|
@ -101,7 +101,7 @@ class multiSlsDetectorClient {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (parser.detector_id() >= detPtr->size()) {
|
||||
if (parser.detector_id() >= static_cast<int>(detPtr->size())) {
|
||||
os << "position is out of bounds.\n";
|
||||
return;
|
||||
}
|
||||
|
@ -597,7 +597,7 @@ Result<int> Detector::getTemp(defs::dacIndex index, Positions pos) const {
|
||||
switch (getDetectorType()) {
|
||||
case defs::EIGER:
|
||||
case defs::JUNGFRAU:
|
||||
for (auto it : pos) {
|
||||
for (auto &it : res) {
|
||||
it /= 1000;
|
||||
}
|
||||
break;
|
||||
@ -694,6 +694,82 @@ void Detector::setDAC(int value, defs::dacIndex index, bool mV, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setDAC, pos, value, index, mV);
|
||||
}
|
||||
|
||||
Result<defs::externalCommunicationMode> Detector::getTimingMode(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setExternalCommunicationMode, pos, defs::GET_EXTERNAL_COMMUNICATION_MODE);
|
||||
}
|
||||
|
||||
void Detector::setTimingMode(defs::externalCommunicationMode value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setExternalCommunicationMode, pos, value);
|
||||
}
|
||||
|
||||
Result<defs::externalSignalFlag> Detector::getExternalSignalFlags(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setExternalSignalFlags, pos, defs::GET_EXTERNAL_SIGNAL_FLAG);
|
||||
}
|
||||
|
||||
void Detector::setExternalSignalFlags(defs::externalSignalFlag value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setExternalSignalFlags, pos, value);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getParallelMode(Positions pos) const {
|
||||
auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos, defs::GET_READOUT_FLAGS);
|
||||
Result <bool> booleanRes;
|
||||
for (unsigned int i = 0; i < res.size(); ++i) {
|
||||
booleanRes[i] = (res[i] & defs::PARALLEL) ? true : false;
|
||||
}
|
||||
return booleanRes;
|
||||
}
|
||||
|
||||
void Detector::setParallelMode(bool value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setReadOutFlags, pos, value ? defs::PARALLEL : defs::NONPARALLEL);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getOverFlowMode(Positions pos) const {
|
||||
auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos, defs::GET_READOUT_FLAGS);
|
||||
Result <bool> booleanRes;
|
||||
for (unsigned int i = 0; i < res.size(); ++i) {
|
||||
booleanRes[i] = (res[i] & defs::SHOW_OVERFLOW) ? true : false;
|
||||
}
|
||||
return booleanRes;
|
||||
}
|
||||
|
||||
void Detector::setOverFlowMode(bool value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setReadOutFlags, pos, value ? defs::SHOW_OVERFLOW : defs::NOOVERFLOW);
|
||||
}
|
||||
|
||||
Result<int> Detector::getSignalType(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;
|
||||
}
|
||||
|
||||
void Detector::setSignalType(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);
|
||||
}
|
||||
|
||||
// Erik
|
||||
Result<int> Detector::getFramesCaughtByReceiver(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos);
|
||||
@ -912,7 +988,7 @@ Result<bool> Detector::getAutoCompDisable(Positions pos) const {
|
||||
|
||||
void Detector::setPowerChip(bool on, Positions pos) {
|
||||
if (on && pimpl->size() > 3) {
|
||||
for (int i = 0; i != pimpl->size(); ++i) {
|
||||
for (unsigned int i = 0; i != pimpl->size(); ++i) {
|
||||
pimpl->powerChip(static_cast<int>(on), i);
|
||||
usleep(1000 * 1000);
|
||||
}
|
||||
|
@ -378,8 +378,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
||||
++i;
|
||||
|
||||
/*! \page config
|
||||
- <b>extsig [flag]</b> sets/gets the mode of the external signal. Options: \c off, \c trigger_in_rising_edge, \c trigger_in_falling_edge,
|
||||
\c trigger_out_rising_edge, \c trigger_out_falling_edge\n Used in GOTTHARDonly. \c Returns \c (string)
|
||||
- <b>extsig [flag]</b> sets/gets the mode of the external signal. Options: \c trigger_in_rising_edge, \c trigger_in_falling_edge. Used in GOTTHARDonly. \c Returns \c (string)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName = "extsig"; /* find command! */
|
||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdAdvanced;
|
||||
@ -4815,7 +4814,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
|
||||
std::ostringstream os;
|
||||
if (action == PUT_ACTION || action == HELP_ACTION) {
|
||||
|
||||
os << "extsig mode \t sets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge" << std::endl;
|
||||
os << "extsig mode \t sets the mode of the external signal. can be trigger_out_rising_edge, trigger_out_falling_edge. Gotthard only" << std::endl;
|
||||
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overlow, nooverflow, unknown." << std::endl;
|
||||
os << "interruptsubframe flag \t sets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
|
||||
os << "readnlines f \t sets the number of rows to read out per half module. Options: 1 - 256 (Not all values as it depends on dynamic range and 10GbE enabled). Used for EIGER only. " << std::endl;
|
||||
@ -4831,7 +4830,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
|
||||
}
|
||||
if (action == GET_ACTION || action == HELP_ACTION) {
|
||||
|
||||
os << "extsig \t gets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge" << std::endl;
|
||||
os << "extsig \t gets the mode of the external signal. can be trigger_in_rising_edge, trigger_in_falling_edge. Gotthard only" << std::endl;
|
||||
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overflow, nooverflow, unknown" << std::endl;
|
||||
os << "interruptsubframe \t gets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
|
||||
os << "readnlines \t gets the number of rows to read out per half module. Used for EIGER only. " << std::endl;
|
||||
|
Reference in New Issue
Block a user