From c92c39401bf2ddd8a1ed65fd8815d963bc4a0edf Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Wed, 22 Mar 2023 10:46:36 -0700 Subject: [PATCH] Nuget bump and QP oversight --- Adaptation/FileHandlers/pcl/ProcessData.cs | 4 ++-- Adaptation/MET08RESIHGCV.Tests.csproj | 4 ++-- Adaptation/_Tests/Static/pcl.cs | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Adaptation/FileHandlers/pcl/ProcessData.cs b/Adaptation/FileHandlers/pcl/ProcessData.cs index 54c3aa6..c56feda 100644 --- a/Adaptation/FileHandlers/pcl/ProcessData.cs +++ b/Adaptation/FileHandlers/pcl/ProcessData.cs @@ -226,7 +226,7 @@ public class ProcessData : IProcessData reactor = defaultReactor; else reactor = segments[0]; - if (segments.Length <= 1 || !int.TryParse(segments[1], out int rdsValue) || rdsValue < 99) + if (segments.Length <= 1 || !int.TryParse(segments[1].Replace("QP", string.Empty), out int rdsValue) || rdsValue < 99) rds = defaultRDS; else rds = segments[1]; @@ -324,7 +324,7 @@ public class ProcessData : IProcessData if (lot.Length > 2 && lot[0] == '1' && (lot[1] == 'T' || lot[1] == 't')) lot = lot.Substring(2); string[] segments = lot.Split('-'); - bool hasRDS = Regex.IsMatch(lot, "[-]?[0-9]{5,}[-]?"); + bool hasRDS = Regex.IsMatch(lot, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?"); (reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, lot, segments, hasRDS); (layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments, hasRDS); zone = GetZone(segments); diff --git a/Adaptation/MET08RESIHGCV.Tests.csproj b/Adaptation/MET08RESIHGCV.Tests.csproj index f28b573..0ee3e72 100644 --- a/Adaptation/MET08RESIHGCV.Tests.csproj +++ b/Adaptation/MET08RESIHGCV.Tests.csproj @@ -34,7 +34,7 @@ - + NU1701 NU1701 NU1701 @@ -43,7 +43,7 @@ NU1701 NU1701 - + diff --git a/Adaptation/_Tests/Static/pcl.cs b/Adaptation/_Tests/Static/pcl.cs index b8170b5..b2a9f7c 100644 --- a/Adaptation/_Tests/Static/pcl.cs +++ b/Adaptation/_Tests/Static/pcl.cs @@ -136,6 +136,14 @@ public class PCL : LoggingUnitTesting, IDisposable Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); + descriptor = FileHandlers.pcl.ProcessData.GetDescriptor("75-QP1414-SPLIT4"); + Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Lot)); + Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); + Assert.IsTrue(descriptor.PSN is "SPLIT4"); + Assert.IsTrue(descriptor.RDS is "QP1414"); + Assert.IsTrue(descriptor.Reactor is "75"); + Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); + Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); }