diff options
| author | Jacob Palecki <[email protected]> | 2020-09-01 02:18:41 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-01 02:18:41 -0700 |
| commit | 246fb772c5bf7dd6a85143fadebece3b4d9f1e04 (patch) | |
| tree | 454c869d44c69a0e7603ceb1e03de8a3e4f5e70a /grapher/Models/Charts/AccelCharts.cs | |
| parent | Show xy charts only when accel applied by component (diff) | |
| download | rawaccel-246fb772c5bf7dd6a85143fadebece3b4d9f1e04.tar.xz rawaccel-246fb772c5bf7dd6a85143fadebece3b4d9f1e04.zip | |
Add constants class and separate classes into regions
Diffstat (limited to 'grapher/Models/Charts/AccelCharts.cs')
| -rw-r--r-- | grapher/Models/Charts/AccelCharts.cs | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 0136ced..1574ce2 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -1,4 +1,5 @@ -using grapher.Models.Calculations; +using grapher.Constants; +using grapher.Models.Calculations; using grapher.Models.Charts; using System; using System.Collections.Generic; @@ -14,10 +15,7 @@ namespace grapher { public class AccelCharts { - public const int ChartSeparationVertical = 10; - - /// <summary> Needed to show full contents in form. Unsure why. </summary> - public const int FormHeightPadding = 35; + #region Constructors public AccelCharts( Form form, @@ -43,9 +41,9 @@ namespace grapher SensitivityChart.SetTop(0); VelocityChart.SetHeight(SensitivityChart.Height); - VelocityChart.SetTop(SensitivityChart.Height + ChartSeparationVertical); + VelocityChart.SetTop(SensitivityChart.Height + AccelGUIConstants.ChartSeparationVertical); GainChart.SetHeight(SensitivityChart.Height); - GainChart.SetTop(VelocityChart.Top + VelocityChart.Height + ChartSeparationVertical); + GainChart.SetTop(VelocityChart.Top + VelocityChart.Height + AccelGUIConstants.ChartSeparationVertical); Rectangle screenRectangle = ContaingForm.RectangleToScreen(ContaingForm.ClientRectangle); FormBorderHeight = screenRectangle.Top - ContaingForm.Top; @@ -58,6 +56,10 @@ namespace grapher ShowCombined(); } + #endregion Constructors + + #region Properties + public Form ContaingForm { get; } public ChartXY SensitivityChart { get; } @@ -80,6 +82,10 @@ namespace grapher private int FormBorderHeight { get; } + #endregion Properties + + #region Methods + public void MakeDots(int x, int y, double timeInMs) { if (Combined) @@ -149,9 +155,9 @@ namespace grapher VelocityChart.Show(); GainChart.Show(); ContaingForm.Height = SensitivityChart.Height + - ChartSeparationVertical + + AccelGUIConstants.ChartSeparationVertical + VelocityChart.Height + - ChartSeparationVertical + + AccelGUIConstants.ChartSeparationVertical + GainChart.Height + FormBorderHeight; } @@ -195,5 +201,7 @@ namespace grapher { ContaingForm.Width = SensitivityChart.Left + SensitivityChart.Width; } + + #endregion Methods } } |