Mike Phares 61188f434d UniqueId replacement for attachments
Write input PDSF in output after EOF

GetPropertyValue for MoveMatchingFiles

ProcessDataStandardFormat over Tuple

MoveMatchingFiles to use ProcessDataStandardFormatMapping
2025-04-23 13:45:07 -07:00

64 lines
1.8 KiB
C#

using Adaptation.Shared;
using System.Collections.ObjectModel;
using System.IO;
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.Stratus;
#nullable enable
internal class Run
{
public Run(Header header, ReadOnlyCollection<Wafer> wafers, Grade grade)
{
Header = header;
Wafers = wafers;
Grade = grade;
}
public Header Header { get; }
public ReadOnlyCollection<Wafer> Wafers { get; }
public Grade Grade { get; }
internal static Run? Get(Logistics logistics)
{
Run? result;
Constant constant = new();
int[] i = new int[] { 0 };
string text = File.ReadAllText(logistics.ReportFullPath);
Header? header = Header.Get(text, constant, i);
if (header is null)
result = null;
else
{
ReadOnlyCollection<string> groups = Wafer.GetGroups(text, constant, i);
if (groups.Count == 0)
result = null;
else
{
ReadOnlyCollection<Wafer> wafers = Wafer.Get(constant, groups);
if (wafers.Count == 0)
result = null;
else
{
Grade? grade = Grade.Get(constant, groups);
if (grade is null)
result = null;
else
result = new(header, wafers, grade);
// WriteJson(logistics, fileInfoCollection, result);
// WriteCommaSeparatedValues(logistics, result);
}
}
}
return result;
}
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Run))]
internal partial class StratusRunSourceGenerationContext : JsonSerializerContext
{
}