|
|
|
@ -47,11 +47,11 @@ public class CarCtrlState : IState
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
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<bool> 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<SoundClient>();
|
|
|
|
|
|
|
|
|
|
Task<bool> result = TBoxApi.UnLockCarManyTimes(machine.RfidReadModel.VelVin);
|
|
|
|
|
// await result;
|
|
|
|
|
bool unLock = result.Result;
|
|
|
|
|
if (!unLock )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
SoundClient = AppInfo.Container.Resolve<SoundClient>();
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|