diff --git a/build/AssemblyInfo.cs b/build/AssemblyInfo.cs index 20cc7067..0e37c45d 100644 --- a/build/AssemblyInfo.cs +++ b/build/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Reflection; -[assembly: AssemblyVersion("6.0.8")] -[assembly: AssemblyFileVersion("6.0.8")] +[assembly: AssemblyVersion("6.0.9")] +[assembly: AssemblyFileVersion("6.0.9")] [assembly: AssemblyCompany("TrakHound Inc.")] [assembly: AssemblyCopyright("Copyright (c) 2023 TrakHound Inc., All Rights Reserved.")] diff --git a/libraries/MTConnect.NET-Common/Devices/Device.cs b/libraries/MTConnect.NET-Common/Devices/Device.cs index 912dc4dc..82a73eeb 100644 --- a/libraries/MTConnect.NET-Common/Devices/Device.cs +++ b/libraries/MTConnect.NET-Common/Devices/Device.cs @@ -609,7 +609,7 @@ public static Device Process(IDevice device, Version mtconnectVersion) if (mtconnectVersion >= MTConnectVersions.Version13) obj.References = device.References; if (mtconnectVersion >= MTConnectVersions.Version17) obj.Configuration = device.Configuration; if (mtconnectVersion >= MTConnectVersions.Version18) obj.CoordinateSystemIdRef = device.CoordinateSystemIdRef; - obj.MTConnectVersion = device.MTConnectVersion != null ? device.MTConnectVersion : mtconnectVersion; + if (mtconnectVersion >= MTConnectVersions.Version17) obj.MTConnectVersion = device.MTConnectVersion != null ? device.MTConnectVersion : mtconnectVersion; if (mtconnectVersion >= MTConnectVersions.Version22) obj.Hash = device.Hash; // Add DataItems diff --git a/libraries/MTConnect.NET-JSON-cppagent/Devices/JsonDevice.cs b/libraries/MTConnect.NET-JSON-cppagent/Devices/JsonDevice.cs index b616a0e3..338eaf5a 100644 --- a/libraries/MTConnect.NET-JSON-cppagent/Devices/JsonDevice.cs +++ b/libraries/MTConnect.NET-JSON-cppagent/Devices/JsonDevice.cs @@ -17,8 +17,8 @@ public class JsonDevice [JsonPropertyName("uuid")] public string Uuid { get; set; } - [JsonPropertyName("instanceId")] - public long InstanceId { get; set; } + [JsonPropertyName("hash")] + public string Hash { get; set; } [JsonPropertyName("iso841Class")] public string Iso841Class { get; set; } @@ -67,7 +67,7 @@ public JsonDevice(IDevice device) Name = device.Name; NativeName = device.NativeName; Uuid = device.Uuid; - InstanceId = device.InstanceId; + Hash = device.Hash; if (device.SampleRate > 0) SampleRate = device.SampleRate; if (device.SampleInterval > 0) SampleInterval = device.SampleInterval; Iso841Class = device.Iso841Class; @@ -113,7 +113,7 @@ public Device ToDevice() device.Name = Name; device.NativeName = NativeName; device.Uuid = Uuid; - device.InstanceId = InstanceId; + device.Hash = Hash; device.SampleRate = SampleRate.HasValue ? SampleRate.Value : 0; device.SampleInterval = SampleInterval.HasValue ? SampleInterval.Value : 0; device.Iso841Class = Iso841Class; diff --git a/libraries/MTConnect.NET-JSON/Devices/JsonDevice.cs b/libraries/MTConnect.NET-JSON/Devices/JsonDevice.cs index 4e21db9f..48fab58a 100644 --- a/libraries/MTConnect.NET-JSON/Devices/JsonDevice.cs +++ b/libraries/MTConnect.NET-JSON/Devices/JsonDevice.cs @@ -23,8 +23,8 @@ public class JsonDevice [JsonPropertyName("uuid")] public string Uuid { get; set; } - [JsonPropertyName("instanceId")] - public long InstanceId { get; set; } + [JsonPropertyName("hash")] + public string Hash { get; set; } [JsonPropertyName("iso841Class")] public string Iso841Class { get; set; } @@ -74,7 +74,7 @@ public JsonDevice(IDevice device) Name = device.Name; NativeName = device.NativeName; Uuid = device.Uuid; - InstanceId = device.InstanceId; + Hash = device.Hash; if (device.SampleRate > 0) SampleRate = device.SampleRate; if (device.SampleInterval > 0) SampleInterval = device.SampleInterval; Iso841Class = device.Iso841Class; @@ -137,7 +137,7 @@ public Device ToDevice() device.Name = Name; device.NativeName = NativeName; device.Uuid = Uuid; - device.InstanceId = InstanceId; + device.Hash = Hash; device.SampleRate = SampleRate.HasValue ? SampleRate.Value : 0; device.SampleInterval = SampleInterval.HasValue ? SampleInterval.Value : 0; device.Iso841Class = Iso841Class; diff --git a/libraries/MTConnect.NET-XML/Devices/XmlDevice.cs b/libraries/MTConnect.NET-XML/Devices/XmlDevice.cs index d7c27f6e..0968a919 100644 --- a/libraries/MTConnect.NET-XML/Devices/XmlDevice.cs +++ b/libraries/MTConnect.NET-XML/Devices/XmlDevice.cs @@ -85,7 +85,7 @@ protected IDevice ToDevice(Device device) device.SampleInterval = SampleInterval; device.Iso841Class = Iso841Class; device.CoordinateSystemIdRef = CoordinateSystemIdRef; - device.Hash = device.Hash; + device.Hash = Hash; if (Version.TryParse(MTConnectVersion, out var mtconnectVersion)) { device.MTConnectVersion = mtconnectVersion; @@ -236,7 +236,7 @@ public static void WriteXml(XmlWriter writer, IDevice device, bool outputComment if (device.SampleRate > 0) writer.WriteAttributeString("sampleRate", device.SampleRate.ToString()); if (!string.IsNullOrEmpty(device.CoordinateSystemIdRef)) writer.WriteAttributeString("coordinateSystemIdRef", device.CoordinateSystemIdRef); if (device.MTConnectVersion != null) writer.WriteAttributeString("mtconnectVersion", device.MTConnectVersion.ToString()); - if (device.MTConnectVersion != null && device.MTConnectVersion >= MTConnectVersions.Version22) writer.WriteAttributeString("hash", device.Hash); + if (!string.IsNullOrEmpty(device.Hash)) writer.WriteAttributeString("hash", device.Hash); // Write Description XmlDescription.WriteXml(writer, device.Description);