Unified · Split
| @@ -25,6 +25,7 @@ using System; · 24 unmodified lines | ||
| 25 | 25 | using System.Collections.Generic; |
| 26 | 26 | using System.ComponentModel; |
| 27 | 27 | using System.IO; |
| 28 | +using System.Linq; | |
| 28 | 29 | using System.Runtime.Serialization; |
| 29 | 30 | |
| 30 | 31 | // ReSharper disable VirtualMemberCallInConstructor |
| @@ -41,7 +42,7 @@ namespace GSF.PhasorProtocols.IEEEC37_118 · 10 unmodified lines | ||
| 41 | 42 | // Constants |
| 42 | 43 | internal const int ConversionFactorLength = 4; |
| 43 | 44 | |
| 44 | − private const int BitLabelCount = sizeof(ushort) * 8; | |
| 45 | + private const int BitLabelCount = 16; | |
| 45 | 46 | |
| 46 | 47 | // Fields |
| 47 | 48 | private byte[] m_labelImage; |
| @@ -135,7 +136,7 @@ namespace GSF.PhasorProtocols.IEEEC37_118 · 87 unmodified lines | ||
| 135 | 136 | { |
| 136 | 137 | // We hide this from the editor just because this is a large combined string of all digital labels, |
| 137 | 138 | // and it will make more sense for consumers to use the "Labels" property |
| 138 | − get => string.Join("|", Labels); | |
| 139 | + get => string.Join("|", Labels.Select(label => label.RemoveCharacter('|').GetValidLabel())); | |
| 139 | 140 | set |
| 140 | 141 | { |
| 141 | 142 | if (string.IsNullOrEmpty(value)) |
| @@ -147,7 +148,7 @@ namespace GSF.PhasorProtocols.IEEEC37_118 · 5 unmodified lines | ||
| 147 | 148 | string[] labels = value.Split('|'); |
| 148 | 149 | |
| 149 | 150 | for (int i = 0; i < BitLabelCount; i++) |
| 150 | − Labels[i] = i < labels.Length ? labels[i] : ""; | |
| 151 | + Labels[i] = i < labels.Length ? labels[i].Trim() : ""; | |
| 151 | 152 | |
| 152 | 153 | using (MemoryStream stream = new MemoryStream()) |
| 153 | 154 | { |