现场修正:防止重复发启动充电

master
CZ 5 months ago
parent af0822f8b5
commit 355ef6b8d7

@ -182,18 +182,22 @@ public class AutoChargeTask : ITask
{
float? chargePower = EquipInfoRepository.QueryPowerByCode(binInfo.ChargerNo);
float? power = chargePower == null ? StaticStationInfo.ChargePower : chargePower;
Result<bool>? result = ClientMgr.GetBySn(binInfo.ChargerNo)
?.StartCharge(chargeSoc, (float)power);
if (result is { IsSuccess: true })
if (binInfo.ChargeStatus != 1)
{
Log.Info($"auto start charge {binInfo.ChargerNo}");
number++;
}
if (count == number)
{
Log.Info($"auto start charge count {count}");
break;
//没有充电时候在充电
Result<bool>? result = ClientMgr.GetBySn(binInfo.ChargerNo)
?.StartCharge(chargeSoc, (float)power);
if (result is { IsSuccess: true })
{
Log.Info($"auto start charge {binInfo.ChargerNo}");
number++;
}
if (count == number)
{
Log.Info($"auto start charge count {count}");
break;
}
}
}
}
@ -202,12 +206,11 @@ public class AutoChargeTask : ITask
foreach (var VARIABLE in chargingList)
{
if (StaticStationInfo.ChargeSoc != 100)
if (VARIABLE.Soc >= (StaticStationInfo.ChargeSoc + 1))
{
Log.Info($"auto stop charge {VARIABLE.No} soc>=chaegeSoc+1 soc:{VARIABLE.Soc}");
ClientMgr.GetBySn(VARIABLE.No)?.SendRemoteStopCharging();
}
if (VARIABLE.Soc >= (StaticStationInfo.ChargeSoc + 1))
{
Log.Info($"auto stop charge {VARIABLE.No} soc>=chaegeSoc+1 soc:{VARIABLE.Soc}");
ClientMgr.GetBySn(VARIABLE.No)?.SendRemoteStopCharging();
}
}
#endregion

Loading…
Cancel
Save