diff options
| author | Jacob Palecki <[email protected]> | 2020-07-29 19:35:57 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-07-29 19:35:57 -0700 |
| commit | 621ab8d23d10c892a18c39234b24266fd90b90fa (patch) | |
| tree | 7c46133ef24dc74b02437fb61616ece0163fb64f /grapher/Form1.cs | |
| parent | Take all variables through GUI (diff) | |
| download | rawaccel-621ab8d23d10c892a18c39234b24266fd90b90fa.tar.xz rawaccel-621ab8d23d10c892a18c39234b24266fd90b90fa.zip | |
Separate classes into files, add Field class for text box state
Diffstat (limited to 'grapher/Form1.cs')
| -rw-r--r-- | grapher/Form1.cs | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/grapher/Form1.cs b/grapher/Form1.cs index d1244f3..fbf5dfb 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -25,7 +25,7 @@ namespace grapher Weight = new VectorXY(1); Cap = new VectorXY(0); Offset = 0; - Acceleration = 0; + Acceleration = new Field("0.0", this.accelerationBox, 0); LimitOrExponent = 1.01; Midpoint = 0; @@ -69,7 +69,7 @@ namespace grapher private double Offset { get; set; } - private double Acceleration { get; set; } + private Field Acceleration { get; set; } private double LimitOrExponent { get; set; } @@ -158,7 +158,7 @@ namespace grapher Cap.X, Cap.Y, Offset, - Acceleration, + Acceleration.Data, LimitOrExponent, Midpoint); ManagedAcceleration.WriteToDriver(); @@ -173,14 +173,6 @@ namespace grapher } } - private void accelerationBox_KeyDown(object sender, KeyEventArgs e) - { - if (TryHandleWithEnter(e, sender, out double data)) - { - Acceleration = data; - } - } - private void rotationBox_KeyDown(object sender, KeyEventArgs e) { if (TryHandleWithEnter(e, sender, out double data)) @@ -222,30 +214,5 @@ namespace grapher } #endregion Methods - - public class VectorXY - { - public VectorXY(double x) - { - X = x; - Y = x; - } - - public VectorXY(double x, double y) - { - X = x; - Y = y; - } - - public double X { get; set; } - - public double Y { get; set; } - - public void SetBoth(double value) - { - X = value; - Y = value; - } - } } } |