summaryrefslogtreecommitdiff
path: root/grapher/Models/Charts/ChartState/XYTwoGraphState.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-17 01:29:18 -0700
committerJacob Palecki <[email protected]>2020-09-17 01:29:18 -0700
commit5beedd6d1aca73adaae6556ded584d3f454509b0 (patch)
treeb0aa89c37dcdae4ad2533ba5b60e75c584b47eb3 /grapher/Models/Charts/ChartState/XYTwoGraphState.cs
parentAdd chart states to grapher (diff)
downloadrawaccel-5beedd6d1aca73adaae6556ded584d3f454509b0.tar.xz
rawaccel-5beedd6d1aca73adaae6556ded584d3f454509b0.zip
Much progress
Diffstat (limited to 'grapher/Models/Charts/ChartState/XYTwoGraphState.cs')
-rw-r--r--grapher/Models/Charts/ChartState/XYTwoGraphState.cs32
1 files changed, 31 insertions, 1 deletions
diff --git a/grapher/Models/Charts/ChartState/XYTwoGraphState.cs b/grapher/Models/Charts/ChartState/XYTwoGraphState.cs
index f37af08..b54832c 100644
--- a/grapher/Models/Charts/ChartState/XYTwoGraphState.cs
+++ b/grapher/Models/Charts/ChartState/XYTwoGraphState.cs
@@ -1,9 +1,13 @@
using grapher.Models.Calculations;
+using grapher.Models.Serialized;
+using System;
namespace grapher.Models.Charts.ChartState
{
public class XYTwoGraphState : ChartState
{
+ private DriverSettings _settings;
+
public XYTwoGraphState(
ChartXY sensitivityChart,
ChartXY velocityChart,
@@ -16,6 +20,24 @@ namespace grapher.Models.Charts.ChartState
accelData)
{ }
+ public override DriverSettings Settings
+ {
+ get { return _settings; }
+ set
+ {
+ _settings = value;
+ ShouldStripSens = AccelCalculator.ShouldStripSens(ref value);
+ if (ShouldStripSens)
+ {
+ Sensitivity = AccelCalculator.GetSens(ref value);
+ }
+ }
+ }
+
+ private bool ShouldStripSens { get; set; }
+
+ private (double, double) Sensitivity { get; set; }
+
public override void Activate()
{
SensitivityChart.SetSeparate();
@@ -25,7 +47,15 @@ namespace grapher.Models.Charts.ChartState
public override void MakeDots(int x, int y, double timeInMs)
{
- AccelData.CalculateDotsXY(x, y, timeInMs);
+ double xCalc = x;
+ double yCalc = y;
+
+ if (ShouldStripSens)
+ {
+ (xCalc, yCalc) = AccelCalculator.StripSens(xCalc, yCalc, Sensitivity.Item1, Sensitivity.Item2);
+ }
+
+ AccelData.CalculateDotsXY((int)Math.Round(xCalc), (int)Math.Round(yCalc), timeInMs);
}
public override void Bind()