Improved error reporting in eigermono

This commit is contained in:
2014-04-07 14:06:48 +02:00
parent fc0ff43db2
commit e36ced5718

View File

@@ -175,7 +175,7 @@ static void writeMotPos(SConnection * pCon, int silent, char *name,
static long startTASMotor(pMotor mot, SConnection * pCon, char *name,
double target, int silent, int stopFixed)
{
float val, fixed, precision = MOTPREC;
float val, fixed, fHard, precision = MOTPREC;
long status = NOTSTARTED;
char buffer[132];
pIDrivable pDriv = NULL;
@@ -195,18 +195,22 @@ static long startTASMotor(pMotor mot, SConnection * pCon, char *name,
}
return NOTSTARTED;
}
if(MotorCheckBoundary(mot,target,&fHard,buffer,sizeof(buffer)) == 0){
SCPrintf(pCon,eLog,"ERROR: %s", buffer);
}
}
mot->stopped = 0;
if (ABS(val - target) > precision) {
status = StartDriveTask(mot, pCon, name, (float)target);
if(status < 0){
SCPrintf(pCon,eLog,"ERROR: failed to drive %s to %f", name, target);
} else {
/*
to force updates on targets
*/
InvokeNewTarget(pServ->pExecutor, name, target);
writeMotPos(pCon, silent, name, val, target);
}
/*
to force updates on targets
*/
InvokeNewTarget(pServ->pExecutor, name, target);
writeMotPos(pCon, silent, name, val, target);
return status;
}
return NOTSTARTED;