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

@@ -30,6 +30,7 @@
#include <dynstring.h>
#include <time.h>
#include "anstoutil.h"
#include "action.h"
#define UNITSLEN 256
#define TEXTPARLEN 1024
@@ -207,6 +208,7 @@ struct __MoDriv {
#endif
int bias_bits; /**< number of bits to mask */
int bias_bias; /**< bias to add to encoder value */
char ao_id[256];
};
int DMC2280MotionControl = 1; /* defaults to enabled */
@@ -1151,23 +1153,17 @@ static bool has_var_x(pDMC2280Driv self, const char* vars, const char* name) {
static int cmdStatus(pDMC2280Driv self) {
char cmd[CMDLEN];
char encoder = self->axisLabel;
int io_byte = 0;
if (self->encoderAxis && !(self->variables & VAR_ENC))
encoder = self->encoderAxis;
if (self->axisLabel >= 'A' && self->axisLabel <= 'D')
io_byte = 0;
else
io_byte = 1;
/* Use POSx, ENCx, RUNx, SWIx if it has these variables */
snprintf(cmd, CMDLEN, "MG {F10.0} %s%c,%s%c,%s%c,%s%c,%s%c,_TI%d,_XQ0",
snprintf(cmd, CMDLEN, "MG {F10.0} %s%c,%s%c,%s%c,%s%c,%s%c,_TI0,_TI1,_XQ0",
(self->variables & VAR_POS) ? "POS" : "_TD", self->axisLabel,
(self->variables & VAR_ENC) ? "ENC" : "_TP", encoder,
(self->variables & VAR_SWI) ? "SWI" : "_TS", self->axisLabel,
(self->variables & VAR_RUN) ? "RUN" : "_BG", self->axisLabel,
(self->variables & VAR_STP) ? "STP" : "_SC", self->axisLabel,
io_byte);
(self->variables & VAR_STP) ? "STP" : "_SC", self->axisLabel);
return DMC_SendReq(self, cmd);
}
@@ -1247,12 +1243,21 @@ static int cmdOff(pDMC2280Driv self) {
static int rspStatus(pDMC2280Driv self, const char* text) {
int iRet, iFlags;
int iSteps, iCounts;
int iIOByte, iStopCode, iXQ0, iBG;
iRet = sscanf(text, "%d %d %d %d %d %d %d",
int iTIzero, iTIone, iIOByte, iStopCode, iXQ0, iBG;
iRet = sscanf(text, "%d %d %d %d %d %d %d %d",
&iSteps, &iCounts, &iFlags, &iBG,
&iStopCode, &iIOByte, &iXQ0);
if (iRet != 7)
&iStopCode, &iTIzero, &iTIone, &iXQ0);
if (iRet != 8)
return 0;
/* TODO some kind of callback for builtin status would be better */
if (self->ao_id[0] != '\0') {
AO_istatus(iTIone, "TI1");
}
if (self->axisLabel >= 'A' && self->axisLabel <= 'D')
iIOByte = iTIzero;
else
iIOByte = iTIone;
if ((trace_switches || self->debug) && self->currFlags != iFlags) {
char line[CMDLEN];
char *sw;
@@ -3654,6 +3659,11 @@ MotorDriver *CreateDMC2280(SConnection *pCon, char *motor, char *params) {
sscanf(pPtr,"%d",&(pNew->debug));
}
pNew->ao_id[0] = '\0';
if ((pPtr=getParam(pCon, interp, params, "aoid", _OPTIONAL)) != NULL) {
strncpy(pNew->ao_id, pPtr, sizeof(pNew->ao_id));
pNew->ao_id[sizeof(pNew->ao_id) - 1] = '\0';
}
if ((pPtr=getParam(pCon, interp, params, LONG_NAME, _OPTIONAL)) != NULL) {
strncpy(pNew->long_name, pPtr, sizeof(pNew->long_name));
pNew->long_name[sizeof(pNew->long_name) - 1] = '\0';