commands_common.tcl
Added ::motor::go_home command to run motors to their home positions.

hrpd,hipd,rsd,sans,reflectometer/commands.tcl
Initilise ::motor::is_homing_list for the ::motor::go_hom command

util/command.tcl
Allow an empty parameter list

server_config.tcl
Call the "commands" initilisation function on server init

motor_asim.c
Added the "home" parameter so we can test the go_home command

r2677 | ffr | 2008-08-14 15:00:18 +1000 (Thu, 14 Aug 2008) | 17 lines
This commit is contained in:
Ferdi Franceschini
2008-08-14 15:00:18 +10:00
committed by Douglas Clowes
parent f7c357a56d
commit 348bd3aed1
9 changed files with 73 additions and 3 deletions

View File

@@ -94,6 +94,7 @@ typedef struct ___MoDriv {
float fPos; /* simulated current position */
float fTarget; /* simulation target position including fault */
float fDestination; /* requested final position */
float home;
int iStatus;
char units[256]; /**< physical units for axis */
char long_name[256]; /**< long name of motor */
@@ -650,6 +651,15 @@ int SimAction(SConnection *pCon, SicsInterp *pSics, void *pData,
}
newZero = (currPos - newValue);
return MotorSetPar(self->pMot, pCon, "softzero", newZero);
} else if(strcasecmp("home", argv[1]) == 0) {
if (argc > 2) {
sscanf(argv[2], "%f", &(self->home));
} else {
char line[132];
snprintf(line, 132, "%s.home = %f", argv[0], self->home);
SCWrite(pCon, line, eValue);
return 1;
}
}
else if(strcasecmp("reset", argv[1]) == 0) { }
else if(strcasecmp("state", argv[1]) == 0) { }