Removed writeFloat64, not needed; add setPosition()

This commit is contained in:
MarkRivers
2011-03-29 21:28:25 +00:00
parent 2c1335dc0b
commit 1f860a1423
+8 -38
View File
@@ -179,7 +179,7 @@ asynStatus motorSimController::writeInt32(asynUser *pasynUser, epicsInt32 value)
/* Set the parameter and readback in the parameter library. This may be overwritten when we read back the
* status at the end, but that's OK */
status = setIntegerParam(pAxis->axisNo_, function, value);
pAxis->setIntegerParam(function, value);
if (function == motorDeferMoves_)
{
@@ -198,7 +198,7 @@ asynStatus motorSimController::writeInt32(asynUser *pasynUser, epicsInt32 value)
}
/* Do callbacks so higher layers see any changes */
callParamCallbacks(pAxis->axisNo_);
pAxis->callParamCallbacks();
if (status)
asynPrint(pasynUser, ASYN_TRACE_ERROR,
"%s:%s: error, status=%d function=%d, value=%d\n",
@@ -210,42 +210,6 @@ asynStatus motorSimController::writeInt32(asynUser *pasynUser, epicsInt32 value)
return status;
}
asynStatus motorSimController::writeFloat64(asynUser *pasynUser, epicsFloat64 value)
{
int function = pasynUser->reason;
asynStatus status = asynSuccess;
motorSimAxis *pAxis = this->getAxis(pasynUser);
static const char *functionName = "writeFloat64";
/* Set the parameter and readback in the parameter library. This may be overwritten when we read back the
* status at the end, but that's OK */
status = setDoubleParam(pAxis->axisNo_, function, value);
if (function == motorPosition_)
{
pAxis->enc_offset_ = (double) value - pAxis->nextpoint_.axis[0].p;
asynPrint(pasynUser, ASYN_TRACE_FLOW,
"%s:%s: Set axis %d to position %d\n",
driverName, functionName, pAxis->axisNo_, value);
} else {
/* Call base class call its method (if we have our parameters check this here) */
status = asynMotorController::writeFloat64(pasynUser, value);
}
/* Do callbacks so higher layers see any changes */
callParamCallbacks(pAxis->axisNo_);
if (status)
asynPrint(pasynUser, ASYN_TRACE_ERROR,
"%s:%s: error, status=%d function=%d, value=%f\n",
driverName, functionName, status, function, value);
else
asynPrint(pasynUser, ASYN_TRACEIO_DRIVER,
"%s:%s: function=%d, value=%f\n",
driverName, functionName, function, value);
return status;
}
motorSimAxis* motorSimController::getAxis(asynUser *pasynUser)
{
return static_cast<motorSimAxis*>(asynMotorController::getAxis(pasynUser));
@@ -390,6 +354,12 @@ asynStatus motorSimAxis::stop(double acceleration )
return asynSuccess;
}
asynStatus motorSimAxis::setPosition(double position)
{
enc_offset_ = position - nextpoint_.axis[0].p;
return asynSuccess;
}
asynStatus motorSimAxis::config(int hiHardLimit, int lowHardLimit, int home, int start)
{
hiHardLimit_ = hiHardLimit;