MET08THFTIRQS408M - v2.43.4 - Builtin MonA, Run with layer

and 1T
This commit is contained in:
2022-09-13 08:56:23 -07:00
parent 09f85078f4
commit 0626e4f4e3
41 changed files with 1412 additions and 425 deletions

View File

@ -253,6 +253,195 @@ public partial class ProcessData : IProcessData
return result;
}
public static Descriptor GetDescriptor(string text)
{
Descriptor result;
string psn;
string rds;
string zone;
string wafer;
string layer;
string reactor;
string employee;
const string defaultPSN = "0000";
const string defaultReactor = "00";
const string defaultRDS = "000000";
if (text.Length is 2 or 3)
{
wafer = text;
employee = text;
rds = defaultRDS;
psn = defaultPSN;
zone = string.Empty;
layer = string.Empty;
reactor = defaultReactor;
}
else
{
// Remove illegal characters \/:*?"<>| found in the Batch
wafer = Regex.Replace(text, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
if (wafer.StartsWith("1T") || wafer.StartsWith("1t"))
wafer = wafer.Substring(2);
string[] segments = wafer.Split('-');
if (segments.Length == 0)
reactor = defaultReactor;
else
reactor = segments[0];
if (segments.Length <= 1)
rds = defaultRDS;
else
rds = segments[1];
if (reactor.Length > 3)
{
rds = reactor;
reactor = defaultReactor;
}
if (segments.Length <= 2)
psn = defaultPSN;
else
psn = segments[2];
if (segments.Length < 3)
layer = string.Empty;
else
{
string[] segmentsB = segments[2].Split('.');
if (segmentsB.Length > 1)
psn = segmentsB[0];
if (segmentsB.Length <= 1)
layer = string.Empty;
else
layer = segmentsB[1];
}
if (segments.Length <= 3)
zone = string.Empty;
else
zone = segments[3];
if (segments.Length <= 4)
employee = string.Empty;
else
employee = segments[4];
}
if (layer.Length > 1 && layer[0] == '0')
layer = layer.Substring(1);
if (zone.Length > 1 && zone[0] == '0')
zone = zone.Substring(1);
result = new(employee, layer, psn, rds, reactor, wafer, zone);
return result;
}
private void Set(Logistics logistics, ProcessData lastProcessData, string receivedData)
{
string psn;
string rds;
string date;
string zone;
string batch;
string layer;
string title;
string wafer;
string recipe;
string reactor;
string cassette;
string employee;
title = GetBefore("Recipe:");
recipe = GetToken();
string dateTimeText = GetToEOL();
if (dateTimeText.EndsWith("."))
dateTimeText = dateTimeText.Remove(dateTimeText.Length - 1, 1);
DateTime dateTime = GetDateTime(logistics, dateTimeText);
date = dateTime.ToString();
ScanPast("operator:");
employee = GetBefore("batch:");
batch = GetToEOL();
// Remove illegal characters \/:*?"<>| found in the Batch
batch = Regex.Replace(batch, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
ScanPast("cassette:");
cassette = GetBefore("wafer:");
if (string.IsNullOrEmpty(batch))
{
_I = 0;
_Data = receivedData;
ScanPast("wafer:");
}
wafer = GetToEOL();
_ = GetToEOL();
_ = GetToEOL();
if (string.IsNullOrEmpty(wafer))
throw new Exception("Wafer field is missing.");
Descriptor descriptor = GetDescriptor(wafer);
psn = descriptor.PSN;
rds = descriptor.RDS;
zone = descriptor.Zone;
wafer = descriptor.Wafer;
layer = descriptor.Layer;
reactor = descriptor.Reactor;
if (employee != wafer)
employee = descriptor.Employee;
if (logistics.DateTimeFromSequence > DateTime.Now.AddHours(-24))
{
if (string.IsNullOrEmpty(lastProcessData.Wafer))
{
lastProcessData.Batch = JobID;
lastProcessData.Cassette = JobID;
lastProcessData.Employee = JobID;
lastProcessData.Recipe = JobID;
lastProcessData.Title = JobID;
}
lastProcessData.Wafer = wafer;
lastProcessData.Reactor = reactor;
lastProcessData.RDS = rds;
string check = "--------";
if (string.IsNullOrEmpty(batch) || batch.Contains(check))
batch = lastProcessData.Batch;
else
lastProcessData.Batch = batch;
if (string.IsNullOrEmpty(cassette) || cassette.Contains(check))
cassette = lastProcessData.Cassette;
else
lastProcessData.Cassette = cassette;
if (string.IsNullOrEmpty(employee) || employee.Contains(check))
employee = lastProcessData.Employee;
else
lastProcessData.Employee = employee;
if (string.IsNullOrEmpty(recipe) || recipe.Contains(check))
recipe = lastProcessData.Recipe;
else
lastProcessData.Recipe = recipe;
if (string.IsNullOrEmpty(title) || title.Contains(check))
title = lastProcessData.Title;
else
lastProcessData.Title = title;
}
//fix title
StringBuilder titleFixed = new();
foreach (char c in title)
{
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
_ = titleFixed.Append(c);
}
//fix wafer
StringBuilder waferFixed = new();
foreach (char c in wafer)
{
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
_ = waferFixed.Append(c);
}
PSN = psn;
RDS = rds;
Date = date;
Zone = zone;
Batch = batch;
Layer = layer;
Recipe = recipe;
Reactor = reactor;
Cassette = cassette;
Employee = employee;
JobID = logistics.JobID;
Title = titleFixed.ToString();
Wafer = waferFixed.ToString();
UniqueId = string.Concat(title, '_', wafer, '_', logistics.DateTimeFromSequence.ToString("yyyyMMddHHmmssffff"), '_', logistics.TotalSecondsSinceLastWriteTimeFromSequence);
}
private void Parse(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, string originalDataBioRad, ProcessData lastProcessData)
{
if (fileRead is null)
@ -276,29 +465,7 @@ public partial class ProcessData : IProcessData
{
_I = 0;
_Data = receivedData;
Title = GetBefore("Recipe:");
Recipe = GetToken();
string dateTimeText = GetToEOL();
if (dateTimeText.EndsWith("."))
dateTimeText = dateTimeText.Remove(dateTimeText.Length - 1, 1);
DateTime dateTime = GetDateTime(logistics, dateTimeText);
Date = dateTime.ToString();
ScanPast("operator:");
Employee = GetBefore("batch:");
Batch = GetToEOL();
// Remove illegal characters \/:*?"<>| found in the Batch
Batch = Regex.Replace(Batch, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
ScanPast("cassette:");
Cassette = GetBefore("wafer:");
if (string.IsNullOrEmpty(Batch))
{
_I = 0;
_Data = receivedData;
ScanPast("wafer:");
}
Wafer = GetToEOL();
_ = GetToEOL();
_ = GetToEOL();
Set(logistics, lastProcessData, receivedData);
string token = GetToken();
int counter = 1;
while (true)
@ -322,86 +489,6 @@ public partial class ProcessData : IProcessData
ScanPast("thickness");
RVThickness = GetToEOL();
}
if (string.IsNullOrEmpty(Wafer))
throw new Exception("Wafer field is missing.");
//parse out batch and validate
string[] parsedBatch = Wafer.Split('-');
if (parsedBatch.Length >= 1)
Reactor = parsedBatch[0];
if (parsedBatch.Length >= 2)
RDS = parsedBatch[1];
if (parsedBatch.Length >= 3)
{
string[] parsedPSN = parsedBatch[2].Split('.');
if (parsedPSN.Length >= 1)
PSN = parsedPSN[0];
if (parsedPSN.Length >= 2)
Layer = parsedPSN[1];
}
if (parsedBatch.Length >= 4)
Zone = parsedBatch[3];
JobID = logistics.JobID;
if (logistics.DateTimeFromSequence > DateTime.Now.AddHours(-24))
{
if (string.IsNullOrEmpty(lastProcessData.Wafer))
{
lastProcessData.Batch = JobID;
lastProcessData.Cassette = JobID;
lastProcessData.Employee = JobID;
lastProcessData.Recipe = JobID;
lastProcessData.Title = JobID;
}
lastProcessData.Wafer = Wafer;
lastProcessData.Reactor = Reactor;
lastProcessData.RDS = RDS;
string check = "--------";
if (string.IsNullOrEmpty(Batch) || Batch.Contains(check))
Batch = lastProcessData.Batch;
else
lastProcessData.Batch = Batch;
if (string.IsNullOrEmpty(Cassette) || Cassette.Contains(check))
Cassette = lastProcessData.Cassette;
else
lastProcessData.Cassette = Cassette;
if (string.IsNullOrEmpty(Employee) || Employee.Contains(check))
Employee = lastProcessData.Employee;
else
lastProcessData.Employee = Employee;
if (string.IsNullOrEmpty(Recipe) || Recipe.Contains(check))
Recipe = lastProcessData.Recipe;
else
lastProcessData.Recipe = Recipe;
if (string.IsNullOrEmpty(Title) || Title.Contains(check))
Title = lastProcessData.Title;
else
lastProcessData.Title = Title;
}
//fix title
StringBuilder titleFixed = new();
foreach (char c in Title)
{
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
_ = titleFixed.Append(c);
}
Title = titleFixed.ToString();
//fix wafer
StringBuilder waferFixed = new();
foreach (char c in Wafer)
{
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
_ = waferFixed.Append(c);
}
Wafer = waferFixed.ToString();
//create filename / unique id
UniqueId = string.Concat(Title, '_', Wafer, '_', logistics.DateTimeFromSequence.ToString("yyyyMMddHHmmssffff"), '_', logistics.TotalSecondsSinceLastWriteTimeFromSequence);
foreach (Detail detail in details)
{
detail.HeaderUniqueId = UniqueId;
@ -423,7 +510,7 @@ public partial class ProcessData : IProcessData
_Log.Debug(string.Format("Std Dev: {0}", StdDev));
_Log.Debug(string.Format("Title: {0}", Title));
_Log.Debug(string.Format("Wafer: {0}", Wafer));
fileInfoCollection.Add(new FileInfo(logistics.ReportFullPath));
fileInfoCollection.Add(logistics.FileInfo);
_Details.AddRange(details);
}