diff --git a/MtconnectTranspiler.Sinks.CSharp.Example/Properties/launchSettings.json b/MtconnectTranspiler.Sinks.CSharp.Example/Properties/launchSettings.json index 4d158eaf..4949f3e5 100644 --- a/MtconnectTranspiler.Sinks.CSharp.Example/Properties/launchSettings.json +++ b/MtconnectTranspiler.Sinks.CSharp.Example/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "MtconnectTranspiler.Sinks.CSharp.Example": { "commandName": "Project", - "commandLineArgs": "\"%UserProfile%\\Desktop\\MTConnect Transpiled\\CSharp\"" + "commandLineArgs": "\"%UserProfile%\\Desktop\\MTConnect Transpiled\\CSharp\" \"C:\\Users\\LightWorks\\Source\\Repos\\mtconnect_sysml_model_dev\\MTConnect SysML Model.xml\"" } } } \ No newline at end of file diff --git a/MtconnectTranspiler.Sinks.CSharp.Example/Transpiler.cs b/MtconnectTranspiler.Sinks.CSharp.Example/Transpiler.cs index 7c5e4ba2..8a751127 100644 --- a/MtconnectTranspiler.Sinks.CSharp.Example/Transpiler.cs +++ b/MtconnectTranspiler.Sinks.CSharp.Example/Transpiler.cs @@ -101,7 +101,7 @@ public override void Transpile(XmiDocument model, CancellationToken cancellation { value.Name = value.SysML_Name; } - if (!categoryEnum.ValueTypes.ContainsKey(type.Name!)) categoryEnum.ValueTypes.Add(ScribanHelperMethods.ToUpperSnakeCode(type.Name), $"{type.Name}Values"); + if (!categoryEnum.ValueTypes.ContainsKey(type.Name!)) categoryEnum.ValueTypes.Add(CSharpHelperMethods.ToUpperSnakeCode(type.Name), $"{type.Name}Values"); valueEnums.Add(typeValuesEnum); } } @@ -110,7 +110,7 @@ public override void Transpile(XmiDocument model, CancellationToken cancellation if (subTypes != null && subTypes.ContainsKey(type.Name!)) { // Register type as having a subType in the CATEGORY enum - if (!categoryEnum.SubTypes.ContainsKey(type.Name!)) categoryEnum.SubTypes.Add(ScribanHelperMethods.ToUpperSnakeCode(type.Name), $"{type.Name}SubTypes"); + if (!categoryEnum.SubTypes.ContainsKey(type.Name!)) categoryEnum.SubTypes.Add(CSharpHelperMethods.ToUpperSnakeCode(type.Name), $"{type.Name}SubTypes"); var subTypeEnum = new ExampleEnum(model!, type, $"{type.Name}SubTypes") { Namespace = DataItemNamespace }; @@ -121,7 +121,7 @@ public override void Transpile(XmiDocument model, CancellationToken cancellation foreach (var item in subTypeEnum.Items) { if (!item.Name.Contains('.')) continue; - item.Name = ScribanHelperMethods.ToUpperSnakeCode(item.Name[(item.Name.IndexOf(".") + 1)..]); + item.Name = CSharpHelperMethods.ToUpperSnakeCode(item.Name[(item.Name.IndexOf(".") + 1)..]); } // Register the DataItem SubType Enum @@ -132,7 +132,7 @@ public override void Transpile(XmiDocument model, CancellationToken cancellation // Cleanup Enum names foreach (var item in categoryEnum.Items) { - item.Name = ScribanHelperMethods.ToUpperSnakeCode(item.Name); + item.Name = CSharpHelperMethods.ToUpperSnakeCode(item.Name); } // Register the DataItem Category Enum (ie. Samples, Events, Conditions) diff --git a/MtconnectTranspiler.Sinks.CSharp/Models/ScribanHelperMethods.cs b/MtconnectTranspiler.Sinks.CSharp/Models/CSharpHelperMethods.cs similarity index 96% rename from MtconnectTranspiler.Sinks.CSharp/Models/ScribanHelperMethods.cs rename to MtconnectTranspiler.Sinks.CSharp/Models/CSharpHelperMethods.cs index b026b9de..ea01de56 100644 --- a/MtconnectTranspiler.Sinks.CSharp/Models/ScribanHelperMethods.cs +++ b/MtconnectTranspiler.Sinks.CSharp/Models/CSharpHelperMethods.cs @@ -8,7 +8,7 @@ namespace MtconnectTranspiler.Sinks.CSharp.Models /// /// Helper methods to process content for scriban templates /// - public class ScribanHelperMethods : ScribanTemplates.ScribanHelperMethods + public class CSharpHelperMethods : ScribanTemplates.ScribanHelperMethods { private static Dictionary umlDataTypeToCSharp = new Dictionary() { diff --git a/MtconnectTranspiler.Sinks.CSharp/Models/CsharpType.cs b/MtconnectTranspiler.Sinks.CSharp/Models/CsharpType.cs index c30f0da8..398a6648 100644 --- a/MtconnectTranspiler.Sinks.CSharp/Models/CsharpType.cs +++ b/MtconnectTranspiler.Sinks.CSharp/Models/CsharpType.cs @@ -25,7 +25,7 @@ public virtual string Name get { if (string.IsNullOrEmpty(_name)) - _name = ScribanHelperMethods.ToPascalCase(base.SysML_Name); + _name = CSharpHelperMethods.ToPascalCase(base.SysML_Name); return _name; } set { _name = value; } diff --git a/MtconnectTranspiler.Sinks.CSharp/Models/EnumItem.cs b/MtconnectTranspiler.Sinks.CSharp/Models/EnumItem.cs index e0edd3fb..6c0df419 100644 --- a/MtconnectTranspiler.Sinks.CSharp/Models/EnumItem.cs +++ b/MtconnectTranspiler.Sinks.CSharp/Models/EnumItem.cs @@ -25,7 +25,7 @@ public string Name get { if (string.IsNullOrEmpty(_name)) - _name = ScribanHelperMethods.ToSnakeCase(base.SysML_Name); + _name = CSharpHelperMethods.ToSnakeCase(base.SysML_Name); return _name; } set { _name = value; } diff --git a/MtconnectTranspiler.Sinks.CSharp/Models/Property.cs b/MtconnectTranspiler.Sinks.CSharp/Models/Property.cs index e395be38..284be8a4 100644 --- a/MtconnectTranspiler.Sinks.CSharp/Models/Property.cs +++ b/MtconnectTranspiler.Sinks.CSharp/Models/Property.cs @@ -30,7 +30,7 @@ public Property(XmiDocument model, UmlProperty source) : base(model, source) AccessModifier = source.Visibility; - Type = ScribanHelperMethods.ToPrimitiveType(model, source)?.Name ?? "object"; + Type = CSharpHelperMethods.ToPrimitiveType(model, source)?.Name ?? "object"; } } } diff --git a/MtconnectTranspiler.Sinks.CSharp/Models/SummaryItem.cs b/MtconnectTranspiler.Sinks.CSharp/Models/SummaryItem.cs index bfae2cb4..1ffdd4d3 100644 --- a/MtconnectTranspiler.Sinks.CSharp/Models/SummaryItem.cs +++ b/MtconnectTranspiler.Sinks.CSharp/Models/SummaryItem.cs @@ -22,7 +22,7 @@ public SummaryItem(OwnedComment source) /// public override string ToString() { - return $"/// {ScribanHelperMethods.ToSummary(_source.Body)}"; + return $"/// {CSharpHelperMethods.ToSummary(_source.Body)}"; } } } diff --git a/MtconnectTranspiler.Sinks.CSharp/MtconnectTranspiler.Sinks.CSharp.csproj b/MtconnectTranspiler.Sinks.CSharp/MtconnectTranspiler.Sinks.CSharp.csproj index cfe28b5d..9c107316 100644 --- a/MtconnectTranspiler.Sinks.CSharp/MtconnectTranspiler.Sinks.CSharp.csproj +++ b/MtconnectTranspiler.Sinks.CSharp/MtconnectTranspiler.Sinks.CSharp.csproj @@ -4,7 +4,7 @@ netstandard2.0 True MTConnect Transpiler Sink for C# - 1.0.14-prerelease + 1.0.14.2-prerelease mtconnect, tbm0115 MTConnect Institute; TAMS; An implementation of `ITranspilerSink` from the `MtconnectTranspiler` library. This libary makes it possible to transpile the MTConnect Standard SysML model into C# code. @@ -42,7 +42,7 @@ - +