Further testing with partial data runs

This commit is contained in:
Mike Phares 2025-01-15 12:35:15 -07:00
parent e37d9757ec
commit 784471c5ce
14 changed files with 107 additions and 57 deletions

View File

@ -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",

View File

@ -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<Test>(), Array.Empty<JsonElement>(), 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<Test>(), Array.Empty<JsonElement>(), 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;
}

View File

@ -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;
}
}

View File

@ -68,9 +68,6 @@ internal class Run
return results.AsReadOnly();
}
private static ReadOnlyCollection<string> GetLines(JsonElement jsonElement) =>
GetLines(new JsonElement[] { jsonElement });
private static void WriteTabSeparatedValues(Logistics logistics, List<FileInfo> fileInfoCollection, Run run)
{
List<Row> results = new();
@ -89,10 +86,12 @@ internal class Run
fileInfoCollection.Add(fileInfo);
}
private static void WriteException(Logistics logistics, Exception ex)
private static ReadOnlyCollection<string> GetWaferIds(Header header)
{
FileInfo fileInfo = new($"{logistics.ReportFullPath}.{nameof(Exception)}.txt");
File.WriteAllText(fileInfo.FullName, $"{ex.Message}{Environment.NewLine}{ex.StackTrace}");
List<string> results = new();
foreach (WaferSummary waferSummary in header.WaferSummary)
results.Add(waferSummary.Id);
return results.AsReadOnly();
}
internal static Run? Get(Logistics logistics, List<FileInfo> fileInfoCollection, ReadOnlyDictionary<string, string> pages)
@ -105,35 +104,12 @@ internal class Run
result = null;
else
{
ReadOnlyCollection<Wafer> 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<string> waferIds = GetWaferIds(header);
ReadOnlyDictionary<string, Wafer> keyValuePairs = Wafer.Get(pages, constant, headerFileName);
ReadOnlyCollection<Wafer> wafers = Wafer.Get(waferIds, keyValuePairs);
result = new(header, wafers);
WriteJson(logistics, fileInfoCollection, result);
WriteTabSeparatedValues(logistics, fileInfoCollection, result);
}
return result;
}

View File

@ -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<Wafer> Get(ReadOnlyDictionary<string, string> pages, Constant constant, string headerFileName)
internal static ReadOnlyDictionary<string, Wafer> Get(ReadOnlyDictionary<string, string> pages, Constant constant, string headerFileName)
{
List<Wafer> results = new();
Dictionary<string, Wafer> results = new();
Wafer wafer;
string? text;
List<string> 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<Wafer> Get(ReadOnlyCollection<string> waferIds, ReadOnlyDictionary<string, Wafer> keyValuePairs)
{
List<Wafer> 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();

View File

@ -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

View File

@ -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);