Skip to content

Commit

Permalink
Updates for UA-1.05.04
Browse files Browse the repository at this point in the history
  • Loading branch information
randy-armstrong committed Dec 3, 2024
1 parent 6333dcd commit 5e6a54c
Show file tree
Hide file tree
Showing 132 changed files with 20,856 additions and 6,511 deletions.
29 changes: 19 additions & 10 deletions BuildStandardTypes.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,20 @@ set MODELVERSION=

REM Set overrides for older versions. set DOTNET_TARGET=.\Stack\Stack\Opc.Ua.Core\
IF "%1"=="v105" (
set DOTNET_TARGET=.\Stack\Stack\Opc.Ua.Core\
set MODELVERSION=-mv 1.05.03 -pd 2023-12-15
set MODELVERSION=-mv 1.05.04 -pd 2024-12-01
set USEALLOWSUBTYPES=
)

IF "%1"=="v104" (
set DOTNET_TARGET=.\Stack\Stack\Opc.Ua.Core\
set DOTNET_TARGET=
set GDS_TARGET=
set USEALLOWSUBTYPES=
set MODELVERSION=-mv 1.04.12 -pd 2024-02-15
set MODELVERSION=-mv 1.04.12 -pd 2024-01-05
)

IF "%1"=="v103" (
set DOTNET_TARGET=
set GDS_TARGET=
set USEALLOWSUBTYPES=
set CSVINPUT=%INPUT%
set MODELVERSION=-mv 1.03.9 -pd 2022-03-29
Expand Down Expand Up @@ -99,12 +101,19 @@ MOVE /Y "%OUTPUT%\Schema\Opc.Ua.DataTypes.cs" "%OUTPUT%\DotNet\Opc.Ua.DataTypes.
MOVE /Y "%OUTPUT%\Schema\Opc.Ua.PredefinedNodes.uanodes" "%OUTPUT%\DotNet\Opc.Ua.PredefinedNodes.uanodes"
MOVE /Y "%OUTPUT%\Schema\Opc.Ua.PredefinedNodes.xml" "%OUTPUT%\DotNet\Opc.Ua.PredefinedNodes.xml"
MOVE /Y "%OUTPUT%\Schema\Opc.Ua.NodeSet.xml" "%OUTPUT%\DotNet\Opc.Ua.NodeSet.xml"
MOVE /Y "%OUTPUT%\DotNet\Opc.Ua.Services.wsdl" "%OUTPUT%\Schema\Opc.Ua.Services.wsdl"
MOVE /Y "%OUTPUT%\DotNet\Opc.Ua.Endpoints.wsdl" "%OUTPUT%\Schema\Opc.Ua.Endpoints.wsdl"
@ECHO OFF

ECHO Moving .ts files to %OUTPUT%\TypeScript\
IF NOT EXIST "%OUTPUT%\TypeScript" MKDIR "%OUTPUT%\TypeScript"
MOVE /Y "%OUTPUT%\DotNet\*.ts" "%OUTPUT%\TypeScript\"
MOVE /Y "%OUTPUT%\Schema\*.ts" "%OUTPUT%\TypeScript\"
IF NOT EXIST "%OUTPUT%\OpenApi" MKDIR "%OUTPUT%\OpenApi"
COPY "%OUTPUT%\Schema\*.json" "%OUTPUT%\OpenApi\"

ECHO Moving Constants to %OUTPUT%\OpenApi\Constants\
IF EXIST "%OUTPUT%\OpenApi\Constants" RMDIR /S /Q "%OUTPUT%\OpenApi\Constants"
XCOPY "%OUTPUT%\Schema\Constants" "%OUTPUT%\OpenApi\Constants" /E /Y /I
RMDIR /S /Q "%OUTPUT%\Schema\Constants"
XCOPY "%OUTPUT%\DotNet\Constants" "%OUTPUT%\OpenApi\Constants" /E /Y /I
RMDIR /S /Q "%OUTPUT%\DotNet\Constants"
@ECHO OFF

IF "%ANSIC_TARGET%" NEQ "" (
Expand Down Expand Up @@ -142,8 +151,8 @@ IF "%DOTNET_TARGET%" NEQ "" (
COPY "%OUTPUT%\Schema\Opc.Ua.NodeSet2.xml" "%DOTNET_TARGET%\Schema\Opc.Ua.NodeSet2.xml"
COPY "%OUTPUT%\Schema\Opc.Ua.Types.bsd" "%DOTNET_TARGET%\Schema\Opc.Ua.Types.bsd"
COPY "%OUTPUT%\Schema\Opc.Ua.Types.xsd" "%DOTNET_TARGET%\Schema\Opc.Ua.Types.xsd"
COPY "%OUTPUT%\DotNet\Opc.Ua.Endpoints.wsdl" "%DOTNET_TARGET%\Schema\Opc.Ua.Endpoints.wsdl"
COPY "%OUTPUT%\DotNet\Opc.Ua.Services.wsdl" "%DOTNET_TARGET%\Schema\Opc.Ua.Services.wsdl"
COPY "%OUTPUT%\Schema\Opc.Ua.Endpoints.wsdl" "%DOTNET_TARGET%\Schema\Opc.Ua.Endpoints.wsdl"
COPY "%OUTPUT%\Schema\Opc.Ua.Services.wsdl" "%DOTNET_TARGET%\Schema\Opc.Ua.Services.wsdl"
COPY "%OUTPUT%\DotNet\Opc.Ua.Channels.cs" "%DOTNET_TARGET%\Stack\Generated\Opc.Ua.Channels.cs"
COPY "%OUTPUT%\DotNet\Opc.Ua.Client.cs" "%DOTNET_TARGET%\Stack\Generated\Opc.Ua.Client.cs"
COPY "%OUTPUT%\DotNet\Opc.Ua.Endpoints.cs" "%DOTNET_TARGET%\Stack\Generated\Opc.Ua.Endpoints.cs"
Expand Down
13 changes: 9 additions & 4 deletions Opc.Ua.ModelCompiler/BaseSchemaExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ internal class BaseSchemaExporter
protected NodeIdDictionary<DataTypeState> m_index;
protected Dictionary<string, BaseSchemaElement> m_builtInTypes;
protected string m_modelUri;
protected bool m_useCompactEncoding;

public BaseSchemaExporter()
{
Expand Down Expand Up @@ -267,8 +268,11 @@ private BaseSchemaField FindFieldSchema(
field.IsOptional ||
fieldType.IsAbstract)
{
schema.ExportType = GetStructureType();
return schema;
if (field.IsOptional)
{
schema.ExportType = GetStructureType();
return schema;
}
}

schema.ExportType = (fieldType.NodeId.NamespaceIndex != 0) ? $"{fieldType.NodeId.NamespaceIndex}:{fieldType.SymbolicName}" : fieldType.SymbolicName;
Expand All @@ -283,13 +287,13 @@ private BaseSchemaField FindFieldSchema(

if (bit.NodeId == Opc.Ua.DataTypes.Enumeration)
{
schema.ExportType = GetEnumerationExportType();
schema.ExportType = (fieldType.NodeId.NamespaceIndex != 0) ? $"{fieldType.NodeId.NamespaceIndex}:{fieldType.SymbolicName}" : fieldType.SymbolicName;
return schema;
}

if (m_builtInTypes.TryGetValue(bit.SymbolicName, out var type))
{
if (type.ExportType != "object")
if (type.ExportType != "object" && type.ExportType != null)
{
schema.ExportType = type.ExportType;
schema.ExportSubType = type.ExportSubType;
Expand Down Expand Up @@ -446,6 +450,7 @@ internal class BaseSchemaElement
public string ExportSubType { get; set; }
public NodeId DataTypeId { get; set; }
public List<BaseSchemaField> Fields { get; set; }
public bool Sealed { get; set; }
}

internal class BaseSchemaField
Expand Down
128 changes: 86 additions & 42 deletions Opc.Ua.ModelCompiler/CSVs/DemoModel.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@ Vector_Encoding_DefaultXml,6,Object
WorkOrderStatusType_Encoding_DefaultXml,7,Object
WorkOrderType_Encoding_DefaultXml,8,Object
DemoModel_XmlSchema,9,Variable
Seeker_Identities,10,Unspecified
Seeker_Identities,10,Variable
DemoModel_XmlSchema_NamespaceUri,11,Variable
DemoModel_XmlSchema_Vector,12,Variable
Seeker_ApplicationsExclude,13,Unspecified
Seeker_Applications,14,Unspecified
Seeker_ApplicationsExclude,13,Variable
Seeker_Applications,14,Variable
DemoModel_XmlSchema_WorkOrderStatusType,15,Variable
Seeker_EndpointsExclude,16,Unspecified
Seeker_Endpoints,17,Unspecified
Seeker_EndpointsExclude,16,Variable
Seeker_Endpoints,17,Variable
DemoModel_XmlSchema_WorkOrderType,18,Variable
Seeker_CustomConfiguration,19,Unspecified
Seeker_AddIdentity,20,Unspecified
Seeker_CustomConfiguration,19,Variable
Seeker_AddIdentity,20,Method
Vector_Encoding_DefaultBinary,21,Object
WorkOrderStatusType_Encoding_DefaultBinary,22,Object
WorkOrderType_Encoding_DefaultBinary,23,Object
DemoModel_BinarySchema,24,Variable
Seeker_AddIdentity_InputArguments,25,Unspecified
Seeker_AddIdentity_InputArguments,25,Variable
DemoModel_BinarySchema_NamespaceUri,26,Variable
DemoModel_BinarySchema_Vector,27,Variable
Seeker_RemoveIdentity,28,Unspecified
Seeker_RemoveIdentity_InputArguments,29,Unspecified
Seeker_RemoveIdentity,28,Method
Seeker_RemoveIdentity_InputArguments,29,Variable
DemoModel_BinarySchema_WorkOrderStatusType,30,Variable
Seeker_AddApplication,31,Unspecified
Seeker_AddApplication_InputArguments,32,Unspecified
Seeker_AddApplication,31,Method
Seeker_AddApplication_InputArguments,32,Variable
DemoModel_BinarySchema_WorkOrderType,33,Variable
Seeker_RemoveApplication,34,Unspecified
Seeker_RemoveApplication_InputArguments,35,Unspecified
Signal,36,Object
Signal_Red,37,Variable
Signal_Yellow,38,Variable
Signal_Green,39,Variable
TrafficView,40,View
Seeker_RemoveApplication,34,Method
Seeker_RemoveApplication_InputArguments,35,Variable
Signal,36,Unspecified
Signal_Red,37,Unspecified
Signal_Yellow,38,Unspecified
Signal_Green,39,Unspecified
TrafficView,40,Unspecified
SampleUnion,41,DataType
SampleStructureWithOptionalFields,42,DataType
SampleUnionAllowSubtypes,43,DataType
Expand All @@ -48,27 +48,27 @@ SampleUnionAllowSubtypes_Encoding_DefaultBinary,47,Object
SampleStructureAllowSubtypes_Encoding_DefaultBinary,48,Object
DemoModel_BinarySchema_Deprecated,49,Variable
DemoModel_BinarySchema_SampleUnion,50,Variable
Seeker_AddEndpoint,51,Unspecified
Seeker_AddEndpoint_InputArguments,52,Unspecified
Seeker_AddEndpoint,51,Method
Seeker_AddEndpoint_InputArguments,52,Variable
DemoModel_BinarySchema_SampleStructureWithOptionalFields,53,Variable
Seeker_RemoveEndpoint,54,Unspecified
Seeker_RemoveEndpoint_InputArguments,55,Unspecified
Seeker_RemoveEndpoint,54,Method
Seeker_RemoveEndpoint_InputArguments,55,Variable
DemoModel_BinarySchema_SampleUnionAllowSubtypes,56,Variable
RestrictedObjectType_Red_Yellow,57,Unspecified
RestrictedObjectType_Pink_Placeholder_Yellow,58,Unspecified
RestrictedObjectType_Red_Yellow,57,Variable
RestrictedObjectType_Pink_Placeholder_Yellow,58,Variable
DemoModel_BinarySchema_SampleStructureAllowSubtypes,59,Variable
TestObject_Red,60,Unspecified
TestObject_Red_Yellow,61,Unspecified
TestObject_Red,60,Variable
TestObject_Red_Yellow,61,Variable
SampleUnion_Encoding_DefaultXml,62,Object
SampleStructureWithOptionalFields_Encoding_DefaultXml,63,Object
SampleUnionAllowSubtypes_Encoding_DefaultXml,64,Object
SampleStructureAllowSubtypes_Encoding_DefaultXml,65,Object
DemoModel_XmlSchema_Deprecated,66,Variable
DemoModel_XmlSchema_SampleUnion,67,Variable
EnumUnderscoreTest,68,Unspecified
EnumUnderscoreTest_EnumValues,69,Unspecified
EnumUnderscoreTest,68,DataType
EnumUnderscoreTest_EnumValues,69,Variable
DemoModel_XmlSchema_SampleStructureWithOptionalFields,70,Variable
TestObject_Blue,71,Unspecified
TestObject_Blue,71,Method
DemoModel_BinarySchema_DataTypeVersion,72,Variable
DemoModel_XmlSchema_SampleUnionAllowSubtypes,73,Variable
DemoModel_BinarySchema_Vector_DataTypeVersion,74,Variable
Expand All @@ -90,9 +90,9 @@ ProgramArrayType_Program_Name,89,Unspecified
ProgramType,90,Unspecified
ProgramType_Id,91,Unspecified
ProgramType_Name,92,Unspecified
Test_Error,93,Unspecified
Test_ErrorComponent,94,Unspecified
Seeker,95,Unspecified
Test_Error,93,Object
Test_ErrorComponent,94,Object
Seeker,95,Object
DemoModel_BinarySchema_WorkOrderType_DataTypeVersion,96,Variable
DemoModel_BinarySchema_WorkOrderType_DictionaryFragment,97,Variable
DemoModel_BinarySchema_SampleUnion_DataTypeVersion,98,Variable
Expand All @@ -117,19 +117,19 @@ RestrictedObject,116,Unspecified
RestrictedObject_Red,117,Unspecified
RestrictedObject_Red_Yellow,118,Unspecified
RestrictedObject_Blue,119,Unspecified
WithTwoDimensionalVariableType,120,Unspecified
WithTwoDimensionalVariableType_X,121,Unspecified
RestrictedVariableType,122,Unspecified
RestrictedVariableType_Yellow,123,Unspecified
RestrictedObjectType,124,Unspecified
RestrictedObjectType_Red,125,Unspecified
WithTwoDimensionalVariableType,120,ObjectType
WithTwoDimensionalVariableType_X,121,Variable
RestrictedVariableType,122,VariableType
RestrictedVariableType_Yellow,123,Variable
RestrictedObjectType,124,ObjectType
RestrictedObjectType_Red,125,Variable
DemoModel_XmlSchema_SampleUnion_DictionaryFragment,126,Variable
RestrictedObjectType_Blue,127,Unspecified
TestObject,128,Unspecified
RestrictedObjectType_Blue,127,Method
TestObject,128,Object
DemoModel_XmlSchema_SampleStructureWithOptionalFields_DataTypeVersion,129,Variable
DemoModel_XmlSchema_SampleStructureWithOptionalFields_DictionaryFragment,130,Variable
DemoModel_XmlSchema_SampleUnionAllowSubtypes_DataTypeVersion,131,Variable
RestrictedObjectType_Pink_Placeholder,132,Unspecified
RestrictedObjectType_Pink_Placeholder,132,Variable
DemoModel_XmlSchema_SampleUnionAllowSubtypes_DictionaryFragment,133,Variable
DemoModel_XmlSchema_SampleStructureAllowSubtypes_DataTypeVersion,134,Variable
DemoModel_XmlSchema_SampleStructureAllowSubtypes_DictionaryFragment,135,Variable
Expand Down Expand Up @@ -195,3 +195,47 @@ WidgetType_DeviceTypeImage,194,Unspecified
WidgetType_Documentation,195,Unspecified
WidgetType_ProtocolSupport,196,Unspecified
WidgetType_ImageSet,197,Unspecified
RestrictedVariableType_[0],198,Unspecified
RestrictedVariableType_[1],199,Unspecified
RestrictedVariableType_[2],200,Unspecified
RestrictedObjectType_Red_[0],201,Unspecified
RestrictedObjectType_Red_[1],202,Unspecified
RestrictedObjectType_Red_[2],203,Unspecified
RestrictedObjectType_Pink_Placeholder_[0],204,Unspecified
RestrictedObjectType_Pink_Placeholder_[1],205,Unspecified
RestrictedObjectType_Pink_Placeholder_[2],206,Unspecified
TestObject_Red_[0],207,Unspecified
TestObject_Red_[1],208,Unspecified
TestObject_Red_[2],209,Unspecified
RestrictedVariableType_X,210,Variable
RestrictedVariableType_Y,211,Variable
RestrictedVariableType_Z,212,Variable
RestrictedObjectType_Red_X,213,Variable
RestrictedObjectType_Red_Y,214,Variable
RestrictedObjectType_Red_Z,215,Variable
RestrictedObjectType_Pink_Placeholder_X,216,Variable
RestrictedObjectType_Pink_Placeholder_Y,217,Variable
RestrictedObjectType_Pink_Placeholder_Z,218,Variable
TestObject_Red_X,219,Variable
TestObject_Red_Y,220,Variable
TestObject_Red_Z,221,Variable
Person,222,DataType
Student,223,DataType
Person_Encoding_DefaultBinary,224,Object
Student_Encoding_DefaultBinary,225,Object
DemoModel_BinarySchema_Person,226,Variable
DemoModel_BinarySchema_Person_DataTypeVersion,227,Variable
DemoModel_BinarySchema_Person_DictionaryFragment,228,Variable
DemoModel_BinarySchema_Student,229,Variable
DemoModel_BinarySchema_Student_DataTypeVersion,230,Variable
DemoModel_BinarySchema_Student_DictionaryFragment,231,Variable
Person_Encoding_DefaultXml,232,Object
Student_Encoding_DefaultXml,233,Object
DemoModel_XmlSchema_Person,234,Variable
DemoModel_XmlSchema_Person_DataTypeVersion,235,Variable
DemoModel_XmlSchema_Person_DictionaryFragment,236,Variable
DemoModel_XmlSchema_Student,237,Variable
DemoModel_XmlSchema_Student_DataTypeVersion,238,Variable
DemoModel_XmlSchema_Student_DictionaryFragment,239,Variable
Person_Encoding_DefaultJson,240,Object
Student_Encoding_DefaultJson,241,Object
Loading

0 comments on commit 5e6a54c

Please sign in to comment.