forked from epics_driver_modules/motorBase
Merge pull request #38 from rokvintar/reading_velo_accl_params_fix
Velocity, baseVelocity and acceleration read only when needed. Fix fo…
This commit is contained in:
@@ -277,15 +277,14 @@ asynStatus asynMotorController::writeFloat64(asynUser *pasynUser, epicsFloat64 v
|
||||
/* Set the parameter and readback in the parameter library. */
|
||||
status = pAxis->setDoubleParam(function, value);
|
||||
|
||||
getDoubleParam(axis, motorVelBase_, &baseVelocity);
|
||||
getDoubleParam(axis, motorVelocity_, &velocity);
|
||||
getDoubleParam(axis, motorAccel_, &acceleration);
|
||||
|
||||
if (function == motorMoveRel_) {
|
||||
if (autoPower == 1) {
|
||||
status = pAxis->setClosedLoop(true);
|
||||
epicsThreadSleep(autoPowerOnDelay);
|
||||
}
|
||||
getDoubleParam(axis, motorVelBase_, &baseVelocity);
|
||||
getDoubleParam(axis, motorVelocity_, &velocity);
|
||||
getDoubleParam(axis, motorAccel_, &acceleration);
|
||||
status = pAxis->move(value, 1, baseVelocity, velocity, acceleration);
|
||||
pAxis->setIntegerParam(motorStatusDone_, 0);
|
||||
pAxis->callParamCallbacks();
|
||||
@@ -299,6 +298,9 @@ asynStatus asynMotorController::writeFloat64(asynUser *pasynUser, epicsFloat64 v
|
||||
status = pAxis->setClosedLoop(true);
|
||||
epicsThreadSleep(autoPowerOnDelay);
|
||||
}
|
||||
getDoubleParam(axis, motorVelBase_, &baseVelocity);
|
||||
getDoubleParam(axis, motorVelocity_, &velocity);
|
||||
getDoubleParam(axis, motorAccel_, &acceleration);
|
||||
status = pAxis->move(value, 0, baseVelocity, velocity, acceleration);
|
||||
pAxis->setIntegerParam(motorStatusDone_, 0);
|
||||
pAxis->callParamCallbacks();
|
||||
@@ -312,6 +314,8 @@ asynStatus asynMotorController::writeFloat64(asynUser *pasynUser, epicsFloat64 v
|
||||
status = pAxis->setClosedLoop(true);
|
||||
epicsThreadSleep(autoPowerOnDelay);
|
||||
}
|
||||
getDoubleParam(axis, motorVelBase_, &baseVelocity);
|
||||
getDoubleParam(axis, motorAccel_, &acceleration);
|
||||
status = pAxis->moveVelocity(baseVelocity, value, acceleration);
|
||||
pAxis->setIntegerParam(motorStatusDone_, 0);
|
||||
pAxis->callParamCallbacks();
|
||||
@@ -326,6 +330,9 @@ asynStatus asynMotorController::writeFloat64(asynUser *pasynUser, epicsFloat64 v
|
||||
status = pAxis->setClosedLoop(true);
|
||||
epicsThreadSleep(autoPowerOnDelay);
|
||||
}
|
||||
getDoubleParam(axis, motorVelBase_, &baseVelocity);
|
||||
getDoubleParam(axis, motorVelocity_, &velocity);
|
||||
getDoubleParam(axis, motorAccel_, &acceleration);
|
||||
forwards = (value == 0) ? 0 : 1;
|
||||
status = pAxis->home(baseVelocity, velocity, acceleration, forwards);
|
||||
pAxis->setIntegerParam(motorStatusDone_, 0);
|
||||
|
||||
Reference in New Issue
Block a user