using Adaptation.FileHandlers.pcl;

This commit is contained in:
Mike Phares 2025-02-17 12:52:27 -07:00
parent 0f55fcbb0a
commit 4819d17819
3 changed files with 25 additions and 28 deletions

View File

@ -9,6 +9,8 @@ internal class Row
public Row(Run run, int i)
{
Index = i;
//
Date = run.Header.Date;
Recipe = run.Header.Recipe;
Id = run.Header.Id;
@ -95,6 +97,8 @@ internal class Row
WaferRecipe = run.Wafers[i].Recipe;
}
public int Index { get; }
//
public string Date { get; }
public string Recipe { get; }
public string Id { get; }

View File

@ -39,7 +39,7 @@ internal class Run
int columns = 0;
StringBuilder stringBuilder = new();
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}\"");
string dateTimeFromSequence = logistics.DateTimeFromSequence.ToString("MM/dd/yyyy hh:mm:ss tt");
for (int i = 0; i < jsonElements?.Length;)

View File

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