diff --git a/slsDetectorSoftware/commonFiles/error_defs.h b/slsDetectorSoftware/commonFiles/error_defs.h index 5050478ed..61b9517ac 100644 --- a/slsDetectorSoftware/commonFiles/error_defs.h +++ b/slsDetectorSoftware/commonFiles/error_defs.h @@ -18,7 +18,6 @@ using namespace std; /** Error flags */ -#define NUM_ERROR_FLAGS 32 #define CRITICAL_ERROR_MASK 0xFFFFFFFF #define CANNOT_CONNECT_TO_DETECTOR 0x8000000000000000ULL @@ -50,6 +49,8 @@ using namespace std; #define RECEIVER_DYNAMIC_RANGE 0x0000000000000800ULL #define RECEIVER_TEN_GIGA 0x0000000000001000ULL #define ALLTIMBITS_NOT_SET 0x0000000000002000ULL +#define COULD_NOT_SET_SPEED_PARAMETERS 0x0000000000004000ULL +#define COULD_NOT_SET_READOUT_FLAGS 0x0000000000008000ULL // 0x00000000FFFFFFFFULL /** @short class returning all error messages for error mask */ @@ -150,7 +151,11 @@ public: if(slsErrorMask&ALLTIMBITS_NOT_SET) retval.append("Could not set all trimbits to value.\n"); + if(slsErrorMask&COULD_NOT_SET_SPEED_PARAMETERS) + retval.append("Could not set the speed parameter value\n"); + if(slsErrorMask&COULD_NOT_SET_READOUT_FLAGS) + retval.append("Could not set the readout flag\n"); return retval; diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer index 45564168e..91af79a11 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer differ diff --git a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c index edffb9be0..99eada715 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c @@ -745,7 +745,7 @@ int setDynamicRange(int dr){ enum readOutFlags setReadOutFlags(enum readOutFlags val){ - enum readOutFlags retval; + enum readOutFlags retval = GET_READOUT_FLAGS; if(val!=GET_READOUT_FLAGS){ diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index b00340bf9..ddddec4bd 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -4262,6 +4262,7 @@ int slsDetector::setSpeed(speedVariable sp, int value) { if (ret==FAIL) { controlSocket->ReceiveDataOnly(mess,sizeof(mess)); std::cout<< "Detector returned error: " << mess << std::endl; + setErrorMask((getErrorMask())|(COULD_NOT_SET_SPEED_PARAMETERS)); } else { controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); } @@ -4530,6 +4531,7 @@ int slsDetector::setReadOutFlags(readOutFlags flag){ if (ret==FAIL) { controlSocket->ReceiveDataOnly(mess,sizeof(mess)); std::cout<< "Detector returned error: " << mess << std::endl; + setErrorMask((getErrorMask())|(COULD_NOT_SET_READOUT_FLAGS)); } else { controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); thisDetector->roFlags=retval; diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c index 870bd9d3d..dfe66d020 100755 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c @@ -2779,9 +2779,10 @@ int set_readout_flags(int file_des) { #endif if (ret==OK) { - if (retval == -1) { + if ((retval == -1) || ((arg!=-1)&&((retval&arg)!=arg))){ + cprintf(RED,"arg:0x%x, retval:0x%x retval&arg:0x%x\n",(int)arg,(int)retval,retval&arg); ret=FAIL; - sprintf(mess,"Could not change readout flag: should be %d but is %d\n", arg, retval); + sprintf(mess,"Could not change readout flag: should be 0x%x but is 0x%x\n", arg, retval); cprintf(RED, "%s",mess); }else if (differentClients) ret=FORCE_UPDATE;