using Adaptation.FileHandlers.txt;

Sequence as a string
Job Update using null
This commit is contained in:
Mike Phares 2025-02-17 12:45:31 -07:00
parent ba22cebdf2
commit 0788998e09
7 changed files with 153 additions and 107 deletions

View File

@ -5,6 +5,7 @@
"cSpell.words": [ "cSpell.words": [
"BIORAD", "BIORAD",
"CASS", "CASS",
"CEPIEPSILON",
"CUST", "CUST",
"DDUPSP", "DDUPSP",
"EQPT", "EQPT",

View File

@ -1,21 +1,30 @@
namespace Adaptation.FileHandlers.TIBCO.Transport; namespace Adaptation.FileHandlers.TIBCO.Transport;
#nullable enable
public class Common public class Common
{ {
public string Layer { get; } public string? Layer { get; }
public string PSN { get; } public string? PSN { get; }
public int? RDSNumber { get; } public int? RDSNumber { get; }
public int? ReactorNumber { get; } public int? ReactorNumber { get; }
public string Zone { get; } public string? Zone { get; }
public string? Employee { get; }
public Common(string layer, string psn, int? rdsNumber, int? reactor, string zone) public Common(string? layer,
string? psn,
int? rdsNumber,
int? reactor,
string? zone,
string? employee)
{ {
Layer = layer; Layer = layer;
PSN = psn; PSN = psn;
RDSNumber = rdsNumber; RDSNumber = rdsNumber;
ReactorNumber = reactor; ReactorNumber = reactor;
Zone = zone; Zone = zone;
Employee = employee;
} }
} }

View File

@ -13,27 +13,29 @@ using System.Threading.Tasks;
namespace Adaptation.FileHandlers.TIBCO.Transport; namespace Adaptation.FileHandlers.TIBCO.Transport;
#nullable enable
public partial class Job public partial class Job
{ {
public string AutomationMode { get; } public string? AutomationMode { get; }
public string BasicType { get; } public string? BasicType { get; }
public string CreationUser { get; } public string? CreationUser { get; }
public string Equipment { get; } public string? Equipment { get; }
public string JobName { get; } public string? JobName { get; }
public string LastUpdateUser { get; } public string? LastUpdateUser { get; }
public string LotName { get; } public string? LotName { get; }
public string LotState { get; } public string? LotState { get; }
public string PackageName { get; } public string? PackageName { get; }
public string ProcessSpecName { get; } public string? ProcessSpecName { get; }
public string ProcessType { get; } public string? ProcessType { get; }
public string ProductName { get; } public string? ProductName { get; }
public string Qty { get; } public string? Qty { get; }
public string Qty2 { get; } public string? Qty2 { get; }
public string RecipeName { get; } public string? RecipeName { get; }
public string SpecName { get; } public string? SpecName { get; }
public string StateModel { get; } public string? StateModel { get; }
public string Status { get; } public string? Status { get; }
// //
public bool IsAreaSi { get; } public bool IsAreaSi { get; }
public DateTime DateTime { get; } public DateTime DateTime { get; }
@ -56,7 +58,7 @@ public partial class Job
const string bioRad3 = "BIORAD3"; const string bioRad3 = "BIORAD3";
const string twoAlphaPattern = "^[a-zA-z]{2,3}"; const string twoAlphaPattern = "^[a-zA-z]{2,3}";
const string reactorNumberPattern = @"^[0-9]{2}--"; const string reactorNumberPattern = @"^[0-9]{2}--";
Input input = JsonSerializer.Deserialize<Input>(mid); Input input = JsonSerializer.Deserialize<Input>(mid) ?? throw new Exception();
if (!long.TryParse(input.Sequence, out long sequence)) if (!long.TryParse(input.Sequence, out long sequence))
DateTime = DateTime.Now; DateTime = DateTime.Now;
else else
@ -71,9 +73,14 @@ public partial class Job
workOrder = GetWorkOrder(input); workOrder = GetWorkOrder(input);
reactorNumber = GetReactorNumber(input); reactorNumber = GetReactorNumber(input);
if (workOrder.IsWorkOrder || reactorNumber.HasValue) if (workOrder.IsWorkOrder || reactorNumber.HasValue)
common = new(string.Empty, string.Empty, null, null, string.Empty); common = new(layer: null,
psn: null,
rdsNumber: null,
reactor: null,
zone: null,
employee: null);
else if (!string.IsNullOrEmpty(input.MID) && input.MID.Length is 2 or 3 && Regex.IsMatch(input.MID, twoAlphaPattern)) else if (!string.IsNullOrEmpty(input.MID) && input.MID.Length is 2 or 3 && Regex.IsMatch(input.MID, twoAlphaPattern))
common = Get(metrologyFileShare, input); common = GetTwoAlphaPattern(metrologyFileShare, input);
else else
common = Get(input); common = Get(input);
} }
@ -121,6 +128,7 @@ public partial class Job
private static WorkOrder GetWorkOrder(Input input) private static WorkOrder GetWorkOrder(Input input)
{ {
WorkOrder result;
int? slotNumber; int? slotNumber;
int? workOrderStep = null; int? workOrderStep = null;
int? workOrderNumber = null; int? workOrderNumber = null;
@ -154,48 +162,53 @@ public partial class Job
slotNumber = null; slotNumber = null;
else else
slotNumber = slot; slotNumber = slot;
return new(workOrderNumber, workOrderStep, workOrderCassette, slotNumber, workOrderStep is not null || workOrderNumber is not null || workOrderCassette is not null); result = new(workOrderNumber: workOrderNumber,
workOrderStep: workOrderStep,
workOrderCassette: workOrderCassette,
slotNumber: slotNumber,
isWorkOrder: workOrderStep is not null || workOrderNumber is not null || workOrderCassette is not null);
return result;
} }
private static bool IsValid(int? rdsNumber) => !IsInvalid(rdsNumber); private static bool IsValid(int? rdsNumber) => !IsInvalid(rdsNumber);
private static bool IsInvalid(int? rdsNumber) => rdsNumber is null or < 100000 or > 100000000; private static bool IsInvalid(int? rdsNumber) => rdsNumber is null or < 100000 or > 100000000;
private static (string, string) GetReactorAndRDS(string defaultReactor, string defaultRDS, string text, string formattedText, string[] segments) private static (string?, string?) GetReactorAndRDS(string text, string formattedText, string[] segments)
{ {
string rds; string? rds;
string reactor; string? reactor;
if (string.IsNullOrEmpty(text) || segments.Length == 0 || string.IsNullOrEmpty(formattedText)) if (string.IsNullOrEmpty(text) || segments.Length < 1 || string.IsNullOrEmpty(formattedText))
reactor = defaultReactor; reactor = null;
else else
reactor = segments[0]; reactor = segments[0];
if (segments.Length <= 1 || !int.TryParse(segments[1], out int rdsValue) || rdsValue < 99) if (segments.Length < 2 || !int.TryParse(segments[1], out int rdsValue) || rdsValue < 99)
rds = defaultRDS; rds = null;
else else
rds = segments[1]; rds = segments[1];
if (reactor.Length > 3) if (!string.IsNullOrEmpty(reactor) && reactor.Length > 3)
{ {
rds = reactor; rds = reactor;
reactor = defaultReactor; reactor = null;
} }
return new(reactor, rds); return new(reactor, rds);
} }
private static (string, string) GetLayerAndPSN(string defaultLayer, string defaultPSN, string[] segments) private static (string?, string?) GetLayerAndPSN(string[] segments)
{ {
string psn; string? psn;
string layer; string? layer;
if (segments.Length <= 2) if (segments.Length <= 2)
{ {
psn = defaultPSN; psn = null;
layer = defaultLayer; layer = null;
} }
else else
{ {
string[] segmentsB = segments[2].Split('.'); string[] segmentsB = segments[2].Split('.');
psn = segmentsB[0]; psn = segmentsB[0];
if (segmentsB.Length <= 1) if (segmentsB.Length <= 1)
layer = defaultLayer; layer = null;
else else
{ {
layer = segmentsB[1]; layer = segmentsB[1];
@ -206,11 +219,11 @@ public partial class Job
return (layer, psn); return (layer, psn);
} }
private static string GetZone(string[] segments) private static string? GetZone(string[] segments)
{ {
string result; string? result;
if (segments.Length <= 3) if (segments.Length <= 3)
result = string.Empty; result = null;
else else
{ {
result = segments[3]; result = segments[3];
@ -222,39 +235,43 @@ public partial class Job
private static Common Get(Input input) private static Common Get(Input input)
{ {
string psn; string? psn;
string rds; string? rds;
string zone; string? zone;
string layer;
int rdsNumber; int rdsNumber;
string reactor; string? layer;
string? reactor;
string? employee;
int? reactorNumber; int? reactorNumber;
string defaultPSN = string.Empty;
string defaultRDS = string.Empty;
string defaultLayer = string.Empty;
string defaultReactor = string.Empty;
string[] segments = input.MID.Split(new char[] { '-' }); string[] segments = input.MID.Split(new char[] { '-' });
// bool hasRDS = Regex.IsMatch(input.MID, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?"); // bool hasRDS = Regex.IsMatch(input.MID, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?");
string formattedText = Regex.Replace(input.MID, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; string formattedText = Regex.Replace(input.MID, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
(reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, input.MID, formattedText, segments); (reactor, rds) = GetReactorAndRDS(input.MID, formattedText, segments);
if (string.IsNullOrEmpty(rds) || segments.Length < 2) if (string.IsNullOrEmpty(rds))
rdsNumber = 0; rdsNumber = 0;
else else
_ = int.TryParse(segments[1], out rdsNumber); _ = int.TryParse(rds, out rdsNumber);
if (IsInvalid(rdsNumber) || !int.TryParse(reactor, out int reactorCheck)) if (IsInvalid(rdsNumber) || !int.TryParse(reactor, out int reactorCheck))
{ {
psn = string.Empty; psn = null;
zone = string.Empty; zone = null;
layer = string.Empty; layer = null;
employee = null;
reactorNumber = null; reactorNumber = null;
} }
else else
{ {
reactorNumber = reactorCheck;
(layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments);
zone = GetZone(segments); zone = GetZone(segments);
reactorNumber = reactorCheck;
(layer, psn) = GetLayerAndPSN(segments);
employee = segments.Length <= 4 ? null : segments[4];
} }
return new(layer, psn, rdsNumber, reactorNumber, zone); return new(layer: layer,
psn: psn,
rdsNumber: rdsNumber,
reactor: reactorNumber,
zone: zone,
employee: employee);
} }
private static string[] GetDirectories(string fileShare) private static string[] GetDirectories(string fileShare)
@ -271,18 +288,16 @@ public partial class Job
}; };
} }
#nullable enable private static Common GetTwoAlphaPattern(string metrologyFileShare, Input input)
private static Common Get(string metrologyFileShare, Input input)
{ {
string lines; string lines;
const int zero = 0; const int zero = 0;
string? psn = null;
int? reactor = null; int? reactor = null;
string? zone = null;
string? layer = null;
int? rdsNumber = null; int? rdsNumber = null;
string psn = string.Empty;
List<string> files = new(); List<string> files = new();
string zone = string.Empty;
string layer = string.Empty;
WorkMaterialOut? workMaterialOut; WorkMaterialOut? workMaterialOut;
if (string.IsNullOrEmpty(metrologyFileShare) || !Directory.Exists(metrologyFileShare)) if (string.IsNullOrEmpty(metrologyFileShare) || !Directory.Exists(metrologyFileShare))
throw new Exception($"Unable to access file-share <{metrologyFileShare}>"); throw new Exception($"Unable to access file-share <{metrologyFileShare}>");
@ -314,7 +329,12 @@ public partial class Job
zone = workMaterialOut.Zone; zone = workMaterialOut.Zone;
break; break;
} }
return new(layer, psn, rdsNumber, reactor, zone); return new(layer: layer,
psn: psn,
rdsNumber: rdsNumber,
reactor: reactor,
zone: zone,
employee: null);
} }
private static List<string> GetFiles(Input input, string barcodeHostFileShare) private static List<string> GetFiles(Input input, string barcodeHostFileShare)
@ -360,8 +380,6 @@ public partial class Job
Common common; Common common;
WorkOrder workOrder; WorkOrder workOrder;
Task<Stream> streamTask; Task<Stream> streamTask;
string zone = string.Empty;
string layer = string.Empty;
Task<HttpResponseMessage> httpResponseMessageTask; Task<HttpResponseMessage> httpResponseMessageTask;
JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true }; JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true };
int? reactor = !int.TryParse(input.MID.Substring(0, 2), out int reactorNumber) ? null : reactorNumber; int? reactor = !int.TryParse(input.MID.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
@ -380,7 +398,12 @@ public partial class Job
rds = null; rds = null;
psn = string.Empty; psn = string.Empty;
workOrder = new(null, null, null, null, false); workOrder = new(null, null, null, null, false);
common = new(layer, psn, rds, reactor, zone); common = new(layer: null,
psn: psn,
rdsNumber: rds,
reactor: reactor,
zone: null,
employee: null);
} }
else else
{ {
@ -399,12 +422,22 @@ public partial class Job
if (runDataSheetRoot is null || reactor != runDataSheetRoot.RunDataSheet.Reactor) if (runDataSheetRoot is null || reactor != runDataSheetRoot.RunDataSheet.Reactor)
{ {
psn = string.Empty; psn = string.Empty;
common = new(layer, psn, rds, reactor, zone); common = new(layer: null,
psn: psn,
rdsNumber: rds,
reactor: reactor,
zone: null,
employee: null);
} }
else else
{ {
psn = runDataSheetRoot.RunDataSheet.PSN.ToString(); psn = runDataSheetRoot.RunDataSheet.PSN.ToString();
common = new(layer, psn, rds, reactor, zone); common = new(layer: null,
psn: psn,
rdsNumber: rds,
reactor: reactor,
zone: null,
employee: null);
} }
} }
return new(common, workOrder); return new(common, workOrder);
@ -417,9 +450,6 @@ public partial class Job
int? rds; int? rds;
long sequence = 0; long sequence = 0;
WorkOrder workOrder; WorkOrder workOrder;
string psn = string.Empty;
string zone = string.Empty;
string layer = string.Empty;
int? reactor = !int.TryParse(input.MID.Substring(0, 2), out int reactorNumber) ? null : reactorNumber; int? reactor = !int.TryParse(input.MID.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
bool parsed = !string.IsNullOrEmpty(input.Sequence) && long.TryParse(input.Sequence, out sequence); bool parsed = !string.IsNullOrEmpty(input.Sequence) && long.TryParse(input.Sequence, out sequence);
List<string> files; List<string> files;
@ -443,7 +473,12 @@ public partial class Job
rds = null; rds = null;
workOrder = GetWorkOrder(new(input, text.Substring(2))); workOrder = GetWorkOrder(new(input, text.Substring(2)));
} }
Common common = new(layer, psn, rds, reactor, zone); Common common = new(layer: null,
psn: null,
rdsNumber: rds,
reactor: reactor,
zone: null,
employee: null);
return new(common, workOrder); return new(common, workOrder);
} }

