From 7622f542daa27db332334d0af25faa9651a1c831 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sat, 19 Sep 2020 21:24:59 -0700 Subject: log sigmoid sens done --- grapher/Layouts/ExperimentOneLayout.cs | 26 ++++++++++++++++++++++++++ grapher/Layouts/LayoutBase.cs | 1 + 2 files changed, 27 insertions(+) create mode 100644 grapher/Layouts/ExperimentOneLayout.cs (limited to 'grapher/Layouts') diff --git a/grapher/Layouts/ExperimentOneLayout.cs b/grapher/Layouts/ExperimentOneLayout.cs new file mode 100644 index 0000000..1853fbc --- /dev/null +++ b/grapher/Layouts/ExperimentOneLayout.cs @@ -0,0 +1,26 @@ +using grapher.Models.Serialized; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher.Layouts +{ + public class ExperimentOneLayout : LayoutBase + { + public ExperimentOneLayout() + : base() + { + Name = "Experiment 1"; + Index = (int)AccelMode.experimentone; + + AccelLayout = new OptionLayout(true, Acceleration); + CapLayout = new OptionLayout(false, string.Empty); + WeightLayout = new OptionLayout(true, Weight); + OffsetLayout = new OptionLayout(false, string.Empty); + LimExpLayout = new OptionLayout(true, Motility); + MidpointLayout = new OptionLayout(true, Midpoint); + } + } +} diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 6ed8fee..067ce44 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -10,6 +10,7 @@ namespace grapher.Layouts public const string Exponent = "Exponent"; public const string Limit = "Limit"; public const string Midpoint = "Midpoint"; + public const string Motility = "Motility"; public const string Offset = "Offset"; public const string Cap = "Cap"; public const string Weight = "Weight"; -- cgit v1.2.3 From 4bf7cea7083e4f445032443f23f00b93b314630d Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 22 Sep 2020 00:10:56 -0700 Subject: faster type switch --- grapher/Layouts/LayoutBase.cs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'grapher/Layouts') diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 6ed8fee..9016940 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -58,30 +58,32 @@ namespace grapher.Layouts Button button, int top) { - AccelLayout.Layout(accelOption); - CapLayout.Layout(capOption); - WeightLayout.Layout(weightOption); - OffsetLayout.Layout(offsetOption); - LimExpLayout.Layout(limExpOption); - MidpointLayout.Layout(midpointOption); - button.Enabled = ButtonEnabled; IOption previous = null; - foreach (var option in new IOption[] { accelOption, capOption, weightOption, offsetOption, limExpOption, midpointOption}) + + foreach (var option in new (OptionLayout, IOption)[] { + (AccelLayout, accelOption), + (CapLayout, capOption), + (WeightLayout, weightOption), + (OffsetLayout, offsetOption), + (LimExpLayout, limExpOption), + (MidpointLayout, midpointOption)}) { - if (option.Visible) + option.Item1.Layout(option.Item2); + + if (option.Item2.Visible) { if (previous != null) { - option.SnapTo(previous); + option.Item2.SnapTo(previous); } else { - option.Top = top; + option.Item2.Top = top; } - previous = option; + previous = option.Item2; } } } -- cgit v1.2.3 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/Layouts/DefaultLayout.cs | 1 + grapher/Layouts/ExperimentOneLayout.cs | 1 + grapher/Layouts/LayoutBase.cs | 7 +++++-- grapher/Layouts/LinearLayout.cs | 1 + grapher/Layouts/LogarithmLayout.cs | 1 + grapher/Layouts/NaturalGainLayout.cs | 1 + grapher/Layouts/NaturalLayout.cs | 1 + grapher/Layouts/OffLayout.cs | 1 + grapher/Layouts/PowerLayout.cs | 1 + grapher/Layouts/SigmoidGainLayout.cs | 1 + 10 files changed, 14 insertions(+), 2 deletions(-) (limited to 'grapher/Layouts') diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index 83535c2..cf6f87f 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -10,6 +10,7 @@ namespace grapher.Layouts Name = "Default"; Index = (int)AccelMode.noaccel; ButtonEnabled = false; + LogarithmicCharts = false; AccelLayout = new OptionLayout(true, Acceleration); CapLayout = new OptionLayout(true, Cap); diff --git a/grapher/Layouts/ExperimentOneLayout.cs b/grapher/Layouts/ExperimentOneLayout.cs index 1853fbc..ad6f61a 100644 --- a/grapher/Layouts/ExperimentOneLayout.cs +++ b/grapher/Layouts/ExperimentOneLayout.cs @@ -14,6 +14,7 @@ namespace grapher.Layouts { Name = "Experiment 1"; Index = (int)AccelMode.experimentone; + LogarithmicCharts = true; AccelLayout = new OptionLayout(true, Acceleration); CapLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 10429fb..b89e2f7 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -25,15 +25,18 @@ namespace grapher.Layouts MidpointLayout = new OptionLayout(false, string.Empty); ButtonEnabled = true; + LogarithmicCharts = false; } /// /// Gets or sets mapping from acceleration type to identifying integer. /// Must match accel_mode defined in rawaccel-settings.h /// - public int Index { get; internal set; } + public int Index { get; protected set; } - public string Name { get; internal set; } + public string Name { get; protected set; } + + public bool LogarithmicCharts { get; protected set; } protected bool ButtonEnabled { get; set; } diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index 8afdc79..e87c851 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -9,6 +9,7 @@ namespace grapher.Layouts { Name = "Linear"; Index = (int)AccelMode.linear; + LogarithmicCharts = false; AccelLayout = new OptionLayout(true, Acceleration); CapLayout = new OptionLayout(true, Cap); diff --git a/grapher/Layouts/LogarithmLayout.cs b/grapher/Layouts/LogarithmLayout.cs index 5b25d60..e39dbe7 100644 --- a/grapher/Layouts/LogarithmLayout.cs +++ b/grapher/Layouts/LogarithmLayout.cs @@ -9,6 +9,7 @@ namespace grapher.Layouts { Name = "Logarithm"; Index = (int)AccelMode.logarithm; + LogarithmicCharts = false; AccelLayout = new OptionLayout(true, Scale); CapLayout = new OptionLayout(true, Cap); diff --git a/grapher/Layouts/NaturalGainLayout.cs b/grapher/Layouts/NaturalGainLayout.cs index dd2cc05..b9cf75e 100644 --- a/grapher/Layouts/NaturalGainLayout.cs +++ b/grapher/Layouts/NaturalGainLayout.cs @@ -9,6 +9,7 @@ namespace grapher.Layouts { Name = "NaturalGain"; Index = (int)AccelMode.naturalgain; + LogarithmicCharts = false; AccelLayout = new OptionLayout(true, Acceleration); CapLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index faa4730..59895df 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -9,6 +9,7 @@ namespace grapher.Layouts { Name = "Natural"; Index = (int)AccelMode.natural; + LogarithmicCharts = false; AccelLayout = new OptionLayout(true, Acceleration); CapLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index 85c8d3f..c47ea39 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -10,6 +10,7 @@ namespace grapher.Layouts Name = "Off"; Index = (int)AccelMode.noaccel; ButtonEnabled = true; + LogarithmicCharts = false; AccelLayout = new OptionLayout(false, string.Empty); CapLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index 2004f23..5391506 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -9,6 +9,7 @@ namespace grapher.Layouts { Name = "Power"; Index = (int)AccelMode.power; + LogarithmicCharts = false; AccelLayout = new OptionLayout(true, Acceleration); CapLayout = new OptionLayout(true, Cap); diff --git a/grapher/Layouts/SigmoidGainLayout.cs b/grapher/Layouts/SigmoidGainLayout.cs index c807439..684de83 100644 --- a/grapher/Layouts/SigmoidGainLayout.cs +++ b/grapher/Layouts/SigmoidGainLayout.cs @@ -9,6 +9,7 @@ namespace grapher.Layouts { Name = "SigmoidGain"; Index = (int)AccelMode.sigmoidgain; + LogarithmicCharts = false; AccelLayout = new OptionLayout(true, Acceleration); CapLayout = new OptionLayout(false, string.Empty); -- 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/Layouts/ExperimentOneLayout.cs | 27 --------------------------- grapher/Layouts/MotivityLayout.cs | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 grapher/Layouts/ExperimentOneLayout.cs create mode 100644 grapher/Layouts/MotivityLayout.cs (limited to 'grapher/Layouts') diff --git a/grapher/Layouts/ExperimentOneLayout.cs b/grapher/Layouts/ExperimentOneLayout.cs deleted file mode 100644 index ad6f61a..0000000 --- a/grapher/Layouts/ExperimentOneLayout.cs +++ /dev/null @@ -1,27 +0,0 @@ -using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace grapher.Layouts -{ - public class ExperimentOneLayout : LayoutBase - { - public ExperimentOneLayout() - : base() - { - Name = "Experiment 1"; - Index = (int)AccelMode.experimentone; - LogarithmicCharts = true; - - AccelLayout = new OptionLayout(true, Acceleration); - CapLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(true, Weight); - OffsetLayout = new OptionLayout(false, string.Empty); - LimExpLayout = new OptionLayout(true, Motility); - MidpointLayout = new OptionLayout(true, Midpoint); - } - } -} diff --git a/grapher/Layouts/MotivityLayout.cs b/grapher/Layouts/MotivityLayout.cs new file mode 100644 index 0000000..dfef2de --- /dev/null +++ b/grapher/Layouts/MotivityLayout.cs @@ -0,0 +1,27 @@ +using grapher.Models.Serialized; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher.Layouts +{ + public class MotivityLayout : LayoutBase + { + public MotivityLayout() + : base() + { + Name = "Motivity"; + Index = (int)AccelMode.motivity; + LogarithmicCharts = true; + + AccelLayout = new OptionLayout(true, Acceleration); + CapLayout = new OptionLayout(false, string.Empty); + WeightLayout = new OptionLayout(true, Weight); + OffsetLayout = new OptionLayout(false, string.Empty); + LimExpLayout = new OptionLayout(true, Motility); + MidpointLayout = new OptionLayout(true, Midpoint); + } + } +} -- 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/Layouts/SigmoidGainLayout.cs | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 grapher/Layouts/SigmoidGainLayout.cs (limited to 'grapher/Layouts') diff --git a/grapher/Layouts/SigmoidGainLayout.cs b/grapher/Layouts/SigmoidGainLayout.cs deleted file mode 100644 index 684de83..0000000 --- a/grapher/Layouts/SigmoidGainLayout.cs +++ /dev/null @@ -1,22 +0,0 @@ -using grapher.Models.Serialized; - -namespace grapher.Layouts -{ - public class SigmoidGainLayout : LayoutBase - { - public SigmoidGainLayout() - : base() - { - Name = "SigmoidGain"; - Index = (int)AccelMode.sigmoidgain; - LogarithmicCharts = false; - - AccelLayout = new OptionLayout(true, Acceleration); - CapLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(true, Weight); - OffsetLayout = new OptionLayout(false, string.Empty); - LimExpLayout = new OptionLayout(true, Limit); - MidpointLayout = new OptionLayout(true, Midpoint); - } - } -} -- cgit v1.2.3