43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System.Collections.ObjectModel;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Adaptation.FileHandlers.RsM;
|
|
|
|
internal record Line4
|
|
{
|
|
|
|
[JsonConstructor]
|
|
public Line4(string time, string date, string temp, string tCRPercent, string nOrP)
|
|
{
|
|
Time = time;
|
|
Date = date;
|
|
Temp = temp;
|
|
TCRPercent = tCRPercent;
|
|
NOrP = nOrP;
|
|
}
|
|
|
|
[JsonPropertyName("Time")] public string Time { get; }
|
|
[JsonPropertyName("Date")] public string Date { get; }
|
|
[JsonPropertyName("Temp")] public string Temp { get; }
|
|
[JsonPropertyName("TCR%")] public string TCRPercent { get; }
|
|
[JsonPropertyName("N|P")] public string NOrP { get; }
|
|
|
|
internal static Line4 Get(string[] segments)
|
|
{
|
|
Line4 result;
|
|
ReadOnlyCollection<string> collection = Run.GetCollection(segments);
|
|
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
|
collection.Count < 2 ? string.Empty : collection[1],
|
|
collection.Count < 3 ? string.Empty : collection[2],
|
|
collection.Count < 4 ? string.Empty : collection[3],
|
|
collection.Count < 5 ? string.Empty : collection[4]);
|
|
return result;
|
|
}
|
|
|
|
}
|
|
|
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
|
[JsonSerializable(typeof(Line4))]
|
|
internal partial class Line4SourceGenerationContext : JsonSerializerContext
|
|
{
|
|
} |