SICS-616 Removed obsolete setpos command from motor driver.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user