Removed hasRDS that was added for P2-LOW-RR
This commit is contained in:
parent
4c77edbc40
commit
d86d3d6294
@ -250,15 +250,15 @@ public 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];
|
||||
@ -270,11 +270,11 @@ public 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;
|
||||
@ -356,9 +356,9 @@ 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, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?");
|
||||
(reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, lot, segments, hasRDS);
|
||||
(layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments, hasRDS);
|
||||
// bool hasRDS = Regex.IsMatch(lot, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?");
|
||||
(reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, lot, segments);
|
||||
(layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments);
|
||||
zone = GetZone(segments);
|
||||
employee = defaultEmployee;
|
||||
}
|
||||
|
@ -129,18 +129,17 @@ public class PCL : LoggingUnitTesting, IDisposable
|
||||
Assert.IsTrue(descriptor.Zone is "1");
|
||||
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
|
||||
descriptor = FileHandlers.pcl.ProcessData.GetDescriptor("P2-LOW-RR");
|
||||
Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Lot));
|
||||
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.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(string.IsNullOrEmpty(descriptor.RDS));
|
||||
Assert.IsTrue(descriptor.Reactor is "75");
|
||||
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
|
||||
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
|
||||
|
Loading…
x
Reference in New Issue
Block a user