From 05c7094a93c7d29eb8ac05247110995574a7b963 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Wed, 16 Sep 2020 01:20:23 -0700 Subject: Unsure if I will use this --- grapher/Models/Charts/ChartState/ChartState.cs | 86 ++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 grapher/Models/Charts/ChartState/ChartState.cs (limited to 'grapher/Models/Charts/ChartState/ChartState.cs') diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs new file mode 100644 index 0000000..b450357 --- /dev/null +++ b/grapher/Models/Charts/ChartState/ChartState.cs @@ -0,0 +1,86 @@ +using grapher.Models.Calculations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace grapher.Models.Charts.ChartState +{ + public abstract class ChartState + { + public ChartState( + ChartXY sensitivityChart, + ChartXY velocityChart, + ChartXY gainChart, + AccelData accelData) + { + SensitivityChart = sensitivityChart; + VelocityChart = velocityChart; + GainChart = gainChart; + AccelData = accelData; + } + + public ChartXY SensitivityChart { get; } + + public ChartXY VelocityChart { get; } + + public ChartXY GainChart { get; } + + public AccelData AccelData { get; } + + public abstract void MakeDots(int x, int y, double timeInMs); + + public abstract void Bind(); + + public abstract void Activate(); + + public void DrawLastMovement() + { + SensitivityChart.DrawLastMovementValue(); + VelocityChart.DrawLastMovementValue(); + GainChart.DrawLastMovementValue(); + } + + public void SetWidened() + { + SensitivityChart.SetWidened(); + VelocityChart.SetWidened(); + GainChart.SetWidened(); + } + + public void SetNarrowed() + { + SensitivityChart.SetNarrowed(); + VelocityChart.SetNarrowed(); + GainChart.SetNarrowed(); + } + + public void ClearLastValue() + { + SensitivityChart.ClearLastValue(); + VelocityChart.ClearLastValue(); + GainChart.ClearLastValue(); + } + + public void ShowVelocityAndGain(Form form, int borderHeight) + { + VelocityChart.Show(); + GainChart.Show(); + form.Height = SensitivityChart.Height + + Constants.ChartSeparationVertical + + VelocityChart.Height + + Constants.ChartSeparationVertical + + GainChart.Height + + borderHeight; + } + + public void HideVelocityAndGain(Form form, int borderHeight) + { + VelocityChart.Hide(); + GainChart.Hide(); + form.Height = SensitivityChart.Height + borderHeight; + } + } +} -- cgit v1.2.3 From 5beedd6d1aca73adaae6556ded584d3f454509b0 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 17 Sep 2020 01:29:18 -0700 Subject: Much progress --- grapher/Models/Charts/ChartState/ChartState.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'grapher/Models/Charts/ChartState/ChartState.cs') diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs index b450357..cc334ac 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.Serialized; using System; using System.Collections.Generic; using System.Linq; @@ -30,6 +31,8 @@ namespace grapher.Models.Charts.ChartState public AccelData AccelData { get; } + public virtual DriverSettings Settings { get; set; } + public abstract void MakeDots(int x, int y, double timeInMs); public abstract void Bind(); -- cgit v1.2.3 From df173decac3ac5e1043b53961f1512bb88b85136 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 17 Sep 2020 20:26:15 -0700 Subject: Further work --- grapher/Models/Charts/ChartState/ChartState.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'grapher/Models/Charts/ChartState/ChartState.cs') diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs index cc334ac..99f44ff 100644 --- a/grapher/Models/Charts/ChartState/ChartState.cs +++ b/grapher/Models/Charts/ChartState/ChartState.cs @@ -15,12 +15,14 @@ namespace grapher.Models.Charts.ChartState ChartXY sensitivityChart, ChartXY velocityChart, ChartXY gainChart, - AccelData accelData) + AccelData accelData, + AccelCalculator calculator) { SensitivityChart = sensitivityChart; VelocityChart = velocityChart; GainChart = gainChart; - AccelData = accelData; + Data = accelData; + Calculator = calculator; } public ChartXY SensitivityChart { get; } @@ -29,7 +31,9 @@ namespace grapher.Models.Charts.ChartState public ChartXY GainChart { get; } - public AccelData AccelData { get; } + public AccelData Data { get; } + + public AccelCalculator Calculator { get; } public virtual DriverSettings Settings { get; set; } @@ -39,6 +43,8 @@ namespace grapher.Models.Charts.ChartState public abstract void Activate(); + public abstract void Calculate(); + public void DrawLastMovement() { SensitivityChart.DrawLastMovementValue(); -- cgit v1.2.3 From 1dd0c108b8948c50fd8f2b9c9055dbb8e7d47270 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 17 Sep 2020 23:51:47 -0700 Subject: Add y lines to graphes + further work --- grapher/Models/Charts/ChartState/ChartState.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'grapher/Models/Charts/ChartState/ChartState.cs') diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs index 99f44ff..a219cc4 100644 --- a/grapher/Models/Charts/ChartState/ChartState.cs +++ b/grapher/Models/Charts/ChartState/ChartState.cs @@ -43,7 +43,12 @@ namespace grapher.Models.Charts.ChartState public abstract void Activate(); - public abstract void Calculate(); + public abstract void Calculate(ManagedAccel accel, DriverSettings settings); + public virtual void SetUpCalculate(DriverSettings settings) + { + Data.Clear(); + Calculator.ScaleByMouseSettings(); + } public void DrawLastMovement() { -- cgit v1.2.3 From ba642cd8c8e63ec3778fa17ecbcd7964074aaba1 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 21 Sep 2020 00:08:19 -0700 Subject: separate x/y mostly works --- grapher/Models/Charts/ChartState/ChartState.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'grapher/Models/Charts/ChartState/ChartState.cs') diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs index a219cc4..ea67e83 100644 --- a/grapher/Models/Charts/ChartState/ChartState.cs +++ b/grapher/Models/Charts/ChartState/ChartState.cs @@ -23,6 +23,7 @@ namespace grapher.Models.Charts.ChartState GainChart = gainChart; Data = accelData; Calculator = calculator; + TwoDotsPerGraph = false; } public ChartXY SensitivityChart { get; } @@ -37,6 +38,8 @@ namespace grapher.Models.Charts.ChartState public virtual DriverSettings Settings { get; set; } + internal bool TwoDotsPerGraph { get; set; } + public abstract void MakeDots(int x, int y, double timeInMs); public abstract void Bind(); @@ -44,6 +47,7 @@ namespace grapher.Models.Charts.ChartState public abstract void Activate(); public abstract void Calculate(ManagedAccel accel, DriverSettings settings); + public virtual void SetUpCalculate(DriverSettings settings) { Data.Clear(); @@ -52,9 +56,9 @@ namespace grapher.Models.Charts.ChartState public void DrawLastMovement() { - SensitivityChart.DrawLastMovementValue(); - VelocityChart.DrawLastMovementValue(); - GainChart.DrawLastMovementValue(); + SensitivityChart.DrawLastMovementValue(TwoDotsPerGraph); + VelocityChart.DrawLastMovementValue(TwoDotsPerGraph); + GainChart.DrawLastMovementValue(TwoDotsPerGraph); } public void SetWidened() -- cgit v1.2.3