updated gui to work with receiver, start and stop receiver, show progress using callback

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@108 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-11-07 17:01:24 +00:00
parent 716b3530e8
commit ba923b55b7
6 changed files with 36 additions and 5 deletions

View File

@ -194,7 +194,8 @@ void qDrawPlot::SetupWidgetWindow(){
myDet->registerAcquisitionFinishedCallback(&(GetAcquisitionFinishedCallBack),this);
//Setting the callback function to alert when each measurement finished from detector class
myDet->registerMeasurementFinishedCallback(&(GetMeasurementFinishedCallBack),this);
//Setting the callback function to get progress from detector class(using receivers)
myDet->registerProgressCallback(&(GetProgressCallBack),this);
}
@ -511,9 +512,20 @@ void qDrawPlot::SetupMeasurement(int currentIndex){
void* qDrawPlot::DataStartAcquireThread(void *this_pointer){
cout << "before acquire ...." << endl;
bool receiver=(((qDrawPlot*)this_pointer)->myDet->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG);
if(receiver){
if(((qDrawPlot*)this_pointer)->myDet->startReceiver()==slsDetectorDefs::OK)
usleep(2000000);
else{
qDefs::Message(qDefs::CRITICAL,"could not start receiver","Plot");
return this_pointer;
}
}
((qDrawPlot*)this_pointer)->myDet->acquire(1);
cout << "after acquire ...." << endl;
if(receiver){
usleep(0);
((qDrawPlot*)this_pointer)->myDet->stopReceiver();
}
return this_pointer;
}
@ -813,6 +825,15 @@ int qDrawPlot::AcquisitionFinished(double currentProgress, int detectorStatus){
//-------------------------------------------------------------------------------------------------------------------------------------------------
int qDrawPlot::GetProgressCallBack(double currentProgress, void *this_pointer){
((qDrawPlot*)this_pointer)->progress= currentProgress;
return 0;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qDrawPlot::ShowAcquisitionErrorMessage(QString status){
if(!alreadyDisplayed){
alreadyDisplayed = true;