summaryrefslogtreecommitdiff
path: root/grapher/Models/Charts/ChartState/ChartStateManager.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/ChartStateManager.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/ChartStateManager.cs')
-rw-r--r--grapher/Models/Charts/ChartState/ChartStateManager.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/grapher/Models/Charts/ChartState/ChartStateManager.cs b/grapher/Models/Charts/ChartState/ChartStateManager.cs
new file mode 100644
index 0000000..27d0836
--- /dev/null
+++ b/grapher/Models/Charts/ChartState/ChartStateManager.cs
@@ -0,0 +1,68 @@
+using grapher.Models.Calculations;
+using grapher.Models.Serialized;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace grapher.Models.Charts.ChartState
+{
+ public class ChartStateManager
+ {
+ public ChartStateManager(
+ ChartXY sensitivityChart,
+ ChartXY velocityChart,
+ ChartXY gainChat,
+ AccelData accelData)
+ {
+ CombinedState = new CombinedState(
+ sensitivityChart,
+ velocityChart,
+ gainChat,
+ accelData);
+
+ XYOneGraphState = new XYOneGraphState(
+ sensitivityChart,
+ velocityChart,
+ gainChat,
+ accelData);
+
+ XYTwoGraphState = new XYTwoGraphState(
+ sensitivityChart,
+ velocityChart,
+ gainChat,
+ accelData);
+ }
+
+ private CombinedState CombinedState { get; }
+
+ private XYOneGraphState XYOneGraphState { get; }
+
+ private XYTwoGraphState XYTwoGraphState { get; }
+
+ public ChartState DetermineState(DriverSettings settings)
+ {
+ if (settings.combineMagnitudes)
+ {
+ if (settings.sensitivity.x != settings.sensitivity.y)
+ {
+ return XYOneGraphState;
+ }
+ else
+ {
+ return CombinedState;
+ }
+ }
+ else
+ {
+ return XYTwoGraphState;
+ }
+ }
+
+ public ChartState InitialState()
+ {
+ return CombinedState;
+ }
+ }
+}