From 784471c5cea8f786aae959e6cf1368d93c6b8c5e Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Wed, 15 Jan 2025 12:35:15 -0700 Subject: [PATCH] Further testing with partial data runs --- Adaptation/.vscode/tasks.json | 2 +- Adaptation/FileHandlers/pcl/FileRead.cs | 30 +++++----- Adaptation/FileHandlers/pcl/ProcessData.cs | 9 +-- Adaptation/FileHandlers/pcl/Run.cs | 46 ++++----------- Adaptation/FileHandlers/pcl/Wafer.cs | 57 ++++++++++++++++++- .../v2.57.0/MET08DDUPSFS6420.cs | 0 .../v2.57.0/TENCOR1.cs | 0 .../v2.57.0/TENCOR2.cs | 0 .../v2.57.0/TENCOR3.cs | 0 .../v2.57.0/MET08DDUPSFS6420.cs | 0 .../v2.57.0/TENCOR1.cs | 0 .../v2.57.0/TENCOR2.cs | 0 .../v2.57.0/TENCOR3.cs | 18 ++++++ FileHandlers/FileRead.cs | 2 + 14 files changed, 107 insertions(+), 57 deletions(-) rename Adaptation/_Tests/CreateSelfDescription/{Staging => Production}/v2.57.0/MET08DDUPSFS6420.cs (100%) rename Adaptation/_Tests/CreateSelfDescription/{Staging => Production}/v2.57.0/TENCOR1.cs (100%) rename Adaptation/_Tests/CreateSelfDescription/{Staging => Production}/v2.57.0/TENCOR2.cs (100%) rename Adaptation/_Tests/CreateSelfDescription/{Staging => Production}/v2.57.0/TENCOR3.cs (100%) rename Adaptation/_Tests/Extract/{Staging => Production}/v2.57.0/MET08DDUPSFS6420.cs (100%) rename Adaptation/_Tests/Extract/{Staging => Production}/v2.57.0/TENCOR1.cs (100%) rename Adaptation/_Tests/Extract/{Staging => Production}/v2.57.0/TENCOR2.cs (100%) rename Adaptation/_Tests/Extract/{Staging => Production}/v2.57.0/TENCOR3.cs (68%) diff --git a/Adaptation/.vscode/tasks.json b/Adaptation/.vscode/tasks.json index 49a1bc8..a8367a7 100644 --- a/Adaptation/.vscode/tasks.json +++ b/Adaptation/.vscode/tasks.json @@ -78,7 +78,7 @@ "args": [ "/target:Build", "/restore:True", - "/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json", + "/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json", "/detailedsummary", "/consoleloggerparameters:PerformanceSummary;ErrorsOnly;", "/property:Configuration=Debug;TargetFrameworkVersion=v4.8", diff --git a/Adaptation/FileHandlers/pcl/FileRead.cs b/Adaptation/FileHandlers/pcl/FileRead.cs index b8e6601..417b7fd 100644 --- a/Adaptation/FileHandlers/pcl/FileRead.cs +++ b/Adaptation/FileHandlers/pcl/FileRead.cs @@ -119,22 +119,26 @@ public class FileRead : Shared.FileRead, IFileRead throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks)); IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4, pages, run); if (iProcessData is not ProcessData processData) - throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks)); - string mid; - if (!string.IsNullOrEmpty(processData.Lot) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN)) - mid = processData.Lot; - else if (!string.IsNullOrEmpty(processData.Employee) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN)) - mid = processData.Employee; + results = new(string.Concat("B) No Data - ", dateTime.Ticks), Array.Empty(), Array.Empty(), results.Item4); else { - mid = string.Concat(processData.Reactor, "-", processData.RDS, "-", processData.PSN); - mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; + string mid; + if (!string.IsNullOrEmpty(processData.Lot) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN)) + mid = processData.Lot; + else if (!string.IsNullOrEmpty(processData.Employee) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN)) + mid = processData.Employee; + else + { + mid = string.Concat(processData.Reactor, "-", processData.RDS, "-", processData.PSN); + mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; + } + SetFileParameterLotID(mid); + _Logistics.Update(mid, processData.Reactor); + if (iProcessData.Details.Count > 0) + results = iProcessData.GetResults(this, _Logistics, results.Item4); + else + results = new(string.Concat("C) No Data - ", dateTime.Ticks), Array.Empty(), Array.Empty(), results.Item4); } - SetFileParameterLotID(mid); - _Logistics.Update(mid, processData.Reactor); - if (iProcessData.Details.Count == 0) - throw new Exception(string.Concat("C) No Data - ", dateTime.Ticks)); - results = iProcessData.GetResults(this, _Logistics, results.Item4); } return results; } diff --git a/Adaptation/FileHandlers/pcl/ProcessData.cs b/Adaptation/FileHandlers/pcl/ProcessData.cs index 91f7157..7089a63 100644 --- a/Adaptation/FileHandlers/pcl/ProcessData.cs +++ b/Adaptation/FileHandlers/pcl/ProcessData.cs @@ -641,7 +641,7 @@ public class ProcessData : IProcessData slots[dataFile.Slot].Add(dataFile); } string checkFileName = string.Concat(sourcePath, @"\", sourceFileNameWithoutExtension, "_data.pdf"); - if (!File.Exists(checkFileName)) + if (fileRead.IsEAFHosted && !File.Exists(checkFileName)) { File.Move(headerFileName, checkFileName); _ = sourceFiles.Remove(headerFileName); @@ -653,7 +653,7 @@ public class ProcessData : IProcessData if (!string.IsNullOrEmpty(pageMapping[i].Item2)) { checkFileName = pageMapping[i].Item2; - if (!File.Exists(checkFileName)) + if (fileRead.IsEAFHosted && !File.Exists(checkFileName)) { File.Move(pageMapping[i].Item1, checkFileName); _ = sourceFiles.Remove(pageMapping[i].Item1); @@ -662,16 +662,13 @@ public class ProcessData : IProcessData } else if (!string.IsNullOrEmpty(checkFileName)) { - //if (i == 0 || !string.IsNullOrEmpty(pageMapping[i - 1].Item2)) - //{ checkFileName = checkFileName.Replace("_data.pdf", "_image.pdf"); - if (!File.Exists(checkFileName)) + if (fileRead.IsEAFHosted && !File.Exists(checkFileName)) { File.Move(pageMapping[i].Item1, checkFileName); _ = sourceFiles.Remove(pageMapping[i].Item1); sourceFiles.Add(checkFileName); } - //} checkFileName = string.Empty; } } diff --git a/Adaptation/FileHandlers/pcl/Run.cs b/Adaptation/FileHandlers/pcl/Run.cs index 0038ed9..5909809 100644 --- a/Adaptation/FileHandlers/pcl/Run.cs +++ b/Adaptation/FileHandlers/pcl/Run.cs @@ -68,9 +68,6 @@ internal class Run return results.AsReadOnly(); } - private static ReadOnlyCollection GetLines(JsonElement jsonElement) => - GetLines(new JsonElement[] { jsonElement }); - private static void WriteTabSeparatedValues(Logistics logistics, List fileInfoCollection, Run run) { List results = new(); @@ -89,10 +86,12 @@ internal class Run fileInfoCollection.Add(fileInfo); } - private static void WriteException(Logistics logistics, Exception ex) + private static ReadOnlyCollection GetWaferIds(Header header) { - FileInfo fileInfo = new($"{logistics.ReportFullPath}.{nameof(Exception)}.txt"); - File.WriteAllText(fileInfo.FullName, $"{ex.Message}{Environment.NewLine}{ex.StackTrace}"); + List results = new(); + foreach (WaferSummary waferSummary in header.WaferSummary) + results.Add(waferSummary.Id); + return results.AsReadOnly(); } internal static Run? Get(Logistics logistics, List fileInfoCollection, ReadOnlyDictionary pages) @@ -105,35 +104,12 @@ internal class Run result = null; else { - ReadOnlyCollection wafers = Wafer.Get(pages, constant, headerFileName); - if (wafers.Count == 0) - result = null; - else - { - result = new(header, wafers); - WriteJson(logistics, fileInfoCollection, result); - for (int i = 0; i < wafers.Count; i++) - { - if (wafers[i].Id != header.WaferSummary[i].Id) - { - header = null; - break; - } - } - if (header is null || wafers.Count != header.WaferSummary.Count) - result = null; - else - { - try - { - WriteTabSeparatedValues(logistics, fileInfoCollection, result); - } - catch (Exception ex) - { - WriteException(logistics, ex); - } - } - } + ReadOnlyCollection waferIds = GetWaferIds(header); + ReadOnlyDictionary keyValuePairs = Wafer.Get(pages, constant, headerFileName); + ReadOnlyCollection wafers = Wafer.Get(waferIds, keyValuePairs); + result = new(header, wafers); + WriteJson(logistics, fileInfoCollection, result); + WriteTabSeparatedValues(logistics, fileInfoCollection, result); } return result; } diff --git a/Adaptation/FileHandlers/pcl/Wafer.cs b/Adaptation/FileHandlers/pcl/Wafer.cs index fc9dd09..a0d3d04 100644 --- a/Adaptation/FileHandlers/pcl/Wafer.cs +++ b/Adaptation/FileHandlers/pcl/Wafer.cs @@ -46,6 +46,40 @@ public class Wafer Recipe = recipe; } + private static Wafer? Get(string id) => + new(date: string.Empty, + id: id, + comments: string.Empty, + sort: string.Empty, + lPDCount: string.Empty, + lPDCM2: string.Empty, + bin1: string.Empty, + bin2: string.Empty, + bin3: string.Empty, + bin4: string.Empty, + bin5: string.Empty, + bin6: string.Empty, + bin7: string.Empty, + bin8: string.Empty, + mean: string.Empty, + stdDev: string.Empty, + areaCount: string.Empty, + areaTotal: string.Empty, + scratchCount: string.Empty, + scratchTotal: string.Empty, + sumOfDefects: string.Empty, + hazeRegion: string.Empty, + hazeAverage: string.Empty, + hazePeak: string.Empty, + laser: string.Empty, + gain: string.Empty, + diameter: string.Empty, + thresh: string.Empty, + exclusion: string.Empty, + hazeRng: string.Empty, + thruput: string.Empty, + recipe: string.Empty); + public string Date { get; } public string Id { get; } public string Comments { get; } @@ -79,9 +113,9 @@ public class Wafer public string Thruput { get; } public string Recipe { get; } - internal static ReadOnlyCollection Get(ReadOnlyDictionary pages, Constant constant, string headerFileName) + internal static ReadOnlyDictionary Get(ReadOnlyDictionary pages, Constant constant, string headerFileName) { - List results = new(); + Dictionary results = new(); Wafer wafer; string? text; List stringList; @@ -105,6 +139,8 @@ public class Wafer if (id.Length > 5) id = string.Concat(id.Substring(0, 5), "... - ***"); id = id.Replace("*", ""); + if (results.ContainsKey(id)) + continue; Header.ScanPast(text, i, "Comments:"); string comments = Header.GetToEOL(text, i); Header.ScanPast(text, i, "Sort:"); @@ -186,6 +222,23 @@ public class Wafer hazeRng: hazeRng, thruput: thruput, recipe: recipe); + results.Add(id, wafer); + } + return new(results); + } + + internal static ReadOnlyCollection Get(ReadOnlyCollection waferIds, ReadOnlyDictionary keyValuePairs) + { + List results = new(); + string id; + Wafer? wafer; + for (int i = 0; i < waferIds.Count; i++) + { + id = waferIds[i]; + if (!keyValuePairs.TryGetValue(id, out wafer)) + wafer = Get(id); + if (wafer is null) + break; results.Add(wafer); } return results.AsReadOnly(); diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/MET08DDUPSFS6420.cs b/Adaptation/_Tests/CreateSelfDescription/Production/v2.57.0/MET08DDUPSFS6420.cs similarity index 100% rename from Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/MET08DDUPSFS6420.cs rename to Adaptation/_Tests/CreateSelfDescription/Production/v2.57.0/MET08DDUPSFS6420.cs diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/TENCOR1.cs b/Adaptation/_Tests/CreateSelfDescription/Production/v2.57.0/TENCOR1.cs similarity index 100% rename from Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/TENCOR1.cs rename to Adaptation/_Tests/CreateSelfDescription/Production/v2.57.0/TENCOR1.cs diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/TENCOR2.cs b/Adaptation/_Tests/CreateSelfDescription/Production/v2.57.0/TENCOR2.cs similarity index 100% rename from Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/TENCOR2.cs rename to Adaptation/_Tests/CreateSelfDescription/Production/v2.57.0/TENCOR2.cs diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/TENCOR3.cs b/Adaptation/_Tests/CreateSelfDescription/Production/v2.57.0/TENCOR3.cs similarity index 100% rename from Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/TENCOR3.cs rename to Adaptation/_Tests/CreateSelfDescription/Production/v2.57.0/TENCOR3.cs diff --git a/Adaptation/_Tests/Extract/Staging/v2.57.0/MET08DDUPSFS6420.cs b/Adaptation/_Tests/Extract/Production/v2.57.0/MET08DDUPSFS6420.cs similarity index 100% rename from Adaptation/_Tests/Extract/Staging/v2.57.0/MET08DDUPSFS6420.cs rename to Adaptation/_Tests/Extract/Production/v2.57.0/MET08DDUPSFS6420.cs diff --git a/Adaptation/_Tests/Extract/Staging/v2.57.0/TENCOR1.cs b/Adaptation/_Tests/Extract/Production/v2.57.0/TENCOR1.cs similarity index 100% rename from Adaptation/_Tests/Extract/Staging/v2.57.0/TENCOR1.cs rename to Adaptation/_Tests/Extract/Production/v2.57.0/TENCOR1.cs diff --git a/Adaptation/_Tests/Extract/Staging/v2.57.0/TENCOR2.cs b/Adaptation/_Tests/Extract/Production/v2.57.0/TENCOR2.cs similarity index 100% rename from Adaptation/_Tests/Extract/Staging/v2.57.0/TENCOR2.cs rename to Adaptation/_Tests/Extract/Production/v2.57.0/TENCOR2.cs diff --git a/Adaptation/_Tests/Extract/Staging/v2.57.0/TENCOR3.cs b/Adaptation/_Tests/Extract/Production/v2.57.0/TENCOR3.cs similarity index 68% rename from Adaptation/_Tests/Extract/Staging/v2.57.0/TENCOR3.cs rename to Adaptation/_Tests/Extract/Production/v2.57.0/TENCOR3.cs index 1193e14..862a429 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.57.0/TENCOR3.cs +++ b/Adaptation/_Tests/Extract/Production/v2.57.0/TENCOR3.cs @@ -55,5 +55,23 @@ public class TENCOR3 NonThrowTryCatch(); } +#if DEBUG + [Ignore] +#endif + [TestMethod] + [ExpectedException(typeof(MissingMethodException))] + public void Production__v2_57_0__TENCOR3__pcl638725158781216195__Parital() + { + string check = "*.pcl"; + bool validatePDSF = false; + _TENCOR3.Production__v2_57_0__TENCOR3__pcl(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _TENCOR3.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _TENCOR3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); + NonThrowTryCatch(); + } + } #endif \ No newline at end of file diff --git a/FileHandlers/FileRead.cs b/FileHandlers/FileRead.cs index e53fd89..ed93927 100644 --- a/FileHandlers/FileRead.cs +++ b/FileHandlers/FileRead.cs @@ -88,6 +88,8 @@ public partial class FileRead : FileReaderHandler, ISMTP try { extractResults = _FileRead.GetExtractResult(reportFullPath, eventName); + if (extractResults.Item3.Length == 0 && !string.IsNullOrEmpty(extractResults.Item1) && !extractResults.Item1.Contains(Environment.NewLine)) + throw new Exception(extractResults.Item1); TriggerEvents(extractResults); _FileRead.Move(extractResults); FilePathGeneratorInfoMove(extractResults);