diff --git a/slsDetectorSoftware/slsDetector/slsDetectorBase.h b/slsDetectorSoftware/slsDetector/slsDetectorBase.h index 48c99ab7a..63a2bd031 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorBase.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorBase.h @@ -245,6 +245,8 @@ class slsDetectorBase : public virtual slsDetectorDefs { virtual int getFileIndexFromFileName(string fname)=0; + virtual int getIndicesFromFileName(string fname,int &index)=0; + virtual double *convertAngles()=0; /** set rate correction diff --git a/slsDetectorSoftware/slsDetectorAnalysis/fileIO.h b/slsDetectorSoftware/slsDetectorAnalysis/fileIO.h index 690ec4360..e934b5fd4 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/fileIO.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/fileIO.h @@ -40,6 +40,7 @@ class fileIO : public fileIOStatic, public virtual slsDetectorBase { using fileIOStatic::createFileName; int getFileIndexFromFileName(string fname){return fileIOStatic::getFileIndexFromFileName(fname);}; + int getIndicesFromFileName(string fname, int &index){return fileIOStatic::getIndicesFromFileName(fname,index);}; int getVariablesFromFileName(string fname, int &index, int &p_index, double &sv0, double &sv1){return fileIOStatic::getVariablesFromFileName(fname, index, p_index, sv0, sv1);}; int getVariablesFromFileName(string fname, int &index, int &f_index, int &p_index, double &sv0, double &sv1, int &detindex){return fileIOStatic::getVariablesFromFileName(fname, f_index, index, p_index, sv0, sv1, detindex);}; /** diff --git a/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h b/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h index 793be6ebf..b5aaed8cb 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/fileIOStatic.h @@ -113,7 +113,30 @@ class fileIOStatic { return 0; \ }; - + /** static function that returns the frame index and file index from the file name + \param fname file name + \param index reference to index + \returns frame index + */ + static int getIndicesFromFileName(string fname,int &index){ \ + int i; \ + string s; \ + size_t uscore=fname.rfind("_"); \ + if (uscore==string::npos) return -1; \ + s=fname; \ + if (sscanf(s.substr(uscore+1,s.size()-uscore-1).c_str(),"%d",&i)){ \ + index=i; \ + s=fname.substr(0,uscore); \ + } \ + else cout << "******************************** cannot parse file index" << endl; \ + uscore=s.rfind("_"); \ + if (sscanf( s.substr(uscore+1,s.size()-uscore-1).c_str(),"f%d",&i)) \ + if(i==-1)return 0; \ + else return i; \ + cout << "******************************** cannot parse frame index" << endl; \ + return 0; \ + }; + /** static function that returns the variables from the file name \param fname file name diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp index 898227c3e..847866b72 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp @@ -114,10 +114,10 @@ void postProcessing::processFrame(int *myData, int delflag) { cout << "writing raw data " << endl; #endif - if (getDetectorsType()==MYTHEN){cout<<"gonna write datafile"<