diff --git a/build/MTConnect.NET-SysML-Import/MTConnect.NET-SysML-Import.csproj b/build/MTConnect.NET-SysML-Import/MTConnect.NET-SysML-Import.csproj new file mode 100644 index 00000000..6c42f2c1 --- /dev/null +++ b/build/MTConnect.NET-SysML-Import/MTConnect.NET-SysML-Import.csproj @@ -0,0 +1,15 @@ + + + + Exe + net6.0 + MTConnect.NET_SysML_Import + enable + enable + + + + + + + diff --git a/build/MTConnect.NET-SysML-Import/Program.cs b/build/MTConnect.NET-SysML-Import/Program.cs new file mode 100644 index 00000000..481d7ce1 --- /dev/null +++ b/build/MTConnect.NET-SysML-Import/Program.cs @@ -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); \ No newline at end of file diff --git a/src/MTConnect.NET.sln b/src/MTConnect.NET.sln index 9b019e69..ddd6cf46 100644 --- a/src/MTConnect.NET.sln +++ b/src/MTConnect.NET.sln @@ -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 @@ -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 @@ -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}