- Introduced FileRead and Record classes for handling file reading in the Transmission Control Protocol. - Enhanced Description, Detail, and other related classes with JSON serialization attributes for improved data handling. - Implemented methods for reading and processing files, including network stream management. - Updated unit tests to cover new functionality and ensure robust testing. - Added new PDSF file handling classes and integrated them into the project structure. - Refactored existing code to utilize source generation for JSON serialization, improving performance and maintainability.
33 lines
1.3 KiB
C#
33 lines
1.3 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Adaptation.FileHandlers.pcl;
|
|
|
|
public class Detail
|
|
{
|
|
|
|
[JsonPropertyName("FlatZ")] public string FlatZ { get; set; }
|
|
[JsonPropertyName("Grade")] public string Grade { get; set; }
|
|
public string HeaderUniqueId { get; set; }
|
|
[JsonPropertyName("NAvg")] public string NAvg { get; set; }
|
|
[JsonPropertyName("Nsl")] public string Nsl { get; set; }
|
|
[JsonPropertyName("Phase")] public string Phase { get; set; }
|
|
[JsonPropertyName("RhoAvg")] public string RhoAvg { get; set; }
|
|
[JsonPropertyName("Rhosl")] public string Rhosl { get; set; }
|
|
public string UniqueId { get; set; }
|
|
[JsonPropertyName("Vd")] public string Vd { get; set; }
|
|
|
|
public override string ToString() => string.Concat(FlatZ, ";", Grade);
|
|
|
|
}
|
|
|
|
[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
|
|
{
|
|
} |