summaryrefslogtreecommitdiff
path: root/grapher/Models/Charts/ChartState/ChartState.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-16 01:20:23 -0700
committerJacob Palecki <[email protected]>2020-09-16 01:20:23 -0700
commit05c7094a93c7d29eb8ac05247110995574a7b963 (patch)
tree8bf2845cc7f33d2e20399001d2724510cf35336a /grapher/Models/Charts/ChartState/ChartState.cs
parentFix box write (diff)
downloadrawaccel-05c7094a93c7d29eb8ac05247110995574a7b963.tar.xz
rawaccel-05c7094a93c7d29eb8ac05247110995574a7b963.zip
Unsure if I will use this
Diffstat (limited to 'grapher/Models/Charts/ChartState/ChartState.cs')
-rw-r--r--grapher/Models/Charts/ChartState/ChartState.cs86
1 files changed, 86 insertions, 0 deletions
diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs
new file mode 100644
index 0000000..b450357
--- /dev/null
+++ b/grapher/Models/Charts/ChartState/ChartState.cs
@@ -0,0 +1,86 @@
+using grapher.Models.Calculations;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace grapher.Models.Charts.ChartState
+{
+ public abstract class ChartState
+ {
+ public ChartState(
+ ChartXY sensitivityChart,
+ ChartXY velocityChart,
+ ChartXY gainChart,
+ AccelData accelData)
+ {
+ SensitivityChart = sensitivityChart;
+ VelocityChart = velocityChart;
+ GainChart = gainChart;
+ AccelData = accelData;
+ }
+
+ public ChartXY SensitivityChart { get; }
+
+ public ChartXY VelocityChart { get; }
+
+ public ChartXY GainChart { get; }
+
+ public AccelData AccelData { get; }
+
+ public abstract void MakeDots(int x, int y, double timeInMs);
+
+ public abstract void Bind();
+
+ public abstract void Activate();
+
+ public void DrawLastMovement()
+ {
+ SensitivityChart.DrawLastMovementValue();
+ VelocityChart.DrawLastMovementValue();
+ GainChart.DrawLastMovementValue();
+ }
+
+ public void SetWidened()
+ {
+ SensitivityChart.SetWidened();
+ VelocityChart.SetWidened();
+ GainChart.SetWidened();
+ }
+
+ public void SetNarrowed()
+ {
+ SensitivityChart.SetNarrowed();
+ VelocityChart.SetNarrowed();
+ GainChart.SetNarrowed();
+ }
+
+ public void ClearLastValue()
+ {
+ SensitivityChart.ClearLastValue();
+ VelocityChart.ClearLastValue();
+ GainChart.ClearLastValue();
+ }
+
+ public void ShowVelocityAndGain(Form form, int borderHeight)
+ {
+ VelocityChart.Show();
+ GainChart.Show();
+ form.Height = SensitivityChart.Height +
+ Constants.ChartSeparationVertical +
+ VelocityChart.Height +
+ Constants.ChartSeparationVertical +
+ GainChart.Height +
+ borderHeight;
+ }
+
+ public void HideVelocityAndGain(Form form, int borderHeight)
+ {
+ VelocityChart.Hide();
+ GainChart.Hide();
+ form.Height = SensitivityChart.Height + borderHeight;
+ }
+ }
+}