From 1a848050a898eaca58d21b135357e98a9cbe167b Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Tue, 26 Aug 2014 08:02:21 +0200 Subject: [PATCH] DBR_TIME_ also carries alarm data --- src/ca/caChannel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ca/caChannel.cpp b/src/ca/caChannel.cpp index ab9cc6a..75ac2c9 100644 --- a/src/ca/caChannel.cpp +++ b/src/ca/caChannel.cpp @@ -145,7 +145,7 @@ static PVStructure::shared_pointer createPVStructure(CAChannel::shared_pointer c properties = "value,alarm"; } else if (dbrType >= DBR_TIME_STRING) // 14 - properties = "value,timeStamp"; + properties = "value,alarm,timeStamp"; else if (dbrType >= DBR_STS_STRING) // 7 properties = "value,alarm"; else @@ -501,16 +501,16 @@ static chtype getDBRType(PVStructure::shared_pointer const & pvRequest, chtype n if (fieldStructure->getField("display") || fieldStructure->getField("valueAlarm")) return static_cast(static_cast(nativeType) + DBR_GR_STRING); - // alarm -> DBR_STS_ - if (fieldStructure->getField("alarm")) - return static_cast(static_cast(nativeType) + DBR_STS_STRING); - // timeStamp -> DBR_TIME_ // NOTE: that only DBR_TIME_ type holds timestamp, therefore if you request for // the fields above, you will never get timestamp if (fieldStructure->getField("timeStamp")) return static_cast(static_cast(nativeType) + DBR_TIME_STRING); + // alarm -> DBR_STS_ + if (fieldStructure->getField("alarm")) + return static_cast(static_cast(nativeType) + DBR_STS_STRING); + return nativeType; } @@ -679,7 +679,7 @@ void copy_DBR_TIME(const void * dbr, unsigned count, PVStructure::shared_pointer ts->getLongField("secondsPastEpoch")->put(spe); ts->getIntField("nanoseconds")->put(data->stamp.nsec); - copy_DBR(&data->value, count, pvStructure); + copy_DBR_STS(dbr, count, pvStructure); }