Esempio n. 1
0
            internal CanMessage UnpackCanMessage(BinaryReader br)
            {
                UInt32 cob = br.ReadUInt32();
                UInt16 tim = br.ReadUInt16();
                byte   src = br.ReadByte();
                byte   rs1 = br.ReadByte(); /* zero */

                byte[] d    = br.ReadBytes(8);
                byte   dlen = br.ReadByte();

                byte[] p = br.ReadBytes(7); /* PAD */
                UInt64 t = br.ReadUInt64();


                Array.Resize(ref d, dlen);

                return(new CanMessage(
                           CanSourceId.Source(_BoardID, (byte)((src & 7) - 1)),
                           CanMailboxId.Mailbox((src & 0x08) != 0, (byte)(src >> 4)),
                           cob, d)
                {
                    Time = tim,
                    Sec = (UInt32)(long)(t / (1000 * 1000)),
                    Usec = (UInt32)((long)(t % (1000 * 1000)))
                });
            }
Esempio n. 2
0
 public CanMessage(CanSourceId src, CanMailboxId mbox, CanObjectId cob, byte[] data)
 {
     Source  = src;
     Mailbox = mbox;
     COB     = cob;
     Data    = data;
 }
Esempio n. 3
0
 public CanMessage(CanSourceId src, CanMailboxId mbox, CanObjectId cob, byte[] data)
 {
     Source = src;
     Mailbox = mbox;
     COB = cob;
     Data = data;
 }
Esempio n. 4
0
 public static void RegisterBoard(byte id, object board, int numsources)
 {
     Boards.TryAdd(id, board);
     for (byte i = 0; i < numsources; i++)
     {
         CanSharkCore.Sources.Add(CanSourceId.Source(id, i));
     }
 }
Esempio n. 5
0
        private void button3_Click(object sender, EventArgs e)
        {
            Random r = new Random();

            CanSharkCore.InputQueue.Enqueue(
                new CanMessage(
                    CanSourceId.Source(0, 0),
                    CanMailboxId.Mailbox(true, 0x00),
                    CanObjectId.Std(0x80))
            {
                Time = 0,
                Usec = 0
            });

            CanSharkCore.InputQueue.Enqueue(
                new CanMessage(
                    CanSourceId.Source(0, 1),
                    CanMailboxId.Mailbox(true, 0x00),
                    CanObjectId.Std(0x80))
            {
                Time = 0,
                Usec = 0
            });

            for (int i = 0; i < 10000; i++)
            {
                uint id = (uint)r.Next(0x800);
                while (id == 0x80)
                {
                    id = (uint)r.Next(0x800);
                }

                CanSharkCore.InputQueue.Enqueue(
                    new CanMessage(
                        CanSourceId.Source(0, (byte)(i % 2)),
                        CanMailboxId.Mailbox(false, 0x00),
                        CanObjectId.Std(id))
                {
                    Time = (ushort)(i * 44),
                    Usec = (ushort)((i * 44) % 1000000),
                    Sec  = (ushort)((i * 44) / 1000000)
                });
            }
        }
Esempio n. 6
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            CanSharkCore.DataSources.Add(new EthBoard());

            CanSharkCore.Analyzers.Add(Cycle);
            CanSharkCore.Analyzers.Add(HistogramData);
            CanSharkCore.Analyzers.Add(PortStats);
            CanSharkCore.Analyzers.Add(MessageLog);

            frameStatistics1.SetSource(PortStats, CanSourceId.Source(0, 0));
            frameStatistics2.SetSource(PortStats, CanSourceId.Source(0, 1));

            frameCanopenCycleLog1.SetSource(Cycle, CanSourceId.Source(0, 0));
            frameCanopenCycleLog2.SetSource(Cycle, CanSourceId.Source(0, 1));

            frameMessageMatrix1.SetSource(HistogramData, CanSourceId.Source(0, 0));
            frameMessageMatrix2.SetSource(HistogramData, CanSourceId.Source(0, 1));

            frameMessages1.SetSource(MessageLog, CanSourceId.Source(0, 0));
            frameMessages2.SetSource(MessageLog, CanSourceId.Source(0, 1));
        }
Esempio n. 7
0
 public void SetSource(AnalyseMessageLog stats, CanSourceId id)
 {
     _Source = id;
     _Stats  = stats;
 }
Esempio n. 8
0
 public void SetSource(PortStatistics stats, CanSourceId id)
 {
     _Source = id;
     _Stats = stats;
 }
Esempio n. 9
0
 public CanMessage(CanSourceId src, CanMailboxId mbox, CanObjectId cob)
 {
     Source = src;
     Mailbox = mbox;
     COB = cob;
 }
Esempio n. 10
0
 public void SetSource(PortStatistics stats, CanSourceId id)
 {
     _Source = id;
     _Stats  = stats;
 }
Esempio n. 11
0
 internal void SetSource(CanBusHistogram data, CanSourceId src)
 {
     _Stats  = data;
     _Source = src;
 }
Esempio n. 12
0
 public void SetSource(CanopenCycle stats, CanSourceId id)
 {
     _Source = id;
     _Stats = stats;
 }
Esempio n. 13
0
 internal void SetSource(CanBusHistogram data, CanSourceId src)
 {
     _Stats = data;
     _Source = src;
 }
Esempio n. 14
0
 public CanMessage(CanSourceId src, CanMailboxId mbox, CanObjectId cob)
 {
     Source  = src;
     Mailbox = mbox;
     COB     = cob;
 }
Esempio n. 15
0
 public void SetSource(AnalyseMessageLog stats, CanSourceId id)
 {
     _Source = id;
     _Stats = stats;
 }
Esempio n. 16
0
 public void SetSource(CanopenCycle stats, CanSourceId id)
 {
     _Source = id;
     _Stats  = stats;
 }