mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
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:
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user