示例#1
0
 public MotionCalculator(xIMU xIMU)
 {
     this.xIMU  = xIMU;
     magnituide = new float();
     magnitudes = new float[] { 0, 0, 0, 0, 0 };
     Init();
 }
示例#2
0
        private void Connect_to_xIMUs()
        {
            xIMU_1 = new xIMU(portAssignment[0], 1, LowPassChecked.Checked);
            xIMU_2 = new xIMU(portAssignment[1], 2, LowPassChecked.Checked);
            xIMUs.Add(xIMU_1);
            xIMUs.Add(xIMU_2);

            Status ConnectionState1 = xIMU_1.Connect();

            if (ConnectionState1 == Status.Good)
            {
                ConStateLabel.Text = "Connected to x-IMU " + xIMU_1.ID + " on " + xIMU_1.PortAssignment.PortName + ".";
            }
            else
            {
                ConStateLabel.Text = "Connection failed!";
            }

            Status ConnectionState2 = xIMU_2.Connect();

            if (ConnectionState2 == Status.Good)
            {
                ConStateLabel2.Text = "Connected to x-IMU " + xIMU_2.ID + " on " + xIMU_2.PortAssignment.PortName + ".";
            }
            else
            {
                ConStateLabel2.Text = "Connection failed!";
            }

            if (ConnectionState1 == Status.Good && ConnectionState2 == Status.Good)
            {
                ButtonStart.Enabled = true;
                ButtonClose.Enabled = true;
                InitTabControl();
            }
            else
            {
                ButtonOpen.Enabled  = true;
                ButtonClose.Enabled = false;
            }



            _timerCounter = 0;
            _clearSeries  = false;
        }