mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-08 05:40:03 +02:00
fixed bug show nth frame as in 2nd, 4th etc.
This commit is contained in:
parent
e452bccea2
commit
882202c2bc
@ -601,6 +601,8 @@ private:
|
||||
/** Dummy Packet identifier value */
|
||||
const static uint32_t dummyPacketValue = 0xFFFFFFFF;
|
||||
|
||||
|
||||
|
||||
//***receiver to GUI parameters***
|
||||
/** Current Frame copied for GUI */
|
||||
char* latestData;
|
||||
@ -617,6 +619,8 @@ private:
|
||||
/** Semaphore to synchronize Writer and GuiReader threads*/
|
||||
sem_t writerGuiSemaphore;
|
||||
|
||||
/** counter for nth frame to gui */
|
||||
int frametoGuiCounter;
|
||||
|
||||
|
||||
|
||||
|
@ -176,6 +176,7 @@ void UDPStandardImplementation::initializeMembers(){
|
||||
guiDataReady = false;
|
||||
guiData = NULL;
|
||||
strcpy(guiFileName,"");
|
||||
frametoGuiCounter = 0;
|
||||
|
||||
//***general and listening thread parameters***
|
||||
threadStarted = false;
|
||||
@ -804,6 +805,7 @@ int UDPStandardImplementation::startReceiver(char *c){
|
||||
|
||||
//RESET
|
||||
//reset measurement variables
|
||||
frametoGuiCounter = 0;
|
||||
measurementStarted = false;
|
||||
startFrameIndex = 0;
|
||||
frameIndex = 0;
|
||||
@ -2897,6 +2899,9 @@ void UDPStandardImplementation::copyFrameToGui(char* buffer[]){
|
||||
pthread_mutex_unlock(&dataReadyMutex);
|
||||
}
|
||||
|
||||
//if nthe frame, wait for your turn (1st frame always shown as its zero)
|
||||
else if(FrameToGuiFrequency && ((frametoGuiCounter)%FrameToGuiFrequency));
|
||||
|
||||
//random read (gui ready) or nth frame read: gui needs data now or it is the first frame
|
||||
else{
|
||||
#ifdef DEBUG4
|
||||
@ -2936,6 +2941,12 @@ void UDPStandardImplementation::copyFrameToGui(char* buffer[]){
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//update the counter for nth frame
|
||||
if(FrameToGuiFrequency)
|
||||
frametoGuiCounter++;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user