From a2be6bef318137e0bc14e8af4f6e019deccf2fa6 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Tue, 28 Mar 2023 07:32:38 -0700 Subject: [PATCH] Indirectly disabled tickoffset by setting it to 0 --- Adaptation/FileHandlers/Stratus/FileRead.cs | 2 +- Adaptation/FileHandlers/Stratus/ProcessData.cs | 16 ++++++++-------- Adaptation/FileHandlers/txt/ProcessData.cs | 4 ++-- Adaptation/MET08THFTIRSTRATUS-Development.yml | 10 +++++++++- Adaptation/MET08THFTIRSTRATUS.yml | 10 +++++++++- Adaptation/_Tests/Static/Stratus.cs | 7 +++---- 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/Adaptation/FileHandlers/Stratus/FileRead.cs b/Adaptation/FileHandlers/Stratus/FileRead.cs index 8257b6f..21e1d06 100644 --- a/Adaptation/FileHandlers/Stratus/FileRead.cs +++ b/Adaptation/FileHandlers/Stratus/FileRead.cs @@ -100,7 +100,7 @@ public class FileRead : Shared.FileRead, IFileRead private Tuple> GetExtractResult(string reportFullPath, DateTime dateTime) { Tuple> results = new(string.Empty, null, null, new List()); - _TickOffset ??= new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks; + _TickOffset ??= 0; // new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks; _Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true); SetFileParameterLotIDToLogisticsMID(); if (_Logistics.FileInfo.Length < _MinFileLength) diff --git a/Adaptation/FileHandlers/Stratus/ProcessData.cs b/Adaptation/FileHandlers/Stratus/ProcessData.cs index bc109d6..447020e 100644 --- a/Adaptation/FileHandlers/Stratus/ProcessData.cs +++ b/Adaptation/FileHandlers/Stratus/ProcessData.cs @@ -246,15 +246,15 @@ public partial class ProcessData : IProcessData return result; } - private static (string, string) GetReactorAndRDS(string defaultReactor, string defaultRDS, string text, string formattedText, string[] segments, bool hasRDS) + private static (string, string) GetReactorAndRDS(string defaultReactor, string defaultRDS, string text, string formattedText, string[] segments) { string rds; string reactor; - if (string.IsNullOrEmpty(text) || segments.Length == 0 || string.IsNullOrEmpty(formattedText) || (segments.Length > 1 && !hasRDS)) + if (string.IsNullOrEmpty(text) || segments.Length == 0 || string.IsNullOrEmpty(formattedText)) reactor = defaultReactor; else reactor = segments[0]; - if (segments.Length <= 1 || !int.TryParse(segments[1].Replace("QP", string.Empty), out int rdsValue) || rdsValue < 99) + if (segments.Length <= 1 || !int.TryParse(segments[1], out int rdsValue) || rdsValue < 99) rds = defaultRDS; else rds = segments[1]; @@ -266,11 +266,11 @@ public partial class ProcessData : IProcessData return new(reactor, rds); } - private static (string, string) GetLayerAndPSN(string defaultLayer, string defaultPSN, string[] segments, bool hasRDS) + private static (string, string) GetLayerAndPSN(string defaultLayer, string defaultPSN, string[] segments) { string psn; string layer; - if (segments.Length <= 2 || (segments.Length > 1 && !hasRDS)) + if (segments.Length <= 2) { psn = defaultPSN; layer = defaultLayer; @@ -360,9 +360,9 @@ public partial class ProcessData : IProcessData segments = cassette.Split(new char[] { '.' }); else segments = cassette.Split(new char[] { '\u005F' }); - bool hasRDS = Regex.IsMatch(cassette, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?"); - (reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, cassette, segments, hasRDS); - (layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments, hasRDS); + // bool hasRDS = Regex.IsMatch(cassette, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?"); + (reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, cassette, segments); + (layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments); zone = GetZone(segments); if (segments.Length <= 3 || segments[3].Length <= 1) employee = defaultEmployee; diff --git a/Adaptation/FileHandlers/txt/ProcessData.cs b/Adaptation/FileHandlers/txt/ProcessData.cs index 7e7c9d7..efcf861 100644 --- a/Adaptation/FileHandlers/txt/ProcessData.cs +++ b/Adaptation/FileHandlers/txt/ProcessData.cs @@ -435,7 +435,7 @@ public partial class ProcessData log.Debug($"****Extract(FDR): DataType = {dataType}"); if (!isBioRad) { - cassetteDateTime = logistics.DateTimeFromSequence.AddTicks(tickOffset).AddTicks(i * -1); + cassetteDateTime = logistics.DateTimeFromSequence.AddTicks(i * -1); results.Add(new Tuple(cassetteID, isBioRad, cassetteDateTime, dataText)); } else @@ -452,7 +452,7 @@ public partial class ProcessData throw new Exception(); count += 1; _ = contents.Clear(); - cassetteDateTime = logistics.DateTimeFromSequence.AddTicks(tickOffset).AddTicks(count * -1); + cassetteDateTime = logistics.DateTimeFromSequence.AddTicks(count * -1); user = processData.Employee?.ToString() ?? ""; recipe = detail.Recipe?.ToString() ?? ""; _ = contents.Append("Bio-Rad ").Append("QS400MEPI".PadRight(17)).Append("Recipe: ").Append(recipe.PadRight(25)).AppendLine(processData.Date.ToString(Stratus.Description.GetDateFormat())); diff --git a/Adaptation/MET08THFTIRSTRATUS-Development.yml b/Adaptation/MET08THFTIRSTRATUS-Development.yml index 92bd246..b37ed7a 100644 --- a/Adaptation/MET08THFTIRSTRATUS-Development.yml +++ b/Adaptation/MET08THFTIRSTRATUS-Development.yml @@ -22,7 +22,7 @@ steps: set configuration=Debug echo %configuration% echo ##vso[task.setvariable variable=Configuration;]%configuration% - echo ($Configuration) + echo $(Configuration) displayName: Configuration - script: | @@ -123,6 +123,14 @@ steps: testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)" searchFolder: "$(System.DefaultWorkingDirectory)" + - task: PublishTestResults@2 + displayName: "Publish Test Results **/coverage.cobertura.xml" + inputs: + testResultsFormat: VSTest + testResultsFiles: "**/coverage.cobertura.xml" + testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)" + searchFolder: "$(System.DefaultWorkingDirectory)/TestResults" + - task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1 displayName: "Create work item" inputs: diff --git a/Adaptation/MET08THFTIRSTRATUS.yml b/Adaptation/MET08THFTIRSTRATUS.yml index cd668b9..3e2ed92 100644 --- a/Adaptation/MET08THFTIRSTRATUS.yml +++ b/Adaptation/MET08THFTIRSTRATUS.yml @@ -22,7 +22,7 @@ steps: set configuration=Release echo %configuration% echo ##vso[task.setvariable variable=Configuration;]%configuration% - echo ($Configuration) + echo $(Configuration) displayName: Configuration - script: | @@ -120,6 +120,14 @@ steps: testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)" searchFolder: "$(System.DefaultWorkingDirectory)" + - task: PublishTestResults@2 + displayName: "Publish Test Results **/coverage.cobertura.xml" + inputs: + testResultsFormat: VSTest + testResultsFiles: "**/coverage.cobertura.xml" + testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)" + searchFolder: "$(System.DefaultWorkingDirectory)/TestResults" + - task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1 displayName: "Create work item" inputs: diff --git a/Adaptation/_Tests/Static/Stratus.cs b/Adaptation/_Tests/Static/Stratus.cs index 9b27b2e..bb27705 100644 --- a/Adaptation/_Tests/Static/Stratus.cs +++ b/Adaptation/_Tests/Static/Stratus.cs @@ -129,11 +129,10 @@ public class Stratus : LoggingUnitTesting, IDisposable Assert.IsTrue(descriptor.Zone is "1"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = FileHandlers.Stratus.ProcessData.GetDescriptor("P2-LOW-RR"); - Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Cassette)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); - Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); + Assert.IsTrue(descriptor.PSN is "RR"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); - Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); + Assert.IsTrue(descriptor.Reactor is "P2"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = FileHandlers.Stratus.ProcessData.GetDescriptor("i171308.1.51"); @@ -168,7 +167,7 @@ public class Stratus : LoggingUnitTesting, IDisposable Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Cassette)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(descriptor.PSN is "SPLIT4"); - Assert.IsTrue(descriptor.RDS is "QP1414"); + Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(descriptor.Reactor is "75"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));