mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
removing comments, added one check for nullptr, updated current threshold when getting module, removing unsued function from header file (writesettingsfile)
This commit is contained in:
@ -1158,11 +1158,6 @@ std::string slsDetector::getSettingsFile() {
|
||||
return std::string(detector_shm()->settingsFile);
|
||||
}
|
||||
|
||||
// int slsDetector::writeSettingsFile(const std::string &fname) {
|
||||
// //TODO should read module from detector...
|
||||
// return writeSettingsFile(fname, getModule());
|
||||
// }
|
||||
|
||||
slsDetectorDefs::detectorSettings slsDetector::getSettings() {
|
||||
return sendSettingsOnly(GET_SETTINGS);
|
||||
}
|
||||
@ -3878,6 +3873,7 @@ int slsDetector::getChanRegs(double *retval) {
|
||||
// update chanregs
|
||||
sls_detector_module *myMod = getModule();
|
||||
|
||||
if (myMod != nullptr) {
|
||||
//the original array has 0 initialized
|
||||
if (myMod->chanregs) {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
@ -3885,6 +3881,7 @@ int slsDetector::getChanRegs(double *retval) {
|
||||
}
|
||||
}
|
||||
deleteModule(myMod);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -3926,26 +3923,6 @@ int slsDetector::setModule(sls_detector_module module, int tb) {
|
||||
|
||||
// update client structure
|
||||
if (ret == OK) {
|
||||
// if (detectorModules) {
|
||||
// if (detector_shm()->myDetectorType == EIGER && tb && chanregs) {
|
||||
// for (int ichip = 0; ichip < detector_shm()->nChips; ++ichip) {
|
||||
// for (int i = 0; i < detector_shm()->nChans; ++i) {
|
||||
// chanregs[i + ichip * detector_shm()->nChans] =
|
||||
// module.chanregs[ichip * detector_shm()->nChans + i];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (dacs) {
|
||||
// for (int i = 0; i < detector_shm()->nDacs; ++i) {
|
||||
// dacs[i] = module.dacs[i];
|
||||
// }
|
||||
// }
|
||||
// (detectorModules)->serialnumber = module.serialnumber;
|
||||
// (detectorModules)->reg = module.reg;
|
||||
// (detectorModules)->iodelay = module.iodelay;
|
||||
// (detectorModules)->tau = module.tau;
|
||||
// (detectorModules)->eV = module.eV;
|
||||
// }
|
||||
if (module.eV != -1) {
|
||||
detector_shm()->currentThresholdEV = module.eV;
|
||||
}
|
||||
@ -3981,31 +3958,11 @@ slsDetectorDefs::sls_detector_module *slsDetector::getModule() {
|
||||
}
|
||||
|
||||
// update client structure
|
||||
// if (ret == OK) {
|
||||
// if (detectorModules) {
|
||||
// if (detector_shm()->myDetectorType == EIGER && chanregs) {
|
||||
// for (int ichip = 0; ichip < detector_shm()->nChips; ++ichip) {
|
||||
// for (int i = 0; i < detector_shm()->nChans; ++i) {
|
||||
// chanregs[i + ichip * detector_shm()->nChans] =
|
||||
// myMod->chanregs[ichip * detector_shm()->nChans + i];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (dacs) {
|
||||
// for (int i = 0; i < detector_shm()->nDacs; ++i) {
|
||||
// dacs[i] = myMod->dacs[i];
|
||||
// }
|
||||
// }
|
||||
// (detectorModules)->serialnumber = myMod->serialnumber;
|
||||
// (detectorModules)->reg = myMod->reg;
|
||||
// (detectorModules)->iodelay = myMod->iodelay;
|
||||
// (detectorModules)->tau = myMod->tau;
|
||||
// (detectorModules)->eV = myMod->eV;
|
||||
// }
|
||||
// } else {
|
||||
// deleteModule(myMod);
|
||||
// myMod = nullptr;
|
||||
// }
|
||||
if (ret == OK) {
|
||||
if (myMod->eV != -1) {
|
||||
detector_shm()->currentThresholdEV = myMod->eV;
|
||||
}
|
||||
}
|
||||
return myMod;
|
||||
}
|
||||
|
||||
|
@ -539,15 +539,6 @@ class slsDetector : public virtual slsDetectorDefs, public virtual errorDefs {
|
||||
*/
|
||||
std::string getSettingsFile();
|
||||
|
||||
/**
|
||||
* Writes a trim/settings file for module number
|
||||
* the values will be read from the current detector structure
|
||||
* @param fname name of the file to be written
|
||||
* @returns OK or FAIL if the file could not be written
|
||||
* \sa ::sls_detector_module sharedSlsDetector mythenDetector::writeSettingsFile(string, int)
|
||||
*/
|
||||
int writeSettingsFile(const std::string &fname);
|
||||
|
||||
/**
|
||||
* Get detector settings
|
||||
* @returns current settings
|
||||
|
Reference in New Issue
Block a user