diff --git a/Service/Execute/Step/CarCtrlState.cs b/Service/Execute/Step/CarCtrlState.cs index 32f361b..2503e3d 100644 --- a/Service/Execute/Step/CarCtrlState.cs +++ b/Service/Execute/Step/CarCtrlState.cs @@ -61,8 +61,9 @@ public class CarCtrlState : IState //查询车辆锁止状态 Task carInfo = TBoxApi.GetCarInfo(machine.RfidReadModel.VelVin); var resultHeartBeatMsg = carInfo.Result.CarStatus; - if (resultHeartBeatMsg?.LockStatus == 1) + if (resultHeartBeatMsg?.LockStatus == 1 || machine.ManualConfirmCarUnlockFlag) { + machine.ManualConfirmCarUnlockFlag = false; machine.BoxCarInfoModel = carInfo.Result; machine.VelUnlockFlag = true; _CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.VelUnlockFlag, diff --git a/Service/Execute/Step/SwapDoneState.cs b/Service/Execute/Step/SwapDoneState.cs index 19fd5c0..94f1f46 100644 --- a/Service/Execute/Step/SwapDoneState.cs +++ b/Service/Execute/Step/SwapDoneState.cs @@ -103,8 +103,9 @@ public class SwapDoneState : IState { //查询车辆锁止状态 Task carInfo = TBoxApi.GetCarInfo(machine.RfidReadModel.VelVin); - if (carInfo.Result?.CarStatus?.LockStatus == 2) + if (carInfo.Result?.CarStatus?.LockStatus == 2 || machine.ManualConfirmCarLockFlag) { + machine.ManualConfirmCarLockFlag = false; machine.BoxCarInfoModel = carInfo.Result; //设置出口的是绿灯 if (PlcApi.WriteExistLamp(1000)) diff --git a/Service/Execute/SwappingStateMachine.cs b/Service/Execute/SwappingStateMachine.cs index 022f871..317496b 100644 --- a/Service/Execute/SwappingStateMachine.cs +++ b/Service/Execute/SwappingStateMachine.cs @@ -32,11 +32,12 @@ public class SwappingStateMachine : IDisposable //手动确认换电成功 public bool ManualSwapSuccFlag { get; set; } = false; - - //手动确认解锁/上锁成功 - public bool ManualConfirmCarOperateFlag { get; set; } + //手动确认解锁/上锁成功 + public bool ManualConfirmCarUnlockFlag { get; set; } + //手动确认解锁/上锁成功 + public bool ManualConfirmCarLockFlag { get; set; } public OperateModel OperateModel = null; public readonly LedTool? LedTool = null; @@ -279,6 +280,23 @@ public class SwappingStateMachine : IDisposable Log.Info($"ManualSwapSuccFlag machine ok"); return true; } + + public bool ManualConfirmLockCar() + { + ManualConfirmCarLockFlag = true; + Thread.Sleep(2000); + Log.Info($"ManualConfirmLockCar ok"); + return true; + } + + public bool ManualConfirmUnLockCar() + { + ManualConfirmCarUnlockFlag = true; + Thread.Sleep(2000); + Log.Info($"ManualConfirmLockCar ok"); + return true; + } + private void ResetData() @@ -305,8 +323,8 @@ public class SwappingStateMachine : IDisposable PlcSwapFlag = false; ManualSwapSuccFlag = false; OperateModel = null; - ManualConfirmCarOperateFlag = false; - + ManualConfirmCarUnlockFlag = false; + ManualConfirmCarLockFlag = false; CancelFlag = false; StopFlag = false; } diff --git a/WebStarter/Controllers/SwapMonitorController.cs b/WebStarter/Controllers/SwapMonitorController.cs index 1cead45..1aebf33 100644 --- a/WebStarter/Controllers/SwapMonitorController.cs +++ b/WebStarter/Controllers/SwapMonitorController.cs @@ -293,4 +293,24 @@ public class SwapMonitorController : ControllerBase return Result>.Success(carInfoList.Where(i => i.CarNo.Length >= 17).ToList()); } + + /// + /// 确认上锁成功 + /// + [HttpGet("ConfirmLockSucc")] + public async Task> ConfirmLockSucc() + { + StationSoftMgr.SwappingStateMachine.ManualConfirmLockCar(); + return Result.Success(); + } + + /// + /// 确认解锁成功 + /// + [HttpGet("ConfirmUnLockSucc")] + public async Task> ConfirmUnLockSucc() + { + StationSoftMgr.SwappingStateMachine.ManualConfirmUnLockCar(); + return Result.Success(); + } } \ No newline at end of file