mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-07 21:30:05 +02:00
added setdaclist in cmd line
This commit is contained in:
parent
2823451c9d
commit
9995b74217
@ -1059,8 +1059,7 @@ std::string CmdProxy::Dac(int action) {
|
|||||||
auto type = det->getDetectorType().squash();
|
auto type = det->getDetectorType().squash();
|
||||||
// dac indices only for ctb
|
// dac indices only for ctb
|
||||||
if (args.size() > 0 && action != defs::HELP_ACTION) {
|
if (args.size() > 0 && action != defs::HELP_ACTION) {
|
||||||
if (is_int(args[0]) &&
|
if (is_int(args[0]) && type != defs::CHIPTESTBOARD) {
|
||||||
type != defs::CHIPTESTBOARD) {
|
|
||||||
throw sls::RuntimeError(
|
throw sls::RuntimeError(
|
||||||
"Dac indices can only be used for chip test board. Use daclist "
|
"Dac indices can only be used for chip test board. Use daclist "
|
||||||
"to get list of dac names for current detector.");
|
"to get list of dac names for current detector.");
|
||||||
@ -1078,9 +1077,9 @@ std::string CmdProxy::Dac(int action) {
|
|||||||
WrongNumberOfParameters(1); // This prints slightly wrong
|
WrongNumberOfParameters(1); // This prints slightly wrong
|
||||||
|
|
||||||
defs::dacIndex dacIndex{};
|
defs::dacIndex dacIndex{};
|
||||||
if (type == defs::CHIPTESTBOARD && !is_int(args[0])){
|
if (type == defs::CHIPTESTBOARD && !is_int(args[0])) {
|
||||||
dacIndex = det->decodeNamedDac(args[0]);
|
dacIndex = det->decodeNamedDac(args[0]);
|
||||||
}else{
|
} else {
|
||||||
dacIndex = StringTo<defs::dacIndex>(args[0]);
|
dacIndex = StringTo<defs::dacIndex>(args[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1125,6 +1124,37 @@ std::string CmdProxy::Dac(int action) {
|
|||||||
return os.str();
|
return os.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CmdProxy::DacList(const int action) {
|
||||||
|
std::ostringstream os;
|
||||||
|
os << cmd << ' ';
|
||||||
|
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||||
|
os << "\n\t\tGets the list of dac names for every dac for this "
|
||||||
|
"detector.\n\t[dacname1 dacname2 .. dacname18] "
|
||||||
|
"\n\t\t[ChipTestBoard] Set the list of dac names for this "
|
||||||
|
"detector."
|
||||||
|
<< '\n';
|
||||||
|
} else if (action == slsDetectorDefs::GET_ACTION) {
|
||||||
|
if (!args.empty()) {
|
||||||
|
WrongNumberOfParameters(0);
|
||||||
|
}
|
||||||
|
auto t = det->getDacNames();
|
||||||
|
os << sls::ToString(t) << '\n';
|
||||||
|
} else if (action == slsDetectorDefs::PUT_ACTION) {
|
||||||
|
if (det->getDetectorType().squash() != defs::CHIPTESTBOARD) {
|
||||||
|
throw sls::RuntimeError("This detector already has fixed dac "
|
||||||
|
"names. Cannot change them.");
|
||||||
|
}
|
||||||
|
if (args.size() != 18) {
|
||||||
|
WrongNumberOfParameters(18);
|
||||||
|
}
|
||||||
|
det->setDacNames(args);
|
||||||
|
os << ToString(args) << '\n';
|
||||||
|
} else {
|
||||||
|
throw sls::RuntimeError("Unknown action");
|
||||||
|
}
|
||||||
|
return os.str();
|
||||||
|
}
|
||||||
|
|
||||||
std::string CmdProxy::DacValues(int action) {
|
std::string CmdProxy::DacValues(int action) {
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
|
@ -837,7 +837,7 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* dacs */
|
/* dacs */
|
||||||
{"dac", &CmdProxy::Dac},
|
{"dac", &CmdProxy::Dac},
|
||||||
{"daclist", &CmdProxy::daclist},
|
{"daclist", &CmdProxy::DacList},
|
||||||
{"dacvalues", &CmdProxy::DacValues},
|
{"dacvalues", &CmdProxy::DacValues},
|
||||||
{"resetdacs", &CmdProxy::ResetDacs},
|
{"resetdacs", &CmdProxy::ResetDacs},
|
||||||
{"defaultdac", &CmdProxy::DefaultDac},
|
{"defaultdac", &CmdProxy::DefaultDac},
|
||||||
@ -1124,6 +1124,7 @@ class CmdProxy {
|
|||||||
std::string TemperatureValues(int action);
|
std::string TemperatureValues(int action);
|
||||||
/* dacs */
|
/* dacs */
|
||||||
std::string Dac(int action);
|
std::string Dac(int action);
|
||||||
|
std::string DacList(int action);
|
||||||
std::string DacValues(int action);
|
std::string DacValues(int action);
|
||||||
std::string ResetDacs(int action);
|
std::string ResetDacs(int action);
|
||||||
std::string DefaultDac(int action);
|
std::string DefaultDac(int action);
|
||||||
@ -1465,10 +1466,6 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* dacs */
|
/* dacs */
|
||||||
|
|
||||||
GET_COMMAND_NOID(
|
|
||||||
daclist, getDacNames,
|
|
||||||
"\n\tGets the list of commands for every dac for this detector.");
|
|
||||||
|
|
||||||
/* on chip dacs */
|
/* on chip dacs */
|
||||||
INTEGER_USER_IND_COMMAND(
|
INTEGER_USER_IND_COMMAND(
|
||||||
vchip_comp_fe, getOnChipDAC, setOnChipDAC, StringTo<int>,
|
vchip_comp_fe, getOnChipDAC, setOnChipDAC, StringTo<int>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user