From 7b7d42f253fa9ad19b7f499cd4033a20aa11d94e Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Mon, 14 Mar 2016 14:39:40 +0100 Subject: [PATCH] fixed the 8 byte iodelay trimfile bug, now writes as 4 bytes --- slsDetectorSoftware/commonFiles/sls_detector_defs.h | 5 +++++ slsDetectorSoftware/slsDetector/slsDetector.cpp | 1 + slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/slsDetectorSoftware/commonFiles/sls_detector_defs.h b/slsDetectorSoftware/commonFiles/sls_detector_defs.h index 4d55f5b6b..4990c8587 100755 --- a/slsDetectorSoftware/commonFiles/sls_detector_defs.h +++ b/slsDetectorSoftware/commonFiles/sls_detector_defs.h @@ -32,6 +32,11 @@ typedef char mystring[MAX_STR_LENGTH]; typedef double mysteps[MAX_SCAN_STEPS]; +typedef double double32_t; +typedef float float32_t; +typedef int int32_t; + + #ifndef DACS_FLOAT typedef int dacs_t; #else diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 641520b18..9d4810495 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -3132,6 +3132,7 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise if(thisDetector->myDetectorType == EIGER) iodelay = new int; + int ret=0; diff --git a/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp b/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp index 24537f98f..cc8c88afd 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/energyConversion.cpp @@ -353,7 +353,7 @@ slsDetectorDefs::sls_detector_module* energyConversion::readSettingsFile(string infile.open(myfname.c_str(),ifstream::binary); if (infile.is_open()) { infile.read((char*) myMod->dacs,sizeof(dacs_t)*(myMod->ndac)); - infile.read((char*) iodelay,sizeof(iodelay)); + infile.read((char*) iodelay,sizeof(*iodelay)); infile.read((char*) myMod->chanregs,sizeof(int)*(myMod->nchan)); #ifdef VERBOSE for(int i=0;indac;i++) @@ -517,7 +517,7 @@ int energyConversion::writeSettingsFile(string fname, detectorType myDetectorTyp std::cout << "iodelay: " << *iodelay << std::endl; #endif outfile.write((char*)mod.dacs, sizeof(dacs_t)*(mod.ndac)); - outfile.write((char*)iodelay, sizeof(iodelay)); + outfile.write((char*)iodelay, sizeof(*iodelay)); outfile.write((char*)mod.chanregs, sizeof(int)*(mod.nchan)); outfile.close();