summaryrefslogtreecommitdiff
path: root/grapher/Form1.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-07-30 01:13:24 -0700
committerJacob Palecki <[email protected]>2020-07-30 01:13:24 -0700
commit3cbec32cfa91bad661bc126b517faf78458a27a6 (patch)
treebf637fbab252befdb1302601e8d759e23c66e82b /grapher/Form1.cs
parentFix small bugs, add AccelOptions class (diff)
downloadrawaccel-3cbec32cfa91bad661bc126b517faf78458a27a6.tar.xz
rawaccel-3cbec32cfa91bad661bc126b517faf78458a27a6.zip
Fully use acceloptions
Diffstat (limited to 'grapher/Form1.cs')
-rw-r--r--grapher/Form1.cs37
1 files changed, 9 insertions, 28 deletions
diff --git a/grapher/Form1.cs b/grapher/Form1.cs
index e35f097..ecb6ead 100644
--- a/grapher/Form1.cs
+++ b/grapher/Form1.cs
@@ -19,7 +19,11 @@ namespace grapher
InitializeComponent();
ManagedAcceleration = new ManagedAccel(5, 0, 0.3, 1.25, 15);
- AccelerationType = 0;
+ AccelerationOptions = new AccelOptions(
+ accelTypeDrop,
+ new Option(accelerationBox, constantOneLabel),
+ new Option(limitBox, constantTwoLabel),
+ new Option(midpointBox, constantThreeLabel));
Sensitivity = new FieldXY(sensitivityBoxX, sensitivityBoxY, sensXYLock, this, 1);
Rotation = new Field(rotationBox, this, 0);
Weight = new FieldXY(weightBoxFirst, weightBoxSecond, weightXYLock, this, 1);
@@ -57,7 +61,7 @@ namespace grapher
public ManagedAccel ManagedAcceleration { get; set; }
- private int AccelerationType { get; set; }
+ private AccelOptions AccelerationOptions { get; set; }
private FieldXY Sensitivity { get; set; }
@@ -150,7 +154,7 @@ namespace grapher
private void writeButton_Click(object sender, EventArgs e)
{
ManagedAcceleration.UpdateAccel(
- AccelerationType,
+ AccelerationOptions.AccelerationIndex,
Rotation.Data,
Sensitivity.X,
Sensitivity.Y,
@@ -168,32 +172,9 @@ namespace grapher
#endregion Methods
- private void accelTypeDrop_SelectedIndexChanged(object sender, EventArgs e)
+ private void label3_Click(object sender, EventArgs e)
{
- switch(this.accelTypeDrop.SelectedItem.ToString())
- {
- case ("Linear"):
- AccelerationType = 1;
- break;
- case ("Classic"):
- AccelerationType = 2;
- break;
- case ("Natural"):
- AccelerationType = 3;
- break;
- case ("Logarithmic"):
- AccelerationType = 4;
- break;
- case ("Sigmoid"):
- AccelerationType = 5;
- break;
- case ("Power"):
- AccelerationType = 6;
- break;
- default:
- AccelerationType = 0;
- break;
- }
+
}
}
}