diff --git a/Server/Data/Tests/InfinityQSV3-GetEpiProTempVerification.html b/Server/Data/Tests/InfinityQSV3-GetEpiProTempVerification.html new file mode 100644 index 0000000..d43283f --- /dev/null +++ b/Server/Data/Tests/InfinityQSV3-GetEpiProTempVerification.html @@ -0,0 +1 @@ +44Productive616747001/1/0001 12:00:00 AM50Productive001/1/0001 12:00:00 AM48Unscheduled Down001/1/0001 12:00:00 AM42Scheduled Down616741001/1/0001 12:00:00 AM40Unscheduled Down616740001/1/0001 12:00:00 AM46Productive001/1/0001 12:00:00 AM54Non-Scheduled001/1/0001 12:00:00 AM \ No newline at end of file diff --git a/Server/Repositories/InfinityQSV3Repository.cs b/Server/Repositories/InfinityQSV3Repository.cs index 7ae0ac3..664e004 100644 --- a/Server/Repositories/InfinityQSV3Repository.cs +++ b/Server/Repositories/InfinityQSV3Repository.cs @@ -428,7 +428,10 @@ public class InfinityQSV3Repository : IInfinityQSV3Repository else { result = new(); + int loadedCount; Reactor? reactor; + string loadedRDS; + int reactorNumber; IInfinityQSV3Repository infinityQSV3Repository = this; string commandText = infinityQSV3Repository.GetCommandText(eppReactorNumbers); StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText); @@ -437,12 +440,18 @@ public class InfinityQSV3Repository : IInfinityQSV3Repository throw new NullReferenceException(nameof(results)); foreach (InfinityQS1090FullLoad infinityQS1090FullLoad in results) { - if (infinityQS1090FullLoad.Reactor is null || !eppReactors.TryGetValue(infinityQS1090FullLoad.Reactor.Value, out reactor)) + if (infinityQS1090FullLoad.Reactor is null) continue; + if (!int.TryParse(infinityQS1090FullLoad.Reactor, out reactorNumber)) + continue; + if (!eppReactors.TryGetValue(reactorNumber, out reactor)) + continue; + loadedCount = reactor.LoadedRDS is null ? 0 : reactor.LoadedRDS.Count; + loadedRDS = reactor.LoadedRDS is null ? "" : reactor.LoadedRDS[0].ToString(); _ = result.Append(""). Append("").Append(reactor.ReactorNo).Append(""). Append("").Append(reactor.E10State).Append(""). - Append("").Append(reactor.LoadedRDS.Count == 0 ? "" : reactor.LoadedRDS[0]).Append(""). + Append("").Append(loadedRDS).Append(""). Append("").Append(infinityQS1090FullLoad.Value).Append(""). Append("").Append(infinityQS1090FullLoad.TemperatureOffsetPercentage).Append(""). Append("").Append(infinityQS1090FullLoad.SubGroupIdFormated).Append(""). diff --git a/Shared/DataModels/InfinityQSEpp.cs b/Shared/DataModels/InfinityQS1090FullLoad.cs similarity index 58% rename from Shared/DataModels/InfinityQSEpp.cs rename to Shared/DataModels/InfinityQS1090FullLoad.cs index 002e52e..dbdf072 100644 --- a/Shared/DataModels/InfinityQSEpp.cs +++ b/Shared/DataModels/InfinityQS1090FullLoad.cs @@ -3,11 +3,11 @@ using System.Text.Json.Serialization; namespace OI.Metrology.Shared.DataModels; public record InfinityQS1090FullLoad([property: JsonPropertyName("se_sgrp")] int SubGroupId, - [property: JsonPropertyName("se_date_time")] DateTime SubGroupIdFormated, - [property: JsonPropertyName("pr_name")] int? Reactor, - [property: JsonPropertyName("pd_name")] int? Part, - [property: JsonPropertyName("se_value")] int Value, - [property: JsonPropertyName("se_temp_offset_percent")] int TemperatureOffsetPercentage); + [property: JsonPropertyName("se_date_time")] DateTime SubGroupIdFormated, + [property: JsonPropertyName("pr_name")] string Reactor, + [property: JsonPropertyName("pd_name")] string Part, + [property: JsonPropertyName("se_value")] float Value, + [property: JsonPropertyName("se_temp_offset_percent")] float TemperatureOffsetPercentage); [JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)] [JsonSerializable(typeof(InfinityQS1090FullLoad))]