From 357170a7356013a6305e14190768afc0c25fa453 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 31 May 2013 09:55:10 +1000 Subject: [PATCH] SICS-616 Removed obsolete setpos command from motor driver. --- site_ansto/motor_dmc2280.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/site_ansto/motor_dmc2280.c b/site_ansto/motor_dmc2280.c index a58df874..5ab8f05d 100644 --- a/site_ansto/motor_dmc2280.c +++ b/site_ansto/motor_dmc2280.c @@ -285,7 +285,6 @@ static bool trace_switches = false; #define BUFFLEN 512 #define _SAVEPOWER 0 -#define SETPOS "setpos" #define HOME "home" #define HARDLOWERLIM "hardlowerlim" #define HARDUPPERLIM "hardupperlim" @@ -3329,17 +3328,6 @@ static int DMC2280SetPar(void *pData, SConnection *pCon, self = (pDMC2280Driv)pData; - if(strcasecmp(name,SETPOS) == 0) { - float oldZero, newZero; - if (self->pMot == NULL) - self->pMot = FindMotor(pServ->pSics, self->name); - assert(self->pMot); - MotorGetPar(self->pMot,"softzero",&oldZero); - newZero = (self->pMot->fPosition - newValue) + oldZero; - MotorSetPar(self->pMot,pCon,"softzero",newZero); - return 1; - } - /* Set motor on delay, managers only */ if(strcasecmp(name,MOTONDELAY) == 0) { if(!SCMatchRights(pCon,usMugger)) @@ -4301,30 +4289,6 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData, DMC2280StrList(self, argv[0], pCon); return 1; } - else if(strcasecmp(SETPOS, argv[1]) == 0) { - float oldZero, newZero, currPos, newValue; - if (self->pMot == NULL) - self->pMot = FindMotor(pServ->pSics, self->name); - assert(self->pMot); - MotorGetPar(self->pMot, "softzero", &oldZero); - if (argc > 3) { - sscanf(argv[2], "%f", &currPos); - currPos += oldZero; - sscanf(argv[3], "%f", &newValue); - } - else if (argc > 2 ){ - sscanf(argv[2], "%f", &newValue); - currPos = self->pMot->fPosition; - } - else { - char buffer[BUFFLEN]; - snprintf(buffer, BUFFLEN, "%s.setPos = %f\n", self->name, oldZero); - SCWrite(pCon, buffer, eStatus); - return 1; - } - newZero = (currPos - newValue); - return MotorSetPar(self->pMot, pCon, "softzero", newZero); - } else if(strcasecmp("reset", argv[1]) == 0) { /* Reset the state machine */ DMC_ClearTimer(self);