mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 22:07:12 +02:00
WIP
This commit is contained in:
@ -3203,6 +3203,9 @@ sls_detector_module Module::readSettingsFile(const std::string &fname,
|
||||
throw RuntimeError("Could not open settings file: " + fname);
|
||||
}
|
||||
|
||||
auto file_size = getFileSize(infile);
|
||||
|
||||
|
||||
// eiger
|
||||
if (shm()->myDetectorType == EIGER) {
|
||||
infile.read(reinterpret_cast<char *>(myMod.dacs),
|
||||
@ -3228,6 +3231,16 @@ sls_detector_module Module::readSettingsFile(const std::string &fname,
|
||||
|
||||
// mythen3 (dacs, trimbits)
|
||||
else if (shm()->myDetectorType == MYTHEN3) {
|
||||
int expected_size =
|
||||
sizeof(int) * myMod.ndac + sizeof(int) * myMod.nchan + sizeof(myMod.reg);
|
||||
if (file_size != expected_size) {
|
||||
throw RuntimeError("The size of the settings file: " + fname +
|
||||
" differs from the expected size, " +
|
||||
std::to_string(file_size) + " instead of " +
|
||||
std::to_string(expected_size) + " bytes");
|
||||
}
|
||||
infile.read(reinterpret_cast<char *>(&myMod.reg),
|
||||
sizeof(myMod.reg));
|
||||
infile.read(reinterpret_cast<char *>(myMod.dacs),
|
||||
sizeof(int) * (myMod.ndac));
|
||||
for (int i = 0; i < myMod.ndac; ++i) {
|
||||
|
Reference in New Issue
Block a user