diff options
Diffstat (limited to 'grapher/Layouts')
| -rw-r--r-- | grapher/Layouts/ClassicLayout.cs | 5 | ||||
| -rw-r--r-- | grapher/Layouts/DefaultLayout.cs | 5 | ||||
| -rw-r--r-- | grapher/Layouts/JumpLayout.cs | 27 | ||||
| -rw-r--r-- | grapher/Layouts/LUTLayout.cs | 38 | ||||
| -rw-r--r-- | grapher/Layouts/LayoutBase.cs | 52 | ||||
| -rw-r--r-- | grapher/Layouts/LinearLayout.cs | 11 | ||||
| -rw-r--r-- | grapher/Layouts/MotivityLayout.cs | 7 | ||||
| -rw-r--r-- | grapher/Layouts/NaturalGainLayout.cs | 24 | ||||
| -rw-r--r-- | grapher/Layouts/NaturalLayout.cs | 7 | ||||
| -rw-r--r-- | grapher/Layouts/OffLayout.cs | 5 | ||||
| -rw-r--r-- | grapher/Layouts/PowerLayout.cs | 9 | ||||
| -rw-r--r-- | grapher/Layouts/UnsupportedLayout.cs | 32 |
12 files changed, 175 insertions, 47 deletions
diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs index 8403c5d..ca9195e 100644 --- a/grapher/Layouts/ClassicLayout.cs +++ b/grapher/Layouts/ClassicLayout.cs @@ -8,8 +8,9 @@ namespace grapher.Layouts : base() { Name = "Classic"; - Index = (int)AccelMode.classic; + Mode = AccelMode.classic; + GainSwitchOptionLayout = new OptionLayout(true, Gain); AccelLayout = new OptionLayout(true, Acceleration); ScaleLayout = new OptionLayout(false, string.Empty); CapLayout = new OptionLayout(true, Cap); @@ -18,6 +19,8 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(true, Exponent); MidpointLayout = new OptionLayout(false, string.Empty); + LutTextLayout = new OptionLayout(false, string.Empty); + LutPanelLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index c2f7fd7..055536a 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -8,9 +8,10 @@ namespace grapher.Layouts : base() { Name = "Default"; - Index = (int)AccelMode.noaccel; + Mode = AccelMode.noaccel; LogarithmicCharts = false; + GainSwitchOptionLayout = new OptionLayout(true, Gain); AccelLayout = new OptionLayout(true, Acceleration); ScaleLayout = new OptionLayout(true, Scale); CapLayout = new OptionLayout(true, Cap); @@ -19,6 +20,8 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(true, Limit); ExponentLayout = new OptionLayout(true, Exponent); MidpointLayout = new OptionLayout(true, Midpoint); + LutTextLayout = new OptionLayout(false, string.Empty); + LutPanelLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/JumpLayout.cs b/grapher/Layouts/JumpLayout.cs new file mode 100644 index 0000000..4e34ef3 --- /dev/null +++ b/grapher/Layouts/JumpLayout.cs @@ -0,0 +1,27 @@ +using grapher.Models.Serialized; + +namespace grapher.Layouts +{ + public class JumpLayout : LayoutBase + { + public JumpLayout() + : base() + { + Name = "Jump"; + Mode = AccelMode.jump; + LogarithmicCharts = false; + + GainSwitchOptionLayout = new OptionLayout(true, Gain); + AccelLayout = new OptionLayout(true, Smooth); + ScaleLayout = new OptionLayout(false, string.Empty); + CapLayout = new OptionLayout(true, Cap); + WeightLayout = new OptionLayout(false, Weight); + OffsetLayout = new OptionLayout(true, Offset); + LimitLayout = new OptionLayout(false, Limit); + ExponentLayout = new OptionLayout(false, string.Empty); + MidpointLayout = new OptionLayout(false, string.Empty); + LutTextLayout = new OptionLayout(false, string.Empty); + LutPanelLayout = new OptionLayout(false, string.Empty); + } + } +} diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs new file mode 100644 index 0000000..1e0037f --- /dev/null +++ b/grapher/Layouts/LUTLayout.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher.Layouts +{ + public class LUTLayout : LayoutBase + { + /// <summary> + /// String small enough to fit in active value label + /// </summary> + public const string LUTActiveName = "LUT"; + + public LUTLayout() + : base() + { + Name = "LookUpTable"; + Mode = AccelMode.lut; + + GainSwitchOptionLayout = new OptionLayout(false, string.Empty); + AccelLayout = new OptionLayout(false, Acceleration); + ScaleLayout = new OptionLayout(false, string.Empty); + CapLayout = new OptionLayout(false, Cap); + WeightLayout = new OptionLayout(false, Weight); + OffsetLayout = new OptionLayout(false, Offset); + LimitLayout = new OptionLayout(false, string.Empty); + ExponentLayout = new OptionLayout(false, Exponent); + MidpointLayout = new OptionLayout(false, string.Empty); + LutTextLayout = new OptionLayout(true, string.Empty); + LutPanelLayout = new OptionLayout(true, string.Empty); + LutApplyOptionsLayout = new OptionLayout(true, string.Empty); + } + + public override string ActiveName => LUTActiveName; + } +} diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 83af292..db914dc 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -1,5 +1,4 @@ using grapher.Models.Options; -using System.Windows.Forms; namespace grapher.Layouts { @@ -14,6 +13,10 @@ namespace grapher.Layouts public const string Offset = "Offset"; public const string Cap = "Cap"; public const string Weight = "Weight"; + public const string Smooth = "Smooth"; + public const string Gain = "Gain"; + public const string GrowthRate = "Growth Rate"; + public const string DecayRate = "Decay Rate"; public LayoutBase() { @@ -25,18 +28,20 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); + LutTextLayout = new OptionLayout(false, string.Empty); + LutPanelLayout = new OptionLayout(false, string.Empty); + LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + GainSwitchOptionLayout = new OptionLayout(false, string.Empty); 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; protected set; } + public AccelMode Mode { get; protected set; } public string Name { get; protected set; } + public virtual string ActiveName { get => Name; } + public bool LogarithmicCharts { get; protected set; } protected OptionLayout AccelLayout { get; set; } @@ -55,7 +60,21 @@ namespace grapher.Layouts protected OptionLayout MidpointLayout { get; set; } + protected OptionLayout LutTextLayout { get; set; } + + protected OptionLayout LutPanelLayout { get; set; } + + protected OptionLayout LutApplyOptionsLayout { get; set; } + + protected OptionLayout GainSwitchOptionLayout { get; set; } + + public override string ToString() + { + return Name; + } + public void Layout( + IOption gainSwitchOption, IOption accelOption, IOption scaleOption, IOption capOption, @@ -64,12 +83,16 @@ namespace grapher.Layouts IOption limitOption, IOption expOption, IOption midpointOption, + IOption lutTextOption, + IOption lutPanelOption, + IOption lutApplyOption, int top) { IOption previous = null; foreach (var option in new (OptionLayout, IOption)[] { + (GainSwitchOptionLayout, gainSwitchOption), (AccelLayout, accelOption), (ScaleLayout, scaleOption), (CapLayout, capOption), @@ -77,7 +100,10 @@ namespace grapher.Layouts (OffsetLayout, offsetOption), (LimitLayout, limitOption), (ExponentLayout, expOption), - (MidpointLayout, midpointOption)}) + (MidpointLayout, midpointOption), + (LutTextLayout, lutTextOption), + (LutPanelLayout, lutPanelOption), + (LutApplyOptionsLayout, lutApplyOption)}) { option.Item1.Layout(option.Item2); @@ -98,6 +124,7 @@ namespace grapher.Layouts } public void Layout( + IOption gainSwitchOption, IOption accelOption, IOption scaleOption, IOption capOption, @@ -105,9 +132,13 @@ namespace grapher.Layouts IOption offsetOption, IOption limitOption, IOption expOption, - IOption midpointOption) + IOption midpointOption, + IOption lutTextOption, + IOption lutPanelOption, + IOption lutApplyOption) { - Layout(accelOption, + Layout(gainSwitchOption, + accelOption, scaleOption, capOption, weightOption, @@ -115,6 +146,9 @@ namespace grapher.Layouts limitOption, expOption, midpointOption, + lutTextOption, + lutPanelOption, + lutApplyOption, accelOption.Top); } } diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index 0412a2a..6447833 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -4,21 +4,26 @@ namespace grapher.Layouts { public class LinearLayout : LayoutBase { + public const string LinearName = "Linear"; + public LinearLayout() : base() { - Name = "Linear"; - Index = (int)AccelMode.linear; + Name = LinearName; + Mode = AccelMode.classic; LogarithmicCharts = false; + GainSwitchOptionLayout = new OptionLayout(true, Gain); AccelLayout = new OptionLayout(true, Acceleration); ScaleLayout = new OptionLayout(false, string.Empty); CapLayout = new OptionLayout(true, Cap); - WeightLayout = new OptionLayout(true, Weight); + WeightLayout = new OptionLayout(false, Weight); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); + LutTextLayout = new OptionLayout(false, string.Empty); + LutPanelLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/MotivityLayout.cs b/grapher/Layouts/MotivityLayout.cs index b06e4fc..7ab2f3f 100644 --- a/grapher/Layouts/MotivityLayout.cs +++ b/grapher/Layouts/MotivityLayout.cs @@ -13,10 +13,11 @@ namespace grapher.Layouts : base() { Name = "Motivity"; - Index = (int)AccelMode.motivity; + Mode = AccelMode.motivity; LogarithmicCharts = true; - AccelLayout = new OptionLayout(true, Acceleration); + GainSwitchOptionLayout = new OptionLayout(true, Gain); + AccelLayout = new OptionLayout(true, GrowthRate); ScaleLayout = new OptionLayout(false, string.Empty); CapLayout = new OptionLayout(false, string.Empty); WeightLayout = new OptionLayout(false, string.Empty); @@ -24,6 +25,8 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(true, Motivity); ExponentLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(true, Midpoint); + LutTextLayout = new OptionLayout(false, string.Empty); + LutPanelLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/NaturalGainLayout.cs b/grapher/Layouts/NaturalGainLayout.cs deleted file mode 100644 index 12daed3..0000000 --- a/grapher/Layouts/NaturalGainLayout.cs +++ /dev/null @@ -1,24 +0,0 @@ -using grapher.Models.Serialized; - -namespace grapher.Layouts -{ - public class NaturalGainLayout : LayoutBase - { - public NaturalGainLayout() - : base() - { - Name = "NaturalGain"; - Index = (int)AccelMode.naturalgain; - LogarithmicCharts = false; - - AccelLayout = new OptionLayout(true, Acceleration); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(true, Weight); - OffsetLayout = new OptionLayout(true, Offset); - LimitLayout = new OptionLayout(true, Limit); - ExponentLayout = new OptionLayout(false, string.Empty); - MidpointLayout = new OptionLayout(false, string.Empty); - } - } -} diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index 44129f9..245a37b 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -8,10 +8,11 @@ namespace grapher.Layouts : base() { Name = "Natural"; - Index = (int)AccelMode.natural; + Mode = AccelMode.natural; LogarithmicCharts = false; - AccelLayout = new OptionLayout(true, Acceleration); + GainSwitchOptionLayout = new OptionLayout(true, Gain); + AccelLayout = new OptionLayout(true, DecayRate); ScaleLayout = new OptionLayout(false, string.Empty); CapLayout = new OptionLayout(false, string.Empty); WeightLayout = new OptionLayout(true, Weight); @@ -19,6 +20,8 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(true, Limit); ExponentLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); + LutTextLayout = new OptionLayout(false, string.Empty); + LutPanelLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index 0b54cbb..16e5c19 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -8,9 +8,10 @@ namespace grapher.Layouts : base() { Name = "Off"; - Index = (int)AccelMode.noaccel; + Mode = AccelMode.noaccel; LogarithmicCharts = false; + GainSwitchOptionLayout = new OptionLayout(false, string.Empty); AccelLayout = new OptionLayout(false, string.Empty); ScaleLayout = new OptionLayout(false, string.Empty); CapLayout = new OptionLayout(false, string.Empty); @@ -19,6 +20,8 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); + LutTextLayout = new OptionLayout(false, string.Empty); + LutPanelLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index da7d5bb..bf40c24 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -1,6 +1,4 @@ -using grapher.Models.Serialized; - -namespace grapher.Layouts +namespace grapher.Layouts { public class PowerLayout : LayoutBase { @@ -8,9 +6,10 @@ namespace grapher.Layouts : base() { Name = "Power"; - Index = (int)AccelMode.power; + Mode = AccelMode.power; LogarithmicCharts = false; + GainSwitchOptionLayout = new OptionLayout(true, Gain); AccelLayout = new OptionLayout(false, string.Empty); ScaleLayout = new OptionLayout(true, Scale); CapLayout = new OptionLayout(true, Cap); @@ -19,6 +18,8 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(true, Exponent); MidpointLayout = new OptionLayout(false, string.Empty); + LutTextLayout = new OptionLayout(false, string.Empty); + LutPanelLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/UnsupportedLayout.cs b/grapher/Layouts/UnsupportedLayout.cs new file mode 100644 index 0000000..c17812d --- /dev/null +++ b/grapher/Layouts/UnsupportedLayout.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher.Layouts +{ + public class UnsupportedLayout : LayoutBase + { + public const string LUTLayoutText = "This mode is unsupported by this program. See the guide for details."; + + public UnsupportedLayout() + : base() + { + Name = "Unsupported"; + Mode = AccelMode.noaccel + 1; + + GainSwitchOptionLayout = new OptionLayout(false, string.Empty); + AccelLayout = new OptionLayout(false, Acceleration); + ScaleLayout = new OptionLayout(false, string.Empty); + CapLayout = new OptionLayout(false, Cap); + WeightLayout = new OptionLayout(false, Weight); + OffsetLayout = new OptionLayout(false, Offset); + LimitLayout = new OptionLayout(false, string.Empty); + ExponentLayout = new OptionLayout(false, Exponent); + MidpointLayout = new OptionLayout(false, string.Empty); + LutTextLayout = new OptionLayout(true, LUTLayoutText); + LutPanelLayout = new OptionLayout(false, string.Empty); + } + } +}
\ No newline at end of file |