Complete
This commit is contained in:
117
Adaptation/FileHandlers/RsM/Complete.cs
Normal file
117
Adaptation/FileHandlers/RsM/Complete.cs
Normal file
@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
#nullable enable
|
||||
|
||||
internal class Complete
|
||||
{
|
||||
public Complete(Line1 line1, Line2 line2, Line3 line3, Line4 line4, Line4B line4B, Line5 line5, Line6 line6, Line7 line7, Line8 line8, Line9 line9, Line10 line10, Line11 line11, Line12 line12, Line13 line13, Point[] points)
|
||||
{
|
||||
Line1 = line1;
|
||||
Line2 = line2;
|
||||
Line3 = line3;
|
||||
Line4 = line4;
|
||||
Line4B = line4B;
|
||||
Line5 = line5;
|
||||
Line6 = line6;
|
||||
Line7 = line7;
|
||||
Line8 = line8;
|
||||
Line9 = line9;
|
||||
Line10 = line10;
|
||||
Line11 = line11;
|
||||
Line12 = line12;
|
||||
Line13 = line13;
|
||||
Points = points;
|
||||
}
|
||||
|
||||
public Line1 Line1 { get; }
|
||||
public Line2 Line2 { get; }
|
||||
public Line3 Line3 { get; }
|
||||
public Line4 Line4 { get; }
|
||||
public Line4B Line4B { get; }
|
||||
public Line5 Line5 { get; }
|
||||
public Line6 Line6 { get; }
|
||||
public Line7 Line7 { get; }
|
||||
public Line8 Line8 { get; }
|
||||
public Line9 Line9 { get; }
|
||||
public Line10 Line10 { get; }
|
||||
public Line11 Line11 { get; }
|
||||
public Line12 Line12 { get; }
|
||||
public Line13 Line13 { get; }
|
||||
public Point[] Points { get; }
|
||||
|
||||
internal static ReadOnlyCollection<string> GetCollection(string[] segments)
|
||||
{
|
||||
List<string> results = new();
|
||||
foreach (string segment in segments)
|
||||
{
|
||||
if (segment[0] == ',')
|
||||
break;
|
||||
results.Add(segment);
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
|
||||
internal static Complete? Get(int take, ReadOnlyCollection<string> lines)
|
||||
{
|
||||
Complete? result;
|
||||
if (lines.Count < take)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
string[] separator = new string[] { " ", "\t" };
|
||||
// <Title>
|
||||
Line1 line1 = Line1.Get(lines[0].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <FileName, Proj,Rcpe, LotID,WfrID, Is_TF_DataFile>
|
||||
Line2 line2 = Line2.Get(lines[1].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <Directory>
|
||||
Line3 line3 = Line3.Get(lines[2].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <DateTime,Temp,TCR%,N|P>
|
||||
Line4 line4 = Line4.Get(lines[3].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <Avg,Dev,Min,Max>
|
||||
Line4B? line4B = Line4B.Get(lines[3].Split(new string[] { ">" }, StringSplitOptions.RemoveEmptyEntries));
|
||||
if (line4B is null)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
// <Operator, Epuipment>
|
||||
Line5 line5 = Line5.Get(lines[4].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <Engineer>
|
||||
Line6 line6 = Line6.Get(lines[5].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <AreaOrDiamScan, WaferShape, dNBand, TemplateFile, xsize,ysize, CalibFactor, MsmtMode, DataType, DataUnit>
|
||||
Line7 line7 = Line7.Get(lines[6].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <NumProbePoints, SingleOrDualProbeConfig, #ActPrbPts, Rsens,IdrvMx,VinGain, DataRejectSigma, MeritThreshold, PrbChg#, PrbName>
|
||||
Line8 line8 = Line8.Get(lines[7].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <WaferSize,EdgeEx, x,yll, x,yur, #x,y, CutCorners>
|
||||
Line9 line9 = Line9.Get(lines[8].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <Diam: ThScan Start End Step>
|
||||
Line10 line10 = Line10.Get(lines[9].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <FlatOrNotch FollowMajorFlat AutoOrManualLoad RangeOrIndvdual PauseAfterEveryRun, AutoPrint,Plot, BulkSmplThk & Unit>
|
||||
Line11 line11 = Line11.Get(lines[10].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <RangeFrom, RangeTo>
|
||||
Line12 line12 = Line12.Get(lines[11].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <CassSlotSelected>
|
||||
Line13 line13 = Line13.Get(lines[12].Split(separator, StringSplitOptions.RemoveEmptyEntries));
|
||||
// <R,Th,Data, Rs,RsA,RsB, #Smpl, x,y, Irng,Vrng, ChiSq,merit/GOF, DataIntegrity>
|
||||
ReadOnlyCollection<Point> points = Point.Get(take, lines, separator);
|
||||
if (points.Count == 0)
|
||||
result = null;
|
||||
else
|
||||
result = new(line1, line2, line3, line4, line4B, line5, line6, line7, line8, line9, line10, line11, line12, line13, points.ToArray());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Complete))]
|
||||
internal partial class CompleteSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
29
Adaptation/FileHandlers/RsM/Line1.cs
Normal file
29
Adaptation/FileHandlers/RsM/Line1.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line1
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line1(string title) =>
|
||||
Title = title;
|
||||
|
||||
[JsonPropertyName("Title")] public string Title { get; }
|
||||
|
||||
internal static Line1 Get(string[] segments)
|
||||
{
|
||||
Line1 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line1))]
|
||||
internal partial class Line1SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
40
Adaptation/FileHandlers/RsM/Line10.cs
Normal file
40
Adaptation/FileHandlers/RsM/Line10.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line10
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line10(string diamThScan, string diamStart, string diamEnd, string diamStep)
|
||||
{
|
||||
DiamThScan = diamThScan;
|
||||
DiamStart = diamStart;
|
||||
DiamEnd = diamEnd;
|
||||
DiamStep = diamStep;
|
||||
}
|
||||
|
||||
[JsonPropertyName("Diam ThScan")] public string DiamThScan { get; }
|
||||
[JsonPropertyName("Diam Start")] public string DiamStart { get; }
|
||||
[JsonPropertyName("Diam End")] public string DiamEnd { get; }
|
||||
[JsonPropertyName("Diam Step")] public string DiamStep { get; }
|
||||
|
||||
internal static Line10 Get(string[] segments)
|
||||
{
|
||||
Line10 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1],
|
||||
collection.Count < 3 ? string.Empty : collection[2],
|
||||
collection.Count < 4 ? string.Empty : collection[3]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line10))]
|
||||
internal partial class Line10SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
55
Adaptation/FileHandlers/RsM/Line11.cs
Normal file
55
Adaptation/FileHandlers/RsM/Line11.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line11
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line11(string flatOrNotch, string followMajorFlat, string autoOrManualLoad, string rangeOrIndividual, string pauseAfterEveryRun, string autoPrint, string plot, string bulkSampleThk, string unit)
|
||||
{
|
||||
FlatOrNotch = flatOrNotch;
|
||||
FollowMajorFlat = followMajorFlat;
|
||||
AutoOrManualLoad = autoOrManualLoad;
|
||||
RangeOrIndividual = rangeOrIndividual;
|
||||
PauseAfterEveryRun = pauseAfterEveryRun;
|
||||
AutoPrint = autoPrint;
|
||||
Plot = plot;
|
||||
BulkSampleThk = bulkSampleThk;
|
||||
Unit = unit;
|
||||
}
|
||||
|
||||
[JsonPropertyName("FlatOrNotch")] public string FlatOrNotch { get; }
|
||||
[JsonPropertyName("FollowMajorFlat")] public string FollowMajorFlat { get; }
|
||||
[JsonPropertyName("AutoOrManualLoad")] public string AutoOrManualLoad { get; }
|
||||
[JsonPropertyName("RangeOrIndvdual")] public string RangeOrIndividual { get; }
|
||||
[JsonPropertyName("PauseAfterEveryRun")] public string PauseAfterEveryRun { get; }
|
||||
[JsonPropertyName("AutoPrint")] public string AutoPrint { get; }
|
||||
[JsonPropertyName("Plot")] public string Plot { get; }
|
||||
[JsonPropertyName("BulkSmplThk")] public string BulkSampleThk { get; }
|
||||
[JsonPropertyName("Unit")] public string Unit { get; }
|
||||
|
||||
internal static Line11 Get(string[] segments)
|
||||
{
|
||||
Line11 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1],
|
||||
collection.Count < 3 ? string.Empty : collection[2],
|
||||
collection.Count < 4 ? string.Empty : collection[3],
|
||||
collection.Count < 5 ? string.Empty : collection[4],
|
||||
collection.Count < 6 ? string.Empty : collection[5],
|
||||
collection.Count < 7 ? string.Empty : collection[6],
|
||||
collection.Count < 8 ? string.Empty : collection[7],
|
||||
collection.Count < 9 ? string.Empty : collection[8]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line11))]
|
||||
internal partial class Line11SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
34
Adaptation/FileHandlers/RsM/Line12.cs
Normal file
34
Adaptation/FileHandlers/RsM/Line12.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line12
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line12(string rangeFrom, string rangeTo)
|
||||
{
|
||||
RangeFrom = rangeFrom;
|
||||
RangeTo = rangeTo;
|
||||
}
|
||||
|
||||
[JsonPropertyName("RangeFrom")] public string RangeFrom { get; }
|
||||
[JsonPropertyName("RangeTo")] public string RangeTo { get; }
|
||||
|
||||
internal static Line12 Get(string[] segments)
|
||||
{
|
||||
Line12 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line12))]
|
||||
internal partial class Line12SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
29
Adaptation/FileHandlers/RsM/Line13.cs
Normal file
29
Adaptation/FileHandlers/RsM/Line13.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line13
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line13(string cassetteSlotSelected) =>
|
||||
CassetteSlotSelected = cassetteSlotSelected;
|
||||
|
||||
[JsonPropertyName("CassSlotSelected")] public string CassetteSlotSelected { get; }
|
||||
|
||||
internal static Line13 Get(string[] segments)
|
||||
{
|
||||
Line13 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line13))]
|
||||
internal partial class Line13SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
46
Adaptation/FileHandlers/RsM/Line2.cs
Normal file
46
Adaptation/FileHandlers/RsM/Line2.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line2
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line2(string fileName, string project, string recipeName, string lotID, string wfrID, string is_TF_DataFile)
|
||||
{
|
||||
FileName = fileName;
|
||||
Project = project;
|
||||
RecipeName = recipeName;
|
||||
LotID = lotID;
|
||||
WfrID = wfrID;
|
||||
Is_TF_DataFile = is_TF_DataFile;
|
||||
}
|
||||
|
||||
[JsonPropertyName("FileName")] public string FileName { get; }
|
||||
[JsonPropertyName("Proj")] public string Project { get; }
|
||||
[JsonPropertyName("Rcpe")] public string RecipeName { get; }
|
||||
[JsonPropertyName("LotID")] public string LotID { get; }
|
||||
[JsonPropertyName("WfrID")] public string WfrID { get; }
|
||||
[JsonPropertyName("Is_TF_DataFile")] public string Is_TF_DataFile { get; }
|
||||
|
||||
internal static Line2 Get(string[] segments)
|
||||
{
|
||||
Line2 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1],
|
||||
collection.Count < 3 ? string.Empty : collection[2],
|
||||
collection.Count < 4 ? string.Empty : collection[3],
|
||||
collection.Count < 5 ? string.Empty : collection[4],
|
||||
collection.Count < 6 ? string.Empty : collection[5]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line2))]
|
||||
internal partial class Line2SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
29
Adaptation/FileHandlers/RsM/Line3.cs
Normal file
29
Adaptation/FileHandlers/RsM/Line3.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line3
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line3(string directory) =>
|
||||
Directory = directory;
|
||||
|
||||
[JsonPropertyName("Directory")] public string Directory { get; }
|
||||
|
||||
internal static Line3 Get(string[] segments)
|
||||
{
|
||||
Line3 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line3))]
|
||||
internal partial class Line3SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
43
Adaptation/FileHandlers/RsM/Line4.cs
Normal file
43
Adaptation/FileHandlers/RsM/Line4.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line4
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line4(string time, string date, string temp, string tCRPercent, string nOrP)
|
||||
{
|
||||
Time = time;
|
||||
Date = date;
|
||||
Temp = temp;
|
||||
TCRPercent = tCRPercent;
|
||||
NOrP = nOrP;
|
||||
}
|
||||
|
||||
[JsonPropertyName("Time")] public string Time { get; }
|
||||
[JsonPropertyName("Date")] public string Date { get; }
|
||||
[JsonPropertyName("Temp")] public string Temp { get; }
|
||||
[JsonPropertyName("TCR%")] public string TCRPercent { get; }
|
||||
[JsonPropertyName("N|P")] public string NOrP { get; }
|
||||
|
||||
internal static Line4 Get(string[] segments)
|
||||
{
|
||||
Line4 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1],
|
||||
collection.Count < 3 ? string.Empty : collection[2],
|
||||
collection.Count < 4 ? string.Empty : collection[3],
|
||||
collection.Count < 5 ? string.Empty : collection[4]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line4))]
|
||||
internal partial class Line4SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
47
Adaptation/FileHandlers/RsM/Line4B.cs
Normal file
47
Adaptation/FileHandlers/RsM/Line4B.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
#nullable enable
|
||||
|
||||
internal record Line4B
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line4B(string avg, string dev, string min, string max)
|
||||
{
|
||||
Avg = avg;
|
||||
Dev = dev;
|
||||
Min = min;
|
||||
Max = max;
|
||||
}
|
||||
|
||||
[JsonPropertyName("Avg")] public string Avg { get; }
|
||||
[JsonPropertyName("Dev")] public string Dev { get; }
|
||||
[JsonPropertyName("Min")] public string Min { get; }
|
||||
[JsonPropertyName("Max")] public string Max { get; }
|
||||
|
||||
internal static Line4B? Get(string[] segments)
|
||||
{
|
||||
Line4B? result;
|
||||
if (segments.Length < 2)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
string[] segmentsB = segments[1].Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
|
||||
result = new(segmentsB.Length < 2 ? string.Empty : segmentsB[1],
|
||||
segmentsB.Length < 4 ? string.Empty : segmentsB[3],
|
||||
segmentsB.Length < 6 ? string.Empty : segmentsB[5],
|
||||
segmentsB.Length < 8 ? string.Empty : segmentsB[7]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line4B))]
|
||||
internal partial class Line4BSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
34
Adaptation/FileHandlers/RsM/Line5.cs
Normal file
34
Adaptation/FileHandlers/RsM/Line5.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line5
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line5(string @operator, string equipment)
|
||||
{
|
||||
Operator = @operator;
|
||||
Equipment = equipment;
|
||||
}
|
||||
|
||||
[JsonPropertyName("Operator")] public string Operator { get; }
|
||||
[JsonPropertyName("Epuipment")] public string Equipment { get; }
|
||||
|
||||
internal static Line5 Get(string[] segments)
|
||||
{
|
||||
Line5 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line5))]
|
||||
internal partial class Line5SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
29
Adaptation/FileHandlers/RsM/Line6.cs
Normal file
29
Adaptation/FileHandlers/RsM/Line6.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line6
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line6(string engineer) =>
|
||||
Engineer = engineer;
|
||||
|
||||
[JsonPropertyName("Engineer")] public string Engineer { get; }
|
||||
|
||||
internal static Line6 Get(string[] segments)
|
||||
{
|
||||
Line6 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line6))]
|
||||
internal partial class Line6SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
58
Adaptation/FileHandlers/RsM/Line7.cs
Normal file
58
Adaptation/FileHandlers/RsM/Line7.cs
Normal file
@ -0,0 +1,58 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line7
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line7(string areaOrDiamScan, string waferShape, string bNBand, string templateFile, string xSize, string ySize, string calibrationFactor, string msmtMode, string dataType, string dataUnit)
|
||||
{
|
||||
AreaOrDiamScan = areaOrDiamScan;
|
||||
WaferShape = waferShape;
|
||||
BNBand = bNBand;
|
||||
TemplateFile = templateFile;
|
||||
XSize = xSize;
|
||||
YSize = ySize;
|
||||
CalibrationFactor = calibrationFactor;
|
||||
MsmtMode = msmtMode;
|
||||
DataType = dataType;
|
||||
DataUnit = dataUnit;
|
||||
}
|
||||
|
||||
[JsonPropertyName("AreaOrDiamScan")] public string AreaOrDiamScan { get; }
|
||||
[JsonPropertyName("WaferShape")] public string WaferShape { get; }
|
||||
[JsonPropertyName("dNBand")] public string BNBand { get; }
|
||||
[JsonPropertyName("TemplateFile")] public string TemplateFile { get; }
|
||||
[JsonPropertyName("xsize")] public string XSize { get; }
|
||||
[JsonPropertyName("ysize")] public string YSize { get; }
|
||||
[JsonPropertyName("CalibFactor")] public string CalibrationFactor { get; }
|
||||
[JsonPropertyName("MsmtMode")] public string MsmtMode { get; }
|
||||
[JsonPropertyName("DataType")] public string DataType { get; }
|
||||
[JsonPropertyName("DataUnit")] public string DataUnit { get; }
|
||||
|
||||
internal static Line7 Get(string[] segments)
|
||||
{
|
||||
Line7 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1],
|
||||
collection.Count < 3 ? string.Empty : collection[2],
|
||||
collection.Count < 4 ? string.Empty : collection[3],
|
||||
collection.Count < 5 ? string.Empty : collection[4],
|
||||
collection.Count < 6 ? string.Empty : collection[5],
|
||||
collection.Count < 7 ? string.Empty : collection[6],
|
||||
collection.Count < 8 ? string.Empty : collection[7],
|
||||
collection.Count < 9 ? string.Empty : collection[8],
|
||||
collection.Count < 10 ? string.Empty : collection[9]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line7))]
|
||||
internal partial class Line7SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
58
Adaptation/FileHandlers/RsM/Line8.cs
Normal file
58
Adaptation/FileHandlers/RsM/Line8.cs
Normal file
@ -0,0 +1,58 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Line8
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line8(string numProbePoints, string singleOrDualProbeConfig, string numberActPrbPts, string rsens, string idrvMx, string vinGain, string dataRejectSigma, string meritThreshold, string prbChgNumber, string prbName)
|
||||
{
|
||||
NumProbePoints = numProbePoints;
|
||||
SingleOrDualProbeConfig = singleOrDualProbeConfig;
|
||||
NumberActPrbPts = numberActPrbPts;
|
||||
Rsens = rsens;
|
||||
IdrvMx = idrvMx;
|
||||
VinGain = vinGain;
|
||||
DataRejectSigma = dataRejectSigma;
|
||||
MeritThreshold = meritThreshold;
|
||||
PrbChgNumber = prbChgNumber;
|
||||
PrbName = prbName;
|
||||
}
|
||||
|
||||
[JsonPropertyName("NumProbePoints")] public string NumProbePoints { get; }
|
||||
[JsonPropertyName("SingleOrDualProbeConfig")] public string SingleOrDualProbeConfig { get; }
|
||||
[JsonPropertyName("#ActPrbPts")] public string NumberActPrbPts { get; }
|
||||
[JsonPropertyName("Rsens")] public string Rsens { get; }
|
||||
[JsonPropertyName("IdrvMx")] public string IdrvMx { get; }
|
||||
[JsonPropertyName("VinGain")] public string VinGain { get; }
|
||||
[JsonPropertyName("DataRejectSigma")] public string DataRejectSigma { get; }
|
||||
[JsonPropertyName("MeritThreshold")] public string MeritThreshold { get; }
|
||||
[JsonPropertyName("PrbChg#")] public string PrbChgNumber { get; }
|
||||
[JsonPropertyName("PrbName")] public string PrbName { get; }
|
||||
|
||||
internal static Line8 Get(string[] segments)
|
||||
{
|
||||
Line8 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1],
|
||||
collection.Count < 3 ? string.Empty : collection[2],
|
||||
collection.Count < 4 ? string.Empty : collection[3],
|
||||
collection.Count < 5 ? string.Empty : collection[4],
|
||||
collection.Count < 6 ? string.Empty : collection[5],
|
||||
collection.Count < 7 ? string.Empty : collection[6],
|
||||
collection.Count < 8 ? string.Empty : collection[7],
|
||||
collection.Count < 9 ? string.Empty : collection[8],
|
||||
collection.Count < 10 ? string.Empty : collection[9]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line8))]
|
||||
internal partial class Line8SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
55
Adaptation/FileHandlers/RsM/Line9.cs
Normal file
55
Adaptation/FileHandlers/RsM/Line9.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal class Line9
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Line9(string waferSize, string edgeEx, string xll, string yll, string xur, string yur, string x, string y, string cutCorners)
|
||||
{
|
||||
WaferSize = waferSize;
|
||||
EdgeEx = edgeEx;
|
||||
Xll = xll;
|
||||
Yll = yll;
|
||||
Xur = xur;
|
||||
Yur = yur;
|
||||
X = x;
|
||||
Y = y;
|
||||
CutCorners = cutCorners;
|
||||
}
|
||||
|
||||
[JsonPropertyName("WaferSize")] public string WaferSize { get; }
|
||||
[JsonPropertyName("EdgeEx")] public string EdgeEx { get; }
|
||||
[JsonPropertyName("xll")] public string Xll { get; }
|
||||
[JsonPropertyName("yll")] public string Yll { get; }
|
||||
[JsonPropertyName("xur")] public string Xur { get; }
|
||||
[JsonPropertyName("yur")] public string Yur { get; }
|
||||
[JsonPropertyName("x")] public string X { get; }
|
||||
[JsonPropertyName("y")] public string Y { get; }
|
||||
[JsonPropertyName("CutCorners")] public string CutCorners { get; }
|
||||
|
||||
internal static Line9 Get(string[] segments)
|
||||
{
|
||||
Line9 result;
|
||||
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
||||
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1],
|
||||
collection.Count < 3 ? string.Empty : collection[2],
|
||||
collection.Count < 4 ? string.Empty : collection[3],
|
||||
collection.Count < 5 ? string.Empty : collection[4],
|
||||
collection.Count < 6 ? string.Empty : collection[5],
|
||||
collection.Count < 7 ? string.Empty : collection[6],
|
||||
collection.Count < 8 ? string.Empty : collection[7],
|
||||
collection.Count < 9 ? string.Empty : collection[8]);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Line9))]
|
||||
internal partial class Line9SourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
82
Adaptation/FileHandlers/RsM/Point.cs
Normal file
82
Adaptation/FileHandlers/RsM/Point.cs
Normal file
@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.RsM;
|
||||
|
||||
internal record Point
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Point(string r, string th, string data, string rs, string rsA, string rsB, string numberSample, string x, string y, string irng, string vrng, string chiSq, string meritGOF, string dataIntegrity)
|
||||
{
|
||||
R = r;
|
||||
Th = th;
|
||||
Data = data;
|
||||
Rs = rs;
|
||||
RsA = rsA;
|
||||
RsB = rsB;
|
||||
NumberSample = numberSample;
|
||||
X = x;
|
||||
Y = y;
|
||||
Irng = irng;
|
||||
Vrng = vrng;
|
||||
ChiSq = chiSq;
|
||||
MeritGOF = meritGOF;
|
||||
DataIntegrity = dataIntegrity;
|
||||
}
|
||||
|
||||
[JsonPropertyName("R")] public string R { get; }
|
||||
[JsonPropertyName("Th")] public string Th { get; }
|
||||
[JsonPropertyName("Data")] public string Data { get; }
|
||||
[JsonPropertyName("Rs")] public string Rs { get; }
|
||||
[JsonPropertyName("RsA")] public string RsA { get; }
|
||||
[JsonPropertyName("RsB")] public string RsB { get; }
|
||||
[JsonPropertyName("#Smpl")] public string NumberSample { get; }
|
||||
[JsonPropertyName("x")] public string X { get; }
|
||||
[JsonPropertyName("y")] public string Y { get; }
|
||||
[JsonPropertyName("Irng")] public string Irng { get; }
|
||||
[JsonPropertyName("Vrng")] public string Vrng { get; }
|
||||
[JsonPropertyName("ChiSq")] public string ChiSq { get; }
|
||||
[JsonPropertyName("merit/GOF")] public string MeritGOF { get; }
|
||||
[JsonPropertyName("DataIntegrity")] public string DataIntegrity { get; }
|
||||
|
||||
internal static ReadOnlyCollection<Point> Get(int take, ReadOnlyCollection<string> lines, string[] separator)
|
||||
{
|
||||
List<Point> results = new();
|
||||
Point point;
|
||||
string[] segments;
|
||||
ReadOnlyCollection<string> collection;
|
||||
for (int i = take - 1; i < lines.Count; i++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(lines[i]))
|
||||
break;
|
||||
segments = lines[i].Split(separator, StringSplitOptions.RemoveEmptyEntries);
|
||||
collection = Complete.GetCollection(segments);
|
||||
point = new(collection.Count < 1 ? string.Empty : collection[0],
|
||||
collection.Count < 2 ? string.Empty : collection[1],
|
||||
collection.Count < 3 ? string.Empty : collection[2],
|
||||
collection.Count < 4 ? string.Empty : collection[3],
|
||||
collection.Count < 5 ? string.Empty : collection[4],
|
||||
collection.Count < 6 ? string.Empty : collection[5],
|
||||
collection.Count < 7 ? string.Empty : collection[6],
|
||||
collection.Count < 8 ? string.Empty : collection[7],
|
||||
collection.Count < 9 ? string.Empty : collection[8],
|
||||
collection.Count < 10 ? string.Empty : collection[9],
|
||||
collection.Count < 11 ? string.Empty : collection[10],
|
||||
collection.Count < 12 ? string.Empty : collection[11],
|
||||
collection.Count < 13 ? string.Empty : collection[12],
|
||||
collection.Count < 14 ? string.Empty : collection[13]);
|
||||
results.Add(point);
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Point))]
|
||||
internal partial class PointSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
using Adaptation.Shared;
|
||||
using Adaptation.Shared.Methods;
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
@ -49,6 +51,7 @@ public class ProcessData : IProcessData
|
||||
public string UniqueId { get; set; }
|
||||
public string Zone { get; set; }
|
||||
|
||||
private readonly ILog _Log;
|
||||
List<object> Shared.Properties.IProcessData.Details => _Details;
|
||||
|
||||
public ProcessData(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection)
|
||||
@ -57,6 +60,7 @@ public class ProcessData : IProcessData
|
||||
fileInfoCollection.Clear();
|
||||
_Details = new List<object>();
|
||||
MesEntity = logistics.MesEntity;
|
||||
_Log = LogManager.GetLogger(typeof(ProcessData));
|
||||
Parse(fileRead, logistics, fileInfoCollection);
|
||||
}
|
||||
|
||||
@ -317,6 +321,24 @@ public class ProcessData : IProcessData
|
||||
return result;
|
||||
}
|
||||
|
||||
#nullable enable
|
||||
|
||||
private Complete? GetComplete(Logistics logistics)
|
||||
{
|
||||
Complete? result;
|
||||
int take = 14;
|
||||
string[] lines = File.ReadAllLines(logistics.ReportFullPath);
|
||||
ReadOnlyCollection<string> collection = new(lines);
|
||||
if (collection.Count > take)
|
||||
result = Complete.Get(take, collection);
|
||||
else
|
||||
{
|
||||
result = null;
|
||||
_Log.Warn($"File {logistics.ReportFullPath} has less than {take} lines");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0060
|
||||
private void Parse(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection)
|
||||
#pragma warning restore IDE0060
|
||||
@ -380,10 +402,25 @@ public class ProcessData : IProcessData
|
||||
}
|
||||
_ = stringBuilder.AppendLine($"Avg = {Avg} {StandardDeviationPercentage} SEMI Radial= {"#.##%"}");
|
||||
LogBody = stringBuilder.ToString();
|
||||
try
|
||||
{
|
||||
Complete? complete = GetComplete(logistics);
|
||||
if (complete is null)
|
||||
_Log.Warn($"Could not get Complete from {logistics}");
|
||||
else
|
||||
{
|
||||
FileInfo fileInfo = new($"{logistics}.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
|
||||
|
||||
internal static List<Description> GetDescriptions(JsonElement[] jsonElements)
|
||||
{
|
||||
List<Description> results = new();
|
||||
|
Reference in New Issue
Block a user