Пример #1
0
 protected virtual void OnOutputChanged(x_IMU_API.DigitalPortBits e)
 {
     if (OutputChanged != null)
     {
         OutputChanged(this, e);
     }
 }
Пример #2
0
 /// <summary>
 /// Initialises a new instance of the Form_digitalIOpanel class.
 /// </summary>
 public Form_digitalIOpanel()
 {
     InitializeComponent();
     Direction                = new x_IMU_API.DigitalPortBits();
     State                    = new x_IMU_API.DigitalPortBits();
     formUpdateTimer          = new Timer();
     formUpdateTimer.Interval = 20;
     formUpdateTimer.Tick    += new EventHandler(formUpdateTimer_Tick);
 }
Пример #3
0
 /// <summary>
 /// Initialises a new instance of the Form_digitalIOpanel class.
 /// </summary>
 public Form_digitalIOpanel()
 {
     InitializeComponent();
     Direction = new x_IMU_API.DigitalPortBits();
     State = new x_IMU_API.DigitalPortBits();
     formUpdateTimer = new Timer();
     formUpdateTimer.Interval = 20;
     formUpdateTimer.Tick += new EventHandler(formUpdateTimer_Tick);
 }
 /// <summary>
 /// DigitalIODataReceived to set mouse button states.
 /// </summary>
 /// <remarks>
 /// Sets sampledCount to briefly disable cursor position updates after button down.
 /// </remarks>
 static void xIMUserial_DigitalIODataReceived(object sender, x_IMU_API.DigitalIOdata e)
 {
     if (prevState.AX1 ^ e.State.AX1)    // if left button state changed
     {
         if (e.State.AX1)
         {
             SendInputClass.MouseEvent((int)SendInputClass.MOUSEEVENTF.LEFTDOWN, 0, 0, 0);
             sampledCount = ((x_IMU_API.xIMUserial)sender).PacketsReadCounter.QuaternionDataPackets;
         }
         else
         {
             SendInputClass.MouseEvent((int)SendInputClass.MOUSEEVENTF.LEFTUP, 0, 0, 0);
         }
     }
     if (prevState.AX0 ^ e.State.AX0)    // if right button state changed
     {
         if (e.State.AX0)
         {
             SendInputClass.MouseEvent((int)SendInputClass.MOUSEEVENTF.RIGHTDOWN, 0, 0, 0);
             sampledCount = ((x_IMU_API.xIMUserial)sender).PacketsReadCounter.QuaternionDataPackets;
         }
         else
         {
             SendInputClass.MouseEvent((int)SendInputClass.MOUSEEVENTF.RIGHTUP, 0, 0, 0);
         }
     }
     prevState = e.State;
 }