|
|
|
@ -47,6 +47,7 @@ public class StationReadyState : IState
|
|
|
|
|
machine);
|
|
|
|
|
|
|
|
|
|
LedClient.SendMsgByKey(InfoEnum.SwapInfo.WelcomeInfo.GetLed());
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
////开启雷达
|
|
|
|
|
var beginRadar = ControlRadar(machine, 1);
|
|
|
|
|
if (InvokeStatus.Done != beginRadar)
|
|
|
|
@ -340,14 +341,26 @@ 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();
|
|
|
|
|
rfidReadModel.Wait();
|
|
|
|
|
var machineRfidReadModel = rfidReadModel.Result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
if (rfidReadModel.IsCompletedSuccessfully && machineRfidReadModel != null
|
|
|
|
|
&& machineRfidReadModel.Result == 1
|
|
|
|
|
&& !string.IsNullOrEmpty(machineRfidReadModel.VelVin))
|
|
|
|
@ -365,11 +378,11 @@ public class StationReadyState : IState
|
|
|
|
|
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.RfidReadFlag,
|
|
|
|
|
machine,param:JsonConvert.SerializeObject(machine.RfidReadModel));
|
|
|
|
|
|
|
|
|
|
//RfidApi.StopRead();
|
|
|
|
|
// _log.Info("stop read rfid");
|
|
|
|
|
// RfidApi.DisConnect();
|
|
|
|
|
machine.RfidConnectFlag = false;
|
|
|
|
|
machine.RfidReadFlag = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}, () =>
|
|
|
|
|
{
|
|
|
|
|