new system log for salimax alarms added

This commit is contained in:
atef 2024-03-11 15:56:38 +01:00
parent 62f5630ab1
commit f77a86c4fc
3 changed files with 11 additions and 5 deletions

View File

@ -26,7 +26,7 @@ public record StatusRecord
public required RelaysRecord? Relays { get; init; }
public required AmptStatus? PvOnDc { get; init; }
public required Config Config { get; set; }
public required SystemLog Log { get; set; } // TODO: init only
public required SystemLog Log { get; init; } // TODO: init only
public required EssControl EssControl { get; set; } // TODO: init only
public required StateMachine StateMachine { get; init; }

View File

@ -1,8 +1,11 @@
using InnovEnergy.App.SaliMax.DataTypes;
namespace InnovEnergy.App.SaliMax.Ess;
public record SystemLog
{
public required String? Message { get; init; }
public required SalimaxAlarmState SalimaxAlarmState { get; init; }
public required String? Message { get; init; }
public required SalimaxAlarmState SalimaxAlarmState { get; init; }
public required List<AlarmOrWarning>? SalimaxAlarms { get; set; }
public required List<AlarmOrWarning>? SalimaxWarnings { get; set; }
}

View File

@ -175,7 +175,7 @@ internal static class Program
StateMachine = StateMachine.Default,
EssControl = EssControl.Default,
Log = new SystemLog { SalimaxAlarmState = SalimaxAlarmState.Green, Message = null }, //TODO: Put real stuff
Log = new SystemLog { SalimaxAlarmState = SalimaxAlarmState.Green, Message = null, SalimaxAlarms = null, SalimaxWarnings = null}, //TODO: Put real stuff
Config = config // load from disk every iteration, so config can be changed while running
};
}
@ -464,6 +464,9 @@ internal static class Program
int.TryParse(s3Bucket?.Split("-")[0], out var installationId);
record.Log.SalimaxAlarms = alarmList;
record.Log.SalimaxWarnings = warningList;
var returnedStatus = new StatusMessage
{
InstallationId = installationId,