summaryrefslogtreecommitdiff
path: root/grapher/Models
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 /grapher/Models
parentCenter write button (diff)
downloadrawaccel-25ab05b2854428891b1615b7b78e9257c2d6db35.tar.xz
rawaccel-25ab05b2854428891b1615b7b78e9257c2d6db35.zip
Add option to turn off last mouse move dot
Diffstat (limited to 'grapher/Models')
-rw-r--r--grapher/Models/AccelGUIFactory.cs2
-rw-r--r--grapher/Models/Charts/AccelCharts.cs31
-rw-r--r--grapher/Models/Charts/ChartXY.cs8
3 files changed, 34 insertions, 7 deletions
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);