Wafer Summary
This commit is contained in:
@ -19,10 +19,10 @@ internal class Complete
|
|||||||
public Header Header { get; }
|
public Header Header { get; }
|
||||||
public Wafer[] Wafers { get; }
|
public Wafer[] Wafers { get; }
|
||||||
|
|
||||||
internal static Complete? Get(string headerFileName, Dictionary<string, string> pages, Dictionary<string, List<Detail>> slots, Constant constant)
|
internal static Complete? Get(string headerFileName, Dictionary<string, string> pages, Constant constant)
|
||||||
{
|
{
|
||||||
Complete? result;
|
Complete? result;
|
||||||
Header? header = Header.Get(headerFileName, pages, slots, constant);
|
Header? header = Header.Get(headerFileName, pages, constant);
|
||||||
if (header is null)
|
if (header is null)
|
||||||
result = null;
|
result = null;
|
||||||
else
|
else
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.pcl;
|
namespace Adaptation.FileHandlers.pcl;
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ public class Header
|
|||||||
public Header(string date,
|
public Header(string date,
|
||||||
string recipe,
|
string recipe,
|
||||||
string id,
|
string id,
|
||||||
|
WaferSummary[] waferSummary,
|
||||||
string lPDCountMin,
|
string lPDCountMin,
|
||||||
string lPDCM2Min,
|
string lPDCM2Min,
|
||||||
string areaCountMin,
|
string areaCountMin,
|
||||||
@ -52,6 +54,7 @@ public class Header
|
|||||||
Date = date;
|
Date = date;
|
||||||
Recipe = recipe;
|
Recipe = recipe;
|
||||||
Id = id;
|
Id = id;
|
||||||
|
WaferSummary = waferSummary;
|
||||||
LPDCountMin = lPDCountMin;
|
LPDCountMin = lPDCountMin;
|
||||||
LPDCM2Min = lPDCM2Min;
|
LPDCM2Min = lPDCM2Min;
|
||||||
AreaCountMin = areaCountMin;
|
AreaCountMin = areaCountMin;
|
||||||
@ -93,6 +96,7 @@ public class Header
|
|||||||
public string Date { get; }
|
public string Date { get; }
|
||||||
public string Recipe { get; }
|
public string Recipe { get; }
|
||||||
public string Id { get; }
|
public string Id { get; }
|
||||||
|
public WaferSummary[] WaferSummary { get; }
|
||||||
public string LPDCountMin { get; }
|
public string LPDCountMin { get; }
|
||||||
public string LPDCM2Min { get; }
|
public string LPDCM2Min { get; }
|
||||||
public string AreaCountMin { get; }
|
public string AreaCountMin { get; }
|
||||||
@ -209,14 +213,16 @@ public class Header
|
|||||||
return GetBefore(text, i, "\n", false);
|
return GetBefore(text, i, "\n", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static Header Get(string headerFileName, Dictionary<string, string> pages, Dictionary<string, List<Detail>> slots, Constant constant)
|
internal static Header Get(string headerFileName, Dictionary<string, string> pages, Constant constant)
|
||||||
{
|
{
|
||||||
Header? result;
|
Header? result;
|
||||||
string id;
|
string id;
|
||||||
string slot;
|
|
||||||
string toEOL;
|
|
||||||
string? text;
|
string? text;
|
||||||
|
string[] segmentsB;
|
||||||
|
string[] segmentsC;
|
||||||
int[] i = new int[] { 0 };
|
int[] i = new int[] { 0 };
|
||||||
|
WaferSummary waferSummary;
|
||||||
|
List<WaferSummary> collection = new();
|
||||||
if (!pages.TryGetValue(headerFileName, out text))
|
if (!pages.TryGetValue(headerFileName, out text))
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
ScanPast(text, i, constant.Date);
|
ScanPast(text, i, constant.Date);
|
||||||
@ -230,15 +236,25 @@ public class Header
|
|||||||
id = GetBefore(text, i, "[7]");
|
id = GetBefore(text, i, "[7]");
|
||||||
else
|
else
|
||||||
id = GetBefore(text, i, "[");
|
id = GetBefore(text, i, "[");
|
||||||
int slotCount = text.Substring(i[0]).Split('*').Length - 1;
|
ScanPast(text, i, "*");
|
||||||
for (int j = 0; j < slotCount; j++)
|
string[] segments = text.Substring(i[0]).Split('*');
|
||||||
|
string[] split = new string[] { Environment.NewLine };
|
||||||
|
foreach (string segment in segments)
|
||||||
{
|
{
|
||||||
i[0] = j;
|
segmentsB = segment.Split(split, StringSplitOptions.None);
|
||||||
ScanPast(text, i, "*");
|
segmentsC = segmentsB[0].Split(' ');
|
||||||
toEOL = GetToEOL(text, i, false);
|
waferSummary = new(id: segmentsC[0].Trim(),
|
||||||
slot = string.Concat("*", toEOL.Substring(0, 2));
|
lPDCount: segmentsC[1].Trim(),
|
||||||
if (!slots.ContainsKey(slot))
|
lPDCM2: segmentsC[2].Trim(),
|
||||||
slots.Add(slot, new List<Detail>());
|
areaCount: segmentsC[3].Trim(),
|
||||||
|
areaTotal: segmentsC[4].Trim(),
|
||||||
|
scratchCount: segmentsC[5].Trim(),
|
||||||
|
scratchTotal: segmentsC[6].Trim(),
|
||||||
|
sumOfDefects: segmentsC[7].Trim(),
|
||||||
|
hazeRegion: segmentsC[8].Trim(),
|
||||||
|
hazeAverage: segmentsC[9].Trim(),
|
||||||
|
grade: segmentsC[10].Trim());
|
||||||
|
collection.Add(waferSummary);
|
||||||
}
|
}
|
||||||
ScanPast(text, i, constant.Min);
|
ScanPast(text, i, constant.Min);
|
||||||
string[] preToEol1 = GetToEOL(text, i, false).Trim().Split(' ');
|
string[] preToEol1 = GetToEOL(text, i, false).Trim().Split(' ');
|
||||||
@ -255,6 +271,7 @@ public class Header
|
|||||||
result = new(date: date,
|
result = new(date: date,
|
||||||
recipe: recipe,
|
recipe: recipe,
|
||||||
id: id,
|
id: id,
|
||||||
|
waferSummary: collection.ToArray(),
|
||||||
lPDCountMin: toEol1[0].Trim(),
|
lPDCountMin: toEol1[0].Trim(),
|
||||||
lPDCM2Min: toEol1[1].Trim(),
|
lPDCM2Min: toEol1[1].Trim(),
|
||||||
areaCountMin: toEol1[2].Trim(),
|
areaCountMin: toEol1[2].Trim(),
|
||||||
@ -294,4 +311,10 @@ public class Header
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
|
[JsonSerializable(typeof(Header))]
|
||||||
|
internal partial class HeaderSourceGenerationContext : JsonSerializerContext
|
||||||
|
{
|
||||||
}
|
}
|
@ -604,11 +604,11 @@ public class ProcessData : IProcessData
|
|||||||
|
|
||||||
#nullable enable
|
#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;
|
Complete? result;
|
||||||
Constant constant = new();
|
Constant constant = new();
|
||||||
result = Complete.Get(headerFileName, pages, slots, constant);
|
result = Complete.Get(headerFileName, pages, constant);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,7 +621,6 @@ public class ProcessData : IProcessData
|
|||||||
List<string> sourceFiles = new();
|
List<string> sourceFiles = new();
|
||||||
List<string> missingSlots = new();
|
List<string> missingSlots = new();
|
||||||
Dictionary<string, string> pages = new();
|
Dictionary<string, string> pages = new();
|
||||||
Dictionary<string, List<Detail>> slots = new();
|
|
||||||
string sourceFileNamePdf = ConvertSourceFileToPdf(ghostPCLFileName, logistics);
|
string sourceFileNamePdf = ConvertSourceFileToPdf(ghostPCLFileName, logistics);
|
||||||
sourceFiles.Add(sourceFileNamePdf);
|
sourceFiles.Add(sourceFileNamePdf);
|
||||||
string sourcePath = Path.GetDirectoryName(logistics.ReportFullPath) ?? throw new Exception();
|
string sourcePath = Path.GetDirectoryName(logistics.ReportFullPath) ?? throw new Exception();
|
||||||
@ -690,6 +689,24 @@ public class ProcessData : IProcessData
|
|||||||
_Log.Debug($"****ParseData - Parsing lot summary");
|
_Log.Debug($"****ParseData - Parsing lot summary");
|
||||||
List<Tuple<string, string>> pageMapping = new();
|
List<Tuple<string, string>> pageMapping = new();
|
||||||
string headerFileName = string.Concat(sourcePath, @"\", sourceFileNameWithoutExtension, "_", pages.Count, ".pdf");
|
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);
|
ParseLotSummary(fileRead, logistics, headerFileName, pages, slots);
|
||||||
foreach (KeyValuePair<string, string> keyValuePair in pages)
|
foreach (KeyValuePair<string, string> keyValuePair in pages)
|
||||||
{
|
{
|
||||||
@ -774,23 +791,6 @@ public class ProcessData : IProcessData
|
|||||||
foreach (string sourceFile in sourceFiles)
|
foreach (string sourceFile in sourceFiles)
|
||||||
fileInfoCollection.Add(new FileInfo(sourceFile));
|
fileInfoCollection.Add(new FileInfo(sourceFile));
|
||||||
fileInfoCollection.Add(logistics.FileInfo);
|
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
|
#nullable enable
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.pcl;
|
namespace Adaptation.FileHandlers.pcl;
|
||||||
|
|
||||||
@ -78,45 +79,6 @@ public class Wafer
|
|||||||
public string Thruput { get; }
|
public string Thruput { get; }
|
||||||
public string Recipe { get; }
|
public string Recipe { get; }
|
||||||
|
|
||||||
// private static bool IsNullOrWhiteSpace(string search)
|
|
||||||
// {
|
|
||||||
// for (int index = 0; index < search.Length; ++index)
|
|
||||||
// {
|
|
||||||
// if (!char.IsWhiteSpace(search[index]))
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// private static bool IsBlankLine(string text, int[] i)
|
|
||||||
// {
|
|
||||||
// int num = text.IndexOf("\n", i[0]);
|
|
||||||
// return IsNullOrWhiteSpace(num > -1 ? text.Substring(i[0], num - i[0]) : text.Substring(i[0]));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// private static string GetToText(string text, int[] i, string search) =>
|
|
||||||
// text.Substring(i[0], text.IndexOf(search, i[0]) - i[0]).Trim();
|
|
||||||
|
|
||||||
// private static string GetToken(string text, int[] i)
|
|
||||||
// {
|
|
||||||
// while (i[0] < text.Length && IsNullOrWhiteSpace(text.Substring(i[0], 1)))
|
|
||||||
// ++i[0];
|
|
||||||
// int j = i[0];
|
|
||||||
// while (j < text.Length && !IsNullOrWhiteSpace(text.Substring(j, 1)))
|
|
||||||
// ++j;
|
|
||||||
// string str = text.Substring(i[0], j - i[0]);
|
|
||||||
// i[0] = j;
|
|
||||||
// return str.Trim();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// private static string PeekNextLine(string text, int[] i)
|
|
||||||
// {
|
|
||||||
// int j = i[0];
|
|
||||||
// string result = Header.GetToEOL(text, i);
|
|
||||||
// i[0] = j;
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
|
|
||||||
internal static ReadOnlyCollection<Wafer> Get(string headerFileName, Dictionary<string, string> pages, Constant constant)
|
internal static ReadOnlyCollection<Wafer> Get(string headerFileName, Dictionary<string, string> pages, Constant constant)
|
||||||
{
|
{
|
||||||
List<Wafer> results = new();
|
List<Wafer> results = new();
|
||||||
@ -226,4 +188,11 @@ public class Wafer
|
|||||||
}
|
}
|
||||||
return results.AsReadOnly();
|
return results.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
|
[JsonSerializable(typeof(Wafer))]
|
||||||
|
internal partial class WaferSourceGenerationContext : JsonSerializerContext
|
||||||
|
{
|
||||||
}
|
}
|
43
Adaptation/FileHandlers/pcl/WaferSummary.cs
Normal file
43
Adaptation/FileHandlers/pcl/WaferSummary.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Adaptation.FileHandlers.pcl;
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
|
public class WaferSummary
|
||||||
|
{
|
||||||
|
|
||||||
|
public WaferSummary(string id, string lPDCount, string lPDCM2, string areaCount, string areaTotal, string scratchCount, string scratchTotal, string sumOfDefects, string hazeRegion, string hazeAverage, string grade)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
LPDCount = lPDCount;
|
||||||
|
LPDCM2 = lPDCM2;
|
||||||
|
AreaCount = areaCount;
|
||||||
|
AreaTotal = areaTotal;
|
||||||
|
ScratchCount = scratchCount;
|
||||||
|
ScratchTotal = scratchTotal;
|
||||||
|
SumOfDefects = sumOfDefects;
|
||||||
|
HazeRegion = hazeRegion;
|
||||||
|
HazeAverage = hazeAverage;
|
||||||
|
Grade = grade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Id { get; }
|
||||||
|
public string LPDCount { get; }
|
||||||
|
public string LPDCM2 { get; }
|
||||||
|
public string AreaCount { get; }
|
||||||
|
public string AreaTotal { get; }
|
||||||
|
public string ScratchCount { get; }
|
||||||
|
public string ScratchTotal { get; }
|
||||||
|
public string SumOfDefects { get; }
|
||||||
|
public string HazeRegion { get; }
|
||||||
|
public string HazeAverage { get; }
|
||||||
|
public string Grade { get; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
|
[JsonSerializable(typeof(WaferSummary))]
|
||||||
|
internal partial class WaferSummarySourceGenerationContext : JsonSerializerContext
|
||||||
|
{
|
||||||
|
}
|
@ -37,7 +37,7 @@ public class TENCOR1
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Production__v2_57_0__TENCOR1__pcl() => _TENCOR1.Production__v2_57_0__TENCOR1__pcl();
|
public void Production__v2_57_0__TENCOR1__pcl() => _TENCOR1.Production__v2_57_0__TENCOR1__pcl();
|
||||||
|
|
||||||
#if (!DEBUG)
|
#if DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
|
@ -129,6 +129,7 @@
|
|||||||
<Compile Include="Adaptation\FileHandlers\pcl\Header.cs" />
|
<Compile Include="Adaptation\FileHandlers\pcl\Header.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\pcl\ProcessData.cs" />
|
<Compile Include="Adaptation\FileHandlers\pcl\ProcessData.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\pcl\Wafer.cs" />
|
<Compile Include="Adaptation\FileHandlers\pcl\Wafer.cs" />
|
||||||
|
<Compile Include="Adaptation\FileHandlers\pcl\WaferSummary.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\Processed\FileRead.cs" />
|
<Compile Include="Adaptation\FileHandlers\Processed\FileRead.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\SPaCe\FileRead.cs" />
|
<Compile Include="Adaptation\FileHandlers\SPaCe\FileRead.cs" />
|
||||||
<Compile Include="Adaptation\Ifx\Eaf\Common\Configuration\ConnectionSetting.cs" />
|
<Compile Include="Adaptation\Ifx\Eaf\Common\Configuration\ConnectionSetting.cs" />
|
||||||
|
Reference in New Issue
Block a user