master
赵宝玉 3 weeks ago
parent 6738f669fa
commit 4b88ea9c82

@ -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);
}
}

@ -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?> rfidReadModel = RfidApi.ReadRfid();
@ -371,6 +371,21 @@ public class StationReadyState : IState
machine.RfidConnectFlag = false;
machine.RfidReadFlag = true;
}
Thread.Sleep(1000);
Task<bool> 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());

Loading…
Cancel
Save