diff options
Diffstat (limited to 'grapher/Layouts')
| -rw-r--r-- | grapher/Layouts/DefaultLayout.cs | 1 | ||||
| -rw-r--r-- | grapher/Layouts/LayoutBase.cs | 34 | ||||
| -rw-r--r-- | grapher/Layouts/LinearLayout.cs | 1 | ||||
| -rw-r--r-- | grapher/Layouts/LogarithmLayout.cs | 1 | ||||
| -rw-r--r-- | grapher/Layouts/MotivityLayout.cs (renamed from grapher/Layouts/SigmoidGainLayout.cs) | 16 | ||||
| -rw-r--r-- | grapher/Layouts/NaturalGainLayout.cs | 1 | ||||
| -rw-r--r-- | grapher/Layouts/NaturalLayout.cs | 1 | ||||
| -rw-r--r-- | grapher/Layouts/OffLayout.cs | 1 | ||||
| -rw-r--r-- | grapher/Layouts/PowerLayout.cs | 1 |
9 files changed, 38 insertions, 19 deletions
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/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 6ed8fee..b89e2f7 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"; @@ -24,15 +25,18 @@ namespace grapher.Layouts MidpointLayout = new OptionLayout(false, string.Empty); ButtonEnabled = true; + LogarithmicCharts = false; } /// <summary> /// Gets or sets mapping from acceleration type to identifying integer. /// Must match accel_mode defined in rawaccel-settings.h /// </summary> - 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; } @@ -58,30 +62,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; } } } 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/SigmoidGainLayout.cs b/grapher/Layouts/MotivityLayout.cs index c807439..dfef2de 100644 --- a/grapher/Layouts/SigmoidGainLayout.cs +++ b/grapher/Layouts/MotivityLayout.cs @@ -1,20 +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 SigmoidGainLayout : LayoutBase + public class MotivityLayout : LayoutBase { - public SigmoidGainLayout() + public MotivityLayout() : base() { - Name = "SigmoidGain"; - Index = (int)AccelMode.sigmoidgain; + 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, Limit); + LimExpLayout = new OptionLayout(true, Motility); MidpointLayout = new OptionLayout(true, Midpoint); } } 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); |