-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b1cb2d
commit 9ce374a
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
build/MTConnect.NET-SysML-Import/MTConnect.NET-SysML-Import.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters