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:
@ -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
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user