Add display debug
This commit is contained in:
parent
e5c3a51d8d
commit
c8210f601c
|
@ -208,6 +208,35 @@ internal static class Program
|
|||
|
||||
var record = ReadStatus();
|
||||
|
||||
|
||||
/******************************************** For Debug Display *************************************/
|
||||
|
||||
int nodeIndex = 2; // Starting node number
|
||||
|
||||
foreach (var batteryNodeRecord in record.Battery.Devices)
|
||||
{
|
||||
var ioStates = batteryNodeRecord.IoStates;
|
||||
|
||||
batteryNodeRecord.FwVersion.WriteLine(" FwVersion ");
|
||||
Convert.ToString(ioStates, 2).PadLeft(16, '0').WriteLine($" IoStates Battery node {nodeIndex}");
|
||||
|
||||
batteryNodeRecord.Dc.Current.WriteLine($" Current Battery node {nodeIndex}");
|
||||
batteryNodeRecord.Dc.Voltage.WriteLine($" Voltage Battery node {nodeIndex}");
|
||||
|
||||
("********************************************************").WriteLine();
|
||||
|
||||
nodeIndex++;
|
||||
}
|
||||
|
||||
// record.GridMeter?.ActivePowerExportT1.WriteLine("kWh Import 7008");
|
||||
// record.GridMeter?.ActivePowerImportT1.WriteLine("kWh Export 7028");
|
||||
record.GridMeter?.ActivePowerExportT2.WriteLine("Wh Import 6008");
|
||||
// record.GridMeter?.ActivePowerImportT2.WriteLine("Wh Export 6028");
|
||||
// record.GridMeter?.ActivePowerExportT3.WriteLine("Kwh Import 8004");
|
||||
// record.GridMeter?.ActivePowerImportT3.WriteLine("kWh Export 8014");
|
||||
// record.GridMeter?.ActivePowerExportT4.WriteLine("port 5906");
|
||||
// record.GridMeter?.ActivePowerImportT4.WriteLine("port 5914");
|
||||
|
||||
var currentSalimaxState = GetSalimaxStateAlarm(record);
|
||||
|
||||
SendSalimaxStateAlarm(currentSalimaxState, record);
|
||||
|
@ -374,13 +403,14 @@ internal static class Program
|
|||
|
||||
if (record.Battery != null)
|
||||
{
|
||||
var i = 0;
|
||||
foreach (var warning in record.Battery.Warnings)
|
||||
{
|
||||
warningList.Add(new AlarmOrWarning
|
||||
{
|
||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||
Time = DateTime.Now.ToString("HH:mm:ss"),
|
||||
CreatedBy = "Battery",
|
||||
CreatedBy = "Battery node" + record.Config.Devices.BatteryNodes[i],
|
||||
Description = warning
|
||||
});
|
||||
}
|
||||
|
@ -428,6 +458,18 @@ internal static class Program
|
|||
var inverters = r.AcDc.Devices;
|
||||
var dcDevices = r.DcDc.Devices;
|
||||
var configFile = r.Config;
|
||||
var maxBatteryDischargingCurrentLive = 0.0;
|
||||
|
||||
|
||||
// This adapting the max discharging current to the current connected batteries
|
||||
if (r.Battery != null)
|
||||
{
|
||||
var numberOfBatteries = configFile.Devices.BatteryNodes.Length;
|
||||
var dischargingCurrentByBattery = configFile.MaxBatteryDischargingCurrent / numberOfBatteries;
|
||||
var numberOfConnectedBatteries = r.Battery.Devices.Where(d => d.ConnectedToDcBus).ToList().Count;
|
||||
maxBatteryDischargingCurrentLive = dischargingCurrentByBattery * numberOfConnectedBatteries;
|
||||
}
|
||||
|
||||
|
||||
var devicesConfig = r.AcDc.Devices.All(d => d.Control.Ac.GridType == GridType.GridTied400V50Hz) ? configFile.GridTie : configFile.IslandMode; // TODO if any of the grid tie mode
|
||||
|
||||
|
@ -442,7 +484,7 @@ internal static class Program
|
|||
dcDevices.ForEach(d => d.Control.DroopControl.ReferenceVoltage = devicesConfig.DcDc.ReferenceDcLinkVoltage);
|
||||
|
||||
dcDevices.ForEach(d => d.Control.CurrentControl.MaxBatteryChargingCurrent = configFile.MaxBatteryChargingCurrent);
|
||||
dcDevices.ForEach(d => d.Control.CurrentControl.MaxBatteryDischargingCurrent = configFile.MaxBatteryDischargingCurrent);
|
||||
dcDevices.ForEach(d => d.Control.CurrentControl.MaxBatteryDischargingCurrent = maxBatteryDischargingCurrentLive == 0? configFile.MaxBatteryDischargingCurrent : maxBatteryDischargingCurrentLive);
|
||||
dcDevices.ForEach(d => d.Control.MaxDcPower = configFile.MaxDcPower);
|
||||
|
||||
dcDevices.ForEach(d => d.Control.VoltageLimits.MaxBatteryVoltage = configFile.MaxChargeBatteryVoltage);
|
||||
|
@ -453,7 +495,7 @@ internal static class Program
|
|||
r.AcDc.ResetAlarms();
|
||||
}
|
||||
|
||||
// This is will be used for
|
||||
// This is will be used for provider throtling
|
||||
private static void ControlPvPower(this StatusRecord r, Int16 exportLimit = 100)
|
||||
{
|
||||
var inverters = r.AcDc.Devices;
|
||||
|
|
Loading…
Reference in New Issue