sans/config/hmm/detector.tcl Use dns-name for voltage controller address. sans/config/motors/motor_configuration.tcl Set det home position. SICS-122 Added FastShutter variable and configured det motor with an action object to set the FastShutter variable. SICS-248 Replaced beamstop motor objects with beamstop action objects. action.[ch] The action object factory will eventuall be defined here. SICS-122 Currently there is just a funcion which sets the FastShutter variable beamstopaction.c Added motion control enabled check. Added "list" subcommand. Makefile Compile action.c motor_dmc2280.c The status check command now always checks the TI1 and TI0 interrupts. Added action-object configuration parameter. Call AO_istatus with TI1 if configured with an action object. r2674 | ffr | 2008-08-13 14:16:30 +1000 (Wed, 13 Aug 2008) | 26 lines
55 lines
1.5 KiB
C
55 lines
1.5 KiB
C
/*-------------------------------------------------------------------------
|
|
* @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 <stdlib.h>
|
|
#include <stdbool.h>
|
|
#include <assert.h>
|
|
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
#include <math.h>
|
|
|
|
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) {
|
|
}
|
|
}
|