Example #1
0
        private void RotationVector_DataUpdated(object sender, RotationVectorSensorDataUpdatedEventArgs e)
        {
            Model.X = e.X;
            Model.Y = e.Y;
            Model.Z = e.Z;
            Model.W = e.W;

            long ticks = DateTime.UtcNow.Ticks;

            foreach (var serie in canvas.Series)
            {
                switch (serie.Name)
                {
                case "X":
                    serie.Points.Add(new Extensions.Point()
                    {
                        Ticks = ticks, Value = e.X
                    });
                    break;

                case "Y":
                    serie.Points.Add(new Extensions.Point()
                    {
                        Ticks = ticks, Value = e.Y
                    });
                    break;

                case "Z":
                    serie.Points.Add(new Extensions.Point()
                    {
                        Ticks = ticks, Value = e.Z
                    });
                    break;

                case "W":
                    serie.Points.Add(new Extensions.Point()
                    {
                        Ticks = ticks, Value = e.W
                    });
                    break;
                }
            }
            canvas.InvalidateSurface();
        }
Example #2
0
 void DataUpdated(object sender, RotationVectorSensorDataUpdatedEventArgs e)
 {
     RaiseReadingChanged(new OrientationSensorData(e.X, e.Y, e.Z, e.W));
 }