Changed to Output string instead of input

This commit is contained in:
atef 2024-06-11 11:39:45 +02:00
parent 0357980b3a
commit 8d04d89eab
1 changed files with 12 additions and 2 deletions

View File

@ -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<DcBus> 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<ModbusDevice<StringOptimizerRegisters>> StringOptimizers(ModbusClient modbusClient)
{