changes of get detector status by Anna

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@309 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi 2012-10-24 08:09:21 +00:00
parent 964ff9006f
commit e577cd369e

View File

@ -1843,27 +1843,41 @@ int get_run_status(int file_des) {
printf("\n\nSTATUS=%08x\n",retval); printf("\n\nSTATUS=%08x\n",retval);
//error //error
if(retval&0x8000){ if(retval&SOME_FIFO_FULL_BIT){
printf("-----------------------------------ERROR--------------------------------------x%0x\n",retval); printf("-----------------------------------ERROR--------------------------------------x%0x\n",retval);
s=ERROR; s=ERROR;
} }
//runbusy=0 //runbusy=0
else if(!(retval&0x20000)){ // else if(!(retval&RUNMACHINE_BUSY_BIT)){ //commented by Anna 24.10.2012
else if(!(retval&RUN_BUSY_BIT)){ // by Anna 24.10.2012
//and readbusy=1, its last frame read //and readbusy=1, its last frame read
if(retval&0x40000){ if((retval&READMACHINE_BUSY_BIT) ){ //
printf("-----------------------------------LAST FRAME READ--------------------------\n");
printf("-----------------------------------READ MACHINE BUSY--------------------------\n");
s=TRANSMITTING; s=TRANSMITTING;
} else if (retval&ALL_FIFO_EMPTY_BIT) {
printf("-----------------------------------DATA IN FIFO--------------------------\n");
s=TRANSMITTING;
} }
//and readbusy=0,idle //and readbusy=0,idle
else if(!(retval&0xFFFFF)){ else if(retval==0){
//if(!(retval&0x00000001)){ //if(!(retval&0x00000001)){
printf("-----------------------------------IDLE--------------------------------------\n"); printf("-----------------------------------IDLE--------------------------------------\n");
s=IDLE; s=IDLE;
} else {
printf("-----------------------------------Unknown status %04x--------------------------------------\n", retval);
s=ERROR;
} }
} }
//if runbusy=1 //if runbusy=1
else { else {
if (retval&0x8){ if (retval&WAITING_FOR_TRIGGER_BIT){
printf("-----------------------------------WAITING-----------------------------------\n"); printf("-----------------------------------WAITING-----------------------------------\n");
s=WAITING; s=WAITING;
} }