eiger server edited to include set timer, settingsand stop server for the time being

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@631 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2013-07-11 09:06:37 +00:00
parent 8720f960e7
commit 036d72fec8
6 changed files with 66 additions and 36 deletions

View File

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

View File

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

View File

@ -14,7 +14,7 @@
#define GOODBYE -200
#define MODULESERIALNUM 0xbeb045 //temporary should be in firmware
#define FIRMWAREREV 0xcaba //temporary should be in firmware
/* examples*/