Пример #1
0
        /// <summary>
        /// Raises the PacketReceived event.
        /// </summary>
        /// <param name="e">The <see cref="OutGaugeEventArgs"/> object containing the event data.</param>
        protected virtual void OnPacketReceived(OutGaugeEventArgs e)
        {
            EventHandler <OutGaugeEventArgs> temp = PacketReceived;

            if (temp != null)
            {
                temp(this, e);
            }
        }
Пример #2
0
 /// <summary>
 /// Raises the PacketReceived event.
 /// </summary>
 /// <param name="e">The <see cref="OutGaugeEventArgs"/> object containing the event data.</param>
 protected virtual void OnPacketReceived(OutGaugeEventArgs e) {
     EventHandler<OutGaugeEventArgs> temp = PacketReceived;
     if (temp != null) {
         temp(this, e);
     }
 }
Пример #3
0
        static void packetReceived(object sender, OutGaugeEventArgs e)
        {
            // Handle packet.

            float speed = e.Speed / 1000 * 3600;
            int gear = (int)e.Gear - 1;

            for (int i = 0; i < dataReceivers.Length; i++)
            {
                dataReceivers[i].setData(e.RPM, speed, gear);
            }
        }