using System.Collections.ObjectModel; using System.Text.Json.Serialization; namespace Adaptation.FileHandlers.RsM; internal record Line11 { [JsonConstructor] public Line11(string flatOrNotch, string followMajorFlat, string autoOrManualLoad, string rangeOrIndividual, string pauseAfterEveryRun, string autoPrint, string plot, string bulkSampleThk, string unit) { FlatOrNotch = flatOrNotch; FollowMajorFlat = followMajorFlat; AutoOrManualLoad = autoOrManualLoad; RangeOrIndividual = rangeOrIndividual; PauseAfterEveryRun = pauseAfterEveryRun; AutoPrint = autoPrint; Plot = plot; BulkSampleThk = bulkSampleThk; Unit = unit; } [JsonPropertyName("FlatOrNotch")] public string FlatOrNotch { get; } [JsonPropertyName("FollowMajorFlat")] public string FollowMajorFlat { get; } [JsonPropertyName("AutoOrManualLoad")] public string AutoOrManualLoad { get; } [JsonPropertyName("RangeOrIndvdual")] public string RangeOrIndividual { get; } [JsonPropertyName("PauseAfterEveryRun")] public string PauseAfterEveryRun { get; } [JsonPropertyName("AutoPrint")] public string AutoPrint { get; } [JsonPropertyName("Plot")] public string Plot { get; } [JsonPropertyName("BulkSmplThk")] public string BulkSampleThk { get; } [JsonPropertyName("Unit")] public string Unit { get; } internal static Line11 Get(string[] segments) { Line11 result; ReadOnlyCollection 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], collection.Count < 6 ? string.Empty : collection[5], collection.Count < 7 ? string.Empty : collection[6], collection.Count < 8 ? string.Empty : collection[7], collection.Count < 9 ? string.Empty : collection[8]); return result; } } [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Line11))] internal partial class Line11SourceGenerationContext : JsonSerializerContext { }