mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
fixed the problem with multiple frame scan, frame index and file index included in gui
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@344 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user