summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grapher/Form1.Designer.cs48
-rw-r--r--grapher/Form1.cs2
-rw-r--r--grapher/Layouts/ClassicLayout.cs1
-rw-r--r--grapher/Layouts/DefaultLayout.cs1
-rw-r--r--grapher/Layouts/JumpLayout.cs6
-rw-r--r--grapher/Layouts/LUTLayout.cs1
-rw-r--r--grapher/Layouts/LayoutBase.cs12
-rw-r--r--grapher/Layouts/LinearLayout.cs1
-rw-r--r--grapher/Layouts/MotivityLayout.cs1
-rw-r--r--grapher/Layouts/NaturalLayout.cs1
-rw-r--r--grapher/Layouts/OffLayout.cs1
-rw-r--r--grapher/Layouts/PowerLayout.cs5
-rw-r--r--grapher/Models/AccelGUIFactory.cs6
-rw-r--r--grapher/Models/Options/AccelTypeOptions.cs28
-rw-r--r--grapher/Models/Options/CheckBoxOption.cs81
-rw-r--r--grapher/grapher.csproj1
16 files changed, 181 insertions, 15 deletions
diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs
index 488d6bb..e0c44bc 100644
--- a/grapher/Form1.Designer.cs
+++ b/grapher/Form1.Designer.cs
@@ -71,6 +71,7 @@ namespace grapher
System.Windows.Forms.DataVisualization.Charting.Title title6 = new System.Windows.Forms.DataVisualization.Charting.Title();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RawAcceleration));
this.optionsPanel = new System.Windows.Forms.Panel();
+ this.LUTTextLabelY = new System.Windows.Forms.Label();
this.LUTTextLabelX = new System.Windows.Forms.Label();
this.FakeBox = new System.Windows.Forms.CheckBox();
this.DirectionalityPanel = new System.Windows.Forms.Panel();
@@ -189,7 +190,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.LUTTextLabelY = new System.Windows.Forms.Label();
+ this.gainSwitchX = new System.Windows.Forms.CheckBox();
+ this.gainSwitchY = new System.Windows.Forms.CheckBox();
this.optionsPanel.SuspendLayout();
this.DirectionalityPanel.SuspendLayout();
this.menuStrip1.SuspendLayout();
@@ -205,6 +207,8 @@ namespace grapher
// optionsPanel
//
this.optionsPanel.AutoSize = true;
+ this.optionsPanel.Controls.Add(this.gainSwitchY);
+ this.optionsPanel.Controls.Add(this.gainSwitchX);
this.optionsPanel.Controls.Add(this.LUTTextLabelY);
this.optionsPanel.Controls.Add(this.LUTTextLabelX);
this.optionsPanel.Controls.Add(this.FakeBox);
@@ -287,6 +291,15 @@ namespace grapher
this.optionsPanel.Size = new System.Drawing.Size(483, 956);
this.optionsPanel.TabIndex = 34;
//
+ // LUTTextLabelY
+ //
+ this.LUTTextLabelY.AutoSize = true;
+ this.LUTTextLabelY.Location = new System.Drawing.Point(266, 350);
+ this.LUTTextLabelY.Name = "LUTTextLabelY";
+ this.LUTTextLabelY.Size = new System.Drawing.Size(52, 13);
+ this.LUTTextLabelY.TabIndex = 153;
+ this.LUTTextLabelY.Text = "LUT Text";
+ //
// LUTTextLabelX
//
this.LUTTextLabelX.AutoSize = true;
@@ -1508,14 +1521,29 @@ namespace grapher
title6.Text = "Sensitivity";
this.AccelerationChart.Titles.Add(title6);
//
- // LUTTextLabelY
- //
- this.LUTTextLabelY.AutoSize = true;
- this.LUTTextLabelY.Location = new System.Drawing.Point(266, 350);
- this.LUTTextLabelY.Name = "LUTTextLabelY";
- this.LUTTextLabelY.Size = new System.Drawing.Size(52, 13);
- this.LUTTextLabelY.TabIndex = 153;
- this.LUTTextLabelY.Text = "LUT Text";
+ // gainSwitchX
+ //
+ this.gainSwitchX.AutoSize = true;
+ this.gainSwitchX.Checked = true;
+ this.gainSwitchX.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.gainSwitchX.Location = new System.Drawing.Point(38, 116);
+ this.gainSwitchX.Name = "gainSwitchX";
+ this.gainSwitchX.Size = new System.Drawing.Size(48, 17);
+ this.gainSwitchX.TabIndex = 154;
+ this.gainSwitchX.Text = "Gain";
+ this.gainSwitchX.UseVisualStyleBackColor = true;
+ //
+ // gainSwitchY
+ //
+ this.gainSwitchY.AutoSize = true;
+ this.gainSwitchY.Checked = true;
+ this.gainSwitchY.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.gainSwitchY.Location = new System.Drawing.Point(283, 116);
+ this.gainSwitchY.Name = "gainSwitchY";
+ this.gainSwitchY.Size = new System.Drawing.Size(48, 17);
+ this.gainSwitchY.TabIndex = 155;
+ this.gainSwitchY.Text = "Gain";
+ this.gainSwitchY.UseVisualStyleBackColor = true;
//
// RawAcceleration
//
@@ -1666,6 +1694,8 @@ namespace grapher
private System.Windows.Forms.ToolStripMenuItem UseSpecificDeviceMenuItem;
private System.Windows.Forms.Label LUTTextLabelX;
private System.Windows.Forms.Label LUTTextLabelY;
+ private System.Windows.Forms.CheckBox gainSwitchX;
+ private System.Windows.Forms.CheckBox gainSwitchY;
}
}
diff --git a/grapher/Form1.cs b/grapher/Form1.cs
index 6ed9c46..5d0b805 100644
--- a/grapher/Form1.cs
+++ b/grapher/Form1.cs
@@ -102,6 +102,8 @@ namespace grapher
FakeBox,
WholeCheckBox,
ByComponentCheckBox,
+ gainSwitchX,
+ gainSwitchY,
LockXYLabel,
sensitivityLabel,
rotationLabel,
diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs
index c804282..e9013b6 100644
--- a/grapher/Layouts/ClassicLayout.cs
+++ b/grapher/Layouts/ClassicLayout.cs
@@ -10,6 +10,7 @@ namespace grapher.Layouts
Name = "Classic";
Index = (int)AccelMode.classic;
+ GainSwitchOptionLayout = new OptionLayout(true, Gain);
AccelLayout = new OptionLayout(true, Acceleration);
ScaleLayout = new OptionLayout(false, string.Empty);
CapLayout = new OptionLayout(true, Cap);
diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs
index 495fac0..42de7f3 100644
--- a/grapher/Layouts/DefaultLayout.cs
+++ b/grapher/Layouts/DefaultLayout.cs
@@ -11,6 +11,7 @@ namespace grapher.Layouts
Index = (int)AccelMode.noaccel;
LogarithmicCharts = false;
+ GainSwitchOptionLayout = new OptionLayout(true, Gain);
AccelLayout = new OptionLayout(true, Acceleration);
ScaleLayout = new OptionLayout(true, Scale);
CapLayout = new OptionLayout(true, Cap);
diff --git a/grapher/Layouts/JumpLayout.cs b/grapher/Layouts/JumpLayout.cs
index cb77963..d78d273 100644
--- a/grapher/Layouts/JumpLayout.cs
+++ b/grapher/Layouts/JumpLayout.cs
@@ -11,14 +11,16 @@ namespace grapher.Layouts
Index = (int)AccelMode.jump;
LogarithmicCharts = false;
- AccelLayout = new OptionLayout(false, Acceleration);
+ GainSwitchOptionLayout = new OptionLayout(true, Gain);
+ AccelLayout = new OptionLayout(true, Smooth);
ScaleLayout = new OptionLayout(false, string.Empty);
- CapLayout = new OptionLayout(true, 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);
}
}
}
diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs
index 4b4b687..fd0b75a 100644
--- a/grapher/Layouts/LUTLayout.cs
+++ b/grapher/Layouts/LUTLayout.cs
@@ -16,6 +16,7 @@ namespace grapher.Layouts
Name = "LookUpTable";
Index = (int)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);
diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs
index 1d2615d..6343ca2 100644
--- a/grapher/Layouts/LayoutBase.cs
+++ b/grapher/Layouts/LayoutBase.cs
@@ -14,6 +14,8 @@ 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 LayoutBase()
{
@@ -25,6 +27,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);
+ GainSwitchOptionLayout = new OptionLayout(false, string.Empty);
LogarithmicCharts = false;
}
@@ -57,7 +61,10 @@ namespace grapher.Layouts
protected OptionLayout LUTTextLayout { get; set; }
+ protected OptionLayout GainSwitchOptionLayout { get; set; }
+
public void Layout(
+ IOption gainSwitchOption,
IOption accelOption,
IOption scaleOption,
IOption capOption,
@@ -73,6 +80,7 @@ namespace grapher.Layouts
IOption previous = null;
foreach (var option in new (OptionLayout, IOption)[] {
+ (GainSwitchOptionLayout, gainSwitchOption),
(AccelLayout, accelOption),
(ScaleLayout, scaleOption),
(CapLayout, capOption),
@@ -102,6 +110,7 @@ namespace grapher.Layouts
}
public void Layout(
+ IOption gainSwitchOption,
IOption accelOption,
IOption scaleOption,
IOption capOption,
@@ -112,7 +121,8 @@ namespace grapher.Layouts
IOption midpointOption,
IOption lutTextOption)
{
- Layout(accelOption,
+ Layout(gainSwitchOption,
+ accelOption,
scaleOption,
capOption,
weightOption,
diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs
index d98baa5..31ae353 100644
--- a/grapher/Layouts/LinearLayout.cs
+++ b/grapher/Layouts/LinearLayout.cs
@@ -13,6 +13,7 @@ namespace grapher.Layouts
Index = (int)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);
diff --git a/grapher/Layouts/MotivityLayout.cs b/grapher/Layouts/MotivityLayout.cs
index 4d7c150..d108d16 100644
--- a/grapher/Layouts/MotivityLayout.cs
+++ b/grapher/Layouts/MotivityLayout.cs
@@ -16,6 +16,7 @@ namespace grapher.Layouts
Index = (int)AccelMode.motivity;
LogarithmicCharts = true;
+ GainSwitchOptionLayout = new OptionLayout(true, Gain);
AccelLayout = new OptionLayout(true, Acceleration);
ScaleLayout = new OptionLayout(false, string.Empty);
CapLayout = new OptionLayout(false, string.Empty);
diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs
index ac07ae5..9fc54fc 100644
--- a/grapher/Layouts/NaturalLayout.cs
+++ b/grapher/Layouts/NaturalLayout.cs
@@ -11,6 +11,7 @@ namespace grapher.Layouts
Index = (int)AccelMode.natural;
LogarithmicCharts = false;
+ GainSwitchOptionLayout = new OptionLayout(true, Gain);
AccelLayout = new OptionLayout(true, Acceleration);
ScaleLayout = new OptionLayout(false, string.Empty);
CapLayout = new OptionLayout(false, string.Empty);
diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs
index 2a361fb..9c56632 100644
--- a/grapher/Layouts/OffLayout.cs
+++ b/grapher/Layouts/OffLayout.cs
@@ -11,6 +11,7 @@ namespace grapher.Layouts
Index = (int)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);
diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs
index ed40d67..8304ccf 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
{
@@ -11,6 +9,7 @@ namespace grapher.Layouts
Index = (int)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);
diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs
index e3a16b6..6e03293 100644
--- a/grapher/Models/AccelGUIFactory.cs
+++ b/grapher/Models/AccelGUIFactory.cs
@@ -68,6 +68,8 @@ namespace grapher.Models
CheckBox fakeBox,
CheckBox wholeCheckBox,
CheckBox byComponentCheckBox,
+ CheckBox gainSwitchX,
+ CheckBox gainSwitchY,
Label lockXYLabel,
Label sensitivityLabel,
Label rotationLabel,
@@ -336,9 +338,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 accelerationOptionsX = new AccelTypeOptions(
accelTypeDropX,
+ gainSwitchOptionX,
accelerationX,
scaleX,
capOptionsX,
@@ -353,6 +358,7 @@ namespace grapher.Models
var accelerationOptionsY = new AccelTypeOptions(
accelTypeDropY,
+ gainSwitchOptionY,
accelerationY,
scaleY,
capOptionsY,
diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs
index 68eccf5..d29f6a8 100644
--- a/grapher/Models/Options/AccelTypeOptions.cs
+++ b/grapher/Models/Options/AccelTypeOptions.cs
@@ -32,6 +32,7 @@ namespace grapher
public AccelTypeOptions(
ComboBox accelDropdown,
+ CheckBoxOption gainSwitch,
Option acceleration,
Option scale,
CapOptions cap,
@@ -49,6 +50,7 @@ namespace grapher
AccelDropdown.Items.AddRange(AccelerationTypes.Keys.ToArray());
AccelDropdown.SelectedIndexChanged += new System.EventHandler(OnIndexChanged);
+ GainSwitch = gainSwitch;
Acceleration = acceleration;
Scale = scale;
Cap = cap;
@@ -107,6 +109,8 @@ namespace grapher
public TextOption LutText { get; }
+ public CheckBoxOption GainSwitch { get; }
+
public override int Top
{
get
@@ -172,6 +176,7 @@ namespace grapher
AccelDropdown.Hide();
AccelTypeActiveValue.Hide();
+ GainSwitch.Hide();
Acceleration.Hide();
Scale.Hide();
Cap.Hide();
@@ -180,6 +185,7 @@ namespace grapher
Limit.Hide();
Exponent.Hide();
Midpoint.Hide();
+ LutText.Hide();
}
public void Show()
@@ -234,6 +240,27 @@ namespace grapher
public void SetArgs(ref AccelArgs args)
{
+ args.mode = (AccelMode)AccelerationType.Index;
+ if (Acceleration.Visible)
+ {
+ if (args.mode == AccelMode.natural)
+ {
+ args.accelNatural = Acceleration.Field.Data;
+ }
+ else if (args.mode == AccelMode.motivity)
+ {
+ args.accelMotivity = Acceleration.Field.Data;
+ }
+ else
+ {
+ args.accelClassic = Acceleration.Field.Data;
+ }
+
+ args.smooth = Acceleration.Field.Data;
+ }
+
+ args.legacy = !GainSwitch.CheckBox.Checked;
+
if (Scale.Visible) args.scale = Scale.Field.Data;
if (Cap.Visible) args.cap = Cap.SensitivityCap;
if (Limit.Visible) args.limit = Limit.Field.Data;
@@ -284,6 +311,7 @@ namespace grapher
}
AccelerationType.Layout(
+ GainSwitch,
Acceleration,
Scale,
Cap,
diff --git a/grapher/Models/Options/CheckBoxOption.cs b/grapher/Models/Options/CheckBoxOption.cs
new file mode 100644
index 0000000..43757b4
--- /dev/null
+++ b/grapher/Models/Options/CheckBoxOption.cs
@@ -0,0 +1,81 @@
+using System.Windows.Forms;
+
+namespace grapher.Models.Options
+{
+ public class CheckBoxOption : OptionBase
+ {
+ public CheckBoxOption(CheckBox checkBox)
+ {
+ CheckBox = checkBox;
+ }
+
+ public CheckBox CheckBox { get; }
+
+ public override bool Visible
+ {
+ get
+ {
+ return CheckBox.Visible;
+ }
+ }
+
+ public override int Left
+ {
+ get
+ {
+ return CheckBox.Left;
+ }
+ set
+ {
+ CheckBox.Left = value;
+ }
+ }
+
+ public override int Height
+ {
+ get
+ {
+ return CheckBox.Height;
+ }
+ }
+
+ public override int Top
+ {
+ get
+ {
+ return CheckBox.Top;
+ }
+ set
+ {
+ CheckBox.Top = value;
+ }
+ }
+
+ public override int Width
+ {
+ get
+ {
+ return CheckBox.Width;
+ }
+ set
+ {
+ CheckBox.Width = value;
+ }
+ }
+
+ public override void AlignActiveValues()
+ {
+ }
+
+ public override void Hide()
+ {
+ CheckBox.Hide();
+ }
+
+ public override void Show(string Name)
+ {
+ CheckBox.Show();
+ CheckBox.Name = Name;
+ }
+ }
+}
diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj
index c896510..b453b6f 100644
--- a/grapher/grapher.csproj
+++ b/grapher/grapher.csproj
@@ -129,6 +129,7 @@
<Compile Include="Layouts\NaturalLayout.cs" />
<Compile Include="Layouts\OffLayout.cs" />
<Compile Include="Layouts\PowerLayout.cs" />
+ <Compile Include="Models\Options\CheckBoxOption.cs" />
<Compile Include="Models\Options\Directionality\DirectionalityOptions.cs" />
<Compile Include="Models\Options\IOption.cs" />
<Compile Include="Models\Options\OffsetOptions.cs" />