Removed hasRDS that was added for P2-LOW-RR

This commit is contained in:
Mike Phares 2023-03-22 17:10:26 -07:00
parent cedcc57f12
commit 82cc75341e
2 changed files with 11 additions and 12 deletions

View File

@ -253,15 +253,15 @@ public partial class ProcessData : IProcessData
return result; 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 rds;
string reactor; 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; reactor = defaultReactor;
else else
reactor = segments[0]; 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; rds = defaultRDS;
else else
rds = segments[1]; rds = segments[1];
@ -273,11 +273,11 @@ public partial class ProcessData : IProcessData
return new(reactor, rds); 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 psn;
string layer; string layer;
if (segments.Length <= 2 || (segments.Length > 1 && !hasRDS)) if (segments.Length <= 2)
{ {
psn = defaultPSN; psn = defaultPSN;
layer = defaultLayer; layer = defaultLayer;
@ -359,9 +359,9 @@ public partial class ProcessData : IProcessData
if (wafer.Length > 2 && wafer[0] == '1' && (wafer[1] == 'T' || wafer[1] == 't')) if (wafer.Length > 2 && wafer[0] == '1' && (wafer[1] == 'T' || wafer[1] == 't'))
wafer = wafer.Substring(2); wafer = wafer.Substring(2);
string[] segments = wafer.Split('-'); string[] segments = wafer.Split('-');
bool hasRDS = Regex.IsMatch(wafer, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?"); // bool hasRDS = Regex.IsMatch(wafer, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?");
(reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, wafer, segments, hasRDS); (reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, wafer, segments);
(layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments, hasRDS); (layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments);
zone = GetZone(segments); zone = GetZone(segments);
if (segments.Length <= 4) if (segments.Length <= 4)
employee = defaultEmployee; employee = defaultEmployee;

View File

@ -126,18 +126,17 @@ public class QS408M : LoggingUnitTesting, IDisposable
Assert.IsTrue(descriptor.Zone is "1"); Assert.IsTrue(descriptor.Zone is "1");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = FileHandlers.QS408M.ProcessData.GetDescriptor("P2-LOW-RR"); descriptor = FileHandlers.QS408M.ProcessData.GetDescriptor("P2-LOW-RR");
Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Wafer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); 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.RDS));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(descriptor.Reactor is "P2");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = FileHandlers.QS408M.ProcessData.GetDescriptor("75-QP1414-SPLIT4"); descriptor = FileHandlers.QS408M.ProcessData.GetDescriptor("75-QP1414-SPLIT4");
Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Wafer)); Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Wafer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(descriptor.PSN is "SPLIT4"); 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(descriptor.Reactor is "75");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));