diff options
| author | Jacob Palecki <[email protected]> | 2020-08-22 02:46:45 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-08-22 02:46:45 -0700 |
| commit | b874058d82a60a39163e91a26f370ff308b8af32 (patch) | |
| tree | 7e14357f1e1e2b2b9726c72ae7b679fd5b475af2 /grapher/Form1.cs | |
| parent | Serialization mostly working (diff) | |
| download | rawaccel-b874058d82a60a39163e91a26f370ff308b8af32.tar.xz rawaccel-b874058d82a60a39163e91a26f370ff308b8af32.zip | |
Saving and loading fully works
Diffstat (limited to 'grapher/Form1.cs')
| -rw-r--r-- | grapher/Form1.cs | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/grapher/Form1.cs b/grapher/Form1.cs index ef06527..d6f7990 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -11,6 +11,7 @@ using System.Windows.Forms; using System.Runtime.InteropServices; using grapher.Models.Calculations; using grapher.Models.Options; +using grapher.Models.Serialized; namespace grapher { @@ -91,6 +92,7 @@ namespace grapher Marshal.FreeHGlobal(args_ptr); + var accelCharts = new AccelCharts( this, new ChartXY(AccelerationChart, AccelerationChartY), @@ -198,15 +200,21 @@ namespace grapher cap, weight); - AccelCalculator accelCalculator = new AccelCalculator( + var accelCalculator = new AccelCalculator( new Field(DPITextBox.TextBox, this, AccelCalculator.DefaultDPI), new Field(PollRateTextBox.TextBox, this, AccelCalculator.DefaultPollRate)); + var settings = new SettingsManager( + managedAcceleration, + accelCalculator.DPI, + accelCalculator.PollRate, + AutoWriteMenuItem); + AccelGUI = new AccelGUI( this, accelCalculator, accelCharts, - managedAcceleration, + settings, accelerationOptions, sensitivity, rotation, @@ -249,21 +257,7 @@ namespace grapher private void writeButton_Click(object sender, EventArgs e) { - AccelGUI.ManagedAcceleration.UpdateAccel( - AccelGUI.AccelerationOptions.AccelerationIndex, - AccelGUI.Rotation.Field.Data, - AccelGUI.Sensitivity.Fields.X, - AccelGUI.Sensitivity.Fields.Y, - AccelGUI.Weight.Fields.X, - AccelGUI.Weight.Fields.Y, - AccelGUI.Cap.SensitivityCapX, - AccelGUI.Cap.SensitivityCapY, - AccelGUI.Offset.Field.Data, - AccelGUI.Acceleration.Field.Data, - AccelGUI.LimitOrExponent.Field.Data, - AccelGUI.Midpoint.Field.Data, - AccelGUI.Cap.VelocityGainCap); - AccelGUI.UpdateGraph(); + AccelGUI.UpdateActiveSettingsFromFields(); } #endregion Methods |