MET08DDUPSP1TBI - v2.47.0 - Job -
Work Oder, Reactor and Slot
This commit is contained in:
@ -457,57 +457,124 @@ public class ProcessData : IProcessData
|
||||
}
|
||||
}
|
||||
|
||||
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))
|
||||
reactor = defaultReactor;
|
||||
else
|
||||
reactor = segments[0];
|
||||
if (segments.Length <= 1 || !int.TryParse(segments[1], out int rdsValue) || rdsValue < 99)
|
||||
rds = defaultRDS;
|
||||
else
|
||||
rds = segments[1];
|
||||
if (reactor.Length > 3)
|
||||
{
|
||||
rds = reactor;
|
||||
reactor = defaultReactor;
|
||||
}
|
||||
return new(reactor, rds);
|
||||
}
|
||||
|
||||
private static (string, string) GetLayerAndPSN(string defaultLayer, string defaultPSN, string[] segments)
|
||||
{
|
||||
string psn;
|
||||
string layer;
|
||||
if (segments.Length <= 2)
|
||||
{
|
||||
psn = defaultPSN;
|
||||
layer = defaultLayer;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] segmentsB = segments[2].Split('.');
|
||||
psn = segmentsB[0];
|
||||
if (segmentsB.Length <= 1)
|
||||
layer = defaultLayer;
|
||||
else
|
||||
{
|
||||
layer = segmentsB[1];
|
||||
if (layer.Length > 1 && layer[0] == '0')
|
||||
layer = layer.Substring(1);
|
||||
}
|
||||
}
|
||||
return (layer, psn);
|
||||
}
|
||||
|
||||
private static string GetZone(string[] segments)
|
||||
{
|
||||
string result;
|
||||
if (segments.Length <= 3)
|
||||
result = string.Empty;
|
||||
else
|
||||
{
|
||||
result = segments[3];
|
||||
if (result.Length > 1 && result[0] == '0')
|
||||
result = result.Substring(1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Descriptor GetDescriptor(string text)
|
||||
{
|
||||
Descriptor result;
|
||||
string lot;
|
||||
string rds;
|
||||
string psn;
|
||||
string rds;
|
||||
string zone;
|
||||
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)
|
||||
string defaultPSN = string.Empty;
|
||||
string defaultRDS = string.Empty;
|
||||
string defaultZone = string.Empty;
|
||||
string defaultLayer = string.Empty;
|
||||
string defaultReactor = string.Empty;
|
||||
string defaultEmployee = string.Empty;
|
||||
if (string.IsNullOrEmpty(text) || (text.Length is 2 or 3 && Regex.IsMatch(text, "^[a-zA-z]{2,3}")))
|
||||
{
|
||||
lot = text;
|
||||
employee = text;
|
||||
rds = defaultRDS;
|
||||
psn = defaultPSN;
|
||||
rds = defaultRDS;
|
||||
zone = defaultZone;
|
||||
layer = defaultLayer;
|
||||
reactor = defaultReactor;
|
||||
}
|
||||
else if (Regex.IsMatch(text, @"^[0-9]{2}[.][0-9]{1}[.]?[0-9]{0,1}"))
|
||||
{
|
||||
string[] segments = text.Split('.');
|
||||
lot = text;
|
||||
psn = defaultPSN;
|
||||
rds = defaultRDS;
|
||||
layer = segments[1];
|
||||
reactor = segments[0];
|
||||
employee = defaultEmployee;
|
||||
if (segments.Length <= 2)
|
||||
zone = defaultZone;
|
||||
else
|
||||
zone = segments[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
employee = string.Empty;
|
||||
// Remove illegal characters \/:*?"<>| found in the Lot.
|
||||
lot = Regex.Replace(text, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
||||
if (lot.StartsWith("1T") || lot.StartsWith("1t"))
|
||||
if (lot.Length > 2 && lot[0] == '1' && (lot[1] == 'T' || lot[1] == 't'))
|
||||
lot = lot.Substring(2);
|
||||
string[] segments = lot.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].Split('.')[0];
|
||||
(reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, lot, segments);
|
||||
(layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments);
|
||||
zone = GetZone(segments);
|
||||
employee = defaultEmployee;
|
||||
}
|
||||
result = new(employee, lot, psn, rds, reactor);
|
||||
result = new(employee, layer, lot, psn, rds, reactor, zone);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void Set(ILogistics logistics, string summaryReportText)
|
||||
{
|
||||
_I = 0;
|
||||
string lot;
|
||||
string rds;
|
||||
string psn;
|
||||
@ -515,24 +582,22 @@ public class ProcessData : IProcessData
|
||||
string reactor;
|
||||
string session;
|
||||
string employee;
|
||||
const string defaultPSN = "0000";
|
||||
const string defaultReactor = "00";
|
||||
const string defaultRDS = "000000";
|
||||
Descriptor descriptor;
|
||||
_Data = summaryReportText;
|
||||
_Log.Debug("HeaderFile() - Beginning");
|
||||
if (string.IsNullOrEmpty(summaryReportText))
|
||||
{
|
||||
rds = defaultRDS;
|
||||
psn = defaultPSN;
|
||||
lot = string.Empty;
|
||||
recipe = string.Empty;
|
||||
session = string.Empty;
|
||||
reactor = defaultReactor;
|
||||
employee = string.Empty;
|
||||
descriptor = GetDescriptor(summaryReportText);
|
||||
lot = descriptor.Lot;
|
||||
psn = descriptor.PSN;
|
||||
rds = descriptor.RDS;
|
||||
reactor = descriptor.Reactor;
|
||||
employee = descriptor.Employee;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Log.Debug("HeaderFile() - Beginning");
|
||||
_I = 0;
|
||||
_Data = summaryReportText;
|
||||
ScanPast("Long Wafer Summary");
|
||||
_ = GetToEOL();
|
||||
ScanPast("Session:");
|
||||
@ -540,7 +605,7 @@ public class ProcessData : IProcessData
|
||||
session = recipe;
|
||||
ScanPast("Lot ID:");
|
||||
lot = GetToEOL(true);
|
||||
Descriptor descriptor = GetDescriptor(lot);
|
||||
descriptor = GetDescriptor(lot);
|
||||
lot = descriptor.Lot;
|
||||
psn = descriptor.PSN;
|
||||
rds = descriptor.RDS;
|
||||
|
Reference in New Issue
Block a user