From 3afb9597f23306c3907e83d5271527e2b6d758c9 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Thu, 18 Sep 2008 16:00:52 +1000 Subject: [PATCH] Fixed SICS-273: hnotify sends position updates for some stationary motors Reverted change from rev 1.79 19-Aug-08 which was supposed to send IDLE state position updates if position change is greater than the precision. r2697 | ffr | 2008-09-18 16:00:52 +1000 (Thu, 18 Sep 2008) | 5 lines --- site_ansto/motor_dmc2280.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/site_ansto/motor_dmc2280.c b/site_ansto/motor_dmc2280.c index 197e4abb..f8cfa9a5 100644 --- a/site_ansto/motor_dmc2280.c +++ b/site_ansto/motor_dmc2280.c @@ -1746,9 +1746,7 @@ static void DMCState_Idle(pDMC2280Driv self, pEvtEvent event) { pAsyncTxn pCmd = event->event.msg.cmd; if (self->subState == 1) { /* Status Response */ int iRet; - long lDelta, lprecision; - float fprecision; - + long lDelta; iRet = rspStatus(self, pCmd->inp_buf); if (iRet == 0) break; @@ -1759,16 +1757,11 @@ static void DMCState_Idle(pDMC2280Driv self, pEvtEvent event) { return; } /* if the motor moved, update any observers */ - MotorGetPar(self->pMot, "precision", &fprecision); - if (self->abs_encoder) { + if (self->abs_encoder) lDelta = fabs(self->currCounts - self->lastCounts); - lprecision = (long) (fprecision * self->cntsPerX + 0.5); - } else { + else lDelta = fabs(self->currSteps - self->lastSteps); - lprecision = (long) (fprecision * self->stepsPerX + 0.5); - } - - if (lDelta > lprecision) { + if (lDelta > 10) { set_lastMotion(self, self->currSteps, self->currCounts); report_motion(self); }