Пример #1
0
 private void Distance_Between_2positions_FormClosed(object sender, FormClosedEventArgs e)
 {
     FormProvider.getMain().Show();
 }
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(FormProvider.getMain());
 }
 private void GNSS_DataConversion_FormClosed(object sender, FormClosedEventArgs e)
 {
     FormProvider.getMain().Show();
 }
Пример #4
0
 private void IMU_Display_Click(object sender, EventArgs e)
 {
     this.Hide();
     FormProvider.getIMU_Display_Monitor().Show();
 }
Пример #5
0
 private void Two_Positions_Distance_Btn_Click(object sender, EventArgs e)
 {
     this.Hide();
     FormProvider.getDistance_Between_2Positions().Show();
 }
Пример #6
0
 private void GNSS_DataConversion_Btn_Click(object sender, EventArgs e)
 {
     this.Hide();
     FormProvider.getGNSS_DataConversion().Show();
 }
Пример #7
0
            // Non-static method
            public void sensorEventThread()
            {
                try
                {
                    while (true)
                    {
                        ZenEvent zenEvent = new ZenEvent();
                        //Console.WriteLine(mZenHandle);
                        if (OpenZen.ZenWaitForNextEvent(mZenHandle, zenEvent))
                        {
                            if (zenEvent.component.handle == 0)
                            {
                                // if the handle is on, its not a sensor event but a system wide
                                // event
                                switch (zenEvent.eventType)
                                {
                                case (int)ZenSensorEvent.ZenSensorEvent_SensorFound:
                                    Console.WriteLine("found sensor event event " + zenEvent.data.sensorFound.name);
                                    mFoundSensors.Add(zenEvent.data.sensorFound);
                                    break;

                                case (int)ZenSensorEvent.ZenSensorEvent_SensorListingProgress:
                                    if (zenEvent.data.sensorListingProgress.progress == 1.0)
                                    {
                                        mSearchDone = true;
                                    }
                                    break;
                                }
                            }
                            else
                            {
                                switch (zenEvent.eventType)
                                {
                                case (int)ZenImuEvent.ZenImuEvent_Sample:
                                    mImuEventCount++;

                                    if (mImuEventCount % 100 == 0)
                                    {
                                        continue;
                                    }
                                    // read acceleration
                                    OpenZenFloatArray fa = OpenZenFloatArray.frompointer(zenEvent.data.imuData.a);
                                    // read euler angles
                                    OpenZenFloatArray fg = OpenZenFloatArray.frompointer(zenEvent.data.imuData.g);
                                    // read quaternion
                                    OpenZenFloatArray fb = OpenZenFloatArray.frompointer(zenEvent.data.imuData.b);

                                    // Output Data
                                    IMU_Display_Monitor imu = FormProvider.getIMU_Display_Monitor();

                                    // Accelerometer
                                    imu.acx = fa.getitem(0);
                                    imu.acy = fa.getitem(1);
                                    imu.acz = fa.getitem(2);

                                    // Gyroscope
                                    imu.gyx = fg.getitem(0);
                                    imu.gyy = fg.getitem(1);
                                    imu.gyz = fg.getitem(2);

                                    // Magnetometer
                                    imu.mgx = fb.getitem(0);
                                    imu.mgy = fb.getitem(1);
                                    imu.mgz = fb.getitem(2);

                                    break;
                                }
                            }
                        }
                    }
                }
                catch (ThreadAbortException)
                {
                }
            }
Пример #8
0
 private void IMU_Display_Monitor_FormClosing(object sender, FormClosingEventArgs e)
 {
     thr.Abort();
     FormProvider.getMain().Show();
 }