diff --git a/Adaptation/FileHandlers/OpenInsight/FileRead.cs b/Adaptation/FileHandlers/OpenInsight/FileRead.cs index aa4469c..e5adb32 100644 --- a/Adaptation/FileHandlers/OpenInsight/FileRead.cs +++ b/Adaptation/FileHandlers/OpenInsight/FileRead.cs @@ -165,17 +165,20 @@ public class FileRead : Shared.FileRead, IFileRead string lines = GetLines(_Logistics, descriptions); if (!string.IsNullOrEmpty(lines)) { + int? count; long? subGroupId; long breakAfter = dateTime.AddSeconds(_BreakAfterSeconds).Ticks; long preWait = _FileConnectorConfiguration?.FileHandleWaitTime is null ? dateTime.AddMilliseconds(1234).Ticks : dateTime.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks; if (string.IsNullOrEmpty(descriptions[0].Reactor) || string.IsNullOrEmpty(descriptions[0].PSN) || string.IsNullOrEmpty(descriptions[0].RDS)) - subGroupId = null; + (subGroupId, count) = (null, null); else - (subGroupId, string _) = FromIQS.GetCommandText(_IqsConnectionString, _Logistics, descriptions[0], breakAfter, preWait); + (subGroupId, count, string _) = FromIQS.GetCommandText(_IqsConnectionString, _Logistics, descriptions[0], breakAfter, preWait); if (subGroupId is null) collection.Add(new(new ScopeInfo(tests[0], _OpenInsightFilePattern), lines)); - else + else if (count is null) collection.Add(new(new ScopeInfo(tests[0], $"{subGroupId.Value} {_OpenInsightFilePattern}"), lines)); + else + collection.Add(new(new ScopeInfo(tests[0], $"{subGroupId.Value} E{count.Value} {_OpenInsightFilePattern}"), lines)); } } if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0) diff --git a/Adaptation/FileHandlers/OpenInsight/FromIQS.cs b/Adaptation/FileHandlers/OpenInsight/FromIQS.cs index 755bdfc..07d416e 100644 --- a/Adaptation/FileHandlers/OpenInsight/FromIQS.cs +++ b/Adaptation/FileHandlers/OpenInsight/FromIQS.cs @@ -29,7 +29,12 @@ public class FromIQS .AppendLine(" pl.f_name pl_name, ") .AppendLine(" pd.f_name pd_name, ") .AppendLine(" td.f_test td_test, ") - .AppendLine(" td.f_name td_name ") + .AppendLine(" td.f_name td_name, ") + .AppendLine(" (select count(ev.f_evnt) ") + .AppendLine(" from [spcepiworld].[dbo].[evnt_inf] ev ") + .AppendLine(" where ev.f_prcs = rd.f_prcs ") + .AppendLine(" and ev.f_part = pd.f_part ") + .AppendLine(" and ev.f_sgtm = se.f_sgtm) ev_count ") .AppendLine(" from [spcepiworld].[dbo].[sgrp_ext] se ") .AppendLine(" join [spcepiworld].[dbo].[prcs_dat] rd ") .AppendLine(" on se.f_prcs = rd.f_prcs ") @@ -67,9 +72,10 @@ public class FromIQS return stringBuilder; } - internal static (long?, string) GetCommandText(string connectionString, Logistics logistics, txt.Description description, long breakAfter, long preWait) + internal static (long?, int?, string) GetCommandText(string connectionString, Logistics logistics, txt.Description description, long breakAfter, long preWait) { string dateTime; + int? count = null; string commandText; long? result = null; string dateFormat = txt.Description.GetDateFormat(); @@ -113,10 +119,12 @@ public class FromIQS { result = subGroupId; commandText = GetCommandText(logistics, description, dateTime, subGroupId); + if (jsonProperties.Any() && jsonProperties[10].Name == "ev_count" && int.TryParse(jsonProperties[10].Value.ToString(), out int evCount)) + count = evCount; } } } - return new(result, commandText); + return new(result, count, commandText); } #nullable disable diff --git a/Adaptation/MET08RESIMAPCDE.Tests.csproj b/Adaptation/MET08RESIMAPCDE.Tests.csproj index b6771f7..106b25d 100644 --- a/Adaptation/MET08RESIMAPCDE.Tests.csproj +++ b/Adaptation/MET08RESIMAPCDE.Tests.csproj @@ -34,7 +34,7 @@ - + NU1701 NU1701 NU1701 @@ -53,7 +53,7 @@ - +