Wafer Summary

This commit is contained in:
2024-11-19 09:05:00 -07:00
parent 8ff877156d
commit 3a23304824
7 changed files with 109 additions and 73 deletions

View File

@ -604,11 +604,11 @@ public class ProcessData : IProcessData
#nullable enable
private static Complete? GetComplete(string headerFileName, Dictionary<string, string> pages, Dictionary<string, List<Detail>> slots)
private static Complete? GetComplete(string headerFileName, Dictionary<string, string> pages)
{
Complete? result;
Constant constant = new();
result = Complete.Get(headerFileName, pages, slots, constant);
result = Complete.Get(headerFileName, pages, constant);
return result;
}
@ -621,7 +621,6 @@ public class ProcessData : IProcessData
List<string> sourceFiles = new();
List<string> missingSlots = new();
Dictionary<string, string> pages = new();
Dictionary<string, List<Detail>> slots = new();
string sourceFileNamePdf = ConvertSourceFileToPdf(ghostPCLFileName, logistics);
sourceFiles.Add(sourceFileNamePdf);
string sourcePath = Path.GetDirectoryName(logistics.ReportFullPath) ?? throw new Exception();
@ -690,6 +689,24 @@ public class ProcessData : IProcessData
_Log.Debug($"****ParseData - Parsing lot summary");
List<Tuple<string, string>> pageMapping = new();
string headerFileName = string.Concat(sourcePath, @"\", sourceFileNameWithoutExtension, "_", pages.Count, ".pdf");
try
{
Complete? complete = GetComplete(headerFileName, pages);
if (complete is null)
_Log.Warn($"Could not get Complete from {sourceFileNameWithoutExtension}");
else
{
FileInfo fileInfo = new($"{sourceFileNameWithoutExtension}.json");
string json = JsonSerializer.Serialize(complete, CompleteSourceGenerationContext.Default.Complete);
File.WriteAllText(fileInfo.FullName, json);
fileInfoCollection.Add(fileInfo);
}
}
catch (Exception ex)
{
_Log.Error($"Error in {nameof(GetComplete)}", ex);
}
Dictionary<string, List<Detail>> slots = new();
ParseLotSummary(fileRead, logistics, headerFileName, pages, slots);
foreach (KeyValuePair<string, string> keyValuePair in pages)
{
@ -774,23 +791,6 @@ public class ProcessData : IProcessData
foreach (string sourceFile in sourceFiles)
fileInfoCollection.Add(new FileInfo(sourceFile));
fileInfoCollection.Add(logistics.FileInfo);
try
{
Complete? complete = GetComplete(headerFileName, pages, slots);
if (complete is null)
_Log.Warn($"Could not get Complete from {sourceFileNameWithoutExtension}");
else
{
FileInfo fileInfo = new($"{sourceFileNameWithoutExtension}.json");
string json = JsonSerializer.Serialize(complete, CompleteSourceGenerationContext.Default.Complete);
File.WriteAllText(fileInfo.FullName, json);
fileInfoCollection.Add(fileInfo);
}
}
catch (Exception ex)
{
_Log.Error($"Error in {nameof(GetComplete)}", ex);
}
}
#nullable enable