From 754a4f8bdc8d5cf2bc11387f39983b67bffa375f Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Wed, 2 Nov 2016 16:37:37 +0100 Subject: [PATCH] q for quit --- .../slsDetectorAnalysis/postProcessing.cpp | 28 +++++++++++++++---- .../slsDetectorAnalysis/postProcessing.h | 2 ++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp index 7d98171ff..6ab1b07c3 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp @@ -6,6 +6,7 @@ #elif EXTPP #include "usersFunctions.h" #endif +#include //#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){ pthread_mutex_t mp1 = PTHREAD_MUTEX_INITIALIZER; @@ -496,10 +508,11 @@ void* postProcessing::processData(int delflag) { else{ int caught = -1; char c; + int ifp; while(true){ - cout.flush(); - cout<