|
|
@ -336,11 +336,17 @@ public class DoSwappingState : IState
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public StateResult CheckChannelStatus(SwappingStateMachine machine)
|
|
|
|
public StateResult CheckChannelStatus(SwappingStateMachine machine)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
while (!machine.ChannelStatusOkFlag)
|
|
|
|
while (!machine.ChannelStatusOkFlag)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_log.Info("begin plc CheckChannelStatus");
|
|
|
|
_log.Info("begin plc CheckChannelStatus");
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
var channelStatus = PlcApi.ChannelStatus();
|
|
|
|
var channelStatus = PlcApi.ChannelStatus();
|
|
|
|
|
|
|
|
if (count % 10 == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.CarTakePhotoInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (channelStatus == 1000)
|
|
|
|
if (channelStatus == 1000)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
machine.ChannelStatusOkFlag = true;
|
|
|
|
machine.ChannelStatusOkFlag = true;
|
|
|
@ -358,7 +364,8 @@ public class DoSwappingState : IState
|
|
|
|
Thread.Sleep(3000);
|
|
|
|
Thread.Sleep(3000);
|
|
|
|
machine.VehiclesInPlace2Flag = false;
|
|
|
|
machine.VehiclesInPlace2Flag = false;
|
|
|
|
machine.StartSwappingFlag = false;
|
|
|
|
machine.StartSwappingFlag = false;
|
|
|
|
|
|
|
|
machine.PlcHoldFlag = false;
|
|
|
|
|
|
|
|
machine.ChannelStatusOkFlag = false;
|
|
|
|
//回归到本阶段的读锁止状态
|
|
|
|
//回归到本阶段的读锁止状态
|
|
|
|
return new StateResult()
|
|
|
|
return new StateResult()
|
|
|
|
{
|
|
|
|
{
|
|
|
|