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; }
public void InstallAmbientLight(SensorPlot plot) { Install(plot); _updaters.Add(() => { var light = _light.CurrentLight; plot.AddValues(light); }); }
public void InstallInclinometer(SensorPlot plot) { Install(plot); _updaters.Add(() => { var inc = _inclinometer.CurrentGradient; plot.AddValues(inc.Pitch, inc.Roll, inc.Yaw); }); }
public void InstallGyrometer(SensorPlot plot) { Install(plot); _updaters.Add(() => { var gyro = _gyrometer.CurrentAngularVelocity; plot.AddValues(gyro.X, gyro.Y, gyro.Z); }); }
public void InstallAccelerometer(SensorPlot plot) { Install(plot); _updaters.Add(() => { var acc = _accelerometer.CurrentAcceleration; plot.AddValues(acc.X, acc.Y, acc.Z); }); }
public void InstallCompass(SensorPlot plot) { Install(plot); _updaters.Add(() => { var comp = _compass.CurrentHeading; plot.AddValues(comp.Magnetic); }); }
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; }; }