From e577cd369e8b43d678bffb4d3be571f12d37c4b3 Mon Sep 17 00:00:00 2001 From: bergamaschi Date: Wed, 24 Oct 2012 08:09:21 +0000 Subject: [PATCH] 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 --- .../gotthardDetectorServer/server_funcs.c | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c index 0953c5a5d..308a5ac46 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/server_funcs.c @@ -1843,27 +1843,41 @@ int get_run_status(int file_des) { printf("\n\nSTATUS=%08x\n",retval); //error - if(retval&0x8000){ + if(retval&SOME_FIFO_FULL_BIT){ printf("-----------------------------------ERROR--------------------------------------x%0x\n",retval); s=ERROR; } //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 - if(retval&0x40000){ - printf("-----------------------------------LAST FRAME READ--------------------------\n"); + if((retval&READMACHINE_BUSY_BIT) ){ // + + + printf("-----------------------------------READ MACHINE BUSY--------------------------\n"); s=TRANSMITTING; - } + } else if (retval&ALL_FIFO_EMPTY_BIT) { + printf("-----------------------------------DATA IN FIFO--------------------------\n"); + s=TRANSMITTING; + + } //and readbusy=0,idle - else if(!(retval&0xFFFFF)){ + else if(retval==0){ //if(!(retval&0x00000001)){ printf("-----------------------------------IDLE--------------------------------------\n"); s=IDLE; + } else { + printf("-----------------------------------Unknown status %04x--------------------------------------\n", retval); + s=ERROR; + } } //if runbusy=1 - else { - if (retval&0x8){ + else { + if (retval&WAITING_FOR_TRIGGER_BIT){ printf("-----------------------------------WAITING-----------------------------------\n"); s=WAITING; }