changes to includes clkdivider and flags in gui and modify the server for proper checks

This commit is contained in:
Dhanya Maliakal 2015-09-10 11:29:15 +02:00
parent 584b9e6036
commit 271838b2b5
5 changed files with 12 additions and 4 deletions

View File

@ -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;

View File

@ -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){

View File

@ -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;

View File

@ -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;