Inheritance: IGyrometerReadingChangedEventArgs
コード例 #1
0
 void gyrometer_ReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             gyrometerReading = args.Reading;
             ShowData();
         });
 }
コード例 #2
0
        private async void GyrometerOnReadingChanged(Sensor.Gyrometer sender, Sensor.GyrometerReadingChangedEventArgs args)
        {
            await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                XAxisReading = args.Reading.AngularVelocityX;
                YAxisReading = args.Reading.AngularVelocityY;
                ZAxisReading = args.Reading.AngularVelocityZ;

                SetupNewLocation();
            });
        }
コード例 #3
0
        private void ReadingChanged(object sender, Sensors.GyrometerReadingChangedEventArgs e)
        {
            Sensors.GyrometerReading reading = e.Reading;

            this.SendEvent("Gyroscope", new RNSensorsJsonObject
            {
                X         = reading.AngularVelocityX,
                Y         = reading.AngularVelocityY,
                Z         = reading.AngularVelocityZ,
                Timestamp = reading.Timestamp
            }.ToJObject());
        }
コード例 #4
0
        async void gyrometer_ReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args)
        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                XValue.Text = args.Reading.AngularVelocityX.ToString();
                YValue.Text = args.Reading.AngularVelocityY.ToString();
                ZValue.Text = args.Reading.AngularVelocityZ.ToString();
                TimeStamp.Text = args.Reading.Timestamp.ToString();

                xLine.X2 = xLine.X1 + args.Reading.AngularVelocityX * 200;
                yLine.Y2 = yLine.Y1 - args.Reading.AngularVelocityY * 200;
                zLine.X2 = zLine.X1 - args.Reading.AngularVelocityZ * 100;
                zLine.Y2 = zLine.Y1 + args.Reading.AngularVelocityZ * 100;
            });
        }
コード例 #5
0
        private void ReadingChanged(object sender, Sensors.GyrometerReadingChangedEventArgs e)
        {
            Sensors.GyrometerReading reading = e.Reading;

            if (_lastReading.AddMilliseconds(interval) <= reading.Timestamp)
            {
                _lastReading = reading.Timestamp;

                this.SendEvent("Gyroscope", new RNSensorsJsonObject
                {
                    X         = reading.AngularVelocityX,
                    Y         = reading.AngularVelocityY,
                    Z         = reading.AngularVelocityZ,
                    Timestamp = reading.Timestamp
                }.ToJObject());
            }
        }
 /// <summary>
 /// This is the event handler for ReadingChanged events.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 async private void ReadingChanged(object sender, GyrometerReadingChangedEventArgs e)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         GyrometerReading reading = e.Reading;
         ScenarioOutput_X.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX);
         ScenarioOutput_Y.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY);
         ScenarioOutput_Z.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ);
     });
 }
コード例 #7
0
ファイル: Gyrometer.cs プロジェクト: FlorianRappl/YAMP
        void OnReadingChanged(Sensor sender, GyrometerReadingChangedEventArgs args)
        {
            var handler = changed;

            if (handler != null)
            {
                var value = ConvertToVector(args.Reading);
                var e = new GyrometerEventArgs(value);
                handler.Invoke(this, e);
            }
        }
コード例 #8
0
 async void MainPage_ReadingChanged( Gyrometer sender, GyrometerReadingChangedEventArgs args )
 {
     await Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () =>
     {
         TextGyrometer.Text = string.Format( @"Gyrometer : X={0} Y={1} Z={2}",
             args.Reading.AngularVelocityX.ToString(),
             args.Reading.AngularVelocityY.ToString(),
             args.Reading.AngularVelocityZ.ToString() );
     } );
 }
コード例 #9
0
 /// <summary>
 /// Gyroscope reading has changed.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The gyroscope event arguments.</param>
 private void GyroscopeReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args)
 {
     LatestReading = args.Reading.AsVector3();
     readingAvailable.Invoke(this, this.LatestReading);
 }
コード例 #10
0
        void GyrometerReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args)
        {
            if (SensorValueChanged != null)
                SensorValueChanged(this, new SensorValueChangedEventArgs { ValueType= MotionSensorValueType.Vector, SensorType = MotionSensorType.Gyroscope, Value = new MotionVector() { X = args.Reading.AngularVelocityX, Y = args.Reading.AngularVelocityY, Z = args.Reading.AngularVelocityZ } });

        }
コード例 #11
0
 public void myGyroHandler(Gyrometer g, GyrometerReadingChangedEventArgs e)
 {
     Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
         () =>
         {
             this.value_gyro_x.Text = e.Reading.AngularVelocityX.ToString("0.00");
             this.gyroX = e.Reading.AngularVelocityX;
             this.value_gyro_y.Text = e.Reading.AngularVelocityY.ToString("0.00");
             this.gyroY = e.Reading.AngularVelocityY;
             this.value_gyro_z.Text = e.Reading.AngularVelocityZ.ToString("0.00");
             this.gyroZ = e.Reading.AngularVelocityZ;
             checkTimeToLog();
         }
     );
 }
コード例 #12
0
ファイル: MainPage.xaml.cs プロジェクト: Agies/Whimsy
 private void OnGyroReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args)
 {
 }
コード例 #13
0
 private void GyrometerReadingChanged(Gyrometer gyrometer, GyrometerReadingChangedEventArgs args)
 {
     if (_measurementData != null)
         _measurementData.AddGyrometerReading(args.Reading);
 }