diff --git a/slsDetectorSoftware/eigerDetectorServer/Makefile b/slsDetectorSoftware/eigerDetectorServer/Makefile index 5e72413c5..649cb7c86 100644 --- a/slsDetectorSoftware/eigerDetectorServer/Makefile +++ b/slsDetectorSoftware/eigerDetectorServer/Makefile @@ -1,6 +1,6 @@ CC = powerpc-4xx-softfloat-gcc CCX = powerpc-4xx-softfloat-g++ -CLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT #-DVERBOSE #-DVIRTUAL +CLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT -DSTOP_SERVER #-DVERBOSE #-DVIRTUAL LDLIBS += -lm -lstdc++ PROGS = eigerDetectorServer diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer index 5c07c2498..4edbb70d8 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 82902f94a..eef8d59fb 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c @@ -42,7 +42,15 @@ extern int dataBytes; const char* dacNames[16] = {"Svp","Svn","Vtr","Vrf","Vrs","Vtgstv","Vcmp_ll","Vcmp_lr","Cal","Vcmp_rl","Vcmp_rr","Rxb_rb","Rxb_lb","Vcp","Vcn","Vis"}; + +//temporary storage on server for debugging until Ian implements int dacvalues[NDAC]; +int framenum=0; +int trains=0; +int exposureTime=1e6; +int period=1e9; +int delay=0; +int gates=0; /** temporary u_int32_t CSP0BASE; @@ -323,14 +331,14 @@ int getModule(sls_detector_module *myMod){ int getThresholdEnergy(int imod){ //template getThresholdEnergy() from mcb_funcs.c //depending on settings - return FAIL; + return 0; } int setThresholdEnergy(int thr, int imod){ //template getThresholdEnergy() from mcb_funcs.c //depending on settings - return FAIL; + return 0; } @@ -385,16 +393,40 @@ char *readFrame(int *ret, char *mess){ int64_t setTimer(enum timerIndex ind, int64_t val){ - //template setDelay() from firmware_funcs.c - //writes to reg - //FRAME_NUMBER - //ACQUISITION_TIME - //FRAME_PERIOD - //DELAY_AFTER_TRIGGER - //GATES_NUMBER - //PROBES_NUMBER - //CYCLES_NUMBER - return 0; + switch(ind){ + case FRAME_NUMBER: + if(val >= 0) + framenum = val; + return framenum; + case ACQUISITION_TIME: + if(val >= 0) + exposureTime = val; + return exposureTime; + case FRAME_PERIOD: + if(val >= 0) + period = val; + return period; + case DELAY_AFTER_TRIGGER: + if(val >= 0) + delay = val; + return delay; + case GATES_NUMBER: + if(val >= 0) + gates = val; + return gates; +/* case PROBES_NUMBER: + if(val >= 0) + framenum = val; + return framenum;*/ + case CYCLES_NUMBER: + if(val >= 0) + trains = val; + return trains; + default: + printf("unknown timer index: %d\n",ind); + break; + } + return -1; } @@ -414,7 +446,7 @@ int64_t getTimeLeft(enum timerIndex ind){ int setDynamicRange(int dr){ //template setDynamicRange() from firmware_funcs.c - return 0; + return DYNAMIC_RANGE; } diff --git a/slsDetectorSoftware/eigerDetectorServer/slsDetectorServer_defs.h b/slsDetectorSoftware/eigerDetectorServer/slsDetectorServer_defs.h index a967913d7..816d2543f 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorServer_defs.h @@ -14,7 +14,7 @@ #define GOODBYE -200 -#define MODULESERIALNUM 0xbeb045 //temporary should be in firmware + #define FIRMWAREREV 0xcaba //temporary should be in firmware /* examples*/ diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index c37d1e7e1..e92ba0d62 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -3054,7 +3054,7 @@ int slsDetector::updateDetectorNoWait() { thisDetector->timerValue[GATES_NUMBER]=retval; //retval=setProbes(tns); - if((thisDetector->myDetectorType!= GOTTHARD)&&(thisDetector->myDetectorType!= MOENCH)){ + if (thisDetector->myDetectorType == MYTHEN){ n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); thisDetector->timerValue[PROBES_NUMBER]=retval; } diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c index 4ac6396a6..2c83e7204 100755 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c @@ -362,37 +362,36 @@ int send_update(int file_des) { int ret=OK; enum detectorSettings t; - int thr, n = 0; - // int it; - int64_t retval;/*, tns=-1;*/ - int nm; - + int n = 0, nm = 0; + int64_t retval = 0; n += sendData(file_des,lastClientIP,sizeof(lastClientIP),OTHER); - /*nm=setNMod(-1,X);*/ + nm=setNMod(GET_FLAG,X); n += sendData(file_des,&nm,sizeof(nm),INT32); - /*nm=setNMod(-1,Y);*/ + nm=setNMod(GET_FLAG,Y); n += sendData(file_des,&nm,sizeof(nm),INT32); - /*nm=setDynamicRange(-1);*/ + nm=setDynamicRange(GET_FLAG); n += sendData(file_des,&nm,sizeof(nm),INT32); n += sendData(file_des,&dataBytes,sizeof(dataBytes),INT32); - /*t=setSettings(GET_SETTINGS, -1);*/ + + t=setSettings(GET_SETTINGS, GET_FLAG); n += sendData(file_des,&t,sizeof(t),INT32); - /*thr=getThresholdEnergy(-1);*/ - n += sendData(file_des,&thr,sizeof(thr),INT32); - /*retval=setFrames(tns);*/ + nm=getThresholdEnergy(GET_FLAG); + n += sendData(file_des,&nm,sizeof(nm),INT32); + + retval=setTimer(FRAME_NUMBER,GET_FLAG); n += sendData(file_des,&retval,sizeof(int64_t),INT64); - /*retval=setExposureTime(tns);*/ + retval=setTimer(ACQUISITION_TIME,GET_FLAG); n += sendData(file_des,&retval,sizeof(int64_t),INT64); - /*retval=setPeriod(tns);*/ + retval=setTimer(FRAME_PERIOD,GET_FLAG); n += sendData(file_des,&retval,sizeof(int64_t),INT64); - /*retval=setDelay(tns);*/ + retval=setTimer(DELAY_AFTER_TRIGGER,GET_FLAG); n += sendData(file_des,&retval,sizeof(int64_t),INT64); - /*retval=setGates(tns);*/ + retval=setTimer(GATES_NUMBER,GET_FLAG); n += sendData(file_des,&retval,sizeof(int64_t),INT64); - /*retval=setProbes(tns);*/ - n += sendData(file_des,&retval,sizeof(int64_t),INT64); - /*retval=setTrains(tns);*/ +/* retval=setTimer(PROBES_NUMBER,GET_FLAG); + n += sendData(file_des,&retval,sizeof(int64_t),INT64);*/ + retval=setTimer(CYCLES_NUMBER,GET_FLAG); n += sendData(file_des,&retval,sizeof(int64_t),INT64); if (lockStatus==0) { @@ -401,7 +400,6 @@ int send_update(int file_des) { return ret; - }