SICS-188 hdb_path is now a comma separated list of paths. NOTE: nodes listed as derived parameter dependencies aren't added to the path.

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
This commit is contained in:
Ferdi Franceschini
2008-08-13 14:16:30 +10:00
committed by Douglas Clowes
parent 7c7ed6cbf9
commit 8a07f5eaf6
7 changed files with 124 additions and 24 deletions

View File

@@ -16,6 +16,8 @@
#define SEQLEN 16
#define ACTIONS 32
extern int DMC2280MotionControl;
typedef enum {
ActID,
Args,
@@ -23,7 +25,7 @@ typedef enum {
DEBUG
} submcd;
char *subcmdName[] = {"act", "args", "status", "debug"};
char *subcmdName[] = {"act", "args", "status", "debug", NULL};
char *validActions[LASTACTION+1] = {"up", "down"};
/* Each action takes two arguments, an axis label and the jogspeed */
char *dfltActionSequence[ACTIONS][SEQLEN] = { {"SH%c","JG%c=%d", "BG%c", NULL}, {"SH%c","JG%c=(-1.0)*(%d)", "BG%c", NULL} };
@@ -94,7 +96,7 @@ static void *AO_GetInterface(void *pData, int iID) {
int AO_Wrapper(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]) {
char msg[128]="No message", output[256];
int actID, status;
int actID, status, i;
OutCode msgType;
pAction self = (pAction) pData;
@@ -102,7 +104,13 @@ int AO_Wrapper(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char
sprintf(msg, "%d", self->status);
msgType = eValue;
} else if (argc == 2) { /* GET */
if (strcasecmp(argv[1], subcmdName[ActID]) == 0) {
if (strcasecmp(argv[1], "list") == 0) {
for (i=0; subcmdName[i]; i++) {
sprintf(msg, "%s", subcmdName[i]);
SCWrite(pCon,msg,eValue);
}
return OKOK;
} else if (strcasecmp(argv[1], subcmdName[ActID]) == 0) {
sprintf(msg, "%s", validActions[self->actionID]);
msgType = eValue;
} else if (strcasecmp(argv[1], subcmdName[Args]) == 0) {
@@ -116,6 +124,7 @@ int AO_Wrapper(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char
msgType = eValue;
} else if (strcasecmp(argv[1], subcmdName[DEBUG]) == 0) {
sprintf(msg, "%d", self->debug);
msgType = eValue;
}
} else if (argc == 3) { /* SET */
if (strcasecmp(argv[1], subcmdName[ActID]) == 0) {
@@ -176,6 +185,16 @@ if fVal == start then
char cmd[AO_CMDLEN], reply[AO_CMDLEN];
int i, cmd_len, comStatus;
if (DMC2280MotionControl != 1) {
AO_Halt(pData);
if (DMC2280MotionControl == 0) {
SCWrite(pCon, "ERROR: Motion control is off", eError);
return 0;
} else {
SCWrite(pCon, "ERROR: Motion control state is unknown", eError);
return 0;
}
}
pAction self = (pAction) pData;
if (self->actionID < NOACTION || self->actionID > LASTACTION) {
sprintf(msg, "ERROR: Programmer error, invalid action ID %d for %s. Alert a SICS programmer", self->actionID, self->objname);