summaryrefslogtreecommitdiff
path: root/grapher/Form1.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-07-29 20:10:18 -0700
committerJacob Palecki <[email protected]>2020-07-29 20:10:18 -0700
commit769deb7d9f8fca973432e74d2a6fac8697091fc2 (patch)
tree61b177a86bdea5d514dabc088d8cabf587398d56 /grapher/Form1.cs
parentSeparate classes into files, add Field class for text box state (diff)
downloadrawaccel-769deb7d9f8fca973432e74d2a6fac8697091fc2.tar.xz
rawaccel-769deb7d9f8fca973432e74d2a6fac8697091fc2.zip
All single-value boxes use fields
Diffstat (limited to 'grapher/Form1.cs')
-rw-r--r--grapher/Form1.cs56
1 files changed, 12 insertions, 44 deletions
diff --git a/grapher/Form1.cs b/grapher/Form1.cs
index fbf5dfb..ef0dd3a 100644
--- a/grapher/Form1.cs
+++ b/grapher/Form1.cs
@@ -21,13 +21,13 @@ namespace grapher
ManagedAcceleration = new ManagedAccel(5, 0, 0.3, 1.25, 15);
AccelerationType = 5;
Sensitivity = new VectorXY(1);
- Rotation = 0;
+ Rotation = new Field("0.0", rotationBox, this, 0);
Weight = new VectorXY(1);
Cap = new VectorXY(0);
- Offset = 0;
- Acceleration = new Field("0.0", this.accelerationBox, 0);
- LimitOrExponent = 1.01;
- Midpoint = 0;
+ Offset = new Field("0.0", offsetBox, this, 0);
+ Acceleration = new Field("0.0", accelerationBox, this, 0);
+ LimitOrExponent = new Field("2.0", limitBox, this, 2);
+ Midpoint = new Field("0.0", midpointBox, this, 0);
UpdateGraph();
@@ -61,19 +61,19 @@ namespace grapher
private VectorXY Sensitivity { get; set; }
- private double Rotation { get; set; }
+ private Field Rotation { get; set; }
private VectorXY Weight { get; set; }
private VectorXY Cap { get; set; }
- private double Offset { get; set; }
+ private Field Offset { get; set; }
private Field Acceleration { get; set; }
- private double LimitOrExponent { get; set; }
+ private Field LimitOrExponent { get; set; }
- private double Midpoint { get; set; }
+ private Field Midpoint { get; set; }
#endregion Properties
@@ -157,10 +157,10 @@ namespace grapher
Weight.Y,
Cap.X,
Cap.Y,
- Offset,
+ Offset.Data,
Acceleration.Data,
- LimitOrExponent,
- Midpoint);
+ LimitOrExponent.Data,
+ Midpoint.Data);
ManagedAcceleration.WriteToDriver();
UpdateGraph();
}
@@ -173,14 +173,6 @@ namespace grapher
}
}
- private void rotationBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (TryHandleWithEnter(e, sender, out double data))
- {
- Rotation = data;
- }
- }
-
private void capBox_KeyDown(object sender, KeyEventArgs e)
{
if (TryHandleWithEnter(e, sender, out double data))
@@ -189,30 +181,6 @@ namespace grapher
}
}
- private void offsetBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (TryHandleWithEnter(e, sender, out double data))
- {
- Offset = data;
- }
- }
-
- private void limitBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (TryHandleWithEnter(e, sender, out double data))
- {
- LimitOrExponent = data;
- }
- }
-
- private void midpointBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (TryHandleWithEnter(e, sender, out double data))
- {
- Midpoint = data;
- }
- }
-
#endregion Methods
}
}