示例#1
0
        public override void HandleMsg(CmdMsgType msgType)
        {
            if (this.State == CommandState.Failed)
            {
                return;
            }

            switch (msgType)
            {
            case CmdMsgType.Pause:
                if (this.State == CommandState.Running)
                {
                    this.State = CommandState.Pause;
                }
                break;

            case CmdMsgType.Resume:
                if (this.State == CommandState.Pause)
                {
                    this.State = CommandState.Running;
                }
                break;

            case CmdMsgType.Stop:
                this.State = CommandState.Failed;
                break;
            }
        }
示例#2
0
        public override void HandleMsg(CmdMsgType msgType)
        {
            if (this.State == CommandState.Failed)
            {
                return;
            }

            switch (msgType)
            {
            case CmdMsgType.Pause:
                if (this.State == CommandState.Running)
                {
                    this.State = CommandState.Pause;
                    this.MoveSmoothStop();
                }
                break;

            case CmdMsgType.Resume:
                if (this.State == CommandState.Pause)
                {
                    this.Call();
                }
                break;

            case CmdMsgType.Stop:
                this.State = CommandState.Failed;
                this.MoveSmoothStop();
                break;

            default:
                break;
            }
        }
示例#3
0
        public override void HandleMsg(CmdMsgType msgType)
        {
            if (this.State == CommandState.Failed)
            {
                return;
            }

            switch (msgType)
            {
            case CmdMsgType.Pause:
                if (this.State == CommandState.Running)
                {
                    this.card.Executor.StopCrd(this.card.CardId, this.TrcPrm.CsId);
                    this.State = CommandState.Pause;
                }
                break;

            case CmdMsgType.Resume:
                if (this.State == CommandState.Pause)
                {
                    this.card.Executor.StartCrd(this.card.CardId, this.TrcPrm.CsId);
                    this.State = CommandState.Running;
                }
                break;

            case CmdMsgType.Stop:
                this.card.Executor.StopCrd(this.card.CardId, this.TrcPrm.CsId);
                this.card.Executor.ClrCrdBuf(this.card.CardId, this.TrcPrm.CsId);
                this.card.Executor.Cmp2dStop(card.CardId, this.Cmp2dPrm.Chn);
                this.State = CommandState.Failed;
                break;
            }
        }
示例#4
0
        public void HandleMsg(CmdMsgType msgType)
        {
            if (this.State == CommandState.Failed)
            {
                return;
            }

            switch (msgType)
            {
            case CmdMsgType.Pause:
                if (this.State == CommandState.Running)
                {
                    this.Timeout = this.Timeout - (DateTime.Now - this.dateTimeStart);
                    this.State   = CommandState.Pause;
                }
                break;

            case CmdMsgType.Resume:
                if (this.State == CommandState.Pause)
                {
                    this.Call();
                }
                break;

            case CmdMsgType.Stop:
                this.State = CommandState.Failed;
                break;
            }
        }
示例#5
0
        public void NotifyAll(CmdMsgType msg)
        {
            Telegram telegram = new Telegram()
            {
                Msg         = msg,
                IsNotifyAll = true
            };

            this.msgQueue.Enqueue(telegram);
        }
示例#6
0
        public void Notify(CmdMsgType msg, List <IActive> observers)
        {
            Telegram telegram = new Telegram()
            {
                Msg         = msg,
                IsNotifyAll = false,
                Observers   = observers
            };

            this.msgQueue.Enqueue(telegram);
        }
示例#7
0
 public void HandleMsg(CmdMsgType msgType)
 {
     if (this.currentCommand != null)
     {
         //this.State = ActiveItemState.Busy;
         this.currentCommand.HandleMsg(msgType);
     }
     else
     {
         //this.State = ActiveItemState.Idel;
     }
 }
示例#8
0
        public override void HandleMsg(CmdMsgType msgType)
        {
            if (this.State == CommandState.Failed)
            {
                return;
            }

            switch (msgType)
            {
            case CmdMsgType.Stop:
                this.State = CommandState.Succeed;
                this.MoveSmoothStop();
                break;

            default:
                break;
            }
        }
示例#9
0
        public void HandleMsg(CmdMsgType msgType)
        {
            if (this.State == CommandState.Failed)
            {
                return;
            }

            switch (msgType)
            {
            case CmdMsgType.Pause:
                break;

            case CmdMsgType.Resume:
                break;

            case CmdMsgType.Stop:
                break;

            case CmdMsgType.Flag:
                this.flag = true;
                break;
            }
        }
示例#10
0
 public abstract void HandleMsg(CmdMsgType msgType);
示例#11
0
 public void HandleMsg(CmdMsgType msgType)
 {
 }
示例#12
0
 public override void HandleMsg(CmdMsgType msgType)
 {
 }