From 26b4b8a2a750d83d95cee1153d43c53f20ec4f40 Mon Sep 17 00:00:00 2001 From: bergamaschi Date: Tue, 4 Sep 2012 10:18:16 +0000 Subject: [PATCH] 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 --- slsDetectorSoftware/slsDetector/slsDetector.cpp | 16 +++++++++------- .../slsDetector/slsDetectorUtils.h | 2 +- .../slsDetectorAnalysis/energyConversion.cpp | 12 ++++++++++++ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 174e71140..80d24018d 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -5070,9 +5070,10 @@ int slsDetector::loadSettingsFile(string fname, int imod) { mmax=imod+1; } for (int im=mmin; immyDetectorType); @@ -5124,11 +5125,12 @@ int slsDetector::loadCalibrationFile(string fname, int imod) { mmax=imod+1; } for (int im=mmin; imgain, myMod->offset)==FAIL) return FAIL; diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h index 95cdfd522..f4d29656b 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h @@ -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;}; diff --git a/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp b/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp index 9a7a81b84..9512541ea 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp @@ -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; };