Update Configuration from frontend
This commit is contained in:
parent
242969306b
commit
a4e3683082
|
@ -4,7 +4,7 @@ public class Configuration
|
|||
{
|
||||
public Double MinimumSoC { get; set; }
|
||||
public Double GridSetPoint { get; set; }
|
||||
public CalibrationChargeType ForceCalibrationCharge { get; set; }
|
||||
public CalibrationChargeType CalibrationChargeState { get; set; }
|
||||
public DateTime CalibrationChargeDate { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ public class Configuration
|
|||
{
|
||||
public Double MinimumSoC { get; set; }
|
||||
public Double GridSetPoint { get; set; }
|
||||
public CalibrationChargeType ForceCalibrationChargeState { get; set; }
|
||||
public CalibrationChargeType CalibrationChargeState { get; set; }
|
||||
public DateTime CalibrationChargeDate { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public static class MiddlewareAgent
|
|||
|
||||
Configuration? config = JsonSerializer.Deserialize<Configuration>(message);
|
||||
|
||||
Console.WriteLine($"Received a configuration message: GridSetPoint is " + config.GridSetPoint + ", MinimumSoC is " + config.MinimumSoC + " and ForceCalibrationCharge is " + config.ForceCalibrationChargeState+ " and CalibrationChargeDate is " + config.CalibrationChargeDate);
|
||||
Console.WriteLine($"Received a configuration message: GridSetPoint is " + config.GridSetPoint + ", MinimumSoC is " + config.MinimumSoC + " and ForceCalibrationCharge is " + config.CalibrationChargeState+ " and CalibrationChargeDate is " + config.CalibrationChargeDate);
|
||||
|
||||
// Send the reply to the sender's endpoint
|
||||
UdpListener.Send(replyData, replyData.Length, serverEndpoint);
|
||||
|
|
|
@ -690,13 +690,13 @@ internal static class Program
|
|||
{
|
||||
status.Config.MinSoc = config.MinimumSoC;
|
||||
status.Config.GridSetPoint = config.GridSetPoint * 1000; // converted from kW to W
|
||||
status.Config.ForceCalibrationChargeState = config.ForceCalibrationChargeState;
|
||||
status.Config.ForceCalibrationChargeState = config.CalibrationChargeState;
|
||||
|
||||
if (config.ForceCalibrationChargeState == CalibrationChargeType.RepetitivelyEvery)
|
||||
if (config.CalibrationChargeState == CalibrationChargeType.RepetitivelyEvery)
|
||||
{
|
||||
status.Config.DayAndTimeForRepetitiveCalibration = config.CalibrationChargeDate;
|
||||
}
|
||||
else if (config.ForceCalibrationChargeState == CalibrationChargeType.AdditionallyOnce)
|
||||
else if (config.CalibrationChargeState == CalibrationChargeType.AdditionallyOnce)
|
||||
{
|
||||
status.Config.DayAndTimeForAdditionalCalibration = config.CalibrationChargeDate;
|
||||
}
|
||||
|
|
|
@ -5,4 +5,4 @@ public enum CalibrationChargeType
|
|||
RepetitivelyEvery,
|
||||
AdditionallyOnce,
|
||||
ChargePermanently
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue