diff --git a/src/copy/pvCopy.cpp b/src/copy/pvCopy.cpp index 15502b5..a80b6e4 100644 --- a/src/copy/pvCopy.cpp +++ b/src/copy/pvCopy.cpp @@ -78,11 +78,11 @@ PVCopyPtr PVCopy::create( PVStructurePtr pvStructure(pvRequest); if(structureName.size()>0) { if(pvRequest->getStructure()->getNumberFields()>0) { - pvStructure = pvRequest->getStructureField(structureName); + pvStructure = pvRequest->getSubField(structureName); if(!pvStructure) return NULLPVCopy; } } else if(pvStructure->getSubField("field")) { - pvStructure = pvRequest->getStructureField("field"); + pvStructure = pvRequest->getSubField("field"); } PVCopyPtr pvCopy = PVCopyPtr(new PVCopy(pvMaster)); bool result = pvCopy->init(pvStructure); @@ -349,7 +349,7 @@ bool PVCopy::init(epics::pvData::PVStructurePtr const &pvRequest) if(len==0) entireMaster = true; PVStructurePtr pvOptions; if(len==1 && pvRequest->getSubField("_options")) { - pvOptions = pvRequest->getStructureField("_options"); + pvOptions = pvRequest->getSubField("_options"); } if(entireMaster) { structure = pvMasterStructure->getStructure(); diff --git a/src/property/pvAlarm.cpp b/src/property/pvAlarm.cpp index 7d66c58..5ff676e 100644 --- a/src/property/pvAlarm.cpp +++ b/src/property/pvAlarm.cpp @@ -28,14 +28,14 @@ bool PVAlarm::attach(PVFieldPtr const & pvField) { if(pvField->getField()->getType()!=structure) return false; PVStructurePtr pvStructure = static_pointer_cast(pvField); - pvSeverity = pvStructure->getIntField("severity"); + pvSeverity = pvStructure->getSubField("severity"); if(pvSeverity.get()==NULL) return false; - pvStatus = pvStructure->getIntField("status"); + pvStatus = pvStructure->getSubField("status"); if(pvStatus.get()==NULL) { pvSeverity.reset(); return false; } - pvMessage = pvStructure->getStringField("message"); + pvMessage = pvStructure->getSubField("message"); if(pvMessage.get()==NULL) { pvSeverity.reset(); pvStatus.reset(); diff --git a/src/property/pvControl.cpp b/src/property/pvControl.cpp index 9de5195..6fe0c03 100644 --- a/src/property/pvControl.cpp +++ b/src/property/pvControl.cpp @@ -28,14 +28,14 @@ bool PVControl::attach(PVFieldPtr const & pvField) { if(pvField->getField()->getType()!=structure) return false; PVStructurePtr pvStructure = static_pointer_cast(pvField); - pvLow = pvStructure->getDoubleField("limitLow"); + pvLow = pvStructure->getSubField("limitLow"); if(pvLow.get()==NULL) return false; - pvHigh = pvStructure->getDoubleField("limitHigh"); + pvHigh = pvStructure->getSubField("limitHigh"); if(pvHigh.get()==NULL) { pvLow.reset(); return false; } - pvMinStep = pvStructure->getDoubleField("minStep"); + pvMinStep = pvStructure->getSubField("minStep"); if(pvMinStep.get()==NULL) { pvLow.reset(); pvHigh.reset(); diff --git a/src/property/pvDisplay.cpp b/src/property/pvDisplay.cpp index 27daa09..796fdbd 100644 --- a/src/property/pvDisplay.cpp +++ b/src/property/pvDisplay.cpp @@ -28,24 +28,24 @@ bool PVDisplay::attach(PVFieldPtr const & pvField) { if(pvField->getField()->getType()!=structure) return false; PVStructurePtr pvStructure = static_pointer_cast(pvField); - pvDescription = pvStructure->getStringField("description"); + pvDescription = pvStructure->getSubField("description"); if(pvDescription.get()==NULL) return false; - pvFormat = pvStructure->getStringField("format"); + pvFormat = pvStructure->getSubField("format"); if(pvFormat.get()==NULL) { detach(); return false; } - pvUnits = pvStructure->getStringField("units"); + pvUnits = pvStructure->getSubField("units"); if(pvUnits.get()==NULL) { detach(); return false; } - pvLow = pvStructure->getDoubleField(string("limitLow")); + pvLow = pvStructure->getSubField(string("limitLow")); if(pvLow.get()==NULL) { detach(); return false; } - pvHigh = pvStructure->getDoubleField(string("limitHigh")); + pvHigh = pvStructure->getSubField(string("limitHigh")); if(pvHigh.get()==NULL) { detach(); return false; diff --git a/src/property/pvEnumerated.cpp b/src/property/pvEnumerated.cpp index 0ccee32..d94ca43 100644 --- a/src/property/pvEnumerated.cpp +++ b/src/property/pvEnumerated.cpp @@ -28,7 +28,7 @@ bool PVEnumerated::attach(PVFieldPtr const & pvField) { if(pvField->getField()->getType()!=structure) return false; PVStructurePtr pvStructure = static_pointer_cast(pvField); - pvIndex = pvStructure->getIntField("index"); + pvIndex = pvStructure->getSubField("index"); if(pvIndex.get()==NULL) return false; PVScalarArrayPtr pvScalarArray = pvStructure->getScalarArrayField( "choices",pvString); diff --git a/src/property/pvTimeStamp.cpp b/src/property/pvTimeStamp.cpp index 37197ff..2524b9c 100644 --- a/src/property/pvTimeStamp.cpp +++ b/src/property/pvTimeStamp.cpp @@ -30,11 +30,11 @@ bool PVTimeStamp::attach(PVFieldPtr const & pvField) PVStructurePtr xxx = static_pointer_cast(pvField); PVStructure* pvStructure = xxx.get(); while(true) { - PVLongPtr pvLong = pvStructure->getLongField("secondsPastEpoch"); + PVLongPtr pvLong = pvStructure->getSubField("secondsPastEpoch"); if(pvLong.get()!=NULL) { pvSecs = pvLong; - pvNano = pvStructure->getIntField("nanoseconds"); - pvUserTag = pvStructure->getIntField("userTag"); + pvNano = pvStructure->getSubField("nanoseconds"); + pvUserTag = pvStructure->getSubField("userTag"); } if(pvSecs.get()!=NULL && pvNano.get()!=NULL diff --git a/src/pv/pvData.h b/src/pv/pvData.h index 575019a..32e4127 100644 --- a/src/pv/pvData.h +++ b/src/pv/pvData.h @@ -33,6 +33,14 @@ typedef class std::ios std::ios_base; #endif +#if defined(__GNUC__) && !(defined(__vxworks) && !defined(_WRS_VXWORKS_MAJOR)) +#define USAGE_DEPRECATED __attribute__((deprecated)) +#define USAGE_ERROR(MSG) __attribute__((error(MSG))) +#else +#define USAGE_DEPRECATED +#define USAGE_ERROR(MSG) { throw std::runtime_error(MSG); } +#endif + namespace epics { namespace pvData { class PostHandler; @@ -709,84 +717,84 @@ public: * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVBooleanPtr getBooleanField(std::string const &fieldName) ; + PVBooleanPtr getBooleanField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a byte field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVBytePtr getByteField(std::string const &fieldName) ; + PVBytePtr getByteField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a short field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVShortPtr getShortField(std::string const &fieldName) ; + PVShortPtr getShortField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a int field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVIntPtr getIntField(std::string const &fieldName) ; + PVIntPtr getIntField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a long field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVLongPtr getLongField(std::string const &fieldName) ; + PVLongPtr getLongField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get an unsigned byte field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVUBytePtr getUByteField(std::string const &fieldName) ; + PVUBytePtr getUByteField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get an unsigned short field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVUShortPtr getUShortField(std::string const &fieldName) ; + PVUShortPtr getUShortField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get an unsigned int field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVUIntPtr getUIntField(std::string const &fieldName) ; + PVUIntPtr getUIntField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get an unsigned long field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVULongPtr getULongField(std::string const &fieldName) ; + PVULongPtr getULongField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a float field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVFloatPtr getFloatField(std::string const &fieldName) ; + PVFloatPtr getFloatField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a double field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVDoublePtr getDoubleField(std::string const &fieldName) ; + PVDoublePtr getDoubleField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a string field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVStringPtr getStringField(std::string const &fieldName) ; + PVStringPtr getStringField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a structure field with the specified name. @@ -794,14 +802,14 @@ public: * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVStructurePtr getStructureField(std::string const &fieldName) ; + PVStructurePtr getStructureField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a union field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVUnionPtr getUnionField(std::string const &fieldName) ; + PVUnionPtr getUnionField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a scalarArray field with the specified name. * @deprecated No longer needed. Use templete version of getSubField @@ -810,21 +818,21 @@ public: * @return Pointer to the field of null if a field with that name and type does not exist. */ PVScalarArrayPtr getScalarArrayField( - std::string const &fieldName,ScalarType elementType) ; + std::string const &fieldName,ScalarType elementType); /** * Get a structureArray field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVStructureArrayPtr getStructureArrayField(std::string const &fieldName) ; + PVStructureArrayPtr getStructureArrayField(std::string const &fieldName) USAGE_DEPRECATED; /** * Get a unionArray field with the specified name. * @deprecated No longer needed. Use templete version of getSubField * @param fieldName The name of the field to get. * @return Pointer to the field of null if a field with that name and type does not exist. */ - PVUnionArrayPtr getUnionArrayField(std::string const &fieldName) ; + PVUnionArrayPtr getUnionArrayField(std::string const &fieldName) USAGE_DEPRECATED; /** * Serialize. * @param pbuffer The byte buffer. @@ -1621,6 +1629,9 @@ namespace std{ epicsShareExtern std::ostream& operator<<(std::ostream& o, const epics::pvData::PVField *ptr); } +#undef USAGE_DEPRECATED +#undef USAGE_ERROR + #endif /* PVDATA_H */ /** @page Overview Documentation diff --git a/testApp/misc/testOverrunBitSet.cpp b/testApp/misc/testOverrunBitSet.cpp index 0c0d560..b6316a9 100644 --- a/testApp/misc/testOverrunBitSet.cpp +++ b/testApp/misc/testOverrunBitSet.cpp @@ -32,17 +32,17 @@ void test() string buffer; string properties("alarm,timeStamp,display"); PVStructurePtr pvStructure = standardPVField->scalar(pvDouble,properties); - PVDoublePtr pvValue = pvStructure->getDoubleField("value"); + PVDoublePtr pvValue = pvStructure->getSubField("value"); uint32 valueOffset = (uint32) pvValue->getFieldOffset(); - PVStructurePtr pvAlarm = pvStructure->getStructureField("alarm"); - PVIntPtr pvSeverity = pvAlarm->getIntField("severity"); - PVStringPtr pvMessage = pvAlarm->getStringField("message"); + PVStructurePtr pvAlarm = pvStructure->getSubField("alarm"); + PVIntPtr pvSeverity = pvAlarm->getSubField("severity"); + PVStringPtr pvMessage = pvAlarm->getSubField("message"); uint32 severityOffset = (uint32) pvSeverity->getFieldOffset(); uint32 messageOffset = (uint32) pvMessage->getFieldOffset(); - PVStructurePtr pvTimeStamp = pvStructure->getStructureField("timeStamp"); - PVLongPtr pvSeconds = pvTimeStamp->getLongField("secondsPastEpoch"); - PVIntPtr pvNanoseconds = pvTimeStamp->getIntField("nanoseconds"); - PVIntPtr pvUserTag = pvTimeStamp->getIntField("userTag"); + PVStructurePtr pvTimeStamp = pvStructure->getSubField("timeStamp"); + PVLongPtr pvSeconds = pvTimeStamp->getSubField("secondsPastEpoch"); + PVIntPtr pvNanoseconds = pvTimeStamp->getSubField("nanoseconds"); + PVIntPtr pvUserTag = pvTimeStamp->getSubField("userTag"); uint32 timeStampOffset = (uint32) pvTimeStamp->getFieldOffset(); uint32 secondsOffset = (uint32) pvSeconds->getFieldOffset(); uint32 nanosecondsOffset = (uint32) pvNanoseconds->getFieldOffset(); diff --git a/testApp/misc/testSerialization.cpp b/testApp/misc/testSerialization.cpp index 8e619aa..f00ded3 100644 --- a/testApp/misc/testSerialization.cpp +++ b/testApp/misc/testSerialization.cpp @@ -385,9 +385,9 @@ void testStructure() { testDiag("\tSimple structure serialization"); PVStructurePtr pvStructure = factory->createPVStructure(getStandardField()->timeStamp()); - pvStructure->getLongField("secondsPastEpoch")->put(123); - pvStructure->getIntField("nanoseconds")->put(456); - pvStructure->getIntField("userTag")->put(789); + pvStructure->getSubField("secondsPastEpoch")->put(123); + pvStructure->getSubField("nanoseconds")->put(456); + pvStructure->getSubField("userTag")->put(789); serializationTest(pvStructure); diff --git a/testApp/pv/testOperators.cpp b/testApp/pv/testOperators.cpp index 4660fd6..eb95be7 100644 --- a/testApp/pv/testOperators.cpp +++ b/testApp/pv/testOperators.cpp @@ -31,7 +31,7 @@ MAIN(testOperators) const double testDV = 12.8; - PVDoublePtr pvValue = pvStructure->getDoubleField("value"); + PVDoublePtr pvValue = pvStructure->getSubField("value"); *pvValue <<= testDV; double dv; @@ -41,7 +41,7 @@ MAIN(testOperators) const string testSV = "test message"; - PVStringPtr pvMessage = pvStructure->getStringField("alarm.message"); + PVStringPtr pvMessage = pvStructure->getSubField("alarm.message"); *pvMessage <<= testSV; string sv; @@ -90,7 +90,7 @@ MAIN(testOperators) pvStructures[i]= pvDataCreate->createPVStructure(structure); } - PVStructureArrayPtr pvStructureArray = pvStructure->getStructureArrayField("value"); + PVStructureArrayPtr pvStructureArray = pvStructure->getSubField("value"); pvStructureArray->replace(freeze(pvStructures)); std::cout << *pvStructure << std::endl; diff --git a/testApp/pv/testPVData.cpp b/testApp/pv/testPVData.cpp index ed1f024..acbf958 100644 --- a/testApp/pv/testPVData.cpp +++ b/testApp/pv/testPVData.cpp @@ -89,7 +89,7 @@ static void testPVScalarWithProperties( pvStructure = standardPVField->scalar( stype,alarmTimeStampValueAlarm); hasBooleanAlarm = true; - PVBooleanPtr pvField = pvStructure->getBooleanField("value"); + PVBooleanPtr pvField = pvStructure->getSubField("value"); pvField->put(true); break; } @@ -98,7 +98,7 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVBytePtr pvField = pvStructure->getByteField("value"); + PVBytePtr pvField = pvStructure->getSubField("value"); pvField->put(127); break; } @@ -107,7 +107,7 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVShortPtr pvField = pvStructure->getShortField("value"); + PVShortPtr pvField = pvStructure->getSubField("value"); pvField->put(32767); break; } @@ -116,7 +116,7 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVIntPtr pvField = pvStructure->getIntField("value"); + PVIntPtr pvField = pvStructure->getSubField("value"); pvField->put((int32)0x80000000); break; } @@ -125,7 +125,7 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVLongPtr pvField = pvStructure->getLongField("value"); + PVLongPtr pvField = pvStructure->getSubField("value"); int64 value = 0x80000000; value <<= 32; value |= 0xffffffff; @@ -137,7 +137,7 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVUBytePtr pvField = pvStructure->getUByteField("value"); + PVUBytePtr pvField = pvStructure->getSubField("value"); pvField->put(255); break; } @@ -146,7 +146,7 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVUShortPtr pvField = pvStructure->getUShortField("value"); + PVUShortPtr pvField = pvStructure->getSubField("value"); pvField->put(65535); break; } @@ -155,7 +155,7 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVUIntPtr pvField = pvStructure->getUIntField("value"); + PVUIntPtr pvField = pvStructure->getSubField("value"); pvField->put((uint32)0x80000000); break; } @@ -164,7 +164,7 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVULongPtr pvField = pvStructure->getULongField("value"); + PVULongPtr pvField = pvStructure->getSubField("value"); int64 value = 0x80000000; value <<= 32; value |= 0xffffffff; @@ -176,7 +176,7 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVFloatPtr pvField = pvStructure->getFloatField("value"); + PVFloatPtr pvField = pvStructure->getSubField("value"); pvField->put(1.123e8); break; } @@ -185,57 +185,57 @@ static void testPVScalarWithProperties( stype,allProperties); hasValueAlarm = true; hasDisplayControl = true; - PVDoublePtr pvField = pvStructure->getDoubleField("value"); + PVDoublePtr pvField = pvStructure->getSubField("value"); pvField->put(1.123e35); break; } case pvString: { pvStructure = standardPVField->scalar( stype,alarmTimeStamp); - PVStringPtr pvField = pvStructure->getStringField("value"); + PVStringPtr pvField = pvStructure->getSubField("value"); pvField->put(string("this is a string")); break; } } - PVLongPtr seconds = pvStructure->getLongField( + PVLongPtr seconds = pvStructure->getSubField( string("timeStamp.secondsPastEpoch")); testOk1(seconds.get()!=0); seconds->put(123456789); - PVIntPtr nano = pvStructure->getIntField(string("timeStamp.nanoseconds")); + PVIntPtr nano = pvStructure->getSubField(string("timeStamp.nanoseconds")); testOk1(nano.get()!=0); nano->put(1000000); - PVIntPtr severity = pvStructure->getIntField(string("alarm.severity")); + PVIntPtr severity = pvStructure->getSubField(string("alarm.severity")); testOk1(severity.get()!=0); severity->put(2); - PVStringPtr message = pvStructure->getStringField(string("alarm.message")); + PVStringPtr message = pvStructure->getSubField(string("alarm.message")); testOk1(message.get()!=0); message->put(string("messageForAlarm")); if(hasDisplayControl) { - PVStringPtr desc = pvStructure->getStringField( + PVStringPtr desc = pvStructure->getSubField( string("display.description")); testOk1(desc.get()!=0); desc->put(string("this is a description")); - PVStringPtr format = pvStructure->getStringField( + PVStringPtr format = pvStructure->getSubField( string("display.format")); testOk1(format.get()!=0); format->put(string("f10.2")); - PVStringPtr units = pvStructure->getStringField( + PVStringPtr units = pvStructure->getSubField( string("display.units")); testOk1(units.get()!=0); units->put(string("SomeUnits")); - PVDoublePtr limit = pvStructure->getDoubleField( + PVDoublePtr limit = pvStructure->getSubField( string("display.limitLow")); testOk1(limit.get()!=0); limit->put(0.0); - limit = pvStructure->getDoubleField( + limit = pvStructure->getSubField( string("display.limitHigh")); testOk1(limit.get()!=0); limit->put(10.0); - limit = pvStructure->getDoubleField( + limit = pvStructure->getSubField( string("control.limitLow")); testOk1(limit.get()!=0); limit->put(1.0); - limit = pvStructure->getDoubleField( + limit = pvStructure->getSubField( string("control.limitHigh")); testOk1(limit.get()!=0); limit->put(9.0); @@ -255,15 +255,15 @@ static void testPVScalarWithProperties( pvtemp = static_pointer_cast(pvField); testOk1(pvtemp.get()!=0); convert->fromDouble(pvtemp,9.0); - severity = pvStructure->getIntField( + severity = pvStructure->getSubField( string("valueAlarm.lowAlarmSeverity")); testOk1(severity.get()!=0); severity->put(2); - severity = pvStructure->getIntField( + severity = pvStructure->getSubField( string("valueAlarm.highAlarmSeverity")); testOk1(severity.get()!=0); severity->put(2); - PVBooleanPtr active = pvStructure->getBooleanField( + PVBooleanPtr active = pvStructure->getSubField( string("valueAlarm.active")); testOk1(active.get()!=0); active->put(true); @@ -273,15 +273,15 @@ static void testPVScalarWithProperties( string("valueAlarm.active")); PVBooleanPtr pvBoolean = static_pointer_cast(pvField); pvBoolean->put(true); - severity = pvStructure->getIntField( + severity = pvStructure->getSubField( string("valueAlarm.falseSeverity")); testOk1(severity.get()!=0); severity->put(0); - severity = pvStructure->getIntField( + severity = pvStructure->getSubField( string("valueAlarm.trueSeverity")); testOk1(severity.get()!=0); severity->put(2); - severity = pvStructure->getIntField( + severity = pvStructure->getSubField( string("valueAlarm.changeStateSeverity")); testOk1(severity.get()!=0); severity->put(1); diff --git a/testApp/pv/testStandardPVField.cpp b/testApp/pv/testStandardPVField.cpp index 28efc6d..de05b5e 100644 --- a/testApp/pv/testStandardPVField.cpp +++ b/testApp/pv/testStandardPVField.cpp @@ -45,11 +45,11 @@ MAIN(testStandardPVField) testPlan(1); PVStructurePtr pvStructure = standardPVField->scalar(pvDouble, "alarm,timeStamp,display,control,valueAlarm"); - PVDoublePtr pvValue = pvStructure->getDoubleField("value"); + PVDoublePtr pvValue = pvStructure->getSubField("value"); pvValue->put(10.0); - PVIntPtr pvSeverity = pvStructure->getIntField("alarm.severity"); + PVIntPtr pvSeverity = pvStructure->getSubField("alarm.severity"); pvSeverity->put(2); - PVStringPtr pvMessage = pvStructure->getStringField("alarm.message"); + PVStringPtr pvMessage = pvStructure->getSubField("alarm.message"); pvMessage->put("test message"); print("scalarTest", pvStructure); pvStructure = standardPVField->scalar(pvBoolean,"alarm,timeStamp,valueAlarm"); @@ -71,7 +71,7 @@ MAIN(testStandardPVField) pvStructures[i]= pvDataCreate->createPVStructure(structure); } - PVStructureArrayPtr pvStructureArray = pvStructure->getStructureArrayField("value"); + PVStructureArrayPtr pvStructureArray = pvStructure->getSubField("value"); pvStructureArray->replace(freeze(pvStructures)); print("structureArrayTest", pvStructure); testPass("testStandardPVField");