added acquisition finished callback when the acquisition returns registerAcquisitionFinishedCallback

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@237 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi
2012-09-04 09:47:47 +00:00
parent 2b59857032
commit 43c51f5be5
8 changed files with 146 additions and 27 deletions

View File

@ -352,6 +352,13 @@ class slsDetectorUsers
*/
virtual void registerDataCallback(int( *userCallback)(detectorData*, void*), void *pArg)=0;
/**
@short register calbback for accessing detector final data
\param func function to be called at the end of the acquisition. gets detector status and progress index as arguments
*/
virtual void registerAcquisitionFinishedCallback(int( *func)(double,int, void*), void *pArg)=0;
/**
@short register calbback for reading detector position

View File

@ -17,6 +17,8 @@ slsDetectorUtils::slsDetectorUtils() {
#ifdef VERBOSE
cout << "setting callbacks" << endl;
#endif
acquisition_finished=NULL;
acqFinished_p=NULL;
registerGetPositionCallback(&defaultGetPosition, NULL);
registerConnectChannelsCallback(&defaultConnectChannels,NULL);
registerDisconnectChannelsCallback(&defaultDisconnectChannels,NULL);
@ -323,6 +325,11 @@ void slsDetectorUtils::acquire(int delflag){
if (eclog)
delete eclog;
if (acquisition_finished) {
acquisition_finished(getCurrentProgress(),getDetectorStatus(),acqFinished_p);
}
}

View File

@ -537,6 +537,10 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
void registerGoToPositionNoWaitCallback(int (*func)(double, void*),void*arg){go_to_position_no_wait=func;GTNarg=arg;};
void registerGetI0Callback( double (*func)(int, void*),void *arg){get_i0=func;IOarg=arg;};
virtual void registerAcquisitionFinishedCallback(int( *func)(double,int, void*), void *pArg){acquisition_finished=func; acqFinished_p=pArg;};
/**
Saves the detector setup to file
\param fname file to write to
@ -583,7 +587,8 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
int (*disconnect_channels)(void*);
double (*get_i0)(int, void*);
void *POarg,*CCarg,*DCarg,*GTarg,*GTNarg,*IOarg;
int (*acquisition_finished)(double,int,void*);
void *acqFinished_p;
};