mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 15:00:02 +02:00
q for quit
This commit is contained in:
parent
40babc23a3
commit
754a4f8bdc
@ -6,6 +6,7 @@
|
|||||||
#elif EXTPP
|
#elif EXTPP
|
||||||
#include "usersFunctions.h"
|
#include "usersFunctions.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
|
||||||
//#define VERBOSE
|
//#define VERBOSE
|
||||||
@ -25,6 +26,17 @@ static void* startProcessDataNoDelete(void *n){
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
int postProcessing::kbhit(){
|
||||||
|
struct timeval tv;
|
||||||
|
fd_set fds;
|
||||||
|
tv.tv_sec = 0;
|
||||||
|
tv.tv_usec = 0;
|
||||||
|
FD_ZERO(&fds);
|
||||||
|
FD_SET(STDIN_FILENO, &fds); //STDIN_FILENO is 0
|
||||||
|
select(STDIN_FILENO+1, &fds, NULL, NULL, &tv);
|
||||||
|
return FD_ISSET(STDIN_FILENO, &fds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
postProcessing::postProcessing(): expTime(NULL), ang(NULL), val(NULL), err(NULL), numberOfChannels(0), badChannelMask(NULL){
|
postProcessing::postProcessing(): expTime(NULL), ang(NULL), val(NULL), err(NULL), numberOfChannels(0), badChannelMask(NULL){
|
||||||
pthread_mutex_t mp1 = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t mp1 = PTHREAD_MUTEX_INITIALIZER;
|
||||||
@ -496,10 +508,11 @@ void* postProcessing::processData(int delflag) {
|
|||||||
else{
|
else{
|
||||||
int caught = -1;
|
int caught = -1;
|
||||||
char c;
|
char c;
|
||||||
|
int ifp;
|
||||||
while(true){
|
while(true){
|
||||||
|
|
||||||
cout.flush();
|
//cout.flush();
|
||||||
cout<<flush;
|
//cout<<flush;
|
||||||
usleep(100 * 1000); //20ms need this else connecting error to receiver (too fast)
|
usleep(100 * 1000); //20ms need this else connecting error to receiver (too fast)
|
||||||
|
|
||||||
if (checkJoinThread()){
|
if (checkJoinThread()){
|
||||||
@ -507,10 +520,13 @@ void* postProcessing::processData(int delflag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
c=fgetc(stdin);
|
ifp=kbhit();
|
||||||
if (c=='q') {
|
if (ifp!=0){
|
||||||
cout<<"gonna stop"<<endl;
|
c=fgetc(stdin);
|
||||||
stopAcquisition();
|
if (c=='q') {
|
||||||
|
cout<<"gonna stop"<<endl;
|
||||||
|
stopAcquisition();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -335,6 +335,8 @@ s
|
|||||||
detectorData *thisData;
|
detectorData *thisData;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
int kbhit(void);
|
||||||
|
|
||||||
// double *fdata;
|
// double *fdata;
|
||||||
// int (*dataReady)(detectorData*,int, int,void*);
|
// int (*dataReady)(detectorData*,int, int,void*);
|
||||||
// void *pCallbackArg;
|
// void *pCallbackArg;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user