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

master
CZ 5 months ago
parent af0822f8b5
commit 355ef6b8d7

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

Loading…
Cancel
Save