From 2ede54033e925f429e9f5f0e7d386926e25b47d1 Mon Sep 17 00:00:00 2001
From: Marty Kraimer Often a property field is associated with another field.
-This other field is refered to as the value field.
+This other field is referred to as the value field.
Usually the value field will have the field name "value".
An example is: Clients and Servers should use alarm.h and pvAlarm.h which are
-provided by pvDataCPP intead of directly using the alarm structure itself.
+provided by pvDataCPP instead of directly using the alarm structure itself.
In particular severity and status are defined as: Clients and Servers should use timeStamp.h and pvTimeStamp.h
-which are provided by pvDataCPP intead of directly using the timeStamp structure itself.
+which are provided by pvDataCPP instead of directly using the timeStamp structure itself.
Note that timeStamp.h provides many methods for manipulating time.
The meaning of the fields is: Servers should use control.h and pvControl.h which are
-provided by pvDataCPP intead of directly using the control structure itself.
+provided by pvDataCPP instead of directly using the control structure itself.
Note that control.h provides many methods for manipulating time.
Each bulder also has a number of additional methods for optional fields
+ Each builder also has a number of additional methods for optional fields
and a method to add extra fields.
@@ -834,7 +834,7 @@ where
lots of code is a copy paste, consider inheritance and templates NTScalarArrayBuilder::arrayValue Should this be: NTScalarArrayBuilder::value This makes NTScalarArray consistent with other NTTypes. This does not have a value field like all the other NTTypes.
+Perhaps instead of It should be Should lables be label?
+Compare with name,value from NTNameValue. This is the 01-Oct-2014 version of the C++ implementation of pvData.
+ This is the 09-Oct-2014 version of the C++ implementation of pvData.
Property Field Definitions
Definition: value
@@ -269,7 +269,7 @@ structure alarm
string message
enum AlarmSeverity {
@@ -304,7 +304,7 @@ structure timeStamp
int userTag
display
@@ -398,7 +398,7 @@ PVData can be used to generate a valueAlarm field as an extra field.
Normative Type Class
ev4:nt/NTNameValue:1.0
string[] names // mandatory
- double[] values // madatory, can be any type, must be same length as names
+ double[] values // mandatory, can be any type, must be same length as names
string descriptor // optional
alarm_t alarm // optional
int severity
From c9d4f6aa02e6fd61ec52d4bdf4b86aa4bb55c02d Mon Sep 17 00:00:00 2001
From: Marty Kraimer TODO
-NTScalarArray
+NTNameValue
+
+NTNameValue
+ string[] name
+ string[] value
+
+NTNameValue
+ value
+ string[] name
+ string[] value
+NTTable
+EPICS ntCPP
-EPICS v4 Working Group, Working Draft, 01-Oct-2014
+EPICS v4 Working Group, Working Draft, 09-Oct-2014
Status of this Document
-
If alarms do appear at multiple levels then an alarm is always @@ -288,9 +290,11 @@ There can be multiple timeStamp fields. A timeStamp associated with a substructure is usually associated with a value field. An timeStamp field attached to the top level structure can be used for either: +
NTNDArray is an example that has two top level timeStamp field with different @@ -369,7 +373,7 @@ structure
NOTE: NTField, described above, has support for checking to see if a structure is an alarmLimit structure but no other support for alarmLimit.
- +PVData has support named valueAlarm instead of alarmLimit (alarmLimit is identical to valueAlarm for type double). For numeric types the field names are the same but the type @@ -394,11 +398,12 @@ PVData can be used to generate a valueAlarm field as an extra field.
Each builder also has a number of additional methods for optional fields +
Each bulder also has a number of additional methods for optional fields and a method to add extra fields.
@@ -494,13 +499,13 @@ where a unique name that is not the name of any mandatory or possible optional field.
An NTScalaBuilder can be used to create multiple PVStructure and/or NTScalar instances. -Each time createPVScalar is called it clears all interval data after the PVStructure +Each time createPVScalar is called it clears all internal data after the PVStructure is created.
An example of creating an NTScalar instance is:
NTScalarBuilderPtr builder = NTScalar::createBuilder();
-NTScalarPtr ntScalar = builder->
+NTScalarPtr ntScalar = builder->
value(pvInt)->
addDescriptor()->
addAlarm()->
@@ -525,7 +530,7 @@ NTScalarPtr ntScalar = builder->create();
ntscalar.h defines the following:
class NTScalar;
-typedef std::tr1::shared_ptr NTScalarPtr;
+typedef std::tr1::shared_ptr<NTScalar> NTScalarPtr;
class NTScalar
{
@@ -549,7 +554,7 @@ public:
PVStructurePtr getControl() const;
PVFieldPtr getValue() const;
template<typename PVT>
- std::tr1::shared_ptr<PV> getValue() const
+ std::tr1::shared_ptr<PVT> getValue() const
private:
}
@@ -557,12 +562,13 @@ where
void myCallback(PVStructurePtr const & pvStructure)
@@ -574,7 +580,7 @@ void myCallback(PVStructurePtr const & pvStructure)
...
}
- This class is similar to NTScalarArray except that the value +
This class is similar to NTScalar except that the value field is a scalar array field instead of just a scalar.
This has the following fields:
@@ -711,7 +717,7 @@ private:where
ntscalarArray.h defines the following:
class NTScalarArray; -typedef std::tr1::shared_ptrNTScalarArrayPtr; +typedef std::tr1::shared_ptr<NTScalarArray> NTScalarArrayPtr; class NTScalarArray { @@ -771,7 +777,7 @@ where - wrap
- Given a pvStructure this creates an NTScalarArray that warps it. It calls isCompatible returns a null PVScalarArray if isCompatible returns false. -
- +
- wrapUnsafe
- Given a pvStructure this creates an NTScalarArray that warps it. It does not check that the introspection interface is compatible. @@ -833,8 +839,8 @@ where
Normative Type NTNameValue
ev4:nt/NTNameValue:1.0 - string[] names // mandatory - double[] values // mandatory, can be any type, must be same length as names + string[] name // mandatory + double[] value // madatory, can be any type, must be same length as name string descriptor // optional alarm_t alarm // optional int severity @@ -896,7 +902,7 @@ whereNTNameValue
class NTNameValue; -typedef std::tr1::shared_ptrNTNameValuePtr; +typedef std::tr1::shared_ptr<NTNameValue> NTNameValuePtr; class NTNameValue { @@ -911,11 +917,12 @@ public: bool attachTimeStamp(PVTimeStamp &pvTimeStamp) const; bool attachAlarm(PVAlarm &pvAlarm) const; + PVStringPtr getDescriptor() const; PVStructurePtr getPVStructure() const; PVStructurePtr getTimeStamp() const; PVStructurePtr getAlarm() const; - PVStringArrayPtr getNames() const; - PVFieldPtr getValues() const; + PVStringArrayPtr getName() const; + PVFieldPtr getValue() const; template<typename PVT> std::tr1::shared_ptr<PV> getValue() const private: @@ -926,7 +933,7 @@ where - wrap
- Given a pvStructure this creates an NTNameValue that warps it. It calls isCompatible returns a null NTNameValue if isCompatible returns false. -
- +
- wrapUnsafe
- Given a pvStructure this creates an NTNameValue that warps it. It does not check that the introspection interface is compatible. @@ -963,10 +970,10 @@ where If the alarm was not selected as an optional field a null pvStructure is returned.
-- getNames
-- Returns field names.
-- getValues
-- Returns field values.
+- getName
+- Returns field name.
+- getValue
+- Returns field value.
class NTTable; -typedef std::tr1::shared_ptrNTTablePtr; +typedef std::tr1::shared_ptr<NTTable> NTTablePtr; class NTTable { @@ -1066,7 +1073,7 @@ where wrap Given a pvStructure this creates an NTTable that warps it. It calls isCompatible returns a null NTTable if isCompatible returns false. - + wrapUnsafe Given a pvStructure this creates an NTTable that warps it. It does not check that the introspection interface is compatible. @@ -1189,7 +1196,7 @@ where NTMultiChannel
class NTMultiChannel; -typedef std::tr1::shared_ptr@@ -1227,7 +1232,7 @@ whereNTMultiChannelPtr; +typedef std::tr1::shared_ptr<NTMultiChannel> NTMultiChannelPtr; class NTMultiChannel { @@ -1204,6 +1211,7 @@ public: bool attachTimeStamp(PVTimeStamp &pvTimeStamp) const; bool attachAlarm(PVAlarm &pvAlarm) const; + PVStringPtr getDescriptor() const; PVStructurePtr getPVStructure() const; PVStructurePtr getTimeStamp() const; PVStructurePtr getAlarm() const; @@ -1216,9 +1224,6 @@ public: PVLongArrayPtr getSecondsPastEpoch() const; PVIntArrayPtr getNanoseconds() const; PVIntArrayPtr getUserTag() const; - PVStringPtr getDescriptor() const; - template<typename PVT> - std::tr1::shared_ptr<PV> getValue() const private: } wrap Given a pvStructure this creates an NTMultiChannel that warps it. It calls isCompatible returns a null NTMultiChannel if isCompatible returns false. - + wrapUnsafe Given a pvStructure this creates an NTMultiChannel that warps it. It does not check that the introspection interface is compatible. @@ -1288,11 +1293,11 @@ where -ev4:nt/NTNDArray:1.0 union value //mandatory - long compressedSize //mandatory - long uncompressedSize //mandatory codec_t codec //mandatory string name any parameters + long compressedSize //mandatory + long uncompressedSize //mandatory dimension_t[] dimension //mandatory dimension_t[] dimension_t @@ -1377,7 +1382,7 @@ whereNTNDArray
class NTNDArray; -typedef std::tr1::shared_ptrNTNDArrayPtr; +typedef std::tr1::shared_ptr<NTNDArray> NTNDArrayPtr; class NTNDArray { @@ -1390,20 +1395,21 @@ public: static bool isComparible(PVStructurePtr const &pvStructure); static NTNDArrayBuilderPtr createBuilder(); + PVStringPtr getDescriptor() const; bool attachTimeStamp(PVTimeStamp &pvTimeStamp) const; bool attachDataTimeStamp(PVTimeStamp &pvTimeStamp) const; bool attachAlarm(PVAlarm &pvAlarm) const; PVStructurePtr getPVStructure() const; PVUnionPtr getValue() const; + PVStructurePtr getCodec() const; PVLongPtr getCompressedDataSize() const; PVLongPtr getUncompressedDataSize() const; - PVStructurePtr getCodec() const; PVStructureArrayPtr getAttribute() const; PVStructureArrayPtr getDimension() const; PVIntPtr getUniqueId() const; - PVStructurePtr getTimeStamp() const; PVStructurePtr getDataTimeStamp() const; PVStringPtr getDescriptor() const; + PVStructurePtr getTimeStamp() const; PVStructurePtr getAlarm() const; PVStructurePtr getDisplay() const; private: @@ -1414,7 +1420,7 @@ where wrap Given a pvStructure this creates an NTNDArray that warps it. It calls isCompatible returns a null NTNDArray if isCompatible returns false. - + wrapUnsafe Given a pvStructure this creates an NTNDArray that warps it. It does not check that the introspection interface is compatible. @@ -1442,6 +1448,23 @@ where getPVStructure Returns the pvStructure that NTNDArray wraps. +getValue +Returns the value field. +getCodec +Returns the severity of each channel. +getCompressedDataSize +Returns the name of each channel. +getUncompressedDataSize +Returns connection state of each channel. +getAttribute +Returns the status of each channel. +getDimension +Returns the message of each channel. +getUniqueId +Returns the secondsPastEpoch of each channel. +getDataTimeStamp +Returns the data timeStamp. + getDescriptor Get the descriptor. getTimeStamp @@ -1459,20 +1482,6 @@ where If the display was not selected as an optional field a null pvStructure is returned.getValue -Returns the value field. -getCompressedDataSize -Returns the name of each channel. -getUncompressedDataSize -Returns connection state of each channel. -getCodec -Returns the severity of each channel. -getAttribute -Returns the status of each channel. -getDimension -Returns the message of each channel. -getUniqueId -Returns the secondsPastEpoch of each channel. From 70b30ade1a767007c2dd7e7272f504a4d72d619d Mon Sep 17 00:00:00 2001 From: Marty KraimerDate: Wed, 15 Oct 2014 14:59:37 -0400 Subject: [PATCH 5/8] Added tag 4.0.0 for changeset df4c65e13c2c --- .hgtags | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.hgtags b/.hgtags index 2fa57a6..70a744d 100644 --- a/.hgtags +++ b/.hgtags @@ -1,2 +1,4 @@ b9a943e6828731a8a89e811818b2d91faff69d86 1.0-BETA aaa5f5840b7eea8afaafb4d13a49bf78975aac0f 4.0.0 +aaa5f5840b7eea8afaafb4d13a49bf78975aac0f 4.0.0 +df4c65e13c2cfaa92e42f84a7afc97c81b5f3888 4.0.0 From 3c5e4a1db5853e30f6ef5ec089913e7f9595dec0 Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Tue, 28 Oct 2014 20:18:08 +0100 Subject: [PATCH 6/8] URI: ev4 to epics --- documentation/ntCPP.html | 16 ++++++++-------- src/nt/ntmultiChannel.cpp | 2 +- src/nt/ntnameValue.cpp | 2 +- src/nt/ntndarray.cpp | 6 +++--- src/nt/ntscalar.cpp | 2 +- src/nt/ntscalarArray.cpp | 2 +- src/nt/nttable.cpp | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/documentation/ntCPP.html b/documentation/ntCPP.html index d214380..7722c64 100644 --- a/documentation/ntCPP.html +++ b/documentation/ntCPP.html @@ -422,7 +422,7 @@ This has methods to do the following: Normative Type NTScalar
This has the following fields:
-ev4:nt/NTScalar:1.0 +epics:nt/NTScalar:1.0 double value // mandatory and can be any numeric type string descriptor // optional alarm_t alarm // optional @@ -666,7 +666,7 @@ string message = alarm.getMessage(); field is a scalar array field instead of just a scalar.This has the following fields:
-ev4:nt/NTScalarArray:1.0 +epics:nt/NTScalarArray:1.0 double[] value // mandatory and can be any numeric type string descriptor // optional alarm_t alarm // optional @@ -838,7 +838,7 @@ whereNormative Type NTNameValue
-ev4:nt/NTNameValue:1.0 +epics:nt/NTNameValue:1.0 string[] name // mandatory double[] value // madatory, can be any type, must be same length as name string descriptor // optional @@ -978,7 +978,7 @@ whereNormative Type NTTable
-ev4:nt/NTTable:1.0 +epics:nt/NTTable:1.0 string[] labels [column0,column1,column2] // mandatory structure value // mandatory; double[] column0 [] // name=labels[0]; can be any scalar type @@ -1291,7 +1291,7 @@ whereNormative Type NTNDArray
-ev4:nt/NTNDArray:1.0 +epics:nt/NTNDArray:1.0 union value //mandatory codec_t codec //mandatory string name @@ -1311,9 +1311,9 @@ ev4:nt/NTNDArray:1.0 long secondsPastEpoch int nanoseconds int userTag - ev4:nt/NTAttribute:1.0[] attribute //mandatory - ev4:nt/NTAttribute:1.0[] - ev4:nt/NTAttribute:1.0 + epics:nt/NTAttribute:1.0[] attribute //mandatory + epics:nt/NTAttribute:1.0[] + epics:nt/NTAttribute:1.0 string name any value string description diff --git a/src/nt/ntmultiChannel.cpp b/src/nt/ntmultiChannel.cpp index f9c6124..0fc53e2 100644 --- a/src/nt/ntmultiChannel.cpp +++ b/src/nt/ntmultiChannel.cpp @@ -195,7 +195,7 @@ NTMultiChannelBuilder::shared_pointer NTMultiChannelBuilder::add(string const & } -const std::string NTMultiChannel::URI("ev4:nt/NTMultiChannel:1.0"); +const std::string NTMultiChannel::URI("epics:nt/NTMultiChannel:1.0"); NTMultiChannel::shared_pointer NTMultiChannel::wrap(PVStructurePtr const & structure) { diff --git a/src/nt/ntnameValue.cpp b/src/nt/ntnameValue.cpp index b1dd26a..e80b558 100644 --- a/src/nt/ntnameValue.cpp +++ b/src/nt/ntnameValue.cpp @@ -108,7 +108,7 @@ NTNameValueBuilder::shared_pointer NTNameValueBuilder::add(string const & name, } -const std::string NTNameValue::URI("ev4:nt/NTNameValue:1.0"); +const std::string NTNameValue::URI("epics:nt/NTNameValue:1.0"); NTNameValue::shared_pointer NTNameValue::wrap(PVStructurePtr const & structure) { diff --git a/src/nt/ntndarray.cpp b/src/nt/ntndarray.cpp index 1635dc5..85bbeb6 100644 --- a/src/nt/ntndarray.cpp +++ b/src/nt/ntndarray.cpp @@ -18,7 +18,7 @@ static NTFieldPtr ntField = NTField::get(); namespace detail { -const std::string ntAttrStr("ev4:nt/NTAttribute:1.0"); +const std::string ntAttrStr("epics:nt/NTAttribute:1.0"); static FieldCreatePtr fieldCreate = getFieldCreate(); static PVDataCreatePtr pvDataCreate = getPVDataCreate(); @@ -198,8 +198,8 @@ NTNDArrayBuilder::shared_pointer NTNDArrayBuilder::add(string const & name, Fiel } -const std::string NTNDArray::URI("ev4:nt/NTNDArray:1.0"); -const std::string ntAttrStr("ev4:nt/NTAttribute:1.0"); +const std::string NTNDArray::URI("epics:nt/NTNDArray:1.0"); +const std::string ntAttrStr("epics:nt/NTAttribute:1.0"); static FieldCreatePtr fieldCreate = getFieldCreate(); static PVDataCreatePtr pvDataCreate = getPVDataCreate(); diff --git a/src/nt/ntscalar.cpp b/src/nt/ntscalar.cpp index 3b3c660..e28b729 100644 --- a/src/nt/ntscalar.cpp +++ b/src/nt/ntscalar.cpp @@ -128,7 +128,7 @@ NTScalarBuilder::shared_pointer NTScalarBuilder::add(string const & name, FieldC } -const std::string NTScalar::URI("ev4:nt/NTScalar:1.0"); +const std::string NTScalar::URI("epics:nt/NTScalar:1.0"); NTScalar::shared_pointer NTScalar::wrap(PVStructurePtr const & structure) { diff --git a/src/nt/ntscalarArray.cpp b/src/nt/ntscalarArray.cpp index 511c2b0..6e6addf 100644 --- a/src/nt/ntscalarArray.cpp +++ b/src/nt/ntscalarArray.cpp @@ -125,7 +125,7 @@ NTScalarArrayBuilder::shared_pointer NTScalarArrayBuilder::add(string const & na } -const std::string NTScalarArray::URI("ev4:nt/NTScalarArray:1.0"); +const std::string NTScalarArray::URI("epics:nt/NTScalarArray:1.0"); NTScalarArray::shared_pointer NTScalarArray::wrap(PVStructurePtr const & structure) { diff --git a/src/nt/nttable.cpp b/src/nt/nttable.cpp index 207f462..dc96906 100644 --- a/src/nt/nttable.cpp +++ b/src/nt/nttable.cpp @@ -123,7 +123,7 @@ NTTableBuilder::shared_pointer NTTableBuilder::add(string const & name, FieldCon } -const std::string NTTable::URI("ev4:nt/NTTable:1.0"); +const std::string NTTable::URI("epics:nt/NTTable:1.0"); NTTable::shared_pointer NTTable::wrap(PVStructurePtr const & structure) { From 95e9b394c45f5756e89e496ae0d724c9ad04cfa3 Mon Sep 17 00:00:00 2001 From: Matej SekoranjaDate: Wed, 29 Oct 2014 13:25:33 +0100 Subject: [PATCH 7/8] fixed NTNDArray::isCompatible --- src/nt/ntndarray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nt/ntndarray.cpp b/src/nt/ntndarray.cpp index 85bbeb6..14b5016 100644 --- a/src/nt/ntndarray.cpp +++ b/src/nt/ntndarray.cpp @@ -245,7 +245,7 @@ bool NTNDArray::isCompatible(PVStructurePtr const & pvStructure) pvField = pvStructure->getSubField("dataTimeStamp"); if(pvField && !ntField->isTimeStamp(pvField->getField())) return false; PVStructureArrayPtr pvAttribute = pvStructure->getSubField ("attribute"); - if(!pvAttribute->getStructureArray()->getStructure()->getID().compare("ntAttrStr")!=0) return false; + if(pvAttribute->getStructureArray()->getStructure()->getID().compare(ntAttrStr)!=0) return false; return true; } From 1fca4d57578759b7c0c5d6796a41a3ea550dc850 Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Wed, 29 Oct 2014 13:26:06 +0100 Subject: [PATCH 8/8] Added tag 4.0.0 for changeset ec29bda853f5 --- .hgtags | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.hgtags b/.hgtags index 70a744d..1cf7e51 100644 --- a/.hgtags +++ b/.hgtags @@ -2,3 +2,5 @@ b9a943e6828731a8a89e811818b2d91faff69d86 1.0-BETA aaa5f5840b7eea8afaafb4d13a49bf78975aac0f 4.0.0 aaa5f5840b7eea8afaafb4d13a49bf78975aac0f 4.0.0 df4c65e13c2cfaa92e42f84a7afc97c81b5f3888 4.0.0 +df4c65e13c2cfaa92e42f84a7afc97c81b5f3888 4.0.0 +ec29bda853f50fa501cbcf3ffd836a1ef2adcdd4 4.0.0