|
|
|
@ -126,7 +126,7 @@ public class DoSwappingState : IState
|
|
|
|
|
//查询当前是否有任务执行
|
|
|
|
|
|
|
|
|
|
var readTaskNo = PlcMgr.PlcClient?.ReadTaskNo();
|
|
|
|
|
if (readTaskNo == 0 || readTaskNo==1)
|
|
|
|
|
if (readTaskNo == 0 || readTaskNo == 1)
|
|
|
|
|
{
|
|
|
|
|
PlcMgr.PlcClient?.ExChangeTaskNo(1);
|
|
|
|
|
//查询车辆锁止状态
|
|
|
|
@ -137,7 +137,6 @@ public class DoSwappingState : IState
|
|
|
|
|
var readPlcTaskStatus = PlcApi.ReadTaskStatus(1);
|
|
|
|
|
if (startSwapping && readPlcTaskStatus)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
machine.SwapOrder.SwapBeginTime = DateTime.Now;
|
|
|
|
|
_CommonMgr.UpdateSwapOrder(machine);
|
|
|
|
|
machine.SwapStatus = 0;
|
|
|
|
@ -328,15 +327,11 @@ public class DoSwappingState : IState
|
|
|
|
|
|
|
|
|
|
if (PlcApi.ReadPlcTaskStatus() == 1007)
|
|
|
|
|
{
|
|
|
|
|
if (PlcApi.ReadTaskStatusReset())
|
|
|
|
|
{
|
|
|
|
|
PlcMgr.PlcClient?.ResetTaskNo();
|
|
|
|
|
SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoToSafePosition);
|
|
|
|
|
machine.ToSafePositionFlag = true;
|
|
|
|
|
machine.BusinessSwappingStateUpdateTime = DateTime.Now;
|
|
|
|
|
SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoToSafePosition);
|
|
|
|
|
machine.ToSafePositionFlag = true;
|
|
|
|
|
machine.BusinessSwappingStateUpdateTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
machine.SwapStatus = 1;
|
|
|
|
|
}
|
|
|
|
|
machine.SwapStatus = 1;
|
|
|
|
|
}
|
|
|
|
|
}, () => { });
|
|
|
|
|
}
|
|
|
|
|