Innovenergy_trunk/csharp/Lib/Devices/AMPT/AmptStatus.cs

37 lines
1014 B
C#
Raw Normal View History

2023-05-06 13:41:20 +00:00
using InnovEnergy.Lib.StatusApi.DeviceTypes;
using InnovEnergy.Lib.Units.Composite;
2023-03-09 11:40:47 +00:00
namespace InnovEnergy.Lib.Devices.AMPT;
2023-02-16 12:57:06 +00:00
2023-06-13 10:53:37 +00:00
public class AmptStatus : IMppt
{
public AmptStatus(DcBus dc, IReadOnlyList<DcBus> strings)
{
Dc = dc;
Strings = strings;
}
public DcBus Dc { get; }
public IReadOnlyList<DcBus> Strings { get; }
}
// public static AmptStatus Parallel(IReadOnlyList<AmptStatus> stati)
// {
// if (stati.Count == 0)
// {
// return new AmptStatus
// (
// Dc: DcBus.FromVoltageCurrent(0, 0),
// Strings: Array.Empty<DcBus>()
// );
// }
//
// var voltage = stati.Average(s => s.Dc.Voltage.Value);
// var current = stati.Sum(s => s.Dc.Current.Value);
// var dc = DcBus.FromVoltageCurrent(voltage, current);
//
// var strings = stati.SelectMany(s => s.Strings).ToList();
//
// return new AmptStatus(dc, strings);
// }