diff --git a/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputDevices.cs b/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputDevices.cs new file mode 100644 index 00000000..462e2920 --- /dev/null +++ b/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputDevices.cs @@ -0,0 +1,37 @@ +using MTConnect.Devices; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace MTConnect.Mqtt +{ + public class MTConnectMqttInputDevices + { + [JsonPropertyName("devices")] + public Dictionary Devices { get; set; } + + + public MTConnectMqttInputDevices() { } + + public MTConnectMqttInputDevices(IDevice device) + { + if (device != null && !string.IsNullOrEmpty(device.Uuid)) + { + + } + } + + public MTConnectMqttInputDevices(IEnumerable devices) + { + if (!devices.IsNullOrEmpty()) + { + foreach (var device in devices) + { + if (device != null && !string.IsNullOrEmpty(device.Uuid)) + { + + } + } + } + } + } +} diff --git a/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputObservation.cs b/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputObservation.cs index 2187a990..ca3649f2 100644 --- a/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputObservation.cs +++ b/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputObservation.cs @@ -5,8 +5,8 @@ namespace MTConnect.Mqtt { public class MTConnectMqttInputObservation { - [JsonPropertyName("dataItemKey")] - public string DataItemKey { get; set; } + [JsonPropertyName("dataItem")] + public string DataItem { get; set; } [JsonPropertyName("values")] public Dictionary Values { get; set; } @@ -16,7 +16,7 @@ public MTConnectMqttInputObservation() { } public MTConnectMqttInputObservation(string dataItemKey, Dictionary values) { - DataItemKey = dataItemKey; + DataItem = dataItemKey; Values = values; } } diff --git a/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputModel.cs b/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputObservations.cs similarity index 94% rename from libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputModel.cs rename to libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputObservations.cs index 5ab52b0c..ff0fc29e 100644 --- a/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputModel.cs +++ b/libraries/MTConnect.NET-MQTT/Input/MTConnectMqttInputObservations.cs @@ -8,7 +8,7 @@ namespace MTConnect.Mqtt { - public class MTConnectMqttInputModel + public class MTConnectMqttInputObservations { [JsonPropertyName("timestamp")] public DateTime Timestamp { get; set; } @@ -34,10 +34,10 @@ private static IEnumerable ToObservationInputs(DateTime times foreach (var mqttObservation in mqttObservations) { - if (!string.IsNullOrEmpty(mqttObservation.DataItemKey) && !mqttObservation.Values.IsNullOrEmpty()) + if (!string.IsNullOrEmpty(mqttObservation.DataItem) && !mqttObservation.Values.IsNullOrEmpty()) { var observation = new ObservationInput(); - observation.DataItemKey = mqttObservation.DataItemKey; + observation.DataItemKey = mqttObservation.DataItem; observation.Timestamp = ts; foreach (var value in mqttObservation.Values)