From 621ab8d23d10c892a18c39234b24266fd90b90fa Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Wed, 29 Jul 2020 19:35:57 -0700 Subject: Separate classes into files, add Field class for text box state --- grapher/Form1.cs | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) (limited to 'grapher/Form1.cs') 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; - } - } } } -- cgit v1.2.3