diff options
| author | Jacob Palecki <[email protected]> | 2020-08-19 15:26:25 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-08-19 15:26:25 -0700 |
| commit | 53c9025337166a408febc15078af3e9b136b3bab (patch) | |
| tree | c124a399bf5ae56abf9405a41c2908fd753acfbe /grapher/Models/AccelGUI.cs | |
| parent | Merge pull request #15 from JacobPalecki/GUI (diff) | |
| download | rawaccel-53c9025337166a408febc15078af3e9b136b3bab.tar.xz rawaccel-53c9025337166a408febc15078af3e9b136b3bab.zip | |
Add natural gain accel; add scale by DPI, poll rate in GUI
Diffstat (limited to 'grapher/Models/AccelGUI.cs')
| -rw-r--r-- | grapher/Models/AccelGUI.cs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 8eb2226..2c27bf7 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -18,6 +18,7 @@ namespace grapher public AccelGUI( RawAcceleration accelForm, + AccelCalculator accelCalculator, AccelCharts accelCharts, ManagedAccel managedAccel, AccelOptions accelOptions, @@ -30,9 +31,11 @@ namespace grapher Option limtOrExp, Option midpoint, Button writeButton, - Label mouseMoveLabel) + Label mouseMoveLabel, + ToolStripMenuItem scaleMenuItem) { AccelForm = accelForm; + AccelCalculator = accelCalculator; AccelCharts = accelCharts; ManagedAcceleration = managedAccel; AccelerationOptions = accelOptions; @@ -45,11 +48,14 @@ namespace grapher LimitOrExponent = limtOrExp; Midpoint = midpoint; WriteButton = writeButton; + ScaleMenuItem = scaleMenuItem; ManagedAcceleration.ReadFromDriver(); UpdateGraph(); MouseWatcher = new MouseWatcher(AccelForm, mouseMoveLabel, AccelCharts); + + ScaleMenuItem.Click += new System.EventHandler(OnScaleMenuItemClick); } #endregion constructors @@ -58,6 +64,8 @@ namespace grapher public RawAcceleration AccelForm { get; } + public AccelCalculator AccelCalculator { get; } + public AccelCharts AccelCharts { get; } public ManagedAccel ManagedAcceleration { get; } @@ -84,17 +92,22 @@ namespace grapher public MouseWatcher MouseWatcher { get; } + public ToolStripMenuItem ScaleMenuItem { get; } + #endregion properties #region methods - public void UpdateGraph() { AccelCalculator.Calculate(AccelCharts.AccelData, ManagedAcceleration); AccelCharts.Bind(); } + private void OnScaleMenuItemClick(object sender, EventArgs e) + { + UpdateGraph(); + } #endregion methods } |