Skip to content

Commit

Permalink
Bump update
Browse files Browse the repository at this point in the history
  • Loading branch information
tbm0115 committed Nov 1, 2023
1 parent dc7db16 commit 113b312
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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\""
}
}
}
8 changes: 4 additions & 4 deletions MtconnectTranspiler.Sinks.CSharp.Example/Transpiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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 };

Expand All @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace MtconnectTranspiler.Sinks.CSharp.Models
/// <summary>
/// Helper methods to process content for scriban templates
/// </summary>
public class ScribanHelperMethods : ScribanTemplates.ScribanHelperMethods
public class CSharpHelperMethods : ScribanTemplates.ScribanHelperMethods
{
private static Dictionary<string, Type> umlDataTypeToCSharp = new Dictionary<string, Type>()
{
Expand Down
2 changes: 1 addition & 1 deletion MtconnectTranspiler.Sinks.CSharp/Models/CsharpType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion MtconnectTranspiler.Sinks.CSharp/Models/EnumItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion MtconnectTranspiler.Sinks.CSharp/Models/Property.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
}
2 changes: 1 addition & 1 deletion MtconnectTranspiler.Sinks.CSharp/Models/SummaryItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public SummaryItem(OwnedComment source)
/// <inheritdoc />
public override string ToString()
{
return $"/// {ScribanHelperMethods.ToSummary(_source.Body)}";
return $"/// {CSharpHelperMethods.ToSummary(_source.Body)}";
}
}
}
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>1.0.14-prerelease</Version>
<Version>1.0.14.2-prerelease</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 Expand Up @@ -42,7 +42,7 @@
<ItemGroup>
<PackageReference Include="CaseExtensions" Version="1.1.0" />
<PackageReference Include="MtconnectTranspiler" Version="1.0.8-prerelease" />
<PackageReference Include="MtconnectTranspiler.Sinks.ScribanTemplates" Version="1.0.15-prerelease" />
<PackageReference Include="MtconnectTranspiler.Sinks.ScribanTemplates" Version="1.0.15.2-prerelease" />
<PackageReference Include="Scriban" Version="5.9.0" />
</ItemGroup>

Expand Down

0 comments on commit 113b312

Please sign in to comment.