Add logic to prevent always to process the PVs on readParameter function
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <epicsEvent.h>
|
||||
#include <epicsTime.h>
|
||||
@@ -384,7 +385,7 @@ return status;
|
||||
|
||||
|
||||
//============================================================================
|
||||
int Hama::readParameter(int propertyID){
|
||||
int Hama::readParameter(int propertyID, bool processPV) {
|
||||
|
||||
asynStatus status = asynSuccess;
|
||||
double dvalue = 0;
|
||||
@@ -748,25 +749,14 @@ int Hama::readParameter(int propertyID){
|
||||
break;
|
||||
}
|
||||
|
||||
if(failed(m_err)) {
|
||||
char text[256];
|
||||
dcamprop_getname(m_hdcam, propertyID, text, sizeof(text));
|
||||
printError(m_hdcam, m_err, "+dcamprop_getvalue()", "IDPROP:0x%08x, VALUE:%s\n", propertyID, text);
|
||||
}
|
||||
if(failed(m_err)) {
|
||||
char text[256] = {'\0'};
|
||||
dcamprop_getname(m_hdcam, propertyID, text, sizeof(text));
|
||||
printError(m_hdcam, m_err, "+dcamprop_getvalue()", "IDPROP:0x%08x, VALUE:%s\n", propertyID, text);
|
||||
}
|
||||
|
||||
/* Do callbacks so higher layers see any changes */
|
||||
status = callParamCallbacks();
|
||||
/*
|
||||
if (status)
|
||||
asynPrint(0, ASYN_TRACE_ERROR,
|
||||
"%s:%s: error, status=%d function=%d, paramName=%s, value=%d\n",
|
||||
driverName, functionName, status, index, paramName, value);
|
||||
else
|
||||
asynPrint(NULL, ASYN_TRACEIO_DRIVER,
|
||||
"%s:%s: function=%d, paramName=%s, value=%d\n",
|
||||
driverName, functionName, index, paramName, value);
|
||||
*/
|
||||
return status;
|
||||
if (processPV) status = callParamCallbacks();
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -1009,7 +999,7 @@ asynStatus Hama::writeInt32(asynUser *pasynUser, epicsInt32 value) {
|
||||
m_err = dcamprop_getvalue(m_hdcam, DCAM_IDPROP_IMAGE_FRAMEBYTES, &dFrameBytes);
|
||||
status = setIntegerParam(hImageFramebytes, dFrameBytes);
|
||||
}
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME);
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME, false);
|
||||
}
|
||||
else if (index == ADMinY) {
|
||||
int minV = 0, sizeV = 0;
|
||||
@@ -1035,7 +1025,7 @@ asynStatus Hama::writeInt32(asynUser *pasynUser, epicsInt32 value) {
|
||||
dcamprop_getvalue(m_hdcam, DCAM_IDPROP_IMAGE_FRAMEBYTES, &dFrameBytes);
|
||||
status = setIntegerParam(hImageFramebytes, dFrameBytes);
|
||||
}
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME);
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME, false);
|
||||
}
|
||||
|
||||
else if (index == ADSizeX) {
|
||||
@@ -1058,7 +1048,7 @@ asynStatus Hama::writeInt32(asynUser *pasynUser, epicsInt32 value) {
|
||||
status = setIntegerParam(hImageFramebytes, dFrameBytes);
|
||||
value = (int)dsizeX;
|
||||
}
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME);
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME, false);
|
||||
}
|
||||
|
||||
else if (index == ADSizeY) {
|
||||
@@ -1080,7 +1070,7 @@ asynStatus Hama::writeInt32(asynUser *pasynUser, epicsInt32 value) {
|
||||
status = setIntegerParam(hImageFramebytes, dFrameBytes);
|
||||
value = (int)dsizeY;
|
||||
}
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME);
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME, false);
|
||||
}
|
||||
else if (index == ADReadStatus) {
|
||||
// dcamprop_setvalue(m_hdcam, DCAM_IDPROP_, value);
|
||||
@@ -1092,14 +1082,14 @@ asynStatus Hama::writeInt32(asynUser *pasynUser, epicsInt32 value) {
|
||||
printf("[DEBUG]::writeInit32 SensorMode %d\n", value);
|
||||
m_err = dcamprop_setgetvalue(m_hdcam, DCAM_IDPROP_SENSORMODE, &dvalue);
|
||||
if (failed(m_err)) printError(m_hdcam, m_err, "dcamprop_setgetvalue()", "IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME);
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME, false);
|
||||
}
|
||||
|
||||
else if (index == hReadoutSpeed) {
|
||||
printf("[DEBUG]::writeInit32 ReadoutSpeed %d\n", value);
|
||||
m_err = dcamprop_setgetvalue(m_hdcam, DCAM_IDPROP_READOUTSPEED, &dvalue);
|
||||
if (failed(m_err)) printError(m_hdcam, m_err, "dcamprop_setgetvalue()", "IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME);
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME, false);
|
||||
}
|
||||
|
||||
else if (index == hReadoutDirection) {
|
||||
@@ -1438,7 +1428,7 @@ asynStatus Hama::writeFloat64(asynUser *pasynUser, epicsFloat64 value){
|
||||
}
|
||||
}
|
||||
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME);
|
||||
readParameter(DCAM_IDPROP_TIMING_READOUTTIME, false);
|
||||
m_err = dcamprop_getvalue(m_hdcam, DCAM_IDPROP_EXPOSURETIME, &value);
|
||||
}
|
||||
|
||||
|
||||
@@ -144,11 +144,7 @@ public:
|
||||
virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value);
|
||||
virtual void report(FILE *fp, int details);
|
||||
|
||||
/* This function could be implemented as overwrite virtual readInt32, readFloat64 */
|
||||
/* It is however implemented in that way due to sugestion that only */
|
||||
/* writeInt32, writeFloat64, report should be overwrite */
|
||||
/* could be changed in the future */
|
||||
int readParameter(int paramIndex);
|
||||
int readParameter(int propertyID, bool processPV = true);
|
||||
int readParameterStr(int paramIndex);
|
||||
|
||||
epicsUInt32 mTimeStampSec;
|
||||
|
||||
Reference in New Issue
Block a user