Refactor OpenInsight file handling to utilize JsonElement for data processing and enhance serialization with JsonSourceGeneration. Updated methods across multiple classes to improve data handling and reduce dependencies on ProcessDataStandardFormat.
This commit is contained in:
@ -577,7 +577,7 @@ public partial class ProcessData : IProcessData
|
||||
_Log.Debug("****ProcessData Removing stdDev");
|
||||
detail.StdDev = detail.StdDev.Remove(detail.StdDev.Length - 1, 1);
|
||||
}
|
||||
detail.UniqueId = string.Concat("_Wafer-", detail.Wafer, "_Slot-", detail.Slot, "_Point-", detail.Position);
|
||||
detail.UniqueId = string.Concat("_Wafer-", detail.Wafer, "_Slot-", detail.Slot);
|
||||
details.Add(detail);
|
||||
nextLine = PeekNextLine();
|
||||
if (nextLine.Contains(cassette))
|
||||
@ -630,11 +630,6 @@ public partial class ProcessData : IProcessData
|
||||
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
||||
detail.Thickness = stringBuilder.ToString();
|
||||
_ = stringBuilder.Clear();
|
||||
foreach (Point point in detail.Points)
|
||||
_ = stringBuilder.Append(point.Position).Append(',');
|
||||
if (stringBuilder.Length > 0)
|
||||
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
||||
detail.Position = stringBuilder.ToString();
|
||||
}
|
||||
if (details.Count != 2
|
||||
|| details[0].Slot != "1"
|
||||
@ -666,12 +661,11 @@ public partial class ProcessData : IProcessData
|
||||
{
|
||||
List<Description> results = new();
|
||||
Description? description;
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString };
|
||||
foreach (JsonElement jsonElement in jsonElements)
|
||||
{
|
||||
if (jsonElement.ValueKind != JsonValueKind.Object)
|
||||
throw new Exception();
|
||||
description = JsonSerializer.Deserialize<Description>(jsonElement.ToString(), jsonSerializerOptions);
|
||||
description = JsonSerializer.Deserialize(jsonElement.ToString(), DescriptionSourceGenerationContext.Default.Description);
|
||||
if (description is null)
|
||||
continue;
|
||||
results.Add(description);
|
||||
|
||||
Reference in New Issue
Block a user