Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions NodeSetToAML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
using UAObject = MarkdownProcessor.NodeSet.UAObject;
using UAType = MarkdownProcessor.NodeSet.UAType;
using UAVariable = MarkdownProcessor.NodeSet.UAVariable;
using UAVariableType = MarkdownProcessor.NodeSet.UAVariableType;
using DataTypeField = MarkdownProcessor.NodeSet.DataTypeField;
using Aml.Engine.Adapter;
using System.Xml.Linq;
Expand All @@ -53,7 +54,6 @@
using System.Reflection;
using System.Xml;
using Opc2Aml;
using Newtonsoft.Json.Linq;


namespace MarkdownProcessor
Expand Down Expand Up @@ -604,6 +604,15 @@ private void AddBaseNodeClassAttributes( AttributeSequence seq, UANode uanode)
{
AddModifyAttribute(seq, "IsAbstract", "Boolean", uaType.IsAbstract);
}

UAVariableType uaVariableType = uanode as UAVariableType;
if (uaVariableType != null)
{
if (uaVariableType.ValueRank != -1)
{
AddModifyAttribute(seq, "ValueRank", "Int32", uaVariableType.ValueRank);
}
}
}

private void BuildLocalizedTextAttribute(
Expand Down Expand Up @@ -714,8 +723,6 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str
{
if (bListOf == false && val.TypeInfo != null) // look for reasons not to add the attribute because missing == default value
{
if (name == "ValueRank" && val == -2 )
return null;
if (name == "IsSource" && val == false)
return null;
if (name == "Symmetric" && val == false)
Expand Down
7 changes: 7 additions & 0 deletions SystemTest/TestAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ public class TestAttributes
[DataRow("IsAbstract", "2881", "false",
true, true, DisplayName = "AcknowledgeableConditionType should not be Abstract")]

[DataRow("ValueRank", "62", "-2",
true, true, DisplayName = "BaseVariableType ValueRank -2")]
[DataRow("ValueRank", "58", "",
false, true, DisplayName = "BaseObjectType No ValueRank")]
[DataRow("ValueRank", "18773", "-1",
true, true, DisplayName = "CartesianCoordinates LengthUnit ValueRank -1")]

public void TestAttribute(string attribute, string nodeId,
string expected, bool expectedToBeFound, bool foundationRoot = false)
{
Expand Down