mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 15:57:13 +02:00
gotthard2: vetoref, burstmode
This commit is contained in:
@ -1066,6 +1066,25 @@ std::string CmdProxy::VetoPhoton(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::VetoReference(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[gain index] [12 bit value in hex] \n\t[Gotthard2] Set veto reference for all 128 channels for all chips." << '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
throw sls::RuntimeError("cannot get vetoref. Did you mean vetophoton?");
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
if (args.size() != 2) {
|
||||
WrongNumberOfParameters(2);
|
||||
}
|
||||
det->setVetoReference(std::stoi(args[0]), stoiHex(args[1]), {det_id});
|
||||
os << sls::ToString(args) << '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
/* CTB Specific */
|
||||
|
||||
std::string CmdProxy::Samples(int action) {
|
||||
|
@ -1104,6 +1104,18 @@ void Detector::setVetoPhoton(const int chipIndex, const int numPhotons, const in
|
||||
pimpl->Parallel(&slsDetector::setVetoPhoton, pos, chipIndex, numPhotons, energy, fname);
|
||||
}
|
||||
|
||||
void Detector::setVetoReference(const int gainIndex, const int value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setVetoReference, pos, gainIndex, value);
|
||||
}
|
||||
|
||||
void Detector::setBurstMode(bool enable, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setBurstMode, pos, enable);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getBurstMode(Positions pos) {
|
||||
return pimpl->Parallel(&slsDetector::getBurstMode, pos);
|
||||
}
|
||||
|
||||
// CTB Specific
|
||||
|
||||
Result<int> Detector::getNumberOfAnalogSamples(Positions pos) const {
|
||||
|
@ -2475,6 +2475,25 @@ void slsDetector::setVetoPhoton(const int chipIndex, const int numPhotons, const
|
||||
}
|
||||
}
|
||||
|
||||
void slsDetector::setVetoReference(const int gainIndex, const int value) {
|
||||
int args[]{gainIndex, value};
|
||||
FILE_LOG(logDEBUG1) << "Setting veto reference [gainIndex: " << gainIndex << ", value: 0x" << std::hex << value << std::dec << ']';
|
||||
sendToDetector(F_SET_VETO_REFERENCE, args, nullptr);
|
||||
}
|
||||
|
||||
bool slsDetector::getBurstMode() {
|
||||
int retval = -1;
|
||||
sendToDetector(F_GET_BURST_MODE, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "Burst mode:" << retval;
|
||||
return static_cast<bool>(retval);
|
||||
}
|
||||
|
||||
void slsDetector::setBurstMode(bool enable) {
|
||||
int arg = static_cast<int>(enable);
|
||||
FILE_LOG(logDEBUG1) << "Setting burst mode to " << arg;
|
||||
sendToDetector(F_SET_BURST_MODE, arg, nullptr);
|
||||
}
|
||||
|
||||
int slsDetector::setCounterBit(int cb) {
|
||||
int retval = -1;
|
||||
FILE_LOG(logDEBUG1) << "Sending counter bit " << cb;
|
||||
|
Reference in New Issue
Block a user