diff options
| -rw-r--r-- | grapher/Models/AccelGUI.cs | 6 | ||||
| -rw-r--r-- | grapher/Models/Charts/AccelCharts.cs | 6 | ||||
| -rw-r--r-- | grapher/Models/Charts/ChartXY.cs | 28 |
3 files changed, 29 insertions, 11 deletions
diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index c150393..3acb943 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -96,7 +96,6 @@ namespace grapher public void RefreshOnRead() { - AccelCharts.RefreshXY(Settings.RawAccelSettings.AccelerationSettings.combineMagnitudes); UpdateGraph(); UpdateShownActiveValues(); } @@ -112,7 +111,10 @@ namespace grapher public void UpdateShownActiveValues() { - ApplyOptions.SetActiveValues(Settings.RawAccelSettings.AccelerationSettings); + var settings = Settings.RawAccelSettings.AccelerationSettings; + + AccelCharts.ShowActive(settings); + ApplyOptions.SetActiveValues(settings); } private Timer SetupButtonTimer() diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 84673b8..3f228c3 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -1,5 +1,6 @@ using grapher.Models.Calculations; using grapher.Models.Charts; +using grapher.Models.Serialized; using System; using System.Drawing; using System.Windows.Forms; @@ -51,6 +52,7 @@ namespace grapher EnableLastValue.CheckedChanged += new System.EventHandler(OnEnableLastMouseMoveCheckStateChange); HideVelocityAndGain(); + SensitivityChart.Show(); Combined = false; ShowCombined(); } @@ -127,9 +129,9 @@ namespace grapher } } - public void RefreshXY(bool isWhole) + public void ShowActive(DriverSettings driverSettings) { - if (isWhole) + if (driverSettings.combineMagnitudes) { ShowCombined(); } diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 2037190..30be229 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -21,6 +21,9 @@ namespace grapher SetupChart(ChartX); SetupChart(ChartY); + Combined = false; + SetCombined(); + Widened = false; SetWidened(); } @@ -72,6 +75,8 @@ namespace grapher public bool Widened { get; private set; } + public bool Visible { get; private set; } + private PointData CombinedPointData { get; set; } private PointData XPointData { get; set; } @@ -167,7 +172,7 @@ namespace grapher { if (Combined) { - if (ChartX.Visible) + if (Visible) { ChartY.Show(); } @@ -206,17 +211,26 @@ namespace grapher public void Hide() { - ChartX.Hide(); - ChartY.Hide(); + if (Visible) + { + ChartX.Hide(); + ChartY.Hide(); + Visible = false; + } } public void Show() { - ChartX.Show(); - - if (!Combined) + if (!Visible) { - ChartY.Show(); + ChartX.Show(); + + if (!Combined) + { + ChartY.Show(); + } + + Visible = true; } } |