From 14c28ce452446dc3a3ce89929c3738c6f02a4b9b Mon Sep 17 00:00:00 2001 From: Randy Armstrong Date: Tue, 31 Oct 2023 16:30:52 -0700 Subject: [PATCH] Fixes #139 --- Opc.Ua.ModelCompiler/ModelDesignerValidator.cs | 10 +++++++++- Opc.Ua.ModelCompiler/ModelGenerator2.cs | 5 +++-- Tests/DemoModel/BuildModel.bat | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Opc.Ua.ModelCompiler/ModelDesignerValidator.cs b/Opc.Ua.ModelCompiler/ModelDesignerValidator.cs index f41aeef6..058f841c 100644 --- a/Opc.Ua.ModelCompiler/ModelDesignerValidator.cs +++ b/Opc.Ua.ModelCompiler/ModelDesignerValidator.cs @@ -5073,7 +5073,15 @@ private void BuildInstanceHierarchy2( child.StaticValue = true; } } - + + if (instance.ModellingRule == ModellingRule.OptionalPlaceholder || instance.ModellingRule == ModellingRule.MandatoryPlaceholder) + { + if (depth > 3) + { + continue; + } + } + nodes.Add(child); BuildInstanceHierarchy2(instance, browsePath, nodes, references, inherited, depth + 1); diff --git a/Opc.Ua.ModelCompiler/ModelGenerator2.cs b/Opc.Ua.ModelCompiler/ModelGenerator2.cs index 2e68e37c..f33939a2 100644 --- a/Opc.Ua.ModelCompiler/ModelGenerator2.cs +++ b/Opc.Ua.ModelCompiler/ModelGenerator2.cs @@ -4376,7 +4376,8 @@ private InstanceDesign GetMergedInstance(InstanceDesign instance) { "Description", "Save", - "Value" + "Handle", + "Specification" }; private bool IsIndeterminateType(InstanceDesign instance) @@ -4469,7 +4470,7 @@ private bool WriteTemplate_ListOfPropertiesForType(Template template, Context co if (!IsOverridden(instance)) { - if (!BuiltInPropertyNames.Contains(instance.SymbolicName.Name)) + if (!BuiltInPropertyNames.Contains(instance.SymbolicName.Name) || (instance is VariableDesign && instance.SymbolicName.Name == "Value")) { template.AddReplacement("public new", "public"); } diff --git a/Tests/DemoModel/BuildModel.bat b/Tests/DemoModel/BuildModel.bat index 1b0255b2..60668189 100644 --- a/Tests/DemoModel/BuildModel.bat +++ b/Tests/DemoModel/BuildModel.bat @@ -6,6 +6,7 @@ set MODEL=DemoModel set VERSION=v105 set EXCLUDE=Draft set INPUT=. +set CSVINPUT=. set OUTPUT=. set USEALLOWSUBTYPES=-useAllowSubtypes