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) }); } }
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); } }