diff options
Diffstat (limited to 'grapher')
| -rw-r--r-- | grapher/Layouts/MotivityLayout.cs (renamed from grapher/Layouts/ExperimentOneLayout.cs) | 8 | ||||
| -rw-r--r-- | grapher/Models/Charts/ChartXY.cs | 1 | ||||
| -rw-r--r-- | grapher/Models/Mouse/MouseData.cs | 49 | ||||
| -rw-r--r-- | grapher/Models/Mouse/MouseWatcher.cs | 3 | ||||
| -rw-r--r-- | grapher/Models/Options/AccelTypeOptions.cs | 2 | ||||
| -rw-r--r-- | grapher/Models/Serialized/DriverSettings.cs | 2 | ||||
| -rw-r--r-- | grapher/grapher.csproj | 3 |
7 files changed, 60 insertions, 8 deletions
diff --git a/grapher/Layouts/ExperimentOneLayout.cs b/grapher/Layouts/MotivityLayout.cs index ad6f61a..dfef2de 100644 --- a/grapher/Layouts/ExperimentOneLayout.cs +++ b/grapher/Layouts/MotivityLayout.cs @@ -7,13 +7,13 @@ using System.Threading.Tasks; namespace grapher.Layouts { - public class ExperimentOneLayout : LayoutBase + public class MotivityLayout : LayoutBase { - public ExperimentOneLayout() + public MotivityLayout() : base() { - Name = "Experiment 1"; - Index = (int)AccelMode.experimentone; + Name = "Motivity"; + Index = (int)AccelMode.motivity; LogarithmicCharts = true; AccelLayout = new OptionLayout(true, Acceleration); diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index c5c00d1..3850e42 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -128,7 +128,6 @@ namespace grapher pointTwo.Get(out x, out y); chart.Series[3].Points.DataBindXY(x, y); } - chart.Update(); } } diff --git a/grapher/Models/Mouse/MouseData.cs b/grapher/Models/Mouse/MouseData.cs new file mode 100644 index 0000000..e59a969 --- /dev/null +++ b/grapher/Models/Mouse/MouseData.cs @@ -0,0 +1,49 @@ +using System; + +namespace grapher.Models.Mouse +{ + public class MouseData + { + #region Constructors + + public MouseData() + { + Lock = new Object(); + X = 0; + Y = 0; + } + + #endregion Constructors + + #region Properties + + public Object Lock { get; } + + private int X { get; set; } + private int Y { get; set; } + + public void Set(int x, int y) + { + lock (Lock) + { + X = x; + Y = y; + } + } + + #endregion Properties + + #region Methods + + public void Get(out int x, out int y) + { + lock (Lock) + { + x = X; + y = Y; + } + } + + #endregion Methods + } +} diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index 405110e..86b1c2e 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -682,6 +682,7 @@ namespace grapher.Models.Mouse ContainingForm = containingForm; Display = display; AccelCharts = accelCharts; + MouseData = new MouseData(); RAWINPUTDEVICE device = new RAWINPUTDEVICE(); device.WindowHandle = ContainingForm.Handle; @@ -705,6 +706,8 @@ namespace grapher.Models.Mouse private AccelCharts AccelCharts { get; } + private MouseData MouseData { get; } + private double PollTime { get; } #endregion Properties diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index ce5ec54..1302387 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -21,7 +21,7 @@ namespace grapher new LogarithmLayout(), new NaturalGainLayout(), new SigmoidGainLayout(), - new ExperimentOneLayout(), + new MotivityLayout(), new OffLayout() }.ToDictionary(k => k.Name); diff --git a/grapher/Models/Serialized/DriverSettings.cs b/grapher/Models/Serialized/DriverSettings.cs index 03c5687..119b684 100644 --- a/grapher/Models/Serialized/DriverSettings.cs +++ b/grapher/Models/Serialized/DriverSettings.cs @@ -8,7 +8,7 @@ namespace grapher.Models.Serialized public enum AccelMode { - linear, classic, natural, naturalgain, sigmoidgain, power, logarithm, experimentone, noaccel + linear, classic, natural, naturalgain, sigmoidgain, power, logarithm, motivity, noaccel } #endregion Enumerations diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index ebe224a..b283e37 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -54,7 +54,7 @@ </ItemGroup> <ItemGroup> <Compile Include="Constants\Constants.cs" /> - <Compile Include="Layouts\ExperimentOneLayout.cs" /> + <Compile Include="Layouts\MotivityLayout.cs" /> <Compile Include="Layouts\LogarithmLayout.cs" /> <Compile Include="Layouts\NaturalGainLayout.cs" /> <Compile Include="Layouts\SigmoidGainLayout.cs" /> @@ -70,6 +70,7 @@ <Compile Include="Models\Charts\EstimatedPoints.cs" /> <Compile Include="Models\Charts\ChartState\XYOneGraphState.cs" /> <Compile Include="Models\Charts\ChartState\XYTwoGraphState.cs" /> + <Compile Include="Models\Mouse\MouseData.cs" /> <Compile Include="Models\Mouse\MouseWatcher.cs" /> <Compile Include="Models\Mouse\PointData.cs" /> <Compile Include="Models\Options\AccelTypeOptions.cs" /> |