Refactor QS408M and PDSF File Handlers
- 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.
This commit is contained in:
@ -304,12 +304,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