summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/utility-rawinput.hpp116
-rw-r--r--grapher/Constants/Constants.cs21
-rw-r--r--grapher/Form1.Designer.cs12
-rw-r--r--grapher/Form1.cs5
-rw-r--r--grapher/Models/AccelGUIFactory.cs3
-rw-r--r--grapher/Models/Charts/AccelCharts.cs11
-rw-r--r--grapher/Models/Charts/ChartState/ChartState.cs7
-rw-r--r--grapher/Models/Charts/ChartXY.cs103
-rw-r--r--grapher/Models/Devices/DeviceIDManager.cs4
-rw-r--r--grapher/Models/Serialized/GUISettings.cs9
-rw-r--r--grapher/Models/Serialized/SettingsManager.cs8
11 files changed, 221 insertions, 78 deletions
diff --git a/common/utility-rawinput.hpp b/common/utility-rawinput.hpp
index eaa23db..f04b2c1 100644
--- a/common/utility-rawinput.hpp
+++ b/common/utility-rawinput.hpp
@@ -2,6 +2,7 @@
#pragma comment(lib, "cfgmgr32.lib")
+#include <algorithm>
#include <string>
#include <system_error>
#include <vector>
@@ -11,85 +12,92 @@
#include <initguid.h> // needed for devpkey.h to parse properly
#include <devpkey.h>
-inline
-std::wstring dev_prop_wstr_from_interface(const WCHAR* interface_name, const DEVPROPKEY* key)
-{
- ULONG size = 0;
- DEVPROPTYPE type;
- CONFIGRET cm_res;
-
- cm_res = CM_Get_Device_Interface_PropertyW(interface_name, key,
- &type, NULL, &size, 0);
-
- if (cm_res != CR_BUFFER_SMALL && cm_res != CR_SUCCESS) {
- throw std::runtime_error("CM_Get_Device_Interface_PropertyW failed (" +
- std::to_string(cm_res) + ')');
- }
-
- std::wstring prop((size + 1) / 2, L'\0');
-
- cm_res = CM_Get_Device_Interface_PropertyW(interface_name, key,
- &type, reinterpret_cast<PBYTE>(&prop[0]), &size, 0);
-
- if (cm_res != CR_SUCCESS) {
- throw std::runtime_error("CM_Get_Device_Interface_PropertyW failed (" +
- std::to_string(cm_res) + ')');
- }
-
- return prop;
-}
-
-inline
-std::wstring dev_id_from_interface(const WCHAR* interface_name)
-{
- auto id = dev_prop_wstr_from_interface(interface_name, &DEVPKEY_Device_InstanceId);
- id.resize(id.find_last_of('\\'));
- return id;
-}
-
template <typename Func>
-void rawinput_foreach_with_interface(Func fn, DWORD input_type = RIM_TYPEMOUSE)
+void rawinput_foreach_dev_with_id(Func fn, bool with_instance_id = false,
+ DWORD input_type = RIM_TYPEMOUSE)
{
const UINT RI_ERROR = -1;
-
+
+ // get number of devices
UINT num_devs = 0;
-
- if (GetRawInputDeviceList(NULL, &num_devs, sizeof(RAWINPUTDEVICELIST)) == RI_ERROR) {
+ if (GetRawInputDeviceList(NULL, &num_devs, sizeof(RAWINPUTDEVICELIST)) != 0) {
throw std::system_error(GetLastError(), std::system_category(), "GetRawInputDeviceList failed");
}
auto devs = std::vector<RAWINPUTDEVICELIST>(num_devs);
if (GetRawInputDeviceList(&devs[0], &num_devs, sizeof(RAWINPUTDEVICELIST)) == RI_ERROR) {
- throw std::system_error(GetLastError(), std::system_category(), "GetRawInputDeviceList failed");
+ return;
}
+ std::wstring name;
+ std::wstring id;
+ DEVPROPTYPE type;
+ CONFIGRET cm_res;
+
for (auto&& dev : devs) {
if (dev.dwType != input_type) continue;
- WCHAR name[256] = {};
- UINT name_size = sizeof(name);
+ // get interface name length
+ UINT name_len = 0;
+ if (GetRawInputDeviceInfoW(dev.hDevice, RIDI_DEVICENAME, NULL, &name_len) == RI_ERROR) {
+ continue;
+ }
+
+ name.resize(name_len);
+
+ if (GetRawInputDeviceInfoW(dev.hDevice, RIDI_DEVICENAME, &name[0], &name_len) == RI_ERROR) {
+ continue;
+ }
+
+ // get sizeof dev instance id
+ ULONG id_size = 0;
+ cm_res = CM_Get_Device_Interface_PropertyW(&name[0], &DEVPKEY_Device_InstanceId,
+ &type, NULL, &id_size, 0);
- if (GetRawInputDeviceInfoW(dev.hDevice, RIDI_DEVICENAME, name, &name_size) == RI_ERROR) {
- throw std::system_error(GetLastError(), std::system_category(), "GetRawInputDeviceInfoW failed");
+ if (cm_res != CR_BUFFER_SMALL && cm_res != CR_SUCCESS) continue;
+
+ id.resize((id_size + 1) / 2);
+
+ cm_res = CM_Get_Device_Interface_PropertyW(&name[0], &DEVPKEY_Device_InstanceId,
+ &type, reinterpret_cast<PBYTE>(&id[0]), &id_size, 0);
+
+ if (cm_res != CR_SUCCESS) continue;
+
+ if (!with_instance_id) {
+ auto instance_delim_pos = id.find_last_of('\\');
+ if (instance_delim_pos != std::string::npos) id.resize(instance_delim_pos);
}
- fn(dev, name);
+ fn(dev, id);
}
}
-// returns device handles corresponding to a "device id"
-// https://docs.microsoft.com/en-us/windows-hardware/drivers/install/device-ids
inline
-std::vector<HANDLE> rawinput_handles_from_dev_id(const std::wstring& device_id, DWORD input_type = RIM_TYPEMOUSE)
+std::vector<HANDLE> rawinput_handles_from_dev_id(const std::wstring& device_id,
+ bool with_instance_id = false,
+ DWORD input_type = RIM_TYPEMOUSE)
{
std::vector<HANDLE> handles;
- rawinput_foreach_with_interface([&](const auto& dev, const WCHAR* name) {
- if (device_id == dev_id_from_interface(name)) {
- handles.push_back(dev.hDevice);
- }
- }, input_type);
+ rawinput_foreach_dev_with_id([&](const auto& dev, const std::wstring& id) {
+ if (id == device_id) handles.push_back(dev.hDevice);
+ }, with_instance_id, input_type);
return handles;
}
+
+inline
+std::vector<std::wstring> rawinput_dev_id_list(bool with_instance_id = false,
+ DWORD input_type = RIM_TYPEMOUSE)
+{
+ std::vector<std::wstring> ids;
+
+ rawinput_foreach_dev_with_id([&](const auto& dev, const std::wstring& id) {
+ ids.push_back(id);
+ }, with_instance_id, input_type);
+
+ std::sort(ids.begin(), ids.end());
+ ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
+ return ids;
+}
diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs
index 2bc9bbc..b99f662 100644
--- a/grapher/Constants/Constants.cs
+++ b/grapher/Constants/Constants.cs
@@ -134,6 +134,27 @@ namespace grapher
/// <summary> Style used by System.Double.Parse </summary>
public const NumberStyles FloatStyle = NumberStyles.Float | NumberStyles.AllowThousands;
+ /// <summary> Font Size for Chart Titles </summary>
+ public const float ChartTitleFontSize = 15;
+
+ /// <summary> Font Size for Chart Axis Titles </summary>
+ public const float ChartAxisFontSize = 12;
+
+ /// <summary> Line Width For Series data on chart </summary>
+ public const int ChartSeriesLineWidth = 3;
+
+ /// <summary> Foreground Color When Streamer Mode Active </summary>
+ public static readonly System.Drawing.Color fgStreamer = System.Drawing.Color.White;
+
+ /// <summary> Background Color When Streamer Mode Active </summary>
+ public static readonly System.Drawing.Color bgStreamer = System.Drawing.Color.Green;
+
+ /// <summary> Foreground Color When Streamer Mode Inactive </summary>
+ public static readonly System.Drawing.Color fgNoStreamer = System.Drawing.Color.Black;
+
+ /// <summary> Background Color When Streamer Mode Inactive </summary>
+ public static readonly System.Drawing.Color bgNoStreamer = System.Drawing.Color.White;
+
#endregion Constants
#region ReadOnly
diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs
index 2cd13d5..c114ff6 100644
--- a/grapher/Form1.Designer.cs
+++ b/grapher/Form1.Designer.cs
@@ -196,6 +196,7 @@ namespace grapher
this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+ this.streamingModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.XLutActiveValuesBox = new System.Windows.Forms.RichTextBox();
this.YLutActiveValuesBox = new System.Windows.Forms.RichTextBox();
this.optionsPanel.SuspendLayout();
@@ -1262,7 +1263,8 @@ namespace grapher
this.graphsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.scaleByDPIToolStripMenuItem,
this.showVelocityGainToolStripMenuItem,
- this.showLastMouseMoveToolStripMenuItem});
+ this.showLastMouseMoveToolStripMenuItem,
+ this.streamingModeToolStripMenuItem});
this.graphsToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.graphsToolStripMenuItem.Name = "graphsToolStripMenuItem";
this.graphsToolStripMenuItem.Size = new System.Drawing.Size(53, 20);
@@ -1603,6 +1605,13 @@ namespace grapher
title6.Text = "Sensitivity";
this.AccelerationChart.Titles.Add(title6);
//
+ // streamingModeToolStripMenuItem
+ //
+ this.streamingModeToolStripMenuItem.CheckOnClick = true;
+ this.streamingModeToolStripMenuItem.Name = "streamingModeToolStripMenuItem";
+ this.streamingModeToolStripMenuItem.Size = new System.Drawing.Size(201, 22);
+ this.streamingModeToolStripMenuItem.Text = "Streaming Mode";
+ //
// XLutActiveValuesBox
//
this.XLutActiveValuesBox.Location = new System.Drawing.Point(317, 369);
@@ -1776,6 +1785,7 @@ namespace grapher
private System.Windows.Forms.Label XLutApplyLabel;
private System.Windows.Forms.RichTextBox YLutActiveValuesBox;
private System.Windows.Forms.RichTextBox XLutActiveValuesBox;
+ private System.Windows.Forms.ToolStripMenuItem streamingModeToolStripMenuItem;
}
}
diff --git a/grapher/Form1.cs b/grapher/Form1.cs
index a7a878b..3971322 100644
--- a/grapher/Form1.cs
+++ b/grapher/Form1.cs
@@ -65,6 +65,7 @@ namespace grapher
toggleButton,
showVelocityGainToolStripMenuItem,
showLastMouseMoveToolStripMenuItem,
+ streamingModeToolStripMenuItem,
AutoWriteMenuItem,
UseSpecificDeviceMenuItem,
ScaleMenuItem,
@@ -228,6 +229,6 @@ namespace grapher
}
- #endregion Method
- }
+ #endregion Method
+ }
}
diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs
index 3bb5a49..7d33f0c 100644
--- a/grapher/Models/AccelGUIFactory.cs
+++ b/grapher/Models/AccelGUIFactory.cs
@@ -32,6 +32,7 @@ namespace grapher.Models
ButtonBase toggleButton,
ToolStripMenuItem showVelocityGainToolStripMenuItem,
ToolStripMenuItem showLastMouseMoveMenuItem,
+ ToolStripMenuItem streamingModeToolStripMenuItem,
ToolStripMenuItem autoWriteMenuItem,
ToolStripMenuItem useSpecificDeviceMenuItem,
ToolStripMenuItem scaleMenuItem,
@@ -153,6 +154,7 @@ namespace grapher.Models
new ChartXY(gainChart, gainChartY, Constants.GainChartTitle),
showVelocityGainToolStripMenuItem,
showLastMouseMoveMenuItem,
+ streamingModeToolStripMenuItem,
writeButton,
accelCalculator);
@@ -419,6 +421,7 @@ namespace grapher.Models
autoWriteMenuItem,
showLastMouseMoveMenuItem,
showVelocityGainToolStripMenuItem,
+ streamingModeToolStripMenuItem,
deviceIdManager);
var mouseWatcher = new MouseWatcher(form, mouseLabel, accelCharts, settings);
diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs
index 65c636b..7682120 100644
--- a/grapher/Models/Charts/AccelCharts.cs
+++ b/grapher/Models/Charts/AccelCharts.cs
@@ -18,6 +18,7 @@ namespace grapher
ChartXY gainChart,
ToolStripMenuItem enableVelocityAndGain,
ToolStripMenuItem enableLastMouseMove,
+ ToolStripMenuItem enableStreamingMode,
Button writeButton,
AccelCalculator accelCalculator)
{
@@ -37,6 +38,8 @@ namespace grapher
ContainingForm = form;
EnableVelocityAndGain = enableVelocityAndGain;
EnableLastValue = enableLastMouseMove;
+ EnableStreamingMode = enableStreamingMode;
+
WriteButton = writeButton;
EnableVelocityAndGain.Click += new System.EventHandler(OnEnableClick);
@@ -44,6 +47,8 @@ namespace grapher
EnableLastValue.CheckedChanged += new System.EventHandler(OnEnableLastMouseMoveCheckStateChange);
+ EnableStreamingMode.CheckedChanged += new System.EventHandler(OnEnableStreamingModeCheckStateChange);
+
ChartState = ChartStateManager.InitialState();
ChartState.Activate();
HideVelocityAndGain();
@@ -57,6 +62,8 @@ namespace grapher
public ToolStripMenuItem EnableVelocityAndGain { get; }
+ public ToolStripMenuItem EnableStreamingMode { get; }
+
private ToolStripMenuItem EnableLastValue { get; }
private Button WriteButton { get; }
@@ -174,6 +181,10 @@ namespace grapher
HideVelocityAndGain();
}
}
+ private void OnEnableStreamingModeCheckStateChange(object sender, EventArgs e)
+ {
+ ChartState.SetStreaming(EnableStreamingMode.Checked);
+ }
private void OnEnableLastMouseMoveCheckStateChange(object sender, EventArgs e)
{
diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs
index 5a86713..a50eaf0 100644
--- a/grapher/Models/Charts/ChartState/ChartState.cs
+++ b/grapher/Models/Charts/ChartState/ChartState.cs
@@ -117,5 +117,12 @@ namespace grapher.Models.Charts.ChartState
ChartXY.SetStandard(GainChart.ChartY);
}
}
+
+ public void SetStreaming(bool streaming)
+ {
+ SensitivityChart.SetStreaming(streaming);
+ GainChart.SetStreaming(streaming);
+ VelocityChart.SetStreaming(streaming);
+ }
}
}
diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs
index bd80ea2..5bafb94 100644
--- a/grapher/Models/Charts/ChartXY.cs
+++ b/grapher/Models/Charts/ChartXY.cs
@@ -89,34 +89,91 @@ namespace grapher
#region Methods
+ public static void setChartColors(Chart chart, System.Drawing.Color fgColor, System.Drawing.Color bgColor)
+ {
+ chart.ForeColor = fgColor;
+ chart.BackColor = bgColor;
+
+ chart.Titles[0].ForeColor = fgColor;
+
+ chart.ChartAreas[0].AxisX.LabelStyle.ForeColor = fgColor;
+ chart.ChartAreas[0].AxisY.LabelStyle.ForeColor = fgColor;
+
+ chart.ChartAreas[0].AxisX.LineColor = fgColor;
+ chart.ChartAreas[0].AxisY.LineColor = fgColor;
+ chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = fgColor;
+ chart.ChartAreas[0].AxisX.MajorTickMark.LineColor = fgColor;
+
+ chart.ChartAreas[0].AxisX.MajorGrid.LineColor = fgColor;
+ chart.ChartAreas[0].AxisY.MajorGrid.LineColor = fgColor;
+
+ chart.ChartAreas[0].AxisX.MinorGrid.LineColor = fgColor;
+ chart.Legends[0].ForeColor = fgColor;
+
+ chart.ChartAreas[0].AxisX.TitleForeColor = fgColor;
+ chart.ChartAreas[0].AxisY.TitleForeColor = fgColor;
+
+ chart.ChartAreas[0].BorderColor = fgColor;
+
+
+ }
+
public static void SetupChart(Chart chart)
{
- chart.ChartAreas[0].AxisX.RoundAxisValues();
+ ChartArea area = chart.ChartAreas[0];
+ Legend legend = chart.Legends[0];
+ Title title = chart.Titles[0];
- chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
- chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
+ area.AxisX.RoundAxisValues();
- chart.ChartAreas[0].AxisY.ScaleView.MinSize = 0.01;
- chart.ChartAreas[0].AxisY.ScaleView.SmallScrollSize = 0.001;
+ area.AxisX.ScaleView.Zoomable = true;
+ area.AxisY.ScaleView.Zoomable = true;
- chart.ChartAreas[0].AxisX.LabelStyle.Format = "0.##";
- chart.ChartAreas[0].AxisY.LabelStyle.Format = "0.##";
+ area.AxisY.ScaleView.MinSize = 0.01;
+ area.AxisY.ScaleView.SmallScrollSize = 0.001;
+
+ area.AxisX.LabelStyle.Format = "0.##";
+ area.AxisY.LabelStyle.Format = "0.##";
- chart.ChartAreas[0].CursorY.Interval = 0.001;
+ area.CursorY.Interval = 0.001;
- chart.ChartAreas[0].CursorX.AutoScroll = true;
- chart.ChartAreas[0].CursorY.AutoScroll = true;
+ area.CursorX.AutoScroll = true;
+ area.CursorY.AutoScroll = true;
- chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
- chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
+ area.CursorX.IsUserSelectionEnabled = true;
+ area.CursorY.IsUserSelectionEnabled = true;
- chart.ChartAreas[0].CursorX.IsUserEnabled = true;
- chart.ChartAreas[0].CursorY.IsUserEnabled = true;
+ area.CursorX.IsUserEnabled = true;
+ area.CursorY.IsUserEnabled = true;
chart.Series[1].Points.Clear();
chart.Series[1].Points.AddXY(0, 0);
- chart.Titles[0].Font = new System.Drawing.Font(chart.Titles[0].Font.Name, 9.0f, System.Drawing.FontStyle.Italic);
+ area.AxisX.TitleFont = new System.Drawing.Font(area.AxisX.TitleFont.Name, Constants.ChartAxisFontSize, System.Drawing.FontStyle.Bold);
+ area.AxisY.TitleFont = area.AxisX.TitleFont;
+
+ title.Font = new System.Drawing.Font(title.Font.Name, Constants.ChartTitleFontSize, System.Drawing.FontStyle.Italic | System.Drawing.FontStyle.Bold);
+
+ chart.Series[0].BorderWidth = Constants.ChartSeriesLineWidth;
+ chart.Series[0].MarkerSize = Constants.ChartSeriesLineWidth * 2;
+ chart.Series[2].BorderWidth = Constants.ChartSeriesLineWidth;
+ chart.Series[2].MarkerSize = Constants.ChartSeriesLineWidth * 2;
+
+ area.AxisX.MinorGrid.Enabled = true;
+ area.AxisX.MinorGrid.LineDashStyle = ChartDashStyle.Dot;
+
+ title.Alignment = System.Drawing.ContentAlignment.MiddleCenter;
+
+ legend.DockedToChartArea = area.Name;
+ legend.LegendStyle = LegendStyle.Row;
+
+ ElementPosition legendPosNew = new ElementPosition(25, 0, 50, 25);
+ legend.Position = legendPosNew;
+
+ System.Drawing.Color bgTrans = System.Drawing.Color.Transparent;
+
+ area.BackColor = bgTrans;
+ legend.BackColor = bgTrans;
}
public static void DrawPoint(Chart chart, PointData pointOne, PointData pointTwo = null)
@@ -313,6 +370,22 @@ namespace grapher
ChartY.Height = height;
}
+ public void SetStreaming(bool streaming)
+ {
+ var fgColor = Constants.fgNoStreamer;
+ var bgColor = Constants.bgNoStreamer;
+
+ if (streaming)
+ {
+ fgColor = Constants.fgStreamer;
+ bgColor = Constants.bgStreamer;
+ }
+
+ setChartColors(ChartX, fgColor, bgColor);
+ setChartColors(ChartY, fgColor, bgColor);
+ Update();
+ }
+
private string SetComponentTitle(string component)
{
return $"{Title} : {component}";
diff --git a/grapher/Models/Devices/DeviceIDManager.cs b/grapher/Models/Devices/DeviceIDManager.cs
index 8592763..39856a1 100644
--- a/grapher/Models/Devices/DeviceIDManager.cs
+++ b/grapher/Models/Devices/DeviceIDManager.cs
@@ -46,9 +46,9 @@ namespace grapher.Models.Devices
if (found) SetActive(anyDevice);
- foreach (var (name, id) in RawInputInterop.GetDeviceIDs())
+ foreach (string id in RawInputInterop.GetDeviceIDs())
{
- var deviceItem = new DeviceIDItem(name, id, this);
+ var deviceItem = new DeviceIDItem(string.Empty, id, this);
if (!found && deviceItem.ID.Equals(devID))
{
SetActive(deviceItem);
diff --git a/grapher/Models/Serialized/GUISettings.cs b/grapher/Models/Serialized/GUISettings.cs
index 93d56de..e7b67ba 100644
--- a/grapher/Models/Serialized/GUISettings.cs
+++ b/grapher/Models/Serialized/GUISettings.cs
@@ -32,6 +32,9 @@ namespace grapher.Models.Serialized
[JsonProperty(Order = 5)]
public bool AutoWriteToDriverOnStartup { get; set; }
+ [JsonProperty(Order = 6)]
+ public bool StreamingMode { get; set; }
+
#endregion Properties
#region Methods
@@ -54,7 +57,8 @@ namespace grapher.Models.Serialized
PollRate == other.PollRate &&
ShowLastMouseMove == other.ShowLastMouseMove &&
ShowVelocityAndGain == other.ShowVelocityAndGain &&
- AutoWriteToDriverOnStartup == other.AutoWriteToDriverOnStartup;
+ AutoWriteToDriverOnStartup == other.AutoWriteToDriverOnStartup &&
+ StreamingMode == other.StreamingMode;
}
public override int GetHashCode()
@@ -63,7 +67,8 @@ namespace grapher.Models.Serialized
PollRate.GetHashCode() ^
ShowLastMouseMove.GetHashCode() ^
ShowVelocityAndGain.GetHashCode() ^
- AutoWriteToDriverOnStartup.GetHashCode();
+ AutoWriteToDriverOnStartup.GetHashCode() ^
+ StreamingMode.GetHashCode();
}
public void Save()
diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs
index c0cc413..6bcfab8 100644
--- a/grapher/Models/Serialized/SettingsManager.cs
+++ b/grapher/Models/Serialized/SettingsManager.cs
@@ -20,6 +20,7 @@ namespace grapher.Models.Serialized
ToolStripMenuItem autoWrite,
ToolStripMenuItem showLastMouseMove,
ToolStripMenuItem showVelocityAndGain,
+ ToolStripMenuItem streamingMode,
DeviceIDManager deviceIDManager)
{
DpiField = dpiField;
@@ -27,6 +28,7 @@ namespace grapher.Models.Serialized
AutoWriteMenuItem = autoWrite;
ShowLastMouseMoveMenuItem = showLastMouseMove;
ShowVelocityAndGainMoveMenuItem = showVelocityAndGain;
+ StreamingModeMenuItem = streamingMode;
DeviceIDManager = deviceIDManager;
SetActiveFields(activeAccel);
@@ -69,7 +71,7 @@ namespace grapher.Models.Serialized
private ToolStripMenuItem ShowLastMouseMoveMenuItem { get; set; }
private ToolStripMenuItem ShowVelocityAndGainMoveMenuItem { get; set; }
-
+ private ToolStripMenuItem StreamingModeMenuItem{ get; set; }
#endregion Properties
#region Methods
@@ -88,6 +90,7 @@ namespace grapher.Models.Serialized
PollRateField.SetToEntered(GuiSettings.PollRate);
ShowLastMouseMoveMenuItem.Checked = GuiSettings.ShowLastMouseMove;
ShowVelocityAndGainMoveMenuItem.Checked = GuiSettings.ShowVelocityAndGain;
+ StreamingModeMenuItem.Checked = GUISettings.StreamingMode;
AutoWriteMenuItem.Checked = GuiSettings.AutoWriteToDriverOnStartup;
}
@@ -131,7 +134,8 @@ namespace grapher.Models.Serialized
PollRate = (int)PollRateField.Data,
ShowLastMouseMove = ShowLastMouseMoveMenuItem.Checked,
ShowVelocityAndGain = ShowVelocityAndGainMoveMenuItem.Checked,
- AutoWriteToDriverOnStartup = AutoWriteMenuItem.Checked
+ AutoWriteToDriverOnStartup = AutoWriteMenuItem.Checked,
+ StreamingMode = StreamingModeMenuItem.Checked
};
}