NTField::createAlarmLimit removed; NTNameValue names,values changed to name,value
This commit is contained in:
+8
-11
@@ -154,15 +154,23 @@ bool NTField::isAlarmLimit(FieldConstPtr const & field)
|
||||
f = fields[1];
|
||||
if(names[1].compare("lowAlarmLimit")!=0) return false;
|
||||
if(f->getType()!=scalar) return false;
|
||||
s = static_pointer_cast<const Scalar>(f);
|
||||
if(s->getScalarType()!=pvDouble) return false;
|
||||
f = fields[2];
|
||||
if(names[2].compare("lowWarningLimit")!=0) return false;
|
||||
if(f->getType()!=scalar) return false;
|
||||
s = static_pointer_cast<const Scalar>(f);
|
||||
if(s->getScalarType()!=pvDouble) return false;
|
||||
f = fields[3];
|
||||
if(names[3].compare("highWarningLimit")!=0) return false;
|
||||
if(f->getType()!=scalar) return false;
|
||||
s = static_pointer_cast<const Scalar>(f);
|
||||
if(s->getScalarType()!=pvDouble) return false;
|
||||
f = fields[4];
|
||||
if(names[4].compare("highAlarmLimit")!=0) return false;
|
||||
if(f->getType()!=scalar) return false;
|
||||
s = static_pointer_cast<const Scalar>(f);
|
||||
if(s->getScalarType()!=pvDouble) return false;
|
||||
f = fields[5];
|
||||
if(names[5].compare("lowAlarmSeverity")!=0) return false;
|
||||
if(f->getType()!=scalar) return false;
|
||||
@@ -235,11 +243,6 @@ StructureConstPtr NTField::createDisplay()
|
||||
return standardField->display();
|
||||
}
|
||||
|
||||
StructureConstPtr NTField::createAlarmLimit()
|
||||
{
|
||||
return standardField->doubleAlarm();
|
||||
}
|
||||
|
||||
StructureConstPtr NTField::createControl()
|
||||
{
|
||||
return standardField->control();
|
||||
@@ -306,12 +309,6 @@ PVStructurePtr PVNTField::createDisplay()
|
||||
return pvDataCreate->createPVStructure(display);
|
||||
}
|
||||
|
||||
PVStructurePtr PVNTField::createAlarmLimit()
|
||||
{
|
||||
StructureConstPtr structure = NTField::get()->createAlarmLimit();
|
||||
return pvDataCreate->createPVStructure(structure);
|
||||
}
|
||||
|
||||
|
||||
PVStructurePtr PVNTField::createControl()
|
||||
{
|
||||
|
||||
@@ -99,11 +99,6 @@ public:
|
||||
* @return a displayalarm structure.
|
||||
*/
|
||||
StructureConstPtr createDisplay();
|
||||
/**
|
||||
* Create an alarmLimit structure.
|
||||
* @return an alarmLimit structure.
|
||||
*/
|
||||
StructureConstPtr createAlarmLimit();
|
||||
/**
|
||||
* Create a control structure.
|
||||
* @return a control structure.
|
||||
|
||||
+10
-10
@@ -34,8 +34,8 @@ StructureConstPtr NTNameValueBuilder::createStructure()
|
||||
FieldBuilderPtr builder =
|
||||
getFieldCreate()->createFieldBuilder()->
|
||||
setId(NTNameValue::URI)->
|
||||
addArray("names", pvString)->
|
||||
addArray("values", valueType);
|
||||
addArray("name", pvString)->
|
||||
addArray("value", valueType);
|
||||
|
||||
if (descriptor)
|
||||
builder->add("descriptor", pvString);
|
||||
@@ -130,10 +130,10 @@ bool NTNameValue::is_a(StructureConstPtr const & structure)
|
||||
|
||||
bool NTNameValue::is_compatible(PVStructurePtr const & pvStructure)
|
||||
{
|
||||
PVStringArrayPtr pvNames = pvStructure->getSubField<PVStringArray>("names");
|
||||
if(!pvNames) return false;
|
||||
PVFieldPtr pvValues = pvStructure->getSubField("values");
|
||||
if(!pvValues) return false;
|
||||
PVStringArrayPtr pvName = pvStructure->getSubField<PVStringArray>("name");
|
||||
if(!pvName) return false;
|
||||
PVFieldPtr pvValue = pvStructure->getSubField("value");
|
||||
if(!pvValue) return false;
|
||||
PVFieldPtr pvField = pvStructure->getSubField("descriptor");
|
||||
if(pvField && !pvStructure->getSubField<PVString>("descriptor")) return false;
|
||||
pvField = pvStructure->getSubField("alarm");
|
||||
@@ -186,14 +186,14 @@ PVStructurePtr NTNameValue::getAlarm() const
|
||||
return pvNTNameValue->getSubField<PVStructure>("alarm");
|
||||
}
|
||||
|
||||
PVStringArrayPtr NTNameValue::getNames() const
|
||||
PVStringArrayPtr NTNameValue::getName() const
|
||||
{
|
||||
return pvNTNameValue->getSubField<PVStringArray>("names");
|
||||
return pvNTNameValue->getSubField<PVStringArray>("name");
|
||||
}
|
||||
|
||||
PVFieldPtr NTNameValue::getValues() const
|
||||
PVFieldPtr NTNameValue::getValue() const
|
||||
{
|
||||
return pvNTNameValue->getSubField("values");
|
||||
return pvNTNameValue->getSubField("value");
|
||||
}
|
||||
|
||||
NTNameValue::NTNameValue(PVStructurePtr const & pvStructure) :
|
||||
|
||||
@@ -200,25 +200,25 @@ public:
|
||||
epics::pvData::PVStructurePtr getAlarm() const;
|
||||
|
||||
/**
|
||||
* Get the names array field.
|
||||
* @return The PVStringArray for the names.
|
||||
* Get the name array field.
|
||||
* @return The PVStringArray for the name.
|
||||
*/
|
||||
epics::pvData::PVStringArrayPtr getNames() const;
|
||||
epics::pvData::PVStringArrayPtr getName() const;
|
||||
|
||||
/**
|
||||
* Get the value array field.
|
||||
* @return The PVField for the values.
|
||||
* @return The PVField for the value.
|
||||
*/
|
||||
epics::pvData::PVFieldPtr getValues() const;
|
||||
epics::pvData::PVFieldPtr getValue() const;
|
||||
|
||||
/**
|
||||
* Get the value array field of a specified type (e.g. PVDoubleArray).
|
||||
* @return The <PVT> array for the values.
|
||||
* @return The <PVT> array for the value.
|
||||
*/
|
||||
template<typename PVT>
|
||||
std::tr1::shared_ptr<PVT> getValues() const
|
||||
std::tr1::shared_ptr<PVT> getValue() const
|
||||
{
|
||||
epics::pvData::PVFieldPtr pvField = getValues();
|
||||
epics::pvData::PVFieldPtr pvField = getValue();
|
||||
if (pvField.get())
|
||||
return std::tr1::dynamic_pointer_cast<PVT>(pvField);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user