ProcessDataStandardFormat

run.json
descriptions.json
Infineon.Mesa.PDF.Text.Stripper 4.8.0.2
WaferMean
NestExistingFiles only for TriggerOnCreated
txt now writes .a and .b csv file
Stratus doesn't work the .csv file
MSTEST0037
This commit is contained in:
2025-03-03 14:49:22 -07:00
parent c938da28c2
commit 4e8348ebc8
23 changed files with 744 additions and 105 deletions

View File

@ -16,7 +16,7 @@ internal class Constant
public string Reference { get; } = "Reference";
public string StartedAt { get; } = "started at";
public string Thickness { get; } = "Thickness,";
public string Destination { get; } = "Destination:";
public string ProcessFailed { get; } = "------------- Process failed -------------";
public string Destination { get; } = "Destination:";
public string ProcessFailed { get; } = "------------- Process failed -------------";
}

View File

@ -4,21 +4,21 @@ namespace Adaptation.FileHandlers.Stratus;
#nullable enable
public class Footer
public class Grade
{
public Footer(string meanThickness, string stdDev)
public Grade(string meanThickness, string stdDev)
{
MeanThickness = meanThickness;
Mean = meanThickness;
StdDev = stdDev;
}
public string MeanThickness { get; }
public string Mean { get; }
public string StdDev { get; }
internal static Footer? Get(Constant constant, ReadOnlyCollection<string> groups)
internal static Grade? Get(Constant constant, ReadOnlyCollection<string> groups)
{
Footer? result;
Grade? result;
int[] j = new int[] { 0 };
string stdDev = string.Empty;
string meanThickness = string.Empty;

View File

@ -73,8 +73,12 @@ public partial class ProcessData : IProcessData
if (description.Test != (int)tests[i])
throw new Exception();
}
FileInfo fileInfo = new($"{logistics.ReportFullPath}.descriptions.json");
List<Description> fileReadDescriptions = (from l in descriptions select (Description)l).ToList();
string json = JsonSerializer.Serialize(fileReadDescriptions, fileReadDescriptions.GetType());
File.WriteAllText(fileInfo.FullName, json);
File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence);
fileInfoCollection.Add(fileInfo);
JsonElement[] jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json) ?? throw new Exception();
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(logistics.Logistics1[0], tests.ToArray(), jsonElements, fileInfoCollection);
return results;

View File

@ -23,11 +23,11 @@ internal class Row
Site = run.Wafers[i].Sites[j];
Slot = run.Wafers[i].Slot;
Source = run.Wafers[i].Source;
WaferStdDev = run.Wafers[i].StdDev;
StdDev = run.Wafers[i].StdDev;
Text = run.Wafers[i].Text;
//
MeanThickness = run.Footer.MeanThickness;
StdDev = run.Footer.StdDev;
GradeMean = run.Grade.Mean;
GradeStdDev = run.Grade.StdDev;
}
public int Index { get; }
@ -44,16 +44,16 @@ internal class Row
public string Site { get; }
public string Slot { get; }
public string Source { get; }
public string WaferStdDev { get; }
public string StdDev { get; }
public string Text { get; }
//
public string MeanThickness { get; }
public string StdDev { get; }
public string GradeMean { get; }
public string GradeStdDev { get; }
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Row))]
internal partial class RowSourceGenerationContext : JsonSerializerContext
internal partial class StratusRowSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -1,5 +1,4 @@
using Adaptation.Shared;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
@ -14,21 +13,21 @@ namespace Adaptation.FileHandlers.Stratus;
internal class Run
{
public Run(Header header, ReadOnlyCollection<Wafer> wafers, Footer footer)
public Run(Header header, ReadOnlyCollection<Wafer> wafers, Grade grade)
{
Header = header;
Wafers = wafers;
Footer = footer;
Grade = grade;
}
public Header Header { get; }
public ReadOnlyCollection<Wafer> Wafers { get; }
public Footer Footer { get; }
public Grade Grade { get; }
private static void WriteJson(Logistics logistics, List<FileInfo> fileInfoCollection, Run? result)
private static void WriteJson(Logistics logistics, List<FileInfo> fileInfoCollection, Run result)
{
FileInfo fileInfo = new($"{logistics.ReportFullPath}.json");
string json = JsonSerializer.Serialize(result, RunSourceGenerationContext.Default.Run);
FileInfo fileInfo = new($"{logistics.ReportFullPath}.run.json");
string json = JsonSerializer.Serialize(result, StratusRunSourceGenerationContext.Default.Run);
File.WriteAllText(fileInfo.FullName, json);
File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence);
fileInfoCollection.Add(fileInfo);
@ -75,27 +74,6 @@ internal class Run
return results.AsReadOnly();
}
private static void WriteCommaSeparatedValues(Logistics logistics, Run run)
{
List<Row> results = new();
Row row;
int index = 0;
for (int i = 0; i < run.Wafers.Count; i++)
{
for (int j = 0; j < run.Wafers[i].Sites.Count; j++)
{
row = new(run, index, i, j);
results.Add(row);
index +=1;
}
}
string json = JsonSerializer.Serialize(results);
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json);
ReadOnlyCollection<string> lines = GetLines(logistics, jsonElements);
File.WriteAllText($"{logistics.ReportFullPath}.a.csv", string.Join(Environment.NewLine, lines));
File.WriteAllText($"{logistics.ReportFullPath}.b.csv", string.Join(Environment.NewLine, lines));
}
internal static Run? Get(Logistics logistics, List<FileInfo> fileInfoCollection)
{
Run? result;
@ -117,14 +95,13 @@ internal class Run
result = null;
else
{
Footer? footer = Footer.Get(constant, groups);
if (footer is null)
Grade? grade = Grade.Get(constant, groups);
if (grade is null)
result = null;
else
{
result = new(header, wafers, footer);
result = new(header, wafers, grade);
WriteJson(logistics, fileInfoCollection, result);
WriteCommaSeparatedValues(logistics, result);
}
}
}
@ -136,6 +113,6 @@ internal class Run
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Run))]
internal partial class RunSourceGenerationContext : JsonSerializerContext
internal partial class StratusRunSourceGenerationContext : JsonSerializerContext
{
}