mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
rearranging
This commit is contained in:
parent
de53747ddd
commit
b6d9015ed0
@ -170,6 +170,14 @@ class Detector {
|
||||
/** [Gotthard][Jungfrau][CTB] */
|
||||
Result<ns> getPeriodLeft(Positions pos = {}) const;
|
||||
|
||||
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [Gotthard, Jungfrau, CTB Options: AUTO_TIMING, TRIGGER_EXPOSURE]
|
||||
* [Eiger Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER]
|
||||
*/
|
||||
void setTimingMode(defs::timingMode value, Positions pos = {});
|
||||
|
||||
/** [Eiger][Jungfrau] */
|
||||
Result<defs::speedLevel> getSpeed(Positions pos = {}) const;
|
||||
|
||||
@ -221,6 +229,12 @@ class Detector {
|
||||
|
||||
Result<int> getHighVoltage(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Mythen3] */
|
||||
Result<bool> getPowerChip(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Mythen3] */
|
||||
void setPowerChip(bool on, Positions pos = {});
|
||||
|
||||
/**
|
||||
* [Gotthard Options: 0, 90, 110, 120, 150, 180, 200]
|
||||
* [Jungfrau, CTB Options: 0, 60 - 200]
|
||||
@ -249,14 +263,6 @@ class Detector {
|
||||
/* [Gotthard2] */
|
||||
void setOnChipDAC(defs::dacIndex index, int chipIndex, int value, Positions pos = {});
|
||||
|
||||
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [Gotthard, Jungfrau, CTB Options: AUTO_TIMING, TRIGGER_EXPOSURE]
|
||||
* [Eiger Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER]
|
||||
*/
|
||||
void setTimingMode(defs::timingMode value, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* Acquisition *
|
||||
@ -807,12 +813,6 @@ class Detector {
|
||||
/** [Jungfrau] */
|
||||
void resetTemperatureEvent(Positions pos = {});
|
||||
|
||||
/** [Jungfrau] */
|
||||
Result<bool> getPowerChip(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau] */
|
||||
void setPowerChip(bool on, Positions pos = {});
|
||||
|
||||
/** [Jungfrau] */
|
||||
Result<bool> getAutoCompDisable(Positions pos = {}) const;
|
||||
|
||||
|
@ -581,6 +581,7 @@ std::string CmdProxy::ClockDivider(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
/** temperature */
|
||||
/* dacs */
|
||||
std::string CmdProxy::Dac(int action) {
|
||||
std::ostringstream os;
|
||||
|
@ -478,6 +478,7 @@ class CmdProxy {
|
||||
{"cyclesl", "triggersl"},
|
||||
{"clkdivider", "speed"},
|
||||
|
||||
/** temperature */
|
||||
/** dacs */
|
||||
{"vcall", "vcal"},
|
||||
|
||||
@ -578,6 +579,7 @@ class CmdProxy {
|
||||
{"triggersl", &CmdProxy::triggersl},
|
||||
{"delayl", &CmdProxy::delayl},
|
||||
{"periodl", &CmdProxy::periodl},
|
||||
{"timing", &CmdProxy::timing},
|
||||
{"speed", &CmdProxy::Speed},
|
||||
{"adcphase", &CmdProxy::Adcphase},
|
||||
{"maxadcphaseshift", &CmdProxy::maxadcphaseshift},
|
||||
@ -586,6 +588,9 @@ class CmdProxy {
|
||||
{"maxclkphaseshift", &CmdProxy::MaxClockPhaseShift},
|
||||
{"clkdiv", &CmdProxy::ClockDivider},
|
||||
{"vhighvoltage", &CmdProxy::vhighvoltage},
|
||||
{"powerchip", &CmdProxy::powerchip},
|
||||
|
||||
/** temperature */
|
||||
{"temp_adc", &CmdProxy::temp_adc},
|
||||
{"temp_fpga", &CmdProxy::temp_fpga},
|
||||
{"temp_fpgaext", &CmdProxy::temp_fpgaext},
|
||||
@ -595,7 +600,6 @@ class CmdProxy {
|
||||
{"temp_sodr", &CmdProxy::temp_sodr},
|
||||
{"temp_fpgafl", &CmdProxy::temp_fpgafl},
|
||||
{"temp_fpgafr", &CmdProxy::temp_fpgafr},
|
||||
{"timing", &CmdProxy::timing},
|
||||
|
||||
/* dacs */
|
||||
{"vthreshold", &CmdProxy::vthreshold},
|
||||
@ -767,7 +771,6 @@ class CmdProxy {
|
||||
{"temp_threshold", &CmdProxy::temp_threshold},
|
||||
{"temp_control", &CmdProxy::temp_control},
|
||||
{"temp_event", &CmdProxy::TemperatureEvent},
|
||||
{"powerchip", &CmdProxy::powerchip},
|
||||
{"auto_comp_disable", &CmdProxy::auto_comp_disable},
|
||||
{"storagecells", &CmdProxy::storagecells},
|
||||
{"storagecell_start", &CmdProxy::storagecell_start},
|
||||
@ -911,6 +914,7 @@ class CmdProxy {
|
||||
std::string ClockPhase(int action);
|
||||
std::string MaxClockPhaseShift(int action);
|
||||
std::string ClockDivider(int action);
|
||||
/** temperature */
|
||||
/* dacs */
|
||||
std::string Dac(int action);
|
||||
std::string DacList(int action);
|
||||
@ -1026,12 +1030,23 @@ class CmdProxy {
|
||||
TIME_GET_COMMAND(periodl, getPeriodLeft,
|
||||
"\n\t[Gotthard][Jungfrau][CTB] Period left for current frame.");
|
||||
|
||||
INTEGER_COMMAND(timing, getTimingMode, setTimingMode, sls::StringTo<slsDetectorDefs::timingMode>,
|
||||
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Gotthard][Ctb] [auto|trigger]\n\t[Eiger] [auto|trigger|gating|burst_trigger]");
|
||||
|
||||
GET_COMMAND(maxadcphaseshift, getMaxADCPhaseShift,
|
||||
"\n\t[Jungfrau][CTB] Absolute maximum Phase shift of ADC clock.");
|
||||
|
||||
INTEGER_COMMAND(vhighvoltage, getHighVoltage, setHighVoltage, std::stoi,
|
||||
"[n_value]\n\tHigh voltage to the sensor in Voltage.\n\t[Gotthard] [0|90|110|120|150|180|200]\n\t[Eiger] 0-200\n\t[Jungfrau][Ctb] [0|60-200]");
|
||||
|
||||
INTEGER_COMMAND(powerchip, getPowerChip, setPowerChip, std::stoi,
|
||||
"[0, 1]\n\t[Jungfrau][Mythen3] Power the chip. Default 0.
|
||||
\n\t[Jungfrau] Get will return power status.
|
||||
Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled.
|
||||
\n\t[Mythen3] If module not connected or wrong module, 1 will fail. By default, not powered on");
|
||||
|
||||
/** temperature */
|
||||
|
||||
GET_IND_COMMAND(temp_adc, getTemperature, slsDetectorDefs::TEMPERATURE_ADC, " °C",
|
||||
"[n_value]\n\t[Jungfrau][Gotthard] ADC Temperature");
|
||||
|
||||
@ -1059,9 +1074,6 @@ class CmdProxy {
|
||||
GET_IND_COMMAND(temp_fpgafr, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA3, " °C",
|
||||
"[n_value]\n\t[Eiger]Temperature of the left front end board fpga");
|
||||
|
||||
INTEGER_COMMAND(timing, getTimingMode, setTimingMode, sls::StringTo<slsDetectorDefs::timingMode>,
|
||||
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Gotthard][Ctb] [auto|trigger]\n\t[Eiger] [auto|trigger|gating|burst_trigger]");
|
||||
|
||||
/* dacs */
|
||||
|
||||
DAC_COMMAND(vthreshold, getDAC, setDAC, defs::THRESHOLD,
|
||||
@ -1502,9 +1514,6 @@ class CmdProxy {
|
||||
INTEGER_COMMAND(temp_control, getTemperatureControl, setTemperatureControl, std::stoi,
|
||||
"[0, 1]\n\t[Jungfrau] Temperature control enable. Default is 0 (disabled). If temperature crosses threshold temperature and temperature control is enabled, power to chip will be switched off and temperature event occurs. To power on chip again, temperature has to be less than threshold temperature and temperature event has to be cleared.");
|
||||
|
||||
INTEGER_COMMAND(powerchip, getPowerChip, setPowerChip, std::stoi,
|
||||
"[0, 1]\n\t[Jungfrau][Mythen3] Power the chip. Default 0. \n\t[Jungfrau] Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled.");
|
||||
|
||||
INTEGER_COMMAND(auto_comp_disable, getAutoCompDisable, setAutoCompDisable, std::stoi,
|
||||
"[0, 1]\n\t[Jungfrau] Auto comparator disable mode. Default 0 or this mode disabled(comparator enabled throughout). 1 enables mode. 0 disables mode. This mode disables the on-chip gain switching comparator automatically after 93.75% of exposure time (only for longer than 100us).");
|
||||
|
||||
|
@ -224,6 +224,15 @@ Result<ns> Detector::getPeriodLeft(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getPeriodLeft, pos);
|
||||
}
|
||||
|
||||
Result<defs::timingMode> Detector::getTimingMode(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setTimingMode, pos,
|
||||
defs::GET_TIMING_MODE);
|
||||
}
|
||||
|
||||
void Detector::setTimingMode(defs::timingMode value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setTimingMode, pos, value);
|
||||
}
|
||||
|
||||
Result<defs::speedLevel> Detector::getSpeed(Positions pos) const {
|
||||
auto res =
|
||||
pimpl->Parallel(&slsDetector::getClockDivider, pos, defs::RUN_CLOCK);
|
||||
@ -309,6 +318,21 @@ void Detector::setHighVoltage(int value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setDAC, pos, value, defs::HIGH_VOLTAGE, 0);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getPowerChip(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::powerChip, pos, -1);
|
||||
}
|
||||
|
||||
void Detector::setPowerChip(bool on, Positions pos) {
|
||||
if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) {
|
||||
for (int i = 0; i != pimpl->size(); ++i) {
|
||||
pimpl->Parallel(&slsDetector::powerChip, {i}, static_cast<int>(on));
|
||||
usleep(1000 * 1000);
|
||||
}
|
||||
} else {
|
||||
pimpl->Parallel(&slsDetector::powerChip, pos, static_cast<int>(on));
|
||||
}
|
||||
}
|
||||
|
||||
Result<int> Detector::getTemperature(defs::dacIndex index,
|
||||
Positions pos) const {
|
||||
switch (index) {
|
||||
@ -359,15 +383,6 @@ void Detector::setOnChipDAC(defs::dacIndex index, int chipIndex, int value,
|
||||
pimpl->Parallel(&slsDetector::setOnChipDAC, pos, index, chipIndex, value);
|
||||
}
|
||||
|
||||
Result<defs::timingMode> Detector::getTimingMode(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setTimingMode, pos,
|
||||
defs::GET_TIMING_MODE);
|
||||
}
|
||||
|
||||
void Detector::setTimingMode(defs::timingMode value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setTimingMode, pos, value);
|
||||
}
|
||||
|
||||
// Acquisition
|
||||
|
||||
void Detector::acquire() { pimpl->acquire(); }
|
||||
@ -1069,21 +1084,6 @@ void Detector::resetTemperatureEvent(Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setTemperatureEvent, pos, 0);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getPowerChip(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::powerChip, pos, -1);
|
||||
}
|
||||
|
||||
void Detector::setPowerChip(bool on, Positions pos) {
|
||||
if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) {
|
||||
for (int i = 0; i != pimpl->size(); ++i) {
|
||||
pimpl->Parallel(&slsDetector::powerChip, {i}, static_cast<int>(on));
|
||||
usleep(1000 * 1000);
|
||||
}
|
||||
} else {
|
||||
pimpl->Parallel(&slsDetector::powerChip, pos, static_cast<int>(on));
|
||||
}
|
||||
}
|
||||
|
||||
Result<bool> Detector::getAutoCompDisable(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setAutoComparatorDisableMode, pos, -1);
|
||||
}
|
||||
|
@ -1483,6 +1483,16 @@ int64_t slsDetector::getMeasurementTime() const {
|
||||
return retval;
|
||||
}
|
||||
|
||||
slsDetectorDefs::timingMode slsDetector::setTimingMode(timingMode pol) {
|
||||
int fnum = F_SET_TIMING_MODE;
|
||||
auto arg = static_cast<int>(pol);
|
||||
timingMode retval = GET_TIMING_MODE;
|
||||
FILE_LOG(logDEBUG1) << "Setting communication to mode " << pol;
|
||||
sendToDetector(fnum, arg, retval);
|
||||
FILE_LOG(logDEBUG1) << "Timing Mode: " << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
int slsDetector::setDynamicRange(int n) {
|
||||
// TODO! Properly handle fail
|
||||
int prevDr = shm()->dynamicRange;
|
||||
@ -1549,16 +1559,6 @@ int slsDetector::getADC(dacIndex index) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
slsDetectorDefs::timingMode slsDetector::setTimingMode(timingMode pol) {
|
||||
int fnum = F_SET_TIMING_MODE;
|
||||
auto arg = static_cast<int>(pol);
|
||||
timingMode retval = GET_TIMING_MODE;
|
||||
FILE_LOG(logDEBUG1) << "Setting communication to mode " << pol;
|
||||
sendToDetector(fnum, arg, retval);
|
||||
FILE_LOG(logDEBUG1) << "Timing Mode: " << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
slsDetectorDefs::externalSignalFlag
|
||||
slsDetector::setExternalSignalFlags(externalSignalFlag pol) {
|
||||
int fnum = F_SET_EXTERNAL_SIGNAL_FLAG;
|
||||
|
@ -619,6 +619,13 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
/** [Jungfrau][CTB] Get timestamp at a frame start */
|
||||
int64_t getMeasurementTime() const;
|
||||
|
||||
/**
|
||||
* Set/get timing mode
|
||||
* @param pol timing mode (-1 gets)
|
||||
* @returns current timing mode
|
||||
*/
|
||||
timingMode setTimingMode(timingMode pol = GET_TIMING_MODE);
|
||||
|
||||
/**
|
||||
* Set/get dynamic range
|
||||
* (Eiger: If i is 32, also sets clkdivider to 2, if 16, sets clkdivider to
|
||||
@ -652,13 +659,6 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
*/
|
||||
int getADC(dacIndex index);
|
||||
|
||||
/**
|
||||
* Set/get timing mode
|
||||
* @param pol timing mode (-1 gets)
|
||||
* @returns current timing mode
|
||||
*/
|
||||
timingMode setTimingMode(timingMode pol = GET_TIMING_MODE);
|
||||
|
||||
/**
|
||||
* Set/get external signal flags (to specify triggerinrising edge etc)
|
||||
* (Gotthard, Mythen)
|
||||
|
Loading…
x
Reference in New Issue
Block a user