Skip to content

chore(build): add mtconnect_sysml_model as a submodule#162

Draft
ottobolyos wants to merge 1 commit into
TrakHound:masterfrom
ottobolyos:chore/sysml-model-submodule
Draft

chore(build): add mtconnect_sysml_model as a submodule#162
ottobolyos wants to merge 1 commit into
TrakHound:masterfrom
ottobolyos:chore/sysml-model-submodule

Conversation

@ottobolyos
Copy link
Copy Markdown
Contributor

@ottobolyos ottobolyos commented May 15, 2026

Summary

Add mtconnect_sysml_model as a tracked git submodule at build/sysml-model, pinned to tag v2.7. The submodule replaces the prior documented-but-untracked external clone pattern (where contributors had to git clone https://github.com/mtconnect/mtconnect_sysml_model.git to some out-of-tree path and pass --xmi manually to MTConnect.NET-SysML-Import).

Why

The regen pipeline that builds Devices/Components/*.g.cs, Devices/DataItems/*.g.cs, the asset / events / samples / conditions hierarchies, and the organizer lists needs a pinned XMI source so the output is reproducible. A submodule makes the version explicit in-tree and ties the commit history of regenerated code to a specific upstream model commit.

What changed

  • .gitmodules - new entry registering build/sysml-model against https://github.com/mtconnect/mtconnect_sysml_model.git.
  • build/sysml-model - submodule pointer at tag v2.7 (commit 25796ac59).
  • build/MTConnect.NET-SysML-Import/README.md - regen recipe rewritten to reference the in-tree submodule path; the legacy git clone ... /tmp/mtconnect-sysml recipe retained as an ad-hoc fallback for one-off regens against an unpinned commit.

@ottobolyos ottobolyos force-pushed the chore/sysml-model-submodule branch from 0f22556 to 2cfd465 Compare May 18, 2026 21:08
@ottobolyos ottobolyos marked this pull request as ready for review May 18, 2026 21:08
@ottobolyos ottobolyos marked this pull request as draft May 18, 2026 21:10
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request May 22, 2026
…ides

Resolves the hand-written CS0108 'hides inherited member' warnings:

* libraries/MTConnect.NET-XML/Assets/.../Xml*Asset.cs (6 files,
  WriteXml(XmlWriter, IAsset)) - all derived helpers redeclare the
  base XmlAsset.WriteXml static; mark as 'new'.
* libraries/MTConnect.NET-XML/Assets/XmlUnknownAsset.cs - FromXml
  string overload redeclares base XmlAsset.FromXml; mark as 'new'.
* libraries/MTConnect.NET-Common/Devices/IComponent.cs - the
  'string Type { get; }' member redeclares IContainer.Type; mark
  as 'new'.
* libraries/MTConnect.NET-Common/Devices/IDevice.cs - the
  'string Type { get; }' member redeclares IComponent.Type;
  mark as 'new'.
* libraries/MTConnect.NET-Common/Assets/Files/FileAsset.cs - the
  'TypeId' const redeclares AbstractFileAsset.TypeId; mark as
  'new'.
* libraries/MTConnect.NET-Common/Buffers/MTConnectObservationFileBuffer.cs -
  Dispose() redeclares the non-virtual base; mark as 'new'.
* build/MTConnect.NET-SysML-Import/CSharp/InterfaceDataItemType.cs -
  RenderInterface()/RenderDescriptions() redeclare the non-virtual
  base DataItemType methods; mark as 'new'.
* libraries/MTConnect.NET-SysML/Models/Devices/MTConnectInterfaceDataItemType.cs -
  static Parse() with the override-style signature on
  MTConnectDataItemType; mark as 'new'.

The remaining 10 CS0108 cases sit in '.g.cs' files generated from
the SysML XMI by the importer. Per CONVENTIONS sec15c, '.g.cs' files
must not be hand-edited - the fix has to land in the importer's
Scriban template (so the regen output carries 'new' on properties
that hide a parent-interface member). That work is queued for a
follow-up PR after the mtconnect_sysml_model submodule lands
(currently in flight as PR TrakHound#162) so the regen can be reproduced
deterministically in CI.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request May 22, 2026
…ides

Resolves the hand-written CS0108 'hides inherited member' warnings:

* libraries/MTConnect.NET-XML/Assets/.../Xml*Asset.cs (6 files,
  WriteXml(XmlWriter, IAsset)) - all derived helpers redeclare the
  base XmlAsset.WriteXml static; mark as 'new'.
* libraries/MTConnect.NET-XML/Assets/XmlUnknownAsset.cs - FromXml
  string overload redeclares base XmlAsset.FromXml; mark as 'new'.
* libraries/MTConnect.NET-Common/Devices/IComponent.cs - the
  'string Type { get; }' member redeclares IContainer.Type; mark
  as 'new'.
* libraries/MTConnect.NET-Common/Devices/IDevice.cs - the
  'string Type { get; }' member redeclares IComponent.Type;
  mark as 'new'.
* libraries/MTConnect.NET-Common/Assets/Files/FileAsset.cs - the
  'TypeId' const redeclares AbstractFileAsset.TypeId; mark as
  'new'.
* libraries/MTConnect.NET-Common/Buffers/MTConnectObservationFileBuffer.cs -
  Dispose() redeclares the non-virtual base; mark as 'new'.
* build/MTConnect.NET-SysML-Import/CSharp/InterfaceDataItemType.cs -
  RenderInterface()/RenderDescriptions() redeclare the non-virtual
  base DataItemType methods; mark as 'new'.
* libraries/MTConnect.NET-SysML/Models/Devices/MTConnectInterfaceDataItemType.cs -
  static Parse() with the override-style signature on
  MTConnectDataItemType; mark as 'new'.

The remaining 10 CS0108 cases sit in '.g.cs' files generated from
the SysML XMI by the importer. Per CONVENTIONS sec15c, '.g.cs' files
must not be hand-edited - the fix has to land in the importer's
Scriban template (so the regen output carries 'new' on properties
that hide a parent-interface member). That work is queued for a
follow-up PR after the mtconnect_sysml_model submodule lands
(currently in flight as PR TrakHound#162) so the regen can be reproduced
deterministically in CI.
…-model

Pins the SysML XMI source of truth as a tracked submodule rather than a
documented-but-untracked external clone. The submodule's default tip
tracks `v2.7` (the latest published spec version); switching to a prior
version is `git -C build/sysml-model checkout v2.5` (or `v2.6`, `v2.0`,
etc.) followed by a regen.

Worktree usage:

* In the main checkout: `git submodule update --init build/sysml-model`
  once after pulling, then the path is populated and the importer can
  consume `--xmi build/sysml-model/MTConnectSysMLModel.xml` directly.
* In a `git worktree`-created tree: the submodule must be initialised
  per-worktree (`git -C <worktree> submodule update --init
  build/sysml-model`). The submodule's own `.git` lives under the
  primary repository's `.git/modules/build/sysml-model/`; per-worktree
  trees share the gitdir and only differ in their working-tree
  checkout.
* For multi-version regen in parallel: the submodule's gitdir is
  shared, so `git -C build/sysml-model worktree add /tmp/sysml-v2.6
  v2.6` creates a v2.6 working tree without disturbing the primary
  v2.7 checkout. The importer can then be pointed at
  `/tmp/sysml-v2.6/MTConnectSysMLModel.xml` while the main tree
  retains the v2.7 model.

Updated `build/MTConnect.NET-SysML-Import/README.md` regen recipe to
reference the submodule path; the prior recipe instructed contributors
to clone the model into `/tmp/mtconnect-sysml` which is now replaced
by the in-tree submodule. The clone option remains documented as the
fallback for ad-hoc one-off regens against an unpinned commit.
@ottobolyos ottobolyos force-pushed the chore/sysml-model-submodule branch from 2cfd465 to dbb7036 Compare May 22, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants