• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SensorReadingEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ProcessAccelerometerReading

        private void ProcessAccelerometerReading(SensorReadingEventArgs<AccelerometerReading> e)
        {
            Vector3 reading = e.SensorReading.Acceleration;
            txtTime.Text = e.SensorReading.Timestamp.ToString();
            txtX.Text = reading.X.ToString();
            txtY.Text = reading.Y.ToString();
            txtZ.Text = reading.Z.ToString();

            ProcessPRY(e);
        }
开发者ID:huynguyen1412,项目名称:Phone,代码行数:10,代码来源:MainPage.xaml.cs


示例17: acc_CurrentValueChanged

        void acc_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)
        {
            // wordt uitgevoerd indien je beweegt met de phone

            Dispatcher.BeginInvoke(() =>
            {
                SliderX.Value = e.SensorReading.Acceleration.X;
                SliderY.Value = e.SensorReading.Acceleration.Y;
                SliderZ.Value = e.SensorReading.Acceleration.Z;
            });
        }
开发者ID:natsirt20,项目名称:School,代码行数:11,代码来源:Sensors.xaml.cs


示例18: accelerometer_CurrentValueChanged

        void accelerometer_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)
        {
            // Note that this event handler is called from a background thread
            // and therefore does not have access to the UI thread. To update
            // the UI from this handler, use Dispatcher.BeginInvoke() as shown.
            Dispatcher.BeginInvoke(() => { statusTextBlock.Text = "in CurrentValueChanged"; });

            isDataValid = accelerometer.IsDataValid;

            acceleration = e.SensorReading.Acceleration;
        }
开发者ID:atkiis,项目名称:pds2013,代码行数:11,代码来源:MotionCamera.xaml.cs


示例19: LeituraAcelerometro

 void LeituraAcelerometro(object sender, SensorReadingEventArgs<AccelerometerReading> e)
 {
     Vector3 acceleration = e.SensorReading.Acceleration;
     Dispatcher.BeginInvoke(() => {
         string x = acceleration.X.ToString("f");
         string y = acceleration.Y.ToString("f");
         string z = acceleration.Z.ToString("f");
  
         tb.Text = x +" " + y  + " "+ z;
     });
 }
开发者ID:rogeriofabricio,项目名称:XamarinCursoCross,代码行数:11,代码来源:MainPage.xaml.cs


示例20: acc_CurrentValueChanged

        protected void acc_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)
        {
            Vector3 a = e.SensorReading.Acceleration;
            Vector2 v = new Vector2();

            // 値を計算
            a.X *= 10;
            if (a.X > 0)
            {
                v.X = (a.X > 5 ? 5f : a.X);
            }
            else
            {
                v.X = (a.X > -5 ? -5f : a.X);
            }
            a.Y *= 10;
            if (a.Y > 0)
            {
                v.Y = (a.Y > 5 ? 5f : a.Y);
            }
            else
            {
                v.Y = (a.Y > -5 ? -5f : a.Y);
            }

            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                if (scene != SCENE.PLAY)
                {
                    return;
                }

                // 自機を移動
                flayer.pos.X += a.X;
                if (flayer.pos.X < 0)
                {
                    flayer.pos.X = graphics.PreferredBackBufferWidth;
                }
                else if (flayer.pos.X > graphics.PreferredBackBufferWidth)
                {
                    flayer.pos.X = 0;
                }
                flayer.pos.Y -= a.Y;
                if (flayer.pos.Y < 0)
                {
                    flayer.pos.Y = graphics.PreferredBackBufferHeight;
                }
                else if (flayer.pos.Y > graphics.PreferredBackBufferHeight)
                {
                    flayer.pos.Y = 0;
                }
            });
        }
开发者ID:roshi,项目名称:wpat2013,代码行数:53,代码来源:Game1.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SensorType类代码示例发布时间:2022-05-24
下一篇:
C# SensorData类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap