Exemplo n.º 1
0
 public CanMessage(CanSourceId src, CanMailboxId mbox, CanObjectId cob, byte[] data)
 {
     Source  = src;
     Mailbox = mbox;
     COB     = cob;
     Data    = data;
 }
Exemplo n.º 2
0
 public CanMessage(CanSourceId src, CanMailboxId mbox, CanObjectId cob, byte[] data)
 {
     Source = src;
     Mailbox = mbox;
     COB = cob;
     Data = data;
 }
Exemplo n.º 3
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)
                });
            }
        }
Exemplo n.º 4
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            int Col = e.X / _CellSize.Width;
            int Row = e.Y / _CellSize.Height;

            bool        oldh  = MouseHovered;
            CanObjectId oldid = MouseHoveredId;

            MouseHovered = (Col < _Columns) && (Row < _Rows);

            if (MouseHovered)
            {
                MouseHoveredId = CanObjectId.Std((uint)(Row * _Columns + Col));
            }

            if (((oldid != MouseHoveredId) || (MouseHovered != oldh)) && (MouseHoveredOverId != null))
            {
                MouseHoveredOverId(this, EventArgs.Empty);
            }
        }
Exemplo n.º 5
0
 public CanMessage(CanSourceId src, CanMailboxId mbox, CanObjectId cob)
 {
     Source = src;
     Mailbox = mbox;
     COB = cob;
 }
Exemplo n.º 6
0
 public CanMessage(CanSourceId src, CanMailboxId mbox, CanObjectId cob)
 {
     Source  = src;
     Mailbox = mbox;
     COB     = cob;
 }
Exemplo n.º 7
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            int Col = e.X / _CellSize.Width;
            int Row = e.Y / _CellSize.Height;

            bool oldh = MouseHovered;
            CanObjectId oldid = MouseHoveredId;

            MouseHovered = (Col < _Columns) && (Row < _Rows);

            if (MouseHovered)
                MouseHoveredId = CanObjectId.Std((uint)(Row * _Columns + Col));

            if (((oldid != MouseHoveredId) || (MouseHovered != oldh)) && (MouseHoveredOverId != null))
                MouseHoveredOverId(this, EventArgs.Empty);
        }