Ejemplo n.º 1
0
 private void SendMissed(CheckHandle handle)
 {
     MessageServices.EnableSkipsQueue(() =>
     {
         handle.Message.SendIn(this.BotBits);
     });
 }
Ejemplo n.º 2
0
        private void OnSendPlace(SentEvent <PlaceSendMessage> e)
        {
            var b = e.Message;
            var p = GetPoint3D(b);

            lock (this._sentBlocks)
            {
                this._timeoutResetEvent.Set();
                this._finishResetEvent.Reset();

                var         overwrritenSends = 0;
                CheckHandle oldHandle;
                if (this._sentLocations.TryGetValue(p, out oldHandle))
                {
                    this._sentBlocks.Remove(oldHandle);
                    overwrritenSends = oldHandle.OverwrittenSends + 1;
                }

                var newHandle = new CheckHandle(b, overwrritenSends);
                this._sentBlocks.AddToBack(newHandle);
                this._sentLocations[p] = newHandle;
            }

            this.RemoveFromSendQueue(e.Message);
        }
Ejemplo n.º 3
0
        private void SendMissed(CheckHandle handle)
        {
            if (this._disabled)
            {
                return;
            }

            MessageServices.WithSkipsQueue(() => { handle.Message.SendIn(this.BotBits); });
        }
Ejemplo n.º 4
0
        public void BackCheck(OnOffBtn btn, byte[] sendbyte, string type)
        {
            bool ack = false;

            try
            {
                CheckHandle  ch = new CheckHandle(this.Foo);
                IAsyncResult ar = ch.BeginInvoke(sendbyte, type, null, ch);
                ack = ch.EndInvoke(ar);
            }
            catch
            {
                ack = false;
            }
            finally
            {
                if (!ack)
                {
                    btn.isCheck = !btn.isCheck;
                    btn.Invalidate();

                    /*if (btn.Checked == true)
                     * {
                     *  method.ctrChanged(, "1");
                     * }
                     * if (btn.Checked == false)
                     * {
                     *  method.ctrChanged(1, "0");
                     * }*/
                    //此处不恢复原来的控制,以便于在配置信号处的使用
                    MessageBox.Show("信号下发失败!");
                    //this.richTextBox3.Text = this.richTextBox3.Text + Environment.NewLine +
                    //DateTime.Now.ToLocalTime().ToString() + " 信号下发失败";
                }
            }
        }
Ejemplo n.º 5
0
 public void RemoveCheckHandle(CheckHandle checkHandle)
 {
     m_CheckHandle -= checkHandle;
 }
Ejemplo n.º 6
0
 public void AddCheckHandle(CheckHandle checkHandle)
 {
     //m_CheckHandle -= checkHandle;
     m_CheckHandle += checkHandle;
 }