summaryrefslogtreecommitdiff
path: root/grapher/Models/Charts
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-08-12 19:51:38 -0700
committerJacob Palecki <[email protected]>2020-08-12 19:51:38 -0700
commitb6254f32a6cfbd40bd1919950b344160f38bf1e4 (patch)
tree82a2a514f90b9781062b2919e2b17c4cc6f852bc /grapher/Models/Charts
parentReorganized solution into directories (diff)
downloadrawaccel-b6254f32a6cfbd40bd1919950b344160f38bf1e4.tar.xz
rawaccel-b6254f32a6cfbd40bd1919950b344160f38bf1e4.zip
Factor accel calculations into calculation classes
Diffstat (limited to 'grapher/Models/Charts')
-rw-r--r--grapher/Models/Charts/AccelCharts.cs14
-rw-r--r--grapher/Models/Charts/ChartXY.cs6
2 files changed, 19 insertions, 1 deletions
diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs
index 9952016..4ed44c7 100644
--- a/grapher/Models/Charts/AccelCharts.cs
+++ b/grapher/Models/Charts/AccelCharts.cs
@@ -1,4 +1,5 @@
-using System;
+using grapher.Models.Calculations;
+using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
@@ -55,8 +56,17 @@ namespace grapher
public ToolStripMenuItem EnableVelocityAndGain { get; }
+ private bool Combined { get; set; }
+
private int FormBorderHeight { get; }
+ public void Bind(AccelData data)
+ {
+ SensitivityChart.Bind(data.OrderedAccelPoints);
+ VelocityChart.Bind(data.OrderedVelocityPoints);
+ GainChart.Bind(data.OrderedGainPoints);
+ }
+
private void OnEnableClick(object sender, EventArgs e)
{
EnableVelocityAndGain.Checked = !EnableVelocityAndGain.Checked;
@@ -99,6 +109,7 @@ namespace grapher
VelocityChart.SetSeparate();
GainChart.SetSeparate();
UpdateFormWidth();
+ Combined = false;
}
private void ShowCombined()
@@ -107,6 +118,7 @@ namespace grapher
VelocityChart.SetCombined();
GainChart.SetCombined();
UpdateFormWidth();
+ Combined = true;
}
private void UpdateFormWidth()
diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs
index 4bb1bd5..a57801e 100644
--- a/grapher/Models/Charts/ChartXY.cs
+++ b/grapher/Models/Charts/ChartXY.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -89,6 +90,11 @@ namespace grapher
public bool Combined { get; private set; }
+ public void Bind(IDictionary data)
+ {
+ ChartX.Series[0].Points.DataBindXY(data.Keys, data.Values);
+ }
+
public void SetCombined()
{
if (!Combined)