Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
ff006cb792 | |||
89c4d99398 |
@ -128,7 +128,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
FileCopy(reportFullPath, dateTime, descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
MoveArchive(reportFullPath, dateTime);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
SaveIQSFile(reportFullPath, dateTime, descriptions, tests);
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
FileCopy(reportFullPath, dateTime, descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
SaveOpenInsightFile(reportFullPath, dateTime, processDataStandardFormat, descriptions, tests);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
SendData(reportFullPath, dateTime, descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
PostOpenInsightMetrologyViewerAttachments(descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<txt.Description> descriptions = txt.ProcessData.GetDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
DirectoryMove(reportFullPath, dateTime, descriptions);
|
||||
else if (!_IsEAFHosted)
|
||||
|
@ -125,7 +125,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
FileCopy(reportFullPath, dateTime, descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -11,15 +11,13 @@ public class Common
|
||||
public int? ReactorNumber { get; }
|
||||
public string? Zone { get; }
|
||||
public string? Employee { get; }
|
||||
public WorkOrder? WorkOrder { get; }
|
||||
|
||||
public Common(string? layer,
|
||||
string? psn,
|
||||
int? rdsNumber,
|
||||
int? reactor,
|
||||
string? zone,
|
||||
string? employee,
|
||||
WorkOrder? workOrder)
|
||||
string? employee)
|
||||
{
|
||||
Layer = layer;
|
||||
PSN = psn;
|
||||
@ -27,7 +25,6 @@ public class Common
|
||||
ReactorNumber = reactor;
|
||||
Zone = zone;
|
||||
Employee = employee;
|
||||
WorkOrder = workOrder;
|
||||
}
|
||||
|
||||
}
|
@ -3,20 +3,18 @@ namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
public class CommonB
|
||||
{
|
||||
|
||||
public string Comment { get; }
|
||||
public string Layer { get; }
|
||||
public string LoadLockSide { get; }
|
||||
public int? RDSNumber { get; }
|
||||
public string ReactorType { get; }
|
||||
public string PSN { get; }
|
||||
public int? ReactorNumber { get; }
|
||||
public string Zone { get; }
|
||||
|
||||
public CommonB(string layer, string loadLockSide, int? rdsNumber, string reactorType, string psn, int? reactorNumber, string zone)
|
||||
public CommonB(string comment, string layer, int? rdsNumber, string psn, int? reactorNumber, string zone)
|
||||
{
|
||||
Comment = comment;
|
||||
Layer = layer;
|
||||
LoadLockSide = loadLockSide;
|
||||
RDSNumber = rdsNumber;
|
||||
ReactorType = reactorType;
|
||||
PSN = psn;
|
||||
ReactorNumber = reactorNumber;
|
||||
Zone = zone;
|
||||
|
@ -52,6 +52,7 @@ public partial class Job
|
||||
Common common;
|
||||
CommonB commonB;
|
||||
int? reactorNumber;
|
||||
WorkOrder workOrder;
|
||||
const string hyphen = "-";
|
||||
const string bioRad2 = "BIORAD2";
|
||||
const string bioRad3 = "BIORAD3";
|
||||
@ -64,23 +65,20 @@ public partial class Job
|
||||
DateTime = new DateTime(sequence);
|
||||
const string dep08CEPIEPSILON = "DEP08CEPIEPSILON";
|
||||
if (input.EquipmentType == dep08CEPIEPSILON)
|
||||
{
|
||||
common = Get(input, httpClient);
|
||||
}
|
||||
(common, workOrder) = Get(input, httpClient);
|
||||
else if (!string.IsNullOrEmpty(input.MID) && !string.IsNullOrEmpty(input.MesEntity) && Regex.IsMatch(input.MID, reactorNumberPattern) && input.MesEntity is bioRad2 or bioRad3)
|
||||
common = Get(input, barcodeHostFileShare);
|
||||
(common, workOrder) = Get(input, barcodeHostFileShare);
|
||||
else
|
||||
{
|
||||
workOrder = GetWorkOrder(input);
|
||||
reactorNumber = GetReactorNumber(input);
|
||||
WorkOrder workOrder = GetWorkOrder(input);
|
||||
if (workOrder.IsWorkOrder || reactorNumber.HasValue)
|
||||
common = new(layer: null,
|
||||
psn: null,
|
||||
rdsNumber: null,
|
||||
reactor: null,
|
||||
zone: null,
|
||||
employee: null,
|
||||
workOrder: workOrder);
|
||||
employee: null);
|
||||
else if (!string.IsNullOrEmpty(input.MID) && input.MID.Length is 2 or 3 && Regex.IsMatch(input.MID, twoAlphaPattern))
|
||||
common = GetTwoAlphaPattern(metrologyFileShare, input);
|
||||
else
|
||||
@ -89,13 +87,12 @@ public partial class Job
|
||||
bool isValid = IsValid(common.RDSNumber);
|
||||
if (isValid)
|
||||
commonB = GetWithValidRDS(lsl2SQLConnectionString, enteredDateTimeFilter, loadSignatureDateTimeFilter, common.Layer, common.PSN, common.RDSNumber, common.ReactorNumber, common.Zone);
|
||||
else if (common.WorkOrder is null || common.WorkOrder.IsWorkOrder || common.RDSNumber.HasValue)
|
||||
commonB = Get(lsl2SQLConnectionString, enteredDateTimeFilter, loadSignatureDateTimeFilter, common);
|
||||
else if (workOrder.IsWorkOrder || common.RDSNumber.HasValue)
|
||||
commonB = Get(lsl2SQLConnectionString, enteredDateTimeFilter, loadSignatureDateTimeFilter, common.Layer, common.PSN, common.ReactorNumber, workOrder.SlotNumber, workOrder.WorkOrderNumber, workOrder.WorkOrderCassette, common.Zone);
|
||||
else
|
||||
commonB = new(layer: hyphen,
|
||||
loadLockSide: hyphen,
|
||||
commonB = new(comment: hyphen,
|
||||
layer: hyphen,
|
||||
rdsNumber: common.RDSNumber,
|
||||
reactorType: hyphen,
|
||||
psn: common.PSN,
|
||||
reactorNumber: common.ReactorNumber,
|
||||
zone: hyphen);
|
||||
@ -111,45 +108,17 @@ public partial class Job
|
||||
IsAreaSi = input.Area == "Si"; // N/A
|
||||
StateModel = input.EquipmentType; // ?
|
||||
JobName = DateTime.Ticks.ToString(); // ?
|
||||
BasicType = GetComment(hyphen, httpClient, commonB); // BASIC_TYPE
|
||||
AutomationMode = string.Concat(DateTime.Ticks, ".", input.MesEntity); // ?
|
||||
SpecName = !string.IsNullOrEmpty(commonB.Layer) ? commonB.Layer : hyphen; // LAYER
|
||||
ProductName = !string.IsNullOrEmpty(commonB.PSN) ? commonB.PSN : hyphen; // PRODUCT
|
||||
ProcessSpecName = !string.IsNullOrEmpty(commonB.Zone) ? commonB.Zone : hyphen; // WAFER_POS
|
||||
BasicType = !string.IsNullOrEmpty(commonB.Comment) ? commonB.Comment : hyphen; // BASIC_TYPE
|
||||
LotName = commonB.RDSNumber is not null ? commonB.RDSNumber.Value.ToString() : input.MID; // MID
|
||||
ProcessType = commonB.ReactorNumber is not null ? commonB.ReactorNumber.Value.ToString() : hyphen; // PROCESS_JOBID
|
||||
Items.Add(new Item { Name = "0", Type = "NA", Number = (0 + 1).ToString(), Qty = "1", CarrierName = hyphen });
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetComment(string hyphen, HttpClient httpClient, CommonB commonB)
|
||||
{
|
||||
string result;
|
||||
string? loadLockSide = commonB.LoadLockSide;
|
||||
if (string.IsNullOrEmpty(loadLockSide) && commonB.RDSNumber is not null)
|
||||
{
|
||||
RunDataSheetRoot? runDataSheetRoot;
|
||||
try
|
||||
{ runDataSheetRoot = GetRunDataSheetRoot(httpClient, commonB.RDSNumber.Value); }
|
||||
catch (Exception)
|
||||
{ runDataSheetRoot = null; }
|
||||
loadLockSide = runDataSheetRoot?.RunDataSheet?.LoadLockSide;
|
||||
}
|
||||
if (string.IsNullOrEmpty(loadLockSide) || string.IsNullOrEmpty(commonB.ReactorType))
|
||||
result = hyphen;
|
||||
else
|
||||
{
|
||||
string loadLockSideFull = loadLockSide switch
|
||||
{
|
||||
"L" => "Left",
|
||||
"R" => "Right",
|
||||
_ => loadLockSide,
|
||||
};
|
||||
result = $"{loadLockSideFull} - {commonB.ReactorType}";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static int? GetReactorNumber(Input input)
|
||||
{
|
||||
int? result;
|
||||
@ -310,8 +279,7 @@ public partial class Job
|
||||
rdsNumber: rdsNumber,
|
||||
reactor: reactorNumber,
|
||||
zone: zone,
|
||||
employee: employee,
|
||||
workOrder: null);
|
||||
employee: employee);
|
||||
}
|
||||
|
||||
private static string[] GetDirectories(string fileShare)
|
||||
@ -374,8 +342,7 @@ public partial class Job
|
||||
rdsNumber: rdsNumber,
|
||||
reactor: reactor,
|
||||
zone: zone,
|
||||
employee: null,
|
||||
workOrder: null);
|
||||
employee: null);
|
||||
}
|
||||
|
||||
private static List<string> GetFiles(Input input, string barcodeHostFileShare)
|
||||
@ -414,11 +381,12 @@ public partial class Job
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Common Get(Input input, HttpClient httpClient)
|
||||
private static (Common common, WorkOrder workOrder) Get(Input input, HttpClient httpClient)
|
||||
{
|
||||
int? rds;
|
||||
string? psn;
|
||||
Common result;
|
||||
string psn;
|
||||
Common common;
|
||||
WorkOrder workOrder;
|
||||
Task<Stream> streamTask;
|
||||
Task<HttpResponseMessage> httpResponseMessageTask;
|
||||
string mid = string.IsNullOrEmpty(input.MID) ? string.Empty : input.MID;
|
||||
@ -437,70 +405,60 @@ public partial class Job
|
||||
if (reactorRoot is null || reactor != reactorRoot.Reactor.ReactorNo || reactorRoot.Reactor.LoadedRDS is null || reactorRoot.Reactor.LoadedRDS.Length < 1)
|
||||
{
|
||||
rds = null;
|
||||
psn = null;
|
||||
result = new(layer: null,
|
||||
psn = string.Empty;
|
||||
workOrder = new(null, null, null, null, false);
|
||||
common = new(layer: null,
|
||||
psn: psn,
|
||||
rdsNumber: rds,
|
||||
reactor: reactor,
|
||||
zone: null,
|
||||
employee: null,
|
||||
workOrder: null);
|
||||
employee: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
rds = reactorRoot.Reactor.LoadedRDS[0];
|
||||
RunDataSheetRoot? runDataSheetRoot = GetRunDataSheetRoot(httpClient, rds.Value);
|
||||
workOrder = new(null, null, null, null, false);
|
||||
httpResponseMessageTask = httpClient.GetAsync($"{httpClient.BaseAddress}/materials/rds/{rds}");
|
||||
httpResponseMessageTask.Wait();
|
||||
if (httpResponseMessageTask.Result.StatusCode != System.Net.HttpStatusCode.OK)
|
||||
throw new Exception($"Unable to OI <{httpResponseMessageTask.Result.StatusCode}>");
|
||||
streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync();
|
||||
streamTask.Wait();
|
||||
if (!streamTask.Result.CanRead)
|
||||
throw new NullReferenceException(nameof(streamTask));
|
||||
RunDataSheetRoot? runDataSheetRoot = JsonSerializer.Deserialize<RunDataSheetRoot>(streamTask.Result, jsonSerializerOptions);
|
||||
streamTask.Result.Dispose();
|
||||
if (runDataSheetRoot is null || reactor != runDataSheetRoot.RunDataSheet.Reactor)
|
||||
{
|
||||
psn = null;
|
||||
result = new(layer: null,
|
||||
psn = string.Empty;
|
||||
common = new(layer: null,
|
||||
psn: psn,
|
||||
rdsNumber: rds,
|
||||
reactor: reactor,
|
||||
zone: null,
|
||||
employee: null,
|
||||
workOrder: null);
|
||||
employee: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
psn = runDataSheetRoot.RunDataSheet.PSN.ToString();
|
||||
result = new(layer: null,
|
||||
common = new(layer: null,
|
||||
psn: psn,
|
||||
rdsNumber: rds,
|
||||
reactor: reactor,
|
||||
zone: null,
|
||||
employee: null,
|
||||
workOrder: null);
|
||||
employee: null);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return new(common, workOrder);
|
||||
}
|
||||
|
||||
private static RunDataSheetRoot? GetRunDataSheetRoot(HttpClient httpClient, int rds)
|
||||
private static (Common common, WorkOrder workOrder) Get(Input input, string barcodeHostFileShare)
|
||||
{
|
||||
RunDataSheetRoot? runDataSheetRoot;
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true };
|
||||
using Task<HttpResponseMessage> httpResponseMessageTask = httpClient.GetAsync($"{httpClient.BaseAddress}/materials/rds/{rds}");
|
||||
httpResponseMessageTask.Wait();
|
||||
if (httpResponseMessageTask.Result.StatusCode != System.Net.HttpStatusCode.OK)
|
||||
throw new Exception($"Unable to OI <{httpResponseMessageTask.Result.StatusCode}>");
|
||||
using Task<Stream> streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync();
|
||||
streamTask.Wait();
|
||||
if (!streamTask.Result.CanRead)
|
||||
throw new NullReferenceException(nameof(streamTask));
|
||||
runDataSheetRoot = JsonSerializer.Deserialize<RunDataSheetRoot>(streamTask.Result, jsonSerializerOptions);
|
||||
streamTask.Result.Dispose();
|
||||
return runDataSheetRoot;
|
||||
}
|
||||
|
||||
private static Common Get(Input input, string barcodeHostFileShare)
|
||||
{
|
||||
Common result;
|
||||
if (string.IsNullOrEmpty(barcodeHostFileShare) || !Directory.Exists(barcodeHostFileShare))
|
||||
throw new Exception($"Unable to access file-share <{barcodeHostFileShare}>");
|
||||
int? rds;
|
||||
long sequence = 0;
|
||||
WorkOrder? workOrder;
|
||||
WorkOrder workOrder;
|
||||
string mid = string.IsNullOrEmpty(input.MID) ? string.Empty : input.MID;
|
||||
int? reactor = mid.Length < 2 || !int.TryParse(mid.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
|
||||
bool parsed = !string.IsNullOrEmpty(input.Sequence) && long.TryParse(input.Sequence, out sequence);
|
||||
@ -513,28 +471,29 @@ public partial class Job
|
||||
if (text is null || text.Length < 3)
|
||||
{
|
||||
rds = null;
|
||||
workOrder = null;
|
||||
workOrder = new(null, null, null, null, false);
|
||||
}
|
||||
else if (!text.Contains('.'))
|
||||
{
|
||||
workOrder = null;
|
||||
rds = !int.TryParse(text.Substring(2), out int rdsNumber) ? null : rdsNumber;
|
||||
workOrder = new(null, null, null, null, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
rds = null;
|
||||
workOrder = GetWorkOrder(new(input, text.Substring(2)));
|
||||
}
|
||||
result = new(layer: null,
|
||||
Common common = new(layer: null,
|
||||
psn: null,
|
||||
rdsNumber: rds,
|
||||
reactor: reactor,
|
||||
zone: null,
|
||||
employee: null,
|
||||
workOrder: workOrder);
|
||||
return result;
|
||||
employee: null);
|
||||
return new(common, workOrder);
|
||||
}
|
||||
|
||||
#nullable disable
|
||||
|
||||
private static string GetRunJson(string lsl2SQLConnectionString, string commandText)
|
||||
{
|
||||
StringBuilder result = new();
|
||||
@ -638,77 +597,74 @@ public partial class Job
|
||||
return string.Join(Environment.NewLine, results);
|
||||
} // cSpell:restore
|
||||
|
||||
private static CommonB Get(string lsl2SQLConnectionString, DateTime enteredDateTimeFilter, DateTime loadSignatureDateTimeFilter, Common common)
|
||||
private static CommonB Get(string lsl2SQLConnectionString, DateTime enteredDateTimeFilter, DateTime loadSignatureDateTimeFilter, string layer, string psn, int? reactorNumber, int? slotNumber, int? workOrderNumber, int? workOrderCassette, string zone)
|
||||
{
|
||||
int? rdsNumber;
|
||||
string? psn;
|
||||
string? zone;
|
||||
string? layer;
|
||||
string comment;
|
||||
const int zero = 0;
|
||||
int? reactorNumber;
|
||||
string? reactorType;
|
||||
string? loadLockSide;
|
||||
const string hyphen = "-";
|
||||
string commandText = GetCommandText(enteredDateTimeFilter,
|
||||
loadSignatureDateTimeFilter,
|
||||
rds: null,
|
||||
workOrderNumber: common.WorkOrder?.WorkOrderNumber,
|
||||
workOrderCassette: common.WorkOrder?.WorkOrderCassette,
|
||||
slot: common.WorkOrder?.SlotNumber,
|
||||
reactor: common.ReactorNumber);
|
||||
workOrderNumber: workOrderNumber,
|
||||
workOrderCassette: workOrderCassette,
|
||||
slot: slotNumber,
|
||||
reactor: reactorNumber);
|
||||
string json = GetRunJson(lsl2SQLConnectionString, commandText);
|
||||
if (string.IsNullOrEmpty(json))
|
||||
{
|
||||
psn = common.PSN;
|
||||
rdsNumber = null;
|
||||
reactorType = null;
|
||||
zone = common.Zone;
|
||||
loadLockSide = null;
|
||||
layer = common.Layer;
|
||||
reactorNumber = common.ReactorNumber;
|
||||
comment = hyphen;
|
||||
psn = string.Empty;
|
||||
zone = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
Run[]? runs;
|
||||
Run[] runs;
|
||||
try
|
||||
{ runs = JsonSerializer.Deserialize<Run[]>(json); }
|
||||
catch (Exception)
|
||||
{ runs = Array.Empty<Run>(); }
|
||||
if (runs is null || runs.Length == 0)
|
||||
if (runs.Length == 0)
|
||||
{
|
||||
psn = common.PSN;
|
||||
rdsNumber = null;
|
||||
reactorType = null;
|
||||
zone = common.Zone;
|
||||
loadLockSide = null;
|
||||
layer = common.Layer;
|
||||
reactorNumber = common.ReactorNumber;
|
||||
comment = hyphen;
|
||||
psn = string.Empty;
|
||||
zone = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
reactorType = null;
|
||||
Run run = runs[zero];
|
||||
rdsNumber = run.RdsNo;
|
||||
reactorNumber = run.Reactor;
|
||||
loadLockSide = run.LoadLockSide;
|
||||
psn = string.IsNullOrEmpty(common.PSN) ? run.PSN : common.PSN;
|
||||
zone = string.IsNullOrEmpty(common.Zone) ? run.Zone : common.Zone;
|
||||
layer = string.IsNullOrEmpty(common.Layer) ? run.EpiLayer : common.Layer;
|
||||
rdsNumber = runs[zero].RdsNo;
|
||||
if (string.IsNullOrEmpty(psn))
|
||||
psn = runs[zero].PSN;
|
||||
if (string.IsNullOrEmpty(zone))
|
||||
zone = runs[zero].Zone;
|
||||
if (string.IsNullOrEmpty(layer))
|
||||
layer = runs[zero].EpiLayer;
|
||||
reactorNumber = runs[zero].Reactor;
|
||||
string loadLockSide = runs[zero].LoadLockSide;
|
||||
string loadLockSideFull = loadLockSide switch
|
||||
{
|
||||
"L" => "Left",
|
||||
"R" => "Right",
|
||||
_ => loadLockSide,
|
||||
};
|
||||
comment = $"{loadLockSideFull} - {runs[zero].ReactorType}";
|
||||
}
|
||||
}
|
||||
return new(layer: layer,
|
||||
loadLockSide: loadLockSide,
|
||||
return new(comment: comment,
|
||||
layer: layer,
|
||||
rdsNumber: rdsNumber,
|
||||
psn: psn,
|
||||
reactorNumber: reactorNumber,
|
||||
reactorType: reactorType,
|
||||
zone: zone);
|
||||
}
|
||||
|
||||
private static CommonB GetWithValidRDS(string lsl2SQLConnectionString, DateTime enteredDateTimeFilter, DateTime loadSignatureDateTimeFilter, string? layer, string? psn, int? rdsNumber, int? reactorNumber, string? zone)
|
||||
private static CommonB GetWithValidRDS(string lsl2SQLConnectionString, DateTime enteredDateTimeFilter, DateTime loadSignatureDateTimeFilter, string layer, string psn, int? rdsNumber, int? reactorNumber, string zone)
|
||||
{
|
||||
string comment;
|
||||
const int zero = 0;
|
||||
string? reactorType;
|
||||
string? loadLockSide;
|
||||
const string hyphen = "-";
|
||||
string commandText = GetCommandText(enteredDateTimeFilter,
|
||||
loadSignatureDateTimeFilter,
|
||||
rds: rdsNumber,
|
||||
@ -719,41 +675,43 @@ public partial class Job
|
||||
string json = GetRunJson(lsl2SQLConnectionString, commandText);
|
||||
if (string.IsNullOrEmpty(json))
|
||||
{
|
||||
zone = null;
|
||||
reactorType = null;
|
||||
loadLockSide = null;
|
||||
comment = hyphen;
|
||||
zone = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
Run[]? runs;
|
||||
Run[] runs;
|
||||
try
|
||||
{ runs = JsonSerializer.Deserialize<Run[]>(json); }
|
||||
catch (Exception)
|
||||
{ runs = Array.Empty<Run>(); }
|
||||
if (runs is null || runs.Length == 0)
|
||||
if (runs.Length == 0)
|
||||
{
|
||||
zone = null;
|
||||
reactorType = null;
|
||||
loadLockSide = null;
|
||||
comment = hyphen;
|
||||
zone = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
Run run = runs[zero];
|
||||
if (string.IsNullOrEmpty(psn))
|
||||
psn = run.PSN;
|
||||
psn = runs[zero].PSN;
|
||||
if (string.IsNullOrEmpty(zone))
|
||||
zone = run.Zone;
|
||||
zone = runs[zero].Zone;
|
||||
if (string.IsNullOrEmpty(layer))
|
||||
layer = run.EpiLayer;
|
||||
reactorNumber = run.Reactor is null ? reactorNumber : run.Reactor.Value;
|
||||
loadLockSide = run.LoadLockSide;
|
||||
reactorType = run.ReactorType;
|
||||
layer = runs[zero].EpiLayer;
|
||||
reactorNumber = runs[zero].Reactor is null ? reactorNumber : runs[zero].Reactor.Value;
|
||||
string loadLockSide = runs[zero].LoadLockSide;
|
||||
string loadLockSideFull = loadLockSide switch
|
||||
{
|
||||
"L" => "Left",
|
||||
"R" => "Right",
|
||||
_ => loadLockSide,
|
||||
};
|
||||
comment = $"{loadLockSideFull} - {runs[zero].ReactorType}";
|
||||
}
|
||||
}
|
||||
return new(layer: layer,
|
||||
loadLockSide: loadLockSide,
|
||||
return new(comment: comment,
|
||||
layer: layer,
|
||||
rdsNumber: rdsNumber,
|
||||
reactorType: reactorType,
|
||||
psn: psn,
|
||||
reactorNumber: reactorNumber,
|
||||
zone: zone);
|
||||
|
@ -6,14 +6,12 @@ public class RunDataSheet
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public RunDataSheet(string loadLockSide, int psn, int reactor)
|
||||
public RunDataSheet(int psn, int reactor)
|
||||
{
|
||||
PSN = psn;
|
||||
LoadLockSide = loadLockSide;
|
||||
Reactor = reactor;
|
||||
}
|
||||
|
||||
[JsonPropertyName("loadLockSide")] public string LoadLockSide { get; } // { init; get; }
|
||||
[JsonPropertyName("PSN")] public int PSN { get; } // { init; get; }
|
||||
[JsonPropertyName("reactor")] public int Reactor { get; } // { init; get; }
|
||||
|
||||
|
@ -38,7 +38,7 @@ stages:
|
||||
displayName: "Echo Check"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear'
|
||||
displayName: "Nuget Clear"
|
||||
displayName: "Nuget Nuget Clear"
|
||||
enabled: false
|
||||
|
||||
- task: CopyFiles@2
|
||||
@ -199,7 +199,7 @@ stages:
|
||||
displayName: "Echo Check"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear'
|
||||
displayName: "Nuget Clear"
|
||||
displayName: "Nuget Nuget Clear"
|
||||
enabled: false
|
||||
|
||||
- task: CopyFiles@2
|
||||
|
@ -478,14 +478,27 @@ public class FileRead : Properties.IFileRead
|
||||
}
|
||||
}
|
||||
|
||||
protected static void WritePDSF(IFileRead fileRead, JsonElement[] jsonElements)
|
||||
protected void WritePDSF(IFileRead fileRead, JsonElement[] jsonElements)
|
||||
{
|
||||
#pragma warning disable CA1510
|
||||
if (fileRead is null)
|
||||
throw new ArgumentNullException(nameof(fileRead));
|
||||
if (jsonElements is null)
|
||||
throw new ArgumentNullException(nameof(jsonElements));
|
||||
#pragma warning restore CA1510
|
||||
string directory;
|
||||
string day = $"{_Logistics.DateTimeFromSequence:yyyy-MM-dd}";
|
||||
string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||
string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}";
|
||||
if (!_CellInstanceConnectionName.StartsWith(_CellInstanceName) && _CellInstanceConnectionNameBase == _EquipmentType)
|
||||
directory = Path.Combine(_TracePath, _EquipmentType, "Target", weekDirectory, day, _CellInstanceName, _CellInstanceConnectionName);
|
||||
else
|
||||
directory = Path.Combine(_TracePath, _EquipmentType, "Source", weekDirectory, day, _CellInstanceName, _CellInstanceConnectionName);
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
string file = Path.Combine(directory, string.Concat(_Logistics.MesEntity, "_", _Logistics.Sequence, ".ipdsf"));
|
||||
string lines = ProcessDataStandardFormat.GetPDSFText(fileRead, _Logistics, jsonElements, logisticsText: string.Empty);
|
||||
File.WriteAllText(file, lines);
|
||||
if (_Logistics.TotalSecondsSinceLastWriteTimeFromSequence > 600)
|
||||
{
|
||||
try
|
||||
{ File.SetLastWriteTime(file, _Logistics.DateTimeFromSequence); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
}
|
||||
|
||||
protected void WaitForThread(Thread thread, List<Exception> threadExceptions)
|
||||
|
@ -398,20 +398,13 @@ internal class ProcessDataStandardFormat
|
||||
line = string.Concat(line.Substring(0, line.Length - 1), '}');
|
||||
lines.Add(line);
|
||||
}
|
||||
string? json = null;
|
||||
if (processDataStandardFormat.Footer is not null && processDataStandardFormat.Footer.Count > 0) {
|
||||
Dictionary<string, string> footerKeyValuePairs = GetFooterKeyValuePairs(processDataStandardFormat.Footer);
|
||||
Dictionary<string, Dictionary<string, string>> logisticKeyValuePairs = GetLogisticKeyValuePairs(processDataStandardFormat.Footer, footerKeyValuePairs);
|
||||
json = JsonSerializer.Serialize(logisticKeyValuePairs, DictionaryStringDictionaryStringStringSourceGenerationContext.Default.DictionaryStringDictionaryStringString);
|
||||
}
|
||||
string footerText = string.IsNullOrEmpty(json) || json == "{}" ? string.Empty : $",{Environment.NewLine}\"PDSF\":{Environment.NewLine}{json}";
|
||||
result = string.Concat(
|
||||
'{',
|
||||
Environment.NewLine,
|
||||
'"',
|
||||
"Count",
|
||||
'"',
|
||||
": ",
|
||||
": ",
|
||||
processDataStandardFormat.Body.Count,
|
||||
',',
|
||||
Environment.NewLine,
|
||||
@ -430,67 +423,12 @@ internal class ProcessDataStandardFormat
|
||||
'"',
|
||||
"Sequence",
|
||||
'"',
|
||||
": ",
|
||||
": ",
|
||||
processDataStandardFormat.Sequence,
|
||||
Environment.NewLine,
|
||||
footerText,
|
||||
Environment.NewLine,
|
||||
'}');
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Dictionary<string, string> GetFooterKeyValuePairs(ReadOnlyCollection<string> footerLines) {
|
||||
Dictionary<string, string> results = new();
|
||||
string[] segments;
|
||||
foreach (string footerLine in footerLines) {
|
||||
segments = footerLine.Split('\t');
|
||||
if (segments.Length != 2 || string.IsNullOrEmpty(segments[1].Trim())) {
|
||||
continue;
|
||||
}
|
||||
if (segments[1].Contains(';')) {
|
||||
continue;
|
||||
} else {
|
||||
results.Add(segments[0], segments[1]);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private static Dictionary<string, Dictionary<string, string>> GetLogisticKeyValuePairs(ReadOnlyCollection<string> footerLines, Dictionary<string, string> footerKeyValuePairs) {
|
||||
Dictionary<string, Dictionary<string, string>> results = new();
|
||||
string[] segments;
|
||||
string[] subSegments;
|
||||
string[] subSubSegments;
|
||||
Dictionary<string, string>? keyValue;
|
||||
results.Add("Footer", footerKeyValuePairs);
|
||||
foreach (string footerLine in footerLines) {
|
||||
segments = footerLine.Split('\t');
|
||||
if (segments.Length != 2 || string.IsNullOrEmpty(segments[1].Trim())) {
|
||||
continue;
|
||||
}
|
||||
if (!segments[1].Contains(';') || !segments[1].Contains('=')) {
|
||||
continue;
|
||||
} else {
|
||||
subSegments = segments[1].Split(';');
|
||||
if (subSegments.Length < 1) {
|
||||
continue;
|
||||
}
|
||||
if (!results.TryGetValue(segments[0], out keyValue)) {
|
||||
results.Add(segments[0], new());
|
||||
if (!results.TryGetValue(segments[0], out keyValue)) {
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
foreach (string segment in subSegments) {
|
||||
subSubSegments = segment.Split('=');
|
||||
if (subSubSegments.Length != 2) {
|
||||
continue;
|
||||
}
|
||||
keyValue.Add(subSubSegments[0], subSubSegments[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
#pragma warning restore CA1845, IDE0057
|
||||
}
|
||||
|
||||
internal static void Write(string path, ProcessDataStandardFormat processDataStandardFormat, List<Metrology.WS.Results>? wsResults)
|
||||
@ -839,9 +777,4 @@ internal class ProcessDataStandardFormat
|
||||
[JsonSerializable(typeof(JsonElement[]))]
|
||||
internal partial class JsonElementCollectionSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(Dictionary<string, Dictionary<string, string>>))]
|
||||
internal partial class DictionaryStringDictionaryStringStringSourceGenerationContext : JsonSerializerContext {
|
||||
}
|
@ -319,6 +319,9 @@ public class Job : LoggingUnitTesting, IDisposable
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !Always
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void TestJobI()
|
||||
{
|
||||
|
Reference in New Issue
Block a user