diff --git a/csharp/Lib/Devices/AMPT/AmptDevices.cs b/csharp/Lib/Devices/AMPT/AmptDevices.cs index 1674baffe..003e09b20 100644 --- a/csharp/Lib/Devices/AMPT/AmptDevices.cs +++ b/csharp/Lib/Devices/AMPT/AmptDevices.cs @@ -77,8 +77,8 @@ public class AmptDevices Current = busCurrent }; - // flatten the 2 strings of each SO into one array - var strings = soStati.SelectMany(GetStrings).ToArray(nStrings); + // flatten the output strings of each SO into one array + var strings = soStati.SelectMany(GetDc).ToArray(nStrings); return new AmptStatus { @@ -107,6 +107,16 @@ public class AmptDevices }; } + private static IEnumerable GetDc(StringOptimizerRegisters r) + { + // hardcoded: every SO has 2 strings (produced like this by AMPT) + + yield return new() + { + Voltage = r.Voltage, + Current = r.Current, + }; + } private static IEnumerable> StringOptimizers(ModbusClient modbusClient) {