From b060f86f64c3792cb15abe3640806d91c0998d74 Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Fri, 31 May 2013 19:54:14 +0200 Subject: [PATCH] ca: valueAlarm,control not relevant for string/enums --- pvAccessApp/ca/caChannel.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/pvAccessApp/ca/caChannel.cpp b/pvAccessApp/ca/caChannel.cpp index 70e8b0c..748a2bb 100644 --- a/pvAccessApp/ca/caChannel.cpp +++ b/pvAccessApp/ca/caChannel.cpp @@ -84,9 +84,19 @@ static PVStructure::shared_pointer createPVStructure(CAChannel::shared_pointer c // TODO value is always there String properties; if (dbrType >= DBR_CTRL_STRING) // 28 - properties = "value,alarm,display,valueAlarm,control"; + { + if (dbrType != DBR_CTRL_STRING && dbrType != DBR_CTRL_ENUM) + properties = "value,alarm,display,valueAlarm,control"; + else + properties = "value,alarm,display"; + } else if (dbrType >= DBR_GR_STRING) // 21 - properties = "value,alarm,display,valueAlarm"; + { + if (dbrType != DBR_GR_STRING && dbrType != DBR_GR_STRING) + properties = "value,alarm,display,valueAlarm"; + else + properties = "value,alarm,display"; + } else if (dbrType >= DBR_TIME_STRING) // 14 properties = "value,timeStamp"; else if (dbrType >= DBR_STS_STRING) // 7 @@ -105,7 +115,11 @@ void CAChannel::connected() elementCount = ca_element_count(channelID); channelType = ca_field_type(channelID); - String allProperties("value,timeStamp,alarm,display,valueAlarm,control"); + // no valueAlarm and control for non-numeric type + String allProperties = + channelType != DBR_STRING && channelType != DBR_ENUM ? + "value,timeStamp,alarm,display,valueAlarm,control" : + "value,timeStamp,alarm,display"; PVStructure::shared_pointer pvStructure = createPVStructure(shared_from_this(), allProperties); // TODO thread sync