Remove * and @ lines
This commit is contained in:
@ -28,12 +28,12 @@ internal class SummarySegment
|
||||
[JsonPropertyName("Navg")] public string NAvg { get; }
|
||||
[JsonPropertyName("Nsl")] public string Nsl { get; }
|
||||
[JsonPropertyName("Vd")] public string Vd { get; }
|
||||
[JsonPropertyName("@ Flat Z")] public string FlatZ { get; }
|
||||
[JsonPropertyName("Flat Z")] public string FlatZ { get; }
|
||||
[JsonPropertyName("Rhoavg")] public string RhoAvg { get; }
|
||||
[JsonPropertyName("Rhosl")] public string Rhosl { get; }
|
||||
[JsonPropertyName("Phase")] public string Phase { get; }
|
||||
[JsonPropertyName("Grade")] public string Grade { get; }
|
||||
[JsonPropertyName("@ Rs")] public string Rs { get; }
|
||||
[JsonPropertyName("Rs")] public string Rs { get; }
|
||||
|
||||
public static SummarySegment Get() =>
|
||||
new(string.Empty,
|
||||
@ -64,6 +64,7 @@ internal class SummarySegment
|
||||
string[] segments;
|
||||
bool found = false;
|
||||
string[] segmentsB;
|
||||
List<string> names = new();
|
||||
Dictionary<string, string> keyValuePairs = new();
|
||||
Dictionary<string, string> keyValuePairsB = new();
|
||||
Dictionary<string, string> keyValuePairsC = new();
|
||||
@ -81,11 +82,14 @@ internal class SummarySegment
|
||||
foreach (JsonProperty jsonProperty in jsonProperties)
|
||||
{
|
||||
segments = line.Split(new string[] { $"{jsonProperty.Name}:", $"{jsonProperty.Name} :" }, StringSplitOptions.None);
|
||||
if (segments.Length < 2 || (!line.StartsWith(jsonProperty.Name) && !line.StartsWith($"@ {jsonProperty.Name}")))
|
||||
if (segments.Length < 2 || !line.StartsWith(jsonProperty.Name))
|
||||
continue;
|
||||
segmentsB = segments[1].Trim().Split(' ');
|
||||
if (segmentsB.Length < 3)
|
||||
continue;
|
||||
if (names.Contains(jsonProperty.Name))
|
||||
continue;
|
||||
names.Add(jsonProperty.Name);
|
||||
keyValuePairs.Add(jsonProperty.Name, segmentsB[0]);
|
||||
keyValuePairsB.Add(jsonProperty.Name, segmentsB[1]);
|
||||
keyValuePairsC.Add(jsonProperty.Name, segmentsB[2]);
|
||||
|
Reference in New Issue
Block a user