Skip to content

Commit a248217

Browse files
Resolve issue 140 (#141)
Some Attributes with IsAbstract attribute contain NodeId Attribute
1 parent 84775d2 commit a248217

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

NodeSetToAML.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,6 +3334,7 @@ private void AddAttributeData( AttributeFamilyType attribute, UANode uaNode )
33343334
AttributeType isAbstractAttribute = AddModifyAttribute(
33353335
attribute.Attribute, "IsAbstract", "Boolean", true);
33363336
isAbstractAttribute.AdditionalInformation.Append(OpcUaTypeOnly);
3337+
RemoveUnwantedAttribute(isAbstractAttribute, "NodeId");
33373338
}
33383339

33393340
nodeIdAttribute.AdditionalInformation.Append( OpcUaTypeOnly );

SystemTest/IsAbstract.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,33 @@ public void TestInterfaceIsAbstract(bool isNull)
228228
}
229229
}
230230

231+
232+
[TestMethod, Timeout(TestHelper.UnitTestTimeout)]
233+
public void TestNodeIdInIsAbstract()
234+
{
235+
CAEXDocument document = GetDocument("AmlFxTest.xml.amlx");
236+
int counter = 0;
237+
foreach( AttributeTypeLibType libType in document.AttributeTypeLib )
238+
{
239+
foreach (AttributeFamilyType familyType in libType)
240+
{
241+
AttributeType isAbstract = familyType.Attribute["IsAbstract"];
242+
if ( isAbstract != null )
243+
{
244+
AttributeType nodeId = isAbstract.Attribute["NodeId"];
245+
if (nodeId != null)
246+
{
247+
Console.WriteLine(familyType.Name + " has NodeId in IsAbstract");
248+
counter++;
249+
// Error
250+
}
251+
}
252+
}
253+
}
254+
Assert.AreEqual(0, counter, "There were " + counter.ToString() +
255+
" IsAbstract attributes with NodeId sub-attributes");
256+
}
257+
231258
public void WriteTestFile( DirectoryInfo outputDirectory, string fileName, List<string> output)
232259
{
233260
if( output.Count == 0 )

0 commit comments

Comments
 (0)