Beispiel #1
0
        public void Analyze(CanMessage[] msgs)
        {
            foreach (CanMessage m in msgs)
            {
                Result result = Results.GetOrAdd(m.Source, x => new Result());

                if (m.COB.IdStd == 0x80)        // std ID 0x80 = SYNC
                {
                    result.oldsynctime = result.synctime;
                    result.synctime    = m.Time;
                }
                else
                if (result.CycleLog.Count == 0)           // make the cycle entire from the beginning
                {
                    return;
                }



                CanopenMsg msg = result.CycleLog.GetOrAdd(m.COB, x => new CanopenMsg()
                {
                    COB = x, count = 0
                });

                msg.data = BitConverter.ToString(m.Data);
                msg.count++;
                msg.delay  = TimeDiff(result.synctime, m.Time) / (2 * BitRate);
                msg.length = m.FrameLengthStuffed / BitRate;
                msg.IsTx   = m.Mailbox.IsTx;
            }
        }
Beispiel #2
0
        public void UpdateData(CanopenMsg[] data)
        {
            _Data = data;
            RowCount = _Data.Length;

            Invalidate();
        }