Skip to content

Commit c9db3e1

Browse files
committed
Merge chore/sysml-import-template-compliance (PR TrakHound#224) into integration/up-to-pr-224 on top of integration/up-to-pr-223
# Conflicts: # MTConnect.NET.sln # build/MTConnect.NET-SysML-Import/CSharp/TemplateRenderer.cs # build/MTConnect.NET-SysML-Import/CSharp/Templates/EnumStringDescriptions.scriban # build/MTConnect.NET-SysML-Import/Xml/Templates/XmlCuttingToolLifeCycle.scriban # libraries/MTConnect.NET-Common/Assets/CuttingTools/Measurement.g.cs
2 parents 3bca492 + 28c2b23 commit c9db3e1

773 files changed

Lines changed: 1895 additions & 792 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MTConnect.NET.sln

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-XML-Tests", "
7474
EndProject
7575
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-SysML-Import", "build\MTConnect.NET-SysML-Import\MTConnect.NET-SysML-Import.csproj", "{C5F7C26D-F394-42F6-852B-C6981A99AA0F}"
7676
EndProject
77+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-SysML-Import-Tests", "tests\MTConnect.NET-SysML-Import-Tests\MTConnect.NET-SysML-Import-Tests.csproj", "{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D}"
78+
EndProject
7779
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-AgentProcessor-Python", "agent\Processors\MTConnect.NET-AgentProcessor-Python\MTConnect.NET-AgentProcessor-Python.csproj", "{F6FDE58F-6520-4BFB-9587-A7FF66628AD8}"
7880
EndProject
7981
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-AgentModule-MqttRelay", "agent\Modules\MTConnect.NET-AgentModule-MqttRelay\MTConnect.NET-AgentModule-MqttRelay.csproj", "{CB2E7F5A-55D5-43BD-ABC8-145E8436BE88}"
@@ -297,6 +299,14 @@ Global
297299
{8AD3DE52-3EC4-49BC-B512-9976477C1E63}.Package|Any CPU.Build.0 = Debug|Any CPU
298300
{8AD3DE52-3EC4-49BC-B512-9976477C1E63}.Release|Any CPU.ActiveCfg = Release|Any CPU
299301
{8AD3DE52-3EC4-49BC-B512-9976477C1E63}.Release|Any CPU.Build.0 = Release|Any CPU
302+
{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
303+
{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
304+
{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D}.Docker|Any CPU.ActiveCfg = Debug|Any CPU
305+
{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D}.Docker|Any CPU.Build.0 = Debug|Any CPU
306+
{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D}.Package|Any CPU.ActiveCfg = Debug|Any CPU
307+
{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D}.Package|Any CPU.Build.0 = Debug|Any CPU
308+
{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
309+
{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D}.Release|Any CPU.Build.0 = Release|Any CPU
300310
{C5F7C26D-F394-42F6-852B-C6981A99AA0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
301311
{C5F7C26D-F394-42F6-852B-C6981A99AA0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
302312
{C5F7C26D-F394-42F6-852B-C6981A99AA0F}.Docker|Any CPU.ActiveCfg = Debug|Any CPU
@@ -587,6 +597,7 @@ Global
587597
{AE09D1CA-5572-40BF-B984-74230E8634E1} = {14375E03-6BF8-45E6-B868-D2399368992B}
588598
{3E89B860-A428-470C-8E48-0DDABC4027F0} = {14375E03-6BF8-45E6-B868-D2399368992B}
589599
{8B61CE3B-DC8A-47CE-A34B-38BC57DFFD57} = {14375E03-6BF8-45E6-B868-D2399368992B}
600+
{9B5A2D9F-1E4C-4F8B-A7D2-3E6C8B4F2A9D} = {14375E03-6BF8-45E6-B868-D2399368992B}
590601
EndGlobalSection
591602
GlobalSection(ExtensibilityGlobals) = postSolution
592603
SolutionGuid = {CC13D3AD-18BF-4695-AB2A-087EF0885B20}

build/MTConnect.NET-SysML-Import/CSharp/TemplateRenderer.cs

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,10 @@ public static void Render(MTConnectModel mtconnectModel, string outputPath)
300300
//
301301
// The full import-side classModels list is passed too so the
302302
// walk can find parents that are present in the SysML graph but
303-
// never reach `templates` (e.g. `Assets.CuttingTools.Measurement`,
304-
// an abstract base whose .g.cs is hand-maintained / frozen and
305-
// therefore not re-emitted by any current renderer flow). The
306-
// child ToolingMeasurement still extends it at C# compile time,
307-
// so its `Code` property hides Measurement.Code and needs `new`.
303+
// never reach `templates` (e.g. abstract bases whose .g.cs is
304+
// hand-maintained / frozen and therefore not re-emitted by any
305+
// current renderer flow) — the child class still extends them at
306+
// C# compile time, so any name collision needs the `new` marker.
308307
MarkInheritedProperties(templates, classModels);
309308

310309
// Mark each ClassModel's ParentHasRules flag so Model.scriban
@@ -500,7 +499,7 @@ private static void WriteDescriptions(ITemplateModel template, string outputPath
500499
/// <see cref="MTConnectClassModel.ParentName"/> through every
501500
/// ClassModel the renderer has assembled. This catches the
502501
/// overwhelming majority of cases (Asset.SerialNumber ⇒
503-
/// CuttingToolAsset, Measurement.CodeToolingMeasurement, etc.).
502+
/// CuttingToolAsset, Component.UuidDevice, etc.).
504503
/// </item>
505504
/// <item>
506505
/// Hand-stitched seeds for inheritance links the SysML model does
@@ -652,19 +651,25 @@ private static void MarkInheritedProperties(
652651
break;
653652

654653
case "Assets.CuttingTools.ToolingMeasurement":
655-
// No hand-stitched inheritance seed needed. The
656-
// Assets.CuttingTools.Measurement base IS produced
657-
// by the current renderer flow (via
658-
// MTConnectAssetInformationModel.ParseAssetInformationModel's
659-
// sharedMeasurement injection which imports the
660-
// Pallet Measurement class under Assets.CuttingTools),
661-
// so the export-side ClassModel graph already carries
662-
// its property list. The Pallet Measurement lacks
663-
// Code, and the interface IMeasurement.g.cs likewise
664-
// has Code commented out — hence emitting `new` on
665-
// ToolingMeasurement.Code would raise CS0109 on both
666-
// the class and interface sides. Fall through to the
667-
// default inheritance walk with no override.
654+
// ToolingMeasurement extends `Measurement` (the
655+
// CuttingTools abstract Measurement base, NOT
656+
// Assets.Pallet.Measurement). The SysML v2.7 XMI
657+
// relocates `Code` onto ToolingMeasurement — the
658+
// parent Measurement (both class and interface)
659+
// no longer declares Code, so ToolingMeasurement's
660+
// `Code` is a fresh introduction that hides
661+
// nothing. Emitting `new` here would raise CS0109
662+
// on both the class and the interface. No hand-
663+
// stitched inheritance seed is needed for this
664+
// template — leave the case block as a marker so
665+
// the intentional emptiness is documented. The
666+
// Assets.CuttingTools.Measurement base is emitted
667+
// by the current renderer flow via the
668+
// sharedMeasurement injection in
669+
// MTConnectAssetInformationModel, so the export-
670+
// side ClassModel graph carries its property list
671+
// and the default inheritance walk resolves
672+
// correctly.
668673
break;
669674
}
670675

build/MTConnect.NET-SysML-Import/CSharp/Templates/Assets.CuttingToolMeasurement.scriban

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ namespace MTConnect.Assets.CuttingTools.Measurements
5252
{{ if (units_enum) }}Units = {{units_enum}};{{ end }}
5353
}
5454
}
55-
}
55+
}

build/MTConnect.NET-SysML-Import/CSharp/Templates/Devices.CompositionType.scriban

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ namespace MTConnect.Devices.Compositions
5353
/// </summary>
5454
public {{name}}() { Type = TypeId; }
5555
}
56-
}
56+
}

