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 | |
| 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')
| -rw-r--r-- | grapher/Models/Charts/AccelCharts.cs | 26 | ||||
| -rw-r--r-- | grapher/Models/Charts/ChartXY.cs | 4 | ||||
| -rw-r--r-- | grapher/Models/Charts/EstimatedPoints.cs | 8 |
3 files changed, 27 insertions, 11 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 } } diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 81874a2..e5a948a 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -15,11 +15,11 @@ namespace grapher { public class ChartXY { - #region Consts + #region Constants public const int ChartSeparationHorizontal = 10; - #endregion Consts + #endregion Constants #region Constructors diff --git a/grapher/Models/Charts/EstimatedPoints.cs b/grapher/Models/Charts/EstimatedPoints.cs index fa0718b..9ff0e5b 100644 --- a/grapher/Models/Charts/EstimatedPoints.cs +++ b/grapher/Models/Charts/EstimatedPoints.cs @@ -9,6 +9,8 @@ namespace grapher.Models.Charts { public class EstimatedPoints { + #region Constructors + public EstimatedPoints() { Sensitivity = new PointData(); @@ -16,10 +18,16 @@ namespace grapher.Models.Charts Gain = new PointData(); } + #endregion Constructors + + #region Properties + public PointData Sensitivity { get; } public PointData Velocity { get; } public PointData Gain { get; } + + #endregion Properties } } |