mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-19 16:27:13 +02:00
external signals
This commit is contained in:
@ -756,6 +756,39 @@ std::string CmdProxy::ClockDivider(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::ExternalSignal(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[n_signal] [signal_type] External signal mode for trigger "
|
||||
"timing mode."
|
||||
"\n\t[Gotthard] [0] "
|
||||
"[trigger_in_rising_edge|trigger_in_falling_edge]"
|
||||
"\n\t[Mythen3] [0-7] "
|
||||
"[trigger_in_rising_edge|trigger_in_falling_edge|inversion_on|"
|
||||
"inversion_off]\n\t where 0-3 is master input signals and 4-7 is "
|
||||
"master output signals"
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (args.size() != 1) {
|
||||
WrongNumberOfParameters(1);
|
||||
}
|
||||
auto t = det->getExternalSignalFlags(StringTo<int>(args[0]), {det_id});
|
||||
os << OutString(t) << '\n';
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
if (args.size() != 2) {
|
||||
WrongNumberOfParameters(2);
|
||||
}
|
||||
det->setExternalSignalFlags(
|
||||
StringTo<int>(args[0]),
|
||||
StringTo<slsDetectorDefs::externalSignalFlag>(args[1]), {det_id});
|
||||
os << args[1] << '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
/** temperature */
|
||||
/* dacs */
|
||||
std::string CmdProxy::Dac(int action) {
|
||||
|
@ -590,6 +590,7 @@ class CmdProxy {
|
||||
{"vhighvoltage", &CmdProxy::vhighvoltage},
|
||||
{"powerchip", &CmdProxy::powerchip},
|
||||
{"imagetest", &CmdProxy::imagetest},
|
||||
{"extsig", &CmdProxy::ExternalSignal},
|
||||
|
||||
/** temperature */
|
||||
{"temp_adc", &CmdProxy::temp_adc},
|
||||
@ -784,7 +785,6 @@ class CmdProxy {
|
||||
{"roi", &CmdProxy::ROI},
|
||||
{"clearroi", &CmdProxy::ClearROI},
|
||||
{"exptimel", &CmdProxy::exptimel},
|
||||
{"extsig", &CmdProxy::extsig},
|
||||
|
||||
/* Gotthard2 Specific */
|
||||
{"bursts", &CmdProxy::bursts},
|
||||
@ -932,6 +932,7 @@ class CmdProxy {
|
||||
std::string ClockPhase(int action);
|
||||
std::string MaxClockPhaseShift(int action);
|
||||
std::string ClockDivider(int action);
|
||||
std::string ExternalSignal(int action);
|
||||
/** temperature */
|
||||
/* dacs */
|
||||
std::string Dac(int action);
|
||||
@ -1856,11 +1857,6 @@ class CmdProxy {
|
||||
"[(optional unit) ns|us|ms|s]\n\t[Gotthard] Exposure time "
|
||||
"left for current frame. ");
|
||||
|
||||
INTEGER_COMMAND(extsig, getExternalSignalFlags, setExternalSignalFlags,
|
||||
sls::StringTo<slsDetectorDefs::externalSignalFlag>,
|
||||
"[trigger_in_rising_edge|trigger_in_falling_edge]\n\t["
|
||||
"Gotthard] External signal mode for trigger timing mode.");
|
||||
|
||||
/* Gotthard2 Specific */
|
||||
INTEGER_COMMAND_NOID(
|
||||
bursts, getNumberOfBursts, setNumberOfBursts, StringTo<int64_t>,
|
||||
|
@ -1169,14 +1169,14 @@ Result<ns> Detector::getExptimeLeft(Positions pos) const {
|
||||
}
|
||||
|
||||
Result<defs::externalSignalFlag>
|
||||
Detector::getExternalSignalFlags(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::setExternalSignalFlags, pos,
|
||||
defs::GET_EXTERNAL_SIGNAL_FLAG);
|
||||
Detector::getExternalSignalFlags(int signalIndex, Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getExternalSignalFlags, pos, signalIndex);
|
||||
}
|
||||
|
||||
void Detector::setExternalSignalFlags(defs::externalSignalFlag value,
|
||||
void Detector::setExternalSignalFlags(int signalIndex,
|
||||
defs::externalSignalFlag value,
|
||||
Positions pos) {
|
||||
pimpl->Parallel(&Module::setExternalSignalFlags, pos, value);
|
||||
pimpl->Parallel(&Module::setExternalSignalFlags, pos, signalIndex, value);
|
||||
}
|
||||
|
||||
// Gotthard2 Specific
|
||||
|
@ -1312,10 +1312,15 @@ int Module::getADC(dacIndex index) {
|
||||
}
|
||||
|
||||
slsDetectorDefs::externalSignalFlag
|
||||
Module::setExternalSignalFlags(externalSignalFlag pol) {
|
||||
LOG(logDEBUG1) << "Setting signal flag to " << pol;
|
||||
Module::getExternalSignalFlags(int signalIndex) {
|
||||
return sendToDetector<slsDetectorDefs::externalSignalFlag>(
|
||||
F_SET_EXTERNAL_SIGNAL_FLAG, pol);
|
||||
F_GET_EXTERNAL_SIGNAL_FLAG, signalIndex);
|
||||
}
|
||||
|
||||
void Module::setExternalSignalFlags(int signalIndex, externalSignalFlag type) {
|
||||
LOG(logDEBUG1) << "Setting signal flag (" << signalIndex << ") to " << type;
|
||||
int args[2] = {signalIndex, static_cast<int>(type)};
|
||||
sendToDetector(F_SET_EXTERNAL_SIGNAL_FLAG, args, nullptr);
|
||||
}
|
||||
|
||||
void Module::setParallelMode(const bool enable) {
|
||||
|
@ -549,14 +549,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
*/
|
||||
int getADC(dacIndex index);
|
||||
|
||||
/**
|
||||
* Set/get external signal flags (to specify triggerinrising edge etc)
|
||||
* (Gotthard, Mythen)
|
||||
* @param pol external signal flag (-1 gets)
|
||||
* @returns current timing mode
|
||||
*/
|
||||
externalSignalFlag
|
||||
setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG);
|
||||
externalSignalFlag getExternalSignalFlags(int signalIndex);
|
||||
void setExternalSignalFlags(int signalIndex, externalSignalFlag type);
|
||||
|
||||
/**
|
||||
* Set Parallel readout mode (Only for Eiger)
|
||||
|
Reference in New Issue
Block a user