- Updated Detail class to include JsonSourceGenerationOptions and JsonSerializable attributes for source generation. - Modified ProcessData class to utilize source generation context for Description deserialization. - Renamed RowSourceGenerationContext to QS408MRowSourceGenerationContext for clarity. - Updated Run class to use QS408MRunSourceGenerationContext for serialization. - Enhanced Description class with source generation attributes. - Refactored FileRead class to use source generation context for Description deserialization. - Added new methods in ProcessDataStandardFormat for JSON element array extraction. - Introduced new PDSF file handler classes: Body, Constant, FileRead, Footer, Header, Row, Run, and Site. - Implemented logic for parsing and handling PDSF data structures. - Added unit tests for PDSF processing to ensure functionality.
80 lines
1.9 KiB
C#
80 lines
1.9 KiB
C#
namespace Adaptation.FileHandlers.pdsf;
|
|
|
|
#nullable enable
|
|
|
|
public class Body
|
|
{
|
|
|
|
public Body(string waferMeanThickness, string stdDev, string passFail)
|
|
{
|
|
WaferMeanThickness = waferMeanThickness;
|
|
StdDev = stdDev;
|
|
PassFail = passFail;
|
|
}
|
|
|
|
public string WaferMeanThickness { get; }
|
|
public string StdDev { get; }
|
|
public string PassFail { get; }
|
|
|
|
private static bool IsNullOrWhiteSpace(string text)
|
|
{
|
|
bool flag;
|
|
int num = 0;
|
|
while (true)
|
|
{
|
|
if (num >= text.Length)
|
|
{
|
|
flag = true;
|
|
break;
|
|
}
|
|
else if (char.IsWhiteSpace(text[num]))
|
|
{
|
|
num++;
|
|
}
|
|
else
|
|
{
|
|
flag = false;
|
|
break;
|
|
}
|
|
}
|
|
return flag;
|
|
}
|
|
|
|
internal static string GetToken(string text, int[] i)
|
|
{
|
|
while (true)
|
|
{
|
|
if (i[0] >= text.Length || !IsNullOrWhiteSpace(text.Substring(i[0], 1)))
|
|
{
|
|
break;
|
|
}
|
|
i[0]++;
|
|
}
|
|
int num = i[0];
|
|
while (true)
|
|
{
|
|
if (num >= text.Length || IsNullOrWhiteSpace(text.Substring(num, 1)))
|
|
{
|
|
break;
|
|
}
|
|
num++;
|
|
}
|
|
string str = text.Substring(i[0], num - i[0]);
|
|
i[0] = num;
|
|
return str.Trim();
|
|
}
|
|
|
|
internal static Body? Get(Constant constant, string text, int[] i)
|
|
{
|
|
Body? result;
|
|
i[0] = Run.ScanPast(text, i, constant.MeanThickness);
|
|
string meanThickness = Run.GetBefore(text, i, constant.StandardDeviation);
|
|
string stdDev = GetToken(text, i);
|
|
string passFail = Run.GetToEOL(text, i);
|
|
result = new(meanThickness,
|
|
stdDev,
|
|
passFail);
|
|
return result;
|
|
}
|
|
|
|
} |