/*------------------------------------------------------------------------- * @file ACTION OBJECT * Currently just provides methods to set SICSVariables on status update. * Copyright: see file Copyright.txt */ #include "action.h" #include "sics.h" #include "asyncqueue.h" #include "nwatch.h" #include "fsm.h" #include "anstoutil.h" #include "sicsvar.h" #include #include #include #include #include #include static char *SV_FastShutter = "FastShutter"; static void setTextSICSVar(char *VarName, char *value) { int privilege = 1; pSicsVariable svText=NULL; svText = (pSicsVariable)FindCommandData(pServ->pSics,SV_FastShutter,"SicsVariable"); if (svText != NULL) VarSetText(svText,value,privilege); } /** * @brief Update a SICS variable with the current status * * @param input, status from device * @param identifier, status query identifier */ void AO_istatus(int input, char *identifier) { int testVal; if (strcasecmp(identifier, "TI1") == 0) { testVal = 48 & input; if (testVal == 32) { // Fast shutter open setTextSICSVar(SV_FastShutter, "OPEN"); } else if (testVal == 16) { // Fast shutter closed setTextSICSVar(SV_FastShutter, "CLOSED"); } else if (testVal == 48) { setTextSICSVar(SV_FastShutter, "INBETWEEN"); } else { // 0 ie both limits activated setTextSICSVar(SV_FastShutter, "FAULT"); } } else if (strcasecmp(identifier, "TS") == 0) { } }