当前位置: 首页>>代码示例>>C#>>正文


C# SensorReadingEventArgs类代码示例

本文整理汇总了C#中SensorReadingEventArgs的典型用法代码示例。如果您正苦于以下问题:C# SensorReadingEventArgs类的具体用法?C# SensorReadingEventArgs怎么用?C# SensorReadingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SensorReadingEventArgs类属于命名空间,在下文中一共展示了SensorReadingEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: accelerometer_CurrentValueChanged

 void accelerometer_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)
 {
     AddJOValue("accX", e.SensorReading.Acceleration.X);
     AddJOValue("accY", e.SensorReading.Acceleration.Y);
     AddJOValue("accZ", e.SensorReading.Acceleration.Z);
     AddJOValue("timestamp", DeviceTools.GetUnixTime());
 }
开发者ID:WinToosa,项目名称:mobilelogger,代码行数:7,代码来源:AccelHandler.cs

示例2: gyroscope_CurrentValueChanged

 /// <summary>
 /// Get the current rotation rate. This value is in radians per second.
 /// </summary>
 /// <returns>The MainViewModel object.</returns>
 void gyroscope_CurrentValueChanged(object sender, SensorReadingEventArgs<GyroscopeReading> e)
 {
     AddJOValue("currentRotationRateX", e.SensorReading.RotationRate.X);
     AddJOValue("currentRotationRateY", e.SensorReading.RotationRate.Y);
     AddJOValue("currentRotationRateZ", e.SensorReading.RotationRate.Z);
     AddJOValue("timestamp", DeviceTools.GetUnixTime());
 }
开发者ID:WinToosa,项目名称:mobilelogger,代码行数:11,代码来源:GyroHandler.cs

示例3: AccelerometerOnCurrentValueChanged

		/// <summary>
		/// Accelerometers the on current value changed.
		/// </summary>
		/// <param name="sender">The sender.</param>
		/// <param name="sensorReadingEventArgs">The sensor reading event arguments.</param>
		private void AccelerometerOnCurrentValueChanged(
			object sender,
			SensorReadingEventArgs<AccelerometerReading> sensorReadingEventArgs)
		{
			LatestReading = sensorReadingEventArgs.SensorReading.Acceleration.AsVector3();
			readingAvailable.Invoke(sender, LatestReading);
		}
开发者ID:Jaskomal,项目名称:Xamarin-Forms-Labs,代码行数:12,代码来源:Accelerometer.cs

示例4: acc_CurrentValueChanged

        void acc_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)
        {
            //Dispatcher.BeginInvoke(() => UpdateUI(e.SensorReading));
           AccelerometerReading t =e.SensorReading;
            Vector3 a=t.Acceleration;
            if (Math.Abs(a.X) < Math.Abs(this.currentThreshold)) return;

            if (a.X * this.currentThreshold > 0)
            {
                this.accQuicklyForwardTime = t.Timestamp;
            }
            else if(t.Timestamp - this.accQuicklyForwardTime < TimeSpan.FromSeconds(.2))
            {
                this.accQuicklyForwardTime = DateTimeOffset.MinValue;
                this.Dispatcher.BeginInvoke(delegate()
                {
                    switch (this.random.Next(0, 4))
                    {
                        case 0: SoundEffects.Punch1.Play(); break;
                        case 1: SoundEffects.Punch2.Play(); break;
                        case 2: SoundEffects.Punch3.Play(); break;
                        case 3: SoundEffects.Punch4.Play(); break;
                    }

                    switch (this.random.Next(0, 10))
                    {
                        case 0: SoundEffects.Grunt1.Play(); break;
                        case 1: SoundEffects.Grunt2.Play(); break;
                        case 2: SoundEffects.Grunt3.Play(); break;
                    }
                });
            }
        }
开发者ID:1e0heen9,项目名称:wp7demo101,代码行数:33,代码来源:MainPage.xaml.cs

示例5: ReadingChanged

        private void ReadingChanged(SensorReadingEventArgs<AccelerometerReading> e)
        {
            Vector3 currentReading = e.SensorReading.Acceleration;

            double distanceTraveled = 2;
            double boundingBoxStrokeThickness = boundingBox.StrokeThickness;
            double rightBumper = ContentGrid.Width - ball.Width - boundingBoxStrokeThickness; // right margin is 0
            double leftBumper = ContentGrid.Margin.Left + boundingBoxStrokeThickness; // left margin is non-zero
            double bottomBumper = ContentGrid.Height - ball.Height - boundingBoxStrokeThickness;
            double topBumper = ContentGrid.Margin.Top + boundingBoxStrokeThickness;

            double acceleration = Math.Abs(currentReading.Z) == 0 ? 0.02 : Math.Abs(currentReading.Z);
              //  acceleration = (acceleration * 2)%2;
            Debug.WriteLine("Accel" + acceleration);
            double ballX = (double)ball.GetValue(Canvas.LeftProperty) +(double)distanceTraveled * (currentReading.X / acceleration);
            double ballY = (double)ball.GetValue(Canvas.TopProperty) - (double)distanceTraveled * (currentReading.Y / acceleration);

            if (ballX < leftBumper) {
                ballX = leftBumper;
            }

            else if (ballX > rightBumper) {
                ballX = rightBumper;
            }

            if (ballY < topBumper) {
                ballY = topBumper;
            }
            else if (ballY > bottomBumper) {
                ballY = bottomBumper;
            }

            ball.SetValue(Canvas.LeftProperty, ballX);
            ball.SetValue(Canvas.TopProperty, ballY);
        }
开发者ID:huynguyen1412,项目名称:Phone,代码行数:35,代码来源:MainPage.xaml.cs

示例6: gyro_CurrentValueChanged

 void gyro_CurrentValueChanged(object sender, SensorReadingEventArgs<GyroscopeReading> e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         txtRotRate.Text = string.Format("{0},{1},{2}", e.SensorReading.RotationRate.X, e.SensorReading.RotationRate.Y, e.SensorReading.RotationRate.Z);
         txtTimestamp.Text = e.SensorReading.Timestamp.ToString();
     });
 }
开发者ID:usmanghani,项目名称:Mars.WinFo,代码行数:8,代码来源:GyroPage.xaml.cs

示例7: gyroscope_CurrentValueChanged

 void gyroscope_CurrentValueChanged(object sender, SensorReadingEventArgs<GyroscopeReading> e)
 {
     var reading = e.SensorReading;
     var rate = reading.RotationRate;
     this.readingAvailable.Invoke<GyroReading>(
         sender, 
         new GyroReading(reading.Timestamp, rate.X, rate.Y, rate.Z));
 }
开发者ID:paul33868,项目名称:SimplyMobile,代码行数:8,代码来源:Gyroscope.cs

示例8: GyroscopeCurrentValueChanged

		/// <summary>
		/// Gyroscopes the current value changed.
		/// </summary>
		/// <param name="sender">The sender.</param>
		/// <param name="e">The e.</param>
		private void GyroscopeCurrentValueChanged(object sender, SensorReadingEventArgs<GyroscopeReading> e)
		{
			if (_gyroscope.IsDataValid)
			{
				LatestReading = e.SensorReading.RotationRate.AsVector3();
				readingAvailable.Invoke(this, this.LatestReading);
			}
		}
开发者ID:robertohuertasm,项目名称:Xamarin-Forms-Labs,代码行数:13,代码来源:Gyroscope.cs

示例9: LeerEstado

 private void LeerEstado(object sender, SensorReadingEventArgs<AccelerometerReading> e) {
     Dispatcher.BeginInvoke(() =>
         {
             txbox_x.Text = e.SensorReading.Acceleration.X.ToString();
             txbox_y.Text = e.SensorReading.Acceleration.Y.ToString();
             txbox_z.Text = e.SensorReading.Acceleration.Z.ToString();
         });
 }
开发者ID:CharlsOliver,项目名称:Windows-Phone-Intermedio,代码行数:8,代码来源:MainPage.xaml.cs

示例10: motion_CurrentValueChanged

 public void motion_CurrentValueChanged(object sender, SensorReadingEventArgs<MotionReading> e)
 {
     if (motion.IsDataValid)
     {
         values[0] = e.SensorReading.Attitude.Yaw;
         values[1] = e.SensorReading.Attitude.Pitch;
         values[2] = e.SensorReading.Attitude.Roll;
     }
 }
开发者ID:ZENG-Yuhao,项目名称:Xamarin-CrossPlatform,代码行数:9,代码来源:PhoneOrientation.cs

示例11: GyroscopeCurrentValueChanged

 void GyroscopeCurrentValueChanged(object sender, SensorReadingEventArgs<GyroscopeReading> e)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             tbXCoordinate.Text = e.SensorReading.RotationRate.X.ToString();
             tbYCoordinate.Text = e.SensorReading.RotationRate.Y.ToString();
             tbZCoordinate.Text = e.SensorReading.RotationRate.Z.ToString();
         });
 }
开发者ID:SonLamUIT,项目名称:WPSamples,代码行数:9,代码来源:GyroscopeSamplePage.xaml.cs

示例12: _compass_CurrentValueChanged

        void _compass_CurrentValueChanged(object sender, SensorReadingEventArgs<CompassReading> e)
        {
            lock (_locker)
              {

            _trueHeading = e.SensorReading.TrueHeading.ToString();
            Monitor.Pulse(_locker);
              }
        }
开发者ID:rsatter,项目名称:MonoCross,代码行数:9,代码来源:GpsAccess.cs

示例13: AccelerometerOnCurrentValueChanged

 private static void AccelerometerOnCurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> sensorReadingEventArgs)
 {
     if (readingAvailable != null)
     {
         var ac = sensorReadingEventArgs.SensorReading.Acceleration;
         readingAvailable.Invoke(
             accelerometer, 
             new AccelometerStatus(ac.X, ac.Y, ac.Z));
     }
 }
开发者ID:paul33868,项目名称:SimplyMobile,代码行数:10,代码来源:Accelometer.cs

示例14: compass_CurrentValueChanged

 void compass_CurrentValueChanged(object sender, SensorReadingEventArgs<CompassReading> e)
 {
     AddJOValue("trueHeading", e.SensorReading.TrueHeading);
     AddJOValue("magneticHeading", e.SensorReading.MagneticHeading);
     AddJOValue("headingAccuracy", e.SensorReading.HeadingAccuracy);
     AddJOValue("rawMagneticReadingX", e.SensorReading.MagnetometerReading.X);
     AddJOValue("rawMagneticReadingY", e.SensorReading.MagnetometerReading.Y);
     AddJOValue("rawMagneticReadingZ", e.SensorReading.MagnetometerReading.Z);
     AddJOValue("timestamp", DeviceTools.GetUnixTime());
 }
开发者ID:WinToosa,项目名称:mobilelogger,代码行数:10,代码来源:CompassHandler.cs

示例15: _accelerometer_CurrentValueChanged

 private void _accelerometer_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)
 {
     lock (_locker)
       {
     _xyz = string.Format("{0:0.00}, {1:0.00}, {2:0.00}", e.SensorReading.Acceleration.X,
                                                                  e.SensorReading.Acceleration.Y,
                                                                     e.SensorReading.Acceleration.Z);
     Monitor.Pulse(_locker);
       }
 }
开发者ID:rsatter,项目名称:MonoCross,代码行数:10,代码来源:AccelerometerAccess.cs


注:本文中的SensorReadingEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。