diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 515ed58ba..285a7d9d5 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -5107,12 +5107,12 @@ int slsDetector::loadSettingsFile(string fname, int imod) { ostfn << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im); fn=ostfn.str(); } - //settings is saved in myMod.reg for gotthard - if(thisDetector->myDetectorType==GOTTHARD) - myMod->reg=thisDetector->currentSettings; myMod=readSettingsFile(fn, thisDetector->myDetectorType); if (myMod) { myMod->module=im; + //settings is saved in myMod.reg for gotthard + if(thisDetector->myDetectorType==GOTTHARD) + myMod->reg=thisDetector->currentSettings; setModule(*myMod); deleteModule(myMod); } else diff --git a/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp b/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp index c69b52b1e..67de642f2 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp @@ -280,44 +280,46 @@ int energyConversion::writeSettingsFile(string fname, detectorType myDetectorTyp int iv, ichan, ichip; int iv1, idac; int nb; - outfile.open(fname.c_str(), ios_base::out); + outfile.open(fname.c_str(), ios_base::out); - if (outfile.is_open()) { - for (idac=0; idac>nb); - outfile << iv1 << " "; - nb=8; - iv1=((iv&(1<>nb); - outfile << iv1 << " "; - nb=7; - iv1=((iv&(1<>nb); - outfile <>nb); - outfile << iv1 << " "; - nb=11; - iv1= ((iv&0xfffff800)>>nb); - outfile << iv1 << std::endl; - } - } - outfile.close(); - return OK; - } else { - std::cout<< "could not open SETTINGS file " << fname << std::endl; - return FAIL; + if (outfile.is_open()) { + for (idac=0; idac>nb); + outfile << iv1 << " "; + nb=8; + iv1=((iv&(1<>nb); + outfile << iv1 << " "; + nb=7; + iv1=((iv&(1<>nb); + outfile <>nb); + outfile << iv1 << " "; + nb=11; + iv1= ((iv&0xfffff800)>>nb); + outfile << iv1 << std::endl; + } + } + } + outfile.close(); + return OK; + } else { + std::cout<< "could not open SETTINGS file " << fname << std::endl; + return FAIL; + } };