人工操作bug修复

master
lxw 6 months ago
parent c5cafea201
commit a73ec84a8d

@ -24,6 +24,9 @@ public class CancelState : IState
public StateResult Handle(SwappingStateMachine machine) public StateResult Handle(SwappingStateMachine machine)
{ {
_log.Info($"'goto cancel"); _log.Info($"'goto cancel");
try
{
machine.CancelFlag = false; machine.CancelFlag = false;
if (machine.SwapOrderBatteryInfo!=null && machine.SwapOrderBatteryInfo.swapAmtOrder != null) if (machine.SwapOrderBatteryInfo!=null && machine.SwapOrderBatteryInfo.swapAmtOrder != null)
{ {
@ -48,6 +51,14 @@ public class CancelState : IState
machine.Reset(); machine.Reset();
}
catch (Exception e)
{
machine.Reset();
_log.Error($"CancelState err={e}");
}
return new StateResult() return new StateResult()
{ {
SwappingState = SwappingState.StationReady SwappingState = SwappingState.StationReady

@ -24,6 +24,8 @@ public class ManualSuccState : IState
public StateResult Handle(SwappingStateMachine machine) public StateResult Handle(SwappingStateMachine machine)
{ {
_log.Info($"'goto ManualSucc"); _log.Info($"'goto ManualSucc");
try
{
machine.ManualSwapSuccFlag = false; machine.ManualSwapSuccFlag = false;
if (machine.SwapOrderBatteryInfo.swapAmtOrder != null) if (machine.SwapOrderBatteryInfo.swapAmtOrder != null)
{ {
@ -47,6 +49,13 @@ public class ManualSuccState : IState
Reason = machine.OperateModel.Reason, Reason = machine.OperateModel.Reason,
}); });
machine.Reset(); machine.Reset();
}
catch (Exception e)
{
machine.Reset();
_log.Error($"ManualSuccState err={e}");
}
return new StateResult() return new StateResult()
{ {
SwappingState = SwappingState.StationReady SwappingState = SwappingState.StationReady

Loading…
Cancel
Save