diff --git a/Adaptation/FileHandlers/pcl/ProcessData.cs b/Adaptation/FileHandlers/pcl/ProcessData.cs index b5f3b63..465be2c 100644 --- a/Adaptation/FileHandlers/pcl/ProcessData.cs +++ b/Adaptation/FileHandlers/pcl/ProcessData.cs @@ -258,7 +258,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]; @@ -356,7 +356,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/MET08DDUPSFS6420.Tests.csproj b/Adaptation/MET08DDUPSFS6420.Tests.csproj index 3b846af..77afe96 100644 --- a/Adaptation/MET08DDUPSFS6420.Tests.csproj +++ b/Adaptation/MET08DDUPSFS6420.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 6d8ec73..5ada1ed 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")); }