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