Complete
This commit is contained in:
43
Adaptation/FileHandlers/RsM/Line4.cs
Normal file
43
Adaptation/FileHandlers/RsM/Line4.cs
Normal file
@ -0,0 +1,43 @@
|
||||
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 = Complete.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
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user