mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +02:00
using framescaught instead of frameindex in gui to get data
This commit is contained in:
parent
225b67f5e5
commit
79e13c6db7
@ -495,8 +495,9 @@ void* postProcessing::processData(int delflag) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
int progress = -1;
|
int progress = 0;
|
||||||
char currentfName[MAX_STR_LENGTH]="";
|
char currentfName[MAX_STR_LENGTH]="";
|
||||||
|
int caught = -1;
|
||||||
int currentAcquisitionIndex = -1;
|
int currentAcquisitionIndex = -1;
|
||||||
int currentFrameIndex = -1;
|
int currentFrameIndex = -1;
|
||||||
bool newData = false;
|
bool newData = false;
|
||||||
@ -529,20 +530,23 @@ void* postProcessing::processData(int delflag) {
|
|||||||
//get progress
|
//get progress
|
||||||
pthread_mutex_lock(&mg);
|
pthread_mutex_lock(&mg);
|
||||||
if(setReceiverOnline() == ONLINE_FLAG)
|
if(setReceiverOnline() == ONLINE_FLAG)
|
||||||
currentAcquisitionIndex = getReceiverCurrentFrameIndex();
|
caught = getFramesCaughtByReceiver();//getReceiverCurrentFrameIndex();
|
||||||
pthread_mutex_unlock(&mg);
|
pthread_mutex_unlock(&mg);
|
||||||
|
|
||||||
//updating progress
|
//updating progress
|
||||||
if(currentAcquisitionIndex != -1){
|
if(currentAcquisitionIndex != -1){
|
||||||
|
setCurrentProgress(caught);
|
||||||
|
/*
|
||||||
if(subframe){
|
if(subframe){
|
||||||
pthread_mutex_lock(&mg);
|
pthread_mutex_lock(&mg);
|
||||||
setCurrentProgress(getFramesCaughtByReceiver());
|
setCurrentProgress(getFramesCaughtByReceiver());
|
||||||
pthread_mutex_unlock(&mg);
|
pthread_mutex_unlock(&mg);
|
||||||
}else
|
}else
|
||||||
setCurrentProgress(currentAcquisitionIndex+1);
|
setCurrentProgress(currentAcquisitionIndex+1);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
#ifdef VERY_VERY_DEBUG
|
#ifdef VERY_VERY_DEBUG
|
||||||
cout << "currentAcquisitionIndex:" << currentAcquisitionIndex << endl;
|
cout << "caught:" << caught << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -585,20 +589,45 @@ void* postProcessing::processData(int delflag) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (dataReady){
|
|
||||||
//for random reads, ask only if it has new data
|
//for random reads, ask only if it has new data
|
||||||
if(!newData){
|
if(!newData){
|
||||||
if(currentAcquisitionIndex > progress)
|
if(caught > progress){
|
||||||
newData = true;
|
newData = true;
|
||||||
|
/*
|
||||||
|
// keeping acquiringdone at 1 to get more time to get data
|
||||||
|
if(acquiringDone > 0){cout<<"going to maintain acquiidne"<<endl;
|
||||||
|
pthread_mutex_lock(&mg);
|
||||||
|
acquiringDone = 1;
|
||||||
|
//#ifdef VERY_VERY_DEBUG
|
||||||
|
cout << "Keeping acquiringDone at 1 " << endl;
|
||||||
|
//#endif
|
||||||
|
pthread_mutex_unlock(&mg);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
||||||
#ifdef VERY_VERY_DEBUG
|
#ifdef VERY_VERY_DEBUG
|
||||||
cout << "currentAcquisitionIndex:" << currentAcquisitionIndex << " progress:" << progress << endl;
|
cout << "currentAcquisitionIndex:" << currentAcquisitionIndex << " progress:" << progress << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newData){
|
if(newData){
|
||||||
//#ifdef VERY_VERY_DEBUG
|
#ifdef VERY_VERY_DEBUG
|
||||||
cout << "new data" << endl;
|
cout << "new data" << endl;
|
||||||
//#endif
|
#endif
|
||||||
|
//no gui
|
||||||
|
if (!dataReady){
|
||||||
|
progress = caught;
|
||||||
|
#ifdef VERY_VERY_DEBUG
|
||||||
|
cout << "progress:" << progress << endl;
|
||||||
|
#endif
|
||||||
|
newData = false;
|
||||||
|
#ifdef VERY_VERY_DEBUG
|
||||||
|
cout << "newData set to false" << endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
//gui
|
||||||
|
else{
|
||||||
if(setReceiverOnline()==ONLINE_FLAG){
|
if(setReceiverOnline()==ONLINE_FLAG){
|
||||||
//get data
|
//get data
|
||||||
strcpy(currentfName,"");
|
strcpy(currentfName,"");
|
||||||
@ -617,14 +646,16 @@ void* postProcessing::processData(int delflag) {
|
|||||||
cout<<"****Detector Data returned is NULL***"<<endl;
|
cout<<"****Detector Data returned is NULL***"<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//not garbage frame
|
// garbage frame
|
||||||
if(currentAcquisitionIndex < 0){
|
if(currentAcquisitionIndex < 0){
|
||||||
#ifdef VERY_VERY_DEBUG
|
#ifdef VERY_VERY_DEBUG
|
||||||
cout<<"****Detector returned mismatched indices/garbage or acquisition is over. Trying again.***"<<endl;
|
cout<<"****Detector returned mismatched indices/garbage or acquisition is over. Trying again.***"<<endl;
|
||||||
#endif
|
#endif
|
||||||
if(receiverData)
|
if(receiverData)
|
||||||
delete [] receiverData;
|
delete [] receiverData;
|
||||||
}else if (currentAcquisitionIndex > progress){
|
}
|
||||||
|
//not garbage frame
|
||||||
|
else{// if (currentAcquisitionIndex > progress){
|
||||||
#ifdef VERY_VERY_DEBUG
|
#ifdef VERY_VERY_DEBUG
|
||||||
cout << "GOT data" << endl;
|
cout << "GOT data" << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -636,7 +667,7 @@ void* postProcessing::processData(int delflag) {
|
|||||||
dataReady(thisData, currentFrameIndex, pCallbackArg);
|
dataReady(thisData, currentFrameIndex, pCallbackArg);
|
||||||
delete thisData;
|
delete thisData;
|
||||||
fdata = NULL;
|
fdata = NULL;
|
||||||
progress = currentAcquisitionIndex;
|
progress = caught;
|
||||||
#ifdef VERY_VERY_DEBUG
|
#ifdef VERY_VERY_DEBUG
|
||||||
cout << "progress:" << progress << endl;
|
cout << "progress:" << progress << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -649,6 +680,7 @@ void* postProcessing::processData(int delflag) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user