summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-08-03 13:20:17 -0700
committerJacob Palecki <[email protected]>2020-08-03 13:20:17 -0700
commitdba84307479550135db0bccce9554da09c74aa74 (patch)
treed5f6a56a174f4d0dc0a70f8ba6133997d3efead8
parentAdd gain and velocity graphs (diff)
downloadrawaccel-dba84307479550135db0bccce9554da09c74aa74.tar.xz
rawaccel-dba84307479550135db0bccce9554da09c74aa74.zip
Add tool menu to enable\disable charts
-rw-r--r--grapher/AccelCharts.cs95
-rw-r--r--grapher/AccelGUI.cs20
-rw-r--r--grapher/Form1.Designer.cs185
-rw-r--r--grapher/Form1.cs9
-rw-r--r--grapher/Form1.resx6
-rw-r--r--grapher/grapher.csproj1
6 files changed, 225 insertions, 91 deletions
diff --git a/grapher/AccelCharts.cs b/grapher/AccelCharts.cs
new file mode 100644
index 0000000..62c60e5
--- /dev/null
+++ b/grapher/AccelCharts.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+
+namespace grapher
+{
+ public class AccelCharts
+ {
+ public const int ChartSeparation = 10;
+
+ /// <summary> Needed to show full contents in form. Unsure why. </summary>
+ public const int FormHeightPadding = 35;
+
+ public AccelCharts(
+ Form form,
+ Chart sensitivityChart,
+ Chart velocityChart,
+ Chart gainChart,
+ ToolStripMenuItem enableVelocityAndGain)
+ {
+ ContaingForm = form;
+ SensitivityChart = sensitivityChart;
+ VelocityChart = velocityChart;
+ GainChart = gainChart;
+ EnableVelocityAndGain = enableVelocityAndGain;
+
+ SensitivityChart.Top = 0;
+ VelocityChart.Height = SensitivityChart.Height;
+ VelocityChart.Top = SensitivityChart.Height + ChartSeparation;
+ GainChart.Height = SensitivityChart.Height;
+ GainChart.Top = VelocityChart.Top + VelocityChart.Height + ChartSeparation;
+
+ Rectangle screenRectangle = ContaingForm.RectangleToScreen(ContaingForm.ClientRectangle);
+ FormBorderHeight = screenRectangle.Top - ContaingForm.Top;
+
+ EnableVelocityAndGain.Click += new System.EventHandler(OnEnableClick);
+ EnableVelocityAndGain.CheckedChanged += new System.EventHandler(OnEnableCheckStateChange);
+
+ HideVelocityAndGain();
+ }
+
+ public Form ContaingForm { get; }
+
+ public Chart SensitivityChart { get; }
+
+ public Chart VelocityChart { get; }
+
+ public Chart GainChart { get; }
+
+ public ToolStripMenuItem EnableVelocityAndGain { get; }
+
+ private int FormBorderHeight { get; }
+
+ private void OnEnableClick(object sender, EventArgs e)
+ {
+ EnableVelocityAndGain.Checked = !EnableVelocityAndGain.Checked;
+ }
+
+ private void OnEnableCheckStateChange(object sender, EventArgs e)
+ {
+ if (EnableVelocityAndGain.Checked)
+ {
+ ShowVelocityAndGain();
+ }
+ else
+ {
+ HideVelocityAndGain();
+ }
+ }
+
+ private void ShowVelocityAndGain()
+ {
+ VelocityChart.Show();
+ GainChart.Show();
+ ContaingForm.Height = SensitivityChart.Height +
+ ChartSeparation +
+ VelocityChart.Height +
+ ChartSeparation +
+ GainChart.Height +
+ FormBorderHeight;
+ }
+
+ private void HideVelocityAndGain()
+ {
+ VelocityChart.Hide();
+ GainChart.Hide();
+ ContaingForm.Height = SensitivityChart.Height + FormBorderHeight;
+ }
+ }
+}
diff --git a/grapher/AccelGUI.cs b/grapher/AccelGUI.cs
index 48fad7e..b8f1bed 100644
--- a/grapher/AccelGUI.cs
+++ b/grapher/AccelGUI.cs
@@ -24,9 +24,7 @@ namespace grapher
public AccelGUI(
RawAcceleration accelForm,
- Chart accelerationChart,
- Chart velocityChart,
- Chart gainChart,
+ AccelCharts accelCharts,
ManagedAccel managedAccel,
AccelOptions accelOptions,
OptionXY sensitivity,
@@ -39,9 +37,7 @@ namespace grapher
Option midpoint)
{
AccelForm = accelForm;
- AccelChart = accelerationChart;
- VelocityChart = velocityChart;
- GainChart = gainChart;
+ AccelCharts = accelCharts;
ManagedAcceleration = managedAccel;
AccelerationOptions = accelOptions;
Sensitivity = sensitivity;
@@ -62,11 +58,7 @@ namespace grapher
public RawAcceleration AccelForm { get; }
- public Chart AccelChart { get; }
-
- public Chart VelocityChart { get; }
-
- public Chart GainChart { get; }
+ public AccelCharts AccelCharts { get; }
public ManagedAccel ManagedAcceleration { get; }
@@ -162,7 +154,7 @@ namespace grapher
}
}
- var accelSeries = AccelChart.Series.FirstOrDefault();
+ var accelSeries = AccelCharts.SensitivityChart.Series.FirstOrDefault();
accelSeries.Points.Clear();
foreach (var point in orderedAccelPoints)
@@ -170,7 +162,7 @@ namespace grapher
accelSeries.Points.AddXY(point.Key, point.Value);
}
- var velSeries = VelocityChart.Series.FirstOrDefault();
+ var velSeries = AccelCharts.VelocityChart.Series.FirstOrDefault();
velSeries.Points.Clear();
foreach (var point in orderedVelocityPoints)
@@ -178,7 +170,7 @@ namespace grapher
velSeries.Points.AddXY(point.Key, point.Value);
}
- var gainSeries = GainChart.Series.FirstOrDefault();
+ var gainSeries = AccelCharts.GainChart.Series.FirstOrDefault();
gainSeries.Points.Clear();
foreach (var point in orderedGainPoints)
diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs
index f7e674d..1a268d6 100644
--- a/grapher/Form1.Designer.cs
+++ b/grapher/Form1.Designer.cs
@@ -30,15 +30,15 @@ namespace grapher
/// </summary>
private void InitializeComponent()
{
- System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
- System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
- System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
- System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
- System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
- System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
- System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
- System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
- System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
+ System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea10 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+ System.Windows.Forms.DataVisualization.Charting.Legend legend10 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+ System.Windows.Forms.DataVisualization.Charting.Series series10 = new System.Windows.Forms.DataVisualization.Charting.Series();
+ System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea11 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+ System.Windows.Forms.DataVisualization.Charting.Legend legend11 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+ System.Windows.Forms.DataVisualization.Charting.Series series11 = new System.Windows.Forms.DataVisualization.Charting.Series();
+ System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea12 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+ System.Windows.Forms.DataVisualization.Charting.Legend legend12 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+ System.Windows.Forms.DataVisualization.Charting.Series series12 = new System.Windows.Forms.DataVisualization.Charting.Series();
this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.accelTypeDrop = new System.Windows.Forms.ComboBox();
this.sensitivityBoxX = new System.Windows.Forms.TextBox();
@@ -67,34 +67,38 @@ namespace grapher
this.LockXYLabel = new System.Windows.Forms.Label();
this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+ this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+ this.graphsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.showVelocityGainToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.GainChart)).BeginInit();
+ this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// AccelerationChart
//
- chartArea1.AxisX.Title = "Speed (counts/ms)";
- chartArea1.AxisY.Title = "Sensitivity (magnitude ratio)";
- chartArea1.Name = "ChartArea1";
- this.AccelerationChart.ChartAreas.Add(chartArea1);
- legend1.Name = "Legend1";
- this.AccelerationChart.Legends.Add(legend1);
- this.AccelerationChart.Location = new System.Drawing.Point(242, 1);
+ chartArea10.AxisX.Title = "Speed (counts/ms)";
+ chartArea10.AxisY.Title = "Sensitivity (magnitude ratio)";
+ chartArea10.Name = "ChartArea1";
+ this.AccelerationChart.ChartAreas.Add(chartArea10);
+ legend10.Name = "Legend1";
+ this.AccelerationChart.Legends.Add(legend10);
+ this.AccelerationChart.Location = new System.Drawing.Point(242, 0);
this.AccelerationChart.Name = "AccelerationChart";
- series1.ChartArea = "ChartArea1";
- series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
- series1.Legend = "Legend1";
- series1.Name = "Accelerated Sensitivity";
- this.AccelerationChart.Series.Add(series1);
- this.AccelerationChart.Size = new System.Drawing.Size(721, 312);
+ series10.ChartArea = "ChartArea1";
+ series10.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+ series10.Legend = "Legend1";
+ series10.Name = "Accelerated Sensitivity";
+ this.AccelerationChart.Series.Add(series10);
+ this.AccelerationChart.Size = new System.Drawing.Size(721, 328);
this.AccelerationChart.TabIndex = 0;
this.AccelerationChart.Text = "chart1";
//
// accelTypeDrop
//
this.accelTypeDrop.FormattingEnabled = true;
- this.accelTypeDrop.Location = new System.Drawing.Point(14, 89);
+ this.accelTypeDrop.Location = new System.Drawing.Point(24, 98);
this.accelTypeDrop.Name = "accelTypeDrop";
this.accelTypeDrop.Size = new System.Drawing.Size(151, 21);
this.accelTypeDrop.TabIndex = 2;
@@ -102,7 +106,7 @@ namespace grapher
//
// sensitivityBoxX
//
- this.sensitivityBoxX.Location = new System.Drawing.Point(95, 37);
+ this.sensitivityBoxX.Location = new System.Drawing.Point(105, 46);
this.sensitivityBoxX.Name = "sensitivityBoxX";
this.sensitivityBoxX.Size = new System.Drawing.Size(32, 20);
this.sensitivityBoxX.TabIndex = 3;
@@ -110,7 +114,7 @@ namespace grapher
// sensitivityLabel
//
this.sensitivityLabel.AutoSize = true;
- this.sensitivityLabel.Location = new System.Drawing.Point(14, 40);
+ this.sensitivityLabel.Location = new System.Drawing.Point(24, 49);
this.sensitivityLabel.Name = "sensitivityLabel";
this.sensitivityLabel.Size = new System.Drawing.Size(54, 13);
this.sensitivityLabel.TabIndex = 4;
@@ -118,7 +122,7 @@ namespace grapher
//
// rotationBox
//
- this.rotationBox.Location = new System.Drawing.Point(95, 63);
+ this.rotationBox.Location = new System.Drawing.Point(105, 72);
this.rotationBox.Name = "rotationBox";
this.rotationBox.Size = new System.Drawing.Size(70, 20);
this.rotationBox.TabIndex = 5;
@@ -126,7 +130,7 @@ namespace grapher
// rotationLabel
//
this.rotationLabel.AutoSize = true;
- this.rotationLabel.Location = new System.Drawing.Point(24, 66);
+ this.rotationLabel.Location = new System.Drawing.Point(34, 75);
this.rotationLabel.Name = "rotationLabel";
this.rotationLabel.Size = new System.Drawing.Size(47, 13);
this.rotationLabel.TabIndex = 6;
@@ -134,7 +138,7 @@ namespace grapher
//
// accelerationBox
//
- this.accelerationBox.Location = new System.Drawing.Point(96, 116);
+ this.accelerationBox.Location = new System.Drawing.Point(106, 125);
this.accelerationBox.Name = "accelerationBox";
this.accelerationBox.Size = new System.Drawing.Size(70, 20);
this.accelerationBox.TabIndex = 7;
@@ -142,7 +146,7 @@ namespace grapher
// constantOneLabel
//
this.constantOneLabel.AutoSize = true;
- this.constantOneLabel.Location = new System.Drawing.Point(14, 119);
+ this.constantOneLabel.Location = new System.Drawing.Point(24, 128);
this.constantOneLabel.Name = "constantOneLabel";
this.constantOneLabel.Size = new System.Drawing.Size(66, 13);
this.constantOneLabel.TabIndex = 9;
@@ -151,7 +155,7 @@ namespace grapher
//
// capBoxX
//
- this.capBoxX.Location = new System.Drawing.Point(95, 142);
+ this.capBoxX.Location = new System.Drawing.Point(105, 151);
this.capBoxX.Name = "capBoxX";
this.capBoxX.Size = new System.Drawing.Size(32, 20);
this.capBoxX.TabIndex = 10;
@@ -159,7 +163,7 @@ namespace grapher
// capLabel
//
this.capLabel.AutoSize = true;
- this.capLabel.Location = new System.Drawing.Point(24, 146);
+ this.capLabel.Location = new System.Drawing.Point(34, 155);
this.capLabel.Name = "capLabel";
this.capLabel.Size = new System.Drawing.Size(26, 13);
this.capLabel.TabIndex = 11;
@@ -168,7 +172,7 @@ namespace grapher
//
// weightBoxFirst
//
- this.weightBoxFirst.Location = new System.Drawing.Point(95, 168);
+ this.weightBoxFirst.Location = new System.Drawing.Point(105, 177);
this.weightBoxFirst.Name = "weightBoxFirst";
this.weightBoxFirst.Size = new System.Drawing.Size(32, 20);
this.weightBoxFirst.TabIndex = 12;
@@ -176,7 +180,7 @@ namespace grapher
// weightLabel
//
this.weightLabel.AutoSize = true;
- this.weightLabel.Location = new System.Drawing.Point(24, 171);
+ this.weightLabel.Location = new System.Drawing.Point(34, 180);
this.weightLabel.Name = "weightLabel";
this.weightLabel.Size = new System.Drawing.Size(41, 13);
this.weightLabel.TabIndex = 13;
@@ -185,14 +189,14 @@ namespace grapher
//
// weightBoxSecond
//
- this.weightBoxSecond.Location = new System.Drawing.Point(134, 168);
+ this.weightBoxSecond.Location = new System.Drawing.Point(144, 177);
this.weightBoxSecond.Name = "weightBoxSecond";
this.weightBoxSecond.Size = new System.Drawing.Size(32, 20);
this.weightBoxSecond.TabIndex = 14;
//
// limitBox
//
- this.limitBox.Location = new System.Drawing.Point(95, 220);
+ this.limitBox.Location = new System.Drawing.Point(105, 229);
this.limitBox.Name = "limitBox";
this.limitBox.Size = new System.Drawing.Size(70, 20);
this.limitBox.TabIndex = 15;
@@ -200,7 +204,7 @@ namespace grapher
// constantTwoLabel
//
this.constantTwoLabel.AutoSize = true;
- this.constantTwoLabel.Location = new System.Drawing.Point(14, 223);
+ this.constantTwoLabel.Location = new System.Drawing.Point(24, 232);
this.constantTwoLabel.Name = "constantTwoLabel";
this.constantTwoLabel.Size = new System.Drawing.Size(78, 13);
this.constantTwoLabel.TabIndex = 16;
@@ -209,7 +213,7 @@ namespace grapher
//
// midpointBox
//
- this.midpointBox.Location = new System.Drawing.Point(95, 246);
+ this.midpointBox.Location = new System.Drawing.Point(105, 255);
this.midpointBox.Name = "midpointBox";
this.midpointBox.Size = new System.Drawing.Size(70, 20);
this.midpointBox.TabIndex = 17;
@@ -217,7 +221,7 @@ namespace grapher
// constantThreeLabel
//
this.constantThreeLabel.AutoSize = true;
- this.constantThreeLabel.Location = new System.Drawing.Point(21, 249);
+ this.constantThreeLabel.Location = new System.Drawing.Point(31, 258);
this.constantThreeLabel.Name = "constantThreeLabel";
this.constantThreeLabel.Size = new System.Drawing.Size(47, 13);
this.constantThreeLabel.TabIndex = 18;
@@ -226,7 +230,7 @@ namespace grapher
//
// offsetBox
//
- this.offsetBox.Location = new System.Drawing.Point(95, 194);
+ this.offsetBox.Location = new System.Drawing.Point(105, 203);
this.offsetBox.Name = "offsetBox";
this.offsetBox.Size = new System.Drawing.Size(70, 20);
this.offsetBox.TabIndex = 19;
@@ -234,7 +238,7 @@ namespace grapher
// offsetLabel
//
this.offsetLabel.AutoSize = true;
- this.offsetLabel.Location = new System.Drawing.Point(24, 197);
+ this.offsetLabel.Location = new System.Drawing.Point(34, 206);
this.offsetLabel.Name = "offsetLabel";
this.offsetLabel.Size = new System.Drawing.Size(35, 13);
this.offsetLabel.TabIndex = 20;
@@ -243,7 +247,7 @@ namespace grapher
//
// writeButton
//
- this.writeButton.Location = new System.Drawing.Point(47, 272);
+ this.writeButton.Location = new System.Drawing.Point(57, 281);
this.writeButton.Name = "writeButton";
this.writeButton.Size = new System.Drawing.Size(102, 23);
this.writeButton.TabIndex = 21;
@@ -253,14 +257,14 @@ namespace grapher
//
// sensitivityBoxY
//
- this.sensitivityBoxY.Location = new System.Drawing.Point(133, 37);
+ this.sensitivityBoxY.Location = new System.Drawing.Point(143, 46);
this.sensitivityBoxY.Name = "sensitivityBoxY";
this.sensitivityBoxY.Size = new System.Drawing.Size(32, 20);
this.sensitivityBoxY.TabIndex = 22;
//
// capBoxY
//
- this.capBoxY.Location = new System.Drawing.Point(135, 142);
+ this.capBoxY.Location = new System.Drawing.Point(145, 151);
this.capBoxY.Name = "capBoxY";
this.capBoxY.Size = new System.Drawing.Size(31, 20);
this.capBoxY.TabIndex = 23;
@@ -270,7 +274,7 @@ namespace grapher
this.sensXYLock.AutoSize = true;
this.sensXYLock.Checked = true;
this.sensXYLock.CheckState = System.Windows.Forms.CheckState.Checked;
- this.sensXYLock.Location = new System.Drawing.Point(188, 40);
+ this.sensXYLock.Location = new System.Drawing.Point(198, 49);
this.sensXYLock.Name = "sensXYLock";
this.sensXYLock.Size = new System.Drawing.Size(15, 14);
this.sensXYLock.TabIndex = 24;
@@ -281,7 +285,7 @@ namespace grapher
this.capXYLock.AutoSize = true;
this.capXYLock.Checked = true;
this.capXYLock.CheckState = System.Windows.Forms.CheckState.Checked;
- this.capXYLock.Location = new System.Drawing.Point(188, 145);
+ this.capXYLock.Location = new System.Drawing.Point(198, 154);
this.capXYLock.Name = "capXYLock";
this.capXYLock.Size = new System.Drawing.Size(15, 14);
this.capXYLock.TabIndex = 25;
@@ -292,7 +296,7 @@ namespace grapher
this.weightXYLock.AutoSize = true;
this.weightXYLock.Checked = true;
this.weightXYLock.CheckState = System.Windows.Forms.CheckState.Checked;
- this.weightXYLock.Location = new System.Drawing.Point(188, 171);
+ this.weightXYLock.Location = new System.Drawing.Point(198, 180);
this.weightXYLock.Name = "weightXYLock";
this.weightXYLock.Size = new System.Drawing.Size(15, 14);
this.weightXYLock.TabIndex = 26;
@@ -301,7 +305,7 @@ namespace grapher
// LockXYLabel
//
this.LockXYLabel.AutoSize = true;
- this.LockXYLabel.Location = new System.Drawing.Point(165, 21);
+ this.LockXYLabel.Location = new System.Drawing.Point(175, 30);
this.LockXYLabel.Name = "LockXYLabel";
this.LockXYLabel.Size = new System.Drawing.Size(60, 13);
this.LockXYLabel.TabIndex = 27;
@@ -309,47 +313,74 @@ namespace grapher
//
// VelocityChart
//
- chartArea2.AxisX.Title = "Speed (count/ms)";
- chartArea2.AxisY.Title = "Output Speed (counts/ms)";
- chartArea2.Name = "ChartArea1";
- this.VelocityChart.ChartAreas.Add(chartArea2);
- legend2.Name = "Legend1";
- this.VelocityChart.Legends.Add(legend2);
- this.VelocityChart.Location = new System.Drawing.Point(242, 319);
+ chartArea11.AxisX.Title = "Speed (count/ms)";
+ chartArea11.AxisY.Title = "Output Speed (counts/ms)";
+ chartArea11.Name = "ChartArea1";
+ this.VelocityChart.ChartAreas.Add(chartArea11);
+ legend11.Name = "Legend1";
+ this.VelocityChart.Legends.Add(legend11);
+ this.VelocityChart.Location = new System.Drawing.Point(242, 334);
this.VelocityChart.Name = "VelocityChart";
- series2.ChartArea = "ChartArea1";
- series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
- series2.Legend = "Legend1";
- series2.Name = "Mouse Velocity";
- this.VelocityChart.Series.Add(series2);
- this.VelocityChart.Size = new System.Drawing.Size(721, 300);
+ series11.ChartArea = "ChartArea1";
+ series11.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+ series11.Legend = "Legend1";
+ series11.Name = "Mouse Velocity";
+ this.VelocityChart.Series.Add(series11);
+ this.VelocityChart.Size = new System.Drawing.Size(721, 307);
this.VelocityChart.TabIndex = 28;
this.VelocityChart.Text = "chart1";
//
// GainChart
//
- chartArea3.AxisX.Title = "Speed (counts/ms)";
- chartArea3.AxisY.Title = "Slope of Velocity Chart";
- chartArea3.Name = "ChartArea1";
- this.GainChart.ChartAreas.Add(chartArea3);
- legend3.Name = "Legend1";
- this.GainChart.Legends.Add(legend3);
- this.GainChart.Location = new System.Drawing.Point(242, 625);
+ chartArea12.AxisX.Title = "Speed (counts/ms)";
+ chartArea12.AxisY.Title = "Slope of Velocity Chart";
+ chartArea12.Name = "ChartArea1";
+ this.GainChart.ChartAreas.Add(chartArea12);
+ legend12.Name = "Legend1";
+ this.GainChart.Legends.Add(legend12);
+ this.GainChart.Location = new System.Drawing.Point(242, 647);
this.GainChart.Name = "GainChart";
- series3.ChartArea = "ChartArea1";
- series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
- series3.Legend = "Legend1";
- series3.Name = "Velocity Gain";
- this.GainChart.Series.Add(series3);
- this.GainChart.Size = new System.Drawing.Size(721, 300);
+ series12.ChartArea = "ChartArea1";
+ series12.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
+ series12.Legend = "Legend1";
+ series12.Name = "Velocity Gain";
+ this.GainChart.Series.Add(series12);
+ this.GainChart.Size = new System.Drawing.Size(721, 309);
this.GainChart.TabIndex = 29;
this.GainChart.Text = "chart1";
//
+ // menuStrip1
+ //
+ this.menuStrip1.BackColor = System.Drawing.SystemColors.ControlLight;
+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.graphsToolStripMenuItem});
+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip1.Name = "menuStrip1";
+ this.menuStrip1.Size = new System.Drawing.Size(963, 24);
+ this.menuStrip1.TabIndex = 30;
+ this.menuStrip1.Text = "menuStrip1";
+ //
+ // graphsToolStripMenuItem
+ //
+ this.graphsToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.graphsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.showVelocityGainToolStripMenuItem});
+ 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);
+ this.graphsToolStripMenuItem.Text = "Charts";
+ //
+ // showVelocityGainToolStripMenuItem
+ //
+ this.showVelocityGainToolStripMenuItem.Name = "showVelocityGainToolStripMenuItem";
+ this.showVelocityGainToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
+ this.showVelocityGainToolStripMenuItem.Text = "Show Velocity && Gain";
+ //
// RawAcceleration
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(963, 925);
+ this.ClientSize = new System.Drawing.Size(963, 955);
this.Controls.Add(this.GainChart);
this.Controls.Add(this.VelocityChart);
this.Controls.Add(this.LockXYLabel);
@@ -378,12 +409,15 @@ namespace grapher
this.Controls.Add(this.sensitivityBoxX);
this.Controls.Add(this.accelTypeDrop);
this.Controls.Add(this.AccelerationChart);
+ this.Controls.Add(this.menuStrip1);
this.Name = "RawAcceleration";
this.Text = "Raw Acceleration Graph";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.GainChart)).EndInit();
+ this.menuStrip1.ResumeLayout(false);
+ this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -419,6 +453,9 @@ namespace grapher
private System.Windows.Forms.Label LockXYLabel;
private System.Windows.Forms.DataVisualization.Charting.Chart VelocityChart;
private System.Windows.Forms.DataVisualization.Charting.Chart GainChart;
+ private System.Windows.Forms.MenuStrip menuStrip1;
+ private System.Windows.Forms.ToolStripMenuItem graphsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem showVelocityGainToolStripMenuItem;
}
}
diff --git a/grapher/Form1.cs b/grapher/Form1.cs
index fb841e9..7fa6928 100644
--- a/grapher/Form1.cs
+++ b/grapher/Form1.cs
@@ -116,9 +116,12 @@ namespace grapher
AccelGUI = new AccelGUI(
this,
- AccelerationChart,
- VelocityChart,
- GainChart,
+ new AccelCharts(
+ this,
+ AccelerationChart,
+ VelocityChart,
+ GainChart,
+ showVelocityGainToolStripMenuItem),
managedAcceleration,
accelerationOptions,
sensitivity,
diff --git a/grapher/Form1.resx b/grapher/Form1.resx
index 1af7de1..32fcbfb 100644
--- a/grapher/Form1.resx
+++ b/grapher/Form1.resx
@@ -117,4 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
+ <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>25</value>
+ </metadata>
</root> \ No newline at end of file
diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj
index 4fe8f64..1611fd3 100644
--- a/grapher/grapher.csproj
+++ b/grapher/grapher.csproj
@@ -47,6 +47,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="AccelCharts.cs" />
<Compile Include="AccelGUI.cs" />
<Compile Include="AccelOptions.cs" />
<Compile Include="Field.cs" />