diff options
| author | Jacob Palecki <[email protected]> | 2020-09-21 14:27:12 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-21 14:27:12 -0700 |
| commit | 96112bf6eaee310985ae607b66b43fafcc5efb1e (patch) | |
| tree | 6ffdee3a16c7b5c89b6f12117e8a9b78b1112e6f /grapher/Models/Charts/ChartState/CombinedState.cs | |
| parent | conditional around lookup map (diff) | |
| parent | Merge pull request #21 from JacobPalecki/GUI (diff) | |
| download | rawaccel-96112bf6eaee310985ae607b66b43fafcc5efb1e.tar.xz rawaccel-96112bf6eaee310985ae607b66b43fafcc5efb1e.zip | |
Merge branch 'GUI' into experiment
Diffstat (limited to 'grapher/Models/Charts/ChartState/CombinedState.cs')
| -rw-r--r-- | grapher/Models/Charts/ChartState/CombinedState.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/grapher/Models/Charts/ChartState/CombinedState.cs b/grapher/Models/Charts/ChartState/CombinedState.cs new file mode 100644 index 0000000..17cd68a --- /dev/null +++ b/grapher/Models/Charts/ChartState/CombinedState.cs @@ -0,0 +1,46 @@ +using grapher.Models.Calculations; +using grapher.Models.Serialized; + +namespace grapher.Models.Charts.ChartState +{ + public class CombinedState : ChartState + { + public CombinedState( + ChartXY sensitivityChart, + ChartXY velocityChart, + ChartXY gainChart, + AccelData accelData, + AccelCalculator accelCalculator) + : base( + sensitivityChart, + velocityChart, + gainChart, + accelData, + accelCalculator) + { } + + public override void Activate() + { + SensitivityChart.SetCombined(); + VelocityChart.SetCombined(); + GainChart.SetCombined(); + } + + public override void MakeDots(int x, int y, double timeInMs) + { + Data.CalculateDots(x, y, timeInMs); + } + + public override void Bind() + { + SensitivityChart.Bind(Data.Combined.AccelPoints); + VelocityChart.Bind(Data.Combined.VelocityPoints); + GainChart.Bind(Data.Combined.GainPoints); + } + + public override void Calculate(ManagedAccel accel, DriverSettings settings) + { + Calculator.Calculate(Data.Combined, accel, settings.sensitivity.x, Calculator.MagnitudesCombined); + } + } +} |