From 8e58892723ee10792c7d3db275da826f98d01677 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 22 Sep 2020 02:28:35 -0700 Subject: Mostly works --- grapher/Models/Charts/AccelCharts.cs | 5 +++++ grapher/Models/Charts/ChartState/ChartState.cs | 24 ++++++++++++++++++++++++ grapher/Models/Charts/ChartXY.cs | 16 ++++++++++++++++ 3 files changed, 45 insertions(+) (limited to 'grapher/Models/Charts') diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index d22ab78..a0e99c8 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -149,6 +149,11 @@ namespace grapher ChartState.Calculate(accel, settings); } + public void SetLogarithmic(bool x, bool y) + { + ChartState.SetLogarithmic(x, y); + } + private static void SetupCharts( ChartXY sensitivityChart, ChartXY velocityChart, diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs index ea67e83..e1c7d01 100644 --- a/grapher/Models/Charts/ChartState/ChartState.cs +++ b/grapher/Models/Charts/ChartState/ChartState.cs @@ -100,5 +100,29 @@ namespace grapher.Models.Charts.ChartState GainChart.Hide(); form.Height = SensitivityChart.Height + borderHeight; } + + public void SetLogarithmic(bool x, bool y) + { + if (x) + { + ChartXY.SetLogarithmic(SensitivityChart.ChartX); + ChartXY.SetLogarithmic(GainChart.ChartX); + } + else + { + ChartXY.SetStandard(SensitivityChart.ChartX); + ChartXY.SetStandard(GainChart.ChartX); + } + + if (y) + { + ChartXY.SetLogarithmic(SensitivityChart.ChartY); + ChartXY.SetLogarithmic(GainChart.ChartY); + } + { + ChartXY.SetStandard(SensitivityChart.ChartY); + ChartXY.SetStandard(GainChart.ChartY); + } + } } } diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index fdd0258..b17960b 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -132,6 +132,22 @@ namespace grapher } } + public static void SetLogarithmic(Chart chart) + { + chart.ChartAreas[0].AxisX.Minimum = 0.001; + chart.ChartAreas[0].AxisX.Maximum = 3500; + chart.ChartAreas[0].AxisY.Minimum = 0.001; + chart.ChartAreas[0].AxisY.Maximum = 10; + chart.ChartAreas[0].AxisX.IsLogarithmic = true; + chart.ChartAreas[0].AxisY.IsLogarithmic = true; + } + + public static void SetStandard(Chart chart) + { + chart.ChartAreas[0].AxisX.IsLogarithmic = false; + chart.ChartAreas[0].AxisY.IsLogarithmic = false; + } + public void SetPointBinds(PointData combined, PointData x, PointData y) { CombinedPointData = combined; -- cgit v1.2.3 From 2c288f95f2c3791daf54299580e19439c3dd1b0c Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 22 Sep 2020 03:16:36 -0700 Subject: Fix bug & rename x axis to input speed --- grapher/Models/Charts/ChartXY.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'grapher/Models/Charts') diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index b17960b..c5c00d1 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -134,18 +134,22 @@ namespace grapher public static void SetLogarithmic(Chart chart) { + /* chart.ChartAreas[0].AxisX.Minimum = 0.001; chart.ChartAreas[0].AxisX.Maximum = 3500; chart.ChartAreas[0].AxisY.Minimum = 0.001; chart.ChartAreas[0].AxisY.Maximum = 10; chart.ChartAreas[0].AxisX.IsLogarithmic = true; chart.ChartAreas[0].AxisY.IsLogarithmic = true; + */ } public static void SetStandard(Chart chart) { + /* chart.ChartAreas[0].AxisX.IsLogarithmic = false; chart.ChartAreas[0].AxisY.IsLogarithmic = false; + */ } public void SetPointBinds(PointData combined, PointData x, PointData y) -- cgit v1.2.3 From 45285413a94c9c081098c672e69e9811ac5262b7 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 22 Sep 2020 13:08:31 -0700 Subject: Rename experiment two to motivity --- grapher/Models/Charts/ChartXY.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'grapher/Models/Charts') diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index c5c00d1..3850e42 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -128,7 +128,6 @@ namespace grapher pointTwo.Get(out x, out y); chart.Series[3].Points.DataBindXY(x, y); } - chart.Update(); } } -- cgit v1.2.3 From 720a45289b2342c62eebb0e1cee3c4b88c9fe696 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 22 Sep 2020 14:01:05 -0700 Subject: Scaling improvement, remove y data from xy combined --- grapher/Models/Charts/ChartState/CombinedState.cs | 2 ++ .../Models/Charts/ChartState/XYOneGraphState.cs | 2 ++ .../Models/Charts/ChartState/XYTwoGraphState.cs | 3 +++ grapher/Models/Charts/ChartXY.cs | 22 ++++++++++++++++++++++ 4 files changed, 29 insertions(+) (limited to 'grapher/Models/Charts') diff --git a/grapher/Models/Charts/ChartState/CombinedState.cs b/grapher/Models/Charts/ChartState/CombinedState.cs index 17cd68a..f4b6b8f 100644 --- a/grapher/Models/Charts/ChartState/CombinedState.cs +++ b/grapher/Models/Charts/ChartState/CombinedState.cs @@ -36,6 +36,8 @@ namespace grapher.Models.Charts.ChartState SensitivityChart.Bind(Data.Combined.AccelPoints); VelocityChart.Bind(Data.Combined.VelocityPoints); GainChart.Bind(Data.Combined.GainPoints); + SensitivityChart.SetMinMax(Data.Combined.MinAccel, Data.Combined.MaxAccel); + GainChart.SetMinMax(Data.Combined.MinGain, Data.Combined.MaxGain); } public override void Calculate(ManagedAccel accel, DriverSettings settings) diff --git a/grapher/Models/Charts/ChartState/XYOneGraphState.cs b/grapher/Models/Charts/ChartState/XYOneGraphState.cs index bbc0c28..6bfaac5 100644 --- a/grapher/Models/Charts/ChartState/XYOneGraphState.cs +++ b/grapher/Models/Charts/ChartState/XYOneGraphState.cs @@ -38,6 +38,8 @@ namespace grapher.Models.Charts.ChartState SensitivityChart.BindXYCombined(Data.X.AccelPoints, Data.Y.AccelPoints); VelocityChart.BindXYCombined(Data.X.VelocityPoints, Data.Y.VelocityPoints); GainChart.BindXYCombined(Data.X.GainPoints, Data.Y.GainPoints); + SensitivityChart.SetMinMax(Data.Combined.MinAccel, Data.Combined.MaxAccel); + GainChart.SetMinMax(Data.Combined.MinGain, Data.Combined.MaxGain); } public override void Calculate(ManagedAccel accel, DriverSettings settings) diff --git a/grapher/Models/Charts/ChartState/XYTwoGraphState.cs b/grapher/Models/Charts/ChartState/XYTwoGraphState.cs index 69dc335..b775853 100644 --- a/grapher/Models/Charts/ChartState/XYTwoGraphState.cs +++ b/grapher/Models/Charts/ChartState/XYTwoGraphState.cs @@ -65,6 +65,9 @@ namespace grapher.Models.Charts.ChartState SensitivityChart.BindXY(Data.X.AccelPoints, Data.Y.AccelPoints); VelocityChart.BindXY(Data.X.VelocityPoints, Data.Y.VelocityPoints); GainChart.BindXY(Data.X.GainPoints, Data.Y.GainPoints); + + SensitivityChart.SetMinMaxXY(Data.X.MinAccel, Data.X.MaxAccel, Data.Y.MinAccel, Data.Y.MaxAccel); + GainChart.SetMinMaxXY(Data.X.MinGain, Data.X.MaxGain, Data.Y.MinGain, Data.Y.MaxGain); } public override void Calculate(ManagedAccel accel, DriverSettings settings) diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 3850e42..253804e 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -100,6 +100,9 @@ namespace grapher chart.ChartAreas[0].AxisY.ScaleView.MinSize = 0.01; chart.ChartAreas[0].AxisY.ScaleView.SmallScrollSize = 0.001; + chart.ChartAreas[0].AxisX.LabelStyle.Format = "0.##"; + chart.ChartAreas[0].AxisY.LabelStyle.Format = "0.##"; + chart.ChartAreas[0].CursorY.Interval = 0.001; chart.ChartAreas[0].CursorX.AutoScroll = true; @@ -187,18 +190,37 @@ namespace grapher public void Bind(IDictionary data) { ChartX.Series[0].Points.DataBindXY(data.Keys, data.Values); + ChartX.Series[2].IsVisibleInLegend = false; + ChartX.Series[2].Points.Clear(); } public void BindXY(IDictionary dataX, IDictionary dataY) { ChartX.Series[0].Points.DataBindXY(dataX.Keys, dataX.Values); ChartY.Series[0].Points.DataBindXY(dataY.Keys, dataY.Values); + ChartX.Series[2].IsVisibleInLegend = false; + ChartX.Series[2].Points.Clear(); } public void BindXYCombined(IDictionary dataX, IDictionary dataY) { ChartX.Series[0].Points.DataBindXY(dataX.Keys, dataX.Values); ChartX.Series[2].Points.DataBindXY(dataY.Keys, dataY.Values); + ChartX.Series[2].IsVisibleInLegend = true; + } + + public void SetMinMax(double min, double max) + { + ChartX.ChartAreas[0].AxisY.Minimum = min; + ChartX.ChartAreas[0].AxisY.Maximum = max; + } + + public void SetMinMaxXY(double minX, double maxX, double minY, double maxY) + { + ChartX.ChartAreas[0].AxisY.Minimum = minX; + ChartX.ChartAreas[0].AxisY.Maximum = maxX; + ChartY.ChartAreas[0].AxisY.Minimum = minY; + ChartY.ChartAreas[0].AxisY.Maximum = maxY; } public void SetCombined() -- cgit v1.2.3 From f4ff6334df8a3fd66d13082606b69a78fa592237 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 22 Sep 2020 15:26:08 -0700 Subject: Remove sigmoidgain, only allow one instance of grapher to run at a time --- grapher/Models/Charts/ChartXY.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'grapher/Models/Charts') diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 253804e..c30c993 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -211,16 +211,26 @@ namespace grapher public void SetMinMax(double min, double max) { - ChartX.ChartAreas[0].AxisY.Minimum = min; - ChartX.ChartAreas[0].AxisY.Maximum = max; + if (min < max) + { + ChartX.ChartAreas[0].AxisY.Minimum = min; + ChartX.ChartAreas[0].AxisY.Maximum = max; + } } public void SetMinMaxXY(double minX, double maxX, double minY, double maxY) { - ChartX.ChartAreas[0].AxisY.Minimum = minX; - ChartX.ChartAreas[0].AxisY.Maximum = maxX; - ChartY.ChartAreas[0].AxisY.Minimum = minY; - ChartY.ChartAreas[0].AxisY.Maximum = maxY; + if (minX < maxX) + { + ChartX.ChartAreas[0].AxisY.Minimum = minX; + ChartX.ChartAreas[0].AxisY.Maximum = maxX; + } + + if (minY < maxY) + { + ChartY.ChartAreas[0].AxisY.Minimum = minY; + ChartY.ChartAreas[0].AxisY.Maximum = maxY; + } } public void SetCombined() -- cgit v1.2.3