moduleid for eiger m3 and g2, but set only for g2

This commit is contained in:
2021-09-01 17:06:34 +02:00
parent 25d03f949e
commit a51deda2a4
22 changed files with 180 additions and 95 deletions

View File

@@ -416,14 +416,14 @@ void Module::loadSettingsFile(const std::string &fname) {
if (shm()->myDetectorType == EIGER || shm()->myDetectorType == MYTHEN3) {
std::ostringstream ostfn;
ostfn << fname;
int serialNumberWidth = 3;
int moduleIdWidth = 3;
if (shm()->myDetectorType == MYTHEN3) {
serialNumberWidth = 4;
moduleIdWidth = 4;
}
if ((fname.find(".sn") == std::string::npos) &&
(fname.find(".trim") == std::string::npos)) {
ostfn << ".sn" << std::setfill('0') << std::setw(serialNumberWidth)
<< std::dec << getSerialNumber();
ostfn << ".sn" << std::setfill('0') << std::setw(moduleIdWidth)
<< std::dec << getModuleId();
}
auto myMod = readSettingsFile(ostfn.str());
setModule(myMod);
@@ -3326,12 +3326,12 @@ std::string Module::getTrimbitFilename(detectorSettings s, int e_eV) {
throw RuntimeError(
"Settings or trimbit files not defined for this detector.");
}
int serialNumberWidth = 3;
int moduleIdWidth = 3;
if (shm()->myDetectorType == MYTHEN3) {
serialNumberWidth = 4;
moduleIdWidth = 4;
}
ostfn << std::setfill('0') << std::setw(serialNumberWidth) << std::dec
<< getSerialNumber() << std::setbase(10);
ostfn << std::setfill('0') << std::setw(moduleIdWidth) << std::dec
<< getModuleId() << std::setbase(10);
return ostfn.str();
}