自动充电策略添加区间电池 主动停止功能

master
lxw 2 months ago
parent db1c7c6eb5
commit 2634f62bb6

@ -153,7 +153,23 @@ public class AutoChargeTask : ITask
List<BinInfo> chargingList = binInfos.Where(it => it.ChargeStatus == 1).ToList(); List<BinInfo> chargingList = binInfos.Where(it => it.ChargeStatus == 1).ToList();
Log.Info( Log.Info(
$"chargingList={JsonConvert.SerializeObject(chargingList.Select(info => info.Code + "," + info.ChargerNo).ToList())}"); $"chargingList={JsonConvert.SerializeObject(chargingList.Select(info => info.Code + "," + info.ChargerNo).ToList())}");
if (canSwapList.Count <= needBatteryCount)
#region 现有电池满足需求 停止正在充电的电池
if (canSwapList.Count >= needBatteryCount)
{
Log.Info($"can swap count {canSwapList.Count} > {needBatteryCount}, all stop={JsonConvert.SerializeObject(chargingList.Select(info => info.Code + "," + info.ChargerNo).ToList())}");
foreach (var t in chargingList)
{
Log.Info($"auto stop charge {t.No}");
ClientMgr.GetBySn(t.ChargerNo)?.SendRemoteStopCharging();
}
}
#endregion
if (canSwapList.Count < needBatteryCount)
{ {
List<BinInfo> canChargeList = binInfos.Where(it => List<BinInfo> canChargeList = binInfos.Where(it =>
it.Soc != null && Convert.ToSingle(it.Soc) < StaticStationInfo.SwapSoc && it.Soc != null && Convert.ToSingle(it.Soc) < StaticStationInfo.SwapSoc &&

Loading…
Cancel
Save