mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
setSettingsDir works as the other functions
This commit is contained in:
@ -1111,28 +1111,12 @@ std::string multiSlsDetector::getSettingsDir(int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string multiSlsDetector::setSettingsDir(std::string s, int detPos) {
|
std::string multiSlsDetector::setSettingsDir(std::string directory, int detPos) {
|
||||||
// single
|
if (detPos >= 0)
|
||||||
if (detPos >= 0) {
|
return detectors[detPos]->setSettingsDir(directory);
|
||||||
return detectors[detPos]->setSettingsDir(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
// multi
|
auto r = parallelCall(&slsDetector::setSettingsDir, directory);
|
||||||
size_t p1 = 0;
|
return sls::concatenateIfDifferent(r);
|
||||||
size_t p2 = s.find('+', p1);
|
|
||||||
int id = 0;
|
|
||||||
while (p2 != std::string::npos) {
|
|
||||||
detectors[id]->setSettingsDir(s.substr(p1, p2 - p1));
|
|
||||||
if (detectors[id]->getErrorMask())
|
|
||||||
setErrorMask(getErrorMask() | (1 << id));
|
|
||||||
++id;
|
|
||||||
s = s.substr(p2 + 1);
|
|
||||||
p2 = s.find('+');
|
|
||||||
if (id >= (int)detectors.size())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getSettingsDir();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -531,7 +531,7 @@ public:
|
|||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns the trimbit/settings directory
|
* @returns the trimbit/settings directory
|
||||||
*/
|
*/
|
||||||
std::string setSettingsDir(std::string s, int detPos = -1);
|
std::string setSettingsDir(std::string directory, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the modules settings/trimbits reading from a specific file
|
* Loads the modules settings/trimbits reading from a specific file
|
||||||
|
Reference in New Issue
Block a user