View File

@ -9,7 +9,11 @@ public class WorkOrder
public int? SlotNumber { get; } public int? SlotNumber { get; }
public bool IsWorkOrder { get; } public bool IsWorkOrder { get; }
public WorkOrder(int? workOrderNumber, int? workOrderStep, int? workOrderCassette, int? slotNumber, bool isWorkOrder) public WorkOrder(int? workOrderNumber,
int? workOrderStep,
int? workOrderCassette,
int? slotNumber,
bool isWorkOrder)
{ {
WorkOrderNumber = workOrderNumber; WorkOrderNumber = workOrderNumber;
WorkOrderStep = workOrderStep; WorkOrderStep = workOrderStep;

View File

@ -9,6 +9,8 @@ internal class Row
public Row(Run run, int i) public Row(Run run, int i)
{ {
Index = i;
//
Lot = run.Header.Lot; Lot = run.Header.Lot;
Session = run.Header.Session; Session = run.Header.Session;
DcnAllMin = run.Summary.DcnAllMin; DcnAllMin = run.Summary.DcnAllMin;
@ -318,6 +320,8 @@ internal class Row
DnnBin8 = run.Wafers[i].DnnBin8; DnnBin8 = run.Wafers[i].DnnBin8;
} }
public int Index { get; }
//
public string Lot { get; } public string Lot { get; }
public string Session { get; } public string Session { get; }
public string DcnAllMin { get; } public string DcnAllMin { get; }

View File

@ -40,7 +40,7 @@ internal class Run
int columns = 0; int columns = 0;
StringBuilder stringBuilder = new(); StringBuilder stringBuilder = new();
results.Add($"\"Count\",{jsonElements?.Length}"); results.Add($"\"Count\",{jsonElements?.Length}");
results.Add($"\"{nameof(logistics.Sequence)}\",{logistics.Sequence}"); results.Add($"\"{nameof(logistics.Sequence)}\",\"{logistics.Sequence}\"");
results.Add($"\"{nameof(logistics.MesEntity)}\",\"{logistics.MesEntity}\""); results.Add($"\"{nameof(logistics.MesEntity)}\",\"{logistics.MesEntity}\"");
string dateTimeFromSequence = logistics.DateTimeFromSequence.ToString("MM/dd/yyyy hh:mm:ss tt"); string dateTimeFromSequence = logistics.DateTimeFromSequence.ToString("MM/dd/yyyy hh:mm:ss tt");
for (int i = 0; i < jsonElements?.Length;) for (int i = 0; i < jsonElements?.Length;)

View File

@ -1,4 +1,5 @@
using Adaptation._Tests.Shared; using Adaptation._Tests.Shared;
using Adaptation.FileHandlers.txt;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using System; using System;
@ -57,128 +58,122 @@ public class TXT : LoggingUnitTesting, IDisposable
[TestMethod] [TestMethod]
public void TestDescriptor() public void TestDescriptor()
{ {
FileHandlers.txt.Descriptor descriptor; Descriptor descriptor;
MethodBase methodBase = new StackFrame().GetMethod(); MethodBase methodBase = new StackFrame().GetMethod();
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
descriptor = FileHandlers.txt.ProcessData.GetDescriptor(string.Empty); descriptor = ProcessData.GetDescriptor(string.Empty);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
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.txt.ProcessData.GetDescriptor("12-123456-1234"); descriptor = ProcessData.GetDescriptor("12-123456-1234");
Assert.IsTrue(descriptor.Reactor is "12"); Assert.IsTrue(descriptor.Reactor is "12");
Assert.IsTrue(descriptor.RDS is "123456"); Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(descriptor.PSN is "1234"); Assert.IsTrue(descriptor.PSN is "1234");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
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.txt.ProcessData.GetDescriptor("123456"); descriptor = ProcessData.GetDescriptor("123456");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(descriptor.RDS is "123456"); Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
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.txt.ProcessData.GetDescriptor("1T123456"); descriptor = ProcessData.GetDescriptor("1T123456");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(descriptor.RDS is "123456"); Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
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.txt.ProcessData.GetDescriptor("MP"); descriptor = ProcessData.GetDescriptor("MP");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.Employee is "MP"); Assert.IsTrue(descriptor.Employee is "MP");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
descriptor = FileHandlers.txt.ProcessData.GetDescriptor("12-123456-1234.2-1"); descriptor = ProcessData.GetDescriptor("12-123456-1234.2-1");
Assert.IsTrue(descriptor.Reactor is "12"); Assert.IsTrue(descriptor.Reactor is "12");
Assert.IsTrue(descriptor.RDS is "123456"); Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(descriptor.PSN is "1234"); Assert.IsTrue(descriptor.PSN is "1234");
Assert.IsTrue(descriptor.Layer is "2"); Assert.IsTrue(descriptor.Layer is "2");
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.txt.ProcessData.GetDescriptor("12-123456-1234.02-1"); descriptor = ProcessData.GetDescriptor("12-123456-1234.02-1");
Assert.IsTrue(descriptor.Reactor is "12"); Assert.IsTrue(descriptor.Reactor is "12");
Assert.IsTrue(descriptor.RDS is "123456"); Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(descriptor.PSN is "1234"); Assert.IsTrue(descriptor.PSN is "1234");
Assert.IsTrue(descriptor.Layer is "2"); Assert.IsTrue(descriptor.Layer is "2");
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.txt.ProcessData.GetDescriptor("20"); descriptor = ProcessData.GetDescriptor("20");
Assert.IsTrue(descriptor.Reactor is "20"); Assert.IsTrue(descriptor.Reactor is "20");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
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.txt.ProcessData.GetDescriptor("20.2"); descriptor = ProcessData.GetDescriptor("20.2");
Assert.IsTrue(descriptor.Reactor is "20"); Assert.IsTrue(descriptor.Reactor is "20");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.Layer is "2"); Assert.IsTrue(descriptor.Layer is "2");
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.txt.ProcessData.GetDescriptor("20.2.1"); descriptor = ProcessData.GetDescriptor("20.2.1");
Assert.IsTrue(descriptor.Layer is "2"); Assert.IsTrue(descriptor.Layer is "2");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.Reactor is "20"); Assert.IsTrue(descriptor.Reactor is "20");
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.txt.ProcessData.GetDescriptor("20.1.1"); descriptor = ProcessData.GetDescriptor("20.1.1");
Assert.IsTrue(descriptor.Layer is "1"); Assert.IsTrue(descriptor.Layer is "1");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.Reactor is "20"); Assert.IsTrue(descriptor.Reactor is "20");
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.txt.ProcessData.GetDescriptor("P2-LOW-RR"); descriptor = ProcessData.GetDescriptor("P2-LOW-RR");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(descriptor.PSN is "RR"); Assert.IsTrue(descriptor.PSN is "RR");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.Reactor is "P2"); 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));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); descriptor = ProcessData.GetDescriptor("i171308.1.51");
Assert.IsTrue(descriptor.PSN is "RR");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.Reactor is "P2");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = FileHandlers.txt.ProcessData.GetDescriptor("i171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.RDS is "i171308.1.51"); Assert.IsTrue(descriptor.RDS is "i171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
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.txt.ProcessData.GetDescriptor("o171308.1.51"); descriptor = ProcessData.GetDescriptor("o171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.RDS is "o171308.1.51"); Assert.IsTrue(descriptor.RDS is "o171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
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.txt.ProcessData.GetDescriptor("O171308.1.51"); descriptor = ProcessData.GetDescriptor("O171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.RDS is "O171308.1.51"); Assert.IsTrue(descriptor.RDS is "O171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
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.txt.ProcessData.GetDescriptor("171308.1.51"); descriptor = ProcessData.GetDescriptor("171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.RDS is "171308.1.51"); Assert.IsTrue(descriptor.RDS is "171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
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.txt.ProcessData.GetDescriptor("75-QP1414-SPLIT4"); descriptor = ProcessData.GetDescriptor("75-QP1414-SPLIT4");
Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Lot)); Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Lot));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(descriptor.PSN is "SPLIT4"); Assert.IsTrue(descriptor.PSN is "SPLIT4");
@ -186,9 +181,7 @@ public class TXT : LoggingUnitTesting, IDisposable
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));
descriptor = FileHandlers.txt.ProcessData.GetDescriptor("B48"); descriptor = ProcessData.GetDescriptor("B48");
Assert.IsTrue(descriptor.Lot == "B48");
descriptor = FileHandlers.txt.ProcessData.GetDescriptor("B48");
Assert.IsTrue(descriptor.Lot == "B48"); Assert.IsTrue(descriptor.Lot == "B48");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));