diff options
| author | a1xd <[email protected]> | 2020-08-14 03:48:40 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-08-14 03:48:40 -0400 |
| commit | 0621a7ebd431102d720497a143190505dcfeb7a1 (patch) | |
| tree | 01d7df8f55e5a1cce90617fd876eaf994eb26846 /grapher/Models/AccelGUI.cs | |
| parent | Merge pull request #14 from JacobPalecki/GainCap (diff) | |
| parent | Fix initial points, add poll time constant (diff) | |
| download | rawaccel-0621a7ebd431102d720497a143190505dcfeb7a1.tar.xz rawaccel-0621a7ebd431102d720497a143190505dcfeb7a1.zip | |
Merge pull request #15 from JacobPalecki/GUI
GUI: Add x/y graphs, moving dot
Diffstat (limited to 'grapher/Models/AccelGUI.cs')
| -rw-r--r-- | grapher/Models/AccelGUI.cs | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs new file mode 100644 index 0000000..8eb2226 --- /dev/null +++ b/grapher/Models/AccelGUI.cs @@ -0,0 +1,101 @@ +using grapher.Models.Calculations; +using grapher.Models.Mouse; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Windows.Forms.DataVisualization.Charting; + +namespace grapher +{ + public class AccelGUI + { + + #region constructors + + public AccelGUI( + RawAcceleration accelForm, + AccelCharts accelCharts, + ManagedAccel managedAccel, + AccelOptions accelOptions, + OptionXY sensitivity, + Option rotation, + OptionXY weight, + CapOptions cap, + Option offset, + Option acceleration, + Option limtOrExp, + Option midpoint, + Button writeButton, + Label mouseMoveLabel) + { + AccelForm = accelForm; + AccelCharts = accelCharts; + ManagedAcceleration = managedAccel; + AccelerationOptions = accelOptions; + Sensitivity = sensitivity; + Rotation = rotation; + Weight = weight; + Cap = cap; + Offset = offset; + Acceleration = acceleration; + LimitOrExponent = limtOrExp; + Midpoint = midpoint; + WriteButton = writeButton; + + ManagedAcceleration.ReadFromDriver(); + UpdateGraph(); + + MouseWatcher = new MouseWatcher(AccelForm, mouseMoveLabel, AccelCharts); + } + + #endregion constructors + + #region properties + + public RawAcceleration AccelForm { get; } + + public AccelCharts AccelCharts { get; } + + public ManagedAccel ManagedAcceleration { get; } + + public AccelOptions AccelerationOptions { get; } + + public OptionXY Sensitivity { get; } + + public Option Rotation { get; } + + public OptionXY Weight { get; } + + public CapOptions Cap { get; } + + public Option Offset { get; } + + public Option Acceleration { get; } + + public Option LimitOrExponent { get; } + + public Option Midpoint { get; } + + public Button WriteButton { get; } + + public MouseWatcher MouseWatcher { get; } + + #endregion properties + + #region methods + + + public void UpdateGraph() + { + AccelCalculator.Calculate(AccelCharts.AccelData, ManagedAcceleration); + AccelCharts.Bind(); + } + + #endregion methods + } + +} |