- 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.
27 lines
964 B
C#
27 lines
964 B
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Adaptation.FileHandlers.QS408M;
|
|
|
|
public class Detail
|
|
{
|
|
|
|
public string HeaderUniqueId { get; set; }
|
|
[JsonPropertyName("Position")] public string Position { get; set; }
|
|
[JsonPropertyName("Thickness")] public string Thickness { get; set; }
|
|
public string UniqueId { get; set; }
|
|
|
|
public override string ToString() => string.Concat(Position, ";", Thickness, ";");
|
|
|
|
}
|
|
|
|
[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
|
[JsonSerializable(typeof(Detail))]
|
|
internal partial class DetailSourceGenerationContext : JsonSerializerContext
|
|
{
|
|
}
|
|
|
|
[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
|
[JsonSerializable(typeof(Detail[]))]
|
|
internal partial class DetailArraySourceGenerationContext : JsonSerializerContext
|
|
{
|
|
} |