mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +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:
parent
e0a1e4ab36
commit
89ddfa9b51
@ -245,6 +245,8 @@ class slsDetectorBase : public virtual slsDetectorDefs {
|
|||||||
|
|
||||||
virtual int getFileIndexFromFileName(string fname)=0;
|
virtual int getFileIndexFromFileName(string fname)=0;
|
||||||
|
|
||||||
|
virtual int getIndicesFromFileName(string fname,int &index)=0;
|
||||||
|
|
||||||
virtual double *convertAngles()=0;
|
virtual double *convertAngles()=0;
|
||||||
/**
|
/**
|
||||||
set rate correction
|
set rate correction
|
||||||
|
@ -40,6 +40,7 @@ class fileIO : public fileIOStatic, public virtual slsDetectorBase {
|
|||||||
using fileIOStatic::createFileName;
|
using fileIOStatic::createFileName;
|
||||||
|
|
||||||
int getFileIndexFromFileName(string fname){return fileIOStatic::getFileIndexFromFileName(fname);};
|
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 &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);};
|
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);};
|
||||||
/**
|
/**
|
||||||
|
@ -113,6 +113,29 @@ class fileIOStatic {
|
|||||||
return 0; \
|
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
|
/** static function that returns the variables from the file name
|
||||||
|
@ -114,10 +114,10 @@ void postProcessing::processFrame(int *myData, int delflag) {
|
|||||||
cout << "writing raw data " << endl;
|
cout << "writing raw data " << endl;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if (getDetectorsType()==MYTHEN){cout<<"gonna write datafile"<<endl;
|
if (getDetectorsType()==MYTHEN){
|
||||||
// if (fdata) {
|
// if (fdata) {
|
||||||
//uses static function?!?!?!?
|
//uses static function?!?!?!?
|
||||||
writeDataFile (fname+string(".raw"),fdata, NULL, NULL, 'i');cout<<"finished writing datafile"<<endl;
|
writeDataFile (fname+string(".raw"),fdata, NULL, NULL, 'i');
|
||||||
} else {
|
} else {
|
||||||
writeDataFile ((void*)myData, frameIndex);
|
writeDataFile ((void*)myData, frameIndex);
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ int stopReceiver(){
|
|||||||
|
|
||||||
char* readFrame(){
|
char* readFrame(){
|
||||||
int i;
|
int i;
|
||||||
for(i=0;i<10;i++){
|
for(i=0;i<20;i++){
|
||||||
if ((((int)*((int*)buffer))%2)!=0)
|
if ((((int)*((int*)buffer))%2)!=0)
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user