Add the daily production data in AMPT
This commit is contained in:
parent
50eaf261a3
commit
80f9186319
|
@ -47,6 +47,11 @@ public class AmptDevices
|
|||
// CommunicationUnit knows how many StringOptimizers are connected
|
||||
var nStringOptimizers = cuStatus.NumberOfStringOptimizers;
|
||||
|
||||
//Factor
|
||||
var nEnergyFactor = cuStatus.EnergyScaleFactor;
|
||||
var nCurrentFactor = cuStatus.CurrentScaleFactor;
|
||||
var nVoltageFactor = cuStatus.VoltageScaleFactor;
|
||||
|
||||
// hardcoded: every SO has 2 strings (produced like this by AMPT)
|
||||
var nStrings = nStringOptimizers * 2;
|
||||
|
||||
|
@ -64,10 +69,14 @@ public class AmptDevices
|
|||
|
||||
var busVoltage = nStringOptimizers == 0 ? 0 : soStati.Average(r => r.Voltage);
|
||||
var busCurrent = nStringOptimizers == 0 ? 0 : soStati.Sum (r => r.Current);
|
||||
var dailyOutputEnergy = nStringOptimizers == 0 ? 0 : soStati.Sum (r => r.ProductionToday);
|
||||
|
||||
dailyOutputEnergy.WriteLine(" Daily Production ");
|
||||
|
||||
var dc = new DcBus
|
||||
{
|
||||
Voltage = busVoltage,
|
||||
Current = busCurrent,
|
||||
Current = busCurrent
|
||||
};
|
||||
|
||||
// flatten the 2 strings of each SO into one array
|
||||
|
@ -76,7 +85,8 @@ public class AmptDevices
|
|||
return new AmptStatus
|
||||
{
|
||||
Dc = dc,
|
||||
Strings = strings
|
||||
Strings = strings,
|
||||
DcWh = dailyOutputEnergy
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -7,5 +7,6 @@ public class AmptStatus : IMppt
|
|||
{
|
||||
public required DcBus Dc { get; init; }
|
||||
public required IReadOnlyList<DcBus> Strings { get; init; }
|
||||
public required Double DcWh { get; init; } //Daily integrated string output energy in Wh
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue