diff options
| author | Jacob Palecki <[email protected]> | 2021-04-07 01:05:59 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2021-04-07 01:05:59 -0700 |
| commit | 5e858b059436375ed1c17f7dc1b3e47a7e8e1d5d (patch) | |
| tree | ea56892ee71c0d245d99c348676e84b10928013c | |
| parent | natural legacy algorithm was correct, leave as it was (diff) | |
| download | rawaccel-5e858b059436375ed1c17f7dc1b3e47a7e8e1d5d.tar.xz rawaccel-5e858b059436375ed1c17f7dc1b3e47a7e8e1d5d.zip | |
Add active value labels for gain switch
| -rw-r--r-- | common/rawaccel-base.hpp | 1 | ||||
| -rw-r--r-- | grapher/Form1.Designer.cs | 24 | ||||
| -rw-r--r-- | grapher/Form1.cs | 2 | ||||
| -rw-r--r-- | grapher/Layouts/LayoutBase.cs | 1 | ||||
| -rw-r--r-- | grapher/Models/AccelGUI.cs | 1 | ||||
| -rw-r--r-- | grapher/Models/AccelGUIFactory.cs | 10 | ||||
| -rw-r--r-- | grapher/Models/Options/AccelTypeOptions.cs | 5 | ||||
| -rw-r--r-- | grapher/Models/Options/CheckBoxOption.cs | 18 | ||||
| -rw-r--r-- | wrapper/wrapper.cpp | 2 |
9 files changed, 58 insertions, 6 deletions
diff --git a/common/rawaccel-base.hpp b/common/rawaccel-base.hpp index 7dc1b96..6ce4468 100644 --- a/common/rawaccel-base.hpp +++ b/common/rawaccel-base.hpp @@ -23,6 +23,7 @@ namespace rawaccel { natural, power, motivity, + lookuptable, noaccel }; diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 34ad2eb..995a0b7 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -186,6 +186,8 @@ namespace grapher this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.gainSwitchActiveLabelX = new System.Windows.Forms.Label(); + this.gainSwitchActiveLabelY = new System.Windows.Forms.Label(); this.optionsPanel.SuspendLayout(); this.DirectionalityPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -201,6 +203,8 @@ namespace grapher // optionsPanel // this.optionsPanel.AutoSize = true; + this.optionsPanel.Controls.Add(this.gainSwitchActiveLabelY); + this.optionsPanel.Controls.Add(this.gainSwitchActiveLabelX); this.optionsPanel.Controls.Add(this.gainSwitchY); this.optionsPanel.Controls.Add(this.gainSwitchX); this.optionsPanel.Controls.Add(this.LUTTextLabelY); @@ -1493,6 +1497,24 @@ namespace grapher title6.Text = "Sensitivity"; this.AccelerationChart.Titles.Add(title6); // + // gainSwitchActiveLabelX + // + this.gainSwitchActiveLabelX.AutoSize = true; + this.gainSwitchActiveLabelX.Location = new System.Drawing.Point(200, 96); + this.gainSwitchActiveLabelX.Name = "gainSwitchActiveLabelX"; + this.gainSwitchActiveLabelX.Size = new System.Drawing.Size(29, 13); + this.gainSwitchActiveLabelX.TabIndex = 156; + this.gainSwitchActiveLabelX.Text = "Gain"; + // + // gainSwitchActiveLabelY + // + this.gainSwitchActiveLabelY.AutoSize = true; + this.gainSwitchActiveLabelY.Location = new System.Drawing.Point(417, 95); + this.gainSwitchActiveLabelY.Name = "gainSwitchActiveLabelY"; + this.gainSwitchActiveLabelY.Size = new System.Drawing.Size(29, 13); + this.gainSwitchActiveLabelY.TabIndex = 157; + this.gainSwitchActiveLabelY.Text = "Gain"; + // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1638,6 +1660,8 @@ namespace grapher private System.Windows.Forms.Label LUTTextLabelY; private System.Windows.Forms.CheckBox gainSwitchX; private System.Windows.Forms.CheckBox gainSwitchY; + private System.Windows.Forms.Label gainSwitchActiveLabelY; + private System.Windows.Forms.Label gainSwitchActiveLabelX; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index c7c2723..7b21036 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -144,6 +144,8 @@ namespace grapher MidpointActiveYLabel, AccelTypeActiveLabelX, AccelTypeActiveLabelY, + gainSwitchActiveLabelX, + gainSwitchActiveLabelY, OptionSetXTitle, OptionSetYTitle, MouseLabel, diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index d9d85b1..e3583c4 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 { diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 9ed2cb9..ec570d3 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -154,6 +154,7 @@ namespace grapher { UpdateGraph(); UpdateInputManagers(); + UpdateShownActiveValues(Settings.UserSettings); } public void RefreshUser() diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 6bfc510..73be939 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -110,6 +110,8 @@ namespace grapher.Models Label midpointActiveLabelY, Label accelTypeActiveLabelX, Label accelTypeActiveLabelY, + Label gainSwitchActiveLabelX, + Label gainSwitchActiveLabelY, Label optionSetXTitle, Label optionSetYTitle, Label mouseLabel, @@ -315,8 +317,12 @@ namespace grapher.Models var lutTextX = new TextOption(lutTextLabelX); var lutTextY = new TextOption(lutTextLabelY); - var gainSwitchOptionX = new CheckBoxOption(gainSwitchX); - var gainSwitchOptionY = new CheckBoxOption(gainSwitchY); + var gainSwitchOptionX = new CheckBoxOption( + gainSwitchX, + new ActiveValueLabel(gainSwitchActiveLabelX, activeValueTitleX)); + var gainSwitchOptionY = new CheckBoxOption( + gainSwitchY, + new ActiveValueLabel(gainSwitchActiveLabelY, activeValueTitleY)); var accelerationOptionsX = new AccelTypeOptions( accelTypeDropX, diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index a271ea4..b12ad8a 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -205,8 +205,10 @@ namespace grapher { AccelerationType = AccelTypeFromSettings(args); AccelTypeActiveValue.SetValue(AccelerationType.Name); - AccelDropdown.SelectedIndex = AccelerationType.Index; + // Add one to include linear, which is not represented separately in the config + AccelDropdown.SelectedIndex = AccelerationType.Index + 1; + GainSwitch.SetActiveValue(args.legacy); Weight.SetActiveValue(args.weight); Cap.SetActiveValue(args.cap); Offset.SetActiveValue(args.offset); @@ -281,6 +283,7 @@ namespace grapher public override void AlignActiveValues() { AccelTypeActiveValue.Align(); + GainSwitch.AlignActiveValues(); Acceleration.AlignActiveValues(); Scale.AlignActiveValues(); Cap.AlignActiveValues(); diff --git a/grapher/Models/Options/CheckBoxOption.cs b/grapher/Models/Options/CheckBoxOption.cs index 83b2d7a..abf96d3 100644 --- a/grapher/Models/Options/CheckBoxOption.cs +++ b/grapher/Models/Options/CheckBoxOption.cs @@ -4,14 +4,19 @@ namespace grapher.Models.Options { public class CheckBoxOption : OptionBase { - public CheckBoxOption(CheckBox checkBox) + public CheckBoxOption( + CheckBox checkBox, + ActiveValueLabel activeValueLabel) { CheckBox = checkBox; + ActiveValueLabel = activeValueLabel; Show(string.Empty); } public CheckBox CheckBox { get; } + public ActiveValueLabel ActiveValueLabel { get; } + public override bool Visible { get @@ -49,6 +54,7 @@ namespace grapher.Models.Options set { CheckBox.Top = value; + ActiveValueLabel.Top = value; } } @@ -73,6 +79,7 @@ namespace grapher.Models.Options public override void AlignActiveValues() { + ActiveValueLabel.Align(); } public override void Hide() @@ -80,6 +87,7 @@ namespace grapher.Models.Options CheckBox.Hide(); ShouldShow = false; CheckBox.Enabled = false; + ActiveValueLabel.Hide(); } public override void Show(string Name) @@ -88,6 +96,14 @@ namespace grapher.Models.Options ShouldShow = true; CheckBox.Enabled = true; CheckBox.Name = Name; + ActiveValueLabel.Show(); + } + + public void SetActiveValue(bool legacy) + { + CheckBox.Checked = !legacy; + var activeValueString = legacy ? "Legacy" : "Gain"; + ActiveValueLabel.SetValue(activeValueString); } } } diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp index a28e199..7992de6 100644 --- a/wrapper/wrapper.cpp +++ b/wrapper/wrapper.cpp @@ -20,7 +20,7 @@ ra::settings default_settings; [JsonConverter(Converters::StringEnumConverter::typeid)] public enum class AccelMode { - classic, jump, natural, power, motivity, noaccel + classic, jump, natural, power, motivity, lut, noaccel }; [JsonConverter(Converters::StringEnumConverter::typeid)] |