summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-08 14:44:53 -0700
committerJacob Palecki <[email protected]>2020-09-08 14:44:53 -0700
commit25ab05b2854428891b1615b7b78e9257c2d6db35 (patch)
treee218d46d27d291b8f264611c8f267e7687232d93
parentCenter write button (diff)
downloadrawaccel-25ab05b2854428891b1615b7b78e9257c2d6db35.tar.xz
rawaccel-25ab05b2854428891b1615b7b78e9257c2d6db35.zip
Add option to turn off last mouse move dot
-rw-r--r--grapher/Form1.Designer.cs24
-rw-r--r--grapher/Form1.cs3
-rw-r--r--grapher/Models/AccelGUIFactory.cs2
-rw-r--r--grapher/Models/Charts/AccelCharts.cs31
-rw-r--r--grapher/Models/Charts/ChartXY.cs8
5 files changed, 54 insertions, 14 deletions
diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs
index ad68b2c..f8a6578 100644
--- a/grapher/Form1.Designer.cs
+++ b/grapher/Form1.Designer.cs
@@ -138,6 +138,7 @@ namespace grapher
this.OptionSetYTitle = new System.Windows.Forms.Label();
this.AccelTypeActiveLabelY = new System.Windows.Forms.Label();
this.ActiveValueTitleY = new System.Windows.Forms.Label();
+ this.showLastMouseMoveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.GainChart)).BeginInit();
@@ -433,7 +434,8 @@ namespace grapher
this.graphsToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.graphsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.showVelocityGainToolStripMenuItem,
- this.scaleByDPIToolStripMenuItem});
+ this.scaleByDPIToolStripMenuItem,
+ this.showLastMouseMoveToolStripMenuItem});
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);
@@ -442,7 +444,7 @@ namespace grapher
// showVelocityGainToolStripMenuItem
//
this.showVelocityGainToolStripMenuItem.Name = "showVelocityGainToolStripMenuItem";
- this.showVelocityGainToolStripMenuItem.Size = new System.Drawing.Size(198, 22);
+ this.showVelocityGainToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.showVelocityGainToolStripMenuItem.Text = "Show Velocity && Gain";
//
// scaleByDPIToolStripMenuItem
@@ -452,7 +454,7 @@ namespace grapher
this.pollRateToolStripMenuItem,
this.ScaleMenuItem});
this.scaleByDPIToolStripMenuItem.Name = "scaleByDPIToolStripMenuItem";
- this.scaleByDPIToolStripMenuItem.Size = new System.Drawing.Size(198, 22);
+ this.scaleByDPIToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.scaleByDPIToolStripMenuItem.Text = "Scale by Mouse Settngs";
//
// dPIToolStripMenuItem
@@ -505,7 +507,7 @@ namespace grapher
this.gainCapToolStripMenuItem,
this.legacyCapToolStripMenuItem});
this.capStyleToolStripMenuItem.Name = "capStyleToolStripMenuItem";
- this.capStyleToolStripMenuItem.Size = new System.Drawing.Size(163, 22);
+ this.capStyleToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.capStyleToolStripMenuItem.Text = "Cap Style";
//
// gainCapToolStripMenuItem
@@ -528,7 +530,7 @@ namespace grapher
this.gainOffsetToolStripMenuItem,
this.legacyOffsetToolStripMenuItem});
this.offsetStyleToolStripMenuItem.Name = "offsetStyleToolStripMenuItem";
- this.offsetStyleToolStripMenuItem.Size = new System.Drawing.Size(163, 22);
+ this.offsetStyleToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.offsetStyleToolStripMenuItem.Text = "Offset Style";
//
// gainOffsetToolStripMenuItem
@@ -549,7 +551,7 @@ namespace grapher
this.wholeVectorToolStripMenuItem,
this.byVectorComponentToolStripMenuItem});
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
- this.toolStripMenuItem1.Size = new System.Drawing.Size(163, 22);
+ this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem1.Text = "Application Style";
//
// wholeVectorToolStripMenuItem
@@ -959,6 +961,15 @@ namespace grapher
this.ActiveValueTitleY.TabIndex = 67;
this.ActiveValueTitleY.Text = "Active";
//
+ // showLastMouseMoveToolStripMenuItem
+ //
+ this.showLastMouseMoveToolStripMenuItem.Checked = true;
+ this.showLastMouseMoveToolStripMenuItem.CheckOnClick = true;
+ this.showLastMouseMoveToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.showLastMouseMoveToolStripMenuItem.Name = "showLastMouseMoveToolStripMenuItem";
+ this.showLastMouseMoveToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
+ this.showLastMouseMoveToolStripMenuItem.Text = "Show Last Mouse Move";
+ //
// RawAcceleration
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -1131,6 +1142,7 @@ namespace grapher
private System.Windows.Forms.ToolStripMenuItem gainOffsetToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem legacyOffsetToolStripMenuItem;
private System.Windows.Forms.Label ActiveValueTitleY;
+ private System.Windows.Forms.ToolStripMenuItem showLastMouseMoveToolStripMenuItem;
}
}
diff --git a/grapher/Form1.cs b/grapher/Form1.cs
index 65212d5..103f239 100644
--- a/grapher/Form1.cs
+++ b/grapher/Form1.cs
@@ -50,6 +50,7 @@ namespace grapher
accelTypeDropY,
writeButton,
showVelocityGainToolStripMenuItem,
+ showLastMouseMoveToolStripMenuItem,
wholeVectorToolStripMenuItem,
byVectorComponentToolStripMenuItem,
gainCapToolStripMenuItem,
@@ -143,7 +144,7 @@ namespace grapher
private void RawAcceleration_Paint(object sender, PaintEventArgs e)
{
- AccelGUI.AccelCharts.DrawPoints();
+ AccelGUI.AccelCharts.DrawLastMovement();
}
#endregion Method
diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs
index a381192..713c680 100644
--- a/grapher/Models/AccelGUIFactory.cs
+++ b/grapher/Models/AccelGUIFactory.cs
@@ -23,6 +23,7 @@ namespace grapher.Models
ComboBox accelTypeDropY,
Button writeButton,
ToolStripMenuItem showVelocityGainToolStripMenuItem,
+ ToolStripMenuItem showLastMouseMoveMenuItem,
ToolStripMenuItem wholeVectorToolStripMenuItem,
ToolStripMenuItem byVectorComponentToolStripMenuItem,
ToolStripMenuItem velocityGainCapToolStripMenuItem,
@@ -94,6 +95,7 @@ namespace grapher.Models
new ChartXY(velocityChart, velocityChartY),
new ChartXY(gainChart, gainChartY),
showVelocityGainToolStripMenuItem,
+ showLastMouseMoveMenuItem,
writeButton);
var sensitivity = new OptionXY(
diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs
index 9040851..84673b8 100644
--- a/grapher/Models/Charts/AccelCharts.cs
+++ b/grapher/Models/Charts/AccelCharts.cs
@@ -16,6 +16,7 @@ namespace grapher
ChartXY velocityChart,
ChartXY gainChart,
ToolStripMenuItem enableVelocityAndGain,
+ ToolStripMenuItem enableLastMouseMove,
Button writeButton)
{
Estimated = new EstimatedPoints();
@@ -28,6 +29,7 @@ namespace grapher
VelocityChart = velocityChart;
GainChart = gainChart;
EnableVelocityAndGain = enableVelocityAndGain;
+ EnableLastValue = enableLastMouseMove;
WriteButton = writeButton;
SensitivityChart.SetPointBinds(Estimated.Sensitivity, EstimatedX.Sensitivity, EstimatedY.Sensitivity);
@@ -44,7 +46,9 @@ namespace grapher
FormBorderHeight = screenRectangle.Top - ContaingForm.Top;
EnableVelocityAndGain.Click += new System.EventHandler(OnEnableClick);
- EnableVelocityAndGain.CheckedChanged += new System.EventHandler(OnEnableCheckStateChange);
+ EnableVelocityAndGain.CheckedChanged += new System.EventHandler(OnEnableVelocityGainCheckStateChange);
+
+ EnableLastValue.CheckedChanged += new System.EventHandler(OnEnableLastMouseMoveCheckStateChange);
HideVelocityAndGain();
Combined = false;
@@ -65,6 +69,8 @@ namespace grapher
public ToolStripMenuItem EnableVelocityAndGain { get; }
+ private ToolStripMenuItem EnableLastValue { get; }
+
private Button WriteButton { get; }
public AccelData AccelData { get; }
@@ -95,11 +101,14 @@ namespace grapher
}
}
- public void DrawPoints()
+ public void DrawLastMovement()
{
- SensitivityChart.DrawPoints();
- VelocityChart.DrawPoints();
- GainChart.DrawPoints();
+ if (EnableLastValue.Checked)
+ {
+ SensitivityChart.DrawLastMovementValue();
+ VelocityChart.DrawLastMovementValue();
+ GainChart.DrawLastMovementValue();
+ }
}
public void Bind()
@@ -153,7 +162,7 @@ namespace grapher
EnableVelocityAndGain.Checked = !EnableVelocityAndGain.Checked;
}
- private void OnEnableCheckStateChange(object sender, EventArgs e)
+ private void OnEnableVelocityGainCheckStateChange(object sender, EventArgs e)
{
if (EnableVelocityAndGain.Checked)
{
@@ -165,6 +174,16 @@ namespace grapher
}
}
+ private void OnEnableLastMouseMoveCheckStateChange(object sender, EventArgs e)
+ {
+ if (!EnableLastValue.Checked)
+ {
+ SensitivityChart.ClearLastValue();
+ VelocityChart.ClearLastValue();
+ GainChart.ClearLastValue();
+ }
+ }
+
private void ShowVelocityAndGain()
{
VelocityChart.Show();
diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs
index 5ff2a8d..2037190 100644
--- a/grapher/Models/Charts/ChartXY.cs
+++ b/grapher/Models/Charts/ChartXY.cs
@@ -124,7 +124,7 @@ namespace grapher
YPointData = y;
}
- public void DrawPoints()
+ public void DrawLastMovementValue()
{
if(Combined)
{
@@ -137,6 +137,12 @@ namespace grapher
}
}
+ public void ClearLastValue()
+ {
+ ChartX.Series[1].Points.Clear();
+ ChartY.Series[1].Points.Clear();
+ }
+
public void Bind(IDictionary data)
{
ChartX.Series[0].Points.DataBindXY(data.Keys, data.Values);