From e0cbbde01da7e22d5d565fd4a6628e8ed6397a26 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 31 Oct 2018 14:57:22 +0100 Subject: [PATCH] log fix for servers. eiger server done --- slsDetectorServers/eigerDetectorServer/Beb.c | 4 ++-- .../eigerDetectorServer/FebControl.c | 18 +++++++++++------- .../eigerDetectorServer/gitInfo.txt | 10 +++++----- .../eigerDetectorServer/gitInfoEiger.h | 8 ++++---- .../slsDetectorFunctionList.c | 11 ++++------- slsDetectorServers/slsDetectorServer/logger.h | 6 +++--- 6 files changed, 29 insertions(+), 28 deletions(-) diff --git a/slsDetectorServers/eigerDetectorServer/Beb.c b/slsDetectorServers/eigerDetectorServer/Beb.c index 70f7eae54..c81fcafcb 100644 --- a/slsDetectorServers/eigerDetectorServer/Beb.c +++ b/slsDetectorServers/eigerDetectorServer/Beb.c @@ -246,7 +246,7 @@ void Beb_EndofDataSend(int tengiga) { while(1) { maxtimer = MAX(MAX(l_txndelaycounter,l_framedelaycounter),MAX(r_txndelaycounter,r_framedelaycounter)); maxtimer /= 100; - FILE_LOG(logINFO, ("Will wait for %d us\n",maxtimer)); + FILE_LOG(logDEBUG1, ("Will wait for %d us\n",maxtimer)); usleep(maxtimer); //read new values @@ -289,7 +289,7 @@ void Beb_EndofDataSend(int tengiga) { } - FILE_LOG(logINFO, ("Detector has send all data\n")); + FILE_LOG(logINFO, ("Detector has sent all data\n")); //close file pointer Beb_close(fd,csp0base); } diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.c b/slsDetectorServers/eigerDetectorServer/FebControl.c index 60f67181b..538825f90 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.c +++ b/slsDetectorServers/eigerDetectorServer/FebControl.c @@ -1456,12 +1456,15 @@ void Feb_Control_PrintAcquisitionSetup() { time(&rawtime); struct tm *timeinfo = localtime(&rawtime); - FILE_LOG(logINFO, ("\nStarting an exposure: %s",asctime(timeinfo))); - FILE_LOG(logINFO, ("\t Dynamic range nbits: %d\n",Feb_Control_GetDynamicRange())); - FILE_LOG(logINFO, ("\t Trigger mode: 0x%x\n",Feb_Control_triggerMode)); - FILE_LOG(logINFO, ("\t Number of exposures: %d\n",Feb_Control_GetNExposures())); - FILE_LOG(logINFO, ("\t Exsposure time (if used): %f seconds.\n",Feb_Control_exposure_time_in_sec)); - FILE_LOG(logINFO, ("\t Exsposure period (if used): %f seconds.\n\n\n",Feb_Control_exposure_period_in_sec)); + FILE_LOG(logINFO, ("Starting an exposure: (%s)" + "\t Dynamic range nbits: %d\n" + "\t Trigger mode: 0x%x\n" + "\t Number of exposures: %d\n" + "\t Exsposure time (if used): %f seconds.\n" + "\t Exsposure period (if used): %f seconds.\n\n", + asctime(timeinfo), Feb_Control_GetDynamicRange(), Feb_Control_triggerMode, + Feb_Control_GetNExposures(), Feb_Control_exposure_time_in_sec, + Feb_Control_exposure_period_in_sec)); } int Feb_Control_SendBitModeToBebServer() { @@ -1483,6 +1486,7 @@ int Feb_Control_SendBitModeToBebServer() { int Feb_Control_PrepareForAcquisition() {//return 1; + FILE_LOG(logINFO, ("Going to Prepare for Acquisition\n\n\n")); static unsigned int reg_nums[20]; static unsigned int reg_vals[20]; @@ -1543,7 +1547,7 @@ int Feb_Control_PrepareForAcquisition() {//return 1; int Feb_Control_StartAcquisition() { - FILE_LOG(logINFO, ("****** starting acquisition********* \n")); + FILE_LOG(logINFOBLUE, ("Starting Acquisition\n")); static unsigned int reg_nums[20]; static unsigned int reg_vals[20]; diff --git a/slsDetectorServers/eigerDetectorServer/gitInfo.txt b/slsDetectorServers/eigerDetectorServer/gitInfo.txt index 77c57bbe4..b38e7c8b0 100644 --- a/slsDetectorServers/eigerDetectorServer/gitInfo.txt +++ b/slsDetectorServers/eigerDetectorServer/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorPackage/slsDetectorServers/eigerDetectorServer URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git -Repsitory UUID: 3d40d5d0585931f7f4a42912dea82d26ca2b3ad0 -Revision: 7 +Repsitory UUID: aec8c031dee83a17174c316415c3bd314b31aa8e +Revision: 8 Branch: refactor -Last Changed Author: Erik_Frojdh -Last Changed Rev: 4154 -Last Changed Date: 2018-10-30 12:17:09.000000002 +0100 ./FebInterface.c +Last Changed Author: Dhanya_Thattil +Last Changed Rev: 4155 +Last Changed Date: 2018-10-31 14:35:43.000000002 +0100 ./Beb.c diff --git a/slsDetectorServers/eigerDetectorServer/gitInfoEiger.h b/slsDetectorServers/eigerDetectorServer/gitInfoEiger.h index ad94fcc13..f2e98e723 100644 --- a/slsDetectorServers/eigerDetectorServer/gitInfoEiger.h +++ b/slsDetectorServers/eigerDetectorServer/gitInfoEiger.h @@ -1,6 +1,6 @@ #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" -#define GITREPUUID "3d40d5d0585931f7f4a42912dea82d26ca2b3ad0" -#define GITAUTH "Erik_Frojdh" -#define GITREV 0x4154 -#define GITDATE 0x20181030 +#define GITREPUUID "aec8c031dee83a17174c316415c3bd314b31aa8e" +#define GITAUTH "Dhanya_Thattil" +#define GITREV 0x4155 +#define GITDATE 0x20181031 #define GITBRANCH "refactor" diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index f145a556e..661dc3ae8 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -1625,7 +1625,7 @@ int startStateMachine() { FILE_LOG(logERROR, ("Acquisition did not FILE_LOG(logERROR ouble reading register\n")); return FAIL; } - FILE_LOG(logINFO, ("***Acquisition started\n")); + FILE_LOG(logINFOGREEN, ("Acquisition started\n")); } /*while(getRunStatus() == IDLE) {FILE_LOG(logINFO, ("waiting for being not idle anymore\n"));}*/ @@ -1743,7 +1743,7 @@ void readFrame(int *ret, char *mess) { //FILE_LOG(logERROR ,"Waiting for finished flag\n")); usleep(5000); } - FILE_LOG(logGREEN, ("acquisition successfully finished\n")); + FILE_LOG(logINFOGREEN, ("acquisition successfully finished\n")); return; #else @@ -1752,7 +1752,7 @@ void readFrame(int *ret, char *mess) { *ret = FAIL; return; } - FILE_LOG(logINFO, ("Acquisition finished***\n")); + FILE_LOG(logINFOGREEN, ("Acquisition finished\n")); if (eiger_storeinmem) { FILE_LOG(logINFO, ("requesting images after storing in memory\n")); @@ -1766,10 +1766,7 @@ void readFrame(int *ret, char *mess) { //wait for detector to send Beb_EndofDataSend(send_to_ten_gig); - - - FILE_LOG(logINFO, ("*****Done Waiting...\n")); - FILE_LOG(logGREEN, ("acquisition successfully finished\n")); + FILE_LOG(logINFOGREEN, ("Acquisition successfully finished\n")); #endif } diff --git a/slsDetectorServers/slsDetectorServer/logger.h b/slsDetectorServers/slsDetectorServer/logger.h index 85d0661e4..2bf350b2c 100644 --- a/slsDetectorServers/slsDetectorServer/logger.h +++ b/slsDetectorServers/slsDetectorServer/logger.h @@ -16,11 +16,11 @@ #endif #ifndef FILELOG_MAX_LEVEL -#define FILELOG_MAX_LEVEL logINFOBLUE +#define FILELOG_MAX_LEVEL logINFO #endif typedef enum { -logERROR, logWARNING, logINFO, logINFOBLUE, logGREEN, +logERROR, logWARNING, logINFOBLUE, logINFOGREEN, logINFO, logDEBUG, logDEBUG1, logDEBUG2, logDEBUG3, logDEBUG4, logDEBUG5 }TLogLevel; @@ -35,7 +35,7 @@ static inline void FILELOG_PrintLog(TLogLevel level, char* m) { case logERROR: cprintf(RED BOLD, "ERROR: %s", m); break; case logWARNING: cprintf(YELLOW BOLD, "WARNING: %s", m); break; case logINFOBLUE: cprintf(BLUE, "INFO: %s", m); break; - case logGREEN: cprintf(GREEN, "INFO: %s", m); break; + case logINFOGREEN: cprintf(GREEN, "INFO: %s", m); break; case logINFO: cprintf(RESET, "INFO: %s", m); break; case logDEBUG: cprintf(MAGENTA, "DEBUG: %s", m); break; case logDEBUG1: cprintf(MAGENTA, "DEBUG1: %s", m); break;