Add Transmission Control Protocol file handling and update PCL serialization
- 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.
This commit is contained in:
@ -1,19 +1,33 @@
|
||||
namespace Adaptation.FileHandlers.pcl;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.pcl;
|
||||
|
||||
public class Detail
|
||||
{
|
||||
|
||||
public string FlatZ { get; set; }
|
||||
public string Grade { get; set; }
|
||||
[JsonPropertyName("FlatZ")] public string FlatZ { get; set; }
|
||||
[JsonPropertyName("Grade")] public string Grade { get; set; }
|
||||
public string HeaderUniqueId { get; set; }
|
||||
public string NAvg { get; set; }
|
||||
public string Nsl { get; set; }
|
||||
public string Phase { get; set; }
|
||||
public string RhoAvg { get; set; }
|
||||
public string Rhosl { 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; }
|
||||
public string Vd { 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
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user