summaryrefslogtreecommitdiff
path: root/grapher/Layouts
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-04-13 23:59:21 -0400
committera1xd <[email protected]>2021-04-13 23:59:21 -0400
commita6926be0e911b7b7637861866f41c3bca31a87a3 (patch)
treea8d7cd5afb4c093e6f97e8d772b139dd5d749988 /grapher/Layouts
parentadditional fixes (diff)
downloadrawaccel-a6926be0e911b7b7637861866f41c3bca31a87a3.tar.xz
rawaccel-a6926be0e911b7b7637861866f41c3bca31a87a3.zip
move arbitrary input into settings
separate arbitrary mode from spaced modes, arbitrary now deserializes from default settings file
Diffstat (limited to 'grapher/Layouts')
-rw-r--r--grapher/Layouts/ClassicLayout.cs2
-rw-r--r--grapher/Layouts/DefaultLayout.cs2
-rw-r--r--grapher/Layouts/JumpLayout.cs2
-rw-r--r--grapher/Layouts/LUTLayout.cs2
-rw-r--r--grapher/Layouts/LayoutBase.cs11
-rw-r--r--grapher/Layouts/LinearLayout.cs2
-rw-r--r--grapher/Layouts/MotivityLayout.cs2
-rw-r--r--grapher/Layouts/NaturalLayout.cs2
-rw-r--r--grapher/Layouts/OffLayout.cs2
-rw-r--r--grapher/Layouts/PowerLayout.cs2
-rw-r--r--grapher/Layouts/UnsupportedLayout.cs31
11 files changed, 46 insertions, 14 deletions
diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs
index e9013b6..fe5c25d 100644
--- a/grapher/Layouts/ClassicLayout.cs
+++ b/grapher/Layouts/ClassicLayout.cs
@@ -8,7 +8,7 @@ namespace grapher.Layouts
: base()
{
Name = "Classic";
- Index = (int)AccelMode.classic;
+ Mode = AccelMode.classic;
GainSwitchOptionLayout = new OptionLayout(true, Gain);
AccelLayout = new OptionLayout(true, Acceleration);
diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs
index 42de7f3..8146255 100644
--- a/grapher/Layouts/DefaultLayout.cs
+++ b/grapher/Layouts/DefaultLayout.cs
@@ -8,7 +8,7 @@ namespace grapher.Layouts
: base()
{
Name = "Default";
- Index = (int)AccelMode.noaccel;
+ Mode = AccelMode.noaccel;
LogarithmicCharts = false;
GainSwitchOptionLayout = new OptionLayout(true, Gain);
diff --git a/grapher/Layouts/JumpLayout.cs b/grapher/Layouts/JumpLayout.cs
index d78d273..cf5eb24 100644
--- a/grapher/Layouts/JumpLayout.cs
+++ b/grapher/Layouts/JumpLayout.cs
@@ -8,7 +8,7 @@ namespace grapher.Layouts
: base()
{
Name = "Jump";
- Index = (int)AccelMode.jump;
+ Mode = AccelMode.jump;
LogarithmicCharts = false;
GainSwitchOptionLayout = new OptionLayout(true, Gain);
diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs
index fd0b75a..5505114 100644
--- a/grapher/Layouts/LUTLayout.cs
+++ b/grapher/Layouts/LUTLayout.cs
@@ -14,7 +14,7 @@ namespace grapher.Layouts
: base()
{
Name = "LookUpTable";
- Index = (int)AccelMode.noaccel + 1;
+ Mode = AccelMode.lut;
GainSwitchOptionLayout = new OptionLayout(false, string.Empty);
AccelLayout = new OptionLayout(false, Acceleration);
diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs
index e3583c4..900d611 100644
--- a/grapher/Layouts/LayoutBase.cs
+++ b/grapher/Layouts/LayoutBase.cs
@@ -34,11 +34,7 @@ namespace grapher.Layouts
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; }
@@ -64,6 +60,11 @@ namespace grapher.Layouts
protected OptionLayout GainSwitchOptionLayout { get; set; }
+ public override string ToString()
+ {
+ return Name;
+ }
+
public void Layout(
IOption gainSwitchOption,
IOption accelOption,
diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs
index 31ae353..88be3d4 100644
--- a/grapher/Layouts/LinearLayout.cs
+++ b/grapher/Layouts/LinearLayout.cs
@@ -10,7 +10,7 @@ namespace grapher.Layouts
: base()
{
Name = LinearName;
- Index = (int)AccelMode.classic;
+ Mode = AccelMode.classic;
LogarithmicCharts = false;
GainSwitchOptionLayout = new OptionLayout(true, Gain);
diff --git a/grapher/Layouts/MotivityLayout.cs b/grapher/Layouts/MotivityLayout.cs
index e9c81f4..7458dfc 100644
--- a/grapher/Layouts/MotivityLayout.cs
+++ b/grapher/Layouts/MotivityLayout.cs
@@ -13,7 +13,7 @@ namespace grapher.Layouts
: base()
{
Name = "Motivity";
- Index = (int)AccelMode.motivity;
+ Mode = AccelMode.motivity;
LogarithmicCharts = true;
GainSwitchOptionLayout = new OptionLayout(true, Gain);
diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs
index 070a249..ece2b00 100644
--- a/grapher/Layouts/NaturalLayout.cs
+++ b/grapher/Layouts/NaturalLayout.cs
@@ -8,7 +8,7 @@ namespace grapher.Layouts
: base()
{
Name = "Natural";
- Index = (int)AccelMode.natural;
+ Mode = AccelMode.natural;
LogarithmicCharts = false;
GainSwitchOptionLayout = new OptionLayout(true, Gain);
diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs
index 9c56632..e802113 100644
--- a/grapher/Layouts/OffLayout.cs
+++ b/grapher/Layouts/OffLayout.cs
@@ -8,7 +8,7 @@ namespace grapher.Layouts
: base()
{
Name = "Off";
- Index = (int)AccelMode.noaccel;
+ Mode = AccelMode.noaccel;
LogarithmicCharts = false;
GainSwitchOptionLayout = new OptionLayout(false, string.Empty);
diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs
index 8304ccf..bb07457 100644
--- a/grapher/Layouts/PowerLayout.cs
+++ b/grapher/Layouts/PowerLayout.cs
@@ -6,7 +6,7 @@
: base()
{
Name = "Power";
- Index = (int)AccelMode.power;
+ Mode = AccelMode.power;
LogarithmicCharts = false;
GainSwitchOptionLayout = new OptionLayout(true, Gain);
diff --git a/grapher/Layouts/UnsupportedLayout.cs b/grapher/Layouts/UnsupportedLayout.cs
new file mode 100644
index 0000000..1607a6c
--- /dev/null
+++ b/grapher/Layouts/UnsupportedLayout.cs
@@ -0,0 +1,31 @@
+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);
+ }
+ }
+} \ No newline at end of file