Update naming and space
This commit is contained in:
parent
63a9df5826
commit
7be2fd1fcc
|
@ -211,29 +211,29 @@ internal static class Program
|
||||||
|
|
||||||
/******************************************** For Debug Display *************************************/
|
/******************************************** For Debug Display *************************************/
|
||||||
|
|
||||||
int nodeIndex = 2; // Starting node number
|
|
||||||
|
|
||||||
//foreach (var batteryNodeRecord in record.Battery.Devices)
|
//foreach (var batteryNodeRecord in record.Battery.Devices)
|
||||||
//{
|
//{
|
||||||
// var ioStates = batteryNodeRecord.IoStates;
|
// var strings = batteryNodeRecord.BatteryStrings;
|
||||||
|
|
||||||
// batteryNodeRecord.FwVersion.WriteLine(" FwVersion ");
|
// batteryNodeRecord.FwVersion.WriteLine(" FwVersion ");
|
||||||
// Convert.ToString(ioStates, 2).PadLeft(16, '0').WriteLine($" IoStates Battery node {nodeIndex}");
|
// var stringsString1Active = strings.String1Active;
|
||||||
|
// stringsString1Active.WriteLine(" BatteryString1");
|
||||||
// batteryNodeRecord.Dc.Current.WriteLine($" Current Battery node {nodeIndex}");
|
// strings.String2Active.WriteLine(" BatteryString2");
|
||||||
// batteryNodeRecord.Dc.Voltage.WriteLine($" Voltage Battery node {nodeIndex}");
|
// strings.String3Active.WriteLine(" BatteryString3");
|
||||||
|
// strings.String4Active.WriteLine(" BatteryString4");
|
||||||
|
// strings.String5Active.WriteLine(" BatteryString5");
|
||||||
|
//
|
||||||
// ("********************************************************").WriteLine();
|
// ("********************************************************").WriteLine();
|
||||||
// nodeIndex++;
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// record.GridMeter?.ActivePowerExportT1.WriteLine("kWh Import 7008");
|
//record.GridMeter?.ActivePowerExportT1.WriteLine("kWh Export 5910");
|
||||||
// record.GridMeter?.ActivePowerImportT1.WriteLine("kWh Export 7028");
|
//record.GridMeter?.ActivePowerImportT1.WriteLine("kWh Import 5902");
|
||||||
// record.GridMeter?.ActivePowerExportT2.WriteLine("Wh Import 6008");
|
//record.GridMeter?.ActivePowerExportT2.WriteLine("Wh Export 6008");
|
||||||
// record.GridMeter?.ActivePowerImportT2.WriteLine("Wh Export 6028");
|
//record.GridMeter?.ActivePowerImportT2.WriteLine("Wh Import 6028");
|
||||||
// record.GridMeter?.ActivePowerExportT3.WriteLine("Kwh Import 8004");
|
//record.GridMeter?.ActivePowerExportT3.WriteLine("Kwh Import 8004");
|
||||||
// record.GridMeter?.ActivePowerImportT3.WriteLine("kWh Export 8014");
|
//record.GridMeter?.ActivePowerImportT3.WriteLine("kWh Export 8014");
|
||||||
// record.GridMeter?.ActivePowerExportT4.WriteLine("port 5906");
|
//record.GridMeter?.ActivePowerExportT4.WriteLine("port 5906");
|
||||||
// record.GridMeter?.ActivePowerImportT4.WriteLine("port 5914");
|
//record.GridMeter?.ActivePowerImportT4.WriteLine("port 5914");
|
||||||
|
|
||||||
var currentSalimaxState = GetSalimaxStateAlarm(record);
|
var currentSalimaxState = GetSalimaxStateAlarm(record);
|
||||||
|
|
||||||
|
@ -334,85 +334,85 @@ internal static class Program
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var alarm in record.AcDc.Alarms)
|
foreach (var alarm in record.AcDc.Alarms)
|
||||||
{
|
{
|
||||||
alarmList.Add(new AlarmOrWarning
|
alarmList.Add(new AlarmOrWarning
|
||||||
{
|
{
|
||||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||||
Time = DateTime.Now.ToString("HH:mm:ss"),
|
Time = DateTime.Now.ToString("HH:mm:ss"),
|
||||||
CreatedBy = "AcDc",
|
CreatedBy = "AcDc",
|
||||||
Description = alarm.ToString()
|
Description = alarm.ToString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var alarm in record.DcDc.Alarms)
|
foreach (var alarm in record.DcDc.Alarms)
|
||||||
{
|
{
|
||||||
alarmList.Add(new AlarmOrWarning
|
alarmList.Add(new AlarmOrWarning
|
||||||
{
|
{
|
||||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||||
Time = DateTime.Now.ToString("HH:mm:ss"),
|
Time = DateTime.Now.ToString("HH:mm:ss"),
|
||||||
CreatedBy = "DcDc",
|
CreatedBy = "DcDc",
|
||||||
Description = alarm.ToString()
|
Description = alarm.ToString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (record.Battery != null)
|
if (record.Battery != null)
|
||||||
{
|
{
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
|
||||||
foreach (var battery in record.Battery.Devices)
|
foreach (var battery in record.Battery.Devices)
|
||||||
{
|
{
|
||||||
foreach (var alarm in battery.Alarms)
|
foreach (var alarm in battery.Alarms)
|
||||||
{
|
{
|
||||||
alarmList.Add(new AlarmOrWarning
|
alarmList.Add(new AlarmOrWarning
|
||||||
{
|
{
|
||||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||||
Time = DateTime.Now.ToString("HH:mm:ss"),
|
Time = DateTime.Now.ToString("HH:mm:ss"),
|
||||||
CreatedBy = "Battery node" + record.Config.Devices.BatteryNodes[i],
|
CreatedBy = "Battery node" + record.Config.Devices.BatteryNodes[i],
|
||||||
Description = alarm
|
Description = alarm
|
||||||
});
|
});
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var warning in record.AcDc.Warnings)
|
foreach (var warning in record.AcDc.Warnings)
|
||||||
{
|
{
|
||||||
warningList.Add(new AlarmOrWarning
|
warningList.Add(new AlarmOrWarning
|
||||||
{
|
{
|
||||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||||
Time = DateTime.Now.ToString("HH:mm:ss"),
|
Time = DateTime.Now.ToString("HH:mm:ss"),
|
||||||
CreatedBy = "AcDc",
|
CreatedBy = "AcDc",
|
||||||
Description = warning.ToString()
|
Description = warning.ToString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var warning in record.DcDc.Warnings)
|
foreach (var warning in record.DcDc.Warnings)
|
||||||
{
|
{
|
||||||
warningList.Add(new AlarmOrWarning
|
warningList.Add(new AlarmOrWarning
|
||||||
{
|
{
|
||||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||||
Time = DateTime.Now.ToString("HH:mm:ss"),
|
Time = DateTime.Now.ToString("HH:mm:ss"),
|
||||||
CreatedBy = "DcDc",
|
CreatedBy = "DcDc",
|
||||||
Description = warning.ToString()
|
Description = warning.ToString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (record.Battery != null)
|
if (record.Battery != null)
|
||||||
{
|
{
|
||||||
var i = 0;
|
var i = 0;
|
||||||
foreach (var warning in record.Battery.Warnings)
|
foreach (var warning in record.Battery.Warnings)
|
||||||
{
|
{
|
||||||
warningList.Add(new AlarmOrWarning
|
warningList.Add(new AlarmOrWarning
|
||||||
{
|
{
|
||||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||||
Time = DateTime.Now.ToString("HH:mm:ss"),
|
Time = DateTime.Now.ToString("HH:mm:ss"),
|
||||||
CreatedBy = "Battery node" + record.Config.Devices.BatteryNodes[i],
|
CreatedBy = "Battery node" + record.Config.Devices.BatteryNodes[i],
|
||||||
Description = warning
|
Description = warning
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var salimaxAlarmsState = (record.Battery is not null && record.Battery.Warnings.Any())
|
var salimaxAlarmsState = (record.Battery is not null && record.Battery.Warnings.Any())
|
||||||
| record.AcDc.Warnings.Any()
|
| record.AcDc.Warnings.Any()
|
||||||
|
@ -429,18 +429,18 @@ internal static class Program
|
||||||
? SalimaxAlarmState.Red
|
? SalimaxAlarmState.Red
|
||||||
: salimaxAlarmsState; // this will be replaced by LedState
|
: salimaxAlarmsState; // this will be replaced by LedState
|
||||||
|
|
||||||
int.TryParse(s3Bucket?.Split("-")[0], out var installationId);
|
int.TryParse(s3Bucket?.Split("-")[0], out var installationId);
|
||||||
|
|
||||||
var returnedStatus = new StatusMessage
|
var returnedStatus = new StatusMessage
|
||||||
{
|
{
|
||||||
InstallationId = installationId,
|
InstallationId = installationId,
|
||||||
Status = salimaxAlarmsState,
|
Status = salimaxAlarmsState,
|
||||||
Type = MessageType.AlarmOrWarning,
|
Type = MessageType.AlarmOrWarning,
|
||||||
Alarms = alarmList,
|
Alarms = alarmList,
|
||||||
Warnings = warningList
|
Warnings = warningList
|
||||||
};
|
};
|
||||||
|
|
||||||
return returnedStatus;
|
return returnedStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String? DetectAlarmStates(this StatusRecord r) => r.Relays switch
|
private static String? DetectAlarmStates(this StatusRecord r) => r.Relays switch
|
||||||
|
@ -493,7 +493,7 @@ internal static class Program
|
||||||
r.AcDc.ResetAlarms();
|
r.AcDc.ResetAlarms();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is will be used for provider throtling
|
// This is will be used for provider throttling
|
||||||
private static void ControlPvPower(this StatusRecord r, Int16 exportLimit = 100)
|
private static void ControlPvPower(this StatusRecord r, Int16 exportLimit = 100)
|
||||||
{
|
{
|
||||||
var inverters = r.AcDc.Devices;
|
var inverters = r.AcDc.Devices;
|
||||||
|
|
Loading…
Reference in New Issue