MET08DDUPSP1TBI - v2.47.0 - Job -

Work Oder, Reactor and Slot
This commit is contained in:
Mike Phares 2022-10-10 17:35:21 -07:00
parent 67f10dbc2e
commit ccc2e138e5
8 changed files with 400 additions and 179 deletions

View File

@ -6,7 +6,7 @@ public class Input
public string Area { get; set; } public string Area { get; set; }
public string EquipmentType { get; set; } public string EquipmentType { get; set; }
public string MID { get; set; } public string MID { get; set; }
public string MeanThickness { get; set; } public string Slot { get; set; }
public string MesEntity { get; set; } public string MesEntity { get; set; }
public string Recipe { get; set; } public string Recipe { get; set; }
public string Sequence { get; set; } public string Sequence { get; set; }

View File

@ -38,91 +38,157 @@ public class Job
IsAreaSi = false; IsAreaSi = false;
else else
{ {
int rds;
string psn; string psn;
string lotName; int? rdsNumber;
string reactor;
string epiLayer; string epiLayer;
string basicType; string basicType;
const string hyphen = "-"; const string hyphen = "-";
Input input = JsonSerializer.Deserialize<Input>(mid); Input input = JsonSerializer.Deserialize<Input>(mid);
IsAreaSi = input.Area == "Si";
if (input.MID is null)
input.MID = string.Empty;
if (!long.TryParse(input.Sequence, out long sequence)) if (!long.TryParse(input.Sequence, out long sequence))
DateTime = DateTime.Now; DateTime = DateTime.Now;
else else
DateTime = new DateTime(sequence); DateTime = new DateTime(sequence);
if (input.MID.Length is not 2 and not 3) int? reactorNumber = GetReactorNumber(input);
(psn, rds, reactor) = Get(input); (int? workOrderNumber, int? _, int? workOrderCassette, int? slotNumber, bool isWorkOrder) = GetWorkOrder(input);
if (isWorkOrder || reactorNumber.HasValue)
(psn, rdsNumber) = (string.Empty, null);
else if (input.MID.Length is not 2 and not 3)
(psn, rdsNumber, reactorNumber) = Get(input);
else else
(psn, rds, reactor) = Get(metrologyFileShare, input); (psn, rdsNumber, reactorNumber) = Get(metrologyFileShare, input);
AutomationMode = string.Concat(DateTime.Ticks, ".", input.MesEntity);
Equipment = input.MesEntity; Equipment = input.MesEntity;
IsAreaSi = input.Area == "Si";
JobName = DateTime.Ticks.ToString(); JobName = DateTime.Ticks.ToString();
if (!IsValid(rds)) AutomationMode = string.Concat(DateTime.Ticks, ".", input.MesEntity);
(basicType, epiLayer, lotName, psn, reactor) = Get(lsl2SQLConnectionString, input, psn, rds, reactor); if (IsValid(rdsNumber))
(basicType, rdsNumber, psn, reactorNumber, epiLayer) = GetWithValidRDS(lsl2SQLConnectionString, psn, rdsNumber, reactorNumber);
else if (isWorkOrder || reactorNumber.HasValue)
(basicType, rdsNumber, psn, reactorNumber, epiLayer) = Get(lsl2SQLConnectionString, reactorNumber, slotNumber, workOrderNumber, workOrderCassette);
else else
{ {
basicType = hyphen;
lotName = input.MID;
epiLayer = "1"; epiLayer = "1";
basicType = hyphen;
} }
Qty = "1";
ProductName = psn;
EpiLayer = epiLayer; EpiLayer = epiLayer;
BasicType = basicType; BasicType = basicType;
LotName = lotName;
PackageName = hyphen; //WAFER_ID WaferLot
ProcessSpecName = hyphen; //WAFER_POS PocketNumber
ProcessType = reactor;
ProductName = psn;
Qty = "1";
RecipeName = input.Recipe; RecipeName = input.Recipe;
StateModel = input.EquipmentType; StateModel = input.EquipmentType;
PackageName = hyphen; //WAFER_ID WaferLot
ProcessSpecName = hyphen; //WAFER_POS PocketNumber
if (rdsNumber is null)
LotName = input.MID;
else
LotName = rdsNumber.Value.ToString();
if (reactorNumber is null)
ProcessType = string.Empty;
else
ProcessType = reactorNumber.Value.ToString();
Items.Add(new Item { Name = "0", Type = "NA", Number = (0 + 1).ToString(), Qty = "1", CarrierName = hyphen }); Items.Add(new Item { Name = "0", Type = "NA", Number = (0 + 1).ToString(), Qty = "1", CarrierName = hyphen });
} }
} }
private static bool IsValid(int rds) => rds is < 100000 or > 100000000; private static int? GetReactorNumber(Input input)
private static (string, int, string) Get(Input input)
{ {
int rds; int? result;
string psn; bool isReactor = !string.IsNullOrEmpty(input.MID) && input.MID.Length == 2 && Regex.IsMatch(input.MID, "^[0-9]{2}$");
string reactor; if (!isReactor)
const int zero = 0; result = null;
string[] segments = Regex.Split(input.MID, @"[^0-9']"); else if (!int.TryParse(input.MID, out int reactor))
if (segments.Length < 3) result = null;
rds = 0;
else else
_ = int.TryParse(segments[1], out rds); result = reactor;
if (IsValid(rds)) return result;
}
private static (int?, int?, int?, int?, bool) GetWorkOrder(Input input)
{
int? slotNumber;
int? workOrderStep = null;
int? workOrderNumber = null;
MatchCollection[] collection;
int? workOrderCassette = null;
if (string.IsNullOrEmpty(input.MID))
collection = Array.Empty<MatchCollection>();
else
{
string pattern = @"^([oiOI])([0-9]{6,7})\.([0-5]{1})\.([0-9]{1,2})$"; // o171308.1.51
collection = (from l in input.MID.Split('-') select Regex.Matches(l, pattern)).ToArray();
}
foreach (MatchCollection matchCollection in collection)
{
if (matchCollection.Count == 0)
continue;
if (!matchCollection[0].Success || matchCollection[0].Groups.Count != 5)
continue;
if (!int.TryParse(matchCollection[0].Groups[3].Value, out int workOrderStepValue))
continue;
if (!int.TryParse(matchCollection[0].Groups[2].Value, out int workOrderNumberValue))
continue;
if (!int.TryParse(matchCollection[0].Groups[4].Value, out int workOrderCassetteValue))
continue;
workOrderStep = workOrderStepValue;
workOrderNumber = workOrderNumberValue;
workOrderCassette = workOrderCassetteValue;
break;
}
if (string.IsNullOrEmpty(input.Slot) || !int.TryParse(input.Slot, out int slot))
slotNumber = null;
else
slotNumber = slot;
return new(workOrderNumber, workOrderStep, workOrderCassette, slotNumber, workOrderStep is not null || workOrderNumber is not null || workOrderCassette is not null);
}
private static bool IsValid(int? rdsNumber) => !IsInvalid(rdsNumber);
private static bool IsInvalid(int? rdsNumber) => rdsNumber is null or < 100000 or > 100000000;
private static (string, int, int?) Get(Input input)
{
string psn;
int rdsNumber;
int? reactorNumber;
const int zero = 0;
string[] segments;
if (string.IsNullOrEmpty(input.MID))
segments = Array.Empty<string>();
else
segments = Regex.Split(input.MID, "[^0-9']");
if (segments.Length < 3)
rdsNumber = 0;
else
_ = int.TryParse(segments[1], out rdsNumber);
if (IsInvalid(rdsNumber) || !int.TryParse(segments[zero], out int reactor))
{ {
psn = string.Empty; psn = string.Empty;
reactor = string.Empty; reactorNumber = null;
} }
else else
{ {
psn = segments[2]; psn = segments[2];
reactor = segments[zero]; reactorNumber = reactor;
} }
return new(psn, rds, reactor); return new(psn, rdsNumber, reactorNumber);
} }
private static (string, int, string) Get(string metrologyFileShare, Input input) private static (string, int?, int?) Get(string metrologyFileShare, Input input)
{ {
int rds = 0; string[] files;
string psn;
string reactor;
string[] lines; string[] lines;
string moveFile; string moveFile;
psn = string.Empty; int? reactor = null;
reactor = string.Empty; int? rdsNumber = null;
string psn = string.Empty;
string usedDirectory = Path.Combine(metrologyFileShare, "Used"); string usedDirectory = Path.Combine(metrologyFileShare, "Used");
if (!Directory.Exists(metrologyFileShare)) if (!Directory.Exists(metrologyFileShare))
throw new Exception($"Unable to access file-share <{metrologyFileShare}>"); throw new Exception($"Unable to access file-share <{metrologyFileShare}>");
if (!Directory.Exists(usedDirectory)) if (!Directory.Exists(usedDirectory))
_ = Directory.CreateDirectory(usedDirectory); _ = Directory.CreateDirectory(usedDirectory);
string[] files = Directory.GetFiles(metrologyFileShare, $"*-{input.MID}.rsv", SearchOption.TopDirectoryOnly); if (string.IsNullOrEmpty(input.MID))
files = Array.Empty<string>();
else
files = Directory.GetFiles(metrologyFileShare, $"*-{input.MID}.rsv", SearchOption.TopDirectoryOnly);
foreach (string file in files.OrderByDescending(l => new FileInfo(l).LastWriteTime)) foreach (string file in files.OrderByDescending(l => new FileInfo(l).LastWriteTime))
{ {
lines = File.ReadAllLines(file); lines = File.ReadAllLines(file);
@ -130,11 +196,12 @@ public class Job
{ {
if (string.IsNullOrEmpty(line)) if (string.IsNullOrEmpty(line))
continue; continue;
if (!int.TryParse(line, out rds) || IsValid(rds)) if (!int.TryParse(line, out int rds) || IsInvalid(rds))
continue; continue;
rdsNumber = rds;
break; break;
} }
if (rds != 0) if (rdsNumber is not null)
{ {
moveFile = Path.Combine(usedDirectory, Path.GetFileName(file)); moveFile = Path.Combine(usedDirectory, Path.GetFileName(file));
if (File.Exists(moveFile)) if (File.Exists(moveFile))
@ -144,21 +211,16 @@ public class Job
break; break;
} }
} }
return new(psn, rds, reactor); return new(psn, rdsNumber, reactor);
} }
private static string GetRunJson(string lsl2SQLConnectionString, int rds) private static string GetRunJson(string lsl2SQLConnectionString, int? rds, int? workOrderNumber, int? workOrderCassette, int? slot, int? reactor)
{ {
string result; string result;
object scalar = null; object scalar = null;
StringBuilder sql = new(); StringBuilder sql = new();
_ = sql.Append(" select "). _ = sql.Append(" select ").
Append(" qa.rds_no "). Append(" rr.rds_no ").
Append(" , qa.max_rds_layer_keys_mv_no ").
Append(" , qa.max_part_no ").
Append(" , substring(max_part_no, 0, len(max_part_no)) max_part_no_substr_0 ").
Append(" , substring(max_part_no, 1, len(max_part_no)) max_part_no_substr_1 ").
Append(" , rr.part_no ").
Append(" , rr.reactor "). Append(" , rr.reactor ").
Append(" , rr.ps_no "). Append(" , rr.ps_no ").
Append(" , rr.load_lock_side "). Append(" , rr.load_lock_side ").
@ -166,44 +228,44 @@ public class Job
Append(" , rr.recipe_name "). Append(" , rr.recipe_name ").
Append(" , rr.recipe_no "). Append(" , rr.recipe_no ").
Append(" , rr.spec_type "). Append(" , rr.spec_type ").
Append(" , react_tool_id "). Append(" from lsl2sql.dbo.react_run rr ").
Append(" , epi_layer "). Append(" where rr.rds_no = ").Append(rds is null ? -1 : rds.Value).Append(' ').
Append(" , epi_step "). Append(" union all ").
Append(" , epi_step_lsid "). Append(" select ").
Append(" , epi_dopant "). Append(" rr.rds_no ").
Append(" , epi_thick_min "). Append(" , rr.reactor ").
Append(" , epi_thick_max "). Append(" , rr.ps_no ").
Append(" , epi_thick_targ "). Append(" , rr.load_lock_side ").
Append(" , epi_res_min "). Append(" , rr.reactor_type ").
Append(" , epi_res_max "). Append(" , rr.recipe_name ").
Append(" , epi_res_targ "). Append(" , rr.recipe_no ").
Append(" from ( "). Append(" , rr.spec_type ").
Append(" select top (1000) "). Append(" from lsl2sql.dbo.react_run rr ").
Append(" rds_no "). Append(" where rr.rds_no = ( ").
Append(" , ( "). Append(" select max(wm.rds_no) ").
Append(" select max(mv_no) "). Append(" from lsl2sql.dbo.wm_in_slot_no wm ").
Append(" from lsl2sql.dbo.rds_rds_layer_keys "). Append(" where wm.wo_no = ").Append(workOrderNumber is null ? -1 : workOrderNumber.Value).Append(' ').
Append(" where seq = rds_no "). Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
Append(" ) max_rds_layer_keys_mv_no "). Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
Append(" , case when part_no != '' ").
Append(" then part_no ").
Append(" else ").
Append(" ( ").
Append(" select max(part_no) ").
Append(" from lsl2sql.dbo.react_run b ").
Append(" where b.ps_no = qa.ps_no ").
Append(" ) "). Append(" ) ").
Append(" end max_part_no "). Append(" union all ").
Append(" select ").
Append(" rr.rds_no ").
Append(" , rr.reactor ").
Append(" , rr.ps_no ").
Append(" , rr.load_lock_side ").
Append(" , rr.reactor_type ").
Append(" , rr.recipe_name ").
Append(" , rr.recipe_no ").
Append(" , rr.spec_type ").
Append(" from lsl2sql.dbo.react_run rr ").
Append(" where rr.rds_no = ( ").
Append(" select max(qa.rds_no) ").
Append(" from lsl2sql.dbo.react_run qa "). Append(" from lsl2sql.dbo.react_run qa ").
Append(" where rds_no = '").Append(rds).Append("' "). Append(" where qa.load_sig != '' ").
Append(" ) as qa "). Append(" and qa.load_sig_dtm > '2022-07-01 00:00:00.000' ").
Append(" inner join lsl2sql.dbo.react_run rr "). Append(" and qa.reactor = ").Append(reactor is null ? -1 : reactor.Value).Append(' ').
Append(" on qa.rds_no = rr.rds_no "). Append(" ) ").
Append(" left join lsl2sql.dbo.epi_part_layer_spec es ").
Append(" on max_part_no = epi_pn ").
Append(" or substring(max_part_no, 0, len(max_part_no)) = epi_pn ").
Append(" or substring(max_part_no, 1, len(max_part_no)) = epi_pn ").
Append(" order by epi_layer ").
Append(" for json path "); Append(" for json path ");
try try
{ {
@ -222,19 +284,20 @@ public class Job
return result; return result;
} }
private static (string, string, string, string, string) Get(string lsl2SQLConnectionString, Input input, string psn, int rds, string reactor) private static (string, int?, string, int?, string) Get(string lsl2SQLConnectionString, int? reactorNumber, int? slotNumber, int? workOrderNumber, int? workOrderCassette)
{ {
string lotName; string psn;
string epiLayer; int? rdsNumber;
string basicType; string basicType;
const int zero = 0; const int zero = 0;
string epiLayer = "1";
const string hyphen = "-"; const string hyphen = "-";
lotName = rds.ToString(); string json = GetRunJson(lsl2SQLConnectionString, rds: -1, workOrderNumber, workOrderCassette, slotNumber, reactorNumber);
string json = GetRunJson(lsl2SQLConnectionString, rds);
if (string.IsNullOrEmpty(json)) if (string.IsNullOrEmpty(json))
{ {
epiLayer = "1"; rdsNumber = null;
basicType = hyphen; basicType = hyphen;
psn = string.Empty;
} }
else else
{ {
@ -245,15 +308,16 @@ public class Job
{ runs = Array.Empty<Run>(); } { runs = Array.Empty<Run>(); }
if (!runs.Any()) if (!runs.Any())
{ {
epiLayer = "1"; rdsNumber = null;
basicType = hyphen; basicType = hyphen;
psn = string.Empty;
} }
else else
{ {
if (string.IsNullOrEmpty(reactor))
reactor = runs[zero].Reactor.ToString();
if (string.IsNullOrEmpty(psn))
psn = runs[zero].PSN; psn = runs[zero].PSN;
rdsNumber = runs[zero].RdsNo;
if (reactorNumber is null)
reactorNumber = runs[zero].Reactor;
string loadLockSide = runs[zero].LoadLockSide; string loadLockSide = runs[zero].LoadLockSide;
string loadLockSideFull = loadLockSide switch string loadLockSideFull = loadLockSide switch
{ {
@ -262,29 +326,46 @@ public class Job
_ => loadLockSide, _ => loadLockSide,
}; };
basicType = $"{loadLockSideFull} - {runs[zero].ReactorType}"; basicType = $"{loadLockSideFull} - {runs[zero].ReactorType}";
int maxRdsLayerKeysMvNo = runs[zero].MaxRdsLayerKeysMvNo; }
if (maxRdsLayerKeysMvNo == 1) }
epiLayer = "1"; return new(basicType, rdsNumber, psn, reactorNumber, epiLayer);
}
private static (string, int?, string, int?, string) GetWithValidRDS(string lsl2SQLConnectionString, string psn, int? rdsNumber, int? reactorNumber)
{
string basicType;
const int zero = 0;
string epiLayer = "1";
const string hyphen = "-";
string json = GetRunJson(lsl2SQLConnectionString, rdsNumber, workOrderNumber: -1, workOrderCassette: -1, slot: -1, reactor: -1);
if (string.IsNullOrEmpty(json))
basicType = hyphen;
else else
{ {
if (string.IsNullOrEmpty(input.MeanThickness) || !double.TryParse(input.MeanThickness, out double meanThickness)) Run[] runs;
epiLayer = runs[zero].EpiLayer; try
{ runs = JsonSerializer.Deserialize<Run[]>(json); }
catch (Exception)
{ runs = Array.Empty<Run>(); }
if (!runs.Any())
basicType = hyphen;
else else
{ {
epiLayer = hyphen; if (string.IsNullOrEmpty(psn))
foreach (Run run in runs) psn = runs[zero].PSN;
if (reactorNumber is null)
reactorNumber = runs[zero].Reactor;
string loadLockSide = runs[zero].LoadLockSide;
string loadLockSideFull = loadLockSide switch
{ {
if (run.EpiThickMin is null || run.EpiThickMax is null) "L" => "Left",
continue; "R" => "Right",
if (meanThickness < run.EpiThickMin || meanThickness > run.EpiThickMax) _ => loadLockSide,
continue; };
epiLayer = run.EpiLayer; basicType = $"{loadLockSideFull} - {runs[zero].ReactorType}";
} }
} }
} return new(basicType, rdsNumber, psn, reactorNumber, epiLayer);
}
}
return new(basicType, epiLayer, lotName, psn, reactor);
} }
} }

View File

@ -4,18 +4,22 @@ public class Descriptor
{ {
public string Employee { get; private set; } public string Employee { get; private set; }
public string Layer { get; private set; }
public string Lot { get; private set; } public string Lot { get; private set; }
public string PSN { get; private set; } public string PSN { get; private set; }
public string RDS { get; private set; } public string RDS { get; private set; }
public string Reactor { get; private set; } public string Reactor { get; private set; }
public string Zone { get; private set; }
public Descriptor(string employee, string lot, string psn, string rds, string reactor) public Descriptor(string employee, string layer, string lot, string psn, string rds, string reactor, string zone)
{ {
Employee = employee; Employee = employee;
Layer = layer;
Lot = lot; Lot = lot;
PSN = psn; PSN = psn;
RDS = rds; RDS = rds;
Reactor = reactor; Reactor = reactor;
Zone = zone;
} }
} }

View File

@ -457,38 +457,15 @@ public class ProcessData : IProcessData
} }
} }
public static Descriptor GetDescriptor(string text) private static (string, string) GetReactorAndRDS(string defaultReactor, string defaultRDS, string text, string formattedText, string[] segments)
{ {
Descriptor result;
string lot;
string rds; string rds;
string psn;
string reactor; string reactor;
string employee; if (string.IsNullOrEmpty(text) || segments.Length == 0 || string.IsNullOrEmpty(formattedText))
const string defaultPSN = "0000";
const string defaultReactor = "00";
const string defaultRDS = "000000";
if (text.Length is 2 or 3)
{
lot = text;
employee = text;
rds = defaultRDS;
psn = defaultPSN;
reactor = defaultReactor;
}
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"))
lot = lot.Substring(2);
string[] segments = lot.Split('-');
if (segments.Length == 0)
reactor = defaultReactor; reactor = defaultReactor;
else else
reactor = segments[0]; reactor = segments[0];
if (segments.Length <= 1) if (segments.Length <= 1 || !int.TryParse(segments[1], out int rdsValue) || rdsValue < 99)
rds = defaultRDS; rds = defaultRDS;
else else
rds = segments[1]; rds = segments[1];
@ -497,17 +474,107 @@ public class ProcessData : IProcessData
rds = reactor; rds = reactor;
reactor = defaultReactor; reactor = defaultReactor;
} }
if (segments.Length <= 2) return new(reactor, rds);
psn = defaultPSN;
else
psn = segments[2].Split('.')[0];
} }
result = new(employee, lot, psn, rds, reactor);
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 psn;
string rds;
string zone;
string layer;
string reactor;
string employee;
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;
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
{
// Remove illegal characters \/:*?"<>| found in the Lot.
lot = Regex.Replace(text, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
if (lot.Length > 2 && lot[0] == '1' && (lot[1] == 'T' || lot[1] == 't'))
lot = lot.Substring(2);
string[] segments = lot.Split('-');
(reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, lot, segments);
(layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments);
zone = GetZone(segments);
employee = defaultEmployee;
}
result = new(employee, layer, lot, psn, rds, reactor, zone);
return result; return result;
} }
private void Set(ILogistics logistics, string summaryReportText) private void Set(ILogistics logistics, string summaryReportText)
{ {
_I = 0;
string lot; string lot;
string rds; string rds;
string psn; string psn;
@ -515,24 +582,22 @@ public class ProcessData : IProcessData
string reactor; string reactor;
string session; string session;
string employee; string employee;
const string defaultPSN = "0000"; Descriptor descriptor;
const string defaultReactor = "00"; _Data = summaryReportText;
const string defaultRDS = "000000"; _Log.Debug("HeaderFile() - Beginning");
if (string.IsNullOrEmpty(summaryReportText)) if (string.IsNullOrEmpty(summaryReportText))
{ {
rds = defaultRDS;
psn = defaultPSN;
lot = string.Empty;
recipe = string.Empty; recipe = string.Empty;
session = string.Empty; session = string.Empty;
reactor = defaultReactor; descriptor = GetDescriptor(summaryReportText);
employee = string.Empty; lot = descriptor.Lot;
psn = descriptor.PSN;
rds = descriptor.RDS;
reactor = descriptor.Reactor;
employee = descriptor.Employee;
} }
else else
{ {
_Log.Debug("HeaderFile() - Beginning");
_I = 0;
_Data = summaryReportText;
ScanPast("Long Wafer Summary"); ScanPast("Long Wafer Summary");
_ = GetToEOL(); _ = GetToEOL();
ScanPast("Session:"); ScanPast("Session:");
@ -540,7 +605,7 @@ public class ProcessData : IProcessData
session = recipe; session = recipe;
ScanPast("Lot ID:"); ScanPast("Lot ID:");
lot = GetToEOL(true); lot = GetToEOL(true);
Descriptor descriptor = GetDescriptor(lot); descriptor = GetDescriptor(lot);
lot = descriptor.Lot; lot = descriptor.Lot;
psn = descriptor.PSN; psn = descriptor.PSN;
rds = descriptor.RDS; rds = descriptor.RDS;

View File

@ -42,20 +42,37 @@ public class Job : LoggingUnitTesting, IDisposable
LoggingUnitTesting.Dispose(); LoggingUnitTesting.Dispose();
} }
#if true
[Ignore]
#endif
[TestMethod] [TestMethod]
public void TestJob() public void TestJob()
{ {
FileHandlers.TIBCO.Transport.Job job; FileHandlers.TIBCO.Transport.Job job;
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"));
string conn = "Data Source=10.95.128.28\\PROD1,53959;Initial Catalog=LSL2SQL;Persist Security Info=True;User ID=srpadmin;Password=;"; string conn = "Data Source=10.95.128.28\\PROD1,53959;Initial Catalog=LSL2SQL;Persist Security Info=True;User ID=srpadmin;Password=0okm9ijn;";
job = new(conn, string.Empty, "00-544481-0000"); job = new(conn, string.Empty, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"12-123456-1234\", \"Recipe\": \"Recipe\"}");
Assert.IsTrue(string.IsNullOrEmpty(job.LotName)); Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "21");
Assert.IsTrue(job.LotName == "123456");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4609");
Assert.IsTrue(job.EpiLayer == "1");
job = new(conn, string.Empty, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"-544481-\", \"Recipe\": \"Recipe\"}"); job = new(conn, string.Empty, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"-544481-\", \"Recipe\": \"Recipe\"}");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51");
Assert.IsTrue(job.LotName == "544481"); Assert.IsTrue(job.LotName == "544481");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158");
Assert.IsTrue(job.EpiLayer == "1");
job = new(conn, string.Empty, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-544481-0000\", \"Recipe\": \"Recipe\"}");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51");
Assert.IsTrue(job.LotName == "544481");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158");
Assert.IsTrue(job.EpiLayer == "1");
job = new(conn, string.Empty, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"37\", \"Recipe\": \"Recipe\"}");
Assert.IsTrue(job.ProcessType == "37");
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "549918");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5101");
Assert.IsTrue(job.EpiLayer == "1");
job = new(conn, string.Empty, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-o171308.1.51-0000\", \"Recipe\": \"Recipe\", \"Slot\": \"11\"}");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "54");
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "547000");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4445");
Assert.IsTrue(job.EpiLayer == "1"); Assert.IsTrue(job.EpiLayer == "1");
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
} }

View File

@ -48,29 +48,83 @@ public class TXT : LoggingUnitTesting, IDisposable
FileHandlers.txt.Descriptor descriptor; FileHandlers.txt.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);
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.txt.ProcessData.GetDescriptor("12-123456-1234"); descriptor = FileHandlers.txt.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.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = FileHandlers.txt.ProcessData.GetDescriptor("123456"); descriptor = FileHandlers.txt.ProcessData.GetDescriptor("123456");
Assert.IsTrue(descriptor.Reactor is "00"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(descriptor.RDS is "123456"); Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(descriptor.PSN is "0000"); 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.txt.ProcessData.GetDescriptor("1T123456"); descriptor = FileHandlers.txt.ProcessData.GetDescriptor("1T123456");
Assert.IsTrue(descriptor.Reactor is "00"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(descriptor.RDS is "123456"); Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(descriptor.PSN is "0000"); 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.txt.ProcessData.GetDescriptor("MP"); descriptor = FileHandlers.txt.ProcessData.GetDescriptor("MP");
Assert.IsTrue(descriptor.Reactor is "00"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(descriptor.RDS is "000000"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.PSN is "0000"); 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.Zone));
descriptor = FileHandlers.txt.ProcessData.GetDescriptor("12-123456-1234.2-1"); descriptor = FileHandlers.txt.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));
descriptor = FileHandlers.txt.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.txt.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.txt.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.txt.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.txt.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));
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
} }

View File

@ -169,7 +169,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Infineon.EAF.Runtime"> <PackageReference Include="Infineon.EAF.Runtime">
<Version>2.43.0</Version> <Version>2.47.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="System.Text.Json"> <PackageReference Include="System.Text.Json">
<Version>6.0.3</Version> <Version>6.0.3</Version>

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.43.4.0")] [assembly: AssemblyVersion("2.47.0.0")]
[assembly: AssemblyFileVersion("2.43.4.0")] [assembly: AssemblyFileVersion("2.47.0.0")]