added patfname command to save the file the last pttern was loaded from (#770)

* added patfname command to save the file the last pttern was loaded from
This commit is contained in:
2023-06-22 09:08:48 +02:00
committed by GitHub
parent e18c191247
commit 58cdb5bd20
19 changed files with 120 additions and 28 deletions

View File

@ -2335,7 +2335,7 @@ defs::dacIndex Detector::getVoltageIndex(const std::string &name) const {
}
void Detector::setVoltageName(const defs::dacIndex index,
const std::string &name) {
const std::string &name) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
throw RuntimeError("Named powers only for CTB");
pimpl->setCtbVoltageName(index, name);
@ -2370,7 +2370,7 @@ defs::dacIndex Detector::getSlowAdcIndex(const std::string &name) const {
}
void Detector::setSlowAdcName(const defs::dacIndex index,
const std::string &name) {
const std::string &name) {
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
throw RuntimeError("Named SlowAdcs only for CTB");
pimpl->setCtbSlowAdcName(index, name);
@ -2384,16 +2384,20 @@ std::string Detector::getSlowAdcName(const defs::dacIndex i) const {
// Pattern
Result<std::string> Detector::getPatterFileName(Positions pos) const {
return pimpl->Parallel(&Module::getPatterFileName, pos);
}
void Detector::setPattern(const std::string &fname, Positions pos) {
Pattern pat;
pat.load(fname);
pat.validate();
setPattern(pat, pos);
pimpl->Parallel(&Module::setPattern, pos, pat, fname);
}
void Detector::setPattern(const Pattern &pat, Positions pos) {
pat.validate();
pimpl->Parallel(&Module::setPattern, pos, pat);
pimpl->Parallel(&Module::setPattern, pos, pat, "");
}
void Detector::savePattern(const std::string &fname) {