mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
Debugged loadCalibrationFile and loadSettingsFile concerning the extensions
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@238 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
43c51f5be5
commit
26b4b8a2a7
@ -5070,9 +5070,10 @@ int slsDetector::loadSettingsFile(string fname, int imod) {
|
||||
mmax=imod+1;
|
||||
}
|
||||
for (int im=mmin; im<mmax; im++) {
|
||||
if (fname.find(".sn")==string::npos && fname.find(".trim")) {
|
||||
ostringstream ostfn;
|
||||
ostfn << fname << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
ostringstream ostfn;
|
||||
ostfn << fname;
|
||||
if (fname.find(".sn")==string::npos && fname.find(".trim")==string::npos) {
|
||||
ostfn << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
fn=ostfn.str();
|
||||
}
|
||||
myMod=readSettingsFile(fn, thisDetector->myDetectorType);
|
||||
@ -5124,11 +5125,12 @@ int slsDetector::loadCalibrationFile(string fname, int imod) {
|
||||
mmax=imod+1;
|
||||
}
|
||||
for (int im=mmin; im<mmax; im++) {
|
||||
if (fname.find(".sn")==string::npos && fname.find(".cal")) {
|
||||
ostringstream ostfn;
|
||||
ostfn << fname << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
fn=ostfn.str();
|
||||
ostringstream ostfn;
|
||||
ostfn << fname ;
|
||||
if (fname.find(".sn")==string::npos && fname.find(".cal")==string::npos) {
|
||||
ostfn << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
}
|
||||
fn=ostfn.str();
|
||||
if(myMod=getModule(im)){
|
||||
if(readCalibrationFile(fn, myMod->gain, myMod->offset)==FAIL)
|
||||
return FAIL;
|
||||
|
@ -537,7 +537,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
||||
void registerGoToPositionNoWaitCallback(int (*func)(double, void*),void*arg){go_to_position_no_wait=func;GTNarg=arg;};
|
||||
void registerGetI0Callback( double (*func)(int, void*),void *arg){get_i0=func;IOarg=arg;};
|
||||
|
||||
virtual void registerAcquisitionFinishedCallback(int( *func)(double,int, void*), void *pArg){acquisition_finished=func; acqFinished_p=pArg;};
|
||||
void registerAcquisitionFinishedCallback(int( *func)(double,int, void*), void *pArg){acquisition_finished=func; acqFinished_p=pArg;};
|
||||
|
||||
|
||||
|
||||
|
@ -31,9 +31,15 @@ int energyConversion::readCalibrationFile(string fname, double &gain, double &of
|
||||
std::cout<< "Could not open calibration file "<< fname << std::endl;
|
||||
gain=0.;
|
||||
offset=0.;
|
||||
#ifndef MYROOT
|
||||
return FAIL;
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
#ifndef MYROOT
|
||||
return OK;
|
||||
#endif
|
||||
return 0;
|
||||
};
|
||||
|
||||
int energyConversion::writeCalibrationFile(string fname, double gain, double offset){
|
||||
@ -47,12 +53,18 @@ int energyConversion::writeCalibrationFile(string fname, double gain, double off
|
||||
outfile << offset << " " << gain << std::endl;
|
||||
} else {
|
||||
std::cout<< "Could not open calibration file "<< fname << " for writing" << std::endl;
|
||||
#ifndef MYROOT
|
||||
return FAIL;
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
outfile.close();
|
||||
|
||||
#ifndef MYROOT
|
||||
return OK;
|
||||
#endif
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user