diff --git a/Service/Execute/Step/CarCtrlState.cs b/Service/Execute/Step/CarCtrlState.cs index 970fdeb..756ac17 100644 --- a/Service/Execute/Step/CarCtrlState.cs +++ b/Service/Execute/Step/CarCtrlState.cs @@ -47,11 +47,11 @@ public class CarCtrlState : IState /// public InvokeStatus UnLockCar(SwappingStateMachine machine) { - return Invoker.Invoke("UnLockCar", 500, 4, machine.IsCanceled, - () => machine.VelUnlockFlag, () => + return Invoker.Invoke("UnLockCar", 500, 5, machine.IsCanceled, + () => machine.VelUnlockFlag, async () => { Task result = TBoxApi.UnLockCarManyTimes(machine.RfidReadModel.VelVin); - + await result; bool unLock = result.Result; if (unLock|| machine.ManualConfirmCarUnlockFlag) { @@ -77,14 +77,25 @@ public class CarCtrlState : IState } }, () => { - SoundClient = AppInfo.Container.Resolve(); - + Task result = TBoxApi.UnLockCarManyTimes(machine.RfidReadModel.VelVin); + // await result; + bool unLock = result.Result; + if (!unLock ) + { + + SoundClient = AppInfo.Container.Resolve(); SoundClient.SoundPlay(SoundEnum.music104); Thread.Sleep(7000); - SoundClient.SoundPlay(SoundEnum.music105); - - - }, false, () => { machine.ExceptionReason = ExceptionReason.UnLockCarError; } - , 8, InvokeStatus.None); + SoundClient.SoundPlay(SoundEnum.music105); + Thread.Sleep(4000); + } + + }, + false, + () => + { + machine.ExceptionReason = ExceptionReason.UnLockCarError; + } + , 5, InvokeStatus.None); } } \ No newline at end of file diff --git a/Service/Execute/Step/StationReadyState.cs b/Service/Execute/Step/StationReadyState.cs index a4b5f41..5e0dd7a 100644 --- a/Service/Execute/Step/StationReadyState.cs +++ b/Service/Execute/Step/StationReadyState.cs @@ -340,7 +340,7 @@ public class StationReadyState : IState private InvokeStatus ReadRfid(SwappingStateMachine machine) { //开始读rifd - return Invoker.Invoke("read rfid", 3000, 10, machine.IsCanceled, + return Invoker.Invoke("read rfid", 1000, 10, machine.IsCanceled, () => machine.RfidReadFlag, () => { Task rfidReadModel = RfidApi.ReadRfid(); @@ -371,6 +371,21 @@ public class StationReadyState : IState machine.RfidConnectFlag = false; machine.RfidReadFlag = true; } + Thread.Sleep(1000); + Task beginRead = RfidApi.BeginRead(); + beginRead.Wait(); + if (!beginRead.Result) + { + _log.Info("begin read rfid error"); + } + else + { + machine.ExceptionReason = ExceptionReason.None; + _log.Info("begin read done"); + machine.BeginRfidReadFlag = true; + } + Thread.Sleep(1000); + }, () => { // machine.LedTool!.WriteProgramContent(InfoEnum.SwapInfo.ErrorReadRfid.GetLed());