Skip to content

Commit

Permalink
Added SysML Import Project
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickRitchie committed Oct 25, 2023
1 parent 4b1cb2d commit 9ce374a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
15 changes: 15 additions & 0 deletions build/MTConnect.NET-SysML-Import/MTConnect.NET-SysML-Import.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MTConnect.NET_SysML_Import</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\MTConnect.NET-SysML\MTConnect.NET-SysML.csproj" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions build/MTConnect.NET-SysML-Import/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using MTConnect.SysML.CSharp;
using MTConnect.SysML;
using System.Text.Json;

var xmlPath = @"D:\TrakHound\MTConnect\MTConnectSysMLModel.xml";
var outputPath = @"C:\temp\mtconnect-model-results";

var mtconnectModel = MTConnectModel.Parse(xmlPath);

var jsonOptions = new JsonSerializerOptions();
jsonOptions.WriteIndented = true;
jsonOptions.DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault;
jsonOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;

var json = JsonSerializer.Serialize(mtconnectModel, options: jsonOptions);
await File.WriteAllTextAsync(@"C:\temp\mtconnect-model.json", json);

CSharpTemplateRenderer.Render(mtconnectModel, outputPath);
9 changes: 9 additions & 0 deletions src/MTConnect.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-TLS", "MTConn
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTConnect.NET-SysML", "MTConnect.NET-SysML\MTConnect.NET-SysML.csproj", "{30D59D35-96E8-4E41-B8F7-D1B211DFC360}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTConnect.NET-SysML-Import", "..\build\MTConnect.NET-SysML-Import\MTConnect.NET-SysML-Import.csproj", "{2B098F26-85B1-4719-B389-001196E30446}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -322,6 +324,12 @@ Global
{30D59D35-96E8-4E41-B8F7-D1B211DFC360}.Package|Any CPU.Build.0 = Debug|Any CPU
{30D59D35-96E8-4E41-B8F7-D1B211DFC360}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30D59D35-96E8-4E41-B8F7-D1B211DFC360}.Release|Any CPU.Build.0 = Release|Any CPU
{2B098F26-85B1-4719-B389-001196E30446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B098F26-85B1-4719-B389-001196E30446}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B098F26-85B1-4719-B389-001196E30446}.Package|Any CPU.ActiveCfg = Debug|Any CPU
{2B098F26-85B1-4719-B389-001196E30446}.Package|Any CPU.Build.0 = Debug|Any CPU
{2B098F26-85B1-4719-B389-001196E30446}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B098F26-85B1-4719-B389-001196E30446}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -360,6 +368,7 @@ Global
{44BAF649-0F9F-446A-B1A4-6F2DCF91C968} = {6C3F47E0-BC95-48CB-93A4-C34A0D5CA43B}
{61CB960E-761A-4F89-A365-E9394AD3FA30} = {6C3F47E0-BC95-48CB-93A4-C34A0D5CA43B}
{82B8CF89-A378-47FF-B0DE-EE5F020D9586} = {E0233BEB-F66C-43C4-9DC8-20182894CF5F}
{2B098F26-85B1-4719-B389-001196E30446} = {BBF53739-168D-4635-8595-083AC0C65E4C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CC13D3AD-18BF-4695-AB2A-087EF0885B20}
Expand Down

0 comments on commit 9ce374a

Please sign in to comment.