Skip to content

Commit

Permalink
Ordinal comparison
Browse files Browse the repository at this point in the history
 - Changed comparison of Observation Type names ordinal with a removal of '_' characters on both sides between IClass and IEnum comparisons
  • Loading branch information
tbm0115 committed Aug 24, 2024
1 parent cbf5452 commit 1553964
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>MTConnect Transpiler Sink for C#</Title>
<Version>2.4.0-prerelease.15</Version>
<Version>2.4.0-prerelease.16</Version>
<Authors>mtconnect, tbm0115</Authors>
<Company>MTConnect Institute; TAMS;</Company>
<Description>An implementation of `ITranspilerSink` from the `MtconnectTranspiler` library. This libary makes it possible to transpile the MTConnect Standard SysML model into C# code.</Description>
Expand Down
2 changes: 1 addition & 1 deletion MtconnectTranspiler.Sinks.CSharp/NavigationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static IEnumerable<ObservationType> GetObservationTypes(CategoryEnum cate
HelpUrl = o.HelpUrl,
Category = categoryName,
Name = o.Name,
Definition = (Activator.CreateInstance(o.Properties.Properties.FirstOrDefault(p => p.Name.Equals("type", StringComparison.OrdinalIgnoreCase))?.Type) as IEnum)?.Values?.FirstOrDefault(v => v.Name.Equals(o.Name, StringComparison.OrdinalIgnoreCase))?.Summary ?? o.Summary,
Definition = (Activator.CreateInstance(o.Properties.Properties.FirstOrDefault(p => p.Name.Equals("type", StringComparison.OrdinalIgnoreCase))?.Type) as IEnum)?.Values?.FirstOrDefault(v => v.Name.Replace("_", string.Empty).Equals(o.Name.Replace("_", string.Empty), StringComparison.OrdinalIgnoreCase))?.Summary ?? o.Summary,
Introduced = o.NormativeVersion,
Deprecated = o.DeprecatedVersion,
Properties = o.Properties.Properties,
Expand Down

0 comments on commit 1553964

Please sign in to comment.