summaryrefslogtreecommitdiff
path: root/grapher/Models/Charts/ChartState/ChartState.cs
diff options
context:
space:
mode:
authorJacobPalecki <[email protected]>2021-01-20 20:13:33 -0800
committerGitHub <[email protected]>2021-01-20 20:13:33 -0800
commit5b6479013c8f35df933dd57c680063f4db1e4028 (patch)
tree60dd7c67a0f163457da2519b42553382a39a591b /grapher/Models/Charts/ChartState/ChartState.cs
parentshow custom dialog on bad input (#63) (diff)
parentGuard against bad anisotropy args (diff)
downloadrawaccel-5b6479013c8f35df933dd57c680063f4db1e4028.tar.xz
rawaccel-5b6479013c8f35df933dd57c680063f4db1e4028.zip
Merge pull request #65 from JacobPalecki/Directional
Directionality Features + Graph Fidelity
Diffstat (limited to 'grapher/Models/Charts/ChartState/ChartState.cs')
-rw-r--r--grapher/Models/Charts/ChartState/ChartState.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs
index 0bb141e..5a86713 100644
--- a/grapher/Models/Charts/ChartState/ChartState.cs
+++ b/grapher/Models/Charts/ChartState/ChartState.cs
@@ -1,4 +1,5 @@
using grapher.Models.Calculations;
+using grapher.Models.Calculations.Data;
using grapher.Models.Serialized;
using System;
using System.Collections.Generic;
@@ -15,13 +16,11 @@ namespace grapher.Models.Charts.ChartState
ChartXY sensitivityChart,
ChartXY velocityChart,
ChartXY gainChart,
- AccelData accelData,
AccelCalculator calculator)
{
SensitivityChart = sensitivityChart;
VelocityChart = velocityChart;
GainChart = gainChart;
- Data = accelData;
Calculator = calculator;
TwoDotsPerGraph = false;
}
@@ -32,7 +31,7 @@ namespace grapher.Models.Charts.ChartState
public ChartXY GainChart { get; }
- public AccelData Data { get; }
+ public IAccelData Data { get; protected set; }
public AccelCalculator Calculator { get; }
@@ -40,13 +39,19 @@ namespace grapher.Models.Charts.ChartState
internal bool TwoDotsPerGraph { get; set; }
- public abstract void MakeDots(double x, double y, double timeInMs);
+ public virtual void MakeDots(double x, double y, double timeInMs)
+ {
+ Data.CalculateDots(x, y, timeInMs);
+ }
public abstract void Bind();
public abstract void Activate();
- public abstract void Calculate(ManagedAccel accel, DriverSettings settings);
+ public virtual void Calculate(ManagedAccel accel, DriverSettings settings)
+ {
+ Data.CreateGraphData(accel, settings);
+ }
public void Redraw()
{
@@ -77,12 +82,14 @@ namespace grapher.Models.Charts.ChartState
public void ShowVelocityAndGain()
{
+ SensitivityChart.SetHeight(Constants.SensitivityChartTogetherHeight);
VelocityChart.Show();
GainChart.Show();
}
public void HideVelocityAndGain()
{
+ SensitivityChart.SetHeight(Constants.SensitivityChartAloneHeight);
VelocityChart.Hide();
GainChart.Hide();
}