Exemplo n.º 1
0
 public virtual void SetCreate(ref ECMsg m, int gquant, uint rawdata)
 {
     if (m.K.Item.Num == myK.Item.Num)
     {
         myEmb.SetCreate(ref m, gquant, rawdata);
     }
 }
Exemplo n.º 2
0
 public virtual void GetCreate(ref ECMsg m, int gquant)
 {
     if (m.K.Item.Num == myK.Item.Num)
     {
         myEmb.GetCreate(ref m, gquant);
     }
 }
Exemplo n.º 3
0
 public virtual void GetCreate(ref ECMsg m)
 {
     if (m.K.Item.Num == myK.Item.Num)
     {
         myEmb.GetCreate(ref m);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Set in a ECMsg to a specific index.
 /// </summary>
 public void SetIn(ref ECMsg aecmsg, int at)
 {
     if ((myECMsgs != null) && (at <= (myECMsgs.Length - 1)))
     {
         myIdx = at;
         SetIn(ref aecmsg);
     }
 }
Exemplo n.º 5
0
 public override void SetCreate(ref ECMsg m, int gquant, uint rawdata)
 {
     m.SetUp('S', 6, 1);
     m.ReqMsg[0] = 4;                                             // length
     Msger.AddGroup(m.K.Group.Num, out m.ReqMsg[1], out m.ReqMsg[2]);
     Msger.AddData(myItem.Num, out m.ReqMsg[3], out m.ReqMsg[4]); // Opcode is myItem.Num
     m.ReqMsg[5]  = Msger.Chksum(m.ReqMsg);
     m.RplyMsg[0] = 0;                                            // clear reply for safety
 }
 public override void GetCreate(ref ECMsg m, int gquant)
 {
     m.SetUp('G', 10, 1 + (gquant * 14));
     m.ReqMsg[0] = 8;                                             // length
     Msger.AddGroup(m.K.Group.Num, out m.ReqMsg[1], out m.ReqMsg[2]);
     Msger.AddData(0xB005, out m.ReqMsg[3], out m.ReqMsg[4]);     // Opcode
     Msger.AddHost(myAxis, out m.ReqMsg[5], out m.ReqMsg[6]);     // host/relay axis
     Msger.AddData(myItem.Num, out m.ReqMsg[7], out m.ReqMsg[8]); // Address is myItem.Num
     m.ReqMsg[9]  = Msger.Chksum(m.ReqMsg);
     m.RplyMsg[0] = 0;                                            // clear reply for safety
 }
 public override void SetCreate(ref ECMsg m, int gquant, uint rawdata)
 {
     m.SetUp('S', 12, 1);
     m.ReqMsg[0] = 10;                                            // length
     Msger.AddGroup(m.K.Group.Num, out m.ReqMsg[1], out m.ReqMsg[2]);
     Msger.AddData(0x9005, out m.ReqMsg[3], out m.ReqMsg[4]);     // Opcode
     Msger.AddData(myItem.Num, out m.ReqMsg[5], out m.ReqMsg[6]); // Address is myItem.Num
     Msger.AddData(rawdata, out m.ReqMsg[9], out m.ReqMsg[10], out m.ReqMsg[7], out m.ReqMsg[8]);
     m.ReqMsg[11] = Msger.Chksum(m.ReqMsg);
     m.RplyMsg[0] = 0;  // clear reply for safety
 }
Exemplo n.º 8
0
 /// <summary>
 /// Set in a ECMsg whereever the hell the index is.
 /// </summary>
 public void SetIn(ref ECMsg aecmsg)
 {
     if (myECMsgs != null)
     {
         myECMsgs [myIdx] = aecmsg;
         if (++myIdx >= myECMsgs.Length)
         {
             myIdx = 0;
         }
     }
 }
 public override void SetCreate(ref ECMsg m, uint rawdata)
 {
     m.SetUp('S', 10, 1);
     m.ReqMsg[0] = 8;                                             // length
     Msger.AddAxis(m.K.Axis.Num, out m.ReqMsg[1], out m.ReqMsg[2]);
     Msger.AddData(0x9004, out m.ReqMsg[3], out m.ReqMsg[4]);     // Opcode
     Msger.AddData(myItem.Num, out m.ReqMsg[5], out m.ReqMsg[6]); // Address is myItem.Num
     Msger.AddData(rawdata, out m.ReqMsg[7], out m.ReqMsg[8]);
     m.ReqMsg[9]  = Msger.Chksum(m.ReqMsg);
     m.RplyMsg[0] = 0;  // clear reply for safety
 }
Exemplo n.º 10
0
 public virtual void GetRawdata(ref ECMsg m, int offsetinrply, out uint rawdata)
 {
     if (m.K.Item.Num == myK.Item.Num)
     {
         myEmb.GetRawdata(ref m, offsetinrply, out rawdata);
     }
     else
     {
         rawdata = 0;
     }
 }
Exemplo n.º 11
0
        /// <summary>
        /// Get out the ECMsg at the index, updates index.
        /// </summary>
        public ECMsg GetOut(int at)
        {
            ECMsg r = null;

            if ((myECMsgs != null) && (at <= (myECMsgs.Length - 1)))
            {
                myIdx = at;
                r     = GetOut();
            }
            return(r);
        }
 /// <summary>
 /// If the port is open, restarts transactions and presents an req/rply message.
 /// </summary>
 /// <remarks>
 /// Note ordering; the dispatcher makes the choice on when to keep processing.
 /// </remarks>
 public void Enq(ECMsg m)
 {
     if ((_sp != null) || (_commPort2Use == "DemoMode"))
     {
         if (_transactTask.IsCompleted)
         {
             _transactTask = new Task(TransactTask);
             _transactTask.Start();
         }
         _in_q.Enqueue(m);
     }
 }
        private void Rx_TakUnsolCleanup()
        {
            // unsolicited goes around a few things and restarts
            // it has to build a new ECM message and output it
            // then back to servicing the original msg
            ECMsg m = new ECMsg(null);

            m.SetUp('U', 0, _xbf_i);  // indexs + 1 'cause there's 0x4F precursor...
            Array.Copy(_xbf, m.RplyMsg, m.RplyMsg.Length);
            m.Stat = _xbf_stat;
            _out_q.Enqueue(m);
            RxTakState = TakeDataState.Initial;
        }
Exemplo n.º 14
0
        /// <summary>
        /// Get out the next ECMsg, updates index.
        /// </summary>
        public ECMsg GetOut()
        {
            ECMsg r = null;

            if (myECMsgs != null)
            {
                r = myECMsgs[myIdx];
                if (++myIdx >= myECMsgs.Length)
                {
                    myIdx = 0;
                }
            }
            return(r);
        }
Exemplo n.º 15
0
 /// <summary>
 /// Get out multiple ECMsgs; silently wraps around.
 /// </summary>
 public ECMsg[] GetOut(int quant, int at)
 {
     ECMsg[] r = null;
     if ((myECMsgs != null) && (quant <= myECMsgs.Length) && (at <= (myECMsgs.Length - 1)))
     {
         r     = new ECMsg[quant];
         myIdx = at;
         for (int i = 0; i < quant; i++)
         {
             r[i] = GetOut();
         }
     }
     if ((myECMsgs != null) && (quant <= myECMsgs.Length))
     {
     }
     return(r);
 }
Exemplo n.º 16
0
 /// <summary>
 /// Get out ECMsgs.  May return less than quant; never wrapsaround.
 /// </summary>
 public ECMsg[] GetOut(int quant, int at, ref bool wouldwrap)
 {
     ECMsg[] r = null;
     wouldwrap = false;
     if ((myECMsgs != null) && (quant <= myECMsgs.Length) && (at <= (myECMsgs.Length - 1)))
     {
         r     = new ECMsg[quant];
         myIdx = at;
         for (int i = 0; (i < quant) && !wouldwrap; i++)
         {
             r [i] = GetOut();
             if (myIdx == 0)
             {
                 wouldwrap = true;
             }
         }
     }
     return(r);
 }
        /// <summary>
        /// If the port is open, remove an req/rply message and keep transactions going.
        /// </summary>
        /// <remarks>
        /// Note ordering; the dispatcher makes the choice on when to keep processing.
        /// </remarks>
        public bool TryDeq(out ECMsg m)
        {
            bool r;

            if ((_sp != null) || (_commPort2Use == "DemoMode"))
            {
                r = _out_q.TryDequeue(out m);
                if (_transactTask.IsCompleted)
                {
                    _transactTask = new Task(TransactTask);
                    _transactTask.Start();
                }
            }
            else
            {
                m = null;
                r = false;
            }
            return(r);
        }
 public override void GetRawdata(ref ECMsg m, int offsetinrply, out uint rawdata)
 {
     rawdata = Msger.RemData(m.RplyMsg[offsetinrply + 11], m.RplyMsg[offsetinrply + 12], m.RplyMsg[offsetinrply + 9], m.RplyMsg[offsetinrply + 10]);
 }
 public virtual void SetCreate(ref ECMsg m, int gquant, uint rawdata)
 {
     throw new Exception("Override expected.");
 }
 public virtual void GetCreate(ref ECMsg m, int gquant)
 {
     throw new Exception("Override expected.");
 }
 public virtual void GetRawdata(ref ECMsg m, int offsetinrply, out uint rawdata)
 {
     throw new Exception("Override expected.");
 }
Exemplo n.º 22
0
 public void Report(ECMsg m)
 {
     _eCTimeoutStore[m.K.Axis.Num].HadResult(m.Stat);
 }