build/MTConnect.NET-SysML-Import/CSharp/Templates/Devices.DataItemType.scriban

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,4 @@ namespace MTConnect.Devices.DataItems
270270
}
271271
{{- end }}
272272
}
273-
}
273+
}

build/MTConnect.NET-SysML-Import/CSharp/Templates/Devices.Device.scriban

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,4 +764,4 @@ namespace MTConnect.Devices
764764
return null;
765765
}
766766
}
767-
}
767+
}

build/MTConnect.NET-SysML-Import/CSharp/Templates/Enum.scriban

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ namespace {{namespace}}
1717
{{ end }}
1818
{{- end }}
1919
}
20-
}
20+
}

build/MTConnect.NET-SysML-Import/CSharp/Templates/EnumOrStringDescriptions.scriban

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ namespace {{namespace}}
4141
}
4242
{{- end }}
4343
}
44-
}
44+
}

build/MTConnect.NET-SysML-Import/CSharp/Templates/EnumString.scriban

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ namespace {{namespace}}
1717
{{ end }}
1818
{{- end }}
1919
}
20-
}
20+
}

build/MTConnect.NET-SysML-Import/CSharp/Templates/Interface.scriban

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ namespace {{namespace}}
2121
{{ end }}{{ end }}
2222
{{- end }}
2323
}
24-
}
24+
}

0 commit comments

Comments
 (0)