예제 #1
0
 public void Set(SensorPlot plot, Boolean show, Int32 length)
 {
     plot.Length     = length;
     plot.Visibility = show ? Visibility.Visible : Visibility.Collapsed;
     plot.Maximized  = false;
     _grid.RowDefinitions[Grid.GetRow(plot)].Height = show ? RemainingHeight : ZeroHeight;
 }
예제 #2
0
 public void InstallAmbientLight(SensorPlot plot)
 {
     Install(plot);
     _updaters.Add(() =>
     {
         var light = _light.CurrentLight;
         plot.AddValues(light);
     });
 }
예제 #3
0
 public void InstallInclinometer(SensorPlot plot)
 {
     Install(plot);
     _updaters.Add(() =>
     {
         var inc = _inclinometer.CurrentGradient;
         plot.AddValues(inc.Pitch, inc.Roll, inc.Yaw);
     });
 }
예제 #4
0
 public void InstallGyrometer(SensorPlot plot)
 {
     Install(plot);
     _updaters.Add(() =>
     {
         var gyro = _gyrometer.CurrentAngularVelocity;
         plot.AddValues(gyro.X, gyro.Y, gyro.Z);
     });
 }
예제 #5
0
 public void InstallAccelerometer(SensorPlot plot)
 {
     Install(plot);
     _updaters.Add(() =>
     {
         var acc = _accelerometer.CurrentAcceleration;
         plot.AddValues(acc.X, acc.Y, acc.Z);
     });
 }
예제 #6
0
 public void InstallCompass(SensorPlot plot)
 {
     Install(plot);
     _updaters.Add(() =>
     {
         var comp = _compass.CurrentHeading;
         plot.AddValues(comp.Magnetic);
     });
 }
예제 #7
0
        void Install(SensorPlot plot)
        {
            plot.PreviewMouseDown += (s, e) =>
            {
                var row = Grid.GetRow(plot);

                for (var i = 0; i < _grid.RowDefinitions.Count; i++)
                {
                    if (i != row)
                    {
                        var sensor = _grid.Children[i] as SensorPlot;

                        if (sensor != null && sensor.Visibility == System.Windows.Visibility.Visible)
                        {
                            var auto   = new GridLength(1.0, GridUnitType.Star);
                            var height = plot.Maximized ? auto : new GridLength(0.0);
                            _grid.RowDefinitions[i].Height = height;
                        }
                    }
                }

                plot.Maximized = !plot.Maximized;
            };
        }