mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-19 16:27:13 +02:00
confadc added to client, removed conf adc depending on burst mode
This commit is contained in:
@ -1738,6 +1738,37 @@ std::string CmdProxy::BurstMode(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::ConfigureADC(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[chip index 0-10, -1 for all] [adc index 0-31, -1 for all] [12 "
|
||||
"bit configuration value in hex]\n\t[Gotthard2] Sets "
|
||||
"configuration for specific chip and adc, but configures 1 chip "
|
||||
"(all adcs for that chip) at a time."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (args.size() != 2) {
|
||||
WrongNumberOfParameters(2);
|
||||
}
|
||||
auto t = det->getADCConfiguration(StringTo<int>(args[0]),
|
||||
StringTo<int>(args[1]));
|
||||
os << OutStringHex(t) << '\n';
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
if (args.size() != 3) {
|
||||
WrongNumberOfParameters(3);
|
||||
}
|
||||
int value = StringTo<int>(args[2]);
|
||||
det->setADCConfiguration(StringTo<int>(args[0]), StringTo<int>(args[1]),
|
||||
value, {det_id});
|
||||
os << '[' << args[0] << ", " << args[1] << ", " << ToStringHex(value)
|
||||
<< "]\n";
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
/* Mythen3 Specific */
|
||||
|
||||
std::string CmdProxy::Counters(int action) {
|
||||
|
@ -841,6 +841,7 @@ class CmdProxy {
|
||||
{"currentsource", &CmdProxy::currentsource},
|
||||
{"timingsource", &CmdProxy::timingsource},
|
||||
{"veto", &CmdProxy::veto},
|
||||
{"confadc", &CmdProxy::ConfigureADC},
|
||||
|
||||
/* Mythen3 Specific */
|
||||
{"counters", &CmdProxy::Counters},
|
||||
@ -1018,6 +1019,7 @@ class CmdProxy {
|
||||
std::string VetoReference(int action);
|
||||
std::string VetoFile(int action);
|
||||
std::string BurstMode(int action);
|
||||
std::string ConfigureADC(int action);
|
||||
/* Mythen3 Specific */
|
||||
std::string Counters(int action);
|
||||
std::string GateDelay(int action);
|
||||
|
@ -1350,6 +1350,19 @@ void Detector::setVeto(bool enable, Positions pos) {
|
||||
pimpl->Parallel(&Module::setVeto, pos, enable);
|
||||
}
|
||||
|
||||
Result<int> Detector::getADCConfiguration(const int chipIndex,
|
||||
const int adcIndex,
|
||||
Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getADCConfiguration, pos, chipIndex,
|
||||
adcIndex);
|
||||
}
|
||||
|
||||
void Detector::setADCConfiguration(const int chipIndex, const int adcIndex,
|
||||
const int value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setADCConfiguration, pos, chipIndex, adcIndex,
|
||||
value);
|
||||
}
|
||||
|
||||
// Mythen3 Specific
|
||||
|
||||
Result<uint32_t> Detector::getCounterMask(Positions pos) const {
|
||||
|
@ -1645,6 +1645,17 @@ void Module::setVeto(bool enable) {
|
||||
sendToDetector(F_SET_VETO, static_cast<int>(enable), nullptr);
|
||||
}
|
||||
|
||||
int Module::getADCConfiguration(const int chipIndex, const int adcIndex) {
|
||||
int args[]{chipIndex, adcIndex};
|
||||
return sendToDetector<int>(F_GET_ADC_CONFIGURATION, args);
|
||||
}
|
||||
|
||||
void Module::setADCConfiguration(const int chipIndex, const int adcIndex,
|
||||
int value) {
|
||||
int args[]{chipIndex, adcIndex, value};
|
||||
sendToDetector(F_SET_ADC_CONFIGURATION, args, nullptr);
|
||||
}
|
||||
|
||||
// Mythen3 Specific
|
||||
|
||||
uint32_t Module::getCounterMask() {
|
||||
|
@ -386,6 +386,9 @@ class Module : public virtual slsDetectorDefs {
|
||||
void setTimingSource(slsDetectorDefs::timingSourceType value);
|
||||
bool getVeto();
|
||||
void setVeto(bool enable);
|
||||
int getADCConfiguration(const int chipIndex, const int adcIndex);
|
||||
void setADCConfiguration(const int chipIndex, const int adcIndex,
|
||||
int value);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
|
Reference in New Issue
Block a user