Added implementation of new methods, e.g. setHighLimit, setPGain, etc.; changed all dummy methods to return asynSuccess rather than asynError, so derived classes don't need to implement them

This commit is contained in:
MarkRivers
2012-03-01 19:38:02 +00:00
parent 6334229b98
commit b49a1f2285
+86 -20
View File
@@ -19,7 +19,6 @@
static const char *driverName = "asynMotorAxis";
/** Creates a new asynMotorAxis object.
* \param[in] pC Pointer to the asynMotorController to which this axis belongs.
* \param[in] axisNo Index number of this axis, range 0 to pC->numAxes_-1.
@@ -60,7 +59,6 @@ asynMotorAxis::asynMotorAxis(class asynMotorController *pC, int axisNo)
}
/** Move the motor to an absolute location or by a relative amount.
* \param[in] position The absolute position to move to (if relative=0) or the relative distance to move
* by (if relative=1). Units=steps.
@@ -70,22 +68,20 @@ asynMotorAxis::asynMotorAxis(class asynMotorController *pC, int axisNo)
* \param[in] acceleration The acceleration value. Units=steps/sec/sec. */
asynStatus asynMotorAxis::move(double position, int relative, double minVelocity, double maxVelocity, double acceleration)
{
return asynError;
return asynSuccess;
}
/** Move the motor at a fixed velocity until told to stop.
* \param[in] minVelocity The initial velocity, often called the base velocity. Units=steps/sec.
* \param[in] maxVelocity The maximum velocity, often called the slew velocity. Units=steps/sec.
* \param[in] acceleration The acceleration value. Units=steps/sec/sec. */
asynStatus asynMotorAxis::moveVelocity(double minVelocity, double maxVelocity, double acceleration)
{
return asynError;
return asynSuccess;
}
/** Move the motor to the home position.
* \param[in] minVelocity The initial velocity, often called the base velocity. Units=steps/sec.
* \param[in] maxVelocity The maximum velocity, often called the slew velocity. Units=steps/sec.
@@ -94,20 +90,18 @@ asynStatus asynMotorAxis::moveVelocity(double minVelocity, double maxVelocity, d
* Some controllers need to be told the direction, others know which way to go to home. */
asynStatus asynMotorAxis::home(double minVelocity, double maxVelocity, double acceleration, int forwards)
{
return asynError;
return asynSuccess;
}
/** Stop the motor.
* \param[in] acceleration The acceleration value. Units=steps/sec/sec. */
asynStatus asynMotorAxis::stop(double acceleration)
{
return asynError;
return asynSuccess;
}
/** Poll the axis.
* This function should read the controller position, encoder position, and as many of the motorStatus flags
* as the hardware supports. It should call setIntegerParam() and setDoubleParam() for each item that it polls,
@@ -115,9 +109,87 @@ asynStatus asynMotorAxis::stop(double acceleration)
* \param[out] moving A flag that the function must set indicating that the axis is moving (1) or done (0). */
asynStatus asynMotorAxis::poll(bool *moving)
{
return asynError;
return asynSuccess;
}
/** Set the current position of the motor.
* \param[in] position The new absolute motor position that should be set in the hardware. Units=steps.*/
asynStatus asynMotorAxis::setPosition(double position)
{
return asynSuccess;
}
/** Set the current encoder position of the motor.
* \param[in] position The new absolute encoder position that should be set in the hardware. Units=steps.*/
asynStatus asynMotorAxis::setEncoderPosition(double position)
{
return asynSuccess;
}
/** Set the high limit position of the motor.
* \param[in] highLimit The new high limit position that should be set in the hardware. Units=steps.*/
asynStatus asynMotorAxis::setHighLimit(double highLimit)
{
return asynSuccess;
}
/** Set the low limit position of the motor.
* \param[in] lowLimit The new low limit position that should be set in the hardware. Units=steps.*/
asynStatus asynMotorAxis::setLowLimit(double lowLimit)
{
return asynSuccess;
}
/** Set the proportional gain of the motor.
* \param[in] pGain The new proportional gain. */
asynStatus asynMotorAxis::setPGain(double pGain)
{
return asynSuccess;
}
/** Set the integral gain of the motor.
* \param[in] iGain The new integral gain. */
asynStatus asynMotorAxis::setIGain(double iGain)
{
return asynSuccess;
}
/** Set the derivative gain of the motor.
* \param[in] pGain The new derivative gain. */
asynStatus asynMotorAxis::setDGain(double dGain)
{
return asynSuccess;
}
/** Set the motor closed loop status.
* \param[in] closedLoop true = close loop, false = open looop. */
asynStatus asynMotorAxis::setClosedLoop(bool closedLoop)
{
return asynSuccess;
}
/** Set the motor encoder ratio.
* \param[in] ratio The new encoder ratio */
asynStatus asynMotorAxis::setEncoderRatio(double ratio)
{
return asynSuccess;
}
void asynMotorAxis::report(FILE *fp, int details)
{
}
/**
* Default implementation of doMoveToHome.
* Derived classes need to implement this to actually perform the
@@ -130,9 +202,10 @@ asynStatus asynMotorAxis::doMoveToHome()
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR,
"%s:%s: Axis=%d no implementation\n",
driverName, functionName, pC_->moveToHomeAxis_);
return asynError;
return asynSuccess;
}
/**
* Set method for referencingModeMove_
*/
@@ -141,6 +214,7 @@ void asynMotorAxis::setReferencingModeMove(int distance)
referencingModeMove_ = distance;
}
/**
* Get method for referencingModeMove_
*/
@@ -151,14 +225,6 @@ int asynMotorAxis::getReferencingModeMove()
/** Set the current position of the motor.
* \param[in] position The new absolute motor position that should be set in the hardware. Units=steps.*/
asynStatus asynMotorAxis::setPosition(double position)
{
return asynError;
}
// We implement the setIntegerParam, setDoubleParam, and callParamCallbacks methods so we can construct
// the aggregate status structure and do callbacks on it