Code generation for UaVariant defaultValue missing/obsolete
Posted: 24 Mar 2015, 10:02
UaModeler Version 1.3.4 "293"
Object node initiatlization using Mandatory as Modeling rule generates the following code:
The declaration and definition of the UaVariant seams to be not necessary as the result is not used anywhere unless the UaVariant constructor causes an undocumented side effect. But the code compiles. Worse is that using the Optional Modeling rule the code does not compile as the UaVariant is not being declared, but initialized:
Object node initiatlization using Mandatory as Modeling rule generates the following code:
Code: Select all
/** Initialize the object with all member nodes
*/
void PressureTypeBase::initialize()
{
UaStatus addStatus;
UaVariant defaultValue;
if ( s_typeNodesCreated == false )
{
createTypes();
}
// Mandatory variable Pressure
m_pPressure = new OpcUa::AnalogItemType(this, s_pPressure, m_pNodeConfig, m_pSharedMutex);
addStatus = m_pNodeConfig->addNodeAndReference(this, m_pPressure, OpcUaId_HasComponent);
UA_ASSERT(addStatus.isGood());
m_pPressure->setEURange(UaRange(0, 1000));
defaultValue.setInt32(0);
...
}
Code: Select all
void PressureTypeBase::initialize()
{
if ( s_typeNodesCreated == false )
{
createTypes();
}
// Optional variable Pressure
m_pPressure = NULL;
defaultValue.setInt32(0);
...
}