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);
|
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() {
|
slsDetectorDefs::detectorSettings slsDetector::getSettings() {
|
||||||
return sendSettingsOnly(GET_SETTINGS);
|
return sendSettingsOnly(GET_SETTINGS);
|
||||||
}
|
}
|
||||||
@ -3878,13 +3873,15 @@ int slsDetector::getChanRegs(double *retval) {
|
|||||||
// update chanregs
|
// update chanregs
|
||||||
sls_detector_module *myMod = getModule();
|
sls_detector_module *myMod = getModule();
|
||||||
|
|
||||||
//the original array has 0 initialized
|
if (myMod != nullptr) {
|
||||||
if (myMod->chanregs) {
|
//the original array has 0 initialized
|
||||||
for (int i = 0; i < n; ++i) {
|
if (myMod->chanregs) {
|
||||||
retval[i] = (double)(myMod->chanregs[i] & TRIMBITMASK);
|
for (int i = 0; i < n; ++i) {
|
||||||
}
|
retval[i] = (double)(myMod->chanregs[i] & TRIMBITMASK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
deleteModule(myMod);
|
||||||
}
|
}
|
||||||
deleteModule(myMod);
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3926,26 +3923,6 @@ int slsDetector::setModule(sls_detector_module module, int tb) {
|
|||||||
|
|
||||||
// update client structure
|
// update client structure
|
||||||
if (ret == OK) {
|
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) {
|
if (module.eV != -1) {
|
||||||
detector_shm()->currentThresholdEV = module.eV;
|
detector_shm()->currentThresholdEV = module.eV;
|
||||||
}
|
}
|
||||||
@ -3981,31 +3958,11 @@ slsDetectorDefs::sls_detector_module *slsDetector::getModule() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update client structure
|
// update client structure
|
||||||
// if (ret == OK) {
|
if (ret == OK) {
|
||||||
// if (detectorModules) {
|
if (myMod->eV != -1) {
|
||||||
// if (detector_shm()->myDetectorType == EIGER && chanregs) {
|
detector_shm()->currentThresholdEV = myMod->eV;
|
||||||
// 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;
|
|
||||||
// }
|
|
||||||
return myMod;
|
return myMod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,15 +539,6 @@ class slsDetector : public virtual slsDetectorDefs, public virtual errorDefs {
|
|||||||
*/
|
*/
|
||||||
std::string getSettingsFile();
|
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
|
* Get detector settings
|
||||||
* @returns current settings
|
* @returns current settings
|
||||||
|
Reference in New Issue
Block a user