Skip to content

Commit

Permalink
Updated MTConnect Versions to include v2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickRitchie committed Oct 21, 2024
1 parent e6992c4 commit ecb30b0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/MTConnect.NET-Common/MTConnectVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace MTConnect
{
public static class MTConnectVersions
{
public static Version Max => Version23;
public static Version Max => Version24;

public static readonly Version Version10 = new Version(1, 0);
public static readonly Version Version11 = new Version(1, 1);
Expand All @@ -22,5 +22,6 @@ public static class MTConnectVersions
public static readonly Version Version21 = new Version(2, 1);
public static readonly Version Version22 = new Version(2, 2);
public static readonly Version Version23 = new Version(2, 3);
public static readonly Version Version24 = new Version(2, 4);
}
}
1 change: 1 addition & 0 deletions libraries/MTConnect.NET-XML/MTConnectVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static Version GetByNamespace(string ns)
{
if (ns != null)
{
if (Namespaces.Version23.Match(ns)) return MTConnectVersions.Version24;
if (Namespaces.Version23.Match(ns)) return MTConnectVersions.Version23;
if (Namespaces.Version22.Match(ns)) return MTConnectVersions.Version22;
if (Namespaces.Version21.Match(ns)) return MTConnectVersions.Version21;
Expand Down
17 changes: 17 additions & 0 deletions libraries/MTConnect.NET-XML/Namespaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public static string GetDevices(int majorVerion, int minorVersion)
case 1: return Version21.Devices;
case 2: return Version22.Devices;
case 3: return Version23.Devices;
case 4: return Version24.Devices;
}

break;
Expand Down Expand Up @@ -119,6 +120,7 @@ public static string GetStreams(int majorVerion, int minorVersion)
case 1: return Version21.Streams;
case 2: return Version22.Streams;
case 3: return Version23.Streams;
case 4: return Version24.Streams;
}

break;
Expand Down Expand Up @@ -207,6 +209,7 @@ public static string GetAssets(int majorVerion, int minorVersion)
case 1: return Version21.Assets;
case 2: return Version22.Assets;
case 3: return Version23.Assets;
case 4: return Version24.Assets;
}

break;
Expand Down Expand Up @@ -244,6 +247,7 @@ public static string GetError(int majorVerion, int minorVersion)
case 1: return Version21.Error;
case 2: return Version22.Error;
case 3: return Version23.Error;
case 4: return Version24.Error;
}

break;
Expand All @@ -267,6 +271,19 @@ public static string Clear(string xml)
}


internal static class Version24
{
public const string Assets = "urn:mtconnect.org:MTConnectAssets:2.4";
public const string Devices = "urn:mtconnect.org:MTConnectDevices:2.4";
public const string Error = "urn:mtconnect.org:MTConnectError:2.4";
public const string Streams = "urn:mtconnect.org:MTConnectStreams:2.4";

public static bool Match(string ns)
{
return ns == Assets || ns == Devices || ns == Error || ns == Streams;
}
}

internal static class Version23
{
public const string Assets = "urn:mtconnect.org:MTConnectAssets:2.3";
Expand Down

0 comments on commit ecb30b0

Please sign in to comment.