Inheritance: IGyrometerReading
コード例 #1
0
 public GyrometerSample(GyrometerReading gyrometerReading, DateTimeOffset _startDateTime)
 {
     this.MeasurementTime = gyrometerReading.Timestamp.Subtract(_startDateTime);
     this.VelocityX = Convert.ToSingle(gyrometerReading.AngularVelocityX);
     this.VelocityY = Convert.ToSingle(gyrometerReading.AngularVelocityY);
     this.VelocityZ = Convert.ToSingle(gyrometerReading.AngularVelocityZ);
 }
コード例 #2
0
 void gyrometer_ReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             gyrometerReading = args.Reading;
             ShowData();
         });
 }
コード例 #3
0
ファイル: Gyrometer.cs プロジェクト: FlorianRappl/YAMP
 static Vector ConvertToVector(GyrometerReading reading)
 {
     return new Vector
     {
         X = reading.AngularVelocityX,
         Y = reading.AngularVelocityY,
         Z = reading.AngularVelocityZ
     };
 }
コード例 #4
0
 private void OnReadingChanged(GyrometerReading reading)
 {
     if (this.Log().IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug))
     {
         this.Log().DebugFormat($"Gyrometer reading received " +
                                $"X:{reading.AngularVelocityX}, Y:{reading.AngularVelocityY}, Z:{reading.AngularVelocityZ}");
     }
     _readingChanged?.Invoke(this, new GyrometerReadingChangedEventArgs(reading));
 }
コード例 #5
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());
        }
コード例 #6
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());
            }
        }
コード例 #7
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            try
            {
                gyrometer = Gyrometer.GetDefault();
                if (gyrometer == null)
                {
                    MessageBox.Show("不支持陀螺仪");
                    return;
                }

                gyrometer.ReportInterval = 1000;
                gyrometer.ReadingChanged += gyrometer_ReadingChanged;
                gyrometerReading = gyrometer.GetCurrentReading();
                ShowData();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }

        }
コード例 #8
0
 private void GyrometerReadingUpdated(GyrometerReading reading)
 {
    _gyroReading = reading;
    if (_state == GenerationState.Gathering)
    {
       SpeedX.Value = reading.AngularVelocityX;
       SpeedY.Value = reading.AngularVelocityY;
       SpeedZ.Value = reading.AngularVelocityZ;
    }
 }
コード例 #9
0
        protected override void Update(GameTime gameTime)
        {
            if (started)
            {
                keyboardState = keyboardManager.GetState();
                flushAddedAndRemovedGameObjects();

                accelerometerReading = input.accelerometer.GetCurrentReading();
                gyrometerReading = input.gyrometer.GetCurrentReading();

                camera.Update();
                for (int i = 0; i < gameObjects.Count; i++)
                {
                    gameObjects[i].Update(gameTime);
                }

                mainPage.UpdateScore(score);

                if (keyboardState.IsKeyDown(Keys.Escape))
                {
                    this.Exit();
                    this.Dispose();
                    App.Current.Exit();
                }
                // Handle base.Update
            }
            base.Update(gameTime);
        }
コード例 #10
0
ファイル: LogRecord.cs プロジェクト: swnhieian/Keyboard
 public void setGyrometerReading(GyrometerReading reading)
 {
     this.angularVelocity_x = reading.AngularVelocityX;
     this.angularVelocity_y = reading.AngularVelocityY;
     this.angularVelocity_z = reading.AngularVelocityZ;
 }
コード例 #11
0
        //################################################## Gyrometer ######################################################

        /// <summary>
        /// Adds a new gyrometer reading into the active gyrometer reading list.
        /// </summary>
        /// <param name="gyrometerReading"></param>
        public void AddGyrometerReading(GyrometerReading gyrometerReading)
        {
            if (gyrometerReading != null)
            {
                if (_startDateTime.CompareTo(DateTimeOffset.MinValue) == 0)
                {
                    _startDateTime = gyrometerReading.Timestamp;
                }
                this.AddGyrometerSample(new GyrometerSample(gyrometerReading, _startDateTime));
            }
        }