Various improvements:
- Moved the encoder type PV to sinqMotor - Unified the PV naming scheme - Removed the IsEnabled function - this status is read out from the parameter library (motorEnableRBV_)
This commit is contained in:
+14
-15
@@ -17,6 +17,20 @@ asynStatus sinqAxis::atFirstPoll() {
|
||||
asynStatus status = asynSuccess;
|
||||
int variableSpeed = 0;
|
||||
|
||||
// Motor is assumed to be enabled
|
||||
status = pC_->setIntegerParam(axisNo_, pC_->motorEnableRBV_, 1);
|
||||
if (status != asynSuccess) {
|
||||
return pC_->paramLibAccessFailed(status, "motorEnableRBV_",
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
// By default, motors cannot be disabled
|
||||
status = pC_->setIntegerParam(axisNo_, pC_->motorCanDisable_, 0);
|
||||
if (status != asynSuccess) {
|
||||
return pC_->paramLibAccessFailed(status, "motorCanDisable_",
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
status =
|
||||
pC_->getIntegerParam(axisNo_, pC_->motorCanSetSpeed_, &variableSpeed);
|
||||
if (status != asynSuccess) {
|
||||
@@ -118,10 +132,6 @@ asynStatus sinqAxis::poll(bool *moving) {
|
||||
}
|
||||
}
|
||||
|
||||
// Update the enable RBV
|
||||
bool axisIsEnabled = false;
|
||||
|
||||
pl_status = isEnabled(&axisIsEnabled);
|
||||
if (pl_status != asynSuccess) {
|
||||
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR,
|
||||
"%s => line %d:\nFunction isEnabled failed with %s.\n",
|
||||
@@ -134,12 +144,6 @@ asynStatus sinqAxis::poll(bool *moving) {
|
||||
return pC_->paramLibAccessFailed(pl_status, "motorMessageText_",
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
} else {
|
||||
pl_status = setIntegerParam(pC_->motorEnableRBV_, axisIsEnabled);
|
||||
if (pl_status != asynSuccess) {
|
||||
return pC_->paramLibAccessFailed(pl_status, "motorEnableRBV_",
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
// According to the function documentation of asynMotorAxis::poll, this
|
||||
@@ -256,11 +260,6 @@ asynStatus sinqAxis::doHome(double minVelocity, double maxVelocity,
|
||||
|
||||
asynStatus sinqAxis::enable(bool on) { return asynSuccess; }
|
||||
|
||||
asynStatus sinqAxis::isEnabled(bool *on) {
|
||||
*on = true;
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
asynStatus sinqAxis::setVeloFields(double velo, double vbas, double vmax) {
|
||||
asynStatus status = asynSuccess;
|
||||
int variableSpeed = 0;
|
||||
|
||||
Reference in New Issue
Block a user