Commit e9e64540 authored by kpetersn's avatar kpetersn
Browse files

Cleaned up the readTemperature code. Can probably remove the private copy of the temperatureRbv

parent df7c9bd0
......@@ -57,13 +57,18 @@ asynStatus Linkam::readFloat64(asynUser *pasynUser, epicsFloat64 *value)
driverName, functionName, this->portName, function);
if (function == temperatureInValue_) {
// Read the temperature from the controller
status = readTemperature(value);
// Update the temperatureInValue_ parameter
setDoubleParam(function, *value);
} else {
status = asynPortDriver::readFloat64(pasynUser,value);
}
callParamCallbacks();
//callParamCallbacks(0);
return (status==0) ? asynSuccess : asynError;
}
......@@ -72,9 +77,11 @@ asynStatus Linkam::readTemperature(epicsFloat64 *value)
{
static const char *functionName = "readTemperature";
temperatureRbv_ = GetValue(0);
*value = temperatureRbv_;
setDoubleParam(temperatureInValue_, temperatureRbv_);
// The temperature is the 0th value
*value = GetValue(0);
// There probably isn't a good reason to retain the temperature in a private variable;
// The value is already stored in the parameter library
temperatureRbv_ = *value;
asynPrint(this->pasynUserSelf, ASYN_TRACEIO_DRIVER,
"%s:%s, port %s, temperature = %lf\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment