MET08DDUPSP1TBI - v2.47.0 - Job -
Work Oder, Reactor and Slot
This commit is contained in:
parent
67f10dbc2e
commit
ccc2e138e5
@ -6,7 +6,7 @@ public class Input
|
||||
public string Area { get; set; }
|
||||
public string EquipmentType { get; set; }
|
||||
public string MID { get; set; }
|
||||
public string MeanThickness { get; set; }
|
||||
public string Slot { get; set; }
|
||||
public string MesEntity { get; set; }
|
||||
public string Recipe { get; set; }
|
||||
public string Sequence { get; set; }
|
||||
|
@ -38,91 +38,157 @@ public class Job
|
||||
IsAreaSi = false;
|
||||
else
|
||||
{
|
||||
int rds;
|
||||
string psn;
|
||||
string lotName;
|
||||
string reactor;
|
||||
int? rdsNumber;
|
||||
string epiLayer;
|
||||
string basicType;
|
||||
const string hyphen = "-";
|
||||
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))
|
||||
DateTime = DateTime.Now;
|
||||
else
|
||||
DateTime = new DateTime(sequence);
|
||||
if (input.MID.Length is not 2 and not 3)
|
||||
(psn, rds, reactor) = Get(input);
|
||||
int? reactorNumber = GetReactorNumber(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
|
||||
(psn, rds, reactor) = Get(metrologyFileShare, input);
|
||||
AutomationMode = string.Concat(DateTime.Ticks, ".", input.MesEntity);
|
||||
(psn, rdsNumber, reactorNumber) = Get(metrologyFileShare, input);
|
||||
Equipment = input.MesEntity;
|
||||
IsAreaSi = input.Area == "Si";
|
||||
JobName = DateTime.Ticks.ToString();
|
||||
if (!IsValid(rds))
|
||||
(basicType, epiLayer, lotName, psn, reactor) = Get(lsl2SQLConnectionString, input, psn, rds, reactor);
|
||||
AutomationMode = string.Concat(DateTime.Ticks, ".", input.MesEntity);
|
||||
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
|
||||
{
|
||||
basicType = hyphen;
|
||||
lotName = input.MID;
|
||||
epiLayer = "1";
|
||||
basicType = hyphen;
|
||||
}
|
||||
Qty = "1";
|
||||
ProductName = psn;
|
||||
EpiLayer = epiLayer;
|
||||
BasicType = basicType;
|
||||
LotName = lotName;
|
||||
PackageName = hyphen; //WAFER_ID WaferLot
|
||||
ProcessSpecName = hyphen; //WAFER_POS PocketNumber
|
||||
ProcessType = reactor;
|
||||
ProductName = psn;
|
||||
Qty = "1";
|
||||
RecipeName = input.Recipe;
|
||||
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 });
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsValid(int rds) => rds is < 100000 or > 100000000;
|
||||
|
||||
private static (string, int, string) Get(Input input)
|
||||
private static int? GetReactorNumber(Input input)
|
||||
{
|
||||
int rds;
|
||||
string psn;
|
||||
string reactor;
|
||||
const int zero = 0;
|
||||
string[] segments = Regex.Split(input.MID, @"[^0-9']");
|
||||
if (segments.Length < 3)
|
||||
rds = 0;
|
||||
int? result;
|
||||
bool isReactor = !string.IsNullOrEmpty(input.MID) && input.MID.Length == 2 && Regex.IsMatch(input.MID, "^[0-9]{2}$");
|
||||
if (!isReactor)
|
||||
result = null;
|
||||
else if (!int.TryParse(input.MID, out int reactor))
|
||||
result = null;
|
||||
else
|
||||
_ = int.TryParse(segments[1], out rds);
|
||||
if (IsValid(rds))
|
||||
result = reactor;
|
||||
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;
|
||||
reactor = string.Empty;
|
||||
reactorNumber = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
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 psn;
|
||||
string reactor;
|
||||
string[] files;
|
||||
string[] lines;
|
||||
string moveFile;
|
||||
psn = string.Empty;
|
||||
reactor = string.Empty;
|
||||
int? reactor = null;
|
||||
int? rdsNumber = null;
|
||||
string psn = string.Empty;
|
||||
string usedDirectory = Path.Combine(metrologyFileShare, "Used");
|
||||
if (!Directory.Exists(metrologyFileShare))
|
||||
throw new Exception($"Unable to access file-share <{metrologyFileShare}>");
|
||||
if (!Directory.Exists(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))
|
||||
{
|
||||
lines = File.ReadAllLines(file);
|
||||
@ -130,11 +196,12 @@ public class Job
|
||||
{
|
||||
if (string.IsNullOrEmpty(line))
|
||||
continue;
|
||||
if (!int.TryParse(line, out rds) || IsValid(rds))
|
||||
if (!int.TryParse(line, out int rds) || IsInvalid(rds))
|
||||
continue;
|
||||
rdsNumber = rds;
|
||||
break;
|
||||
}
|
||||
if (rds != 0)
|
||||
if (rdsNumber is not null)
|
||||
{
|
||||
moveFile = Path.Combine(usedDirectory, Path.GetFileName(file));
|
||||
if (File.Exists(moveFile))
|
||||
@ -144,21 +211,16 @@ public class Job
|
||||
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;
|
||||
object scalar = null;
|
||||
StringBuilder sql = new();
|
||||
_ = sql.Append(" select ").
|
||||
Append(" qa.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.rds_no ").
|
||||
Append(" , rr.reactor ").
|
||||
Append(" , rr.ps_no ").
|
||||
Append(" , rr.load_lock_side ").
|
||||
@ -166,44 +228,44 @@ public class Job
|
||||
Append(" , rr.recipe_name ").
|
||||
Append(" , rr.recipe_no ").
|
||||
Append(" , rr.spec_type ").
|
||||
Append(" , react_tool_id ").
|
||||
Append(" , epi_layer ").
|
||||
Append(" , epi_step ").
|
||||
Append(" , epi_step_lsid ").
|
||||
Append(" , epi_dopant ").
|
||||
Append(" , epi_thick_min ").
|
||||
Append(" , epi_thick_max ").
|
||||
Append(" , epi_thick_targ ").
|
||||
Append(" , epi_res_min ").
|
||||
Append(" , epi_res_max ").
|
||||
Append(" , epi_res_targ ").
|
||||
Append(" from ( ").
|
||||
Append(" select top (1000) ").
|
||||
Append(" rds_no ").
|
||||
Append(" , ( ").
|
||||
Append(" select max(mv_no) ").
|
||||
Append(" from lsl2sql.dbo.rds_rds_layer_keys ").
|
||||
Append(" where seq = rds_no ").
|
||||
Append(" ) max_rds_layer_keys_mv_no ").
|
||||
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(" end max_part_no ").
|
||||
Append(" from lsl2sql.dbo.react_run rr ").
|
||||
Append(" where rr.rds_no = ").Append(rds is null ? -1 : rds.Value).Append(' ').
|
||||
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(wm.rds_no) ").
|
||||
Append(" from lsl2sql.dbo.wm_in_slot_no wm ").
|
||||
Append(" where wm.wo_no = ").Append(workOrderNumber is null ? -1 : workOrderNumber.Value).Append(' ').
|
||||
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
|
||||
Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
|
||||
Append(" ) ").
|
||||
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(" where rds_no = '").Append(rds).Append("' ").
|
||||
Append(" ) as qa ").
|
||||
Append(" inner join lsl2sql.dbo.react_run rr ").
|
||||
Append(" on qa.rds_no = rr.rds_no ").
|
||||
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(" where qa.load_sig != '' ").
|
||||
Append(" and qa.load_sig_dtm > '2022-07-01 00:00:00.000' ").
|
||||
Append(" and qa.reactor = ").Append(reactor is null ? -1 : reactor.Value).Append(' ').
|
||||
Append(" ) ").
|
||||
Append(" for json path ");
|
||||
try
|
||||
{
|
||||
@ -222,19 +284,20 @@ public class Job
|
||||
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 epiLayer;
|
||||
string psn;
|
||||
int? rdsNumber;
|
||||
string basicType;
|
||||
const int zero = 0;
|
||||
string epiLayer = "1";
|
||||
const string hyphen = "-";
|
||||
lotName = rds.ToString();
|
||||
string json = GetRunJson(lsl2SQLConnectionString, rds);
|
||||
string json = GetRunJson(lsl2SQLConnectionString, rds: -1, workOrderNumber, workOrderCassette, slotNumber, reactorNumber);
|
||||
if (string.IsNullOrEmpty(json))
|
||||
{
|
||||
epiLayer = "1";
|
||||
rdsNumber = null;
|
||||
basicType = hyphen;
|
||||
psn = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -245,15 +308,16 @@ public class Job
|
||||
{ runs = Array.Empty<Run>(); }
|
||||
if (!runs.Any())
|
||||
{
|
||||
epiLayer = "1";
|
||||
rdsNumber = null;
|
||||
basicType = hyphen;
|
||||
psn = string.Empty;
|
||||
}
|
||||
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 loadLockSideFull = loadLockSide switch
|
||||
{
|
||||
@ -262,29 +326,46 @@ public class Job
|
||||
_ => loadLockSide,
|
||||
};
|
||||
basicType = $"{loadLockSideFull} - {runs[zero].ReactorType}";
|
||||
int maxRdsLayerKeysMvNo = runs[zero].MaxRdsLayerKeysMvNo;
|
||||
if (maxRdsLayerKeysMvNo == 1)
|
||||
epiLayer = "1";
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.MeanThickness) || !double.TryParse(input.MeanThickness, out double meanThickness))
|
||||
epiLayer = runs[zero].EpiLayer;
|
||||
else
|
||||
{
|
||||
epiLayer = hyphen;
|
||||
foreach (Run run in runs)
|
||||
{
|
||||
if (run.EpiThickMin is null || run.EpiThickMax is null)
|
||||
continue;
|
||||
if (meanThickness < run.EpiThickMin || meanThickness > run.EpiThickMax)
|
||||
continue;
|
||||
epiLayer = run.EpiLayer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new(basicType, epiLayer, lotName, psn, reactor);
|
||||
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
|
||||
{
|
||||
Run[] runs;
|
||||
try
|
||||
{ runs = JsonSerializer.Deserialize<Run[]>(json); }
|
||||
catch (Exception)
|
||||
{ runs = Array.Empty<Run>(); }
|
||||
if (!runs.Any())
|
||||
basicType = hyphen;
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrEmpty(psn))
|
||||
psn = runs[zero].PSN;
|
||||
if (reactorNumber is null)
|
||||
reactorNumber = runs[zero].Reactor;
|
||||
string loadLockSide = runs[zero].LoadLockSide;
|
||||
string loadLockSideFull = loadLockSide switch
|
||||
{
|
||||
"L" => "Left",
|
||||
"R" => "Right",
|
||||
_ => loadLockSide,
|
||||
};
|
||||
basicType = $"{loadLockSideFull} - {runs[zero].ReactorType}";
|
||||
}
|
||||
}
|
||||
return new(basicType, rdsNumber, psn, reactorNumber, epiLayer);
|
||||
}
|
||||
|
||||
}
|
@ -4,18 +4,22 @@ public class Descriptor
|
||||
{
|
||||
|
||||
public string Employee { get; private set; }
|
||||
public string Layer { get; private set; }
|
||||
public string Lot { get; private set; }
|
||||
public string PSN { get; private set; }
|
||||
public string RDS { 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;
|
||||
Layer = layer;
|
||||
Lot = lot;
|
||||
PSN = psn;
|
||||
RDS = rds;
|
||||
Reactor = reactor;
|
||||
Zone = zone;
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
|
@ -42,20 +42,37 @@ public class Job : LoggingUnitTesting, IDisposable
|
||||
LoggingUnitTesting.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void TestJob()
|
||||
{
|
||||
FileHandlers.TIBCO.Transport.Job job;
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
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=;";
|
||||
job = new(conn, string.Empty, "00-544481-0000");
|
||||
Assert.IsTrue(string.IsNullOrEmpty(job.LotName));
|
||||
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, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"12-123456-1234\", \"Recipe\": \"Recipe\"}");
|
||||
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\"}");
|
||||
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\": \"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");
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
@ -48,29 +48,83 @@ public class TXT : LoggingUnitTesting, IDisposable
|
||||
FileHandlers.txt.Descriptor descriptor;
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
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");
|
||||
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.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.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");
|
||||
Assert.IsTrue(descriptor.Reactor is "00");
|
||||
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
|
||||
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");
|
||||
Assert.IsTrue(descriptor.Reactor is "00");
|
||||
Assert.IsTrue(descriptor.RDS is "000000");
|
||||
Assert.IsTrue(descriptor.PSN is "0000");
|
||||
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.txt.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(descriptor.Layer is "2");
|
||||
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"));
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Infineon.EAF.Runtime">
|
||||
<Version>2.43.0</Version>
|
||||
<Version>2.47.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Text.Json">
|
||||
<Version>6.0.3</Version>
|
||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.43.4.0")]
|
||||
[assembly: AssemblyFileVersion("2.43.4.0")]
|
||||
[assembly: AssemblyVersion("2.47.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.47.0.0")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user