From 297d610ca1f2978c6e354c679cbed4e1908be743 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 00:31:18 -0700 Subject: Set whole or by component with toolstrip item --- grapher/Form1.Designer.cs | 291 ++++++++++++++++++--------------- grapher/Form1.cs | 3 + grapher/Models/AccelGUI.cs | 8 +- grapher/Models/Options/ApplyOptions.cs | 85 ++++++++++ grapher/Models/Options/CapOptions.cs | 8 +- grapher/grapher.csproj | 1 + 6 files changed, 263 insertions(+), 133 deletions(-) create mode 100644 grapher/Models/Options/ApplyOptions.cs (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 70455ce..cc39c5f 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -30,30 +30,30 @@ namespace grapher /// 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.Series series2 = 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 series3 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series4 = 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 series5 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series7 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series8 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea5 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend5 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series9 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series10 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea6 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend6 = 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.Series series12 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea7 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend7 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series13 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series14 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea8 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend8 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series15 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series16 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea9 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend9 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series17 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series18 = 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 series19 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series20 = 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 series21 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series22 = 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 series23 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series24 = 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(); @@ -114,6 +114,9 @@ namespace grapher this.OffsetActiveLabel = new System.Windows.Forms.Label(); this.LimitExpActiveLabel = new System.Windows.Forms.Label(); this.MidpointActiveLabel = new System.Windows.Forms.Label(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.wholeVectorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.byVectorComponentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.GainChart)).BeginInit(); @@ -125,25 +128,25 @@ namespace grapher // // 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); + chartArea7.AxisX.Title = "Speed (counts/ms)"; + chartArea7.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea7.Name = "ChartArea1"; + this.AccelerationChart.ChartAreas.Add(chartArea7); + legend7.Name = "Legend1"; + this.AccelerationChart.Legends.Add(legend7); this.AccelerationChart.Location = new System.Drawing.Point(333, 0); this.AccelerationChart.Name = "AccelerationChart"; - series1.ChartArea = "ChartArea1"; - series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series1.Legend = "Legend1"; - series1.Name = "Accelerated Sensitivity"; - series2.ChartArea = "ChartArea1"; - series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series2.Legend = "Legend1"; - series2.Name = "LastAccelVal"; - this.AccelerationChart.Series.Add(series1); - this.AccelerationChart.Series.Add(series2); + series13.ChartArea = "ChartArea1"; + series13.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series13.Legend = "Legend1"; + series13.Name = "Accelerated Sensitivity"; + series14.ChartArea = "ChartArea1"; + series14.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series14.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series14.Legend = "Legend1"; + series14.Name = "LastAccelVal"; + this.AccelerationChart.Series.Add(series13); + this.AccelerationChart.Series.Add(series14); this.AccelerationChart.Size = new System.Drawing.Size(723, 328); this.AccelerationChart.TabIndex = 0; this.AccelerationChart.Text = "chart1"; @@ -366,50 +369,50 @@ 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); + chartArea8.AxisX.Title = "Speed (count/ms)"; + chartArea8.AxisY.Title = "Output Speed (counts/ms)"; + chartArea8.Name = "ChartArea1"; + this.VelocityChart.ChartAreas.Add(chartArea8); + legend8.Name = "Legend1"; + this.VelocityChart.Legends.Add(legend8); this.VelocityChart.Location = new System.Drawing.Point(333, 334); this.VelocityChart.Name = "VelocityChart"; - series3.ChartArea = "ChartArea1"; - series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series3.Legend = "Legend1"; - series3.Name = "Mouse Velocity"; - series4.ChartArea = "ChartArea1"; - series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series4.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series4.Legend = "Legend1"; - series4.Name = "LastVelocityVal"; - this.VelocityChart.Series.Add(series3); - this.VelocityChart.Series.Add(series4); + series15.ChartArea = "ChartArea1"; + series15.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series15.Legend = "Legend1"; + series15.Name = "Mouse Velocity"; + series16.ChartArea = "ChartArea1"; + series16.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series16.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series16.Legend = "Legend1"; + series16.Name = "LastVelocityVal"; + this.VelocityChart.Series.Add(series15); + this.VelocityChart.Series.Add(series16); this.VelocityChart.Size = new System.Drawing.Size(723, 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); + chartArea9.AxisX.Title = "Speed (counts/ms)"; + chartArea9.AxisY.Title = "Slope of Velocity Chart"; + chartArea9.Name = "ChartArea1"; + this.GainChart.ChartAreas.Add(chartArea9); + legend9.Name = "Legend1"; + this.GainChart.Legends.Add(legend9); this.GainChart.Location = new System.Drawing.Point(333, 647); this.GainChart.Name = "GainChart"; - series5.ChartArea = "ChartArea1"; - series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series5.Legend = "Legend1"; - series5.Name = "Velocity Gain"; - series6.ChartArea = "ChartArea1"; - series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series6.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series6.Legend = "Legend1"; - series6.Name = "LastGainVal"; - this.GainChart.Series.Add(series5); - this.GainChart.Series.Add(series6); + series17.ChartArea = "ChartArea1"; + series17.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series17.Legend = "Legend1"; + series17.Name = "Velocity Gain"; + series18.ChartArea = "ChartArea1"; + series18.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series18.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series18.Legend = "Legend1"; + series18.Name = "LastGainVal"; + this.GainChart.Series.Add(series17); + this.GainChart.Series.Add(series18); this.GainChart.Size = new System.Drawing.Size(723, 309); this.GainChart.TabIndex = 29; this.GainChart.Text = "chart1"; @@ -491,7 +494,8 @@ namespace grapher // advancedToolStripMenuItem // this.advancedToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.capStyleToolStripMenuItem}); + this.capStyleToolStripMenuItem, + this.toolStripMenuItem1}); this.advancedToolStripMenuItem.Name = "advancedToolStripMenuItem"; this.advancedToolStripMenuItem.Size = new System.Drawing.Size(72, 20); this.advancedToolStripMenuItem.Text = "Advanced"; @@ -502,7 +506,7 @@ namespace grapher this.sensitivityToolStripMenuItem, this.velocityGainToolStripMenuItem}); this.capStyleToolStripMenuItem.Name = "capStyleToolStripMenuItem"; - this.capStyleToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.capStyleToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.capStyleToolStripMenuItem.Text = "Cap Style"; // // sensitivityToolStripMenuItem @@ -510,13 +514,13 @@ namespace grapher this.sensitivityToolStripMenuItem.Checked = true; this.sensitivityToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.sensitivityToolStripMenuItem.Name = "sensitivityToolStripMenuItem"; - this.sensitivityToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.sensitivityToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.sensitivityToolStripMenuItem.Text = "Sensitivity"; // // velocityGainToolStripMenuItem // this.velocityGainToolStripMenuItem.Name = "velocityGainToolStripMenuItem"; - this.velocityGainToolStripMenuItem.Size = new System.Drawing.Size(142, 22); + this.velocityGainToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.velocityGainToolStripMenuItem.Text = "Velocity Gain"; // // startupToolStripMenuItem @@ -538,75 +542,75 @@ namespace grapher // // AccelerationChartY // - chartArea4.AxisX.Title = "Speed (counts/ms)"; - chartArea4.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea4.Name = "ChartArea1"; - this.AccelerationChartY.ChartAreas.Add(chartArea4); - legend4.Name = "Legend1"; - this.AccelerationChartY.Legends.Add(legend4); + chartArea10.AxisX.Title = "Speed (counts/ms)"; + chartArea10.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea10.Name = "ChartArea1"; + this.AccelerationChartY.ChartAreas.Add(chartArea10); + legend10.Name = "Legend1"; + this.AccelerationChartY.Legends.Add(legend10); this.AccelerationChartY.Location = new System.Drawing.Point(1062, 0); this.AccelerationChartY.Name = "AccelerationChartY"; - series7.ChartArea = "ChartArea1"; - series7.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series7.Legend = "Legend1"; - series7.Name = "Accelerated Sensitivity"; - series8.ChartArea = "ChartArea1"; - series8.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series8.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series8.Legend = "Legend1"; - series8.Name = "LastAccelVal"; - this.AccelerationChartY.Series.Add(series7); - this.AccelerationChartY.Series.Add(series8); + series19.ChartArea = "ChartArea1"; + series19.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series19.Legend = "Legend1"; + series19.Name = "Accelerated Sensitivity"; + series20.ChartArea = "ChartArea1"; + series20.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series20.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series20.Legend = "Legend1"; + series20.Name = "LastAccelVal"; + this.AccelerationChartY.Series.Add(series19); + this.AccelerationChartY.Series.Add(series20); this.AccelerationChartY.Size = new System.Drawing.Size(723, 328); this.AccelerationChartY.TabIndex = 31; this.AccelerationChartY.Text = "chart1"; // // VelocityChartY // - chartArea5.AxisX.Title = "Speed (count/ms)"; - chartArea5.AxisY.Title = "Output Speed (counts/ms)"; - chartArea5.Name = "ChartArea1"; - this.VelocityChartY.ChartAreas.Add(chartArea5); - legend5.Name = "Legend1"; - this.VelocityChartY.Legends.Add(legend5); + chartArea11.AxisX.Title = "Speed (count/ms)"; + chartArea11.AxisY.Title = "Output Speed (counts/ms)"; + chartArea11.Name = "ChartArea1"; + this.VelocityChartY.ChartAreas.Add(chartArea11); + legend11.Name = "Legend1"; + this.VelocityChartY.Legends.Add(legend11); this.VelocityChartY.Location = new System.Drawing.Point(1062, 334); this.VelocityChartY.Name = "VelocityChartY"; - series9.ChartArea = "ChartArea1"; - series9.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series9.Legend = "Legend1"; - series9.Name = "Mouse Velocity"; - series10.ChartArea = "ChartArea1"; - series10.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series10.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series10.Legend = "Legend1"; - series10.Name = "LastVelocityVal"; - this.VelocityChartY.Series.Add(series9); - this.VelocityChartY.Series.Add(series10); + series21.ChartArea = "ChartArea1"; + series21.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series21.Legend = "Legend1"; + series21.Name = "Mouse Velocity"; + series22.ChartArea = "ChartArea1"; + series22.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series22.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series22.Legend = "Legend1"; + series22.Name = "LastVelocityVal"; + this.VelocityChartY.Series.Add(series21); + this.VelocityChartY.Series.Add(series22); this.VelocityChartY.Size = new System.Drawing.Size(723, 307); this.VelocityChartY.TabIndex = 32; this.VelocityChartY.Text = "chart1"; // // GainChartY // - chartArea6.AxisX.Title = "Speed (counts/ms)"; - chartArea6.AxisY.Title = "Slope of Velocity Chart"; - chartArea6.Name = "ChartArea1"; - this.GainChartY.ChartAreas.Add(chartArea6); - legend6.Name = "Legend1"; - this.GainChartY.Legends.Add(legend6); + chartArea12.AxisX.Title = "Speed (counts/ms)"; + chartArea12.AxisY.Title = "Slope of Velocity Chart"; + chartArea12.Name = "ChartArea1"; + this.GainChartY.ChartAreas.Add(chartArea12); + legend12.Name = "Legend1"; + this.GainChartY.Legends.Add(legend12); this.GainChartY.Location = new System.Drawing.Point(1062, 647); this.GainChartY.Name = "GainChartY"; - series11.ChartArea = "ChartArea1"; - series11.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series11.Legend = "Legend1"; - series11.Name = "Velocity Gain"; - series12.ChartArea = "ChartArea1"; - series12.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series12.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series12.Legend = "Legend1"; - series12.Name = "LastGainVal"; - this.GainChartY.Series.Add(series11); - this.GainChartY.Series.Add(series12); + series23.ChartArea = "ChartArea1"; + series23.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series23.Legend = "Legend1"; + series23.Name = "Velocity Gain"; + series24.ChartArea = "ChartArea1"; + series24.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series24.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series24.Legend = "Legend1"; + series24.Name = "LastGainVal"; + this.GainChartY.Series.Add(series23); + this.GainChartY.Series.Add(series24); this.GainChartY.Size = new System.Drawing.Size(723, 309); this.GainChartY.TabIndex = 33; this.GainChartY.Text = "chart1"; @@ -737,6 +741,30 @@ namespace grapher this.MidpointActiveLabel.TabIndex = 47; this.MidpointActiveLabel.Text = "0"; // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.wholeVectorToolStripMenuItem, + this.byVectorComponentToolStripMenuItem}); + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 22); + this.toolStripMenuItem1.Text = "Application Style"; + // + // wholeVectorToolStripMenuItem + // + this.wholeVectorToolStripMenuItem.Checked = true; + this.wholeVectorToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.wholeVectorToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.wholeVectorToolStripMenuItem.Name = "wholeVectorToolStripMenuItem"; + this.wholeVectorToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.wholeVectorToolStripMenuItem.Text = "Whole"; + // + // byVectorComponentToolStripMenuItem + // + this.byVectorComponentToolStripMenuItem.Name = "byVectorComponentToolStripMenuItem"; + this.byVectorComponentToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.byVectorComponentToolStripMenuItem.Text = "By Component"; + // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -867,6 +895,9 @@ namespace grapher private System.Windows.Forms.Label MidpointActiveLabel; private System.Windows.Forms.ToolStripMenuItem startupToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem AutoWriteMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem wholeVectorToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem byVectorComponentToolStripMenuItem; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 37f67f8..f46c960 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -49,6 +49,8 @@ namespace grapher ActiveValueTitle.Width = AccelerationChart.Left - ActiveValueTitle.Left; ActiveValueTitle.TextAlign = ContentAlignment.MiddleCenter; + var applyOptions = new ApplyOptions(wholeVectorToolStripMenuItem, byVectorComponentToolStripMenuItem); + var sensitivity = new OptionXY( sensitivityBoxX, sensitivityBoxY, @@ -158,6 +160,7 @@ namespace grapher accelCalculator, accelCharts, settings, + applyOptions, accelerationOptions, sensitivity, rotation, diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index a15dba8..7789337 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -1,5 +1,6 @@ using grapher.Models.Calculations; using grapher.Models.Mouse; +using grapher.Models.Options; using grapher.Models.Serialized; using System; using System.CodeDom; @@ -23,6 +24,7 @@ namespace grapher AccelCalculator accelCalculator, AccelCharts accelCharts, SettingsManager settings, + ApplyOptions applyOptions, AccelOptions accelOptions, OptionXY sensitivity, Option rotation, @@ -41,6 +43,7 @@ namespace grapher AccelCalculator = accelCalculator; AccelCharts = accelCharts; AccelerationOptions = accelOptions; + ApplyOptions = applyOptions; Sensitivity = sensitivity; Rotation = rotation; Weight = weight; @@ -72,6 +75,8 @@ namespace grapher public SettingsManager Settings { get; } + public ApplyOptions ApplyOptions { get; } + public AccelOptions AccelerationOptions { get; } public OptionXY Sensitivity { get; } @@ -110,7 +115,7 @@ namespace grapher x = Sensitivity.Fields.X, y = Sensitivity.Fields.Y }, - combineMagnitudes = true, + combineMagnitudes = ApplyOptions.IsWhole, modes = new Vec2 { x = (AccelMode)AccelerationOptions.AccelerationIndex @@ -159,6 +164,7 @@ namespace grapher Acceleration.SetActiveValue(settings.args.x.accel); // rate, powerscale LimitOrExponent.SetActiveValue(settings.args.x.limit); //exp, powerexp Midpoint.SetActiveValue(settings.args.x.midpoint); + ApplyOptions.SetActive(settings.combineMagnitudes); //Cap.SetActiveValues(Settings.ActiveAccel.GainCap, Settings.ActiveAccel.CapX, Settings.ActiveAccel.CapY, Settings.ActiveAccel.GainCapEnabled); } diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs new file mode 100644 index 0000000..389bf62 --- /dev/null +++ b/grapher/Models/Options/ApplyOptions.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Windows.Forms.DataVisualization.Charting; + +namespace grapher.Models.Options +{ + public class ApplyOptions + { + public ApplyOptions( + ToolStripMenuItem wholeVectorMenuItem, + ToolStripMenuItem byComponentMenuItem) + { + WholeVectorMenuItem = wholeVectorMenuItem; + ByComponentVectorMenuItem = byComponentMenuItem; + + WholeVectorMenuItem.Click += new System.EventHandler(OnWholeClicked); + ByComponentVectorMenuItem.Click += new System.EventHandler(OnByComponentClicked); + + WholeVectorMenuItem.CheckedChanged += new System.EventHandler(OnWholeCheckedChange); + ByComponentVectorMenuItem.CheckedChanged += new System.EventHandler(OnByComponentCheckedChange); + + IsWhole = false; + } + + public ToolStripMenuItem WholeVectorMenuItem { get; } + + public ToolStripMenuItem ByComponentVectorMenuItem { get; } + + public bool IsWhole { get; private set; } + + public void SetActive(bool isWhole) + { + WholeVectorMenuItem.Checked = isWhole; + ByComponentVectorMenuItem.Checked = !isWhole; + } + + public void OnWholeClicked(object sender, EventArgs e) + { + if (!WholeVectorMenuItem.Checked) + { + WholeVectorMenuItem.Checked = true; + ByComponentVectorMenuItem.Checked = false; + } + } + + public void OnByComponentClicked(object sender, EventArgs e) + { + if (!ByComponentVectorMenuItem.Checked) + { + WholeVectorMenuItem.Checked = false; + ByComponentVectorMenuItem.Checked = true; + } + } + + public void OnWholeCheckedChange(object sender, EventArgs e) + { + if (WholeVectorMenuItem.Checked) + { + EnableWholeApplication(); + } + } + + public void OnByComponentCheckedChange(object sender, EventArgs e) + { + if (ByComponentVectorMenuItem.Checked) + { + EnableWholeApplication(); + } + } + + public void EnableWholeApplication() + { + IsWhole = true; + } + public void EnableByComponentApplication() + { + IsWhole = false; + } + + } +} diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index 493561a..3bdf3c6 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -93,12 +93,16 @@ namespace grapher CapOption.ActiveValueLabels.X.FormatString = GainCapFormatString; CapOption.ActiveValueLabels.X.Prefix = "Gain"; CapOption.SetActiveValues(gainCap, gainCap); + SensitivityCapCheck.Checked = true; + VelocityGainCapCheck.Checked = false; } else { CapOption.ActiveValueLabels.X.FormatString = ActiveValueLabel.DefaultFormatString; CapOption.ActiveValueLabels.X.Prefix = string.Empty; CapOption.SetActiveValues(sensCapX, sensCapY); + SensitivityCapCheck.Checked = false; + VelocityGainCapCheck.Checked = true; } } @@ -122,7 +126,7 @@ namespace grapher void OnSensitivityCapCheckedChange(object sender, EventArgs e) { - if (SensitivityCapCheck.Checked == true) + if (SensitivityCapCheck.Checked) { EnableSensitivityCap(); } @@ -130,7 +134,7 @@ namespace grapher void OnVelocityGainCapCheckedChange(object sender, EventArgs e) { - if (SensitivityCapCheck.Checked == true) + if (SensitivityCapCheck.Checked) { EnableVelocityGainCap(); } diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index d34e678..277db21 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -66,6 +66,7 @@ + -- cgit v1.2.3 From b5b87e24053c9f52a2edb5b1cb48f8e27e434ce1 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 00:56:07 -0700 Subject: Show xy charts only when accel applied by component --- grapher/Form1.cs | 12 ++++-------- grapher/Models/AccelGUI.cs | 8 +++++--- grapher/Models/Charts/AccelCharts.cs | 10 +++------- grapher/Models/Fields/FieldXY.cs | 7 +------ grapher/Models/Options/ApplyOptions.cs | 2 +- grapher/Models/Options/OptionXY.cs | 7 ++----- 6 files changed, 16 insertions(+), 30 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.cs b/grapher/Form1.cs index f46c960..f496293 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -41,8 +41,7 @@ namespace grapher new ChartXY(AccelerationChart, AccelerationChartY), new ChartXY(VelocityChart, VelocityChartY), new ChartXY(GainChart, GainChartY), - showVelocityGainToolStripMenuItem, - new CheckBox[] { sensXYLock, weightXYLock, capXYLock }); + showVelocityGainToolStripMenuItem); ActiveValueTitle.AutoSize = false; ActiveValueTitle.Left = LockXYLabel.Left + LockXYLabel.Width; @@ -61,8 +60,7 @@ namespace grapher new ActiveValueLabelXY( new ActiveValueLabel(SensitivityActiveXLabel, ActiveValueTitle), new ActiveValueLabel(SensitivityActiveYLabel, ActiveValueTitle)), - "Sensitivity", - accelCharts); + "Sensitivity"); var rotation = new Option( rotationBox, @@ -82,8 +80,7 @@ namespace grapher new ActiveValueLabelXY( new ActiveValueLabel(WeightActiveXLabel, ActiveValueTitle), new ActiveValueLabel(WeightActiveYLabel, ActiveValueTitle)), - "Weight", - accelCharts); + "Weight"); var cap = new OptionXY( capBoxX, @@ -95,8 +92,7 @@ namespace grapher new ActiveValueLabelXY( new ActiveValueLabel(CapActiveXLabel, ActiveValueTitle), new ActiveValueLabel(CapActiveYLabel, ActiveValueTitle)), - "Cap", - accelCharts); + "Cap"); var offset = new Option( offsetBox, diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 7789337..a26f13d 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -149,10 +149,10 @@ namespace grapher Settings.ActiveAccel, Settings.RawAccelSettings.AccelerationSettings); AccelCharts.Bind(); - UpdateActiveValueLabels(); + UpdateShownActiveValues(); } - public void UpdateActiveValueLabels() + public void UpdateShownActiveValues() { var settings = Settings.RawAccelSettings.AccelerationSettings; @@ -165,7 +165,9 @@ namespace grapher LimitOrExponent.SetActiveValue(settings.args.x.limit); //exp, powerexp Midpoint.SetActiveValue(settings.args.x.midpoint); ApplyOptions.SetActive(settings.combineMagnitudes); - //Cap.SetActiveValues(Settings.ActiveAccel.GainCap, Settings.ActiveAccel.CapX, Settings.ActiveAccel.CapY, Settings.ActiveAccel.GainCapEnabled); + Cap.SetActiveValues(settings.args.x.gainCap, settings.args.x.scaleCap, settings.args.y.scaleCap, settings.args.x.gainCap > 0); + + AccelCharts.RefreshXY(settings.combineMagnitudes); } private void OnScaleMenuItemClick(object sender, EventArgs e) diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 1aa3909..0136ced 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -24,8 +24,7 @@ namespace grapher ChartXY sensitivityChart, ChartXY velocityChart, ChartXY gainChart, - ToolStripMenuItem enableVelocityAndGain, - ICollection checkBoxesXY) + ToolStripMenuItem enableVelocityAndGain) { Estimated = new EstimatedPoints(); EstimatedX = new EstimatedPoints(); @@ -37,7 +36,6 @@ namespace grapher VelocityChart = velocityChart; GainChart = gainChart; EnableVelocityAndGain = enableVelocityAndGain; - CheckBoxesXY = checkBoxesXY; SensitivityChart.SetPointBinds(Estimated.Sensitivity, EstimatedX.Sensitivity, EstimatedY.Sensitivity); VelocityChart.SetPointBinds(Estimated.Velocity, EstimatedX.Velocity, EstimatedY.Velocity); @@ -78,8 +76,6 @@ namespace grapher private EstimatedPoints EstimatedY { get; } - private ICollection CheckBoxesXY { get; } - private bool Combined { get; set; } private int FormBorderHeight { get; } @@ -119,9 +115,9 @@ namespace grapher } } - public void RefreshXY() + public void RefreshXY(bool isWhole) { - if (CheckBoxesXY.All(box => box.Checked)) + if (isWhole) { ShowCombined(); } diff --git a/grapher/Models/Fields/FieldXY.cs b/grapher/Models/Fields/FieldXY.cs index 609af9d..87e0b9c 100644 --- a/grapher/Models/Fields/FieldXY.cs +++ b/grapher/Models/Fields/FieldXY.cs @@ -13,14 +13,13 @@ namespace grapher public const string ShortenedFormatString = "0.###"; - public FieldXY(TextBox xBox, TextBox yBox, CheckBox lockCheckBox, Form containingForm, double defaultData, AccelCharts accelCharts) + public FieldXY(TextBox xBox, TextBox yBox, CheckBox lockCheckBox, Form containingForm, double defaultData) { XField = new Field(xBox, containingForm, defaultData); YField = new Field(yBox, containingForm, defaultData); YField.FormatString = ShortenedFormatString; LockCheckBox = lockCheckBox; LockCheckBox.CheckedChanged += new System.EventHandler(CheckChanged); - AccelCharts = accelCharts; XField.Box.Width = (YField.Box.Left + YField.Box.Width - XField.Box.Left - DefaultSeparation) / 2; YField.Box.Width = XField.Box.Width; @@ -59,8 +58,6 @@ namespace grapher public Field YField { get; } - private AccelCharts AccelCharts { get; } - private bool Combined { get; set; } private int DefaultWidthX { get; } @@ -79,8 +76,6 @@ namespace grapher { SetSeparate(); } - - AccelCharts.RefreshXY(); } public void SetCombined() diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 389bf62..0c9fd6a 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -68,7 +68,7 @@ namespace grapher.Models.Options { if (ByComponentVectorMenuItem.Checked) { - EnableWholeApplication(); + EnableByComponentApplication(); } } diff --git a/grapher/Models/Options/OptionXY.cs b/grapher/Models/Options/OptionXY.cs index 8e22617..b026c8a 100644 --- a/grapher/Models/Options/OptionXY.cs +++ b/grapher/Models/Options/OptionXY.cs @@ -24,9 +24,8 @@ namespace grapher Form containingForm, double defaultData, Label label, - AccelCharts accelCharts, ActiveValueLabelXY activeValueLabels) - : this(new FieldXY(xBox, yBox, lockCheckBox, containingForm, defaultData, accelCharts), label, activeValueLabels) + : this(new FieldXY(xBox, yBox, lockCheckBox, containingForm, defaultData), label, activeValueLabels) { } @@ -38,8 +37,7 @@ namespace grapher double defaultData, Label label, ActiveValueLabelXY activeValueLabels, - string startingName, - AccelCharts accelCharts): + string startingName): this( xBox, yBox, @@ -47,7 +45,6 @@ namespace grapher containingForm, defaultData, label, - accelCharts, activeValueLabels) { SetName(startingName); -- cgit v1.2.3 From 246fb772c5bf7dd6a85143fadebece3b4d9f1e04 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 02:18:41 -0700 Subject: Add constants class and separate classes into regions --- grapher/Constants/AccelGUIConstants.cs | 36 ++++++++++++++++++++++++++ grapher/Models/AccelGUI.cs | 13 +++++----- grapher/Models/Calculations/AccelCalculator.cs | 28 +++++++++++++------- grapher/Models/Calculations/AccelChartData.cs | 12 +++++++++ grapher/Models/Calculations/AccelData.cs | 10 +++++++ grapher/Models/Charts/AccelCharts.cs | 26 ++++++++++++------- grapher/Models/Charts/ChartXY.cs | 4 +-- grapher/Models/Charts/EstimatedPoints.cs | 8 ++++++ grapher/Models/Fields/Field.cs | 5 ++-- grapher/Models/Fields/FieldXY.cs | 17 ++++++++++++ grapher/Models/Mouse/MouseWatcher.cs | 15 +++++++++++ grapher/Models/Mouse/PointData.cs | 12 +++++++++ grapher/Models/Options/AccelOptions.cs | 20 ++++++++++++++ grapher/Models/Options/ActiveValueLabel.cs | 20 ++++++++++++++ grapher/Models/Options/ActiveValueLabelXY.cs | 16 ++++++++++++ grapher/Models/Options/ApplyOptions.cs | 10 +++++++ grapher/Models/Options/CapOptions.cs | 17 +++++++++++- grapher/Models/Options/Option.cs | 12 +++++++++ grapher/Models/Options/OptionXY.cs | 10 +++++++ grapher/Models/Serialized/DriverSettings.cs | 16 ++++++++++++ grapher/Models/Serialized/GUISettings.cs | 8 ++++++ grapher/Models/Serialized/RawAccelSettings.cs | 21 +++++++++++++++ grapher/Models/Serialized/SettingsManager.cs | 12 +++++++++ 23 files changed, 318 insertions(+), 30 deletions(-) create mode 100644 grapher/Constants/AccelGUIConstants.cs (limited to 'grapher') diff --git a/grapher/Constants/AccelGUIConstants.cs b/grapher/Constants/AccelGUIConstants.cs new file mode 100644 index 0000000..20ec6d0 --- /dev/null +++ b/grapher/Constants/AccelGUIConstants.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher.Constants +{ + public static class AccelGUIConstants + { + #region Constants + + /// Vertical separation between charts, in pixels. + public const int ChartSeparationVertical = 10; + + /// Needed to show full contents in form. Unsure why. + public const int FormHeightPadding = 35; + + /// DPI by which charts are scaled if none is set by user. + public const int DefaultDPI = 1200; + + /// Poll rate by which charts are scaled if none is set by user. + public const int DefaultPollRate = 1000; + + /// Resolution of chart calulation. + public const int Resolution = 100; + + /// Multiplied by DPI over poll rate to find rough max expected velocity. + public const double MaxMultiplier = 85; + + /// Ratio of max (X, Y) used in "by component" calulations to those used in "whole vector" calculations. + public const double XYToCombinedRatio = 1.4; + + #endregion Constants + } +} diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index a26f13d..8fe752c 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -17,7 +17,7 @@ namespace grapher public class AccelGUI { - #region constructors + #region Constructors public AccelGUI( RawAcceleration accelForm, @@ -63,9 +63,9 @@ namespace grapher ScaleMenuItem.Click += new System.EventHandler(OnScaleMenuItemClick); } - #endregion constructors + #endregion Constructors - #region properties + #region Properties public RawAcceleration AccelForm { get; } @@ -101,9 +101,9 @@ namespace grapher public ToolStripMenuItem ScaleMenuItem { get; } - #endregion properties + #endregion Properties - #region methods + #region Methods public void UpdateActiveSettingsFromFields() { @@ -174,7 +174,8 @@ namespace grapher { UpdateGraph(); } - #endregion methods + + #endregion Methods } } diff --git a/grapher/Models/Calculations/AccelCalculator.cs b/grapher/Models/Calculations/AccelCalculator.cs index 102de8d..0f0a60a 100644 --- a/grapher/Models/Calculations/AccelCalculator.cs +++ b/grapher/Models/Calculations/AccelCalculator.cs @@ -1,4 +1,5 @@ -using grapher.Models.Serialized; +using grapher.Constants; +using grapher.Models.Serialized; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -11,11 +12,7 @@ namespace grapher.Models.Calculations { public class AccelCalculator { - public const int DefaultDPI = 1200; - public const int DefaultPollRate = 1000; - public const int Resolution = 100; - public const double MaxMultiplier = 85; - public const double XYToCombinedRatio = 1.3; + #region Structs public struct MagnitudeData { @@ -24,6 +21,9 @@ namespace grapher.Models.Calculations public int y; } + #endregion Structs + + #region Constructors public AccelCalculator(Field dpi, Field pollRate) { @@ -31,6 +31,10 @@ namespace grapher.Models.Calculations PollRate = pollRate; } + #endregion Constructors + + #region Properties + public ReadOnlyCollection MagnitudesCombined { get; private set; } public ReadOnlyCollection MagnitudesX { get; private set; } @@ -47,6 +51,10 @@ namespace grapher.Models.Calculations private int Increment { get; set; } + #endregion Fields + + #region Methods + public void Calculate(AccelData data, ManagedAccel accel, DriverSettings settings) { ScaleByMouseSettings(); @@ -171,12 +179,14 @@ namespace grapher.Models.Calculations public void ScaleByMouseSettings() { var dpiPollFactor = DPI.Data / PollRate.Data; - CombinedMaxVelocity = dpiPollFactor * MaxMultiplier; - Increment = (int) Math.Floor(CombinedMaxVelocity / Resolution); - XYMaxVelocity = CombinedMaxVelocity * 1.5; + CombinedMaxVelocity = dpiPollFactor * AccelGUIConstants.MaxMultiplier; + Increment = (int) Math.Floor(CombinedMaxVelocity / AccelGUIConstants.Resolution); + XYMaxVelocity = CombinedMaxVelocity * AccelGUIConstants.XYToCombinedRatio; MagnitudesCombined = GetMagnitudes(); MagnitudesX = GetMagnitudesX(); MagnitudesY = GetMagnitudesY(); } + + #endregion Methods } } diff --git a/grapher/Models/Calculations/AccelChartData.cs b/grapher/Models/Calculations/AccelChartData.cs index 20142a7..6b29f16 100644 --- a/grapher/Models/Calculations/AccelChartData.cs +++ b/grapher/Models/Calculations/AccelChartData.cs @@ -8,6 +8,8 @@ namespace grapher.Models.Calculations { public class AccelChartData { + #region Constructors + public AccelChartData() { AccelPoints = new SortedDictionary(); @@ -17,6 +19,10 @@ namespace grapher.Models.Calculations OutVelocityToPoints = new Dictionary(); } + #endregion Constructors + + #region Properties + public SortedDictionary AccelPoints { get; } public SortedDictionary VelocityPoints { get; } @@ -27,6 +33,10 @@ namespace grapher.Models.Calculations public Dictionary OutVelocityToPoints { get; } + #endregion Properties + + #region Methods + public void Clear() { AccelPoints.Clear(); @@ -57,5 +67,7 @@ namespace grapher.Models.Calculations return values; } } + + #endregion Methods } } diff --git a/grapher/Models/Calculations/AccelData.cs b/grapher/Models/Calculations/AccelData.cs index 683c67e..3e1f987 100644 --- a/grapher/Models/Calculations/AccelData.cs +++ b/grapher/Models/Calculations/AccelData.cs @@ -10,6 +10,7 @@ namespace grapher.Models.Calculations { public class AccelData { + #region Constructors public AccelData( EstimatedPoints combined, @@ -25,6 +26,10 @@ namespace grapher.Models.Calculations EstimatedY = y; } + #endregion Constructors + + #region Properties + public AccelChartData Combined { get; } public AccelChartData X { get; } @@ -37,6 +42,10 @@ namespace grapher.Models.Calculations private EstimatedPoints EstimatedY { get; } + #endregion Properties + + #region Methods + public void Clear() { Combined.Clear(); @@ -70,5 +79,6 @@ namespace grapher.Models.Calculations EstimatedY.Gain.Set(inYVelocity, yGain); } + #endregion Methods } } diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 0136ced..1574ce2 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -1,4 +1,5 @@ -using grapher.Models.Calculations; +using grapher.Constants; +using grapher.Models.Calculations; using grapher.Models.Charts; using System; using System.Collections.Generic; @@ -14,10 +15,7 @@ namespace grapher { public class AccelCharts { - public const int ChartSeparationVertical = 10; - - /// Needed to show full contents in form. Unsure why. - public const int FormHeightPadding = 35; + #region Constructors public AccelCharts( Form form, @@ -43,9 +41,9 @@ namespace grapher SensitivityChart.SetTop(0); VelocityChart.SetHeight(SensitivityChart.Height); - VelocityChart.SetTop(SensitivityChart.Height + ChartSeparationVertical); + VelocityChart.SetTop(SensitivityChart.Height + AccelGUIConstants.ChartSeparationVertical); GainChart.SetHeight(SensitivityChart.Height); - GainChart.SetTop(VelocityChart.Top + VelocityChart.Height + ChartSeparationVertical); + GainChart.SetTop(VelocityChart.Top + VelocityChart.Height + AccelGUIConstants.ChartSeparationVertical); Rectangle screenRectangle = ContaingForm.RectangleToScreen(ContaingForm.ClientRectangle); FormBorderHeight = screenRectangle.Top - ContaingForm.Top; @@ -58,6 +56,10 @@ namespace grapher ShowCombined(); } + #endregion Constructors + + #region Properties + public Form ContaingForm { get; } public ChartXY SensitivityChart { get; } @@ -80,6 +82,10 @@ namespace grapher private int FormBorderHeight { get; } + #endregion Properties + + #region Methods + public void MakeDots(int x, int y, double timeInMs) { if (Combined) @@ -149,9 +155,9 @@ namespace grapher VelocityChart.Show(); GainChart.Show(); ContaingForm.Height = SensitivityChart.Height + - ChartSeparationVertical + + AccelGUIConstants.ChartSeparationVertical + VelocityChart.Height + - ChartSeparationVertical + + AccelGUIConstants.ChartSeparationVertical + GainChart.Height + FormBorderHeight; } @@ -195,5 +201,7 @@ namespace grapher { ContaingForm.Width = SensitivityChart.Left + SensitivityChart.Width; } + + #endregion Methods } } diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 81874a2..e5a948a 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -15,11 +15,11 @@ namespace grapher { public class ChartXY { - #region Consts + #region Constants public const int ChartSeparationHorizontal = 10; - #endregion Consts + #endregion Constants #region Constructors diff --git a/grapher/Models/Charts/EstimatedPoints.cs b/grapher/Models/Charts/EstimatedPoints.cs index fa0718b..9ff0e5b 100644 --- a/grapher/Models/Charts/EstimatedPoints.cs +++ b/grapher/Models/Charts/EstimatedPoints.cs @@ -9,6 +9,8 @@ namespace grapher.Models.Charts { public class EstimatedPoints { + #region Constructors + public EstimatedPoints() { Sensitivity = new PointData(); @@ -16,10 +18,16 @@ namespace grapher.Models.Charts Gain = new PointData(); } + #endregion Constructors + + #region Properties + public PointData Sensitivity { get; } public PointData Velocity { get; } public PointData Gain { get; } + + #endregion Properties } } diff --git a/grapher/Models/Fields/Field.cs b/grapher/Models/Fields/Field.cs index 1810081..03693ed 100644 --- a/grapher/Models/Fields/Field.cs +++ b/grapher/Models/Fields/Field.cs @@ -16,7 +16,7 @@ namespace grapher #endregion Constants - #region Enums + #region Enumerations public enum FieldState { @@ -27,8 +27,7 @@ namespace grapher Unavailable, } - #endregion Enums - + #endregion Enumerations #region Constructors diff --git a/grapher/Models/Fields/FieldXY.cs b/grapher/Models/Fields/FieldXY.cs index 87e0b9c..83f6434 100644 --- a/grapher/Models/Fields/FieldXY.cs +++ b/grapher/Models/Fields/FieldXY.cs @@ -9,10 +9,16 @@ namespace grapher { public class FieldXY { + #region Constants + public const int DefaultSeparation = 4; public const string ShortenedFormatString = "0.###"; + #endregion Constants + + #region Constructors + public FieldXY(TextBox xBox, TextBox yBox, CheckBox lockCheckBox, Form containingForm, double defaultData) { XField = new Field(xBox, containingForm, defaultData); @@ -32,6 +38,11 @@ namespace grapher CombinedWidth = DefaultWidthX + DefaultWidthY + YField.Box.Left - (XField.Box.Left + DefaultWidthX); SetCombined(); } + + #endregion Constructors + + #region Properties + public double X { get => XField.Data; @@ -66,6 +77,10 @@ namespace grapher private int CombinedWidth { get; } + #endregion Properties + + #region Methods + private void CheckChanged(object sender, EventArgs e) { if (LockCheckBox.CheckState == CheckState.Checked) @@ -126,5 +141,7 @@ namespace grapher XField.Box.Hide(); YField.Box.Hide(); } + + #endregion Methods } } diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index fea4e2d..6f6b776 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -11,6 +11,7 @@ namespace grapher.Models.Mouse { public class MouseWatcher { + #region External /// /// Enumeration containing HID usage page flags. /// @@ -677,6 +678,10 @@ namespace grapher.Models.Mouse [DllImport("user32.dll")] public static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, out RawInput pData, ref int pcbSize, int cbSizeHeader); + #endregion External + + #region Constructors + public MouseWatcher(Form containingForm, Label display, AccelCharts accelCharts) { ContainingForm = containingForm; @@ -695,6 +700,10 @@ namespace grapher.Models.Mouse PollTime = 1; } + #endregion Constructors + + #region Properties + private Form ContainingForm { get; } private Label Display { get; } @@ -703,6 +712,10 @@ namespace grapher.Models.Mouse private double PollTime { get; } + #endregion Properties + + #region Methods + public void OnMouseMove(int x, int y, double timeInMs) { Display.Text = $"Last (x, y): ({x}, {y})"; @@ -723,5 +736,7 @@ namespace grapher.Models.Mouse } } + + #endregion Methods } } diff --git a/grapher/Models/Mouse/PointData.cs b/grapher/Models/Mouse/PointData.cs index 12a6e73..3641c23 100644 --- a/grapher/Models/Mouse/PointData.cs +++ b/grapher/Models/Mouse/PointData.cs @@ -8,6 +8,8 @@ namespace grapher.Models.Mouse { public class PointData { + #region Constructors + public PointData() { Lock = new Object(); @@ -15,6 +17,10 @@ namespace grapher.Models.Mouse Y = new double[] { 0 }; } + #endregion Constructors + + #region Properties + public Object Lock { get; } private double[] X { get; set; } @@ -29,6 +35,10 @@ namespace grapher.Models.Mouse } } + #endregion Properties + + #region Methods + public void Get(out double[] x, out double[] y) { lock(Lock) @@ -37,5 +47,7 @@ namespace grapher.Models.Mouse y = Y; } } + + #endregion Methods } } diff --git a/grapher/Models/Options/AccelOptions.cs b/grapher/Models/Options/AccelOptions.cs index 6b98274..224c5cb 100644 --- a/grapher/Models/Options/AccelOptions.cs +++ b/grapher/Models/Options/AccelOptions.cs @@ -11,9 +11,15 @@ namespace grapher { public class AccelOptions { + #region Constants + public const int PossibleOptionsCount = 4; public const int PossibleOptionsXYCount = 2; + #endregion Constants + + #region Fields + public static readonly Dictionary AccelerationTypes = new List { new LinearLayout(), @@ -27,6 +33,10 @@ namespace grapher new OffLayout() }.ToDictionary(k => k.Name); + #endregion Fields + + #region Constructors + public AccelOptions( ComboBox accelDropdown, Option[] options, @@ -57,6 +67,10 @@ namespace grapher Layout("Off"); } + #endregion Constructors + + #region Properties + public Button WriteButton { get; } public ComboBox AccelDropdown { get; } @@ -69,6 +83,10 @@ namespace grapher public OptionXY[] OptionsXY { get; } + #endregion Properties + + #region Methods + public void SetActiveValue(int index) { var name = AccelerationTypes.Where(t => t.Value.Index == index).FirstOrDefault().Value.Name; @@ -87,5 +105,7 @@ namespace grapher AccelerationIndex = accelerationType.Index; accelerationType.Layout(Options, OptionsXY, WriteButton); } + + #endregion Methods } } diff --git a/grapher/Models/Options/ActiveValueLabel.cs b/grapher/Models/Options/ActiveValueLabel.cs index 138775a..b2355b5 100644 --- a/grapher/Models/Options/ActiveValueLabel.cs +++ b/grapher/Models/Options/ActiveValueLabel.cs @@ -10,12 +10,22 @@ namespace grapher.Models.Options { public class ActiveValueLabel { + #region Constants + public const string DefaultFormatString = "0.######"; public static readonly Color ActiveValueFontColor = Color.FromArgb(255, 65, 65, 65); + #endregion Constants + + #region Fields + private string _prefix; private string _value; + #endregion Fields + + #region Constructors + public ActiveValueLabel(Label valueLabel, Label centeringLabel) { ValueLabel = valueLabel; @@ -29,6 +39,10 @@ namespace grapher.Models.Options Prefix = string.Empty; } + #endregion Constructors + + #region Properties + public Label ValueLabel { get; } public string FormatString { get; set; } @@ -79,6 +93,10 @@ namespace grapher.Models.Options } } + #endregion Properties + + #region Methods + public void Hide() { ValueLabel.Hide(); @@ -103,5 +121,7 @@ namespace grapher.Models.Options { ValueLabel.Text = string.IsNullOrWhiteSpace(Prefix) ? Value: $"{Prefix}: {Value}"; } + + #endregion Methods } } diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs index 12506e9..553ce48 100644 --- a/grapher/Models/Options/ActiveValueLabelXY.cs +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -8,9 +8,15 @@ namespace grapher.Models.Options { public class ActiveValueLabelXY { + #region Constants + public const int ActiveLabelXYSeparation = 2; public const string ShortenedFormatString = "0.###"; + #endregion Constants + + #region Constructors + public ActiveValueLabelXY( ActiveValueLabel x, ActiveValueLabel y) @@ -29,6 +35,10 @@ namespace grapher.Models.Options SetCombined(); } + #endregion Constructors + + #region Properties + public ActiveValueLabel X { get; } public ActiveValueLabel Y { get; } @@ -39,6 +49,10 @@ namespace grapher.Models.Options private int ShortenedWidth { get; } + #endregion Properties + + #region Methods + public void SetValues(double x, double y) { X.SetValue(x); @@ -80,5 +94,7 @@ namespace grapher.Models.Options Combined = false; } + + #region Methods } } diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 0c9fd6a..a269b49 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -10,6 +10,8 @@ namespace grapher.Models.Options { public class ApplyOptions { + #region Constructors + public ApplyOptions( ToolStripMenuItem wholeVectorMenuItem, ToolStripMenuItem byComponentMenuItem) @@ -26,12 +28,19 @@ namespace grapher.Models.Options IsWhole = false; } + #endregion Constructors + + #region Properties public ToolStripMenuItem WholeVectorMenuItem { get; } public ToolStripMenuItem ByComponentVectorMenuItem { get; } public bool IsWhole { get; private set; } + #endregion Properties + + #region Methods + public void SetActive(bool isWhole) { WholeVectorMenuItem.Checked = isWhole; @@ -81,5 +90,6 @@ namespace grapher.Models.Options IsWhole = false; } + #endregion Methods } } diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index 3bdf3c6..9d903ec 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -10,9 +10,14 @@ namespace grapher { public class CapOptions { + #region Constants public const string GainCapFormatString = "0.##"; + #endregion Constants + + #region Constructors + public CapOptions( ToolStripMenuItem sensitivityCapCheck, ToolStripMenuItem velocityGainCapCheck, @@ -34,6 +39,10 @@ namespace grapher EnableSensitivityCap(); } + #endregion Constructors + + #region Properties + public ToolStripMenuItem SensitivityCapCheck { get; } public ToolStripMenuItem VelocityGainCapCheck { get; } @@ -42,6 +51,8 @@ namespace grapher public OptionXY WeightOption { get; } + public bool IsSensitivityGain { get; private set; } + public double SensitivityCapX { get { @@ -84,7 +95,9 @@ namespace grapher } } - public bool IsSensitivityGain { get; private set; } + #endregion Properties + + #region Methods public void SetActiveValues(double gainCap, double sensCapX, double sensCapY, bool capGainEnabled) { @@ -157,5 +170,7 @@ namespace grapher WeightOption.Fields.LockCheckBox.Enabled = false; CapOption.SetName("Velocity Gain Cap"); } + + #endregion Methods } } diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index b0ef374..c5336a6 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -10,6 +10,8 @@ namespace grapher { public class Option { + #region Constructors + public Option( Field field, Label label, @@ -50,12 +52,20 @@ namespace grapher SetName(startingName); } + #endregion Constructors + + #region Properties + public Field Field { get; } public Label Label { get; } public ActiveValueLabel ActiveValueLabel { get; } + #endregion Properties + + #region Methods + public void SetName(string name) { Label.Text = name; @@ -93,5 +103,7 @@ namespace grapher Show(); } + + #endregion Methods } } diff --git a/grapher/Models/Options/OptionXY.cs b/grapher/Models/Options/OptionXY.cs index b026c8a..c1fd0b7 100644 --- a/grapher/Models/Options/OptionXY.cs +++ b/grapher/Models/Options/OptionXY.cs @@ -10,6 +10,7 @@ namespace grapher { public class OptionXY { + #region Constructors public OptionXY(FieldXY fields, Label label, ActiveValueLabelXY activeValueLabels) { Fields = fields; @@ -50,12 +51,20 @@ namespace grapher SetName(startingName); } + #endregion Constructors + + #region Properties + public FieldXY Fields { get; } public Label Label { get; } public ActiveValueLabelXY ActiveValueLabels { get; } + #endregion Properties + + #region Methods + public void SetName(string name) { Label.Text = name; @@ -89,5 +98,6 @@ namespace grapher Show(); } + #endregion Methods } } diff --git a/grapher/Models/Serialized/DriverSettings.cs b/grapher/Models/Serialized/DriverSettings.cs index 91d7e9f..e0b5d4a 100644 --- a/grapher/Models/Serialized/DriverSettings.cs +++ b/grapher/Models/Serialized/DriverSettings.cs @@ -3,11 +3,17 @@ using System.Runtime.InteropServices; namespace grapher.Models.Serialized { + #region Enumerations + public enum AccelMode { linear, classic, natural, logarithmic, sigmoid, naturalgain, sigmoidgain, power, noaccel } + #endregion Enumerations + + #region Structs + [StructLayout(LayoutKind.Sequential)] public struct AccelArgs { @@ -31,10 +37,14 @@ namespace grapher.Models.Serialized public T y; } + #endregion Structs + [StructLayout(LayoutKind.Sequential)] [Serializable] public class DriverSettings { + #region Fields + private static readonly IntPtr UnmanagedSettingsHandle = Marshal.AllocHGlobal(Marshal.SizeOf()); @@ -45,6 +55,10 @@ namespace grapher.Models.Serialized public Vec2 sensitivity; public double minimumTime; + #endregion Fields + + #region Methods + public static DriverSettings GetActive() { DriverInterop.GetActiveSettings(UnmanagedSettingsHandle); @@ -83,5 +97,7 @@ namespace grapher.Models.Serialized */ return true; } + + #endregion Methods } } diff --git a/grapher/Models/Serialized/GUISettings.cs b/grapher/Models/Serialized/GUISettings.cs index 7c8e9a4..253e71d 100644 --- a/grapher/Models/Serialized/GUISettings.cs +++ b/grapher/Models/Serialized/GUISettings.cs @@ -12,6 +12,8 @@ namespace grapher.Models.Serialized [Serializable] public class GUISettings { + #region Constructors + public GUISettings() {} public GUISettings(bool autoWrite, int dpi, int pollRate) @@ -21,6 +23,10 @@ namespace grapher.Models.Serialized PollRate = pollRate; } + #endregion Constructors + + #region Properties + [JsonProperty(Order = 1)] public bool AutoWriteToDriverOnStartup { get; set; } @@ -29,5 +35,7 @@ namespace grapher.Models.Serialized [JsonProperty(Order = 3)] public int PollRate { get; set; } + + #endregion Properties } } diff --git a/grapher/Models/Serialized/RawAccelSettings.cs b/grapher/Models/Serialized/RawAccelSettings.cs index 7aed917..768841a 100644 --- a/grapher/Models/Serialized/RawAccelSettings.cs +++ b/grapher/Models/Serialized/RawAccelSettings.cs @@ -13,7 +13,14 @@ namespace grapher.Models.Serialized [Serializable] public class RawAccelSettings { + #region Constants + public const string DefaultSettingsFileName = @"settings.json"; + + #endregion Constants + + #region Fields + public static readonly string ExecutingDirectory = AppDomain.CurrentDomain.BaseDirectory; public static readonly string DefaultSettingsFile = Path.Combine(ExecutingDirectory, DefaultSettingsFileName); public static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings @@ -21,6 +28,10 @@ namespace grapher.Models.Serialized MissingMemberHandling = MissingMemberHandling.Error, }; + #endregion Fields + + #region Constructors + public RawAccelSettings() { } public RawAccelSettings( @@ -31,10 +42,18 @@ namespace grapher.Models.Serialized GUISettings = guiSettings; } + #endregion Constructors + + #region Properties + public GUISettings GUISettings { get; set; } public DriverSettings AccelerationSettings { get; set; } + #endregion Properties + + #region Methods + public static RawAccelSettings Load() { return Load(DefaultSettingsFile); @@ -75,5 +94,7 @@ namespace grapher.Models.Serialized { File.WriteAllText(file, JsonConvert.SerializeObject(this, Formatting.Indented)); } + + #endregion Methods } } diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs index fc58387..7f018cf 100644 --- a/grapher/Models/Serialized/SettingsManager.cs +++ b/grapher/Models/Serialized/SettingsManager.cs @@ -6,6 +6,8 @@ namespace grapher.Models.Serialized { public class SettingsManager { + #region Constructors + public SettingsManager( ManagedAccel activeAccel, Field dpiField, @@ -18,6 +20,10 @@ namespace grapher.Models.Serialized AutoWriteMenuItem = autoWrite; } + #endregion Constructors + + #region Properties + public ManagedAccel ActiveAccel { get; } public RawAccelSettings RawAccelSettings { get; private set; } @@ -28,6 +34,10 @@ namespace grapher.Models.Serialized private ToolStripMenuItem AutoWriteMenuItem { get; set; } + #endregion Properties + + #region Methods + public void UpdateActiveSettings(DriverSettings settings) { try @@ -94,5 +104,7 @@ namespace grapher.Models.Serialized }); RawAccelSettings.Save(); } + + #endregion Methods } } -- cgit v1.2.3 From 4aa2f3ed741dcbd39233e125a34cac8163267d8d Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 02:39:09 -0700 Subject: Move constants to central class --- grapher/Constants/AccelGUIConstants.cs | 36 ------------ grapher/Constants/Constants.cs | 76 ++++++++++++++++++++++++++ grapher/Form1.cs | 4 +- grapher/Models/Calculations/AccelCalculator.cs | 9 ++- grapher/Models/Charts/AccelCharts.cs | 13 ++--- grapher/Models/Charts/ChartXY.cs | 8 +-- grapher/Models/Fields/Field.cs | 8 +-- grapher/Models/Fields/FieldXY.cs | 18 ++---- grapher/Models/Options/AccelOptions.cs | 11 +--- grapher/Models/Options/ActiveValueLabel.cs | 6 +- grapher/Models/Options/ActiveValueLabelXY.cs | 14 ++--- grapher/Models/Options/ApplyOptions.cs | 1 + grapher/Models/Options/CapOptions.cs | 5 +- grapher/Models/Serialized/RawAccelSettings.cs | 8 +-- grapher/grapher.csproj | 1 + 15 files changed, 110 insertions(+), 108 deletions(-) delete mode 100644 grapher/Constants/AccelGUIConstants.cs create mode 100644 grapher/Constants/Constants.cs (limited to 'grapher') diff --git a/grapher/Constants/AccelGUIConstants.cs b/grapher/Constants/AccelGUIConstants.cs deleted file mode 100644 index 20ec6d0..0000000 --- a/grapher/Constants/AccelGUIConstants.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace grapher.Constants -{ - public static class AccelGUIConstants - { - #region Constants - - /// Vertical separation between charts, in pixels. - public const int ChartSeparationVertical = 10; - - /// Needed to show full contents in form. Unsure why. - public const int FormHeightPadding = 35; - - /// DPI by which charts are scaled if none is set by user. - public const int DefaultDPI = 1200; - - /// Poll rate by which charts are scaled if none is set by user. - public const int DefaultPollRate = 1000; - - /// Resolution of chart calulation. - public const int Resolution = 100; - - /// Multiplied by DPI over poll rate to find rough max expected velocity. - public const double MaxMultiplier = 85; - - /// Ratio of max (X, Y) used in "by component" calulations to those used in "whole vector" calculations. - public const double XYToCombinedRatio = 1.4; - - #endregion Constants - } -} diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs new file mode 100644 index 0000000..61fa663 --- /dev/null +++ b/grapher/Constants/Constants.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher +{ + public static class Constants + { + #region Constants + + /// Vertical separation between charts, in pixels. + public const int ChartSeparationVertical = 10; + + /// Default name of settings file. + public const string DefaultSettingsFileName = @"settings.json"; + + /// Needed to show full contents in form. Unsure why. + public const int FormHeightPadding = 35; + + /// Format string for gain cap active value label. + public const string GainCapFormatString = "0.##"; + + /// DPI by which charts are scaled if none is set by user. + public const int DefaultDPI = 1200; + + /// Poll rate by which charts are scaled if none is set by user. + public const int DefaultPollRate = 1000; + + /// Resolution of chart calulation. + public const int Resolution = 100; + + /// Multiplied by DPI over poll rate to find rough max expected velocity. + public const double MaxMultiplier = 85; + + /// Ratio of max (X, Y) used in "by component" calulations to those used in "whole vector" calculations. + public const double XYToCombinedRatio = 1.4; + + /// Separation between X and Y active value labels, in pixels. + public const int ActiveLabelXYSeparation = 2; + + /// Format string for shortened x and y textboxes. + public const string ShortenedFormatString = "0.###"; + + /// Format string for default active value labels. + public const string DefaultActiveValueFormatString = "0.######"; + + /// Format string for default textboxes. + public const string DefaultFieldFormatString = "0.#########"; + + /// Possible options to display in a layout. + public const int PossibleOptionsCount = 4; + + /// Possible x/y options to display in a layout. + public const int PossibleOptionsXYCount = 2; + + /// Horizontal separation between charts, in pixels. + public const int ChartSeparationHorizontal = 10; + + /// Default horizontal separation between x and y fields, in pixels. + public const int DefaultFieldSeparation = 4; + + /// Format string for shortened x and y fields. + public const string ShortenedFieldFormatString = "0.###"; + #endregion Constants + + #region ReadOnly + + /// Color of font in active value labels. + public static readonly Color ActiveValueFontColor = Color.FromArgb(255, 65, 65, 65); + + #endregion ReadOnly + } +} diff --git a/grapher/Form1.cs b/grapher/Form1.cs index f496293..93b841c 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -142,8 +142,8 @@ namespace grapher weight); var accelCalculator = new AccelCalculator( - new Field(DPITextBox.TextBox, this, AccelCalculator.DefaultDPI), - new Field(PollRateTextBox.TextBox, this, AccelCalculator.DefaultPollRate)); + new Field(DPITextBox.TextBox, this, Constants.DefaultDPI), + new Field(PollRateTextBox.TextBox, this, Constants.DefaultPollRate)); var settings = new SettingsManager( activeAccel, diff --git a/grapher/Models/Calculations/AccelCalculator.cs b/grapher/Models/Calculations/AccelCalculator.cs index 0f0a60a..4e44902 100644 --- a/grapher/Models/Calculations/AccelCalculator.cs +++ b/grapher/Models/Calculations/AccelCalculator.cs @@ -1,5 +1,4 @@ -using grapher.Constants; -using grapher.Models.Serialized; +using grapher.Models.Serialized; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -179,9 +178,9 @@ namespace grapher.Models.Calculations public void ScaleByMouseSettings() { var dpiPollFactor = DPI.Data / PollRate.Data; - CombinedMaxVelocity = dpiPollFactor * AccelGUIConstants.MaxMultiplier; - Increment = (int) Math.Floor(CombinedMaxVelocity / AccelGUIConstants.Resolution); - XYMaxVelocity = CombinedMaxVelocity * AccelGUIConstants.XYToCombinedRatio; + CombinedMaxVelocity = dpiPollFactor * Constants.MaxMultiplier; + Increment = (int)Math.Floor(CombinedMaxVelocity / Constants.Resolution); + XYMaxVelocity = CombinedMaxVelocity * Constants.XYToCombinedRatio; MagnitudesCombined = GetMagnitudes(); MagnitudesX = GetMagnitudesX(); MagnitudesY = GetMagnitudesY(); diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 1574ce2..5e4b3de 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -1,5 +1,4 @@ -using grapher.Constants; -using grapher.Models.Calculations; +using grapher.Models.Calculations; using grapher.Models.Charts; using System; using System.Collections.Generic; @@ -41,9 +40,9 @@ namespace grapher SensitivityChart.SetTop(0); VelocityChart.SetHeight(SensitivityChart.Height); - VelocityChart.SetTop(SensitivityChart.Height + AccelGUIConstants.ChartSeparationVertical); + VelocityChart.SetTop(SensitivityChart.Height + Constants.ChartSeparationVertical); GainChart.SetHeight(SensitivityChart.Height); - GainChart.SetTop(VelocityChart.Top + VelocityChart.Height + AccelGUIConstants.ChartSeparationVertical); + GainChart.SetTop(VelocityChart.Top + VelocityChart.Height + Constants.ChartSeparationVertical); Rectangle screenRectangle = ContaingForm.RectangleToScreen(ContaingForm.ClientRectangle); FormBorderHeight = screenRectangle.Top - ContaingForm.Top; @@ -154,10 +153,10 @@ namespace grapher { VelocityChart.Show(); GainChart.Show(); - ContaingForm.Height = SensitivityChart.Height + - AccelGUIConstants.ChartSeparationVertical + + ContaingForm.Height = SensitivityChart.Height + + Constants.ChartSeparationVertical + VelocityChart.Height + - AccelGUIConstants.ChartSeparationVertical + + Constants.ChartSeparationVertical + GainChart.Height + FormBorderHeight; } diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index e5a948a..6a65e41 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -15,12 +15,6 @@ namespace grapher { public class ChartXY { - #region Constants - - public const int ChartSeparationHorizontal = 10; - - #endregion Constants - #region Constructors public ChartXY(Chart chartX, Chart chartY) @@ -31,7 +25,7 @@ namespace grapher ChartY.Top = ChartX.Top; ChartY.Height = ChartX.Height; ChartY.Width = ChartX.Width; - ChartY.Left = ChartX.Left + ChartX.Width + ChartSeparationHorizontal; + ChartY.Left = ChartX.Left + ChartX.Width + Constants.ChartSeparationHorizontal; SetupChart(ChartX); SetupChart(ChartY); diff --git a/grapher/Models/Fields/Field.cs b/grapher/Models/Fields/Field.cs index 03693ed..7651a37 100644 --- a/grapher/Models/Fields/Field.cs +++ b/grapher/Models/Fields/Field.cs @@ -10,12 +10,6 @@ namespace grapher { public class Field { - #region Constants - - public const string DefaultFormatString = "0.#########"; - - #endregion Constants - #region Enumerations public enum FieldState @@ -39,7 +33,7 @@ namespace grapher DefaultData = defaultData; State = FieldState.Undefined; ContainingForm = containingForm; - FormatString = DefaultFormatString; + FormatString = Constants.DefaultFieldFormatString; box.KeyDown += new System.Windows.Forms.KeyEventHandler(KeyDown); box.Leave += new System.EventHandler(FocusLeave); diff --git a/grapher/Models/Fields/FieldXY.cs b/grapher/Models/Fields/FieldXY.cs index 83f6434..826be27 100644 --- a/grapher/Models/Fields/FieldXY.cs +++ b/grapher/Models/Fields/FieldXY.cs @@ -9,31 +9,23 @@ namespace grapher { public class FieldXY { - #region Constants - - public const int DefaultSeparation = 4; - - public const string ShortenedFormatString = "0.###"; - - #endregion Constants - #region Constructors public FieldXY(TextBox xBox, TextBox yBox, CheckBox lockCheckBox, Form containingForm, double defaultData) { XField = new Field(xBox, containingForm, defaultData); YField = new Field(yBox, containingForm, defaultData); - YField.FormatString = ShortenedFormatString; + YField.FormatString = Constants.ShortenedFormatString; LockCheckBox = lockCheckBox; LockCheckBox.CheckedChanged += new System.EventHandler(CheckChanged); - XField.Box.Width = (YField.Box.Left + YField.Box.Width - XField.Box.Left - DefaultSeparation) / 2; + XField.Box.Width = (YField.Box.Left + YField.Box.Width - XField.Box.Left - Constants.DefaultFieldSeparation) / 2; YField.Box.Width = XField.Box.Width; DefaultWidthX = XField.Box.Width; DefaultWidthY = YField.Box.Width; - YField.Box.Left = XField.Box.Left + XField.Box.Width + DefaultSeparation; + YField.Box.Left = XField.Box.Left + XField.Box.Width + Constants.DefaultFieldSeparation; CombinedWidth = DefaultWidthX + DefaultWidthY + YField.Box.Left - (XField.Box.Left + DefaultWidthX); SetCombined(); @@ -99,7 +91,7 @@ namespace grapher YField.SetToUnavailable(); YField.Box.Hide(); XField.Box.Width = CombinedWidth; - XField.FormatString = Field.DefaultFormatString; + XField.FormatString = Constants.DefaultFieldFormatString; } public void SetSeparate() @@ -109,7 +101,7 @@ namespace grapher XField.Box.Width = DefaultWidthX; YField.Box.Width = DefaultWidthY; - XField.FormatString = ShortenedFormatString; + XField.FormatString = Constants.ShortenedFormatString; if (XField.State == Field.FieldState.Default) { diff --git a/grapher/Models/Options/AccelOptions.cs b/grapher/Models/Options/AccelOptions.cs index 224c5cb..8c01585 100644 --- a/grapher/Models/Options/AccelOptions.cs +++ b/grapher/Models/Options/AccelOptions.cs @@ -11,13 +11,6 @@ namespace grapher { public class AccelOptions { - #region Constants - - public const int PossibleOptionsCount = 4; - public const int PossibleOptionsXYCount = 2; - - #endregion Constants - #region Fields public static readonly Dictionary AccelerationTypes = new List @@ -49,12 +42,12 @@ namespace grapher AccelDropdown.Items.AddRange(AccelerationTypes.Keys.ToArray()); AccelDropdown.SelectedIndexChanged += new System.EventHandler(OnIndexChanged); - if (options.Length > PossibleOptionsCount) + if (options.Length > Constants.PossibleOptionsCount) { throw new Exception("Layout given too many options."); } - if (optionsXY.Length > PossibleOptionsXYCount) + if (optionsXY.Length > Constants.PossibleOptionsXYCount) { throw new Exception("Layout given too many options."); } diff --git a/grapher/Models/Options/ActiveValueLabel.cs b/grapher/Models/Options/ActiveValueLabel.cs index b2355b5..d2b43ab 100644 --- a/grapher/Models/Options/ActiveValueLabel.cs +++ b/grapher/Models/Options/ActiveValueLabel.cs @@ -12,8 +12,6 @@ namespace grapher.Models.Options { #region Constants - public const string DefaultFormatString = "0.######"; - public static readonly Color ActiveValueFontColor = Color.FromArgb(255, 65, 65, 65); #endregion Constants @@ -29,13 +27,13 @@ namespace grapher.Models.Options public ActiveValueLabel(Label valueLabel, Label centeringLabel) { ValueLabel = valueLabel; - ValueLabel.ForeColor = ActiveValueFontColor; + ValueLabel.ForeColor = Constants.ActiveValueFontColor; Left = centeringLabel.Left; Width = centeringLabel.Width; ValueLabel.AutoSize = false; ValueLabel.TextAlign = ContentAlignment.MiddleCenter; - FormatString = DefaultFormatString; + FormatString = Constants.DefaultActiveValueFormatString; Prefix = string.Empty; } diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs index 553ce48..c8caddf 100644 --- a/grapher/Models/Options/ActiveValueLabelXY.cs +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -10,8 +10,6 @@ namespace grapher.Models.Options { #region Constants - public const int ActiveLabelXYSeparation = 2; - public const string ShortenedFormatString = "0.###"; #endregion Constants @@ -25,11 +23,11 @@ namespace grapher.Models.Options Y = y; FullWidth = x.Width; - ShortenedWidth = (FullWidth - ActiveLabelXYSeparation) / 2; + ShortenedWidth = (FullWidth - Constants.ActiveLabelXYSeparation) / 2; - Y.Left = X.Left + ShortenedWidth + ActiveLabelXYSeparation; + Y.Left = X.Left + ShortenedWidth + Constants.ActiveLabelXYSeparation; Y.Width = ShortenedWidth; - Y.FormatString = ShortenedFormatString; + Y.FormatString = Constants.ShortenedFormatString; Combined = false; SetCombined(); @@ -72,7 +70,7 @@ namespace grapher.Models.Options { if (!Combined) { - X.FormatString = ActiveValueLabel.DefaultFormatString; + X.FormatString = Constants.DefaultActiveValueFormatString; X.Width = FullWidth; X.Prefix = string.Empty; Y.Hide(); @@ -85,7 +83,7 @@ namespace grapher.Models.Options { if (Combined) { - X.FormatString = ShortenedFormatString; + X.FormatString = Constants.ShortenedFormatString; X.Width = ShortenedWidth; X.Prefix = "X"; Y.Prefix = "Y"; @@ -95,6 +93,6 @@ namespace grapher.Models.Options Combined = false; } - #region Methods + #endregion Methods } } diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index a269b49..703f0d5 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -31,6 +31,7 @@ namespace grapher.Models.Options #endregion Constructors #region Properties + public ToolStripMenuItem WholeVectorMenuItem { get; } public ToolStripMenuItem ByComponentVectorMenuItem { get; } diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index 9d903ec..62f74a3 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -12,7 +12,6 @@ namespace grapher { #region Constants - public const string GainCapFormatString = "0.##"; #endregion Constants @@ -103,7 +102,7 @@ namespace grapher { if (capGainEnabled) { - CapOption.ActiveValueLabels.X.FormatString = GainCapFormatString; + CapOption.ActiveValueLabels.X.FormatString = Constants.GainCapFormatString; CapOption.ActiveValueLabels.X.Prefix = "Gain"; CapOption.SetActiveValues(gainCap, gainCap); SensitivityCapCheck.Checked = true; @@ -111,7 +110,7 @@ namespace grapher } else { - CapOption.ActiveValueLabels.X.FormatString = ActiveValueLabel.DefaultFormatString; + CapOption.ActiveValueLabels.X.FormatString = Constants.DefaultActiveValueFormatString; CapOption.ActiveValueLabels.X.Prefix = string.Empty; CapOption.SetActiveValues(sensCapX, sensCapY); SensitivityCapCheck.Checked = false; diff --git a/grapher/Models/Serialized/RawAccelSettings.cs b/grapher/Models/Serialized/RawAccelSettings.cs index 768841a..7466e82 100644 --- a/grapher/Models/Serialized/RawAccelSettings.cs +++ b/grapher/Models/Serialized/RawAccelSettings.cs @@ -13,16 +13,10 @@ namespace grapher.Models.Serialized [Serializable] public class RawAccelSettings { - #region Constants - - public const string DefaultSettingsFileName = @"settings.json"; - - #endregion Constants - #region Fields public static readonly string ExecutingDirectory = AppDomain.CurrentDomain.BaseDirectory; - public static readonly string DefaultSettingsFile = Path.Combine(ExecutingDirectory, DefaultSettingsFileName); + public static readonly string DefaultSettingsFile = Path.Combine(ExecutingDirectory, Constants.DefaultSettingsFileName); public static readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings { MissingMemberHandling = MissingMemberHandling.Error, diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index 277db21..a726b1b 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -53,6 +53,7 @@ + -- cgit v1.2.3 From fa497a2a20b02b4a44690d55ffa1cac26bafe35f Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 03:15:45 -0700 Subject: Add factory to create AccelGUI --- grapher/Form1.cs | 159 ++++++++--------------------- grapher/Models/AccelGUI.cs | 3 +- grapher/Models/AccelGUIFactory.cs | 207 ++++++++++++++++++++++++++++++++++++++ grapher/grapher.csproj | 1 + 4 files changed, 253 insertions(+), 117 deletions(-) create mode 100644 grapher/Models/AccelGUIFactory.cs (limited to 'grapher') diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 93b841c..20768ef 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -12,6 +12,7 @@ using System.Runtime.InteropServices; using grapher.Models.Calculations; using grapher.Models.Options; using grapher.Models.Serialized; +using grapher.Models; namespace grapher { @@ -36,140 +37,68 @@ namespace grapher throw; } - var accelCharts = new AccelCharts( - this, - new ChartXY(AccelerationChart, AccelerationChartY), - new ChartXY(VelocityChart, VelocityChartY), - new ChartXY(GainChart, GainChartY), - showVelocityGainToolStripMenuItem); - ActiveValueTitle.AutoSize = false; ActiveValueTitle.Left = LockXYLabel.Left + LockXYLabel.Width; ActiveValueTitle.Width = AccelerationChart.Left - ActiveValueTitle.Left; ActiveValueTitle.TextAlign = ContentAlignment.MiddleCenter; - var applyOptions = new ApplyOptions(wholeVectorToolStripMenuItem, byVectorComponentToolStripMenuItem); - - var sensitivity = new OptionXY( + AccelGUI = AccelGUIFactory.Construct( + this, + activeAccel, + AccelerationChart, + AccelerationChartY, + VelocityChart, + VelocityChartY, + GainChart, + GainChartY, + accelTypeDrop, + writeButton, + showVelocityGainToolStripMenuItem, + wholeVectorToolStripMenuItem, + byVectorComponentToolStripMenuItem, + sensitivityToolStripMenuItem, + velocityGainToolStripMenuItem, + AutoWriteMenuItem, + scaleByDPIToolStripMenuItem, + DPITextBox, + PollRateTextBox, sensitivityBoxX, sensitivityBoxY, - sensXYLock, - this, - 1, - sensitivityLabel, - new ActiveValueLabelXY( - new ActiveValueLabel(SensitivityActiveXLabel, ActiveValueTitle), - new ActiveValueLabel(SensitivityActiveYLabel, ActiveValueTitle)), - "Sensitivity"); - - var rotation = new Option( rotationBox, - this, - 0, - rotationLabel, - new ActiveValueLabel(RotationActiveLabel, ActiveValueTitle), - "Rotation"); - - var weight = new OptionXY( weightBoxFirst, weightBoxSecond, - weightXYLock, - this, - 1, - weightLabel, - new ActiveValueLabelXY( - new ActiveValueLabel(WeightActiveXLabel, ActiveValueTitle), - new ActiveValueLabel(WeightActiveYLabel, ActiveValueTitle)), - "Weight"); - - var cap = new OptionXY( capBoxX, capBoxY, + offsetBox, + accelerationBox, + limitBox, + midpointBox, + sensXYLock, + weightXYLock, capXYLock, - this, - 0, + sensitivityLabel, + rotationLabel, + weightLabel, capLabel, - new ActiveValueLabelXY( - new ActiveValueLabel(CapActiveXLabel, ActiveValueTitle), - new ActiveValueLabel(CapActiveYLabel, ActiveValueTitle)), - "Cap"); - - var offset = new Option( - offsetBox, - this, - 0, offsetLabel, - new ActiveValueLabel(OffsetActiveLabel, ActiveValueTitle), - "Offset"); - - // The name and layout of these options is handled by AccelerationOptions object. - var acceleration = new Option( - new Field(accelerationBox, this, 0), constantOneLabel, - new ActiveValueLabel(AccelerationActiveLabel, ActiveValueTitle)); - - var limitOrExponent = new Option( - new Field(limitBox, this, 2), constantTwoLabel, - new ActiveValueLabel(LimitExpActiveLabel, ActiveValueTitle)); - - var midpoint = new Option( - new Field(midpointBox, this, 0), constantThreeLabel, - new ActiveValueLabel(MidpointActiveLabel, ActiveValueTitle)); + ActiveValueTitle, + SensitivityActiveXLabel, + SensitivityActiveYLabel, + RotationActiveLabel, + WeightActiveXLabel, + WeightActiveYLabel, + CapActiveXLabel, + CapActiveYLabel, + OffsetActiveLabel, + AccelerationActiveLabel, + LimitExpActiveLabel, + MidpointActiveLabel, + AccelTypeActiveLabel, + MouseLabel); - var accelerationOptions = new AccelOptions( - accelTypeDrop, - new Option[] - { - offset, - acceleration, - limitOrExponent, - midpoint, - }, - new OptionXY[] - { - weight, - cap, - }, - writeButton, - new ActiveValueLabel(AccelTypeActiveLabel, ActiveValueTitle)); - - var capOptions = new CapOptions( - sensitivityToolStripMenuItem, - velocityGainToolStripMenuItem, - cap, - weight); - - var accelCalculator = new AccelCalculator( - new Field(DPITextBox.TextBox, this, Constants.DefaultDPI), - new Field(PollRateTextBox.TextBox, this, Constants.DefaultPollRate)); - - var settings = new SettingsManager( - activeAccel, - accelCalculator.DPI, - accelCalculator.PollRate, - AutoWriteMenuItem); - - AccelGUI = new AccelGUI( - this, - accelCalculator, - accelCharts, - settings, - applyOptions, - accelerationOptions, - sensitivity, - rotation, - weight, - capOptions, - offset, - acceleration, - limitOrExponent, - midpoint, - writeButton, - MouseLabel, - ScaleMenuItem, - AutoWriteMenuItem); } #endregion Constructor diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 8fe752c..b9a578f 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -36,8 +36,7 @@ namespace grapher Option midpoint, Button writeButton, Label mouseMoveLabel, - ToolStripMenuItem scaleMenuItem, - ToolStripMenuItem autoWriteMenuItem) + ToolStripMenuItem scaleMenuItem) { AccelForm = accelForm; AccelCalculator = accelCalculator; diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs new file mode 100644 index 0000000..e7167e9 --- /dev/null +++ b/grapher/Models/AccelGUIFactory.cs @@ -0,0 +1,207 @@ +using grapher.Models.Calculations; +using grapher.Models.Options; +using grapher.Models.Serialized; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Windows.Forms.DataVisualization.Charting; + +namespace grapher.Models +{ + public static class AccelGUIFactory + { + #region Methods + + public static AccelGUI Construct( + RawAcceleration form, + ManagedAccel activeAccel, + Chart accelerationChart, + Chart accelerationChartY, + Chart velocityChart, + Chart velocityChartY, + Chart gainChart, + Chart gainChartY, + ComboBox accelTypeDrop, + Button writeButton, + ToolStripMenuItem showVelocityGainToolStripMenuItem, + ToolStripMenuItem wholeVectorToolStripMenuItem, + ToolStripMenuItem byVectorComponentToolStripMenuItem, + ToolStripMenuItem sensitivityToolStripMenuItem, + ToolStripMenuItem velocityGainToolStripMenuItem, + ToolStripMenuItem autoWriteMenuItem, + ToolStripMenuItem scaleMenuItem, + ToolStripTextBox dpiTextBox, + ToolStripTextBox pollRateTextBox, + TextBox sensitivityBoxX, + TextBox sensitivityBoxY, + TextBox rotationBox, + TextBox weightBoxX, + TextBox weightBoxY, + TextBox capBoxX, + TextBox capBoxY, + TextBox offsetBox, + TextBox accelerationBox, + TextBox limitBox, + TextBox midpointBox, + CheckBox sensXYLock, + CheckBox weightXYLock, + CheckBox capXYLock, + Label sensitivityLabel, + Label rotationLabel, + Label weightLabel, + Label capLabel, + Label offsetLabel, + Label constantOneLabel, + Label constantTwoLabel, + Label constantThreeLabel, + Label activeValueTitle, + Label sensitivityActiveXLabel, + Label sensitivityActiveYLabel, + Label rotationActiveLabel, + Label weightActiveXLabel, + Label weightActiveYLabel, + Label capActiveXLabel, + Label capActiveYLabel, + Label offsetActiveLabel, + Label accelerationActiveLabel, + Label limitExpActiveLabel, + Label midpointActiveLabel, + Label accelTypeActiveLabel, + Label mouseLabel) + { + var accelCharts = new AccelCharts( + form, + new ChartXY(accelerationChart, accelerationChartY), + new ChartXY(velocityChart, velocityChartY), + new ChartXY(gainChart, gainChartY), + showVelocityGainToolStripMenuItem); + + var applyOptions = new ApplyOptions(wholeVectorToolStripMenuItem, byVectorComponentToolStripMenuItem); + + var sensitivity = new OptionXY( + sensitivityBoxX, + sensitivityBoxY, + sensXYLock, + form, + 1, + sensitivityLabel, + new ActiveValueLabelXY( + new ActiveValueLabel(sensitivityActiveXLabel, activeValueTitle), + new ActiveValueLabel(sensitivityActiveYLabel, activeValueTitle)), + "Sensitivity"); + + var rotation = new Option( + rotationBox, + form, + 0, + rotationLabel, + new ActiveValueLabel(rotationActiveLabel, activeValueTitle), + "Rotation"); + + var weight = new OptionXY( + weightBoxX, + weightBoxY, + weightXYLock, + form, + 1, + weightLabel, + new ActiveValueLabelXY( + new ActiveValueLabel(weightActiveXLabel, activeValueTitle), + new ActiveValueLabel(weightActiveYLabel, activeValueTitle)), + "Weight"); + + var cap = new OptionXY( + capBoxX, + capBoxY, + capXYLock, + form, + 0, + capLabel, + new ActiveValueLabelXY( + new ActiveValueLabel(capActiveXLabel, activeValueTitle), + new ActiveValueLabel(capActiveYLabel, activeValueTitle)), + "Cap"); + + var offset = new Option( + offsetBox, + form, + 0, + offsetLabel, + new ActiveValueLabel(offsetActiveLabel, activeValueTitle), + "Offset"); + + // The name and layout of these options is handled by AccelerationOptions object. + var acceleration = new Option( + new Field(accelerationBox, form, 0), + constantOneLabel, + new ActiveValueLabel(accelerationActiveLabel, activeValueTitle)); + + var limitOrExponent = new Option( + new Field(limitBox, form, 2), + constantTwoLabel, + new ActiveValueLabel(limitExpActiveLabel, activeValueTitle)); + + var midpoint = new Option( + new Field(midpointBox, form, 0), + constantThreeLabel, + new ActiveValueLabel(midpointActiveLabel, activeValueTitle)); + + var accelerationOptions = new AccelOptions( + accelTypeDrop, + new Option[] + { + offset, + acceleration, + limitOrExponent, + midpoint, + }, + new OptionXY[] + { + weight, + cap, + }, + writeButton, + new ActiveValueLabel(accelTypeActiveLabel, activeValueTitle)); + + var capOptions = new CapOptions( + sensitivityToolStripMenuItem, + velocityGainToolStripMenuItem, + cap, + weight); + + var accelCalculator = new AccelCalculator( + new Field(dpiTextBox.TextBox, form, Constants.DefaultDPI), + new Field(pollRateTextBox.TextBox, form, Constants.DefaultPollRate)); + + var settings = new SettingsManager( + activeAccel, + accelCalculator.DPI, + accelCalculator.PollRate, + autoWriteMenuItem); + + return new AccelGUI( + form, + accelCalculator, + accelCharts, + settings, + applyOptions, + accelerationOptions, + sensitivity, + rotation, + weight, + capOptions, + offset, + acceleration, + limitOrExponent, + midpoint, + writeButton, + mouseLabel, + scaleMenuItem); + } + + #endregion Methods + } +} diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index a726b1b..d382041 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -56,6 +56,7 @@ + -- cgit v1.2.3 From 621ef5afb1ac38ca6b87d25efe8442e499a7809b Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 16:26:15 -0700 Subject: Add text boxes and labels for by component accel --- grapher/Form1.Designer.cs | 450 +++++++++++++++++++++++++++------------------- 1 file changed, 261 insertions(+), 189 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index cc39c5f..eefab51 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -30,30 +30,30 @@ namespace grapher /// private void InitializeComponent() { - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea7 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend7 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series13 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series14 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea8 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend8 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series15 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series16 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea9 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend9 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series17 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series18 = 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 series19 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series20 = 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 series21 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series22 = 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 series23 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series24 = new System.Windows.Forms.DataVisualization.Charting.Series(); + 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.Series series2 = 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 series3 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series4 = 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 series5 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series7 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series8 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea5 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend5 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series9 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series10 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea6 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend6 = 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.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(); @@ -77,8 +77,6 @@ namespace grapher this.sensitivityBoxY = new System.Windows.Forms.TextBox(); this.capBoxY = new System.Windows.Forms.TextBox(); this.sensXYLock = new System.Windows.Forms.CheckBox(); - this.capXYLock = new System.Windows.Forms.CheckBox(); - this.weightXYLock = new System.Windows.Forms.CheckBox(); 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(); @@ -95,6 +93,9 @@ namespace grapher this.capStyleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.sensitivityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.velocityGainToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.wholeVectorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.byVectorComponentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.startupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AutoWriteMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AccelerationChartY = new System.Windows.Forms.DataVisualization.Charting.Chart(); @@ -114,9 +115,15 @@ namespace grapher this.OffsetActiveLabel = new System.Windows.Forms.Label(); this.LimitExpActiveLabel = new System.Windows.Forms.Label(); this.MidpointActiveLabel = new System.Windows.Forms.Label(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.wholeVectorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.byVectorComponentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.textBox4 = new System.Windows.Forms.TextBox(); + this.accelTypeDropY = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.GainChart)).BeginInit(); @@ -128,35 +135,35 @@ namespace grapher // // AccelerationChart // - chartArea7.AxisX.Title = "Speed (counts/ms)"; - chartArea7.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea7.Name = "ChartArea1"; - this.AccelerationChart.ChartAreas.Add(chartArea7); - legend7.Name = "Legend1"; - this.AccelerationChart.Legends.Add(legend7); + 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(333, 0); this.AccelerationChart.Name = "AccelerationChart"; - series13.ChartArea = "ChartArea1"; - series13.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series13.Legend = "Legend1"; - series13.Name = "Accelerated Sensitivity"; - series14.ChartArea = "ChartArea1"; - series14.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series14.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series14.Legend = "Legend1"; - series14.Name = "LastAccelVal"; - this.AccelerationChart.Series.Add(series13); - this.AccelerationChart.Series.Add(series14); + series1.ChartArea = "ChartArea1"; + series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series1.Legend = "Legend1"; + series1.Name = "Accelerated Sensitivity"; + series2.ChartArea = "ChartArea1"; + series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series2.Legend = "Legend1"; + series2.Name = "LastAccelVal"; + this.AccelerationChart.Series.Add(series1); + this.AccelerationChart.Series.Add(series2); this.AccelerationChart.Size = new System.Drawing.Size(723, 328); this.AccelerationChart.TabIndex = 0; - this.AccelerationChart.Text = "chart1"; + this.AccelerationChart.Text = "Sensitivity"; // // accelTypeDrop // this.accelTypeDrop.FormattingEnabled = true; this.accelTypeDrop.Location = new System.Drawing.Point(24, 98); this.accelTypeDrop.Name = "accelTypeDrop"; - this.accelTypeDrop.Size = new System.Drawing.Size(151, 21); + this.accelTypeDrop.Size = new System.Drawing.Size(113, 21); this.accelTypeDrop.TabIndex = 2; this.accelTypeDrop.Text = "Acceleration Type"; // @@ -196,7 +203,7 @@ namespace grapher // this.accelerationBox.Location = new System.Drawing.Point(105, 125); this.accelerationBox.Name = "accelerationBox"; - this.accelerationBox.Size = new System.Drawing.Size(69, 20); + this.accelerationBox.Size = new System.Drawing.Size(32, 20); this.accelerationBox.TabIndex = 7; // // constantOneLabel @@ -254,7 +261,7 @@ namespace grapher // this.limitBox.Location = new System.Drawing.Point(105, 229); this.limitBox.Name = "limitBox"; - this.limitBox.Size = new System.Drawing.Size(70, 20); + this.limitBox.Size = new System.Drawing.Size(32, 20); this.limitBox.TabIndex = 15; // // constantTwoLabel @@ -271,7 +278,7 @@ namespace grapher // this.midpointBox.Location = new System.Drawing.Point(105, 255); this.midpointBox.Name = "midpointBox"; - this.midpointBox.Size = new System.Drawing.Size(70, 20); + this.midpointBox.Size = new System.Drawing.Size(32, 20); this.midpointBox.TabIndex = 17; // // constantThreeLabel @@ -288,7 +295,7 @@ namespace grapher // this.offsetBox.Location = new System.Drawing.Point(105, 203); this.offsetBox.Name = "offsetBox"; - this.offsetBox.Size = new System.Drawing.Size(70, 20); + this.offsetBox.Size = new System.Drawing.Size(32, 20); this.offsetBox.TabIndex = 19; // // offsetLabel @@ -336,28 +343,6 @@ namespace grapher this.sensXYLock.TabIndex = 24; this.sensXYLock.UseVisualStyleBackColor = true; // - // capXYLock - // - this.capXYLock.AutoSize = true; - this.capXYLock.Checked = true; - this.capXYLock.CheckState = System.Windows.Forms.CheckState.Checked; - 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; - this.capXYLock.UseVisualStyleBackColor = true; - // - // weightXYLock - // - this.weightXYLock.AutoSize = true; - this.weightXYLock.Checked = true; - this.weightXYLock.CheckState = System.Windows.Forms.CheckState.Checked; - 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; - this.weightXYLock.UseVisualStyleBackColor = true; - // // LockXYLabel // this.LockXYLabel.AutoSize = true; @@ -369,50 +354,50 @@ namespace grapher // // VelocityChart // - chartArea8.AxisX.Title = "Speed (count/ms)"; - chartArea8.AxisY.Title = "Output Speed (counts/ms)"; - chartArea8.Name = "ChartArea1"; - this.VelocityChart.ChartAreas.Add(chartArea8); - legend8.Name = "Legend1"; - this.VelocityChart.Legends.Add(legend8); + 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(333, 334); this.VelocityChart.Name = "VelocityChart"; - series15.ChartArea = "ChartArea1"; - series15.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series15.Legend = "Legend1"; - series15.Name = "Mouse Velocity"; - series16.ChartArea = "ChartArea1"; - series16.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series16.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series16.Legend = "Legend1"; - series16.Name = "LastVelocityVal"; - this.VelocityChart.Series.Add(series15); - this.VelocityChart.Series.Add(series16); + series3.ChartArea = "ChartArea1"; + series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series3.Legend = "Legend1"; + series3.Name = "Mouse Velocity"; + series4.ChartArea = "ChartArea1"; + series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series4.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series4.Legend = "Legend1"; + series4.Name = "LastVelocityVal"; + this.VelocityChart.Series.Add(series3); + this.VelocityChart.Series.Add(series4); this.VelocityChart.Size = new System.Drawing.Size(723, 307); this.VelocityChart.TabIndex = 28; this.VelocityChart.Text = "chart1"; // // GainChart // - chartArea9.AxisX.Title = "Speed (counts/ms)"; - chartArea9.AxisY.Title = "Slope of Velocity Chart"; - chartArea9.Name = "ChartArea1"; - this.GainChart.ChartAreas.Add(chartArea9); - legend9.Name = "Legend1"; - this.GainChart.Legends.Add(legend9); + 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(333, 647); this.GainChart.Name = "GainChart"; - series17.ChartArea = "ChartArea1"; - series17.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series17.Legend = "Legend1"; - series17.Name = "Velocity Gain"; - series18.ChartArea = "ChartArea1"; - series18.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series18.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series18.Legend = "Legend1"; - series18.Name = "LastGainVal"; - this.GainChart.Series.Add(series17); - this.GainChart.Series.Add(series18); + series5.ChartArea = "ChartArea1"; + series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series5.Legend = "Legend1"; + series5.Name = "Velocity Gain"; + series6.ChartArea = "ChartArea1"; + series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series6.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series6.Legend = "Legend1"; + series6.Name = "LastGainVal"; + this.GainChart.Series.Add(series5); + this.GainChart.Series.Add(series6); this.GainChart.Size = new System.Drawing.Size(723, 309); this.GainChart.TabIndex = 29; this.GainChart.Text = "chart1"; @@ -506,7 +491,7 @@ namespace grapher this.sensitivityToolStripMenuItem, this.velocityGainToolStripMenuItem}); this.capStyleToolStripMenuItem.Name = "capStyleToolStripMenuItem"; - this.capStyleToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.capStyleToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.capStyleToolStripMenuItem.Text = "Cap Style"; // // sensitivityToolStripMenuItem @@ -514,15 +499,39 @@ namespace grapher this.sensitivityToolStripMenuItem.Checked = true; this.sensitivityToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.sensitivityToolStripMenuItem.Name = "sensitivityToolStripMenuItem"; - this.sensitivityToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.sensitivityToolStripMenuItem.Size = new System.Drawing.Size(142, 22); this.sensitivityToolStripMenuItem.Text = "Sensitivity"; // // velocityGainToolStripMenuItem // this.velocityGainToolStripMenuItem.Name = "velocityGainToolStripMenuItem"; - this.velocityGainToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.velocityGainToolStripMenuItem.Size = new System.Drawing.Size(142, 22); this.velocityGainToolStripMenuItem.Text = "Velocity Gain"; // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.wholeVectorToolStripMenuItem, + this.byVectorComponentToolStripMenuItem}); + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(163, 22); + this.toolStripMenuItem1.Text = "Application Style"; + // + // wholeVectorToolStripMenuItem + // + this.wholeVectorToolStripMenuItem.Checked = true; + this.wholeVectorToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.wholeVectorToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.wholeVectorToolStripMenuItem.Name = "wholeVectorToolStripMenuItem"; + this.wholeVectorToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.wholeVectorToolStripMenuItem.Text = "Whole"; + // + // byVectorComponentToolStripMenuItem + // + this.byVectorComponentToolStripMenuItem.Name = "byVectorComponentToolStripMenuItem"; + this.byVectorComponentToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.byVectorComponentToolStripMenuItem.Text = "By Component"; + // // startupToolStripMenuItem // this.startupToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -542,75 +551,75 @@ namespace grapher // // AccelerationChartY // - chartArea10.AxisX.Title = "Speed (counts/ms)"; - chartArea10.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea10.Name = "ChartArea1"; - this.AccelerationChartY.ChartAreas.Add(chartArea10); - legend10.Name = "Legend1"; - this.AccelerationChartY.Legends.Add(legend10); + chartArea4.AxisX.Title = "Speed (counts/ms)"; + chartArea4.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea4.Name = "ChartArea1"; + this.AccelerationChartY.ChartAreas.Add(chartArea4); + legend4.Name = "Legend1"; + this.AccelerationChartY.Legends.Add(legend4); this.AccelerationChartY.Location = new System.Drawing.Point(1062, 0); this.AccelerationChartY.Name = "AccelerationChartY"; - series19.ChartArea = "ChartArea1"; - series19.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series19.Legend = "Legend1"; - series19.Name = "Accelerated Sensitivity"; - series20.ChartArea = "ChartArea1"; - series20.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series20.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series20.Legend = "Legend1"; - series20.Name = "LastAccelVal"; - this.AccelerationChartY.Series.Add(series19); - this.AccelerationChartY.Series.Add(series20); + series7.ChartArea = "ChartArea1"; + series7.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series7.Legend = "Legend1"; + series7.Name = "Accelerated Sensitivity"; + series8.ChartArea = "ChartArea1"; + series8.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series8.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series8.Legend = "Legend1"; + series8.Name = "LastAccelVal"; + this.AccelerationChartY.Series.Add(series7); + this.AccelerationChartY.Series.Add(series8); this.AccelerationChartY.Size = new System.Drawing.Size(723, 328); this.AccelerationChartY.TabIndex = 31; this.AccelerationChartY.Text = "chart1"; // // VelocityChartY // - chartArea11.AxisX.Title = "Speed (count/ms)"; - chartArea11.AxisY.Title = "Output Speed (counts/ms)"; - chartArea11.Name = "ChartArea1"; - this.VelocityChartY.ChartAreas.Add(chartArea11); - legend11.Name = "Legend1"; - this.VelocityChartY.Legends.Add(legend11); + chartArea5.AxisX.Title = "Speed (count/ms)"; + chartArea5.AxisY.Title = "Output Speed (counts/ms)"; + chartArea5.Name = "ChartArea1"; + this.VelocityChartY.ChartAreas.Add(chartArea5); + legend5.Name = "Legend1"; + this.VelocityChartY.Legends.Add(legend5); this.VelocityChartY.Location = new System.Drawing.Point(1062, 334); this.VelocityChartY.Name = "VelocityChartY"; - series21.ChartArea = "ChartArea1"; - series21.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series21.Legend = "Legend1"; - series21.Name = "Mouse Velocity"; - series22.ChartArea = "ChartArea1"; - series22.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series22.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series22.Legend = "Legend1"; - series22.Name = "LastVelocityVal"; - this.VelocityChartY.Series.Add(series21); - this.VelocityChartY.Series.Add(series22); + series9.ChartArea = "ChartArea1"; + series9.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series9.Legend = "Legend1"; + series9.Name = "Mouse Velocity"; + series10.ChartArea = "ChartArea1"; + series10.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series10.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series10.Legend = "Legend1"; + series10.Name = "LastVelocityVal"; + this.VelocityChartY.Series.Add(series9); + this.VelocityChartY.Series.Add(series10); this.VelocityChartY.Size = new System.Drawing.Size(723, 307); this.VelocityChartY.TabIndex = 32; this.VelocityChartY.Text = "chart1"; // // GainChartY // - chartArea12.AxisX.Title = "Speed (counts/ms)"; - chartArea12.AxisY.Title = "Slope of Velocity Chart"; - chartArea12.Name = "ChartArea1"; - this.GainChartY.ChartAreas.Add(chartArea12); - legend12.Name = "Legend1"; - this.GainChartY.Legends.Add(legend12); + chartArea6.AxisX.Title = "Speed (counts/ms)"; + chartArea6.AxisY.Title = "Slope of Velocity Chart"; + chartArea6.Name = "ChartArea1"; + this.GainChartY.ChartAreas.Add(chartArea6); + legend6.Name = "Legend1"; + this.GainChartY.Legends.Add(legend6); this.GainChartY.Location = new System.Drawing.Point(1062, 647); this.GainChartY.Name = "GainChartY"; - series23.ChartArea = "ChartArea1"; - series23.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series23.Legend = "Legend1"; - series23.Name = "Velocity Gain"; - series24.ChartArea = "ChartArea1"; - series24.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series24.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series24.Legend = "Legend1"; - series24.Name = "LastGainVal"; - this.GainChartY.Series.Add(series23); - this.GainChartY.Series.Add(series24); + series11.ChartArea = "ChartArea1"; + series11.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series11.Legend = "Legend1"; + series11.Name = "Velocity Gain"; + series12.ChartArea = "ChartArea1"; + series12.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series12.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series12.Legend = "Legend1"; + series12.Name = "LastGainVal"; + this.GainChartY.Series.Add(series11); + this.GainChartY.Series.Add(series12); this.GainChartY.Size = new System.Drawing.Size(723, 309); this.GainChartY.TabIndex = 33; this.GainChartY.Text = "chart1"; @@ -654,7 +663,7 @@ namespace grapher // RotationActiveLabel // this.RotationActiveLabel.AutoSize = true; - this.RotationActiveLabel.Location = new System.Drawing.Point(268, 75); + this.RotationActiveLabel.Location = new System.Drawing.Point(273, 75); this.RotationActiveLabel.Name = "RotationActiveLabel"; this.RotationActiveLabel.Size = new System.Drawing.Size(13, 13); this.RotationActiveLabel.TabIndex = 38; @@ -672,7 +681,7 @@ namespace grapher // AccelerationActiveLabel // this.AccelerationActiveLabel.AutoSize = true; - this.AccelerationActiveLabel.Location = new System.Drawing.Point(268, 128); + this.AccelerationActiveLabel.Location = new System.Drawing.Point(259, 128); this.AccelerationActiveLabel.Name = "AccelerationActiveLabel"; this.AccelerationActiveLabel.Size = new System.Drawing.Size(13, 13); this.AccelerationActiveLabel.TabIndex = 40; @@ -717,7 +726,7 @@ namespace grapher // OffsetActiveLabel // this.OffsetActiveLabel.AutoSize = true; - this.OffsetActiveLabel.Location = new System.Drawing.Point(268, 206); + this.OffsetActiveLabel.Location = new System.Drawing.Point(259, 206); this.OffsetActiveLabel.Name = "OffsetActiveLabel"; this.OffsetActiveLabel.Size = new System.Drawing.Size(13, 13); this.OffsetActiveLabel.TabIndex = 45; @@ -726,7 +735,7 @@ namespace grapher // LimitExpActiveLabel // this.LimitExpActiveLabel.AutoSize = true; - this.LimitExpActiveLabel.Location = new System.Drawing.Point(268, 232); + this.LimitExpActiveLabel.Location = new System.Drawing.Point(259, 232); this.LimitExpActiveLabel.Name = "LimitExpActiveLabel"; this.LimitExpActiveLabel.Size = new System.Drawing.Size(13, 13); this.LimitExpActiveLabel.TabIndex = 46; @@ -735,41 +744,99 @@ namespace grapher // MidpointActiveLabel // this.MidpointActiveLabel.AutoSize = true; - this.MidpointActiveLabel.Location = new System.Drawing.Point(268, 255); + this.MidpointActiveLabel.Location = new System.Drawing.Point(258, 258); this.MidpointActiveLabel.Name = "MidpointActiveLabel"; this.MidpointActiveLabel.Size = new System.Drawing.Size(13, 13); this.MidpointActiveLabel.TabIndex = 47; this.MidpointActiveLabel.Text = "0"; // - // toolStripMenuItem1 + // textBox1 // - this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.wholeVectorToolStripMenuItem, - this.byVectorComponentToolStripMenuItem}); - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 22); - this.toolStripMenuItem1.Text = "Application Style"; + this.textBox1.Location = new System.Drawing.Point(144, 125); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(31, 20); + this.textBox1.TabIndex = 48; // - // wholeVectorToolStripMenuItem + // textBox2 // - this.wholeVectorToolStripMenuItem.Checked = true; - this.wholeVectorToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.wholeVectorToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.wholeVectorToolStripMenuItem.Name = "wholeVectorToolStripMenuItem"; - this.wholeVectorToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.wholeVectorToolStripMenuItem.Text = "Whole"; + this.textBox2.Location = new System.Drawing.Point(144, 203); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(31, 20); + this.textBox2.TabIndex = 49; // - // byVectorComponentToolStripMenuItem + // textBox3 // - this.byVectorComponentToolStripMenuItem.Name = "byVectorComponentToolStripMenuItem"; - this.byVectorComponentToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.byVectorComponentToolStripMenuItem.Text = "By Component"; + this.textBox3.Location = new System.Drawing.Point(144, 229); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(31, 20); + this.textBox3.TabIndex = 50; + // + // textBox4 + // + this.textBox4.Location = new System.Drawing.Point(143, 255); + this.textBox4.Name = "textBox4"; + this.textBox4.Size = new System.Drawing.Size(32, 20); + this.textBox4.TabIndex = 51; + // + // accelTypeDropY + // + this.accelTypeDropY.FormattingEnabled = true; + this.accelTypeDropY.Location = new System.Drawing.Point(144, 97); + this.accelTypeDropY.Name = "accelTypeDropY"; + this.accelTypeDropY.Size = new System.Drawing.Size(80, 21); + this.accelTypeDropY.TabIndex = 52; + this.accelTypeDropY.Text = "Accel Type"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(286, 128); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(13, 13); + this.label1.TabIndex = 53; + this.label1.Text = "0"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(286, 206); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(13, 13); + this.label2.TabIndex = 54; + this.label2.Text = "0"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(286, 232); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(13, 13); + this.label3.TabIndex = 55; + this.label3.Text = "0"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(286, 258); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(13, 13); + this.label4.TabIndex = 56; + this.label4.Text = "0"; // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1786, 958); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.accelTypeDropY); + this.Controls.Add(this.textBox4); + this.Controls.Add(this.textBox3); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); this.Controls.Add(this.MidpointActiveLabel); this.Controls.Add(this.LimitExpActiveLabel); this.Controls.Add(this.OffsetActiveLabel); @@ -790,8 +857,6 @@ namespace grapher this.Controls.Add(this.GainChart); this.Controls.Add(this.VelocityChart); this.Controls.Add(this.LockXYLabel); - this.Controls.Add(this.weightXYLock); - this.Controls.Add(this.capXYLock); this.Controls.Add(this.sensXYLock); this.Controls.Add(this.capBoxY); this.Controls.Add(this.sensitivityBoxY); @@ -858,8 +923,6 @@ namespace grapher private System.Windows.Forms.TextBox sensitivityBoxY; private System.Windows.Forms.TextBox capBoxY; private System.Windows.Forms.CheckBox sensXYLock; - private System.Windows.Forms.CheckBox capXYLock; - private System.Windows.Forms.CheckBox weightXYLock; private System.Windows.Forms.Label LockXYLabel; private System.Windows.Forms.DataVisualization.Charting.Chart VelocityChart; private System.Windows.Forms.DataVisualization.Charting.Chart GainChart; @@ -898,6 +961,15 @@ namespace grapher private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem wholeVectorToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem byVectorComponentToolStripMenuItem; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.TextBox textBox4; + private System.Windows.Forms.ComboBox accelTypeDropY; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; } } -- cgit v1.2.3 From 270f0bc4d8deed515a1db1ba3f75abcf5cc42337 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 17:21:41 -0700 Subject: Space boxes for by component mode --- grapher/Form1.Designer.cs | 448 +++++++++++++++++++++++++++------------------- 1 file changed, 267 insertions(+), 181 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index eefab51..9c16885 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -30,30 +30,30 @@ namespace grapher /// 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.Series series2 = 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 series3 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series4 = 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 series5 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series7 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series8 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea5 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend5 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series9 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series10 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea6 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend6 = 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.Series series12 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea31 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend31 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series61 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series62 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea32 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend32 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series63 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series64 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea33 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend33 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series65 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series66 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea34 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend34 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series67 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series68 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea35 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend35 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series69 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series70 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea36 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend36 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series71 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series72 = 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(); @@ -124,6 +124,13 @@ namespace grapher this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.GainChart)).BeginInit(); @@ -135,25 +142,25 @@ namespace grapher // // 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(333, 0); + chartArea31.AxisX.Title = "Speed (counts/ms)"; + chartArea31.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea31.Name = "ChartArea1"; + this.AccelerationChart.ChartAreas.Add(chartArea31); + legend31.Name = "Legend1"; + this.AccelerationChart.Legends.Add(legend31); + this.AccelerationChart.Location = new System.Drawing.Point(432, 0); this.AccelerationChart.Name = "AccelerationChart"; - series1.ChartArea = "ChartArea1"; - series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series1.Legend = "Legend1"; - series1.Name = "Accelerated Sensitivity"; - series2.ChartArea = "ChartArea1"; - series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series2.Legend = "Legend1"; - series2.Name = "LastAccelVal"; - this.AccelerationChart.Series.Add(series1); - this.AccelerationChart.Series.Add(series2); + series61.ChartArea = "ChartArea1"; + series61.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series61.Legend = "Legend1"; + series61.Name = "Accelerated Sensitivity"; + series62.ChartArea = "ChartArea1"; + series62.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series62.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series62.Legend = "Legend1"; + series62.Name = "LastAccelVal"; + this.AccelerationChart.Series.Add(series61); + this.AccelerationChart.Series.Add(series62); this.AccelerationChart.Size = new System.Drawing.Size(723, 328); this.AccelerationChart.TabIndex = 0; this.AccelerationChart.Text = "Sensitivity"; @@ -161,17 +168,17 @@ namespace grapher // accelTypeDrop // this.accelTypeDrop.FormattingEnabled = true; - this.accelTypeDrop.Location = new System.Drawing.Point(24, 98); + this.accelTypeDrop.Location = new System.Drawing.Point(105, 98); this.accelTypeDrop.Name = "accelTypeDrop"; - this.accelTypeDrop.Size = new System.Drawing.Size(113, 21); + this.accelTypeDrop.Size = new System.Drawing.Size(76, 21); this.accelTypeDrop.TabIndex = 2; - this.accelTypeDrop.Text = "Acceleration Type"; + this.accelTypeDrop.Text = "Accel Type"; // // sensitivityBoxX // this.sensitivityBoxX.Location = new System.Drawing.Point(105, 46); this.sensitivityBoxX.Name = "sensitivityBoxX"; - this.sensitivityBoxX.Size = new System.Drawing.Size(32, 20); + this.sensitivityBoxX.Size = new System.Drawing.Size(34, 20); this.sensitivityBoxX.TabIndex = 3; // // sensitivityLabel @@ -187,7 +194,7 @@ namespace grapher // this.rotationBox.Location = new System.Drawing.Point(105, 72); this.rotationBox.Name = "rotationBox"; - this.rotationBox.Size = new System.Drawing.Size(70, 20); + this.rotationBox.Size = new System.Drawing.Size(76, 20); this.rotationBox.TabIndex = 5; // // rotationLabel @@ -203,7 +210,7 @@ namespace grapher // this.accelerationBox.Location = new System.Drawing.Point(105, 125); this.accelerationBox.Name = "accelerationBox"; - this.accelerationBox.Size = new System.Drawing.Size(32, 20); + this.accelerationBox.Size = new System.Drawing.Size(76, 20); this.accelerationBox.TabIndex = 7; // // constantOneLabel @@ -220,7 +227,7 @@ namespace grapher // this.capBoxX.Location = new System.Drawing.Point(105, 151); this.capBoxX.Name = "capBoxX"; - this.capBoxX.Size = new System.Drawing.Size(32, 20); + this.capBoxX.Size = new System.Drawing.Size(76, 20); this.capBoxX.TabIndex = 10; // // capLabel @@ -237,7 +244,7 @@ namespace grapher // this.weightBoxFirst.Location = new System.Drawing.Point(105, 177); this.weightBoxFirst.Name = "weightBoxFirst"; - this.weightBoxFirst.Size = new System.Drawing.Size(32, 20); + this.weightBoxFirst.Size = new System.Drawing.Size(76, 20); this.weightBoxFirst.TabIndex = 12; // // weightLabel @@ -252,16 +259,16 @@ namespace grapher // // weightBoxSecond // - this.weightBoxSecond.Location = new System.Drawing.Point(144, 177); + this.weightBoxSecond.Location = new System.Drawing.Point(267, 177); this.weightBoxSecond.Name = "weightBoxSecond"; - this.weightBoxSecond.Size = new System.Drawing.Size(31, 20); + this.weightBoxSecond.Size = new System.Drawing.Size(76, 20); this.weightBoxSecond.TabIndex = 14; // // limitBox // this.limitBox.Location = new System.Drawing.Point(105, 229); this.limitBox.Name = "limitBox"; - this.limitBox.Size = new System.Drawing.Size(32, 20); + this.limitBox.Size = new System.Drawing.Size(76, 20); this.limitBox.TabIndex = 15; // // constantTwoLabel @@ -278,7 +285,7 @@ namespace grapher // this.midpointBox.Location = new System.Drawing.Point(105, 255); this.midpointBox.Name = "midpointBox"; - this.midpointBox.Size = new System.Drawing.Size(32, 20); + this.midpointBox.Size = new System.Drawing.Size(76, 20); this.midpointBox.TabIndex = 17; // // constantThreeLabel @@ -295,7 +302,7 @@ namespace grapher // this.offsetBox.Location = new System.Drawing.Point(105, 203); this.offsetBox.Name = "offsetBox"; - this.offsetBox.Size = new System.Drawing.Size(32, 20); + this.offsetBox.Size = new System.Drawing.Size(76, 20); this.offsetBox.TabIndex = 19; // // offsetLabel @@ -310,7 +317,7 @@ namespace grapher // // writeButton // - this.writeButton.Location = new System.Drawing.Point(57, 281); + this.writeButton.Location = new System.Drawing.Point(145, 281); this.writeButton.Name = "writeButton"; this.writeButton.Size = new System.Drawing.Size(102, 23); this.writeButton.TabIndex = 21; @@ -320,16 +327,16 @@ namespace grapher // // sensitivityBoxY // - this.sensitivityBoxY.Location = new System.Drawing.Point(143, 46); + this.sensitivityBoxY.Location = new System.Drawing.Point(145, 46); this.sensitivityBoxY.Name = "sensitivityBoxY"; - this.sensitivityBoxY.Size = new System.Drawing.Size(32, 20); + this.sensitivityBoxY.Size = new System.Drawing.Size(34, 20); this.sensitivityBoxY.TabIndex = 22; // // capBoxY // - this.capBoxY.Location = new System.Drawing.Point(144, 151); + this.capBoxY.Location = new System.Drawing.Point(267, 151); this.capBoxY.Name = "capBoxY"; - this.capBoxY.Size = new System.Drawing.Size(31, 20); + this.capBoxY.Size = new System.Drawing.Size(76, 20); this.capBoxY.TabIndex = 23; // // sensXYLock @@ -337,7 +344,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(198, 49); + this.sensXYLock.Location = new System.Drawing.Point(219, 49); this.sensXYLock.Name = "sensXYLock"; this.sensXYLock.Size = new System.Drawing.Size(15, 14); this.sensXYLock.TabIndex = 24; @@ -346,7 +353,7 @@ namespace grapher // LockXYLabel // this.LockXYLabel.AutoSize = true; - this.LockXYLabel.Location = new System.Drawing.Point(174, 30); + this.LockXYLabel.Location = new System.Drawing.Point(195, 30); this.LockXYLabel.Name = "LockXYLabel"; this.LockXYLabel.Size = new System.Drawing.Size(60, 13); this.LockXYLabel.TabIndex = 27; @@ -354,50 +361,50 @@ 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(333, 334); + chartArea32.AxisX.Title = "Speed (count/ms)"; + chartArea32.AxisY.Title = "Output Speed (counts/ms)"; + chartArea32.Name = "ChartArea1"; + this.VelocityChart.ChartAreas.Add(chartArea32); + legend32.Name = "Legend1"; + this.VelocityChart.Legends.Add(legend32); + this.VelocityChart.Location = new System.Drawing.Point(432, 334); this.VelocityChart.Name = "VelocityChart"; - series3.ChartArea = "ChartArea1"; - series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series3.Legend = "Legend1"; - series3.Name = "Mouse Velocity"; - series4.ChartArea = "ChartArea1"; - series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series4.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series4.Legend = "Legend1"; - series4.Name = "LastVelocityVal"; - this.VelocityChart.Series.Add(series3); - this.VelocityChart.Series.Add(series4); + series63.ChartArea = "ChartArea1"; + series63.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series63.Legend = "Legend1"; + series63.Name = "Mouse Velocity"; + series64.ChartArea = "ChartArea1"; + series64.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series64.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series64.Legend = "Legend1"; + series64.Name = "LastVelocityVal"; + this.VelocityChart.Series.Add(series63); + this.VelocityChart.Series.Add(series64); this.VelocityChart.Size = new System.Drawing.Size(723, 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(333, 647); + chartArea33.AxisX.Title = "Speed (counts/ms)"; + chartArea33.AxisY.Title = "Slope of Velocity Chart"; + chartArea33.Name = "ChartArea1"; + this.GainChart.ChartAreas.Add(chartArea33); + legend33.Name = "Legend1"; + this.GainChart.Legends.Add(legend33); + this.GainChart.Location = new System.Drawing.Point(432, 647); this.GainChart.Name = "GainChart"; - series5.ChartArea = "ChartArea1"; - series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series5.Legend = "Legend1"; - series5.Name = "Velocity Gain"; - series6.ChartArea = "ChartArea1"; - series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series6.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series6.Legend = "Legend1"; - series6.Name = "LastGainVal"; - this.GainChart.Series.Add(series5); - this.GainChart.Series.Add(series6); + series65.ChartArea = "ChartArea1"; + series65.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series65.Legend = "Legend1"; + series65.Name = "Velocity Gain"; + series66.ChartArea = "ChartArea1"; + series66.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series66.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series66.Legend = "Legend1"; + series66.Name = "LastGainVal"; + this.GainChart.Series.Add(series65); + this.GainChart.Series.Add(series66); this.GainChart.Size = new System.Drawing.Size(723, 309); this.GainChart.TabIndex = 29; this.GainChart.Text = "chart1"; @@ -411,7 +418,7 @@ namespace grapher this.startupToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(1786, 24); + this.menuStrip1.Size = new System.Drawing.Size(1884, 24); this.menuStrip1.TabIndex = 30; this.menuStrip1.Text = "menuStrip1"; // @@ -551,75 +558,75 @@ namespace grapher // // AccelerationChartY // - chartArea4.AxisX.Title = "Speed (counts/ms)"; - chartArea4.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea4.Name = "ChartArea1"; - this.AccelerationChartY.ChartAreas.Add(chartArea4); - legend4.Name = "Legend1"; - this.AccelerationChartY.Legends.Add(legend4); - this.AccelerationChartY.Location = new System.Drawing.Point(1062, 0); + chartArea34.AxisX.Title = "Speed (counts/ms)"; + chartArea34.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea34.Name = "ChartArea1"; + this.AccelerationChartY.ChartAreas.Add(chartArea34); + legend34.Name = "Legend1"; + this.AccelerationChartY.Legends.Add(legend34); + this.AccelerationChartY.Location = new System.Drawing.Point(1161, 0); this.AccelerationChartY.Name = "AccelerationChartY"; - series7.ChartArea = "ChartArea1"; - series7.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series7.Legend = "Legend1"; - series7.Name = "Accelerated Sensitivity"; - series8.ChartArea = "ChartArea1"; - series8.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series8.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series8.Legend = "Legend1"; - series8.Name = "LastAccelVal"; - this.AccelerationChartY.Series.Add(series7); - this.AccelerationChartY.Series.Add(series8); + series67.ChartArea = "ChartArea1"; + series67.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series67.Legend = "Legend1"; + series67.Name = "Accelerated Sensitivity"; + series68.ChartArea = "ChartArea1"; + series68.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series68.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series68.Legend = "Legend1"; + series68.Name = "LastAccelVal"; + this.AccelerationChartY.Series.Add(series67); + this.AccelerationChartY.Series.Add(series68); this.AccelerationChartY.Size = new System.Drawing.Size(723, 328); this.AccelerationChartY.TabIndex = 31; this.AccelerationChartY.Text = "chart1"; // // VelocityChartY // - chartArea5.AxisX.Title = "Speed (count/ms)"; - chartArea5.AxisY.Title = "Output Speed (counts/ms)"; - chartArea5.Name = "ChartArea1"; - this.VelocityChartY.ChartAreas.Add(chartArea5); - legend5.Name = "Legend1"; - this.VelocityChartY.Legends.Add(legend5); - this.VelocityChartY.Location = new System.Drawing.Point(1062, 334); + chartArea35.AxisX.Title = "Speed (count/ms)"; + chartArea35.AxisY.Title = "Output Speed (counts/ms)"; + chartArea35.Name = "ChartArea1"; + this.VelocityChartY.ChartAreas.Add(chartArea35); + legend35.Name = "Legend1"; + this.VelocityChartY.Legends.Add(legend35); + this.VelocityChartY.Location = new System.Drawing.Point(1161, 334); this.VelocityChartY.Name = "VelocityChartY"; - series9.ChartArea = "ChartArea1"; - series9.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series9.Legend = "Legend1"; - series9.Name = "Mouse Velocity"; - series10.ChartArea = "ChartArea1"; - series10.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series10.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series10.Legend = "Legend1"; - series10.Name = "LastVelocityVal"; - this.VelocityChartY.Series.Add(series9); - this.VelocityChartY.Series.Add(series10); + series69.ChartArea = "ChartArea1"; + series69.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series69.Legend = "Legend1"; + series69.Name = "Mouse Velocity"; + series70.ChartArea = "ChartArea1"; + series70.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series70.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series70.Legend = "Legend1"; + series70.Name = "LastVelocityVal"; + this.VelocityChartY.Series.Add(series69); + this.VelocityChartY.Series.Add(series70); this.VelocityChartY.Size = new System.Drawing.Size(723, 307); this.VelocityChartY.TabIndex = 32; this.VelocityChartY.Text = "chart1"; // // GainChartY // - chartArea6.AxisX.Title = "Speed (counts/ms)"; - chartArea6.AxisY.Title = "Slope of Velocity Chart"; - chartArea6.Name = "ChartArea1"; - this.GainChartY.ChartAreas.Add(chartArea6); - legend6.Name = "Legend1"; - this.GainChartY.Legends.Add(legend6); - this.GainChartY.Location = new System.Drawing.Point(1062, 647); + chartArea36.AxisX.Title = "Speed (counts/ms)"; + chartArea36.AxisY.Title = "Slope of Velocity Chart"; + chartArea36.Name = "ChartArea1"; + this.GainChartY.ChartAreas.Add(chartArea36); + legend36.Name = "Legend1"; + this.GainChartY.Legends.Add(legend36); + this.GainChartY.Location = new System.Drawing.Point(1161, 647); this.GainChartY.Name = "GainChartY"; - series11.ChartArea = "ChartArea1"; - series11.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series11.Legend = "Legend1"; - series11.Name = "Velocity Gain"; - series12.ChartArea = "ChartArea1"; - series12.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series12.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series12.Legend = "Legend1"; - series12.Name = "LastGainVal"; - this.GainChartY.Series.Add(series11); - this.GainChartY.Series.Add(series12); + series71.ChartArea = "ChartArea1"; + series71.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series71.Legend = "Legend1"; + series71.Name = "Velocity Gain"; + series72.ChartArea = "ChartArea1"; + series72.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series72.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series72.Legend = "Legend1"; + series72.Name = "LastGainVal"; + this.GainChartY.Series.Add(series71); + this.GainChartY.Series.Add(series72); this.GainChartY.Size = new System.Drawing.Size(723, 309); this.GainChartY.TabIndex = 33; this.GainChartY.Text = "chart1"; @@ -636,7 +643,7 @@ namespace grapher // ActiveValueTitle // this.ActiveValueTitle.AutoSize = true; - this.ActiveValueTitle.Location = new System.Drawing.Point(248, 30); + this.ActiveValueTitle.Location = new System.Drawing.Point(359, 30); this.ActiveValueTitle.Name = "ActiveValueTitle"; this.ActiveValueTitle.Size = new System.Drawing.Size(67, 13); this.ActiveValueTitle.TabIndex = 35; @@ -645,7 +652,7 @@ namespace grapher // SensitivityActiveXLabel // this.SensitivityActiveXLabel.AutoSize = true; - this.SensitivityActiveXLabel.Location = new System.Drawing.Point(258, 49); + this.SensitivityActiveXLabel.Location = new System.Drawing.Point(359, 53); this.SensitivityActiveXLabel.Name = "SensitivityActiveXLabel"; this.SensitivityActiveXLabel.Size = new System.Drawing.Size(14, 13); this.SensitivityActiveXLabel.TabIndex = 36; @@ -654,7 +661,7 @@ namespace grapher // SensitivityActiveYLabel // this.SensitivityActiveYLabel.AutoSize = true; - this.SensitivityActiveYLabel.Location = new System.Drawing.Point(286, 50); + this.SensitivityActiveYLabel.Location = new System.Drawing.Point(403, 53); this.SensitivityActiveYLabel.Name = "SensitivityActiveYLabel"; this.SensitivityActiveYLabel.Size = new System.Drawing.Size(14, 13); this.SensitivityActiveYLabel.TabIndex = 37; @@ -663,7 +670,7 @@ namespace grapher // RotationActiveLabel // this.RotationActiveLabel.AutoSize = true; - this.RotationActiveLabel.Location = new System.Drawing.Point(273, 75); + this.RotationActiveLabel.Location = new System.Drawing.Point(384, 75); this.RotationActiveLabel.Name = "RotationActiveLabel"; this.RotationActiveLabel.Size = new System.Drawing.Size(13, 13); this.RotationActiveLabel.TabIndex = 38; @@ -672,7 +679,7 @@ namespace grapher // AccelTypeActiveLabel // this.AccelTypeActiveLabel.AutoSize = true; - this.AccelTypeActiveLabel.Location = new System.Drawing.Point(258, 98); + this.AccelTypeActiveLabel.Location = new System.Drawing.Point(376, 101); this.AccelTypeActiveLabel.Name = "AccelTypeActiveLabel"; this.AccelTypeActiveLabel.Size = new System.Drawing.Size(41, 13); this.AccelTypeActiveLabel.TabIndex = 39; @@ -681,7 +688,7 @@ namespace grapher // AccelerationActiveLabel // this.AccelerationActiveLabel.AutoSize = true; - this.AccelerationActiveLabel.Location = new System.Drawing.Point(259, 128); + this.AccelerationActiveLabel.Location = new System.Drawing.Point(360, 128); this.AccelerationActiveLabel.Name = "AccelerationActiveLabel"; this.AccelerationActiveLabel.Size = new System.Drawing.Size(13, 13); this.AccelerationActiveLabel.TabIndex = 40; @@ -690,7 +697,7 @@ namespace grapher // CapActiveXLabel // this.CapActiveXLabel.AutoSize = true; - this.CapActiveXLabel.Location = new System.Drawing.Point(259, 151); + this.CapActiveXLabel.Location = new System.Drawing.Point(359, 155); this.CapActiveXLabel.Name = "CapActiveXLabel"; this.CapActiveXLabel.Size = new System.Drawing.Size(13, 13); this.CapActiveXLabel.TabIndex = 41; @@ -699,7 +706,7 @@ namespace grapher // WeightActiveXLabel // this.WeightActiveXLabel.AutoSize = true; - this.WeightActiveXLabel.Location = new System.Drawing.Point(259, 180); + this.WeightActiveXLabel.Location = new System.Drawing.Point(359, 180); this.WeightActiveXLabel.Name = "WeightActiveXLabel"; this.WeightActiveXLabel.Size = new System.Drawing.Size(13, 13); this.WeightActiveXLabel.TabIndex = 42; @@ -708,7 +715,7 @@ namespace grapher // WeightActiveYLabel // this.WeightActiveYLabel.AutoSize = true; - this.WeightActiveYLabel.Location = new System.Drawing.Point(286, 180); + this.WeightActiveYLabel.Location = new System.Drawing.Point(403, 180); this.WeightActiveYLabel.Name = "WeightActiveYLabel"; this.WeightActiveYLabel.Size = new System.Drawing.Size(13, 13); this.WeightActiveYLabel.TabIndex = 43; @@ -717,7 +724,7 @@ namespace grapher // CapActiveYLabel // this.CapActiveYLabel.AutoSize = true; - this.CapActiveYLabel.Location = new System.Drawing.Point(286, 151); + this.CapActiveYLabel.Location = new System.Drawing.Point(403, 155); this.CapActiveYLabel.Name = "CapActiveYLabel"; this.CapActiveYLabel.Size = new System.Drawing.Size(13, 13); this.CapActiveYLabel.TabIndex = 44; @@ -726,7 +733,7 @@ namespace grapher // OffsetActiveLabel // this.OffsetActiveLabel.AutoSize = true; - this.OffsetActiveLabel.Location = new System.Drawing.Point(259, 206); + this.OffsetActiveLabel.Location = new System.Drawing.Point(359, 206); this.OffsetActiveLabel.Name = "OffsetActiveLabel"; this.OffsetActiveLabel.Size = new System.Drawing.Size(13, 13); this.OffsetActiveLabel.TabIndex = 45; @@ -735,7 +742,7 @@ namespace grapher // LimitExpActiveLabel // this.LimitExpActiveLabel.AutoSize = true; - this.LimitExpActiveLabel.Location = new System.Drawing.Point(259, 232); + this.LimitExpActiveLabel.Location = new System.Drawing.Point(359, 232); this.LimitExpActiveLabel.Name = "LimitExpActiveLabel"; this.LimitExpActiveLabel.Size = new System.Drawing.Size(13, 13); this.LimitExpActiveLabel.TabIndex = 46; @@ -744,7 +751,7 @@ namespace grapher // MidpointActiveLabel // this.MidpointActiveLabel.AutoSize = true; - this.MidpointActiveLabel.Location = new System.Drawing.Point(258, 258); + this.MidpointActiveLabel.Location = new System.Drawing.Point(359, 258); this.MidpointActiveLabel.Name = "MidpointActiveLabel"; this.MidpointActiveLabel.Size = new System.Drawing.Size(13, 13); this.MidpointActiveLabel.TabIndex = 47; @@ -752,45 +759,45 @@ namespace grapher // // textBox1 // - this.textBox1.Location = new System.Drawing.Point(144, 125); + this.textBox1.Location = new System.Drawing.Point(267, 125); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(31, 20); + this.textBox1.Size = new System.Drawing.Size(76, 20); this.textBox1.TabIndex = 48; // // textBox2 // - this.textBox2.Location = new System.Drawing.Point(144, 203); + this.textBox2.Location = new System.Drawing.Point(267, 203); this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(31, 20); + this.textBox2.Size = new System.Drawing.Size(76, 20); this.textBox2.TabIndex = 49; // // textBox3 // - this.textBox3.Location = new System.Drawing.Point(144, 229); + this.textBox3.Location = new System.Drawing.Point(267, 229); this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(31, 20); + this.textBox3.Size = new System.Drawing.Size(76, 20); this.textBox3.TabIndex = 50; // // textBox4 // - this.textBox4.Location = new System.Drawing.Point(143, 255); + this.textBox4.Location = new System.Drawing.Point(267, 255); this.textBox4.Name = "textBox4"; - this.textBox4.Size = new System.Drawing.Size(32, 20); + this.textBox4.Size = new System.Drawing.Size(76, 20); this.textBox4.TabIndex = 51; // // accelTypeDropY // this.accelTypeDropY.FormattingEnabled = true; - this.accelTypeDropY.Location = new System.Drawing.Point(144, 97); + this.accelTypeDropY.Location = new System.Drawing.Point(267, 98); this.accelTypeDropY.Name = "accelTypeDropY"; - this.accelTypeDropY.Size = new System.Drawing.Size(80, 21); + this.accelTypeDropY.Size = new System.Drawing.Size(76, 21); this.accelTypeDropY.TabIndex = 52; this.accelTypeDropY.Text = "Accel Type"; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(286, 128); + this.label1.Location = new System.Drawing.Point(404, 128); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(13, 13); this.label1.TabIndex = 53; @@ -799,7 +806,7 @@ namespace grapher // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(286, 206); + this.label2.Location = new System.Drawing.Point(403, 206); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(13, 13); this.label2.TabIndex = 54; @@ -808,7 +815,7 @@ namespace grapher // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(286, 232); + this.label3.Location = new System.Drawing.Point(403, 232); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(13, 13); this.label3.TabIndex = 55; @@ -817,17 +824,89 @@ namespace grapher // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(286, 258); + this.label4.Location = new System.Drawing.Point(403, 258); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(13, 13); this.label4.TabIndex = 56; this.label4.Text = "0"; // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Checked = true; + this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox1.Location = new System.Drawing.Point(219, 101); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(15, 14); + this.checkBox1.TabIndex = 57; + this.checkBox1.UseVisualStyleBackColor = true; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(195, 128); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(66, 13); + this.label5.TabIndex = 58; + this.label5.Text = "Acceleration"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(208, 155); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(26, 13); + this.label6.TabIndex = 59; + this.label6.Text = "Cap"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(206, 180); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(41, 13); + this.label7.TabIndex = 60; + this.label7.Text = "Weight"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(209, 209); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(35, 13); + this.label8.TabIndex = 61; + this.label8.Text = "Offset"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(196, 232); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(51, 13); + this.label9.TabIndex = 62; + this.label9.Text = "Limit/Exp"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(200, 258); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(47, 13); + this.label10.TabIndex = 63; + this.label10.Text = "Midpoint"; + // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1786, 958); + this.ClientSize = new System.Drawing.Size(1884, 958); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.checkBox1); this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.label2); @@ -970,6 +1049,13 @@ namespace grapher private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; } } -- cgit v1.2.3 From 06cf7fb7b5861aba28231f5bd7b6514a209dafa0 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 17:43:20 -0700 Subject: Add X Y labels for by component --- grapher/Form1.Designer.cs | 360 ++++++++++++++++++++++++---------------------- 1 file changed, 192 insertions(+), 168 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 9c16885..18a4c32 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -30,30 +30,30 @@ namespace grapher /// private void InitializeComponent() { - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea31 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend31 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series61 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series62 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea32 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend32 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series63 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series64 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea33 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend33 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series65 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series66 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea34 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend34 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series67 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series68 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea35 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend35 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series69 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series70 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea36 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend36 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series71 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series72 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea13 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend13 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series25 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series26 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea14 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend14 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series27 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series28 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea15 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend15 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series29 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series30 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea16 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend16 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series31 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series32 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea17 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend17 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series33 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series34 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea18 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend18 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series35 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series36 = 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(); @@ -131,6 +131,8 @@ namespace grapher this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.GainChart)).BeginInit(); @@ -142,25 +144,25 @@ namespace grapher // // AccelerationChart // - chartArea31.AxisX.Title = "Speed (counts/ms)"; - chartArea31.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea31.Name = "ChartArea1"; - this.AccelerationChart.ChartAreas.Add(chartArea31); - legend31.Name = "Legend1"; - this.AccelerationChart.Legends.Add(legend31); + chartArea13.AxisX.Title = "Speed (counts/ms)"; + chartArea13.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea13.Name = "ChartArea1"; + this.AccelerationChart.ChartAreas.Add(chartArea13); + legend13.Name = "Legend1"; + this.AccelerationChart.Legends.Add(legend13); this.AccelerationChart.Location = new System.Drawing.Point(432, 0); this.AccelerationChart.Name = "AccelerationChart"; - series61.ChartArea = "ChartArea1"; - series61.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series61.Legend = "Legend1"; - series61.Name = "Accelerated Sensitivity"; - series62.ChartArea = "ChartArea1"; - series62.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series62.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series62.Legend = "Legend1"; - series62.Name = "LastAccelVal"; - this.AccelerationChart.Series.Add(series61); - this.AccelerationChart.Series.Add(series62); + series25.ChartArea = "ChartArea1"; + series25.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series25.Legend = "Legend1"; + series25.Name = "Accelerated Sensitivity"; + series26.ChartArea = "ChartArea1"; + series26.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series26.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series26.Legend = "Legend1"; + series26.Name = "LastAccelVal"; + this.AccelerationChart.Series.Add(series25); + this.AccelerationChart.Series.Add(series26); this.AccelerationChart.Size = new System.Drawing.Size(723, 328); this.AccelerationChart.TabIndex = 0; this.AccelerationChart.Text = "Sensitivity"; @@ -168,7 +170,7 @@ namespace grapher // accelTypeDrop // this.accelTypeDrop.FormattingEnabled = true; - this.accelTypeDrop.Location = new System.Drawing.Point(105, 98); + this.accelTypeDrop.Location = new System.Drawing.Point(105, 110); this.accelTypeDrop.Name = "accelTypeDrop"; this.accelTypeDrop.Size = new System.Drawing.Size(76, 21); this.accelTypeDrop.TabIndex = 2; @@ -208,7 +210,7 @@ namespace grapher // // accelerationBox // - this.accelerationBox.Location = new System.Drawing.Point(105, 125); + this.accelerationBox.Location = new System.Drawing.Point(105, 137); this.accelerationBox.Name = "accelerationBox"; this.accelerationBox.Size = new System.Drawing.Size(76, 20); this.accelerationBox.TabIndex = 7; @@ -216,7 +218,7 @@ namespace grapher // constantOneLabel // this.constantOneLabel.AutoSize = true; - this.constantOneLabel.Location = new System.Drawing.Point(24, 128); + this.constantOneLabel.Location = new System.Drawing.Point(24, 140); this.constantOneLabel.Name = "constantOneLabel"; this.constantOneLabel.Size = new System.Drawing.Size(66, 13); this.constantOneLabel.TabIndex = 9; @@ -225,7 +227,7 @@ namespace grapher // // capBoxX // - this.capBoxX.Location = new System.Drawing.Point(105, 151); + this.capBoxX.Location = new System.Drawing.Point(105, 163); this.capBoxX.Name = "capBoxX"; this.capBoxX.Size = new System.Drawing.Size(76, 20); this.capBoxX.TabIndex = 10; @@ -233,7 +235,7 @@ namespace grapher // capLabel // this.capLabel.AutoSize = true; - this.capLabel.Location = new System.Drawing.Point(34, 155); + this.capLabel.Location = new System.Drawing.Point(43, 166); this.capLabel.Name = "capLabel"; this.capLabel.Size = new System.Drawing.Size(26, 13); this.capLabel.TabIndex = 11; @@ -242,7 +244,7 @@ namespace grapher // // weightBoxFirst // - this.weightBoxFirst.Location = new System.Drawing.Point(105, 177); + this.weightBoxFirst.Location = new System.Drawing.Point(105, 189); this.weightBoxFirst.Name = "weightBoxFirst"; this.weightBoxFirst.Size = new System.Drawing.Size(76, 20); this.weightBoxFirst.TabIndex = 12; @@ -250,7 +252,7 @@ namespace grapher // weightLabel // this.weightLabel.AutoSize = true; - this.weightLabel.Location = new System.Drawing.Point(34, 180); + this.weightLabel.Location = new System.Drawing.Point(40, 192); this.weightLabel.Name = "weightLabel"; this.weightLabel.Size = new System.Drawing.Size(41, 13); this.weightLabel.TabIndex = 13; @@ -259,14 +261,14 @@ namespace grapher // // weightBoxSecond // - this.weightBoxSecond.Location = new System.Drawing.Point(267, 177); + this.weightBoxSecond.Location = new System.Drawing.Point(267, 189); this.weightBoxSecond.Name = "weightBoxSecond"; this.weightBoxSecond.Size = new System.Drawing.Size(76, 20); this.weightBoxSecond.TabIndex = 14; // // limitBox // - this.limitBox.Location = new System.Drawing.Point(105, 229); + this.limitBox.Location = new System.Drawing.Point(105, 241); this.limitBox.Name = "limitBox"; this.limitBox.Size = new System.Drawing.Size(76, 20); this.limitBox.TabIndex = 15; @@ -274,7 +276,7 @@ namespace grapher // constantTwoLabel // this.constantTwoLabel.AutoSize = true; - this.constantTwoLabel.Location = new System.Drawing.Point(24, 232); + this.constantTwoLabel.Location = new System.Drawing.Point(24, 244); this.constantTwoLabel.Name = "constantTwoLabel"; this.constantTwoLabel.Size = new System.Drawing.Size(78, 13); this.constantTwoLabel.TabIndex = 16; @@ -283,7 +285,7 @@ namespace grapher // // midpointBox // - this.midpointBox.Location = new System.Drawing.Point(105, 255); + this.midpointBox.Location = new System.Drawing.Point(105, 267); this.midpointBox.Name = "midpointBox"; this.midpointBox.Size = new System.Drawing.Size(76, 20); this.midpointBox.TabIndex = 17; @@ -291,7 +293,7 @@ namespace grapher // constantThreeLabel // this.constantThreeLabel.AutoSize = true; - this.constantThreeLabel.Location = new System.Drawing.Point(31, 258); + this.constantThreeLabel.Location = new System.Drawing.Point(34, 270); this.constantThreeLabel.Name = "constantThreeLabel"; this.constantThreeLabel.Size = new System.Drawing.Size(47, 13); this.constantThreeLabel.TabIndex = 18; @@ -300,7 +302,7 @@ namespace grapher // // offsetBox // - this.offsetBox.Location = new System.Drawing.Point(105, 203); + this.offsetBox.Location = new System.Drawing.Point(105, 215); this.offsetBox.Name = "offsetBox"; this.offsetBox.Size = new System.Drawing.Size(76, 20); this.offsetBox.TabIndex = 19; @@ -308,7 +310,7 @@ namespace grapher // offsetLabel // this.offsetLabel.AutoSize = true; - this.offsetLabel.Location = new System.Drawing.Point(34, 206); + this.offsetLabel.Location = new System.Drawing.Point(43, 218); this.offsetLabel.Name = "offsetLabel"; this.offsetLabel.Size = new System.Drawing.Size(35, 13); this.offsetLabel.TabIndex = 20; @@ -317,7 +319,7 @@ namespace grapher // // writeButton // - this.writeButton.Location = new System.Drawing.Point(145, 281); + this.writeButton.Location = new System.Drawing.Point(153, 293); this.writeButton.Name = "writeButton"; this.writeButton.Size = new System.Drawing.Size(102, 23); this.writeButton.TabIndex = 21; @@ -334,7 +336,7 @@ namespace grapher // // capBoxY // - this.capBoxY.Location = new System.Drawing.Point(267, 151); + this.capBoxY.Location = new System.Drawing.Point(267, 163); this.capBoxY.Name = "capBoxY"; this.capBoxY.Size = new System.Drawing.Size(76, 20); this.capBoxY.TabIndex = 23; @@ -361,50 +363,50 @@ namespace grapher // // VelocityChart // - chartArea32.AxisX.Title = "Speed (count/ms)"; - chartArea32.AxisY.Title = "Output Speed (counts/ms)"; - chartArea32.Name = "ChartArea1"; - this.VelocityChart.ChartAreas.Add(chartArea32); - legend32.Name = "Legend1"; - this.VelocityChart.Legends.Add(legend32); + chartArea14.AxisX.Title = "Speed (count/ms)"; + chartArea14.AxisY.Title = "Output Speed (counts/ms)"; + chartArea14.Name = "ChartArea1"; + this.VelocityChart.ChartAreas.Add(chartArea14); + legend14.Name = "Legend1"; + this.VelocityChart.Legends.Add(legend14); this.VelocityChart.Location = new System.Drawing.Point(432, 334); this.VelocityChart.Name = "VelocityChart"; - series63.ChartArea = "ChartArea1"; - series63.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series63.Legend = "Legend1"; - series63.Name = "Mouse Velocity"; - series64.ChartArea = "ChartArea1"; - series64.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series64.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series64.Legend = "Legend1"; - series64.Name = "LastVelocityVal"; - this.VelocityChart.Series.Add(series63); - this.VelocityChart.Series.Add(series64); + series27.ChartArea = "ChartArea1"; + series27.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series27.Legend = "Legend1"; + series27.Name = "Mouse Velocity"; + series28.ChartArea = "ChartArea1"; + series28.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series28.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series28.Legend = "Legend1"; + series28.Name = "LastVelocityVal"; + this.VelocityChart.Series.Add(series27); + this.VelocityChart.Series.Add(series28); this.VelocityChart.Size = new System.Drawing.Size(723, 307); this.VelocityChart.TabIndex = 28; this.VelocityChart.Text = "chart1"; // // GainChart // - chartArea33.AxisX.Title = "Speed (counts/ms)"; - chartArea33.AxisY.Title = "Slope of Velocity Chart"; - chartArea33.Name = "ChartArea1"; - this.GainChart.ChartAreas.Add(chartArea33); - legend33.Name = "Legend1"; - this.GainChart.Legends.Add(legend33); + chartArea15.AxisX.Title = "Speed (counts/ms)"; + chartArea15.AxisY.Title = "Slope of Velocity Chart"; + chartArea15.Name = "ChartArea1"; + this.GainChart.ChartAreas.Add(chartArea15); + legend15.Name = "Legend1"; + this.GainChart.Legends.Add(legend15); this.GainChart.Location = new System.Drawing.Point(432, 647); this.GainChart.Name = "GainChart"; - series65.ChartArea = "ChartArea1"; - series65.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series65.Legend = "Legend1"; - series65.Name = "Velocity Gain"; - series66.ChartArea = "ChartArea1"; - series66.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series66.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series66.Legend = "Legend1"; - series66.Name = "LastGainVal"; - this.GainChart.Series.Add(series65); - this.GainChart.Series.Add(series66); + series29.ChartArea = "ChartArea1"; + series29.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series29.Legend = "Legend1"; + series29.Name = "Velocity Gain"; + series30.ChartArea = "ChartArea1"; + series30.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series30.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series30.Legend = "Legend1"; + series30.Name = "LastGainVal"; + this.GainChart.Series.Add(series29); + this.GainChart.Series.Add(series30); this.GainChart.Size = new System.Drawing.Size(723, 309); this.GainChart.TabIndex = 29; this.GainChart.Text = "chart1"; @@ -558,75 +560,75 @@ namespace grapher // // AccelerationChartY // - chartArea34.AxisX.Title = "Speed (counts/ms)"; - chartArea34.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea34.Name = "ChartArea1"; - this.AccelerationChartY.ChartAreas.Add(chartArea34); - legend34.Name = "Legend1"; - this.AccelerationChartY.Legends.Add(legend34); + chartArea16.AxisX.Title = "Speed (counts/ms)"; + chartArea16.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea16.Name = "ChartArea1"; + this.AccelerationChartY.ChartAreas.Add(chartArea16); + legend16.Name = "Legend1"; + this.AccelerationChartY.Legends.Add(legend16); this.AccelerationChartY.Location = new System.Drawing.Point(1161, 0); this.AccelerationChartY.Name = "AccelerationChartY"; - series67.ChartArea = "ChartArea1"; - series67.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series67.Legend = "Legend1"; - series67.Name = "Accelerated Sensitivity"; - series68.ChartArea = "ChartArea1"; - series68.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series68.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series68.Legend = "Legend1"; - series68.Name = "LastAccelVal"; - this.AccelerationChartY.Series.Add(series67); - this.AccelerationChartY.Series.Add(series68); + series31.ChartArea = "ChartArea1"; + series31.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series31.Legend = "Legend1"; + series31.Name = "Accelerated Sensitivity"; + series32.ChartArea = "ChartArea1"; + series32.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series32.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series32.Legend = "Legend1"; + series32.Name = "LastAccelVal"; + this.AccelerationChartY.Series.Add(series31); + this.AccelerationChartY.Series.Add(series32); this.AccelerationChartY.Size = new System.Drawing.Size(723, 328); this.AccelerationChartY.TabIndex = 31; this.AccelerationChartY.Text = "chart1"; // // VelocityChartY // - chartArea35.AxisX.Title = "Speed (count/ms)"; - chartArea35.AxisY.Title = "Output Speed (counts/ms)"; - chartArea35.Name = "ChartArea1"; - this.VelocityChartY.ChartAreas.Add(chartArea35); - legend35.Name = "Legend1"; - this.VelocityChartY.Legends.Add(legend35); + chartArea17.AxisX.Title = "Speed (count/ms)"; + chartArea17.AxisY.Title = "Output Speed (counts/ms)"; + chartArea17.Name = "ChartArea1"; + this.VelocityChartY.ChartAreas.Add(chartArea17); + legend17.Name = "Legend1"; + this.VelocityChartY.Legends.Add(legend17); this.VelocityChartY.Location = new System.Drawing.Point(1161, 334); this.VelocityChartY.Name = "VelocityChartY"; - series69.ChartArea = "ChartArea1"; - series69.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series69.Legend = "Legend1"; - series69.Name = "Mouse Velocity"; - series70.ChartArea = "ChartArea1"; - series70.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series70.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series70.Legend = "Legend1"; - series70.Name = "LastVelocityVal"; - this.VelocityChartY.Series.Add(series69); - this.VelocityChartY.Series.Add(series70); + series33.ChartArea = "ChartArea1"; + series33.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series33.Legend = "Legend1"; + series33.Name = "Mouse Velocity"; + series34.ChartArea = "ChartArea1"; + series34.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series34.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series34.Legend = "Legend1"; + series34.Name = "LastVelocityVal"; + this.VelocityChartY.Series.Add(series33); + this.VelocityChartY.Series.Add(series34); this.VelocityChartY.Size = new System.Drawing.Size(723, 307); this.VelocityChartY.TabIndex = 32; this.VelocityChartY.Text = "chart1"; // // GainChartY // - chartArea36.AxisX.Title = "Speed (counts/ms)"; - chartArea36.AxisY.Title = "Slope of Velocity Chart"; - chartArea36.Name = "ChartArea1"; - this.GainChartY.ChartAreas.Add(chartArea36); - legend36.Name = "Legend1"; - this.GainChartY.Legends.Add(legend36); + chartArea18.AxisX.Title = "Speed (counts/ms)"; + chartArea18.AxisY.Title = "Slope of Velocity Chart"; + chartArea18.Name = "ChartArea1"; + this.GainChartY.ChartAreas.Add(chartArea18); + legend18.Name = "Legend1"; + this.GainChartY.Legends.Add(legend18); this.GainChartY.Location = new System.Drawing.Point(1161, 647); this.GainChartY.Name = "GainChartY"; - series71.ChartArea = "ChartArea1"; - series71.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series71.Legend = "Legend1"; - series71.Name = "Velocity Gain"; - series72.ChartArea = "ChartArea1"; - series72.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series72.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series72.Legend = "Legend1"; - series72.Name = "LastGainVal"; - this.GainChartY.Series.Add(series71); - this.GainChartY.Series.Add(series72); + series35.ChartArea = "ChartArea1"; + series35.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series35.Legend = "Legend1"; + series35.Name = "Velocity Gain"; + series36.ChartArea = "ChartArea1"; + series36.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series36.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series36.Legend = "Legend1"; + series36.Name = "LastGainVal"; + this.GainChartY.Series.Add(series35); + this.GainChartY.Series.Add(series36); this.GainChartY.Size = new System.Drawing.Size(723, 309); this.GainChartY.TabIndex = 33; this.GainChartY.Text = "chart1"; @@ -679,7 +681,7 @@ namespace grapher // AccelTypeActiveLabel // this.AccelTypeActiveLabel.AutoSize = true; - this.AccelTypeActiveLabel.Location = new System.Drawing.Point(376, 101); + this.AccelTypeActiveLabel.Location = new System.Drawing.Point(360, 113); this.AccelTypeActiveLabel.Name = "AccelTypeActiveLabel"; this.AccelTypeActiveLabel.Size = new System.Drawing.Size(41, 13); this.AccelTypeActiveLabel.TabIndex = 39; @@ -688,7 +690,7 @@ namespace grapher // AccelerationActiveLabel // this.AccelerationActiveLabel.AutoSize = true; - this.AccelerationActiveLabel.Location = new System.Drawing.Point(360, 128); + this.AccelerationActiveLabel.Location = new System.Drawing.Point(359, 140); this.AccelerationActiveLabel.Name = "AccelerationActiveLabel"; this.AccelerationActiveLabel.Size = new System.Drawing.Size(13, 13); this.AccelerationActiveLabel.TabIndex = 40; @@ -697,7 +699,7 @@ namespace grapher // CapActiveXLabel // this.CapActiveXLabel.AutoSize = true; - this.CapActiveXLabel.Location = new System.Drawing.Point(359, 155); + this.CapActiveXLabel.Location = new System.Drawing.Point(359, 166); this.CapActiveXLabel.Name = "CapActiveXLabel"; this.CapActiveXLabel.Size = new System.Drawing.Size(13, 13); this.CapActiveXLabel.TabIndex = 41; @@ -706,7 +708,7 @@ namespace grapher // WeightActiveXLabel // this.WeightActiveXLabel.AutoSize = true; - this.WeightActiveXLabel.Location = new System.Drawing.Point(359, 180); + this.WeightActiveXLabel.Location = new System.Drawing.Point(359, 192); this.WeightActiveXLabel.Name = "WeightActiveXLabel"; this.WeightActiveXLabel.Size = new System.Drawing.Size(13, 13); this.WeightActiveXLabel.TabIndex = 42; @@ -715,7 +717,7 @@ namespace grapher // WeightActiveYLabel // this.WeightActiveYLabel.AutoSize = true; - this.WeightActiveYLabel.Location = new System.Drawing.Point(403, 180); + this.WeightActiveYLabel.Location = new System.Drawing.Point(403, 192); this.WeightActiveYLabel.Name = "WeightActiveYLabel"; this.WeightActiveYLabel.Size = new System.Drawing.Size(13, 13); this.WeightActiveYLabel.TabIndex = 43; @@ -724,7 +726,7 @@ namespace grapher // CapActiveYLabel // this.CapActiveYLabel.AutoSize = true; - this.CapActiveYLabel.Location = new System.Drawing.Point(403, 155); + this.CapActiveYLabel.Location = new System.Drawing.Point(403, 166); this.CapActiveYLabel.Name = "CapActiveYLabel"; this.CapActiveYLabel.Size = new System.Drawing.Size(13, 13); this.CapActiveYLabel.TabIndex = 44; @@ -733,7 +735,7 @@ namespace grapher // OffsetActiveLabel // this.OffsetActiveLabel.AutoSize = true; - this.OffsetActiveLabel.Location = new System.Drawing.Point(359, 206); + this.OffsetActiveLabel.Location = new System.Drawing.Point(359, 218); this.OffsetActiveLabel.Name = "OffsetActiveLabel"; this.OffsetActiveLabel.Size = new System.Drawing.Size(13, 13); this.OffsetActiveLabel.TabIndex = 45; @@ -742,7 +744,7 @@ namespace grapher // LimitExpActiveLabel // this.LimitExpActiveLabel.AutoSize = true; - this.LimitExpActiveLabel.Location = new System.Drawing.Point(359, 232); + this.LimitExpActiveLabel.Location = new System.Drawing.Point(359, 244); this.LimitExpActiveLabel.Name = "LimitExpActiveLabel"; this.LimitExpActiveLabel.Size = new System.Drawing.Size(13, 13); this.LimitExpActiveLabel.TabIndex = 46; @@ -751,7 +753,7 @@ namespace grapher // MidpointActiveLabel // this.MidpointActiveLabel.AutoSize = true; - this.MidpointActiveLabel.Location = new System.Drawing.Point(359, 258); + this.MidpointActiveLabel.Location = new System.Drawing.Point(360, 270); this.MidpointActiveLabel.Name = "MidpointActiveLabel"; this.MidpointActiveLabel.Size = new System.Drawing.Size(13, 13); this.MidpointActiveLabel.TabIndex = 47; @@ -759,28 +761,28 @@ namespace grapher // // textBox1 // - this.textBox1.Location = new System.Drawing.Point(267, 125); + this.textBox1.Location = new System.Drawing.Point(267, 137); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(76, 20); this.textBox1.TabIndex = 48; // // textBox2 // - this.textBox2.Location = new System.Drawing.Point(267, 203); + this.textBox2.Location = new System.Drawing.Point(267, 215); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(76, 20); this.textBox2.TabIndex = 49; // // textBox3 // - this.textBox3.Location = new System.Drawing.Point(267, 229); + this.textBox3.Location = new System.Drawing.Point(267, 241); this.textBox3.Name = "textBox3"; this.textBox3.Size = new System.Drawing.Size(76, 20); this.textBox3.TabIndex = 50; // // textBox4 // - this.textBox4.Location = new System.Drawing.Point(267, 255); + this.textBox4.Location = new System.Drawing.Point(267, 267); this.textBox4.Name = "textBox4"; this.textBox4.Size = new System.Drawing.Size(76, 20); this.textBox4.TabIndex = 51; @@ -788,7 +790,7 @@ namespace grapher // accelTypeDropY // this.accelTypeDropY.FormattingEnabled = true; - this.accelTypeDropY.Location = new System.Drawing.Point(267, 98); + this.accelTypeDropY.Location = new System.Drawing.Point(267, 110); this.accelTypeDropY.Name = "accelTypeDropY"; this.accelTypeDropY.Size = new System.Drawing.Size(76, 21); this.accelTypeDropY.TabIndex = 52; @@ -797,7 +799,7 @@ namespace grapher // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(404, 128); + this.label1.Location = new System.Drawing.Point(403, 140); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(13, 13); this.label1.TabIndex = 53; @@ -806,7 +808,7 @@ namespace grapher // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(403, 206); + this.label2.Location = new System.Drawing.Point(403, 218); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(13, 13); this.label2.TabIndex = 54; @@ -815,7 +817,7 @@ namespace grapher // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(403, 232); + this.label3.Location = new System.Drawing.Point(403, 244); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(13, 13); this.label3.TabIndex = 55; @@ -824,7 +826,7 @@ namespace grapher // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(403, 258); + this.label4.Location = new System.Drawing.Point(403, 270); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(13, 13); this.label4.TabIndex = 56; @@ -835,7 +837,7 @@ namespace grapher this.checkBox1.AutoSize = true; this.checkBox1.Checked = true; this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox1.Location = new System.Drawing.Point(219, 101); + this.checkBox1.Location = new System.Drawing.Point(219, 113); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(15, 14); this.checkBox1.TabIndex = 57; @@ -844,7 +846,7 @@ namespace grapher // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(195, 128); + this.label5.Location = new System.Drawing.Point(195, 140); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(66, 13); this.label5.TabIndex = 58; @@ -853,7 +855,7 @@ namespace grapher // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(208, 155); + this.label6.Location = new System.Drawing.Point(208, 166); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(26, 13); this.label6.TabIndex = 59; @@ -862,7 +864,7 @@ namespace grapher // label7 // this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(206, 180); + this.label7.Location = new System.Drawing.Point(202, 192); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(41, 13); this.label7.TabIndex = 60; @@ -871,7 +873,7 @@ namespace grapher // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(209, 209); + this.label8.Location = new System.Drawing.Point(208, 218); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(35, 13); this.label8.TabIndex = 61; @@ -880,7 +882,7 @@ namespace grapher // label9 // this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(196, 232); + this.label9.Location = new System.Drawing.Point(196, 244); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(51, 13); this.label9.TabIndex = 62; @@ -889,17 +891,37 @@ namespace grapher // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(200, 258); + this.label10.Location = new System.Drawing.Point(200, 270); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(47, 13); this.label10.TabIndex = 63; this.label10.Text = "Midpoint"; // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(142, 94); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(14, 13); + this.label11.TabIndex = 64; + this.label11.Text = "X"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(300, 94); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(14, 13); + this.label12.TabIndex = 65; + this.label12.Text = "Y"; + // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1884, 958); + this.ClientSize = new System.Drawing.Size(1884, 956); + this.Controls.Add(this.label12); + this.Controls.Add(this.label11); this.Controls.Add(this.label10); this.Controls.Add(this.label9); this.Controls.Add(this.label8); @@ -1056,6 +1078,8 @@ namespace grapher private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; } } -- cgit v1.2.3 From 95cc3ed0a0bf66f5535b873f245bc1c35a145478 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 21:45:42 -0700 Subject: intermittent commit - large commit halfway done --- grapher/Constants/Constants.cs | 14 +- grapher/Form1.Designer.cs | 294 ++++++++++++++--------------- grapher/Form1.cs | 2 - grapher/Layouts/LayoutBase.cs | 15 +- grapher/Models/AccelGUI.cs | 69 ++----- grapher/Models/AccelGUIFactory.cs | 208 +++++++++++++------- grapher/Models/Fields/Field.cs | 48 +++++ grapher/Models/Options/AccelOptionSet.cs | 169 +++++++++++++++++ grapher/Models/Options/AccelOptions.cs | 104 ---------- grapher/Models/Options/AccelTypeOptions.cs | 173 +++++++++++++++++ grapher/Models/Options/CapOptions.cs | 58 +++--- grapher/Models/Options/Option.cs | 48 ++++- grapher/grapher.csproj | 3 +- 13 files changed, 783 insertions(+), 422 deletions(-) create mode 100644 grapher/Models/Options/AccelOptionSet.cs delete mode 100644 grapher/Models/Options/AccelOptions.cs create mode 100644 grapher/Models/Options/AccelTypeOptions.cs (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 61fa663..833512b 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -54,7 +54,7 @@ namespace grapher public const int PossibleOptionsCount = 4; /// Possible x/y options to display in a layout. - public const int PossibleOptionsXYCount = 2; + public const int PossibleOptionsXYCount = 0; /// Horizontal separation between charts, in pixels. public const int ChartSeparationHorizontal = 10; @@ -62,8 +62,20 @@ namespace grapher /// Default horizontal separation between x and y fields, in pixels. public const int DefaultFieldSeparation = 4; + /// Default horizontal separation between an option's label and box, in pixels. + public const int OptionLabelBoxSeperation = 10; + + /// Default horizontal separation between an option's label and box, in pixels. + public const int OptionVerticalSeperation = 4; + /// Format string for shortened x and y fields. public const string ShortenedFieldFormatString = "0.###"; + + /// Format string for shortened x and y dropdowns. + public const string AccelDropDownDefaultFullText = "Acceleration Type"; + + /// Format string for default dropdowns. + public const string AccelDropDownDefaultShortText = "Accel Type"; #endregion Constants #region ReadOnly diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 18a4c32..15f2d04 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -30,30 +30,30 @@ namespace grapher /// private void InitializeComponent() { - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea13 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend13 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series25 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series26 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea14 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend14 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series27 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series28 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea15 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend15 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series29 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series30 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea16 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend16 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series31 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series32 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea17 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend17 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series33 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series34 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea18 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend18 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series35 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series36 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea7 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend7 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series13 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series14 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea8 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend8 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series15 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series16 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea9 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend9 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series17 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series18 = 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 series19 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series20 = 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 series21 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series22 = 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 series23 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series24 = 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(); @@ -131,8 +131,8 @@ namespace grapher this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); + this.OptionSetXTitle = new System.Windows.Forms.Label(); + this.OptionSetYTitle = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.GainChart)).BeginInit(); @@ -144,25 +144,25 @@ namespace grapher // // AccelerationChart // - chartArea13.AxisX.Title = "Speed (counts/ms)"; - chartArea13.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea13.Name = "ChartArea1"; - this.AccelerationChart.ChartAreas.Add(chartArea13); - legend13.Name = "Legend1"; - this.AccelerationChart.Legends.Add(legend13); + chartArea7.AxisX.Title = "Speed (counts/ms)"; + chartArea7.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea7.Name = "ChartArea1"; + this.AccelerationChart.ChartAreas.Add(chartArea7); + legend7.Name = "Legend1"; + this.AccelerationChart.Legends.Add(legend7); this.AccelerationChart.Location = new System.Drawing.Point(432, 0); this.AccelerationChart.Name = "AccelerationChart"; - series25.ChartArea = "ChartArea1"; - series25.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series25.Legend = "Legend1"; - series25.Name = "Accelerated Sensitivity"; - series26.ChartArea = "ChartArea1"; - series26.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series26.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series26.Legend = "Legend1"; - series26.Name = "LastAccelVal"; - this.AccelerationChart.Series.Add(series25); - this.AccelerationChart.Series.Add(series26); + series13.ChartArea = "ChartArea1"; + series13.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series13.Legend = "Legend1"; + series13.Name = "Accelerated Sensitivity"; + series14.ChartArea = "ChartArea1"; + series14.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series14.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series14.Legend = "Legend1"; + series14.Name = "LastAccelVal"; + this.AccelerationChart.Series.Add(series13); + this.AccelerationChart.Series.Add(series14); this.AccelerationChart.Size = new System.Drawing.Size(723, 328); this.AccelerationChart.TabIndex = 0; this.AccelerationChart.Text = "Sensitivity"; @@ -329,7 +329,7 @@ namespace grapher // // sensitivityBoxY // - this.sensitivityBoxY.Location = new System.Drawing.Point(145, 46); + this.sensitivityBoxY.Location = new System.Drawing.Point(147, 46); this.sensitivityBoxY.Name = "sensitivityBoxY"; this.sensitivityBoxY.Size = new System.Drawing.Size(34, 20); this.sensitivityBoxY.TabIndex = 22; @@ -363,50 +363,50 @@ namespace grapher // // VelocityChart // - chartArea14.AxisX.Title = "Speed (count/ms)"; - chartArea14.AxisY.Title = "Output Speed (counts/ms)"; - chartArea14.Name = "ChartArea1"; - this.VelocityChart.ChartAreas.Add(chartArea14); - legend14.Name = "Legend1"; - this.VelocityChart.Legends.Add(legend14); + chartArea8.AxisX.Title = "Speed (count/ms)"; + chartArea8.AxisY.Title = "Output Speed (counts/ms)"; + chartArea8.Name = "ChartArea1"; + this.VelocityChart.ChartAreas.Add(chartArea8); + legend8.Name = "Legend1"; + this.VelocityChart.Legends.Add(legend8); this.VelocityChart.Location = new System.Drawing.Point(432, 334); this.VelocityChart.Name = "VelocityChart"; - series27.ChartArea = "ChartArea1"; - series27.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series27.Legend = "Legend1"; - series27.Name = "Mouse Velocity"; - series28.ChartArea = "ChartArea1"; - series28.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series28.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series28.Legend = "Legend1"; - series28.Name = "LastVelocityVal"; - this.VelocityChart.Series.Add(series27); - this.VelocityChart.Series.Add(series28); + series15.ChartArea = "ChartArea1"; + series15.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series15.Legend = "Legend1"; + series15.Name = "Mouse Velocity"; + series16.ChartArea = "ChartArea1"; + series16.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series16.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series16.Legend = "Legend1"; + series16.Name = "LastVelocityVal"; + this.VelocityChart.Series.Add(series15); + this.VelocityChart.Series.Add(series16); this.VelocityChart.Size = new System.Drawing.Size(723, 307); this.VelocityChart.TabIndex = 28; this.VelocityChart.Text = "chart1"; // // GainChart // - chartArea15.AxisX.Title = "Speed (counts/ms)"; - chartArea15.AxisY.Title = "Slope of Velocity Chart"; - chartArea15.Name = "ChartArea1"; - this.GainChart.ChartAreas.Add(chartArea15); - legend15.Name = "Legend1"; - this.GainChart.Legends.Add(legend15); + chartArea9.AxisX.Title = "Speed (counts/ms)"; + chartArea9.AxisY.Title = "Slope of Velocity Chart"; + chartArea9.Name = "ChartArea1"; + this.GainChart.ChartAreas.Add(chartArea9); + legend9.Name = "Legend1"; + this.GainChart.Legends.Add(legend9); this.GainChart.Location = new System.Drawing.Point(432, 647); this.GainChart.Name = "GainChart"; - series29.ChartArea = "ChartArea1"; - series29.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series29.Legend = "Legend1"; - series29.Name = "Velocity Gain"; - series30.ChartArea = "ChartArea1"; - series30.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series30.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series30.Legend = "Legend1"; - series30.Name = "LastGainVal"; - this.GainChart.Series.Add(series29); - this.GainChart.Series.Add(series30); + series17.ChartArea = "ChartArea1"; + series17.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series17.Legend = "Legend1"; + series17.Name = "Velocity Gain"; + series18.ChartArea = "ChartArea1"; + series18.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series18.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series18.Legend = "Legend1"; + series18.Name = "LastGainVal"; + this.GainChart.Series.Add(series17); + this.GainChart.Series.Add(series18); this.GainChart.Size = new System.Drawing.Size(723, 309); this.GainChart.TabIndex = 29; this.GainChart.Text = "chart1"; @@ -560,75 +560,75 @@ namespace grapher // // AccelerationChartY // - chartArea16.AxisX.Title = "Speed (counts/ms)"; - chartArea16.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea16.Name = "ChartArea1"; - this.AccelerationChartY.ChartAreas.Add(chartArea16); - legend16.Name = "Legend1"; - this.AccelerationChartY.Legends.Add(legend16); + chartArea10.AxisX.Title = "Speed (counts/ms)"; + chartArea10.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea10.Name = "ChartArea1"; + this.AccelerationChartY.ChartAreas.Add(chartArea10); + legend10.Name = "Legend1"; + this.AccelerationChartY.Legends.Add(legend10); this.AccelerationChartY.Location = new System.Drawing.Point(1161, 0); this.AccelerationChartY.Name = "AccelerationChartY"; - series31.ChartArea = "ChartArea1"; - series31.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series31.Legend = "Legend1"; - series31.Name = "Accelerated Sensitivity"; - series32.ChartArea = "ChartArea1"; - series32.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series32.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series32.Legend = "Legend1"; - series32.Name = "LastAccelVal"; - this.AccelerationChartY.Series.Add(series31); - this.AccelerationChartY.Series.Add(series32); + series19.ChartArea = "ChartArea1"; + series19.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series19.Legend = "Legend1"; + series19.Name = "Accelerated Sensitivity"; + series20.ChartArea = "ChartArea1"; + series20.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series20.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series20.Legend = "Legend1"; + series20.Name = "LastAccelVal"; + this.AccelerationChartY.Series.Add(series19); + this.AccelerationChartY.Series.Add(series20); this.AccelerationChartY.Size = new System.Drawing.Size(723, 328); this.AccelerationChartY.TabIndex = 31; this.AccelerationChartY.Text = "chart1"; // // VelocityChartY // - chartArea17.AxisX.Title = "Speed (count/ms)"; - chartArea17.AxisY.Title = "Output Speed (counts/ms)"; - chartArea17.Name = "ChartArea1"; - this.VelocityChartY.ChartAreas.Add(chartArea17); - legend17.Name = "Legend1"; - this.VelocityChartY.Legends.Add(legend17); + chartArea11.AxisX.Title = "Speed (count/ms)"; + chartArea11.AxisY.Title = "Output Speed (counts/ms)"; + chartArea11.Name = "ChartArea1"; + this.VelocityChartY.ChartAreas.Add(chartArea11); + legend11.Name = "Legend1"; + this.VelocityChartY.Legends.Add(legend11); this.VelocityChartY.Location = new System.Drawing.Point(1161, 334); this.VelocityChartY.Name = "VelocityChartY"; - series33.ChartArea = "ChartArea1"; - series33.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series33.Legend = "Legend1"; - series33.Name = "Mouse Velocity"; - series34.ChartArea = "ChartArea1"; - series34.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series34.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series34.Legend = "Legend1"; - series34.Name = "LastVelocityVal"; - this.VelocityChartY.Series.Add(series33); - this.VelocityChartY.Series.Add(series34); + series21.ChartArea = "ChartArea1"; + series21.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series21.Legend = "Legend1"; + series21.Name = "Mouse Velocity"; + series22.ChartArea = "ChartArea1"; + series22.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series22.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series22.Legend = "Legend1"; + series22.Name = "LastVelocityVal"; + this.VelocityChartY.Series.Add(series21); + this.VelocityChartY.Series.Add(series22); this.VelocityChartY.Size = new System.Drawing.Size(723, 307); this.VelocityChartY.TabIndex = 32; this.VelocityChartY.Text = "chart1"; // // GainChartY // - chartArea18.AxisX.Title = "Speed (counts/ms)"; - chartArea18.AxisY.Title = "Slope of Velocity Chart"; - chartArea18.Name = "ChartArea1"; - this.GainChartY.ChartAreas.Add(chartArea18); - legend18.Name = "Legend1"; - this.GainChartY.Legends.Add(legend18); + chartArea12.AxisX.Title = "Speed (counts/ms)"; + chartArea12.AxisY.Title = "Slope of Velocity Chart"; + chartArea12.Name = "ChartArea1"; + this.GainChartY.ChartAreas.Add(chartArea12); + legend12.Name = "Legend1"; + this.GainChartY.Legends.Add(legend12); this.GainChartY.Location = new System.Drawing.Point(1161, 647); this.GainChartY.Name = "GainChartY"; - series35.ChartArea = "ChartArea1"; - series35.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series35.Legend = "Legend1"; - series35.Name = "Velocity Gain"; - series36.ChartArea = "ChartArea1"; - series36.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series36.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series36.Legend = "Legend1"; - series36.Name = "LastGainVal"; - this.GainChartY.Series.Add(series35); - this.GainChartY.Series.Add(series36); + series23.ChartArea = "ChartArea1"; + series23.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series23.Legend = "Legend1"; + series23.Name = "Velocity Gain"; + series24.ChartArea = "ChartArea1"; + series24.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series24.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series24.Legend = "Legend1"; + series24.Name = "LastGainVal"; + this.GainChartY.Series.Add(series23); + this.GainChartY.Series.Add(series24); this.GainChartY.Size = new System.Drawing.Size(723, 309); this.GainChartY.TabIndex = 33; this.GainChartY.Text = "chart1"; @@ -897,31 +897,31 @@ namespace grapher this.label10.TabIndex = 63; this.label10.Text = "Midpoint"; // - // label11 + // OptionSetXTitle // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(142, 94); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(14, 13); - this.label11.TabIndex = 64; - this.label11.Text = "X"; + this.OptionSetXTitle.AutoSize = true; + this.OptionSetXTitle.Location = new System.Drawing.Point(142, 94); + this.OptionSetXTitle.Name = "OptionSetXTitle"; + this.OptionSetXTitle.Size = new System.Drawing.Size(14, 13); + this.OptionSetXTitle.TabIndex = 64; + this.OptionSetXTitle.Text = "X"; // - // label12 + // OptionSetYTitle // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(300, 94); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(14, 13); - this.label12.TabIndex = 65; - this.label12.Text = "Y"; + this.OptionSetYTitle.AutoSize = true; + this.OptionSetYTitle.Location = new System.Drawing.Point(300, 94); + this.OptionSetYTitle.Name = "OptionSetYTitle"; + this.OptionSetYTitle.Size = new System.Drawing.Size(14, 13); + this.OptionSetYTitle.TabIndex = 65; + this.OptionSetYTitle.Text = "Y"; // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1884, 956); - this.Controls.Add(this.label12); - this.Controls.Add(this.label11); + this.Controls.Add(this.OptionSetYTitle); + this.Controls.Add(this.OptionSetXTitle); this.Controls.Add(this.label10); this.Controls.Add(this.label9); this.Controls.Add(this.label8); @@ -1078,8 +1078,8 @@ namespace grapher private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label10; - private System.Windows.Forms.Label label11; - private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label OptionSetXTitle; + private System.Windows.Forms.Label OptionSetYTitle; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 20768ef..0b1b76c 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -74,8 +74,6 @@ namespace grapher limitBox, midpointBox, sensXYLock, - weightXYLock, - capXYLock, sensitivityLabel, rotationLabel, weightLabel, diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index eed1716..0ad855a 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -40,7 +40,7 @@ namespace grapher.Layouts internal bool ButtonEnabled { get; set; } - public void Layout(Option[] options, OptionXY[] optionsXY, Button button) + public void Layout(Option[] options, Button button) { // Relies on AccelOptions to keep lengths correct. for (int i = 0; i < options.Length; i++) @@ -55,19 +55,6 @@ namespace grapher.Layouts } } - // Relies on AccelOptions to keep lengths correct. - for (int i = 0; i< optionsXY.Length; i++) - { - if (ShowOptionsXY[i]) - { - optionsXY[i].Show(); - } - else - { - optionsXY[i].Hide(); - } - } - button.Enabled = ButtonEnabled; } } diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index b9a578f..5ea3595 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -25,15 +25,10 @@ namespace grapher AccelCharts accelCharts, SettingsManager settings, ApplyOptions applyOptions, - AccelOptions accelOptions, OptionXY sensitivity, Option rotation, - OptionXY weight, - CapOptions cap, - Option offset, - Option acceleration, - Option limtOrExp, - Option midpoint, + AccelOptionSet optionSetX, + AccelOptionSet optionSetY, Button writeButton, Label mouseMoveLabel, ToolStripMenuItem scaleMenuItem) @@ -41,21 +36,14 @@ namespace grapher AccelForm = accelForm; AccelCalculator = accelCalculator; AccelCharts = accelCharts; - AccelerationOptions = accelOptions; ApplyOptions = applyOptions; Sensitivity = sensitivity; Rotation = rotation; - Weight = weight; - Cap = cap; - Offset = offset; - Acceleration = acceleration; - LimitOrExponent = limtOrExp; - Midpoint = midpoint; WriteButton = writeButton; ScaleMenuItem = scaleMenuItem; Settings = settings; Settings.Startup(); - UpdateGraph(); + RefreshOnRead(); MouseWatcher = new MouseWatcher(AccelForm, mouseMoveLabel, AccelCharts); @@ -76,23 +64,13 @@ namespace grapher public ApplyOptions ApplyOptions { get; } - public AccelOptions AccelerationOptions { get; } - public OptionXY Sensitivity { get; } public Option Rotation { get; } - public OptionXY Weight { get; } - - public CapOptions Cap { get; } - - public Option Offset { get; } - - public Option Acceleration { get; } - - public Option LimitOrExponent { get; } + public AccelOptionSet OptionSetX { get; } - public Option Midpoint { get; } + public AccelOptionSet OptionSetY { get; } public Button WriteButton { get; } @@ -117,28 +95,23 @@ namespace grapher combineMagnitudes = ApplyOptions.IsWhole, modes = new Vec2 { - x = (AccelMode)AccelerationOptions.AccelerationIndex + x = (AccelMode)OptionSetX.AccelTypeOptions.AccelerationIndex, + y = (AccelMode)OptionSetY.AccelTypeOptions.AccelerationIndex }, args = new Vec2 { - x = new AccelArgs - { - offset = Offset.Field.Data, - weight = Weight.Fields.X, - gainCap = Cap.VelocityGainCap, - scaleCap = Cap.SensitivityCapX, - accel = Acceleration.Field.Data, - rate = Acceleration.Field.Data, - powerScale = Acceleration.Field.Data, - limit = LimitOrExponent.Field.Data, - exponent = LimitOrExponent.Field.Data, - powerExponent = LimitOrExponent.Field.Data, - midpoint = Midpoint.Field.Data - } + x = OptionSetX.GenerateArgs(), + y = OptionSetY.GenerateArgs() }, minimumTime = .4 }); + RefreshOnRead(); + } + + public void RefreshOnRead() + { UpdateGraph(); + UpdateShownActiveValues(); } public void UpdateGraph() @@ -148,23 +121,17 @@ namespace grapher Settings.ActiveAccel, Settings.RawAccelSettings.AccelerationSettings); AccelCharts.Bind(); - UpdateShownActiveValues(); } public void UpdateShownActiveValues() { var settings = Settings.RawAccelSettings.AccelerationSettings; - + Sensitivity.SetActiveValues(settings.sensitivity.x, settings.sensitivity.y); Rotation.SetActiveValue(settings.rotation); - AccelerationOptions.SetActiveValue((int)settings.modes.x); - Offset.SetActiveValue(settings.args.x.offset); - Weight.SetActiveValues(settings.args.x.weight, settings.args.x.weight); - Acceleration.SetActiveValue(settings.args.x.accel); // rate, powerscale - LimitOrExponent.SetActiveValue(settings.args.x.limit); //exp, powerexp - Midpoint.SetActiveValue(settings.args.x.midpoint); ApplyOptions.SetActive(settings.combineMagnitudes); - Cap.SetActiveValues(settings.args.x.gainCap, settings.args.x.scaleCap, settings.args.y.scaleCap, settings.args.x.gainCap > 0); + OptionSetX.SetActiveValues((int)settings.modes.x, settings.args.x); + OptionSetY.SetActiveValues((int)settings.modes.y, settings.args.y); AccelCharts.RefreshXY(settings.combineMagnitudes); } diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index e7167e9..e4637ec 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -24,7 +24,8 @@ namespace grapher.Models Chart velocityChartY, Chart gainChart, Chart gainChartY, - ComboBox accelTypeDrop, + ComboBox accelTypeDropX, + ComboBox accelTypeDropY, Button writeButton, ToolStripMenuItem showVelocityGainToolStripMenuItem, ToolStripMenuItem wholeVectorToolStripMenuItem, @@ -42,21 +43,31 @@ namespace grapher.Models TextBox weightBoxY, TextBox capBoxX, TextBox capBoxY, - TextBox offsetBox, - TextBox accelerationBox, - TextBox limitBox, - TextBox midpointBox, + TextBox offsetBoxX, + TextBox offsetBoxY, + TextBox accelerationBoxX, + TextBox accelerationBoxY, + TextBox limitBoxX, + TextBox limitBoxY, + TextBox midpointBoxX, + TextBox midpointBoxY, CheckBox sensXYLock, CheckBox weightXYLock, CheckBox capXYLock, Label sensitivityLabel, Label rotationLabel, - Label weightLabel, - Label capLabel, - Label offsetLabel, - Label constantOneLabel, - Label constantTwoLabel, - Label constantThreeLabel, + Label weightLabelX, + Label weightLabelY, + Label capLabelX, + Label capLabelY, + Label offsetLabelX, + Label offsetLabelY, + Label constantOneLabelX, + Label constantOneLabelY, + Label constantTwoLabelX, + Label constantTwoLabelY, + Label constantThreeLabelX, + Label constantThreeLabelY, Label activeValueTitle, Label sensitivityActiveXLabel, Label sensitivityActiveYLabel, @@ -65,11 +76,17 @@ namespace grapher.Models Label weightActiveYLabel, Label capActiveXLabel, Label capActiveYLabel, - Label offsetActiveLabel, - Label accelerationActiveLabel, - Label limitExpActiveLabel, - Label midpointActiveLabel, + Label offsetActiveLabelX, + Label offsetActiveLabelY, + Label accelerationActiveLabelX, + Label accelerationActiveLabelY, + Label limitExpActiveLabelX, + Label limitExpActiveLabelY, + Label midpointActiveLabelX, + Label midpointActiveLabelY, Label accelTypeActiveLabel, + Label optionSetXTitle, + Label optionSetYTitle, Label mouseLabel) { var accelCharts = new AccelCharts( @@ -101,76 +118,142 @@ namespace grapher.Models new ActiveValueLabel(rotationActiveLabel, activeValueTitle), "Rotation"); - var weight = new OptionXY( + var weightX = new Option( weightBoxX, + form, + 1, + weightLabelX, + new ActiveValueLabel(weightActiveXLabel, activeValueTitle), + "Weight"); + + var weightY = new Option( weightBoxY, - weightXYLock, form, 1, - weightLabel, - new ActiveValueLabelXY( - new ActiveValueLabel(weightActiveXLabel, activeValueTitle), - new ActiveValueLabel(weightActiveYLabel, activeValueTitle)), + weightLabelY, + new ActiveValueLabel(weightActiveYLabel, activeValueTitle), "Weight"); - var cap = new OptionXY( + var capX = new Option( capBoxX, + form, + 0, + capLabelX, + new ActiveValueLabel(capActiveXLabel, activeValueTitle), + "Cap"); + + var capY = new Option( capBoxY, - capXYLock, form, 0, - capLabel, - new ActiveValueLabelXY( - new ActiveValueLabel(capActiveXLabel, activeValueTitle), - new ActiveValueLabel(capActiveYLabel, activeValueTitle)), + capLabelY, + new ActiveValueLabel(capActiveYLabel, activeValueTitle), "Cap"); - var offset = new Option( - offsetBox, + var offsetX = new Option( + offsetBoxX, form, 0, - offsetLabel, - new ActiveValueLabel(offsetActiveLabel, activeValueTitle), + offsetLabelX, + new ActiveValueLabel(offsetActiveLabelX, activeValueTitle), + "Offset"); + + var offsetY = new Option( + offsetBoxY, + form, + 0, + offsetLabelY, + new ActiveValueLabel(offsetActiveLabelY, activeValueTitle), "Offset"); // The name and layout of these options is handled by AccelerationOptions object. - var acceleration = new Option( - new Field(accelerationBox, form, 0), - constantOneLabel, - new ActiveValueLabel(accelerationActiveLabel, activeValueTitle)); - - var limitOrExponent = new Option( - new Field(limitBox, form, 2), - constantTwoLabel, - new ActiveValueLabel(limitExpActiveLabel, activeValueTitle)); - - var midpoint = new Option( - new Field(midpointBox, form, 0), - constantThreeLabel, - new ActiveValueLabel(midpointActiveLabel, activeValueTitle)); - - var accelerationOptions = new AccelOptions( - accelTypeDrop, + var accelerationX = new Option( + new Field(accelerationBoxX, form, 0), + constantOneLabelX, + new ActiveValueLabel(accelerationActiveLabelX, activeValueTitle)); + + var accelerationY = new Option( + new Field(accelerationBoxY, form, 0), + constantOneLabelY, + new ActiveValueLabel(accelerationActiveLabelY, activeValueTitle)); + + var limitOrExponentX = new Option( + new Field(limitBoxX, form, 2), + constantTwoLabelX, + new ActiveValueLabel(limitExpActiveLabelX, activeValueTitle)); + + var limitOrExponentY = new Option( + new Field(limitBoxY, form, 2), + constantTwoLabelY, + new ActiveValueLabel(limitExpActiveLabelY, activeValueTitle)); + + var midpointX = new Option( + new Field(midpointBoxX, form, 0), + constantThreeLabelX, + new ActiveValueLabel(midpointActiveLabelX, activeValueTitle)); + + var midpointY = new Option( + new Field(midpointBoxY, form, 0), + constantThreeLabelY, + new ActiveValueLabel(midpointActiveLabelY, activeValueTitle)); + + var accelerationOptionsX = new AccelTypeOptions( + accelTypeDropX, new Option[] { - offset, - acceleration, - limitOrExponent, - midpoint, + offsetX, + accelerationX, + limitOrExponentX, + midpointX, + capX, + weightX }, - new OptionXY[] + writeButton, + new ActiveValueLabel(accelTypeActiveLabel, activeValueTitle)); + + var accelerationOptionsY = new AccelTypeOptions( + accelTypeDropY, + new Option[] { - weight, - cap, + offsetY, + accelerationY, + limitOrExponentY, + midpointY, + capY, + weightY }, writeButton, new ActiveValueLabel(accelTypeActiveLabel, activeValueTitle)); - var capOptions = new CapOptions( + var capOptionsX = new CapOptions( sensitivityToolStripMenuItem, velocityGainToolStripMenuItem, - cap, - weight); + capX); + + var capOptionsY = new CapOptions( + sensitivityToolStripMenuItem, + velocityGainToolStripMenuItem, + capY); + + var optionsSetX = new AccelOptionSet( + optionSetXTitle, + accelerationOptionsX, + accelerationX, + capOptionsX, + weightX, + offsetX, + limitOrExponentX, + midpointX); + + var optionsSetY = new AccelOptionSet( + optionSetYTitle, + accelerationOptionsY, + accelerationY, + capOptionsY, + weightY, + offsetY, + limitOrExponentY, + midpointY); var accelCalculator = new AccelCalculator( new Field(dpiTextBox.TextBox, form, Constants.DefaultDPI), @@ -188,15 +271,10 @@ namespace grapher.Models accelCharts, settings, applyOptions, - accelerationOptions, sensitivity, rotation, - weight, - capOptions, - offset, - acceleration, - limitOrExponent, - midpoint, + optionsSetX, + optionsSetY, writeButton, mouseLabel, scaleMenuItem); diff --git a/grapher/Models/Fields/Field.cs b/grapher/Models/Fields/Field.cs index 7651a37..6f38314 100644 --- a/grapher/Models/Fields/Field.cs +++ b/grapher/Models/Fields/Field.cs @@ -58,6 +58,54 @@ namespace grapher public FieldState PreviousState { get; private set; } + public int Top + { + get + { + return Box.Top; + } + set + { + Box.Top = value; + } + } + + public int Height + { + get + { + return Box.Height; + } + set + { + Box.Height = value; + } + } + + public int Left + { + get + { + return Box.Left; + } + set + { + Box.Left = value; + } + } + + public int Width + { + get + { + return Box.Width; + } + set + { + Box.Width = value; + } + } + private double DefaultData { get; } #endregion Properties diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs new file mode 100644 index 0000000..2d15ad6 --- /dev/null +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -0,0 +1,169 @@ +using grapher.Models.Serialized; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace grapher.Models.Options +{ + public class AccelOptionSet + { + public AccelOptionSet( + Label titleLabel, + AccelTypeOptions accelTypeOptions, + Option acceleration, + CapOptions cap, + Option weight, + Option offset, + Option limitOrExp, + Option midpoint) + { + TitleLabel = titleLabel; + AccelTypeOptions = accelTypeOptions; + Acceleration = acceleration; + Cap = cap; + Weight = weight; + Offset = offset; + LimitOrExponent = limitOrExp; + Midpoint = midpoint; + + AccelTypeOptions.ShowFullText(); + + TitleLabel.Top = TopAnchor; + } + + public int TopAnchor { get; } + + public Label TitleLabel { get; } + + public AccelTypeOptions AccelTypeOptions { get; } + + public Option Acceleration { get; } + + public CapOptions Cap { get; } + + public Option Weight { get; } + + public Option Offset { get; } + + public Option LimitOrExponent { get; } + + public Option Midpoint { get; } + + public bool IsTitleMode { get; private set; } + + public void SetRegularMode() + { + if (IsTitleMode) + { + IsTitleMode = false; + + HideTitle(); + AccelTypeOptions.Left = Acceleration.Left; + AccelTypeOptions.Width = Acceleration.Width; + AccelTypeOptions.ShowFullText(); + } + } + + public void SetTitleMode() + { + if (!IsTitleMode) + { + IsTitleMode = true; + + AccelTypeOptions.Left = Acceleration.Field.Left; + AccelTypeOptions.Width = Acceleration.Field.Width; + AccelTypeOptions.ShowFullText(); + DisplayTitle(); + } + } + + public void Hide() + { + TitleLabel.Hide(); + AccelTypeOptions.Hide(); + Acceleration.Hide(); + Cap.Hide(); + Weight.Hide(); + Offset.Hide(); + LimitOrExponent.Hide(); + Midpoint.Hide(); + } + + public void Show() + { + if (IsTitleMode) + { + TitleLabel.Show(); + } + + AccelTypeOptions.Show(); + Acceleration.Show(); + Cap.Show(); + Weight.Show(); + Offset.Show(); + LimitOrExponent.Show(); + Midpoint.Show(); + } + + public void DisplayTitle() + { + TitleLabel.Show(); + + SetOptionsTop(TitleLabel.Top + TitleLabel.Height + Constants.OptionVerticalSeperation); + } + + public void HideTitle() + { + TitleLabel.Hide(); + + SetOptionsTop(TopAnchor); + } + + public void SetArgs(AccelArgs args) + { + args.accel = Acceleration.Field.Data; + args.rate = Acceleration.Field.Data; + args.powerScale = Acceleration.Field.Data; + args.gainCap = Cap.VelocityGainCap; + args.scaleCap = Cap.SensitivityCap; + args.limit = LimitOrExponent.Field.Data; + args.exponent = LimitOrExponent.Field.Data; + args.powerExponent = LimitOrExponent.Field.Data; + args.offset = Offset.Field.Data; + args.midpoint = Midpoint.Field.Data; + args.weight = Weight.Field.Data; + } + + public AccelArgs GenerateArgs() + { + AccelArgs args = new AccelArgs(); + SetArgs(args); + return args; + } + + public void SetActiveValues(int mode, AccelArgs args) + { + AccelTypeOptions.SetActiveValue(mode); + Weight.SetActiveValue(args.weight); + Cap.SetActiveValues(args.gainCap, args.scaleCap, args.gainCap > 0); + Offset.SetActiveValue(args.offset); + Acceleration.SetActiveValue(args.accel); + LimitOrExponent.SetActiveValue(args.exponent); + Midpoint.SetActiveValue(args.midpoint); + } + + private void SetOptionsTop(int top) + { + AccelTypeOptions.Top = top; + Acceleration.Top = AccelTypeOptions.Top+ AccelTypeOptions.Height + Constants.OptionVerticalSeperation; + Cap.SnapTo(Acceleration); + Weight.SnapTo(Cap); + Offset.SnapTo(Weight); + LimitOrExponent.SnapTo(Offset); + Midpoint.SnapTo(LimitOrExponent); + } + } +} diff --git a/grapher/Models/Options/AccelOptions.cs b/grapher/Models/Options/AccelOptions.cs deleted file mode 100644 index 8c01585..0000000 --- a/grapher/Models/Options/AccelOptions.cs +++ /dev/null @@ -1,104 +0,0 @@ -using grapher.Layouts; -using grapher.Models.Options; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace grapher -{ - public class AccelOptions - { - #region Fields - - public static readonly Dictionary AccelerationTypes = new List - { - new LinearLayout(), - new ClassicLayout(), - new NaturalLayout(), - new LogLayout(), - new SigmoidLayout(), - new PowerLayout(), - new NaturalGainLayout(), - new SigmoidGainLayout(), - new OffLayout() - }.ToDictionary(k => k.Name); - - #endregion Fields - - #region Constructors - - public AccelOptions( - ComboBox accelDropdown, - Option[] options, - OptionXY[] optionsXY, - Button writeButton, - ActiveValueLabel activeValueLabel) - { - AccelDropdown = accelDropdown; - AccelDropdown.Items.Clear(); - AccelDropdown.Items.AddRange(AccelerationTypes.Keys.ToArray()); - AccelDropdown.SelectedIndexChanged += new System.EventHandler(OnIndexChanged); - - if (options.Length > Constants.PossibleOptionsCount) - { - throw new Exception("Layout given too many options."); - } - - if (optionsXY.Length > Constants.PossibleOptionsXYCount) - { - throw new Exception("Layout given too many options."); - } - - Options = options; - OptionsXY = optionsXY; - WriteButton = writeButton; - ActiveValueLabel = activeValueLabel; - - Layout("Off"); - } - - #endregion Constructors - - #region Properties - - public Button WriteButton { get; } - - public ComboBox AccelDropdown { get; } - - public int AccelerationIndex { get; private set; } - - public ActiveValueLabel ActiveValueLabel { get; } - - public Option[] Options { get; } - - public OptionXY[] OptionsXY { get; } - - #endregion Properties - - #region Methods - - public void SetActiveValue(int index) - { - var name = AccelerationTypes.Where(t => t.Value.Index == index).FirstOrDefault().Value.Name; - ActiveValueLabel.SetValue(name); - } - - private void OnIndexChanged(object sender, EventArgs e) - { - var accelerationTypeString = AccelDropdown.SelectedItem.ToString(); - Layout(accelerationTypeString); - } - - private void Layout(string type) - { - var accelerationType = AccelerationTypes[type]; - AccelerationIndex = accelerationType.Index; - accelerationType.Layout(Options, OptionsXY, WriteButton); - } - - #endregion Methods - } -} diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs new file mode 100644 index 0000000..2359b8d --- /dev/null +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -0,0 +1,173 @@ +using grapher.Layouts; +using grapher.Models.Options; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace grapher +{ + public class AccelTypeOptions + { + #region Fields + + public static readonly Dictionary AccelerationTypes = new List + { + new LinearLayout(), + new ClassicLayout(), + new NaturalLayout(), + new LogLayout(), + new SigmoidLayout(), + new PowerLayout(), + new NaturalGainLayout(), + new SigmoidGainLayout(), + new OffLayout() + }.ToDictionary(k => k.Name); + + #endregion Fields + + #region Constructors + + public AccelTypeOptions( + ComboBox accelDropdown, + Option[] options, + Button writeButton, + ActiveValueLabel activeValueLabel) + { + AccelDropdown = accelDropdown; + AccelDropdown.Items.Clear(); + AccelDropdown.Items.AddRange(AccelerationTypes.Keys.ToArray()); + AccelDropdown.SelectedIndexChanged += new System.EventHandler(OnIndexChanged); + + if (options.Length > Constants.PossibleOptionsCount) + { + throw new Exception("Layout given too many options."); + } + + Options = options; + WriteButton = writeButton; + ActiveValueLabel = activeValueLabel; + + Layout("Off"); + ShowingDefault = true; + } + + #endregion Constructors + + #region Properties + + public Button WriteButton { get; } + + public ComboBox AccelDropdown { get; } + + public int AccelerationIndex { get; private set; } + + public ActiveValueLabel ActiveValueLabel { get; } + + public Option[] Options { get; } + + public int Top + { + get + { + return AccelDropdown.Top; + } + set + { + AccelDropdown.Top = value; + } + } + + public int Height + { + get + { + return AccelDropdown.Height; + } + set + { + AccelDropdown.Height = value; + } + } + + public int Left + { + get + { + return AccelDropdown.Left; + } + set + { + AccelDropdown.Left = value; + } + } + + public int Width + { + get + { + return AccelDropdown.Width; + } + set + { + AccelDropdown.Width = value; + } + } + + private bool ShowingDefault { get; set; } + + #endregion Properties + + #region Methods + + public void Hide() + { + AccelDropdown.Hide(); + } + + public void Show() + { + AccelDropdown.Show(); + } + + public void SetActiveValue(int index) + { + var name = AccelerationTypes.Where(t => t.Value.Index == index).FirstOrDefault().Value.Name; + ActiveValueLabel.SetValue(name); + } + + public void ShowFullText() + { + if (ShowingDefault) + { + AccelDropdown.Text = Constants.AccelDropDownDefaultFullText; + } + } + + public void ShowShortenedText() + { + if (ShowingDefault) + { + AccelDropdown.Text = Constants.AccelDropDownDefaultShortText; + } + } + + private void OnIndexChanged(object sender, EventArgs e) + { + var accelerationTypeString = AccelDropdown.SelectedItem.ToString(); + Layout(accelerationTypeString); + ShowingDefault = false; + } + + private void Layout(string type) + { + var accelerationType = AccelerationTypes[type]; + AccelerationIndex = accelerationType.Index; + accelerationType.Layout(Options, WriteButton); + } + + #endregion Methods + } +} diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index 62f74a3..6768a85 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -20,14 +20,12 @@ namespace grapher public CapOptions( ToolStripMenuItem sensitivityCapCheck, ToolStripMenuItem velocityGainCapCheck, - OptionXY capOption, - OptionXY weightOption) + Option capOption) { SensitivityCapCheck = sensitivityCapCheck; VelocityGainCapCheck = velocityGainCapCheck; CapOption = capOption; - WeightOption = weightOption; SensitivityCapCheck.Click += new System.EventHandler(OnSensitivityCapCheckClick); VelocityGainCapCheck.Click += new System.EventHandler(OnVelocityGainCapCheckClick); @@ -46,32 +44,16 @@ namespace grapher public ToolStripMenuItem VelocityGainCapCheck { get; } - public OptionXY CapOption { get; } - - public OptionXY WeightOption { get; } + public Option CapOption { get; } public bool IsSensitivityGain { get; private set; } - public double SensitivityCapX { + public double SensitivityCap { get { if (IsSensitivityGain) { - return CapOption.Fields.X; - } - else - { - return 0; - } - } - } - - public double SensitivityCapY { - get - { - if (IsSensitivityGain) - { - return CapOption.Fields.Y; + return CapOption.Field.Data; } else { @@ -89,7 +71,7 @@ namespace grapher } else { - return CapOption.Fields.X; + return CapOption.Field.Data; } } } @@ -98,21 +80,31 @@ namespace grapher #region Methods - public void SetActiveValues(double gainCap, double sensCapX, double sensCapY, bool capGainEnabled) + public void Hide() + { + CapOption.Hide(); + } + + public void Show() + { + CapOption.Show(); + } + + public void SetActiveValues(double gainCap, double sensCap, bool capGainEnabled) { if (capGainEnabled) { - CapOption.ActiveValueLabels.X.FormatString = Constants.GainCapFormatString; - CapOption.ActiveValueLabels.X.Prefix = "Gain"; - CapOption.SetActiveValues(gainCap, gainCap); + CapOption.ActiveValueLabel.FormatString = Constants.GainCapFormatString; + CapOption.ActiveValueLabel.Prefix = "Gain"; + CapOption.SetActiveValue(gainCap); SensitivityCapCheck.Checked = true; VelocityGainCapCheck.Checked = false; } else { - CapOption.ActiveValueLabels.X.FormatString = Constants.DefaultActiveValueFormatString; - CapOption.ActiveValueLabels.X.Prefix = string.Empty; - CapOption.SetActiveValues(sensCapX, sensCapY); + CapOption.ActiveValueLabel.FormatString = Constants.DefaultActiveValueFormatString; + CapOption.ActiveValueLabel.Prefix = string.Empty; + CapOption.SetActiveValue(sensCap); SensitivityCapCheck.Checked = false; VelocityGainCapCheck.Checked = true; } @@ -155,18 +147,12 @@ namespace grapher void EnableSensitivityCap() { IsSensitivityGain = true; - CapOption.Fields.LockCheckBox.Enabled = true; - WeightOption.Fields.LockCheckBox.Enabled = true; CapOption.SetName("Sensitivity Cap"); } void EnableVelocityGainCap() { IsSensitivityGain = false; - CapOption.Fields.LockCheckBox.Checked = true; - CapOption.Fields.LockCheckBox.Enabled = false; - WeightOption.Fields.LockCheckBox.Checked = true; - WeightOption.Fields.LockCheckBox.Enabled = false; CapOption.SetName("Velocity Gain Cap"); } diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index c5336a6..bd2c9a1 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -62,6 +62,47 @@ namespace grapher public ActiveValueLabel ActiveValueLabel { get; } + public int Top + { + get + { + return Field.Top; + } + set + { + Field.Top = value; + Label.Top = value; + } + } + + public int Height + { + get + { + return Field.Height; + } + } + + public int Left + { + get + { + return Label.Left; + } + set + { + Label.Left = value; + Field.Left = value + Label.Width + Constants.OptionLabelBoxSeperation; + } + } + public int Width + { + get + { + return Field.Left + Field.Width - Label.Left; + } + } + #endregion Properties #region Methods @@ -70,7 +111,7 @@ namespace grapher { Label.Text = name; //Label.Left = Convert.ToInt32((Field.Box.Left / 2.0) - (Label.Width / 2.0)); //Centered - Label.Left = Convert.ToInt32(Field.Box.Left - Label.Width - 10); //Right-aligned + Left = Label.Left; } public void SetActiveValue(double value) @@ -103,6 +144,11 @@ namespace grapher Show(); } + + public void SnapTo(Option option) + { + Top = option.Top + option.Height + Constants.OptionVerticalSeperation; + } #endregion Methods } diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index d382041..8481e75 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -65,7 +65,8 @@ - + + -- cgit v1.2.3 From 26130b21dabaab7fc331844df11465623a811197 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 22:42:07 -0700 Subject: Second half - the parts in place --- grapher/Constants/Constants.cs | 2 +- grapher/Form1.Designer.cs | 690 ++++++++++++++++++----------------- grapher/Form1.cs | 54 ++- grapher/Layouts/ClassicLayout.cs | 4 +- grapher/Layouts/DefaultLayout.cs | 4 +- grapher/Layouts/LayoutBase.cs | 6 +- grapher/Layouts/LinearLayout.cs | 4 +- grapher/Layouts/LogLayout.cs | 4 +- grapher/Layouts/NaturalGainLayout.cs | 4 +- grapher/Layouts/NaturalLayout.cs | 2 +- grapher/Layouts/OffLayout.cs | 5 +- grapher/Layouts/PowerLayout.cs | 4 +- grapher/Layouts/SigmoidGainLayout.cs | 4 +- grapher/Layouts/SigmoidLayout.cs | 4 +- grapher/Models/AccelGUI.cs | 2 + grapher/Models/AccelGUIFactory.cs | 9 +- grapher/Models/Options/CapOptions.cs | 27 ++ grapher/Models/Options/Option.cs | 5 + 18 files changed, 449 insertions(+), 385 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 833512b..3d19b21 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -51,7 +51,7 @@ namespace grapher public const string DefaultFieldFormatString = "0.#########"; /// Possible options to display in a layout. - public const int PossibleOptionsCount = 4; + public const int PossibleOptionsCount = 6; /// Possible x/y options to display in a layout. public const int PossibleOptionsXYCount = 0; diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 15f2d04..22ae1b8 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -55,24 +55,24 @@ namespace grapher System.Windows.Forms.DataVisualization.Charting.Series series23 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series24 = new System.Windows.Forms.DataVisualization.Charting.Series(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); - this.accelTypeDrop = new System.Windows.Forms.ComboBox(); + this.accelTypeDropX = new System.Windows.Forms.ComboBox(); this.sensitivityBoxX = new System.Windows.Forms.TextBox(); this.sensitivityLabel = new System.Windows.Forms.Label(); this.rotationBox = new System.Windows.Forms.TextBox(); this.rotationLabel = new System.Windows.Forms.Label(); - this.accelerationBox = new System.Windows.Forms.TextBox(); - this.constantOneLabel = new System.Windows.Forms.Label(); + this.accelerationBoxX = new System.Windows.Forms.TextBox(); + this.constantOneLabelX = new System.Windows.Forms.Label(); this.capBoxX = new System.Windows.Forms.TextBox(); - this.capLabel = new System.Windows.Forms.Label(); - this.weightBoxFirst = new System.Windows.Forms.TextBox(); - this.weightLabel = new System.Windows.Forms.Label(); - this.weightBoxSecond = new System.Windows.Forms.TextBox(); - this.limitBox = new System.Windows.Forms.TextBox(); - this.constantTwoLabel = new System.Windows.Forms.Label(); - this.midpointBox = new System.Windows.Forms.TextBox(); - this.constantThreeLabel = new System.Windows.Forms.Label(); - this.offsetBox = new System.Windows.Forms.TextBox(); - this.offsetLabel = new System.Windows.Forms.Label(); + this.capLabelX = new System.Windows.Forms.Label(); + this.weightBoxX = new System.Windows.Forms.TextBox(); + this.weightLabelX = new System.Windows.Forms.Label(); + this.weightBoxY = new System.Windows.Forms.TextBox(); + this.limitBoxX = new System.Windows.Forms.TextBox(); + this.constantTwoLabelX = new System.Windows.Forms.Label(); + this.midpointBoxX = new System.Windows.Forms.TextBox(); + this.constantThreeLabelX = new System.Windows.Forms.Label(); + this.offsetBoxX = new System.Windows.Forms.TextBox(); + this.offsetLabelX = new System.Windows.Forms.Label(); this.writeButton = new System.Windows.Forms.Button(); this.sensitivityBoxY = new System.Windows.Forms.TextBox(); this.capBoxY = new System.Windows.Forms.TextBox(); @@ -106,33 +106,34 @@ namespace grapher this.SensitivityActiveXLabel = new System.Windows.Forms.Label(); this.SensitivityActiveYLabel = new System.Windows.Forms.Label(); this.RotationActiveLabel = new System.Windows.Forms.Label(); - this.AccelTypeActiveLabel = new System.Windows.Forms.Label(); - this.AccelerationActiveLabel = new System.Windows.Forms.Label(); + this.AccelTypeActiveLabelX = new System.Windows.Forms.Label(); + this.AccelerationActiveLabelX = new System.Windows.Forms.Label(); this.CapActiveXLabel = new System.Windows.Forms.Label(); this.WeightActiveXLabel = new System.Windows.Forms.Label(); this.WeightActiveYLabel = new System.Windows.Forms.Label(); this.CapActiveYLabel = new System.Windows.Forms.Label(); - this.OffsetActiveLabel = new System.Windows.Forms.Label(); - this.LimitExpActiveLabel = new System.Windows.Forms.Label(); - this.MidpointActiveLabel = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.textBox3 = new System.Windows.Forms.TextBox(); - this.textBox4 = new System.Windows.Forms.TextBox(); + this.OffsetActiveXLabel = new System.Windows.Forms.Label(); + this.LimitExpActiveXLabel = new System.Windows.Forms.Label(); + this.MidpointActiveXLabel = new System.Windows.Forms.Label(); + this.accelerationBoxY = new System.Windows.Forms.TextBox(); + this.offsetBoxY = new System.Windows.Forms.TextBox(); + this.limitBoxY = new System.Windows.Forms.TextBox(); + this.midpointBoxY = new System.Windows.Forms.TextBox(); this.accelTypeDropY = new System.Windows.Forms.ComboBox(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.checkBox1 = new System.Windows.Forms.CheckBox(); - this.label5 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); + this.AccelerationActiveLabelY = new System.Windows.Forms.Label(); + this.OffsetActiveYLabel = new System.Windows.Forms.Label(); + this.LimitExpActiveYLabel = new System.Windows.Forms.Label(); + this.MidpointActiveYLabel = new System.Windows.Forms.Label(); + this.ByComponentXYLock = new System.Windows.Forms.CheckBox(); + this.constantOneLabelY = new System.Windows.Forms.Label(); + this.capLabelY = new System.Windows.Forms.Label(); + this.weightLabelY = new System.Windows.Forms.Label(); + this.offsetLabelY = new System.Windows.Forms.Label(); + this.constantTwoLabelY = new System.Windows.Forms.Label(); + this.constantThreeLabelY = new System.Windows.Forms.Label(); this.OptionSetXTitle = new System.Windows.Forms.Label(); this.OptionSetYTitle = new System.Windows.Forms.Label(); + this.AccelTypeActiveLabelY = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.GainChart)).BeginInit(); @@ -167,14 +168,14 @@ namespace grapher this.AccelerationChart.TabIndex = 0; this.AccelerationChart.Text = "Sensitivity"; // - // accelTypeDrop + // accelTypeDropX // - this.accelTypeDrop.FormattingEnabled = true; - this.accelTypeDrop.Location = new System.Drawing.Point(105, 110); - this.accelTypeDrop.Name = "accelTypeDrop"; - this.accelTypeDrop.Size = new System.Drawing.Size(76, 21); - this.accelTypeDrop.TabIndex = 2; - this.accelTypeDrop.Text = "Accel Type"; + this.accelTypeDropX.FormattingEnabled = true; + this.accelTypeDropX.Location = new System.Drawing.Point(105, 110); + this.accelTypeDropX.Name = "accelTypeDropX"; + this.accelTypeDropX.Size = new System.Drawing.Size(76, 21); + this.accelTypeDropX.TabIndex = 2; + this.accelTypeDropX.Text = "Accel Type"; // // sensitivityBoxX // @@ -208,22 +209,22 @@ namespace grapher this.rotationLabel.TabIndex = 6; this.rotationLabel.Text = "Rotation"; // - // accelerationBox + // accelerationBoxX // - this.accelerationBox.Location = new System.Drawing.Point(105, 137); - this.accelerationBox.Name = "accelerationBox"; - this.accelerationBox.Size = new System.Drawing.Size(76, 20); - this.accelerationBox.TabIndex = 7; + this.accelerationBoxX.Location = new System.Drawing.Point(105, 137); + this.accelerationBoxX.Name = "accelerationBoxX"; + this.accelerationBoxX.Size = new System.Drawing.Size(76, 20); + this.accelerationBoxX.TabIndex = 7; // - // constantOneLabel + // constantOneLabelX // - this.constantOneLabel.AutoSize = true; - this.constantOneLabel.Location = new System.Drawing.Point(24, 140); - this.constantOneLabel.Name = "constantOneLabel"; - this.constantOneLabel.Size = new System.Drawing.Size(66, 13); - this.constantOneLabel.TabIndex = 9; - this.constantOneLabel.Text = "Acceleration"; - this.constantOneLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.constantOneLabelX.AutoSize = true; + this.constantOneLabelX.Location = new System.Drawing.Point(24, 140); + this.constantOneLabelX.Name = "constantOneLabelX"; + this.constantOneLabelX.Size = new System.Drawing.Size(66, 13); + this.constantOneLabelX.TabIndex = 9; + this.constantOneLabelX.Text = "Acceleration"; + this.constantOneLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // capBoxX // @@ -232,90 +233,90 @@ namespace grapher this.capBoxX.Size = new System.Drawing.Size(76, 20); this.capBoxX.TabIndex = 10; // - // capLabel + // capLabelX // - this.capLabel.AutoSize = true; - this.capLabel.Location = new System.Drawing.Point(43, 166); - this.capLabel.Name = "capLabel"; - this.capLabel.Size = new System.Drawing.Size(26, 13); - this.capLabel.TabIndex = 11; - this.capLabel.Text = "Cap"; - this.capLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.capLabelX.AutoSize = true; + this.capLabelX.Location = new System.Drawing.Point(43, 166); + this.capLabelX.Name = "capLabelX"; + this.capLabelX.Size = new System.Drawing.Size(26, 13); + this.capLabelX.TabIndex = 11; + this.capLabelX.Text = "Cap"; + this.capLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // weightBoxFirst + // weightBoxX // - this.weightBoxFirst.Location = new System.Drawing.Point(105, 189); - this.weightBoxFirst.Name = "weightBoxFirst"; - this.weightBoxFirst.Size = new System.Drawing.Size(76, 20); - this.weightBoxFirst.TabIndex = 12; + this.weightBoxX.Location = new System.Drawing.Point(105, 189); + this.weightBoxX.Name = "weightBoxX"; + this.weightBoxX.Size = new System.Drawing.Size(76, 20); + this.weightBoxX.TabIndex = 12; // - // weightLabel + // weightLabelX // - this.weightLabel.AutoSize = true; - this.weightLabel.Location = new System.Drawing.Point(40, 192); - this.weightLabel.Name = "weightLabel"; - this.weightLabel.Size = new System.Drawing.Size(41, 13); - this.weightLabel.TabIndex = 13; - this.weightLabel.Text = "Weight"; - this.weightLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.weightLabelX.AutoSize = true; + this.weightLabelX.Location = new System.Drawing.Point(40, 192); + this.weightLabelX.Name = "weightLabelX"; + this.weightLabelX.Size = new System.Drawing.Size(41, 13); + this.weightLabelX.TabIndex = 13; + this.weightLabelX.Text = "Weight"; + this.weightLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // weightBoxSecond + // weightBoxY // - this.weightBoxSecond.Location = new System.Drawing.Point(267, 189); - this.weightBoxSecond.Name = "weightBoxSecond"; - this.weightBoxSecond.Size = new System.Drawing.Size(76, 20); - this.weightBoxSecond.TabIndex = 14; + this.weightBoxY.Location = new System.Drawing.Point(267, 189); + this.weightBoxY.Name = "weightBoxY"; + this.weightBoxY.Size = new System.Drawing.Size(76, 20); + this.weightBoxY.TabIndex = 14; // - // limitBox + // limitBoxX // - this.limitBox.Location = new System.Drawing.Point(105, 241); - this.limitBox.Name = "limitBox"; - this.limitBox.Size = new System.Drawing.Size(76, 20); - this.limitBox.TabIndex = 15; + this.limitBoxX.Location = new System.Drawing.Point(105, 241); + this.limitBoxX.Name = "limitBoxX"; + this.limitBoxX.Size = new System.Drawing.Size(76, 20); + this.limitBoxX.TabIndex = 15; // - // constantTwoLabel + // constantTwoLabelX // - this.constantTwoLabel.AutoSize = true; - this.constantTwoLabel.Location = new System.Drawing.Point(24, 244); - this.constantTwoLabel.Name = "constantTwoLabel"; - this.constantTwoLabel.Size = new System.Drawing.Size(78, 13); - this.constantTwoLabel.TabIndex = 16; - this.constantTwoLabel.Text = "Limit/Exponent"; - this.constantTwoLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.constantTwoLabelX.AutoSize = true; + this.constantTwoLabelX.Location = new System.Drawing.Point(24, 244); + this.constantTwoLabelX.Name = "constantTwoLabelX"; + this.constantTwoLabelX.Size = new System.Drawing.Size(78, 13); + this.constantTwoLabelX.TabIndex = 16; + this.constantTwoLabelX.Text = "Limit/Exponent"; + this.constantTwoLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // midpointBox + // midpointBoxX // - this.midpointBox.Location = new System.Drawing.Point(105, 267); - this.midpointBox.Name = "midpointBox"; - this.midpointBox.Size = new System.Drawing.Size(76, 20); - this.midpointBox.TabIndex = 17; + this.midpointBoxX.Location = new System.Drawing.Point(105, 267); + this.midpointBoxX.Name = "midpointBoxX"; + this.midpointBoxX.Size = new System.Drawing.Size(76, 20); + this.midpointBoxX.TabIndex = 17; // - // constantThreeLabel + // constantThreeLabelX // - this.constantThreeLabel.AutoSize = true; - this.constantThreeLabel.Location = new System.Drawing.Point(34, 270); - this.constantThreeLabel.Name = "constantThreeLabel"; - this.constantThreeLabel.Size = new System.Drawing.Size(47, 13); - this.constantThreeLabel.TabIndex = 18; - this.constantThreeLabel.Text = "Midpoint"; - this.constantThreeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.constantThreeLabelX.AutoSize = true; + this.constantThreeLabelX.Location = new System.Drawing.Point(34, 270); + this.constantThreeLabelX.Name = "constantThreeLabelX"; + this.constantThreeLabelX.Size = new System.Drawing.Size(47, 13); + this.constantThreeLabelX.TabIndex = 18; + this.constantThreeLabelX.Text = "Midpoint"; + this.constantThreeLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // offsetBox + // offsetBoxX // - this.offsetBox.Location = new System.Drawing.Point(105, 215); - this.offsetBox.Name = "offsetBox"; - this.offsetBox.Size = new System.Drawing.Size(76, 20); - this.offsetBox.TabIndex = 19; + this.offsetBoxX.Location = new System.Drawing.Point(105, 215); + this.offsetBoxX.Name = "offsetBoxX"; + this.offsetBoxX.Size = new System.Drawing.Size(76, 20); + this.offsetBoxX.TabIndex = 19; // - // offsetLabel + // offsetLabelX // - this.offsetLabel.AutoSize = true; - this.offsetLabel.Location = new System.Drawing.Point(43, 218); - this.offsetLabel.Name = "offsetLabel"; - this.offsetLabel.Size = new System.Drawing.Size(35, 13); - this.offsetLabel.TabIndex = 20; - this.offsetLabel.Text = "Offset"; - this.offsetLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.offsetLabelX.AutoSize = true; + this.offsetLabelX.Location = new System.Drawing.Point(43, 218); + this.offsetLabelX.Name = "offsetLabelX"; + this.offsetLabelX.Size = new System.Drawing.Size(35, 13); + this.offsetLabelX.TabIndex = 20; + this.offsetLabelX.Text = "Offset"; + this.offsetLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // writeButton // @@ -678,23 +679,23 @@ namespace grapher this.RotationActiveLabel.TabIndex = 38; this.RotationActiveLabel.Text = "0"; // - // AccelTypeActiveLabel + // AccelTypeActiveLabelX // - this.AccelTypeActiveLabel.AutoSize = true; - this.AccelTypeActiveLabel.Location = new System.Drawing.Point(360, 113); - this.AccelTypeActiveLabel.Name = "AccelTypeActiveLabel"; - this.AccelTypeActiveLabel.Size = new System.Drawing.Size(41, 13); - this.AccelTypeActiveLabel.TabIndex = 39; - this.AccelTypeActiveLabel.Text = "Default"; + this.AccelTypeActiveLabelX.AutoSize = true; + this.AccelTypeActiveLabelX.Location = new System.Drawing.Point(359, 113); + this.AccelTypeActiveLabelX.Name = "AccelTypeActiveLabelX"; + this.AccelTypeActiveLabelX.Size = new System.Drawing.Size(13, 13); + this.AccelTypeActiveLabelX.TabIndex = 39; + this.AccelTypeActiveLabelX.Text = "0"; // - // AccelerationActiveLabel + // AccelerationActiveLabelX // - this.AccelerationActiveLabel.AutoSize = true; - this.AccelerationActiveLabel.Location = new System.Drawing.Point(359, 140); - this.AccelerationActiveLabel.Name = "AccelerationActiveLabel"; - this.AccelerationActiveLabel.Size = new System.Drawing.Size(13, 13); - this.AccelerationActiveLabel.TabIndex = 40; - this.AccelerationActiveLabel.Text = "0"; + this.AccelerationActiveLabelX.AutoSize = true; + this.AccelerationActiveLabelX.Location = new System.Drawing.Point(359, 140); + this.AccelerationActiveLabelX.Name = "AccelerationActiveLabelX"; + this.AccelerationActiveLabelX.Size = new System.Drawing.Size(13, 13); + this.AccelerationActiveLabelX.TabIndex = 40; + this.AccelerationActiveLabelX.Text = "0"; // // CapActiveXLabel // @@ -732,60 +733,60 @@ namespace grapher this.CapActiveYLabel.TabIndex = 44; this.CapActiveYLabel.Text = "0"; // - // OffsetActiveLabel + // OffsetActiveXLabel // - this.OffsetActiveLabel.AutoSize = true; - this.OffsetActiveLabel.Location = new System.Drawing.Point(359, 218); - this.OffsetActiveLabel.Name = "OffsetActiveLabel"; - this.OffsetActiveLabel.Size = new System.Drawing.Size(13, 13); - this.OffsetActiveLabel.TabIndex = 45; - this.OffsetActiveLabel.Text = "0"; + this.OffsetActiveXLabel.AutoSize = true; + this.OffsetActiveXLabel.Location = new System.Drawing.Point(359, 218); + this.OffsetActiveXLabel.Name = "OffsetActiveXLabel"; + this.OffsetActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.OffsetActiveXLabel.TabIndex = 45; + this.OffsetActiveXLabel.Text = "0"; // - // LimitExpActiveLabel + // LimitExpActiveXLabel // - this.LimitExpActiveLabel.AutoSize = true; - this.LimitExpActiveLabel.Location = new System.Drawing.Point(359, 244); - this.LimitExpActiveLabel.Name = "LimitExpActiveLabel"; - this.LimitExpActiveLabel.Size = new System.Drawing.Size(13, 13); - this.LimitExpActiveLabel.TabIndex = 46; - this.LimitExpActiveLabel.Text = "0"; + this.LimitExpActiveXLabel.AutoSize = true; + this.LimitExpActiveXLabel.Location = new System.Drawing.Point(359, 244); + this.LimitExpActiveXLabel.Name = "LimitExpActiveXLabel"; + this.LimitExpActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.LimitExpActiveXLabel.TabIndex = 46; + this.LimitExpActiveXLabel.Text = "0"; // - // MidpointActiveLabel + // MidpointActiveXLabel // - this.MidpointActiveLabel.AutoSize = true; - this.MidpointActiveLabel.Location = new System.Drawing.Point(360, 270); - this.MidpointActiveLabel.Name = "MidpointActiveLabel"; - this.MidpointActiveLabel.Size = new System.Drawing.Size(13, 13); - this.MidpointActiveLabel.TabIndex = 47; - this.MidpointActiveLabel.Text = "0"; + this.MidpointActiveXLabel.AutoSize = true; + this.MidpointActiveXLabel.Location = new System.Drawing.Point(360, 270); + this.MidpointActiveXLabel.Name = "MidpointActiveXLabel"; + this.MidpointActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.MidpointActiveXLabel.TabIndex = 47; + this.MidpointActiveXLabel.Text = "0"; // - // textBox1 + // accelerationBoxY // - this.textBox1.Location = new System.Drawing.Point(267, 137); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(76, 20); - this.textBox1.TabIndex = 48; + this.accelerationBoxY.Location = new System.Drawing.Point(267, 137); + this.accelerationBoxY.Name = "accelerationBoxY"; + this.accelerationBoxY.Size = new System.Drawing.Size(76, 20); + this.accelerationBoxY.TabIndex = 48; // - // textBox2 + // offsetBoxY // - this.textBox2.Location = new System.Drawing.Point(267, 215); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(76, 20); - this.textBox2.TabIndex = 49; + this.offsetBoxY.Location = new System.Drawing.Point(267, 215); + this.offsetBoxY.Name = "offsetBoxY"; + this.offsetBoxY.Size = new System.Drawing.Size(76, 20); + this.offsetBoxY.TabIndex = 49; // - // textBox3 + // limitBoxY // - this.textBox3.Location = new System.Drawing.Point(267, 241); - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(76, 20); - this.textBox3.TabIndex = 50; + this.limitBoxY.Location = new System.Drawing.Point(267, 241); + this.limitBoxY.Name = "limitBoxY"; + this.limitBoxY.Size = new System.Drawing.Size(76, 20); + this.limitBoxY.TabIndex = 50; // - // textBox4 + // midpointBoxY // - this.textBox4.Location = new System.Drawing.Point(267, 267); - this.textBox4.Name = "textBox4"; - this.textBox4.Size = new System.Drawing.Size(76, 20); - this.textBox4.TabIndex = 51; + this.midpointBoxY.Location = new System.Drawing.Point(267, 267); + this.midpointBoxY.Name = "midpointBoxY"; + this.midpointBoxY.Size = new System.Drawing.Size(76, 20); + this.midpointBoxY.TabIndex = 51; // // accelTypeDropY // @@ -796,106 +797,106 @@ namespace grapher this.accelTypeDropY.TabIndex = 52; this.accelTypeDropY.Text = "Accel Type"; // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(403, 140); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(13, 13); - this.label1.TabIndex = 53; - this.label1.Text = "0"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(403, 218); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(13, 13); - this.label2.TabIndex = 54; - this.label2.Text = "0"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(403, 244); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(13, 13); - this.label3.TabIndex = 55; - this.label3.Text = "0"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(403, 270); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(13, 13); - this.label4.TabIndex = 56; - this.label4.Text = "0"; - // - // checkBox1 - // - this.checkBox1.AutoSize = true; - this.checkBox1.Checked = true; - this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox1.Location = new System.Drawing.Point(219, 113); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(15, 14); - this.checkBox1.TabIndex = 57; - this.checkBox1.UseVisualStyleBackColor = true; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(195, 140); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(66, 13); - this.label5.TabIndex = 58; - this.label5.Text = "Acceleration"; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(208, 166); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(26, 13); - this.label6.TabIndex = 59; - this.label6.Text = "Cap"; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(202, 192); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(41, 13); - this.label7.TabIndex = 60; - this.label7.Text = "Weight"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(208, 218); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(35, 13); - this.label8.TabIndex = 61; - this.label8.Text = "Offset"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(196, 244); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(51, 13); - this.label9.TabIndex = 62; - this.label9.Text = "Limit/Exp"; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(200, 270); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(47, 13); - this.label10.TabIndex = 63; - this.label10.Text = "Midpoint"; + // AccelerationActiveLabelY + // + this.AccelerationActiveLabelY.AutoSize = true; + this.AccelerationActiveLabelY.Location = new System.Drawing.Point(403, 140); + this.AccelerationActiveLabelY.Name = "AccelerationActiveLabelY"; + this.AccelerationActiveLabelY.Size = new System.Drawing.Size(13, 13); + this.AccelerationActiveLabelY.TabIndex = 53; + this.AccelerationActiveLabelY.Text = "0"; + // + // OffsetActiveYLabel + // + this.OffsetActiveYLabel.AutoSize = true; + this.OffsetActiveYLabel.Location = new System.Drawing.Point(403, 218); + this.OffsetActiveYLabel.Name = "OffsetActiveYLabel"; + this.OffsetActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.OffsetActiveYLabel.TabIndex = 54; + this.OffsetActiveYLabel.Text = "0"; + // + // LimitExpActiveYLabel + // + this.LimitExpActiveYLabel.AutoSize = true; + this.LimitExpActiveYLabel.Location = new System.Drawing.Point(403, 244); + this.LimitExpActiveYLabel.Name = "LimitExpActiveYLabel"; + this.LimitExpActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.LimitExpActiveYLabel.TabIndex = 55; + this.LimitExpActiveYLabel.Text = "0"; + // + // MidpointActiveYLabel + // + this.MidpointActiveYLabel.AutoSize = true; + this.MidpointActiveYLabel.Location = new System.Drawing.Point(403, 270); + this.MidpointActiveYLabel.Name = "MidpointActiveYLabel"; + this.MidpointActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.MidpointActiveYLabel.TabIndex = 56; + this.MidpointActiveYLabel.Text = "0"; + // + // ByComponentXYLock + // + this.ByComponentXYLock.AutoSize = true; + this.ByComponentXYLock.Checked = true; + this.ByComponentXYLock.CheckState = System.Windows.Forms.CheckState.Checked; + this.ByComponentXYLock.Location = new System.Drawing.Point(219, 113); + this.ByComponentXYLock.Name = "ByComponentXYLock"; + this.ByComponentXYLock.Size = new System.Drawing.Size(15, 14); + this.ByComponentXYLock.TabIndex = 57; + this.ByComponentXYLock.UseVisualStyleBackColor = true; + // + // constantOneLabelY + // + this.constantOneLabelY.AutoSize = true; + this.constantOneLabelY.Location = new System.Drawing.Point(195, 140); + this.constantOneLabelY.Name = "constantOneLabelY"; + this.constantOneLabelY.Size = new System.Drawing.Size(66, 13); + this.constantOneLabelY.TabIndex = 58; + this.constantOneLabelY.Text = "Acceleration"; + // + // capLabelY + // + this.capLabelY.AutoSize = true; + this.capLabelY.Location = new System.Drawing.Point(208, 166); + this.capLabelY.Name = "capLabelY"; + this.capLabelY.Size = new System.Drawing.Size(26, 13); + this.capLabelY.TabIndex = 59; + this.capLabelY.Text = "Cap"; + // + // weightLabelY + // + this.weightLabelY.AutoSize = true; + this.weightLabelY.Location = new System.Drawing.Point(202, 192); + this.weightLabelY.Name = "weightLabelY"; + this.weightLabelY.Size = new System.Drawing.Size(41, 13); + this.weightLabelY.TabIndex = 60; + this.weightLabelY.Text = "Weight"; + // + // offsetLabelY + // + this.offsetLabelY.AutoSize = true; + this.offsetLabelY.Location = new System.Drawing.Point(208, 218); + this.offsetLabelY.Name = "offsetLabelY"; + this.offsetLabelY.Size = new System.Drawing.Size(35, 13); + this.offsetLabelY.TabIndex = 61; + this.offsetLabelY.Text = "Offset"; + // + // constantTwoLabelY + // + this.constantTwoLabelY.AutoSize = true; + this.constantTwoLabelY.Location = new System.Drawing.Point(196, 244); + this.constantTwoLabelY.Name = "constantTwoLabelY"; + this.constantTwoLabelY.Size = new System.Drawing.Size(51, 13); + this.constantTwoLabelY.TabIndex = 62; + this.constantTwoLabelY.Text = "Limit/Exp"; + // + // constantThreeLabelY + // + this.constantThreeLabelY.AutoSize = true; + this.constantThreeLabelY.Location = new System.Drawing.Point(200, 270); + this.constantThreeLabelY.Name = "constantThreeLabelY"; + this.constantThreeLabelY.Size = new System.Drawing.Size(47, 13); + this.constantThreeLabelY.TabIndex = 63; + this.constantThreeLabelY.Text = "Midpoint"; // // OptionSetXTitle // @@ -915,38 +916,48 @@ namespace grapher this.OptionSetYTitle.TabIndex = 65; this.OptionSetYTitle.Text = "Y"; // + // AccelTypeActiveLabelY + // + this.AccelTypeActiveLabelY.AutoSize = true; + this.AccelTypeActiveLabelY.Location = new System.Drawing.Point(403, 113); + this.AccelTypeActiveLabelY.Name = "AccelTypeActiveLabelY"; + this.AccelTypeActiveLabelY.Size = new System.Drawing.Size(13, 13); + this.AccelTypeActiveLabelY.TabIndex = 66; + this.AccelTypeActiveLabelY.Text = "0"; + // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1884, 956); + this.Controls.Add(this.AccelTypeActiveLabelY); this.Controls.Add(this.OptionSetYTitle); this.Controls.Add(this.OptionSetXTitle); - this.Controls.Add(this.label10); - this.Controls.Add(this.label9); - this.Controls.Add(this.label8); - this.Controls.Add(this.label7); - this.Controls.Add(this.label6); - this.Controls.Add(this.label5); - this.Controls.Add(this.checkBox1); - this.Controls.Add(this.label4); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); + this.Controls.Add(this.constantThreeLabelY); + this.Controls.Add(this.constantTwoLabelY); + this.Controls.Add(this.offsetLabelY); + this.Controls.Add(this.weightLabelY); + this.Controls.Add(this.capLabelY); + this.Controls.Add(this.constantOneLabelY); + this.Controls.Add(this.ByComponentXYLock); + this.Controls.Add(this.MidpointActiveYLabel); + this.Controls.Add(this.LimitExpActiveYLabel); + this.Controls.Add(this.OffsetActiveYLabel); + this.Controls.Add(this.AccelerationActiveLabelY); this.Controls.Add(this.accelTypeDropY); - this.Controls.Add(this.textBox4); - this.Controls.Add(this.textBox3); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.MidpointActiveLabel); - this.Controls.Add(this.LimitExpActiveLabel); - this.Controls.Add(this.OffsetActiveLabel); + this.Controls.Add(this.midpointBoxY); + this.Controls.Add(this.limitBoxY); + this.Controls.Add(this.offsetBoxY); + this.Controls.Add(this.accelerationBoxY); + this.Controls.Add(this.MidpointActiveXLabel); + this.Controls.Add(this.LimitExpActiveXLabel); + this.Controls.Add(this.OffsetActiveXLabel); this.Controls.Add(this.CapActiveYLabel); this.Controls.Add(this.WeightActiveYLabel); this.Controls.Add(this.WeightActiveXLabel); this.Controls.Add(this.CapActiveXLabel); - this.Controls.Add(this.AccelerationActiveLabel); - this.Controls.Add(this.AccelTypeActiveLabel); + this.Controls.Add(this.AccelerationActiveLabelX); + this.Controls.Add(this.AccelTypeActiveLabelX); this.Controls.Add(this.RotationActiveLabel); this.Controls.Add(this.SensitivityActiveYLabel); this.Controls.Add(this.SensitivityActiveXLabel); @@ -962,24 +973,24 @@ namespace grapher this.Controls.Add(this.capBoxY); this.Controls.Add(this.sensitivityBoxY); this.Controls.Add(this.writeButton); - this.Controls.Add(this.offsetLabel); - this.Controls.Add(this.offsetBox); - this.Controls.Add(this.constantThreeLabel); - this.Controls.Add(this.midpointBox); - this.Controls.Add(this.constantTwoLabel); - this.Controls.Add(this.limitBox); - this.Controls.Add(this.weightBoxSecond); - this.Controls.Add(this.weightLabel); - this.Controls.Add(this.weightBoxFirst); - this.Controls.Add(this.capLabel); + this.Controls.Add(this.offsetLabelX); + this.Controls.Add(this.offsetBoxX); + this.Controls.Add(this.constantThreeLabelX); + this.Controls.Add(this.midpointBoxX); + this.Controls.Add(this.constantTwoLabelX); + this.Controls.Add(this.limitBoxX); + this.Controls.Add(this.weightBoxY); + this.Controls.Add(this.weightLabelX); + this.Controls.Add(this.weightBoxX); + this.Controls.Add(this.capLabelX); this.Controls.Add(this.capBoxX); - this.Controls.Add(this.constantOneLabel); - this.Controls.Add(this.accelerationBox); + this.Controls.Add(this.constantOneLabelX); + this.Controls.Add(this.accelerationBoxX); this.Controls.Add(this.rotationLabel); this.Controls.Add(this.rotationBox); this.Controls.Add(this.sensitivityLabel); this.Controls.Add(this.sensitivityBoxX); - this.Controls.Add(this.accelTypeDrop); + this.Controls.Add(this.accelTypeDropX); this.Controls.Add(this.AccelerationChart); this.Controls.Add(this.menuStrip1); this.Name = "RawAcceleration"; @@ -1002,24 +1013,24 @@ namespace grapher #endregion private System.Windows.Forms.DataVisualization.Charting.Chart AccelerationChart; - private System.Windows.Forms.ComboBox accelTypeDrop; + private System.Windows.Forms.ComboBox accelTypeDropX; private System.Windows.Forms.TextBox sensitivityBoxX; private System.Windows.Forms.Label sensitivityLabel; private System.Windows.Forms.TextBox rotationBox; private System.Windows.Forms.Label rotationLabel; - private System.Windows.Forms.TextBox accelerationBox; - private System.Windows.Forms.Label constantOneLabel; + private System.Windows.Forms.TextBox accelerationBoxX; + private System.Windows.Forms.Label constantOneLabelX; private System.Windows.Forms.TextBox capBoxX; - private System.Windows.Forms.Label capLabel; - private System.Windows.Forms.TextBox weightBoxFirst; - private System.Windows.Forms.Label weightLabel; - private System.Windows.Forms.TextBox weightBoxSecond; - private System.Windows.Forms.TextBox limitBox; - private System.Windows.Forms.Label constantTwoLabel; - private System.Windows.Forms.TextBox midpointBox; - private System.Windows.Forms.Label constantThreeLabel; - private System.Windows.Forms.TextBox offsetBox; - private System.Windows.Forms.Label offsetLabel; + private System.Windows.Forms.Label capLabelX; + private System.Windows.Forms.TextBox weightBoxX; + private System.Windows.Forms.Label weightLabelX; + private System.Windows.Forms.TextBox weightBoxY; + private System.Windows.Forms.TextBox limitBoxX; + private System.Windows.Forms.Label constantTwoLabelX; + private System.Windows.Forms.TextBox midpointBoxX; + private System.Windows.Forms.Label constantThreeLabelX; + private System.Windows.Forms.TextBox offsetBoxX; + private System.Windows.Forms.Label offsetLabelX; private System.Windows.Forms.Button writeButton; private System.Windows.Forms.TextBox sensitivityBoxY; private System.Windows.Forms.TextBox capBoxY; @@ -1048,38 +1059,39 @@ namespace grapher private System.Windows.Forms.Label SensitivityActiveXLabel; private System.Windows.Forms.Label SensitivityActiveYLabel; private System.Windows.Forms.Label RotationActiveLabel; - private System.Windows.Forms.Label AccelTypeActiveLabel; - private System.Windows.Forms.Label AccelerationActiveLabel; + private System.Windows.Forms.Label AccelTypeActiveLabelX; + private System.Windows.Forms.Label AccelerationActiveLabelX; private System.Windows.Forms.Label CapActiveXLabel; private System.Windows.Forms.Label WeightActiveXLabel; private System.Windows.Forms.Label WeightActiveYLabel; private System.Windows.Forms.Label CapActiveYLabel; - private System.Windows.Forms.Label OffsetActiveLabel; - private System.Windows.Forms.Label LimitExpActiveLabel; - private System.Windows.Forms.Label MidpointActiveLabel; + private System.Windows.Forms.Label OffsetActiveXLabel; + private System.Windows.Forms.Label LimitExpActiveXLabel; + private System.Windows.Forms.Label MidpointActiveXLabel; private System.Windows.Forms.ToolStripMenuItem startupToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem AutoWriteMenuItem; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem wholeVectorToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem byVectorComponentToolStripMenuItem; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.TextBox textBox3; - private System.Windows.Forms.TextBox textBox4; + private System.Windows.Forms.TextBox accelerationBoxY; + private System.Windows.Forms.TextBox offsetBoxY; + private System.Windows.Forms.TextBox limitBoxY; + private System.Windows.Forms.TextBox midpointBoxY; private System.Windows.Forms.ComboBox accelTypeDropY; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.CheckBox checkBox1; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label AccelerationActiveLabelY; + private System.Windows.Forms.Label OffsetActiveYLabel; + private System.Windows.Forms.Label LimitExpActiveYLabel; + private System.Windows.Forms.Label MidpointActiveYLabel; + private System.Windows.Forms.CheckBox ByComponentXYLock; + private System.Windows.Forms.Label constantOneLabelY; + private System.Windows.Forms.Label capLabelY; + private System.Windows.Forms.Label weightLabelY; + private System.Windows.Forms.Label offsetLabelY; + private System.Windows.Forms.Label constantTwoLabelY; + private System.Windows.Forms.Label constantThreeLabelY; private System.Windows.Forms.Label OptionSetXTitle; private System.Windows.Forms.Label OptionSetYTitle; + private System.Windows.Forms.Label AccelTypeActiveLabelY; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 0b1b76c..5df97a3 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -51,7 +51,8 @@ namespace grapher VelocityChartY, GainChart, GainChartY, - accelTypeDrop, + accelTypeDropX, + accelTypeDropY, writeButton, showVelocityGainToolStripMenuItem, wholeVectorToolStripMenuItem, @@ -65,23 +66,33 @@ namespace grapher sensitivityBoxX, sensitivityBoxY, rotationBox, - weightBoxFirst, - weightBoxSecond, + weightBoxX, + weightBoxY, capBoxX, capBoxY, - offsetBox, - accelerationBox, - limitBox, - midpointBox, + offsetBoxX, + offsetBoxY, + accelerationBoxX, + accelerationBoxY, + limitBoxX, + limitBoxY, + midpointBoxX, + midpointBoxY, sensXYLock, sensitivityLabel, rotationLabel, - weightLabel, - capLabel, - offsetLabel, - constantOneLabel, - constantTwoLabel, - constantThreeLabel, + weightLabelX, + weightLabelY, + capLabelX, + capLabelY, + offsetLabelX, + offsetLabelY, + constantOneLabelX, + constantOneLabelY, + constantTwoLabelX, + constantTwoLabelY, + constantThreeLabelX, + constantThreeLabelY, ActiveValueTitle, SensitivityActiveXLabel, SensitivityActiveYLabel, @@ -90,11 +101,18 @@ namespace grapher WeightActiveYLabel, CapActiveXLabel, CapActiveYLabel, - OffsetActiveLabel, - AccelerationActiveLabel, - LimitExpActiveLabel, - MidpointActiveLabel, - AccelTypeActiveLabel, + OffsetActiveXLabel, + OffsetActiveYLabel, + AccelerationActiveLabelX, + AccelerationActiveLabelY, + LimitExpActiveXLabel, + LimitExpActiveYLabel, + MidpointActiveXLabel, + MidpointActiveYLabel, + AccelTypeActiveLabelX, + AccelTypeActiveLabelY, + OptionSetXTitle, + OptionSetYTitle, MouseLabel); } diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs index 05f6c82..f7766f0 100644 --- a/grapher/Layouts/ClassicLayout.cs +++ b/grapher/Layouts/ClassicLayout.cs @@ -14,8 +14,8 @@ namespace grapher.Layouts { Name = "Classic"; Index = (int)AccelMode.classic; - ShowOptions = new bool[] { true, true, true, false }; - OptionNames = new string[] { Offset, Acceleration, Exponent, string.Empty }; + ShowOptions = new bool[] { true, true, true, false, true, true }; + OptionNames = new string[] { Offset, Acceleration, Exponent, string.Empty, Cap, Weight }; } } } diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index 42841d5..cb1994f 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -16,8 +16,8 @@ namespace grapher.Layouts { Name = "Default"; Index = (int)AccelMode.noaccel; - ShowOptions = new bool[] { true, true, true, true }; - OptionNames = new string[] { Offset, Acceleration, $"{Limit}\\{Exponent}", Midpoint }; + ShowOptions = new bool[] { true, true, true, true, true }; + OptionNames = new string[] { Offset, Acceleration, $"{Limit}\\{Exponent}", Midpoint, Cap, Weight }; ButtonEnabled = false; } } diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 0ad855a..daac6f1 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -15,12 +15,14 @@ namespace grapher.Layouts public const string Limit = "Limit"; public const string Midpoint = "Midpoint"; public const string Offset = "Offset"; + public const string Cap = "Cap"; + public const string Weight = "Weight"; public LayoutBase() { - ShowOptions = new bool[] { false, false, false, false }; + ShowOptions = new bool[] { false, false, false, false, true, true }; ShowOptionsXY = new bool[] { true, true }; - OptionNames = new string[] { string.Empty, string.Empty, string.Empty, string.Empty }; + OptionNames = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; ButtonEnabled = true; } diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index 0a79a64..8b1d444 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -14,8 +14,8 @@ namespace grapher.Layouts { Name = "Linear"; Index = (int)AccelMode.linear; - ShowOptions = new bool[] { true, true, false, false }; - OptionNames = new string[] { Offset, Acceleration, string.Empty, string.Empty }; + ShowOptions = new bool[] { true, true, false, false, true, true }; + OptionNames = new string[] { Offset, Acceleration, string.Empty, string.Empty, Cap, Weight }; } } } diff --git a/grapher/Layouts/LogLayout.cs b/grapher/Layouts/LogLayout.cs index 1206fb3..4b73683 100644 --- a/grapher/Layouts/LogLayout.cs +++ b/grapher/Layouts/LogLayout.cs @@ -14,8 +14,8 @@ namespace grapher.Layouts { Name = "Logarithmic"; Index = (int)AccelMode.logarithmic; - ShowOptions = new bool[] { true, true, false, false }; - OptionNames = new string[] { Offset, Acceleration, string.Empty, string.Empty }; + ShowOptions = new bool[] { true, true, false, false, true, true }; + OptionNames = new string[] { Offset, Acceleration, string.Empty, string.Empty, Cap, Weight }; } } } diff --git a/grapher/Layouts/NaturalGainLayout.cs b/grapher/Layouts/NaturalGainLayout.cs index 9bb1ec8..0f9caf0 100644 --- a/grapher/Layouts/NaturalGainLayout.cs +++ b/grapher/Layouts/NaturalGainLayout.cs @@ -14,8 +14,8 @@ namespace grapher.Layouts { Name = "NaturalGain"; Index = (int)AccelMode.naturalgain; - ShowOptions = new bool[] { true, true, true, false }; - OptionNames = new string[] { Offset, Acceleration, Limit, string.Empty }; + ShowOptions = new bool[] { true, true, true, false, false, true }; + OptionNames = new string[] { Offset, Acceleration, Limit, string.Empty, string.Empty, Weight}; } } } diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index 44c6c18..a6da67d 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -14,7 +14,7 @@ namespace grapher.Layouts { Name = "Natural"; Index = (int)AccelMode.natural; - ShowOptions = new bool[] { true, true, true, false }; + ShowOptions = new bool[] { true, true, true, false, false, true }; OptionNames = new string[] { Offset, Acceleration, Limit, string.Empty }; } } diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index ce7c149..1c37026 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -14,9 +14,8 @@ namespace grapher.Layouts { Name = "Off"; Index = (int)AccelMode.noaccel; - ShowOptions = new bool[] { false, false, false, false }; - OptionNames = new string[] { string.Empty, string.Empty, string.Empty, string.Empty }; - ShowOptionsXY = new bool[] { false, false }; + ShowOptions = new bool[] { false, false, false, false, false, false }; + OptionNames = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; ButtonEnabled = true; } } diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index c14083a..699536f 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -14,8 +14,8 @@ namespace grapher.Layouts { Name = "Power"; Index = (int)AccelMode.power; - ShowOptions = new bool[] { true, true, true, false }; - OptionNames = new string[] { Offset, Scale, Exponent, string.Empty }; + ShowOptions = new bool[] { true, true, true, false, true, true }; + OptionNames = new string[] { Offset, Scale, Exponent, string.Empty, Cap, Weight }; } } } diff --git a/grapher/Layouts/SigmoidGainLayout.cs b/grapher/Layouts/SigmoidGainLayout.cs index 93214ec..3897477 100644 --- a/grapher/Layouts/SigmoidGainLayout.cs +++ b/grapher/Layouts/SigmoidGainLayout.cs @@ -14,8 +14,8 @@ namespace grapher.Layouts { Name = "SigmoidGain"; Index = (int)AccelMode.sigmoidgain; - ShowOptions = new bool[] { true, true, true, true }; - OptionNames = new string[] { Offset, Acceleration, Limit, Midpoint }; + ShowOptions = new bool[] { true, true, true, true, false, true }; + OptionNames = new string[] { Offset, Acceleration, Limit, Midpoint, string.Empty, Weight }; } } } diff --git a/grapher/Layouts/SigmoidLayout.cs b/grapher/Layouts/SigmoidLayout.cs index 1c7f0b9..e5e35cd 100644 --- a/grapher/Layouts/SigmoidLayout.cs +++ b/grapher/Layouts/SigmoidLayout.cs @@ -14,8 +14,8 @@ namespace grapher.Layouts { Name = "Sigmoid"; Index = (int)AccelMode.sigmoid; - ShowOptions = new bool[] { true, true, true, true }; - OptionNames = new string[] { Offset, Acceleration, Limit, Midpoint }; + ShowOptions = new bool[] { true, true, true, true, false, true }; + OptionNames = new string[] { Offset, Acceleration, Limit, Midpoint, string.Empty, Weight }; } } } diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 5ea3595..891cd01 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -42,6 +42,8 @@ namespace grapher WriteButton = writeButton; ScaleMenuItem = scaleMenuItem; Settings = settings; + OptionSetX = optionSetX; + OptionSetY = optionSetY; Settings.Startup(); RefreshOnRead(); diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index e4637ec..a75207b 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -52,8 +52,6 @@ namespace grapher.Models TextBox midpointBoxX, TextBox midpointBoxY, CheckBox sensXYLock, - CheckBox weightXYLock, - CheckBox capXYLock, Label sensitivityLabel, Label rotationLabel, Label weightLabelX, @@ -84,7 +82,8 @@ namespace grapher.Models Label limitExpActiveLabelY, Label midpointActiveLabelX, Label midpointActiveLabelY, - Label accelTypeActiveLabel, + Label accelTypeActiveLabelX, + Label accelTypeActiveLabelY, Label optionSetXTitle, Label optionSetYTitle, Label mouseLabel) @@ -209,7 +208,7 @@ namespace grapher.Models weightX }, writeButton, - new ActiveValueLabel(accelTypeActiveLabel, activeValueTitle)); + new ActiveValueLabel(accelTypeActiveLabelX, activeValueTitle)); var accelerationOptionsY = new AccelTypeOptions( accelTypeDropY, @@ -223,7 +222,7 @@ namespace grapher.Models weightY }, writeButton, - new ActiveValueLabel(accelTypeActiveLabel, activeValueTitle)); + new ActiveValueLabel(accelTypeActiveLabelY, activeValueTitle)); var capOptionsX = new CapOptions( sensitivityToolStripMenuItem, diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index 6768a85..713842c 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -76,6 +76,27 @@ namespace grapher } } + public int Top + { + get + { + return CapOption.Top; + } + set + { + CapOption.Top = value; + } + } + + public int Height + { + get + { + return CapOption.Height; + } + } + + #endregion Properties #region Methods @@ -90,6 +111,12 @@ namespace grapher CapOption.Show(); } + public void SnapTo(Option option) + { + Top = option.Top + option.Height + Constants.OptionVerticalSeperation; + } + + public void SetActiveValues(double gainCap, double sensCap, bool capGainEnabled) { if (capGainEnabled) diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index bd2c9a1..2006dec 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -150,6 +150,11 @@ namespace grapher Top = option.Top + option.Height + Constants.OptionVerticalSeperation; } + public void SnapTo(CapOptions option) + { + Top = option.Top + option.Height + Constants.OptionVerticalSeperation; + } + #endregion Methods } } -- cgit v1.2.3 From bf747ca2439a371ef74e21a49c1e8bc880d4d3e2 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 23:36:52 -0700 Subject: Small fixes, correctly align labels and boxes --- grapher/Form1.Designer.cs | 254 +++++++++++++++---------------- grapher/Layouts/NaturalLayout.cs | 2 +- grapher/Models/AccelGUIFactory.cs | 31 +++- grapher/Models/Options/AccelOptionSet.cs | 4 +- grapher/Models/Options/Option.cs | 18 ++- 5 files changed, 168 insertions(+), 141 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 22ae1b8..af60be1 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -30,30 +30,30 @@ namespace grapher /// private void InitializeComponent() { - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea7 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend7 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series13 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series14 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea8 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend8 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series15 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series16 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea9 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend9 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series17 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series18 = 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 series19 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series20 = 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 series21 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series22 = 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 series23 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series24 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea13 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend13 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series25 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series26 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea14 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend14 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series27 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series28 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea15 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend15 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series29 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series30 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea16 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend16 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series31 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series32 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea17 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend17 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series33 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series34 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea18 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend18 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series35 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Series series36 = new System.Windows.Forms.DataVisualization.Charting.Series(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.accelTypeDropX = new System.Windows.Forms.ComboBox(); this.sensitivityBoxX = new System.Windows.Forms.TextBox(); @@ -145,25 +145,25 @@ namespace grapher // // AccelerationChart // - chartArea7.AxisX.Title = "Speed (counts/ms)"; - chartArea7.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea7.Name = "ChartArea1"; - this.AccelerationChart.ChartAreas.Add(chartArea7); - legend7.Name = "Legend1"; - this.AccelerationChart.Legends.Add(legend7); + chartArea13.AxisX.Title = "Speed (counts/ms)"; + chartArea13.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea13.Name = "ChartArea1"; + this.AccelerationChart.ChartAreas.Add(chartArea13); + legend13.Name = "Legend1"; + this.AccelerationChart.Legends.Add(legend13); this.AccelerationChart.Location = new System.Drawing.Point(432, 0); this.AccelerationChart.Name = "AccelerationChart"; - series13.ChartArea = "ChartArea1"; - series13.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series13.Legend = "Legend1"; - series13.Name = "Accelerated Sensitivity"; - series14.ChartArea = "ChartArea1"; - series14.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series14.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series14.Legend = "Legend1"; - series14.Name = "LastAccelVal"; - this.AccelerationChart.Series.Add(series13); - this.AccelerationChart.Series.Add(series14); + series25.ChartArea = "ChartArea1"; + series25.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series25.Legend = "Legend1"; + series25.Name = "Accelerated Sensitivity"; + series26.ChartArea = "ChartArea1"; + series26.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series26.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series26.Legend = "Legend1"; + series26.Name = "LastAccelVal"; + this.AccelerationChart.Series.Add(series25); + this.AccelerationChart.Series.Add(series26); this.AccelerationChart.Size = new System.Drawing.Size(723, 328); this.AccelerationChart.TabIndex = 0; this.AccelerationChart.Text = "Sensitivity"; @@ -258,7 +258,7 @@ namespace grapher this.weightLabelX.Size = new System.Drawing.Size(41, 13); this.weightLabelX.TabIndex = 13; this.weightLabelX.Text = "Weight"; - this.weightLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.weightLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // weightBoxY // @@ -364,50 +364,50 @@ namespace grapher // // VelocityChart // - chartArea8.AxisX.Title = "Speed (count/ms)"; - chartArea8.AxisY.Title = "Output Speed (counts/ms)"; - chartArea8.Name = "ChartArea1"; - this.VelocityChart.ChartAreas.Add(chartArea8); - legend8.Name = "Legend1"; - this.VelocityChart.Legends.Add(legend8); + chartArea14.AxisX.Title = "Speed (count/ms)"; + chartArea14.AxisY.Title = "Output Speed (counts/ms)"; + chartArea14.Name = "ChartArea1"; + this.VelocityChart.ChartAreas.Add(chartArea14); + legend14.Name = "Legend1"; + this.VelocityChart.Legends.Add(legend14); this.VelocityChart.Location = new System.Drawing.Point(432, 334); this.VelocityChart.Name = "VelocityChart"; - series15.ChartArea = "ChartArea1"; - series15.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series15.Legend = "Legend1"; - series15.Name = "Mouse Velocity"; - series16.ChartArea = "ChartArea1"; - series16.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series16.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series16.Legend = "Legend1"; - series16.Name = "LastVelocityVal"; - this.VelocityChart.Series.Add(series15); - this.VelocityChart.Series.Add(series16); + series27.ChartArea = "ChartArea1"; + series27.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series27.Legend = "Legend1"; + series27.Name = "Mouse Velocity"; + series28.ChartArea = "ChartArea1"; + series28.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series28.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series28.Legend = "Legend1"; + series28.Name = "LastVelocityVal"; + this.VelocityChart.Series.Add(series27); + this.VelocityChart.Series.Add(series28); this.VelocityChart.Size = new System.Drawing.Size(723, 307); this.VelocityChart.TabIndex = 28; this.VelocityChart.Text = "chart1"; // // GainChart // - chartArea9.AxisX.Title = "Speed (counts/ms)"; - chartArea9.AxisY.Title = "Slope of Velocity Chart"; - chartArea9.Name = "ChartArea1"; - this.GainChart.ChartAreas.Add(chartArea9); - legend9.Name = "Legend1"; - this.GainChart.Legends.Add(legend9); + chartArea15.AxisX.Title = "Speed (counts/ms)"; + chartArea15.AxisY.Title = "Slope of Velocity Chart"; + chartArea15.Name = "ChartArea1"; + this.GainChart.ChartAreas.Add(chartArea15); + legend15.Name = "Legend1"; + this.GainChart.Legends.Add(legend15); this.GainChart.Location = new System.Drawing.Point(432, 647); this.GainChart.Name = "GainChart"; - series17.ChartArea = "ChartArea1"; - series17.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series17.Legend = "Legend1"; - series17.Name = "Velocity Gain"; - series18.ChartArea = "ChartArea1"; - series18.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series18.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series18.Legend = "Legend1"; - series18.Name = "LastGainVal"; - this.GainChart.Series.Add(series17); - this.GainChart.Series.Add(series18); + series29.ChartArea = "ChartArea1"; + series29.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series29.Legend = "Legend1"; + series29.Name = "Velocity Gain"; + series30.ChartArea = "ChartArea1"; + series30.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series30.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series30.Legend = "Legend1"; + series30.Name = "LastGainVal"; + this.GainChart.Series.Add(series29); + this.GainChart.Series.Add(series30); this.GainChart.Size = new System.Drawing.Size(723, 309); this.GainChart.TabIndex = 29; this.GainChart.Text = "chart1"; @@ -561,75 +561,75 @@ namespace grapher // // AccelerationChartY // - chartArea10.AxisX.Title = "Speed (counts/ms)"; - chartArea10.AxisY.Title = "Sensitivity (magnitude ratio)"; - chartArea10.Name = "ChartArea1"; - this.AccelerationChartY.ChartAreas.Add(chartArea10); - legend10.Name = "Legend1"; - this.AccelerationChartY.Legends.Add(legend10); + chartArea16.AxisX.Title = "Speed (counts/ms)"; + chartArea16.AxisY.Title = "Sensitivity (magnitude ratio)"; + chartArea16.Name = "ChartArea1"; + this.AccelerationChartY.ChartAreas.Add(chartArea16); + legend16.Name = "Legend1"; + this.AccelerationChartY.Legends.Add(legend16); this.AccelerationChartY.Location = new System.Drawing.Point(1161, 0); this.AccelerationChartY.Name = "AccelerationChartY"; - series19.ChartArea = "ChartArea1"; - series19.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series19.Legend = "Legend1"; - series19.Name = "Accelerated Sensitivity"; - series20.ChartArea = "ChartArea1"; - series20.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series20.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series20.Legend = "Legend1"; - series20.Name = "LastAccelVal"; - this.AccelerationChartY.Series.Add(series19); - this.AccelerationChartY.Series.Add(series20); + series31.ChartArea = "ChartArea1"; + series31.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series31.Legend = "Legend1"; + series31.Name = "Accelerated Sensitivity"; + series32.ChartArea = "ChartArea1"; + series32.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series32.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series32.Legend = "Legend1"; + series32.Name = "LastAccelVal"; + this.AccelerationChartY.Series.Add(series31); + this.AccelerationChartY.Series.Add(series32); this.AccelerationChartY.Size = new System.Drawing.Size(723, 328); this.AccelerationChartY.TabIndex = 31; this.AccelerationChartY.Text = "chart1"; // // VelocityChartY // - chartArea11.AxisX.Title = "Speed (count/ms)"; - chartArea11.AxisY.Title = "Output Speed (counts/ms)"; - chartArea11.Name = "ChartArea1"; - this.VelocityChartY.ChartAreas.Add(chartArea11); - legend11.Name = "Legend1"; - this.VelocityChartY.Legends.Add(legend11); + chartArea17.AxisX.Title = "Speed (count/ms)"; + chartArea17.AxisY.Title = "Output Speed (counts/ms)"; + chartArea17.Name = "ChartArea1"; + this.VelocityChartY.ChartAreas.Add(chartArea17); + legend17.Name = "Legend1"; + this.VelocityChartY.Legends.Add(legend17); this.VelocityChartY.Location = new System.Drawing.Point(1161, 334); this.VelocityChartY.Name = "VelocityChartY"; - series21.ChartArea = "ChartArea1"; - series21.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series21.Legend = "Legend1"; - series21.Name = "Mouse Velocity"; - series22.ChartArea = "ChartArea1"; - series22.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series22.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series22.Legend = "Legend1"; - series22.Name = "LastVelocityVal"; - this.VelocityChartY.Series.Add(series21); - this.VelocityChartY.Series.Add(series22); + series33.ChartArea = "ChartArea1"; + series33.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series33.Legend = "Legend1"; + series33.Name = "Mouse Velocity"; + series34.ChartArea = "ChartArea1"; + series34.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series34.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series34.Legend = "Legend1"; + series34.Name = "LastVelocityVal"; + this.VelocityChartY.Series.Add(series33); + this.VelocityChartY.Series.Add(series34); this.VelocityChartY.Size = new System.Drawing.Size(723, 307); this.VelocityChartY.TabIndex = 32; this.VelocityChartY.Text = "chart1"; // // GainChartY // - chartArea12.AxisX.Title = "Speed (counts/ms)"; - chartArea12.AxisY.Title = "Slope of Velocity Chart"; - chartArea12.Name = "ChartArea1"; - this.GainChartY.ChartAreas.Add(chartArea12); - legend12.Name = "Legend1"; - this.GainChartY.Legends.Add(legend12); + chartArea18.AxisX.Title = "Speed (counts/ms)"; + chartArea18.AxisY.Title = "Slope of Velocity Chart"; + chartArea18.Name = "ChartArea1"; + this.GainChartY.ChartAreas.Add(chartArea18); + legend18.Name = "Legend1"; + this.GainChartY.Legends.Add(legend18); this.GainChartY.Location = new System.Drawing.Point(1161, 647); this.GainChartY.Name = "GainChartY"; - series23.ChartArea = "ChartArea1"; - series23.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series23.Legend = "Legend1"; - series23.Name = "Velocity Gain"; - series24.ChartArea = "ChartArea1"; - series24.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; - series24.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - series24.Legend = "Legend1"; - series24.Name = "LastGainVal"; - this.GainChartY.Series.Add(series23); - this.GainChartY.Series.Add(series24); + series35.ChartArea = "ChartArea1"; + series35.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + series35.Legend = "Legend1"; + series35.Name = "Velocity Gain"; + series36.ChartArea = "ChartArea1"; + series36.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; + series36.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + series36.Legend = "Legend1"; + series36.Name = "LastGainVal"; + this.GainChartY.Series.Add(series35); + this.GainChartY.Series.Add(series36); this.GainChartY.Size = new System.Drawing.Size(723, 309); this.GainChartY.TabIndex = 33; this.GainChartY.Text = "chart1"; diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index a6da67d..caa77bd 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -15,7 +15,7 @@ namespace grapher.Layouts Name = "Natural"; Index = (int)AccelMode.natural; ShowOptions = new bool[] { true, true, true, false, false, true }; - OptionNames = new string[] { Offset, Acceleration, Limit, string.Empty }; + OptionNames = new string[] { Offset, Acceleration, Limit, string.Empty, string.Empty, Weight }; } } } diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index a75207b..3c2a773 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -114,14 +114,18 @@ namespace grapher.Models form, 0, rotationLabel, + 0, new ActiveValueLabel(rotationActiveLabel, activeValueTitle), "Rotation"); + var optionSetYLeft = rotation.Left + rotation.Width; + var weightX = new Option( weightBoxX, form, 1, weightLabelX, + 0, new ActiveValueLabel(weightActiveXLabel, activeValueTitle), "Weight"); @@ -130,6 +134,7 @@ namespace grapher.Models form, 1, weightLabelY, + optionSetYLeft, new ActiveValueLabel(weightActiveYLabel, activeValueTitle), "Weight"); @@ -138,6 +143,7 @@ namespace grapher.Models form, 0, capLabelX, + 0, new ActiveValueLabel(capActiveXLabel, activeValueTitle), "Cap"); @@ -146,6 +152,7 @@ namespace grapher.Models form, 0, capLabelY, + optionSetYLeft, new ActiveValueLabel(capActiveYLabel, activeValueTitle), "Cap"); @@ -154,6 +161,7 @@ namespace grapher.Models form, 0, offsetLabelX, + 0, new ActiveValueLabel(offsetActiveLabelX, activeValueTitle), "Offset"); @@ -162,6 +170,7 @@ namespace grapher.Models form, 0, offsetLabelY, + optionSetYLeft, new ActiveValueLabel(offsetActiveLabelY, activeValueTitle), "Offset"); @@ -169,32 +178,38 @@ namespace grapher.Models var accelerationX = new Option( new Field(accelerationBoxX, form, 0), constantOneLabelX, - new ActiveValueLabel(accelerationActiveLabelX, activeValueTitle)); + new ActiveValueLabel(accelerationActiveLabelX, activeValueTitle), + 0); var accelerationY = new Option( new Field(accelerationBoxY, form, 0), constantOneLabelY, - new ActiveValueLabel(accelerationActiveLabelY, activeValueTitle)); + new ActiveValueLabel(accelerationActiveLabelY, activeValueTitle), + optionSetYLeft); var limitOrExponentX = new Option( new Field(limitBoxX, form, 2), constantTwoLabelX, - new ActiveValueLabel(limitExpActiveLabelX, activeValueTitle)); + new ActiveValueLabel(limitExpActiveLabelX, activeValueTitle), + 0); var limitOrExponentY = new Option( new Field(limitBoxY, form, 2), constantTwoLabelY, - new ActiveValueLabel(limitExpActiveLabelY, activeValueTitle)); + new ActiveValueLabel(limitExpActiveLabelY, activeValueTitle), + optionSetYLeft); var midpointX = new Option( new Field(midpointBoxX, form, 0), constantThreeLabelX, - new ActiveValueLabel(midpointActiveLabelX, activeValueTitle)); + new ActiveValueLabel(midpointActiveLabelX, activeValueTitle), + 0); var midpointY = new Option( new Field(midpointBoxY, form, 0), constantThreeLabelY, - new ActiveValueLabel(midpointActiveLabelY, activeValueTitle)); + new ActiveValueLabel(midpointActiveLabelY, activeValueTitle), + optionSetYLeft); var accelerationOptionsX = new AccelTypeOptions( accelTypeDropX, @@ -236,16 +251,18 @@ namespace grapher.Models var optionsSetX = new AccelOptionSet( optionSetXTitle, + rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, accelerationOptionsX, accelerationX, capOptionsX, weightX, offsetX, limitOrExponentX, - midpointX); + midpointX); ; var optionsSetY = new AccelOptionSet( optionSetYTitle, + rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, accelerationOptionsY, accelerationY, capOptionsY, diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index 2d15ad6..e2f2bf7 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -12,6 +12,7 @@ namespace grapher.Models.Options { public AccelOptionSet( Label titleLabel, + int topAnchor, AccelTypeOptions accelTypeOptions, Option acceleration, CapOptions cap, @@ -21,6 +22,7 @@ namespace grapher.Models.Options Option midpoint) { TitleLabel = titleLabel; + TopAnchor = topAnchor; AccelTypeOptions = accelTypeOptions; Acceleration = acceleration; Cap = cap; @@ -158,7 +160,7 @@ namespace grapher.Models.Options private void SetOptionsTop(int top) { AccelTypeOptions.Top = top; - Acceleration.Top = AccelTypeOptions.Top+ AccelTypeOptions.Height + Constants.OptionVerticalSeperation; + Acceleration.Top = AccelTypeOptions.Top + AccelTypeOptions.Height + Constants.OptionVerticalSeperation; Cap.SnapTo(Acceleration); Weight.SnapTo(Cap); Offset.SnapTo(Weight); diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index 2006dec..22b78d4 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -15,11 +15,17 @@ namespace grapher public Option( Field field, Label label, - ActiveValueLabel activeValueLabel) + ActiveValueLabel activeValueLabel, + int left) { Field = field; Label = label; ActiveValueLabel = activeValueLabel; + Left = left; + + label.AutoSize = false; + label.Width = Field.Left - left - Constants.OptionLabelBoxSeperation; + label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; } public Option( @@ -27,11 +33,13 @@ namespace grapher Form containingForm, double defaultData, Label label, + int left, ActiveValueLabel activeValueLabel) : this( new Field(box, containingForm, defaultData), label, - activeValueLabel) + activeValueLabel, + left) { } @@ -40,6 +48,7 @@ namespace grapher Form containingForm, double defaultData, Label label, + int left, ActiveValueLabel activeValueLabel, string startingName) : this( @@ -47,6 +56,7 @@ namespace grapher containingForm, defaultData, label, + left, activeValueLabel) { SetName(startingName); @@ -89,10 +99,9 @@ namespace grapher { return Label.Left; } - set + private set { Label.Left = value; - Field.Left = value + Label.Width + Constants.OptionLabelBoxSeperation; } } public int Width @@ -111,7 +120,6 @@ namespace grapher { Label.Text = name; //Label.Left = Convert.ToInt32((Field.Box.Left / 2.0) - (Label.Width / 2.0)); //Centered - Left = Label.Left; } public void SetActiveValue(double value) -- cgit v1.2.3 From 5b9b8ed308e7a8cefbd27b2db72d33d7b002e223 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Wed, 2 Sep 2020 01:02:51 -0700 Subject: Move optionsets to applyoptions --- grapher/Form1.cs | 3 +- grapher/Models/AccelGUI.cs | 24 ++------- grapher/Models/AccelGUIFactory.cs | 12 +++-- grapher/Models/Options/AccelOptionSet.cs | 17 ++----- grapher/Models/Options/AccelTypeOptions.cs | 26 ++++++++-- grapher/Models/Options/ApplyOptions.cs | 79 ++++++++++++++++++++++++++++-- 6 files changed, 114 insertions(+), 47 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 5df97a3..68a8a31 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -38,7 +38,7 @@ namespace grapher } ActiveValueTitle.AutoSize = false; - ActiveValueTitle.Left = LockXYLabel.Left + LockXYLabel.Width; + ActiveValueTitle.Left = accelerationBoxY.Left + accelerationBoxY.Width; ActiveValueTitle.Width = AccelerationChart.Left - ActiveValueTitle.Left; ActiveValueTitle.TextAlign = ContentAlignment.MiddleCenter; @@ -79,6 +79,7 @@ namespace grapher midpointBoxX, midpointBoxY, sensXYLock, + ByComponentXYLock, sensitivityLabel, rotationLabel, weightLabelX, diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 891cd01..6b14672 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -27,8 +27,6 @@ namespace grapher ApplyOptions applyOptions, OptionXY sensitivity, Option rotation, - AccelOptionSet optionSetX, - AccelOptionSet optionSetY, Button writeButton, Label mouseMoveLabel, ToolStripMenuItem scaleMenuItem) @@ -42,8 +40,6 @@ namespace grapher WriteButton = writeButton; ScaleMenuItem = scaleMenuItem; Settings = settings; - OptionSetX = optionSetX; - OptionSetY = optionSetY; Settings.Startup(); RefreshOnRead(); @@ -70,10 +66,6 @@ namespace grapher public Option Rotation { get; } - public AccelOptionSet OptionSetX { get; } - - public AccelOptionSet OptionSetY { get; } - public Button WriteButton { get; } public MouseWatcher MouseWatcher { get; } @@ -95,16 +87,8 @@ namespace grapher y = Sensitivity.Fields.Y }, combineMagnitudes = ApplyOptions.IsWhole, - modes = new Vec2 - { - x = (AccelMode)OptionSetX.AccelTypeOptions.AccelerationIndex, - y = (AccelMode)OptionSetY.AccelTypeOptions.AccelerationIndex - }, - args = new Vec2 - { - x = OptionSetX.GenerateArgs(), - y = OptionSetY.GenerateArgs() - }, + modes = ApplyOptions.GetModes(), + args = ApplyOptions.GetArgs(), minimumTime = .4 }); RefreshOnRead(); @@ -131,9 +115,7 @@ namespace grapher Sensitivity.SetActiveValues(settings.sensitivity.x, settings.sensitivity.y); Rotation.SetActiveValue(settings.rotation); - ApplyOptions.SetActive(settings.combineMagnitudes); - OptionSetX.SetActiveValues((int)settings.modes.x, settings.args.x); - OptionSetY.SetActiveValues((int)settings.modes.y, settings.args.y); + ApplyOptions.SetActiveValues(settings); AccelCharts.RefreshXY(settings.combineMagnitudes); } diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 3c2a773..8ed4d72 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -52,6 +52,7 @@ namespace grapher.Models TextBox midpointBoxX, TextBox midpointBoxY, CheckBox sensXYLock, + CheckBox byComponentXYLock, Label sensitivityLabel, Label rotationLabel, Label weightLabelX, @@ -95,8 +96,6 @@ namespace grapher.Models new ChartXY(gainChart, gainChartY), showVelocityGainToolStripMenuItem); - var applyOptions = new ApplyOptions(wholeVectorToolStripMenuItem, byVectorComponentToolStripMenuItem); - var sensitivity = new OptionXY( sensitivityBoxX, sensitivityBoxY, @@ -271,6 +270,13 @@ namespace grapher.Models limitOrExponentY, midpointY); + var applyOptions = new ApplyOptions( + wholeVectorToolStripMenuItem, + byVectorComponentToolStripMenuItem, + byComponentXYLock, + optionsSetX, + optionsSetY); + var accelCalculator = new AccelCalculator( new Field(dpiTextBox.TextBox, form, Constants.DefaultDPI), new Field(pollRateTextBox.TextBox, form, Constants.DefaultPollRate)); @@ -289,8 +295,6 @@ namespace grapher.Models applyOptions, sensitivity, rotation, - optionsSetX, - optionsSetY, writeButton, mouseLabel, scaleMenuItem); diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index e2f2bf7..46b6e3e 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -69,15 +69,16 @@ namespace grapher.Models.Options } } - public void SetTitleMode() + public void SetTitleMode(string title) { if (!IsTitleMode) { IsTitleMode = true; + TitleLabel.Text = title; AccelTypeOptions.Left = Acceleration.Field.Left; AccelTypeOptions.Width = Acceleration.Field.Width; - AccelTypeOptions.ShowFullText(); + AccelTypeOptions.ShowShortenedText(); DisplayTitle(); } } @@ -86,12 +87,6 @@ namespace grapher.Models.Options { TitleLabel.Hide(); AccelTypeOptions.Hide(); - Acceleration.Hide(); - Cap.Hide(); - Weight.Hide(); - Offset.Hide(); - LimitOrExponent.Hide(); - Midpoint.Hide(); } public void Show() @@ -102,12 +97,6 @@ namespace grapher.Models.Options } AccelTypeOptions.Show(); - Acceleration.Show(); - Cap.Show(); - Weight.Show(); - Offset.Show(); - LimitOrExponent.Show(); - Midpoint.Show(); } public void DisplayTitle() diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 2359b8d..5342f4b 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -62,7 +62,15 @@ namespace grapher public ComboBox AccelDropdown { get; } - public int AccelerationIndex { get; private set; } + public int AccelerationIndex + { + get + { + return AccelerationType.Index; + } + } + + public LayoutBase AccelerationType { get; private set; } public ActiveValueLabel ActiveValueLabel { get; } @@ -125,11 +133,17 @@ namespace grapher public void Hide() { AccelDropdown.Hide(); + + foreach(var option in Options) + { + option.Hide(); + } } public void Show() { AccelDropdown.Show(); + Layout(); } public void SetActiveValue(int index) @@ -163,9 +177,13 @@ namespace grapher private void Layout(string type) { - var accelerationType = AccelerationTypes[type]; - AccelerationIndex = accelerationType.Index; - accelerationType.Layout(Options, WriteButton); + AccelerationType = AccelerationTypes[type]; + Layout(); + } + + private void Layout() + { + AccelerationType.Layout(Options, WriteButton); } #endregion Methods diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 703f0d5..0241fdf 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -1,4 +1,5 @@ -using System; +using grapher.Models.Serialized; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -14,7 +15,10 @@ namespace grapher.Models.Options public ApplyOptions( ToolStripMenuItem wholeVectorMenuItem, - ToolStripMenuItem byComponentMenuItem) + ToolStripMenuItem byComponentMenuItem, + CheckBox byComponentVectorXYLock, + AccelOptionSet optionSetX, + AccelOptionSet optionSetY) { WholeVectorMenuItem = wholeVectorMenuItem; ByComponentVectorMenuItem = byComponentMenuItem; @@ -25,6 +29,14 @@ namespace grapher.Models.Options WholeVectorMenuItem.CheckedChanged += new System.EventHandler(OnWholeCheckedChange); ByComponentVectorMenuItem.CheckedChanged += new System.EventHandler(OnByComponentCheckedChange); + ByComponentVectorXYLock = byComponentVectorXYLock; + OptionSetX = optionSetX; + OptionSetY = optionSetY; + + ByComponentVectorXYLock.CheckedChanged += new System.EventHandler(OnByComponentXYLockChecked); + ByComponentVectorXYLock.Checked = false; + ByComponentVectorXYLock.Checked = true; + IsWhole = false; } @@ -36,18 +48,54 @@ namespace grapher.Models.Options public ToolStripMenuItem ByComponentVectorMenuItem { get; } + public CheckBox ByComponentVectorXYLock { get; } + + public AccelOptionSet OptionSetX { get; } + + public AccelOptionSet OptionSetY { get; } + public bool IsWhole { get; private set; } #endregion Properties #region Methods - public void SetActive(bool isWhole) + public Vec2 GetModes() + { + var xMode = (AccelMode)OptionSetX.AccelTypeOptions.AccelerationIndex; + + return new Vec2 + { + x = xMode, + y = ByComponentVectorXYLock.Checked ? xMode : (AccelMode)OptionSetY.AccelTypeOptions.AccelerationIndex + }; + } + + public Vec2 GetArgs() + { + var xArgs = OptionSetX.GenerateArgs(); + + return new Vec2 + { + x = xArgs, + y = ByComponentVectorXYLock.Checked ? xArgs : OptionSetY.GenerateArgs() + }; + + } + + public void SetActiveValues(int xMode, int yMode, AccelArgs xArgs, AccelArgs yArgs, bool isWhole) { + OptionSetX.SetActiveValues(xMode, xArgs); + OptionSetY.SetActiveValues(yMode, yArgs); WholeVectorMenuItem.Checked = isWhole; ByComponentVectorMenuItem.Checked = !isWhole; } + public void SetActiveValues(DriverSettings settings) + { + SetActiveValues((int)settings.modes.x, (int)settings.modes.y, settings.args.x, settings.args.y, settings.combineMagnitudes); + } + public void OnWholeClicked(object sender, EventArgs e) { if (!WholeVectorMenuItem.Checked) @@ -82,6 +130,31 @@ namespace grapher.Models.Options } } + public void ShowWholeOptionSet() + { + OptionSetX.SetTitleMode("X = Y"); + OptionSetY.Hide(); + } + + public void ShowByComponentSets() + { + OptionSetX.SetTitleMode("X"); + OptionSetY.SetTitleMode("Y"); + OptionSetY.Show(); + } + + private void OnByComponentXYLockChecked(object sender, EventArgs e) + { + if (ByComponentVectorXYLock.Checked) + { + ShowWholeOptionSet(); + } + else + { + ShowByComponentSets(); + } + } + public void EnableWholeApplication() { IsWhole = true; -- cgit v1.2.3 From 66131ff0e469aed0a44ad0fa7179b9cddfb66df5 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Wed, 2 Sep 2020 01:39:36 -0700 Subject: The menus mostly work --- grapher/Models/AccelGUI.cs | 2 +- grapher/Models/Options/AccelOptionSet.cs | 5 +++- grapher/Models/Options/ApplyOptions.cs | 39 ++++++++++++++++++++++---------- 3 files changed, 32 insertions(+), 14 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 6b14672..3a15d48 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -96,6 +96,7 @@ namespace grapher public void RefreshOnRead() { + AccelCharts.RefreshXY(Settings.RawAccelSettings.AccelerationSettings.combineMagnitudes); UpdateGraph(); UpdateShownActiveValues(); } @@ -117,7 +118,6 @@ namespace grapher Rotation.SetActiveValue(settings.rotation); ApplyOptions.SetActiveValues(settings); - AccelCharts.RefreshXY(settings.combineMagnitudes); } private void OnScaleMenuItemClick(object sender, EventArgs e) diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index 46b6e3e..b1f85a9 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -34,6 +34,8 @@ namespace grapher.Models.Options AccelTypeOptions.ShowFullText(); TitleLabel.Top = TopAnchor; + IsTitleMode = true; + SetRegularMode(); } public int TopAnchor { get; } @@ -71,11 +73,12 @@ namespace grapher.Models.Options public void SetTitleMode(string title) { + TitleLabel.Text = title; + if (!IsTitleMode) { IsTitleMode = true; - TitleLabel.Text = title; AccelTypeOptions.Left = Acceleration.Field.Left; AccelTypeOptions.Width = Acceleration.Field.Width; AccelTypeOptions.ShowShortenedText(); diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 0241fdf..bfbc1ef 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -34,10 +34,9 @@ namespace grapher.Models.Options OptionSetY = optionSetY; ByComponentVectorXYLock.CheckedChanged += new System.EventHandler(OnByComponentXYLockChecked); - ByComponentVectorXYLock.Checked = false; ByComponentVectorXYLock.Checked = true; - IsWhole = false; + EnableWholeApplication(); } #endregion Constructors @@ -124,44 +123,60 @@ namespace grapher.Models.Options public void OnByComponentCheckedChange(object sender, EventArgs e) { - if (ByComponentVectorMenuItem.Checked) - { - EnableByComponentApplication(); - } + EnableByComponentApplication(); + } + + public void ShowWholeSet() + { + OptionSetX.SetRegularMode(); + OptionSetY.Hide(); } - public void ShowWholeOptionSet() + public void ShowByComponentAsOneSet() { OptionSetX.SetTitleMode("X = Y"); OptionSetY.Hide(); } - public void ShowByComponentSets() + public void ShowByComponentAsTwoSets() { OptionSetX.SetTitleMode("X"); OptionSetY.SetTitleMode("Y"); OptionSetY.Show(); } - private void OnByComponentXYLockChecked(object sender, EventArgs e) - { + public void ShowByComponentSet() + { if (ByComponentVectorXYLock.Checked) { - ShowWholeOptionSet(); + ShowByComponentAsOneSet(); } else { - ShowByComponentSets(); + ShowByComponentAsTwoSets(); + } + } + + private void OnByComponentXYLockChecked(object sender, EventArgs e) + { + if (!IsWhole) + { + ShowByComponentSet(); } } public void EnableWholeApplication() { IsWhole = true; + ByComponentVectorXYLock.Hide(); + ShowWholeSet(); } + public void EnableByComponentApplication() { IsWhole = false; + ByComponentVectorXYLock.Show(); + ShowByComponentSet(); } #endregion Methods -- cgit v1.2.3 From 6470bff9672c56024c542a74a00429273501879f Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Fri, 4 Sep 2020 01:53:59 -0700 Subject: Remove log and sigmoid styles --- grapher/Layouts/LogLayout.cs | 21 --------------------- grapher/Layouts/SigmoidLayout.cs | 21 --------------------- grapher/Models/Options/AccelTypeOptions.cs | 2 -- grapher/Models/Serialized/DriverSettings.cs | 2 +- grapher/grapher.csproj | 2 -- 5 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 grapher/Layouts/LogLayout.cs delete mode 100644 grapher/Layouts/SigmoidLayout.cs (limited to 'grapher') diff --git a/grapher/Layouts/LogLayout.cs b/grapher/Layouts/LogLayout.cs deleted file mode 100644 index 4b73683..0000000 --- a/grapher/Layouts/LogLayout.cs +++ /dev/null @@ -1,21 +0,0 @@ -using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace grapher.Layouts -{ - public class LogLayout : LayoutBase - { - public LogLayout() - : base() - { - Name = "Logarithmic"; - Index = (int)AccelMode.logarithmic; - ShowOptions = new bool[] { true, true, false, false, true, true }; - OptionNames = new string[] { Offset, Acceleration, string.Empty, string.Empty, Cap, Weight }; - } - } -} diff --git a/grapher/Layouts/SigmoidLayout.cs b/grapher/Layouts/SigmoidLayout.cs deleted file mode 100644 index e5e35cd..0000000 --- a/grapher/Layouts/SigmoidLayout.cs +++ /dev/null @@ -1,21 +0,0 @@ -using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace grapher.Layouts -{ - public class SigmoidLayout : LayoutBase - { - public SigmoidLayout() - : base() - { - Name = "Sigmoid"; - Index = (int)AccelMode.sigmoid; - ShowOptions = new bool[] { true, true, true, true, false, true }; - OptionNames = new string[] { Offset, Acceleration, Limit, Midpoint, string.Empty, Weight }; - } - } -} diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 5342f4b..f05d617 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -18,8 +18,6 @@ namespace grapher new LinearLayout(), new ClassicLayout(), new NaturalLayout(), - new LogLayout(), - new SigmoidLayout(), new PowerLayout(), new NaturalGainLayout(), new SigmoidGainLayout(), diff --git a/grapher/Models/Serialized/DriverSettings.cs b/grapher/Models/Serialized/DriverSettings.cs index ecd4d51..d7c9444 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, logarithmic, sigmoid, naturalgain, sigmoidgain, power, noaccel + linear, classic, natural, naturalgain, sigmoidgain, power, noaccel } #endregion Enumerations diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index 4717a8b..b70bbb6 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -84,11 +84,9 @@ - - -- cgit v1.2.3 From 5ac07584f57b664237068ecda01034cbb9ca9c54 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 7 Sep 2020 12:58:00 -0700 Subject: Pass args by ref for setting --- grapher/Models/Options/AccelOptionSet.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index 838917c..3b9b534 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -116,7 +116,7 @@ namespace grapher.Models.Options SetOptionsTop(TopAnchor); } - public void SetArgs(AccelArgs args) + public void SetArgs(ref AccelArgs args) { args.accel = Acceleration.Field.Data; args.rate = Acceleration.Field.Data; @@ -135,7 +135,7 @@ namespace grapher.Models.Options public AccelArgs GenerateArgs() { AccelArgs args = new AccelArgs(); - SetArgs(args); + SetArgs(ref args); return args; } -- cgit v1.2.3 From aff3a066575f4bfa429f67a5104a1fcffc5f326e Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 7 Sep 2020 15:19:39 -0700 Subject: Refactor type options --- grapher/Layouts/ClassicLayout.cs | 9 ++- grapher/Layouts/DefaultLayout.cs | 9 ++- grapher/Layouts/LayoutBase.cs | 86 ++++++++++++++++----- grapher/Layouts/LinearLayout.cs | 9 ++- grapher/Layouts/NaturalGainLayout.cs | 9 ++- grapher/Layouts/NaturalLayout.cs | 9 ++- grapher/Layouts/OffLayout.cs | 9 ++- grapher/Layouts/OptionLayout.cs | 41 ++++++++++ grapher/Layouts/PowerLayout.cs | 9 ++- grapher/Layouts/SigmoidGainLayout.cs | 9 ++- grapher/Models/AccelGUIFactory.cs | 59 +++++---------- grapher/Models/Fields/Field.cs | 30 ++++++-- grapher/Models/Options/AccelOptionSet.cs | 83 ++++----------------- grapher/Models/Options/AccelTypeOptions.cs | 116 ++++++++++++++++++++++++----- grapher/Models/Options/ApplyOptions.cs | 4 +- grapher/Models/Options/CapOptions.cs | 40 +++++++++- grapher/Models/Options/IOption.cs | 27 +++++++ grapher/Models/Options/OffsetOptions.cs | 65 +++++++++++++++- grapher/Models/Options/Option.cs | 34 ++++----- grapher/Models/Options/OptionBase.cs | 30 ++++++++ grapher/grapher.csproj | 3 + 21 files changed, 498 insertions(+), 192 deletions(-) create mode 100644 grapher/Layouts/OptionLayout.cs create mode 100644 grapher/Models/Options/IOption.cs create mode 100644 grapher/Models/Options/OptionBase.cs (limited to 'grapher') diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs index f7766f0..d02e11c 100644 --- a/grapher/Layouts/ClassicLayout.cs +++ b/grapher/Layouts/ClassicLayout.cs @@ -14,8 +14,13 @@ namespace grapher.Layouts { Name = "Classic"; Index = (int)AccelMode.classic; - ShowOptions = new bool[] { true, true, true, false, true, true }; - OptionNames = new string[] { Offset, Acceleration, Exponent, string.Empty, Cap, Weight }; + + AccelLayout = new OptionLayout(true, Acceleration); + CapLayout = new OptionLayout(true, Cap); + WeightLayout = new OptionLayout(true, Weight); + OffsetLayout = new OptionLayout(true, Offset); + LimExpLayout = new OptionLayout(true, Exponent); + MidpointLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index cb1994f..d9e1413 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -16,9 +16,14 @@ namespace grapher.Layouts { Name = "Default"; Index = (int)AccelMode.noaccel; - ShowOptions = new bool[] { true, true, true, true, true }; - OptionNames = new string[] { Offset, Acceleration, $"{Limit}\\{Exponent}", Midpoint, Cap, Weight }; ButtonEnabled = false; + + AccelLayout = new OptionLayout(true, Acceleration); + CapLayout = new OptionLayout(true, Cap); + WeightLayout = new OptionLayout(true, Weight); + OffsetLayout = new OptionLayout(true, Offset); + LimExpLayout = new OptionLayout(true, $"{Limit}\\{Exponent}"); + MidpointLayout = new OptionLayout(true, Midpoint); } } } diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index daac6f1..629b0a4 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -1,4 +1,5 @@ -using System; +using grapher.Models.Options; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -20,9 +21,13 @@ namespace grapher.Layouts public LayoutBase() { - ShowOptions = new bool[] { false, false, false, false, true, true }; - ShowOptionsXY = new bool[] { true, true }; - OptionNames = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; + AccelLayout = new OptionLayout(false, string.Empty); + CapLayout = new OptionLayout(false, string.Empty); + WeightLayout = new OptionLayout(false, string.Empty); + OffsetLayout = new OptionLayout(false, string.Empty); + LimExpLayout = new OptionLayout(false, string.Empty); + MidpointLayout = new OptionLayout(false, string.Empty); + ButtonEnabled = true; } @@ -34,30 +39,75 @@ namespace grapher.Layouts public string Name { get; internal set; } - internal bool[] ShowOptions { get; set; } + protected bool ButtonEnabled { get; set; } + + protected OptionLayout AccelLayout { get; set; } + + protected OptionLayout CapLayout { get; set; } + + protected OptionLayout WeightLayout { get; set; } - internal bool[] ShowOptionsXY { get; set; } + protected OptionLayout OffsetLayout { get; set; } - internal string[] OptionNames { get; set; } + protected OptionLayout LimExpLayout { get; set; } - internal bool ButtonEnabled { get; set; } + protected OptionLayout MidpointLayout { get; set; } - public void Layout(Option[] options, Button button) + public void Layout( + IOption accelOption, + IOption capOption, + IOption weightOption, + IOption offsetOption, + IOption limExpOption, + IOption midpointOption, + Button button, + int top) { - // Relies on AccelOptions to keep lengths correct. - for (int i = 0; i < options.Length; i++) + AccelLayout.Layout(accelOption); + CapLayout.Layout(capOption); + WeightLayout.Layout(weightOption); + OffsetLayout.Layout(offsetOption); + LimExpLayout.Layout(limExpOption); + MidpointLayout.Layout(midpointOption); + + button.Enabled = ButtonEnabled; + + IOption previous = null; + foreach (var option in new IOption[] { accelOption, capOption, weightOption, offsetOption, limExpOption, midpointOption}) { - if (ShowOptions[i]) + if (option.Visible) { - options[i].Show(OptionNames[i]); - } - else - { - options[i].Hide(); + if (previous != null) + { + option.SnapTo(previous); + } + else + { + option.Top = top; + } + + previous = option; } } + } - button.Enabled = ButtonEnabled; + public void Layout( + IOption accelOption, + IOption capOption, + IOption weightOption, + IOption offsetOption, + IOption limExpOption, + IOption midpointOption, + Button button) + { + Layout(accelOption, + capOption, + weightOption, + offsetOption, + limExpOption, + midpointOption, + button, + accelOption.Top); } } } diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index 8b1d444..b5c6434 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -14,8 +14,13 @@ namespace grapher.Layouts { Name = "Linear"; Index = (int)AccelMode.linear; - ShowOptions = new bool[] { true, true, false, false, true, true }; - OptionNames = new string[] { Offset, Acceleration, string.Empty, string.Empty, Cap, Weight }; + + AccelLayout = new OptionLayout(true, Acceleration); + CapLayout = new OptionLayout(true, Cap); + WeightLayout = new OptionLayout(false, string.Empty); + OffsetLayout = new OptionLayout(true, Offset); + LimExpLayout = new OptionLayout(false, string.Empty); + MidpointLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/NaturalGainLayout.cs b/grapher/Layouts/NaturalGainLayout.cs index 0f9caf0..ae73c80 100644 --- a/grapher/Layouts/NaturalGainLayout.cs +++ b/grapher/Layouts/NaturalGainLayout.cs @@ -14,8 +14,13 @@ namespace grapher.Layouts { Name = "NaturalGain"; Index = (int)AccelMode.naturalgain; - ShowOptions = new bool[] { true, true, true, false, false, true }; - OptionNames = new string[] { Offset, Acceleration, Limit, string.Empty, string.Empty, Weight}; + + AccelLayout = new OptionLayout(true, Acceleration); + CapLayout = new OptionLayout(false, string.Empty); + WeightLayout = new OptionLayout(false, string.Empty); + OffsetLayout = new OptionLayout(true, Offset); + LimExpLayout = new OptionLayout(true, Limit); + MidpointLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index caa77bd..0923e1d 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -14,8 +14,13 @@ namespace grapher.Layouts { Name = "Natural"; Index = (int)AccelMode.natural; - ShowOptions = new bool[] { true, true, true, false, false, true }; - OptionNames = new string[] { Offset, Acceleration, Limit, string.Empty, string.Empty, Weight }; + + AccelLayout = new OptionLayout(true, Acceleration); + CapLayout = new OptionLayout(false, string.Empty); + WeightLayout = new OptionLayout(false, string.Empty); + OffsetLayout = new OptionLayout(true, Offset); + LimExpLayout = new OptionLayout(true, Limit); + MidpointLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index 1c37026..2a2f414 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -14,9 +14,14 @@ namespace grapher.Layouts { Name = "Off"; Index = (int)AccelMode.noaccel; - ShowOptions = new bool[] { false, false, false, false, false, false }; - OptionNames = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; ButtonEnabled = true; + + AccelLayout = new OptionLayout(false, string.Empty); + CapLayout = new OptionLayout(false, string.Empty); + WeightLayout = new OptionLayout(false, string.Empty); + OffsetLayout = new OptionLayout(false, string.Empty); + LimExpLayout = new OptionLayout(false, string.Empty); + MidpointLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/OptionLayout.cs b/grapher/Layouts/OptionLayout.cs new file mode 100644 index 0000000..2f29706 --- /dev/null +++ b/grapher/Layouts/OptionLayout.cs @@ -0,0 +1,41 @@ +using grapher.Models.Options; + +namespace grapher.Layouts +{ + public class OptionLayout + { + #region Constructors + + public OptionLayout(bool show, string name) + { + Show = show; + Name = name; + } + + #endregion Constructors + + #region Properties + + private bool Show { get; } + + private string Name { get; } + + #endregion Properties + + #region Methods + + public void Layout(IOption option) + { + if (Show) + { + option.Show(Name); + } + else + { + option.Hide(); + } + } + + #endregion Methods + } +} diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index 699536f..4438c1a 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -14,8 +14,13 @@ namespace grapher.Layouts { Name = "Power"; Index = (int)AccelMode.power; - ShowOptions = new bool[] { true, true, true, false, true, true }; - OptionNames = new string[] { Offset, Scale, Exponent, string.Empty, Cap, Weight }; + + AccelLayout = new OptionLayout(true, Acceleration); + CapLayout = new OptionLayout(true, Cap); + WeightLayout = new OptionLayout(true, Weight); + OffsetLayout = new OptionLayout(true, Offset); + LimExpLayout = new OptionLayout(true, Limit); + MidpointLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/SigmoidGainLayout.cs b/grapher/Layouts/SigmoidGainLayout.cs index 3897477..1704071 100644 --- a/grapher/Layouts/SigmoidGainLayout.cs +++ b/grapher/Layouts/SigmoidGainLayout.cs @@ -14,8 +14,13 @@ namespace grapher.Layouts { Name = "SigmoidGain"; Index = (int)AccelMode.sigmoidgain; - ShowOptions = new bool[] { true, true, true, true, false, true }; - OptionNames = new string[] { Offset, Acceleration, Limit, Midpoint, string.Empty, Weight }; + + AccelLayout = new OptionLayout(true, Acceleration); + CapLayout = new OptionLayout(false, string.Empty); + WeightLayout = new OptionLayout(false, string.Empty); + OffsetLayout = new OptionLayout(true, Offset); + LimExpLayout = new OptionLayout(true, Limit); + MidpointLayout = new OptionLayout(true, Midpoint); } } } diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 230b64d..5d52f2e 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -185,7 +185,6 @@ namespace grapher.Models legacyOffsetToolStripMenuItem, offsetY); - // The name and layout of these options is handled by AccelerationOptions object. var accelerationX = new Option( new Field(accelerationBoxX, form, 0), constantOneLabelX, @@ -222,34 +221,6 @@ namespace grapher.Models new ActiveValueLabel(midpointActiveLabelY, activeValueTitle), optionSetYLeft); - var accelerationOptionsX = new AccelTypeOptions( - accelTypeDropX, - new Option[] - { - offsetX, - accelerationX, - limitOrExponentX, - midpointX, - capX, - weightX - }, - writeButton, - new ActiveValueLabel(accelTypeActiveLabelX, activeValueTitle)); - - var accelerationOptionsY = new AccelTypeOptions( - accelTypeDropY, - new Option[] - { - offsetY, - accelerationY, - limitOrExponentY, - midpointY, - capY, - weightY - }, - writeButton, - new ActiveValueLabel(accelTypeActiveLabelY, activeValueTitle)); - var capOptionsX = new CapOptions( velocityGainCapToolStripMenuItem, legacyCapToolStripMenuItem, @@ -260,27 +231,37 @@ namespace grapher.Models legacyCapToolStripMenuItem, capY); - var optionsSetX = new AccelOptionSet( - optionSetXTitle, - rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, - accelerationOptionsX, + var accelerationOptionsX = new AccelTypeOptions( + accelTypeDropX, accelerationX, capOptionsX, weightX, offsetOptionsX, limitOrExponentX, - midpointX); + midpointX, + writeButton, + new ActiveValueLabel(accelTypeActiveLabelX, activeValueTitle)); - var optionsSetY = new AccelOptionSet( - optionSetYTitle, - rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, - accelerationOptionsY, + var accelerationOptionsY = new AccelTypeOptions( + accelTypeDropY, accelerationY, capOptionsY, weightY, offsetOptionsY, limitOrExponentY, - midpointY); + midpointY, + writeButton, + new ActiveValueLabel(accelTypeActiveLabelY, activeValueTitle)); + + var optionsSetX = new AccelOptionSet( + optionSetXTitle, + rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, + accelerationOptionsX); + + var optionsSetY = new AccelOptionSet( + optionSetYTitle, + rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, + accelerationOptionsY); var applyOptions = new ApplyOptions( wholeVectorToolStripMenuItem, diff --git a/grapher/Models/Fields/Field.cs b/grapher/Models/Fields/Field.cs index 6f38314..f8a9c2d 100644 --- a/grapher/Models/Fields/Field.cs +++ b/grapher/Models/Fields/Field.cs @@ -23,13 +23,19 @@ namespace grapher #endregion Enumerations + #region Fields + + private double _data; + + #endregion Fields + #region Constructors public Field(TextBox box, Form containingForm, double defaultData) { DefaultText = DecimalString(defaultData); Box = box; - Data = defaultData; + _data = defaultData; DefaultData = defaultData; State = FieldState.Undefined; ContainingForm = containingForm; @@ -48,8 +54,6 @@ namespace grapher private Form ContainingForm { get; } - public double Data { get; private set; } - public string FormatString { get; set; } public string DefaultText { get; } @@ -58,6 +62,20 @@ namespace grapher public FieldState PreviousState { get; private set; } + public double Data { + get + { + if (Box.Visible) + { + return _data; + } + else + { + return DefaultData; + } + } + } + public int Top { get @@ -122,7 +140,7 @@ namespace grapher PreviousState = FieldState.Default; } - Data = DefaultData; + _data = DefaultData; Box.Text = DefaultText; ContainingForm.ActiveControl = null; } @@ -159,7 +177,7 @@ namespace grapher { SetToEntered(); - Data = value; + _data = value; Box.Text = DecimalString(Data); } @@ -238,7 +256,7 @@ namespace grapher { try { - Data = Convert.ToDouble(Box.Text); + _data = Convert.ToDouble(Box.Text); } catch { diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index 3b9b534..8c7b303 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -13,25 +13,13 @@ namespace grapher.Models.Options public AccelOptionSet( Label titleLabel, int topAnchor, - AccelTypeOptions accelTypeOptions, - Option acceleration, - CapOptions cap, - Option weight, - OffsetOptions offset, - Option limitOrExp, - Option midpoint) + AccelTypeOptions accelTypeOptions) { TitleLabel = titleLabel; TopAnchor = topAnchor; - AccelTypeOptions = accelTypeOptions; - Acceleration = acceleration; - Cap = cap; - Weight = weight; - Offset = offset; - LimitOrExponent = limitOrExp; - Midpoint = midpoint; + Options = accelTypeOptions; - AccelTypeOptions.ShowFullText(); + Options.ShowFull(); TitleLabel.Top = TopAnchor; IsTitleMode = true; @@ -42,19 +30,8 @@ namespace grapher.Models.Options public Label TitleLabel { get; } - public AccelTypeOptions AccelTypeOptions { get; } + public AccelTypeOptions Options { get; } - public Option Acceleration { get; } - - public CapOptions Cap { get; } - - public Option Weight { get; } - - public OffsetOptions Offset { get; } - - public Option LimitOrExponent { get; } - - public Option Midpoint { get; } public bool IsTitleMode { get; private set; } @@ -65,9 +42,7 @@ namespace grapher.Models.Options IsTitleMode = false; HideTitle(); - AccelTypeOptions.Left = Acceleration.Left; - AccelTypeOptions.Width = Acceleration.Width; - AccelTypeOptions.ShowFullText(); + Options.ShowFull(); } } @@ -79,9 +54,7 @@ namespace grapher.Models.Options { IsTitleMode = true; - AccelTypeOptions.Left = Acceleration.Field.Left; - AccelTypeOptions.Width = Acceleration.Field.Width; - AccelTypeOptions.ShowShortenedText(); + Options.ShowShortened(); DisplayTitle(); } } @@ -89,7 +62,7 @@ namespace grapher.Models.Options public void Hide() { TitleLabel.Hide(); - AccelTypeOptions.Hide(); + Options.Hide(); } public void Show() @@ -99,66 +72,36 @@ namespace grapher.Models.Options TitleLabel.Show(); } - AccelTypeOptions.Show(); + Options.Show(); } public void DisplayTitle() { TitleLabel.Show(); - SetOptionsTop(TitleLabel.Top + TitleLabel.Height + Constants.OptionVerticalSeperation); + Options.Top = TitleLabel.Top + TitleLabel.Height + Constants.OptionVerticalSeperation; } public void HideTitle() { TitleLabel.Hide(); - SetOptionsTop(TopAnchor); + Options.Top = TopAnchor; } public void SetArgs(ref AccelArgs args) { - args.accel = Acceleration.Field.Data; - args.rate = Acceleration.Field.Data; - args.powerScale = Acceleration.Field.Data; - args.gainCap = Cap.VelocityGainCap; - args.scaleCap = Cap.SensitivityCap; - args.limit = LimitOrExponent.Field.Data; - args.exponent = LimitOrExponent.Field.Data; - args.powerExponent = LimitOrExponent.Field.Data; - args.offset = Offset.Offset; - args.legacy_offset = Offset.LegacyOffset; - args.midpoint = Midpoint.Field.Data; - args.weight = Weight.Field.Data; + Options.SetArgs(ref args); } public AccelArgs GenerateArgs() { - AccelArgs args = new AccelArgs(); - SetArgs(ref args); - return args; + return Options.GenerateArgs(); } public void SetActiveValues(int mode, AccelArgs args) { - AccelTypeOptions.SetActiveValue(mode); - Weight.SetActiveValue(args.weight); - Cap.SetActiveValues(args.gainCap, args.scaleCap, args.gainCap > 0); - Offset.SetActiveValue(args.offset, args.legacy_offset); - Acceleration.SetActiveValue(args.accel); - LimitOrExponent.SetActiveValue(args.exponent); - Midpoint.SetActiveValue(args.midpoint); - } - - private void SetOptionsTop(int top) - { - AccelTypeOptions.Top = top; - Acceleration.Top = AccelTypeOptions.Top + AccelTypeOptions.Height + Constants.OptionVerticalSeperation; - Cap.SnapTo(Acceleration); - Weight.SnapTo(Cap); - Offset.OffsetOption.SnapTo(Weight); - LimitOrExponent.SnapTo(Offset.OffsetOption); - Midpoint.SnapTo(LimitOrExponent); + Options.SetActiveValues(mode, args); } } } diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index f05d617..878c955 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -1,5 +1,6 @@ using grapher.Layouts; using grapher.Models.Options; +using grapher.Models.Serialized; using System; using System.Collections.Generic; using System.Linq; @@ -30,7 +31,12 @@ namespace grapher public AccelTypeOptions( ComboBox accelDropdown, - Option[] options, + Option acceleration, + CapOptions cap, + Option weight, + OffsetOptions offset, + Option limitOrExponent, + Option midpoint, Button writeButton, ActiveValueLabel activeValueLabel) { @@ -39,15 +45,25 @@ namespace grapher AccelDropdown.Items.AddRange(AccelerationTypes.Keys.ToArray()); AccelDropdown.SelectedIndexChanged += new System.EventHandler(OnIndexChanged); - if (options.Length > Constants.PossibleOptionsCount) - { - throw new Exception("Layout given too many options."); - } - - Options = options; + Acceleration = acceleration; + Cap = cap; + Weight = weight; + Offset = offset; + LimitOrExponent = limitOrExponent; + Midpoint = midpoint; WriteButton = writeButton; ActiveValueLabel = activeValueLabel; + Options = new List + { + Acceleration, + Cap, + Offset, + Weight, + LimitOrExponent, + Midpoint, + }; + Layout("Off"); ShowingDefault = true; } @@ -72,7 +88,19 @@ namespace grapher public ActiveValueLabel ActiveValueLabel { get; } - public Option[] Options { get; } + public Option Acceleration { get; } + + public CapOptions Cap { get; } + + public Option Weight { get; } + + public OffsetOptions Offset { get; } + + public Option LimitOrExponent { get; } + + public Option Midpoint { get; } + + private IEnumerable Options { get; } public int Top { @@ -83,6 +111,7 @@ namespace grapher set { AccelDropdown.Top = value; + Layout(value + AccelDropdown.Height + Constants.OptionVerticalSeperation); } } @@ -131,11 +160,13 @@ namespace grapher public void Hide() { AccelDropdown.Hide(); - - foreach(var option in Options) - { - option.Hide(); - } + + Acceleration.Hide(); + Cap.Hide(); + Weight.Hide(); + Offset.Hide(); + LimitOrExponent.Hide(); + Midpoint.Hide(); } public void Show() @@ -144,26 +175,62 @@ namespace grapher Layout(); } - public void SetActiveValue(int index) + public void SetActiveValues(int index, AccelArgs args) { var name = AccelerationTypes.Where(t => t.Value.Index == index).FirstOrDefault().Value.Name; ActiveValueLabel.SetValue(name); + + Weight.SetActiveValue(args.weight); + Cap.SetActiveValues(args.gainCap, args.scaleCap, args.gainCap > 0); + Offset.SetActiveValue(args.offset, args.legacy_offset); + Acceleration.SetActiveValue(args.accel); + LimitOrExponent.SetActiveValue(args.exponent); + Midpoint.SetActiveValue(args.midpoint); } - public void ShowFullText() + public void ShowFull() { if (ShowingDefault) { AccelDropdown.Text = Constants.AccelDropDownDefaultFullText; } + + Left = Acceleration.Left; + Width = Acceleration.Width; } - public void ShowShortenedText() + public void ShowShortened() { if (ShowingDefault) { AccelDropdown.Text = Constants.AccelDropDownDefaultShortText; } + + Left = Acceleration.Field.Left; + Width = Acceleration.Field.Width; + } + + public void SetArgs(ref AccelArgs args) + { + args.accel = Acceleration.Field.Data; + args.rate = Acceleration.Field.Data; + args.powerScale = Acceleration.Field.Data; + args.gainCap = Cap.VelocityGainCap; + args.scaleCap = Cap.SensitivityCap; + args.limit = LimitOrExponent.Field.Data; + args.exponent = LimitOrExponent.Field.Data; + args.powerExponent = LimitOrExponent.Field.Data; + args.offset = Offset.Offset; + args.legacy_offset = Offset.LegacyOffset; + args.midpoint = Midpoint.Field.Data; + args.weight = Weight.Field.Data; + } + + public AccelArgs GenerateArgs() + { + AccelArgs args = new AccelArgs(); + SetArgs(ref args); + return args; } private void OnIndexChanged(object sender, EventArgs e) @@ -179,9 +246,22 @@ namespace grapher Layout(); } - private void Layout() + private void Layout(int top = -1) { - AccelerationType.Layout(Options, WriteButton); + if (top < 0) + { + top = Acceleration.Top; + } + + AccelerationType.Layout( + Acceleration, + Cap, + Weight, + Offset, + LimitOrExponent, + Midpoint, + WriteButton, + top); } #endregion Methods diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index bfbc1ef..68f06fb 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -61,12 +61,12 @@ namespace grapher.Models.Options public Vec2 GetModes() { - var xMode = (AccelMode)OptionSetX.AccelTypeOptions.AccelerationIndex; + var xMode = (AccelMode)OptionSetX.Options.AccelerationIndex; return new Vec2 { x = xMode, - y = ByComponentVectorXYLock.Checked ? xMode : (AccelMode)OptionSetY.AccelTypeOptions.AccelerationIndex + y = ByComponentVectorXYLock.Checked ? xMode : (AccelMode)OptionSetY.Options.AccelerationIndex }; } diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index 6dc1116..cf587c7 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -8,7 +8,7 @@ using System.Windows.Forms; namespace grapher { - public class CapOptions + public class CapOptions : OptionBase { #region Constants @@ -76,7 +76,7 @@ namespace grapher } } - public int Top + public override int Top { get { @@ -88,7 +88,7 @@ namespace grapher } } - public int Height + public override int Height { get { @@ -96,12 +96,39 @@ namespace grapher } } + public override int Left + { + get + { + return CapOption.Left; + } + set + { + CapOption.Left = value; + } + } + + public override int Width + { + get + { + return CapOption.Width; + } + } + + public override bool Visible + { + get + { + return CapOption.Visible; + } + } #endregion Properties #region Methods - public void Hide() + public override void Hide() { CapOption.Hide(); } @@ -111,6 +138,11 @@ namespace grapher CapOption.Show(); } + public override void Show(string name) + { + CapOption.Show(name); + } + public void SnapTo(Option option) { Top = option.Top + option.Height + Constants.OptionVerticalSeperation; diff --git a/grapher/Models/Options/IOption.cs b/grapher/Models/Options/IOption.cs new file mode 100644 index 0000000..71ac5e4 --- /dev/null +++ b/grapher/Models/Options/IOption.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher.Models.Options +{ + public interface IOption + { + int Top { get; set; } + + int Height { get; } + + int Left { get; } + + int Width { get; } + + bool Visible { get; } + + void Show(string name); + + void Hide(); + + void SnapTo(IOption option); + } +} diff --git a/grapher/Models/Options/OffsetOptions.cs b/grapher/Models/Options/OffsetOptions.cs index 0b01ab9..fbc6898 100644 --- a/grapher/Models/Options/OffsetOptions.cs +++ b/grapher/Models/Options/OffsetOptions.cs @@ -7,7 +7,7 @@ using System.Windows.Forms; namespace grapher.Models.Options { - public class OffsetOptions + public class OffsetOptions : OptionBase { public OffsetOptions( ToolStripMenuItem velocityGainOffsetCheck, @@ -65,6 +65,69 @@ namespace grapher.Models.Options } } + public override int Top + { + get + { + return OffsetOption.Top; + } + set + { + OffsetOption.Top = value; + } + } + + public override int Height + { + get + { + return OffsetOption.Height; + } + } + + public override int Left + { + get + { + return OffsetOption.Left; + } + set + { + OffsetOption.Left = value; + } + } + + public override int Width + { + get + { + return OffsetOption.Width; + } + } + + public override bool Visible + { + get + { + return OffsetOption.Visible; + } + } + + public override void Hide() + { + OffsetOption.Hide(); + } + + public void Show() + { + OffsetOption.Show(); + } + + public override void Show(string name) + { + OffsetOption.Show(name); + } + public void SetActiveValue(double offset, double legacyOffset) { if (offset > 0) diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index 22b78d4..68ecf66 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -8,7 +8,7 @@ using System.Windows.Forms; namespace grapher { - public class Option + public class Option : OptionBase { #region Constructors @@ -72,7 +72,7 @@ namespace grapher public ActiveValueLabel ActiveValueLabel { get; } - public int Top + public override int Top { get { @@ -85,7 +85,7 @@ namespace grapher } } - public int Height + public override int Height { get { @@ -93,18 +93,18 @@ namespace grapher } } - public int Left + public override int Left { get { return Label.Left; } - private set + set { Label.Left = value; } } - public int Width + public override int Width { get { @@ -112,6 +112,14 @@ namespace grapher } } + public override bool Visible + { + get + { + return Field.Box.Visible; + } + } + #endregion Properties #region Methods @@ -127,7 +135,7 @@ namespace grapher ActiveValueLabel.SetValue(value); } - public void Hide() + public override void Hide() { Field.Box.Hide(); Label.Hide(); @@ -146,23 +154,13 @@ namespace grapher ActiveValueLabel.SetValue(value); } - public void Show(string name) + public override void Show(string name) { SetName(name); Show(); } - public void SnapTo(Option option) - { - Top = option.Top + option.Height + Constants.OptionVerticalSeperation; - } - - public void SnapTo(CapOptions option) - { - Top = option.Top + option.Height + Constants.OptionVerticalSeperation; - } - #endregion Methods } } diff --git a/grapher/Models/Options/OptionBase.cs b/grapher/Models/Options/OptionBase.cs new file mode 100644 index 0000000..9fba72f --- /dev/null +++ b/grapher/Models/Options/OptionBase.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher.Models.Options +{ + public abstract class OptionBase : IOption + { + public abstract int Top { get; set; } + + public abstract int Height { get; } + + public abstract int Left { get; set; } + + public abstract int Width { get; } + + public abstract bool Visible { get; } + + public abstract void Show(string Name); + + public abstract void Hide(); + + public virtual void SnapTo(IOption option) + { + Top = option.Top + option.Height + Constants.OptionVerticalSeperation; + } + } +} diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index b70bbb6..74e2959 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -87,8 +87,11 @@ + + + -- cgit v1.2.3 From 0fb1013f66026c696fec6469c02aba1c91711289 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 7 Sep 2020 19:13:30 -0700 Subject: Fix some separation bugs --- grapher/Constants/Constants.cs | 51 +++++++++++++++--------------- grapher/Models/Options/AccelTypeOptions.cs | 39 ++++++++++++++--------- grapher/Models/Options/CapOptions.cs | 4 +++ grapher/Models/Options/IOption.cs | 2 ++ grapher/Models/Options/OffsetOptions.cs | 4 +++ grapher/Models/Options/Option.cs | 4 +++ grapher/Models/Options/OptionBase.cs | 11 +++++-- 7 files changed, 73 insertions(+), 42 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 3d19b21..c7ca617 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -11,18 +11,6 @@ namespace grapher { #region Constants - /// Vertical separation between charts, in pixels. - public const int ChartSeparationVertical = 10; - - /// Default name of settings file. - public const string DefaultSettingsFileName = @"settings.json"; - - /// Needed to show full contents in form. Unsure why. - public const int FormHeightPadding = 35; - - /// Format string for gain cap active value label. - public const string GainCapFormatString = "0.##"; - /// DPI by which charts are scaled if none is set by user. public const int DefaultDPI = 1200; @@ -38,23 +26,17 @@ namespace grapher /// Ratio of max (X, Y) used in "by component" calulations to those used in "whole vector" calculations. public const double XYToCombinedRatio = 1.4; + /// Possible options to display in a layout. + public const int PossibleOptionsCount = 6; + /// Separation between X and Y active value labels, in pixels. public const int ActiveLabelXYSeparation = 2; - /// Format string for shortened x and y textboxes. - public const string ShortenedFormatString = "0.###"; - - /// Format string for default active value labels. - public const string DefaultActiveValueFormatString = "0.######"; - - /// Format string for default textboxes. - public const string DefaultFieldFormatString = "0.#########"; - - /// Possible options to display in a layout. - public const int PossibleOptionsCount = 6; + /// Vertical separation between charts, in pixels. + public const int ChartSeparationVertical = 10; - /// Possible x/y options to display in a layout. - public const int PossibleOptionsXYCount = 0; + /// Needed to show full contents in form. Unsure why. + public const int FormHeightPadding = 35; /// Horizontal separation between charts, in pixels. public const int ChartSeparationHorizontal = 10; @@ -68,14 +50,33 @@ namespace grapher /// Default horizontal separation between an option's label and box, in pixels. public const int OptionVerticalSeperation = 4; + /// Horizonatl separation between left side of single dropdown and left side of labels beneath dropdown + public const int DropDownLeftSeparation = 10; + + /// Format string for shortened x and y textboxes. + public const string ShortenedFormatString = "0.###"; + + /// Format string for default active value labels. + public const string DefaultActiveValueFormatString = "0.######"; + + /// Format string for default textboxes. + public const string DefaultFieldFormatString = "0.#########"; + /// Format string for shortened x and y fields. public const string ShortenedFieldFormatString = "0.###"; + /// Format string for gain cap active value label. + public const string GainCapFormatString = "0.##"; + /// Format string for shortened x and y dropdowns. public const string AccelDropDownDefaultFullText = "Acceleration Type"; /// Format string for default dropdowns. public const string AccelDropDownDefaultShortText = "Accel Type"; + + /// Default name of settings file. + public const string DefaultSettingsFileName = @"settings.json"; + #endregion Constants #region ReadOnly diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 878c955..a5ed474 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -10,7 +10,7 @@ using System.Windows.Forms; namespace grapher { - public class AccelTypeOptions + public class AccelTypeOptions : OptionBase { #region Fields @@ -102,7 +102,7 @@ namespace grapher private IEnumerable Options { get; } - public int Top + public override int Top { get { @@ -115,19 +115,15 @@ namespace grapher } } - public int Height + public override int Height { get { return AccelDropdown.Height; } - set - { - AccelDropdown.Height = value; - } } - public int Left + public override int Left { get { @@ -139,7 +135,7 @@ namespace grapher } } - public int Width + public override int Width { get { @@ -151,13 +147,21 @@ namespace grapher } } + public override bool Visible + { + get + { + return AccelDropdown.Visible; + } + } + private bool ShowingDefault { get; set; } #endregion Properties #region Methods - public void Hide() + public override void Hide() { AccelDropdown.Hide(); @@ -175,6 +179,11 @@ namespace grapher Layout(); } + public override void Show(string name) + { + Show(); + } + public void SetActiveValues(int index, AccelArgs args) { var name = AccelerationTypes.Where(t => t.Value.Index == index).FirstOrDefault().Value.Name; @@ -195,8 +204,8 @@ namespace grapher AccelDropdown.Text = Constants.AccelDropDownDefaultFullText; } - Left = Acceleration.Left; - Width = Acceleration.Width; + Left = Acceleration.Left + Constants.DropDownLeftSeparation; + Width = Acceleration.Width - Constants.DropDownLeftSeparation; } public void ShowShortened() @@ -236,14 +245,14 @@ namespace grapher private void OnIndexChanged(object sender, EventArgs e) { var accelerationTypeString = AccelDropdown.SelectedItem.ToString(); - Layout(accelerationTypeString); + Layout(accelerationTypeString, Beneath); ShowingDefault = false; } - private void Layout(string type) + private void Layout(string type, int top = -1) { AccelerationType = AccelerationTypes[type]; - Layout(); + Layout(top); } private void Layout(int top = -1) diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index cf587c7..a44b536 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -114,6 +114,10 @@ namespace grapher { return CapOption.Width; } + set + { + CapOption.Width = value; + } } public override bool Visible diff --git a/grapher/Models/Options/IOption.cs b/grapher/Models/Options/IOption.cs index 71ac5e4..b387971 100644 --- a/grapher/Models/Options/IOption.cs +++ b/grapher/Models/Options/IOption.cs @@ -15,6 +15,8 @@ namespace grapher.Models.Options int Left { get; } int Width { get; } + + int Beneath { get; } bool Visible { get; } diff --git a/grapher/Models/Options/OffsetOptions.cs b/grapher/Models/Options/OffsetOptions.cs index fbc6898..ffcb862 100644 --- a/grapher/Models/Options/OffsetOptions.cs +++ b/grapher/Models/Options/OffsetOptions.cs @@ -103,6 +103,10 @@ namespace grapher.Models.Options { return OffsetOption.Width; } + set + { + OffsetOption.Width = value; + } } public override bool Visible diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index 68ecf66..5355a8a 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -110,6 +110,10 @@ namespace grapher { return Field.Left + Field.Width - Label.Left; } + set + { + Field.Width = value; + } } public override bool Visible diff --git a/grapher/Models/Options/OptionBase.cs b/grapher/Models/Options/OptionBase.cs index 9fba72f..7fb7c0e 100644 --- a/grapher/Models/Options/OptionBase.cs +++ b/grapher/Models/Options/OptionBase.cs @@ -14,7 +14,14 @@ namespace grapher.Models.Options public abstract int Left { get; set; } - public abstract int Width { get; } + public abstract int Width { get; set; } + + public int Beneath { + get + { + return Top + Height + Constants.OptionVerticalSeperation; + } + } public abstract bool Visible { get; } @@ -24,7 +31,7 @@ namespace grapher.Models.Options public virtual void SnapTo(IOption option) { - Top = option.Top + option.Height + Constants.OptionVerticalSeperation; + Top = option.Beneath; } } } -- cgit v1.2.3 From 1462da675f1bc36d2a770413f13ccc68165cf1e9 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 7 Sep 2020 20:30:15 -0700 Subject: Add chart resize --- grapher/Constants/Constants.cs | 13 ++- grapher/Form1.Designer.cs | 160 ++++++++++++++++++--------------- grapher/Models/AccelGUIFactory.cs | 3 +- grapher/Models/Charts/AccelCharts.cs | 16 ++++ grapher/Models/Charts/ChartXY.cs | 33 +++++++ grapher/Models/Options/ApplyOptions.cs | 9 +- grapher/Models/Options/Option.cs | 1 - 7 files changed, 157 insertions(+), 78 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index c7ca617..9367fd1 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -50,9 +50,20 @@ namespace grapher /// Default horizontal separation between an option's label and box, in pixels. public const int OptionVerticalSeperation = 4; - /// Horizonatl separation between left side of single dropdown and left side of labels beneath dropdown + /// Horizontal separation between left side of single dropdown and left side of labels beneath dropdown public const int DropDownLeftSeparation = 10; + /// Width of charts when widened + public const int WideChartWidth = 810; + + /// Width of charts when widened + public const int WideChartLeft = 270; + + /// Width of charts when narrowed + public const int NarrowChartWidth = 698; + + public const int NarrowChartLeft = 482; + /// Format string for shortened x and y textboxes. public const string ShortenedFormatString = "0.###"; diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index b78b450..e60b74c 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -96,11 +96,11 @@ namespace grapher this.offsetStyleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.gainOffsetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.legacyOffsetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.startupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.AutoWriteMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.wholeVectorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.byVectorComponentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.startupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AutoWriteMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AccelerationChartY = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChartY = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.GainChartY = new System.Windows.Forms.DataVisualization.Charting.Chart(); @@ -137,6 +137,7 @@ namespace grapher this.OptionSetXTitle = new System.Windows.Forms.Label(); this.OptionSetYTitle = new System.Windows.Forms.Label(); this.AccelTypeActiveLabelY = new System.Windows.Forms.Label(); + this.ActiveValueTitleY = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VelocityChart)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.GainChart)).BeginInit(); @@ -154,7 +155,7 @@ namespace grapher this.AccelerationChart.ChartAreas.Add(chartArea1); legend1.Name = "Legend1"; this.AccelerationChart.Legends.Add(legend1); - this.AccelerationChart.Location = new System.Drawing.Point(432, 0); + this.AccelerationChart.Location = new System.Drawing.Point(482, 0); this.AccelerationChart.Name = "AccelerationChart"; series1.ChartArea = "ChartArea1"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; @@ -167,7 +168,7 @@ namespace grapher series2.Name = "LastAccelVal"; this.AccelerationChart.Series.Add(series1); this.AccelerationChart.Series.Add(series2); - this.AccelerationChart.Size = new System.Drawing.Size(723, 328); + this.AccelerationChart.Size = new System.Drawing.Size(698, 328); this.AccelerationChart.TabIndex = 0; this.AccelerationChart.Text = "Sensitivity"; // @@ -265,7 +266,7 @@ namespace grapher // // weightBoxY // - this.weightBoxY.Location = new System.Drawing.Point(267, 189); + this.weightBoxY.Location = new System.Drawing.Point(331, 189); this.weightBoxY.Name = "weightBoxY"; this.weightBoxY.Size = new System.Drawing.Size(76, 20); this.weightBoxY.TabIndex = 14; @@ -340,7 +341,7 @@ namespace grapher // // capBoxY // - this.capBoxY.Location = new System.Drawing.Point(267, 163); + this.capBoxY.Location = new System.Drawing.Point(331, 163); this.capBoxY.Name = "capBoxY"; this.capBoxY.Size = new System.Drawing.Size(76, 20); this.capBoxY.TabIndex = 23; @@ -350,7 +351,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(219, 49); + this.sensXYLock.Location = new System.Drawing.Point(282, 46); this.sensXYLock.Name = "sensXYLock"; this.sensXYLock.Size = new System.Drawing.Size(15, 14); this.sensXYLock.TabIndex = 24; @@ -359,7 +360,7 @@ namespace grapher // LockXYLabel // this.LockXYLabel.AutoSize = true; - this.LockXYLabel.Location = new System.Drawing.Point(195, 30); + this.LockXYLabel.Location = new System.Drawing.Point(255, 30); this.LockXYLabel.Name = "LockXYLabel"; this.LockXYLabel.Size = new System.Drawing.Size(60, 13); this.LockXYLabel.TabIndex = 27; @@ -373,7 +374,7 @@ namespace grapher this.VelocityChart.ChartAreas.Add(chartArea2); legend2.Name = "Legend1"; this.VelocityChart.Legends.Add(legend2); - this.VelocityChart.Location = new System.Drawing.Point(432, 334); + this.VelocityChart.Location = new System.Drawing.Point(482, 334); this.VelocityChart.Name = "VelocityChart"; series3.ChartArea = "ChartArea1"; series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; @@ -386,7 +387,7 @@ namespace grapher series4.Name = "LastVelocityVal"; this.VelocityChart.Series.Add(series3); this.VelocityChart.Series.Add(series4); - this.VelocityChart.Size = new System.Drawing.Size(723, 307); + this.VelocityChart.Size = new System.Drawing.Size(698, 307); this.VelocityChart.TabIndex = 28; this.VelocityChart.Text = "chart1"; // @@ -398,7 +399,7 @@ namespace grapher this.GainChart.ChartAreas.Add(chartArea3); legend3.Name = "Legend1"; this.GainChart.Legends.Add(legend3); - this.GainChart.Location = new System.Drawing.Point(432, 647); + this.GainChart.Location = new System.Drawing.Point(482, 647); this.GainChart.Name = "GainChart"; series5.ChartArea = "ChartArea1"; series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; @@ -411,7 +412,7 @@ namespace grapher series6.Name = "LastGainVal"; this.GainChart.Series.Add(series5); this.GainChart.Series.Add(series6); - this.GainChart.Size = new System.Drawing.Size(723, 309); + this.GainChart.Size = new System.Drawing.Size(698, 309); this.GainChart.TabIndex = 29; this.GainChart.Text = "chart1"; // @@ -505,7 +506,7 @@ namespace grapher this.gainCapToolStripMenuItem, this.legacyCapToolStripMenuItem}); this.capStyleToolStripMenuItem.Name = "capStyleToolStripMenuItem"; - this.capStyleToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.capStyleToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.capStyleToolStripMenuItem.Text = "Cap Style"; // // gainCapToolStripMenuItem @@ -528,7 +529,7 @@ namespace grapher this.gainOffsetToolStripMenuItem, this.legacyOffsetToolStripMenuItem}); this.offsetStyleToolStripMenuItem.Name = "offsetStyleToolStripMenuItem"; - this.offsetStyleToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.offsetStyleToolStripMenuItem.Size = new System.Drawing.Size(163, 22); this.offsetStyleToolStripMenuItem.Text = "Offset Style"; // // gainOffsetToolStripMenuItem @@ -543,23 +544,6 @@ namespace grapher this.legacyOffsetToolStripMenuItem.Size = new System.Drawing.Size(147, 22); this.legacyOffsetToolStripMenuItem.Text = "Legacy"; // - // startupToolStripMenuItem - // - this.startupToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.AutoWriteMenuItem}); - this.startupToolStripMenuItem.Name = "startupToolStripMenuItem"; - this.startupToolStripMenuItem.Size = new System.Drawing.Size(57, 20); - this.startupToolStripMenuItem.Text = "Startup"; - // - // AutoWriteMenuItem - // - this.AutoWriteMenuItem.Checked = true; - this.AutoWriteMenuItem.CheckOnClick = true; - this.AutoWriteMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.AutoWriteMenuItem.Name = "AutoWriteMenuItem"; - this.AutoWriteMenuItem.Size = new System.Drawing.Size(229, 22); - this.AutoWriteMenuItem.Text = "Apply Settings File on Startup"; - // // toolStripMenuItem1 // this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -584,6 +568,23 @@ namespace grapher this.byVectorComponentToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.byVectorComponentToolStripMenuItem.Text = "By Component"; // + // startupToolStripMenuItem + // + this.startupToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.AutoWriteMenuItem}); + this.startupToolStripMenuItem.Name = "startupToolStripMenuItem"; + this.startupToolStripMenuItem.Size = new System.Drawing.Size(57, 20); + this.startupToolStripMenuItem.Text = "Startup"; + // + // AutoWriteMenuItem + // + this.AutoWriteMenuItem.Checked = true; + this.AutoWriteMenuItem.CheckOnClick = true; + this.AutoWriteMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.AutoWriteMenuItem.Name = "AutoWriteMenuItem"; + this.AutoWriteMenuItem.Size = new System.Drawing.Size(229, 22); + this.AutoWriteMenuItem.Text = "Apply Settings File on Startup"; + // // AccelerationChartY // chartArea4.AxisX.Title = "Speed (counts/ms)"; @@ -592,7 +593,7 @@ namespace grapher this.AccelerationChartY.ChartAreas.Add(chartArea4); legend4.Name = "Legend1"; this.AccelerationChartY.Legends.Add(legend4); - this.AccelerationChartY.Location = new System.Drawing.Point(1161, 0); + this.AccelerationChartY.Location = new System.Drawing.Point(1186, 0); this.AccelerationChartY.Name = "AccelerationChartY"; series7.ChartArea = "ChartArea1"; series7.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; @@ -605,7 +606,7 @@ namespace grapher series8.Name = "LastAccelVal"; this.AccelerationChartY.Series.Add(series7); this.AccelerationChartY.Series.Add(series8); - this.AccelerationChartY.Size = new System.Drawing.Size(723, 328); + this.AccelerationChartY.Size = new System.Drawing.Size(698, 328); this.AccelerationChartY.TabIndex = 31; this.AccelerationChartY.Text = "chart1"; // @@ -617,7 +618,7 @@ namespace grapher this.VelocityChartY.ChartAreas.Add(chartArea5); legend5.Name = "Legend1"; this.VelocityChartY.Legends.Add(legend5); - this.VelocityChartY.Location = new System.Drawing.Point(1161, 334); + this.VelocityChartY.Location = new System.Drawing.Point(1186, 334); this.VelocityChartY.Name = "VelocityChartY"; series9.ChartArea = "ChartArea1"; series9.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; @@ -630,7 +631,7 @@ namespace grapher series10.Name = "LastVelocityVal"; this.VelocityChartY.Series.Add(series9); this.VelocityChartY.Series.Add(series10); - this.VelocityChartY.Size = new System.Drawing.Size(723, 307); + this.VelocityChartY.Size = new System.Drawing.Size(698, 307); this.VelocityChartY.TabIndex = 32; this.VelocityChartY.Text = "chart1"; // @@ -642,7 +643,7 @@ namespace grapher this.GainChartY.ChartAreas.Add(chartArea6); legend6.Name = "Legend1"; this.GainChartY.Legends.Add(legend6); - this.GainChartY.Location = new System.Drawing.Point(1161, 647); + this.GainChartY.Location = new System.Drawing.Point(1186, 647); this.GainChartY.Name = "GainChartY"; series11.ChartArea = "ChartArea1"; series11.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; @@ -655,7 +656,7 @@ namespace grapher series12.Name = "LastGainVal"; this.GainChartY.Series.Add(series11); this.GainChartY.Series.Add(series12); - this.GainChartY.Size = new System.Drawing.Size(723, 309); + this.GainChartY.Size = new System.Drawing.Size(698, 309); this.GainChartY.TabIndex = 33; this.GainChartY.Text = "chart1"; // @@ -671,16 +672,16 @@ namespace grapher // ActiveValueTitle // this.ActiveValueTitle.AutoSize = true; - this.ActiveValueTitle.Location = new System.Drawing.Point(359, 30); + this.ActiveValueTitle.Location = new System.Drawing.Point(187, 30); this.ActiveValueTitle.Name = "ActiveValueTitle"; - this.ActiveValueTitle.Size = new System.Drawing.Size(67, 13); + this.ActiveValueTitle.Size = new System.Drawing.Size(37, 13); this.ActiveValueTitle.TabIndex = 35; - this.ActiveValueTitle.Text = "Active Value"; + this.ActiveValueTitle.Text = "Active"; // // SensitivityActiveXLabel // this.SensitivityActiveXLabel.AutoSize = true; - this.SensitivityActiveXLabel.Location = new System.Drawing.Point(359, 53); + this.SensitivityActiveXLabel.Location = new System.Drawing.Point(187, 49); this.SensitivityActiveXLabel.Name = "SensitivityActiveXLabel"; this.SensitivityActiveXLabel.Size = new System.Drawing.Size(14, 13); this.SensitivityActiveXLabel.TabIndex = 36; @@ -689,7 +690,7 @@ namespace grapher // SensitivityActiveYLabel // this.SensitivityActiveYLabel.AutoSize = true; - this.SensitivityActiveYLabel.Location = new System.Drawing.Point(403, 53); + this.SensitivityActiveYLabel.Location = new System.Drawing.Point(216, 49); this.SensitivityActiveYLabel.Name = "SensitivityActiveYLabel"; this.SensitivityActiveYLabel.Size = new System.Drawing.Size(14, 13); this.SensitivityActiveYLabel.TabIndex = 37; @@ -698,7 +699,7 @@ namespace grapher // RotationActiveLabel // this.RotationActiveLabel.AutoSize = true; - this.RotationActiveLabel.Location = new System.Drawing.Point(384, 75); + this.RotationActiveLabel.Location = new System.Drawing.Point(196, 75); this.RotationActiveLabel.Name = "RotationActiveLabel"; this.RotationActiveLabel.Size = new System.Drawing.Size(13, 13); this.RotationActiveLabel.TabIndex = 38; @@ -707,16 +708,16 @@ namespace grapher // AccelTypeActiveLabelX // this.AccelTypeActiveLabelX.AutoSize = true; - this.AccelTypeActiveLabelX.Location = new System.Drawing.Point(359, 113); + this.AccelTypeActiveLabelX.Location = new System.Drawing.Point(196, 113); this.AccelTypeActiveLabelX.Name = "AccelTypeActiveLabelX"; - this.AccelTypeActiveLabelX.Size = new System.Drawing.Size(13, 13); + this.AccelTypeActiveLabelX.Size = new System.Drawing.Size(66, 13); this.AccelTypeActiveLabelX.TabIndex = 39; - this.AccelTypeActiveLabelX.Text = "0"; + this.AccelTypeActiveLabelX.Text = "SigmoidGain"; // // AccelerationActiveLabelX // this.AccelerationActiveLabelX.AutoSize = true; - this.AccelerationActiveLabelX.Location = new System.Drawing.Point(359, 140); + this.AccelerationActiveLabelX.Location = new System.Drawing.Point(196, 140); this.AccelerationActiveLabelX.Name = "AccelerationActiveLabelX"; this.AccelerationActiveLabelX.Size = new System.Drawing.Size(13, 13); this.AccelerationActiveLabelX.TabIndex = 40; @@ -725,7 +726,7 @@ namespace grapher // CapActiveXLabel // this.CapActiveXLabel.AutoSize = true; - this.CapActiveXLabel.Location = new System.Drawing.Point(359, 166); + this.CapActiveXLabel.Location = new System.Drawing.Point(196, 166); this.CapActiveXLabel.Name = "CapActiveXLabel"; this.CapActiveXLabel.Size = new System.Drawing.Size(13, 13); this.CapActiveXLabel.TabIndex = 41; @@ -734,7 +735,7 @@ namespace grapher // WeightActiveXLabel // this.WeightActiveXLabel.AutoSize = true; - this.WeightActiveXLabel.Location = new System.Drawing.Point(359, 192); + this.WeightActiveXLabel.Location = new System.Drawing.Point(196, 192); this.WeightActiveXLabel.Name = "WeightActiveXLabel"; this.WeightActiveXLabel.Size = new System.Drawing.Size(13, 13); this.WeightActiveXLabel.TabIndex = 42; @@ -743,7 +744,7 @@ namespace grapher // WeightActiveYLabel // this.WeightActiveYLabel.AutoSize = true; - this.WeightActiveYLabel.Location = new System.Drawing.Point(403, 192); + this.WeightActiveYLabel.Location = new System.Drawing.Point(413, 192); this.WeightActiveYLabel.Name = "WeightActiveYLabel"; this.WeightActiveYLabel.Size = new System.Drawing.Size(13, 13); this.WeightActiveYLabel.TabIndex = 43; @@ -752,7 +753,7 @@ namespace grapher // CapActiveYLabel // this.CapActiveYLabel.AutoSize = true; - this.CapActiveYLabel.Location = new System.Drawing.Point(403, 166); + this.CapActiveYLabel.Location = new System.Drawing.Point(413, 166); this.CapActiveYLabel.Name = "CapActiveYLabel"; this.CapActiveYLabel.Size = new System.Drawing.Size(13, 13); this.CapActiveYLabel.TabIndex = 44; @@ -761,7 +762,7 @@ namespace grapher // OffsetActiveXLabel // this.OffsetActiveXLabel.AutoSize = true; - this.OffsetActiveXLabel.Location = new System.Drawing.Point(359, 218); + this.OffsetActiveXLabel.Location = new System.Drawing.Point(196, 218); this.OffsetActiveXLabel.Name = "OffsetActiveXLabel"; this.OffsetActiveXLabel.Size = new System.Drawing.Size(13, 13); this.OffsetActiveXLabel.TabIndex = 45; @@ -770,7 +771,7 @@ namespace grapher // LimitExpActiveXLabel // this.LimitExpActiveXLabel.AutoSize = true; - this.LimitExpActiveXLabel.Location = new System.Drawing.Point(359, 244); + this.LimitExpActiveXLabel.Location = new System.Drawing.Point(196, 244); this.LimitExpActiveXLabel.Name = "LimitExpActiveXLabel"; this.LimitExpActiveXLabel.Size = new System.Drawing.Size(13, 13); this.LimitExpActiveXLabel.TabIndex = 46; @@ -779,7 +780,7 @@ namespace grapher // MidpointActiveXLabel // this.MidpointActiveXLabel.AutoSize = true; - this.MidpointActiveXLabel.Location = new System.Drawing.Point(360, 270); + this.MidpointActiveXLabel.Location = new System.Drawing.Point(196, 270); this.MidpointActiveXLabel.Name = "MidpointActiveXLabel"; this.MidpointActiveXLabel.Size = new System.Drawing.Size(13, 13); this.MidpointActiveXLabel.TabIndex = 47; @@ -787,28 +788,28 @@ namespace grapher // // accelerationBoxY // - this.accelerationBoxY.Location = new System.Drawing.Point(267, 137); + this.accelerationBoxY.Location = new System.Drawing.Point(331, 137); this.accelerationBoxY.Name = "accelerationBoxY"; this.accelerationBoxY.Size = new System.Drawing.Size(76, 20); this.accelerationBoxY.TabIndex = 48; // // offsetBoxY // - this.offsetBoxY.Location = new System.Drawing.Point(267, 215); + this.offsetBoxY.Location = new System.Drawing.Point(331, 215); this.offsetBoxY.Name = "offsetBoxY"; this.offsetBoxY.Size = new System.Drawing.Size(76, 20); this.offsetBoxY.TabIndex = 49; // // limitBoxY // - this.limitBoxY.Location = new System.Drawing.Point(267, 241); + this.limitBoxY.Location = new System.Drawing.Point(331, 241); this.limitBoxY.Name = "limitBoxY"; this.limitBoxY.Size = new System.Drawing.Size(76, 20); this.limitBoxY.TabIndex = 50; // // midpointBoxY // - this.midpointBoxY.Location = new System.Drawing.Point(267, 267); + this.midpointBoxY.Location = new System.Drawing.Point(331, 267); this.midpointBoxY.Name = "midpointBoxY"; this.midpointBoxY.Size = new System.Drawing.Size(76, 20); this.midpointBoxY.TabIndex = 51; @@ -816,7 +817,7 @@ namespace grapher // accelTypeDropY // this.accelTypeDropY.FormattingEnabled = true; - this.accelTypeDropY.Location = new System.Drawing.Point(267, 110); + this.accelTypeDropY.Location = new System.Drawing.Point(331, 110); this.accelTypeDropY.Name = "accelTypeDropY"; this.accelTypeDropY.Size = new System.Drawing.Size(76, 21); this.accelTypeDropY.TabIndex = 52; @@ -825,7 +826,7 @@ namespace grapher // AccelerationActiveLabelY // this.AccelerationActiveLabelY.AutoSize = true; - this.AccelerationActiveLabelY.Location = new System.Drawing.Point(403, 140); + this.AccelerationActiveLabelY.Location = new System.Drawing.Point(413, 140); this.AccelerationActiveLabelY.Name = "AccelerationActiveLabelY"; this.AccelerationActiveLabelY.Size = new System.Drawing.Size(13, 13); this.AccelerationActiveLabelY.TabIndex = 53; @@ -834,7 +835,7 @@ namespace grapher // OffsetActiveYLabel // this.OffsetActiveYLabel.AutoSize = true; - this.OffsetActiveYLabel.Location = new System.Drawing.Point(403, 218); + this.OffsetActiveYLabel.Location = new System.Drawing.Point(413, 218); this.OffsetActiveYLabel.Name = "OffsetActiveYLabel"; this.OffsetActiveYLabel.Size = new System.Drawing.Size(13, 13); this.OffsetActiveYLabel.TabIndex = 54; @@ -843,7 +844,7 @@ namespace grapher // LimitExpActiveYLabel // this.LimitExpActiveYLabel.AutoSize = true; - this.LimitExpActiveYLabel.Location = new System.Drawing.Point(403, 244); + this.LimitExpActiveYLabel.Location = new System.Drawing.Point(413, 244); this.LimitExpActiveYLabel.Name = "LimitExpActiveYLabel"; this.LimitExpActiveYLabel.Size = new System.Drawing.Size(13, 13); this.LimitExpActiveYLabel.TabIndex = 55; @@ -852,7 +853,7 @@ namespace grapher // MidpointActiveYLabel // this.MidpointActiveYLabel.AutoSize = true; - this.MidpointActiveYLabel.Location = new System.Drawing.Point(403, 270); + this.MidpointActiveYLabel.Location = new System.Drawing.Point(413, 270); this.MidpointActiveYLabel.Name = "MidpointActiveYLabel"; this.MidpointActiveYLabel.Size = new System.Drawing.Size(13, 13); this.MidpointActiveYLabel.TabIndex = 56; @@ -863,7 +864,7 @@ namespace grapher this.ByComponentXYLock.AutoSize = true; this.ByComponentXYLock.Checked = true; this.ByComponentXYLock.CheckState = System.Windows.Forms.CheckState.Checked; - this.ByComponentXYLock.Location = new System.Drawing.Point(219, 113); + this.ByComponentXYLock.Location = new System.Drawing.Point(282, 93); this.ByComponentXYLock.Name = "ByComponentXYLock"; this.ByComponentXYLock.Size = new System.Drawing.Size(15, 14); this.ByComponentXYLock.TabIndex = 57; @@ -872,7 +873,7 @@ namespace grapher // constantOneLabelY // this.constantOneLabelY.AutoSize = true; - this.constantOneLabelY.Location = new System.Drawing.Point(195, 140); + this.constantOneLabelY.Location = new System.Drawing.Point(258, 140); this.constantOneLabelY.Name = "constantOneLabelY"; this.constantOneLabelY.Size = new System.Drawing.Size(66, 13); this.constantOneLabelY.TabIndex = 58; @@ -881,7 +882,7 @@ namespace grapher // capLabelY // this.capLabelY.AutoSize = true; - this.capLabelY.Location = new System.Drawing.Point(208, 166); + this.capLabelY.Location = new System.Drawing.Point(279, 166); this.capLabelY.Name = "capLabelY"; this.capLabelY.Size = new System.Drawing.Size(26, 13); this.capLabelY.TabIndex = 59; @@ -890,7 +891,7 @@ namespace grapher // weightLabelY // this.weightLabelY.AutoSize = true; - this.weightLabelY.Location = new System.Drawing.Point(202, 192); + this.weightLabelY.Location = new System.Drawing.Point(264, 192); this.weightLabelY.Name = "weightLabelY"; this.weightLabelY.Size = new System.Drawing.Size(41, 13); this.weightLabelY.TabIndex = 60; @@ -899,7 +900,7 @@ namespace grapher // offsetLabelY // this.offsetLabelY.AutoSize = true; - this.offsetLabelY.Location = new System.Drawing.Point(208, 218); + this.offsetLabelY.Location = new System.Drawing.Point(270, 218); this.offsetLabelY.Name = "offsetLabelY"; this.offsetLabelY.Size = new System.Drawing.Size(35, 13); this.offsetLabelY.TabIndex = 61; @@ -908,7 +909,7 @@ namespace grapher // constantTwoLabelY // this.constantTwoLabelY.AutoSize = true; - this.constantTwoLabelY.Location = new System.Drawing.Point(196, 244); + this.constantTwoLabelY.Location = new System.Drawing.Point(264, 244); this.constantTwoLabelY.Name = "constantTwoLabelY"; this.constantTwoLabelY.Size = new System.Drawing.Size(51, 13); this.constantTwoLabelY.TabIndex = 62; @@ -917,7 +918,7 @@ namespace grapher // constantThreeLabelY // this.constantThreeLabelY.AutoSize = true; - this.constantThreeLabelY.Location = new System.Drawing.Point(200, 270); + this.constantThreeLabelY.Location = new System.Drawing.Point(264, 270); this.constantThreeLabelY.Name = "constantThreeLabelY"; this.constantThreeLabelY.Size = new System.Drawing.Size(47, 13); this.constantThreeLabelY.TabIndex = 63; @@ -935,7 +936,7 @@ namespace grapher // OptionSetYTitle // this.OptionSetYTitle.AutoSize = true; - this.OptionSetYTitle.Location = new System.Drawing.Point(300, 94); + this.OptionSetYTitle.Location = new System.Drawing.Point(359, 94); this.OptionSetYTitle.Name = "OptionSetYTitle"; this.OptionSetYTitle.Size = new System.Drawing.Size(14, 13); this.OptionSetYTitle.TabIndex = 65; @@ -944,17 +945,27 @@ namespace grapher // AccelTypeActiveLabelY // this.AccelTypeActiveLabelY.AutoSize = true; - this.AccelTypeActiveLabelY.Location = new System.Drawing.Point(403, 113); + this.AccelTypeActiveLabelY.Location = new System.Drawing.Point(413, 113); this.AccelTypeActiveLabelY.Name = "AccelTypeActiveLabelY"; - this.AccelTypeActiveLabelY.Size = new System.Drawing.Size(13, 13); + this.AccelTypeActiveLabelY.Size = new System.Drawing.Size(66, 13); this.AccelTypeActiveLabelY.TabIndex = 66; - this.AccelTypeActiveLabelY.Text = "0"; + this.AccelTypeActiveLabelY.Text = "SigmoidGain"; + // + // ActiveValueTitleY + // + this.ActiveValueTitleY.AutoSize = true; + this.ActiveValueTitleY.Location = new System.Drawing.Point(428, 30); + this.ActiveValueTitleY.Name = "ActiveValueTitleY"; + this.ActiveValueTitleY.Size = new System.Drawing.Size(37, 13); + this.ActiveValueTitleY.TabIndex = 67; + this.ActiveValueTitleY.Text = "Active"; // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1884, 956); + this.Controls.Add(this.ActiveValueTitleY); this.Controls.Add(this.AccelTypeActiveLabelY); this.Controls.Add(this.OptionSetYTitle); this.Controls.Add(this.OptionSetXTitle); @@ -1121,6 +1132,7 @@ namespace grapher private System.Windows.Forms.ToolStripMenuItem gainOffsetToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem legacyOffsetToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; + private System.Windows.Forms.Label ActiveValueTitleY; } } diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 5d52f2e..7dbf200 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -268,7 +268,8 @@ namespace grapher.Models byVectorComponentToolStripMenuItem, byComponentXYLock, optionsSetX, - optionsSetY); + optionsSetY, + accelCharts); var accelCalculator = new AccelCalculator( new Field(dpiTextBox.TextBox, form, Constants.DefaultDPI), diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 5e4b3de..6d9f0a1 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -132,6 +132,22 @@ namespace grapher } } + public void SetWidened() + { + SensitivityChart.SetWidened(); + VelocityChart.SetWidened(); + GainChart.SetWidened(); + UpdateFormWidth(); + } + + public void SetNarrowed() + { + SensitivityChart.SetNarrowed(); + VelocityChart.SetNarrowed(); + GainChart.SetNarrowed(); + UpdateFormWidth(); + } + private void OnEnableClick(object sender, EventArgs e) { EnableVelocityAndGain.Checked = !EnableVelocityAndGain.Checked; diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 6a65e41..7998f7f 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -29,6 +29,9 @@ namespace grapher SetupChart(ChartX); SetupChart(ChartY); + + Widened = false; + SetWidened(); } #endregion Constructors @@ -76,6 +79,8 @@ namespace grapher public bool Combined { get; private set; } + public bool Widened { get; private set; } + private PointData CombinedPointData { get; set; } private PointData XPointData { get; set; } @@ -174,6 +179,34 @@ namespace grapher } } + public void SetWidened() + { + if (!Widened) + { + ChartX.Width = Constants.WideChartWidth; + ChartY.Width = Constants.WideChartWidth; + + ChartX.Left = Constants.WideChartLeft; + ChartY.Left = ChartX.Left + ChartX.Width + Constants.ChartSeparationHorizontal; + + Widened = true; + } + } + + public void SetNarrowed() + { + if (Widened) + { + ChartX.Width = Constants.NarrowChartWidth; + ChartY.Width = Constants.NarrowChartWidth; + + ChartX.Left = Constants.NarrowChartLeft; + ChartY.Left = ChartX.Left + ChartX.Width + Constants.ChartSeparationHorizontal; + + Widened = false; + } + } + public void Hide() { ChartX.Hide(); diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 68f06fb..96d598d 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -18,7 +18,8 @@ namespace grapher.Models.Options ToolStripMenuItem byComponentMenuItem, CheckBox byComponentVectorXYLock, AccelOptionSet optionSetX, - AccelOptionSet optionSetY) + AccelOptionSet optionSetY, + AccelCharts accelCharts) { WholeVectorMenuItem = wholeVectorMenuItem; ByComponentVectorMenuItem = byComponentMenuItem; @@ -32,6 +33,7 @@ namespace grapher.Models.Options ByComponentVectorXYLock = byComponentVectorXYLock; OptionSetX = optionSetX; OptionSetY = optionSetY; + AccelCharts = accelCharts; ByComponentVectorXYLock.CheckedChanged += new System.EventHandler(OnByComponentXYLockChecked); ByComponentVectorXYLock.Checked = true; @@ -53,6 +55,8 @@ namespace grapher.Models.Options public AccelOptionSet OptionSetY { get; } + public AccelCharts AccelCharts { get; } + public bool IsWhole { get; private set; } #endregion Properties @@ -130,12 +134,14 @@ namespace grapher.Models.Options { OptionSetX.SetRegularMode(); OptionSetY.Hide(); + AccelCharts.SetWidened(); } public void ShowByComponentAsOneSet() { OptionSetX.SetTitleMode("X = Y"); OptionSetY.Hide(); + AccelCharts.SetWidened(); } public void ShowByComponentAsTwoSets() @@ -143,6 +149,7 @@ namespace grapher.Models.Options OptionSetX.SetTitleMode("X"); OptionSetY.SetTitleMode("Y"); OptionSetY.Show(); + AccelCharts.SetNarrowed(); } public void ShowByComponentSet() diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index 5355a8a..3c7b2ec 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -112,7 +112,6 @@ namespace grapher } set { - Field.Width = value; } } -- cgit v1.2.3 From f2322540dd904474587ddebfa8d96dc66a902530 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 00:51:05 -0700 Subject: Alignment for whole mode works --- grapher/Constants/Constants.cs | 4 +-- grapher/Form1.Designer.cs | 1 - grapher/Form1.cs | 7 ++-- grapher/Models/AccelGUI.cs | 20 +++-------- grapher/Models/AccelGUIFactory.cs | 9 +++-- grapher/Models/Options/AccelOptionSet.cs | 35 ++++++++++++------ grapher/Models/Options/AccelTypeOptions.cs | 35 +++++++++--------- grapher/Models/Options/ActiveValueLabel.cs | 12 +++++++ grapher/Models/Options/ActiveValueLabelXY.cs | 27 ++++++++++++-- grapher/Models/Options/ApplyOptions.cs | 54 ++++++++++++++++++++++++++-- grapher/Models/Options/CapOptions.cs | 5 +++ grapher/Models/Options/OffsetOptions.cs | 5 +++ grapher/Models/Options/Option.cs | 10 +++++- grapher/Models/Options/OptionBase.cs | 2 ++ grapher/Models/Options/OptionXY.cs | 5 +++ 15 files changed, 174 insertions(+), 57 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 9367fd1..887c8aa 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -54,10 +54,10 @@ namespace grapher public const int DropDownLeftSeparation = 10; /// Width of charts when widened - public const int WideChartWidth = 810; + public const int WideChartWidth = 723; /// Width of charts when widened - public const int WideChartLeft = 270; + public const int WideChartLeft = 333; /// Width of charts when narrowed public const int NarrowChartWidth = 698; diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index e60b74c..6ad2953 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -1131,7 +1131,6 @@ namespace grapher private System.Windows.Forms.ToolStripMenuItem offsetStyleToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem gainOffsetToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem legacyOffsetToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; private System.Windows.Forms.Label ActiveValueTitleY; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index a4c32cd..1bdb05c 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -37,11 +37,6 @@ namespace grapher throw; } - ActiveValueTitle.AutoSize = false; - ActiveValueTitle.Left = accelerationBoxY.Left + accelerationBoxY.Width; - ActiveValueTitle.Width = AccelerationChart.Left - ActiveValueTitle.Left; - ActiveValueTitle.TextAlign = ContentAlignment.MiddleCenter; - AccelGUI = AccelGUIFactory.Construct( this, activeAccel, @@ -82,6 +77,7 @@ namespace grapher midpointBoxY, sensXYLock, ByComponentXYLock, + LockXYLabel, sensitivityLabel, rotationLabel, weightLabelX, @@ -97,6 +93,7 @@ namespace grapher constantThreeLabelX, constantThreeLabelY, ActiveValueTitle, + ActiveValueTitleY, SensitivityActiveXLabel, SensitivityActiveYLabel, RotationActiveLabel, diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index e9e925f..36938b6 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -25,8 +25,6 @@ namespace grapher AccelCharts accelCharts, SettingsManager settings, ApplyOptions applyOptions, - OptionXY sensitivity, - Option rotation, Button writeButton, Label mouseMoveLabel, ToolStripMenuItem scaleMenuItem) @@ -35,8 +33,6 @@ namespace grapher AccelCalculator = accelCalculator; AccelCharts = accelCharts; ApplyOptions = applyOptions; - Sensitivity = sensitivity; - Rotation = rotation; WriteButton = writeButton; ScaleMenuItem = scaleMenuItem; Settings = settings; @@ -62,10 +58,6 @@ namespace grapher public ApplyOptions ApplyOptions { get; } - public OptionXY Sensitivity { get; } - - public Option Rotation { get; } - public Button WriteButton { get; } public MouseWatcher MouseWatcher { get; } @@ -80,11 +72,11 @@ namespace grapher { var settings = new DriverSettings { - rotation = Rotation.Field.Data, + rotation = ApplyOptions.Rotation.Field.Data, sensitivity = new Vec2 { - x = Sensitivity.Fields.X, - y = Sensitivity.Fields.Y + x = ApplyOptions.Sensitivity.Fields.X, + y = ApplyOptions.Sensitivity.Fields.Y }, combineMagnitudes = ApplyOptions.IsWhole, modes = ApplyOptions.GetModes(), @@ -120,11 +112,7 @@ namespace grapher public void UpdateShownActiveValues() { - var settings = Settings.RawAccelSettings.AccelerationSettings; - - Sensitivity.SetActiveValues(settings.sensitivity.x, settings.sensitivity.y); - Rotation.SetActiveValue(settings.rotation); - ApplyOptions.SetActiveValues(settings); + ApplyOptions.SetActiveValues(Settings.RawAccelSettings.AccelerationSettings); } private void OnScaleMenuItemClick(object sender, EventArgs e) diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 7dbf200..05cea70 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -55,6 +55,7 @@ namespace grapher.Models TextBox midpointBoxY, CheckBox sensXYLock, CheckBox byComponentXYLock, + Label lockXYLabel, Label sensitivityLabel, Label rotationLabel, Label weightLabelX, @@ -70,6 +71,7 @@ namespace grapher.Models Label constantThreeLabelX, Label constantThreeLabelY, Label activeValueTitle, + Label activeValueTitleY, Label sensitivityActiveXLabel, Label sensitivityActiveYLabel, Label rotationActiveLabel, @@ -255,11 +257,13 @@ namespace grapher.Models var optionsSetX = new AccelOptionSet( optionSetXTitle, + activeValueTitle, rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, accelerationOptionsX); var optionsSetY = new AccelOptionSet( optionSetYTitle, + activeValueTitleY, rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, accelerationOptionsY); @@ -269,6 +273,9 @@ namespace grapher.Models byComponentXYLock, optionsSetX, optionsSetY, + sensitivity, + rotation, + lockXYLabel, accelCharts); var accelCalculator = new AccelCalculator( @@ -287,8 +294,6 @@ namespace grapher.Models accelCharts, settings, applyOptions, - sensitivity, - rotation, writeButton, mouseLabel, scaleMenuItem); diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index 8c7b303..2a1436f 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -1,6 +1,7 @@ using grapher.Models.Serialized; using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -11,24 +12,31 @@ namespace grapher.Models.Options public class AccelOptionSet { public AccelOptionSet( - Label titleLabel, + Label title, + Label activeValuesTitle, int topAnchor, AccelTypeOptions accelTypeOptions) { - TitleLabel = titleLabel; + OptionsTitle = title; + ActiveValuesTitle = activeValuesTitle; TopAnchor = topAnchor; Options = accelTypeOptions; + ActiveValuesTitle.AutoSize = false; + ActiveValuesTitle.TextAlign = ContentAlignment.MiddleCenter; + Options.ShowFull(); - TitleLabel.Top = TopAnchor; + OptionsTitle.Top = TopAnchor; IsTitleMode = true; SetRegularMode(); } public int TopAnchor { get; } - public Label TitleLabel { get; } + public Label OptionsTitle { get; } + + public Label ActiveValuesTitle { get; } public AccelTypeOptions Options { get; } @@ -48,7 +56,7 @@ namespace grapher.Models.Options public void SetTitleMode(string title) { - TitleLabel.Text = title; + OptionsTitle.Text = title; if (!IsTitleMode) { @@ -61,7 +69,8 @@ namespace grapher.Models.Options public void Hide() { - TitleLabel.Hide(); + OptionsTitle.Hide(); + ActiveValuesTitle.Hide(); Options.Hide(); } @@ -69,22 +78,23 @@ namespace grapher.Models.Options { if (IsTitleMode) { - TitleLabel.Show(); + OptionsTitle.Show(); } + ActiveValuesTitle.Show(); Options.Show(); } public void DisplayTitle() { - TitleLabel.Show(); + OptionsTitle.Show(); - Options.Top = TitleLabel.Top + TitleLabel.Height + Constants.OptionVerticalSeperation; + Options.Top = OptionsTitle.Top + OptionsTitle.Height + Constants.OptionVerticalSeperation; } public void HideTitle() { - TitleLabel.Hide(); + OptionsTitle.Hide(); Options.Top = TopAnchor; } @@ -103,5 +113,10 @@ namespace grapher.Models.Options { Options.SetActiveValues(mode, args); } + + public void AlignActiveValuesByTitle() + { + Options.AlignActiveValues(ActiveValuesTitle.Width); + } } } diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index a5ed474..6a5dbc8 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -38,7 +38,7 @@ namespace grapher Option limitOrExponent, Option midpoint, Button writeButton, - ActiveValueLabel activeValueLabel) + ActiveValueLabel accelTypeActiveValue) { AccelDropdown = accelDropdown; AccelDropdown.Items.Clear(); @@ -52,17 +52,7 @@ namespace grapher LimitOrExponent = limitOrExponent; Midpoint = midpoint; WriteButton = writeButton; - ActiveValueLabel = activeValueLabel; - - Options = new List - { - Acceleration, - Cap, - Offset, - Weight, - LimitOrExponent, - Midpoint, - }; + AccelTypeActiveValue = accelTypeActiveValue; Layout("Off"); ShowingDefault = true; @@ -86,7 +76,7 @@ namespace grapher public LayoutBase AccelerationType { get; private set; } - public ActiveValueLabel ActiveValueLabel { get; } + public ActiveValueLabel AccelTypeActiveValue { get; } public Option Acceleration { get; } @@ -100,8 +90,6 @@ namespace grapher public Option Midpoint { get; } - private IEnumerable Options { get; } - public override int Top { get @@ -111,6 +99,7 @@ namespace grapher set { AccelDropdown.Top = value; + AccelTypeActiveValue.Top = value; Layout(value + AccelDropdown.Height + Constants.OptionVerticalSeperation); } } @@ -132,6 +121,7 @@ namespace grapher set { AccelDropdown.Left = value; + AccelTypeActiveValue.Left = AccelDropdown.Left + Width; } } @@ -144,6 +134,7 @@ namespace grapher set { AccelDropdown.Width = value; + AccelTypeActiveValue.Left = Left + AccelDropdown.Width; } } @@ -187,7 +178,7 @@ namespace grapher public void SetActiveValues(int index, AccelArgs args) { var name = AccelerationTypes.Where(t => t.Value.Index == index).FirstOrDefault().Value.Name; - ActiveValueLabel.SetValue(name); + AccelTypeActiveValue.SetValue(name); Weight.SetActiveValue(args.weight); Cap.SetActiveValues(args.gainCap, args.scaleCap, args.gainCap > 0); @@ -242,6 +233,18 @@ namespace grapher return args; } + public override void AlignActiveValues(int width) + { + AccelTypeActiveValue.Width = width; + + Acceleration.AlignActiveValues(width); + Cap.AlignActiveValues(width); + Offset.AlignActiveValues(width); + Weight.AlignActiveValues(width); + LimitOrExponent.AlignActiveValues(width); + Midpoint.AlignActiveValues(width); + } + private void OnIndexChanged(object sender, EventArgs e) { var accelerationTypeString = AccelDropdown.SelectedItem.ToString(); diff --git a/grapher/Models/Options/ActiveValueLabel.cs b/grapher/Models/Options/ActiveValueLabel.cs index d2b43ab..39af325 100644 --- a/grapher/Models/Options/ActiveValueLabel.cs +++ b/grapher/Models/Options/ActiveValueLabel.cs @@ -91,6 +91,18 @@ namespace grapher.Models.Options } } + public int Top + { + get + { + return ValueLabel.Top; + } + set + { + ValueLabel.Top = value; + } + } + #endregion Properties #region Methods diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs index c8caddf..3f94847 100644 --- a/grapher/Models/Options/ActiveValueLabelXY.cs +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -43,9 +43,9 @@ namespace grapher.Models.Options public bool Combined { get; private set; } - private int FullWidth { get; } + private int FullWidth { get; set; } - private int ShortenedWidth { get; } + private int ShortenedWidth { get; set; } #endregion Properties @@ -93,6 +93,29 @@ namespace grapher.Models.Options Combined = false; } + public void AlignActiveValues(int width) + { + Align(width); + + if (Combined) + { + X.Width = FullWidth; + } + else + { + X.Width = ShortenedWidth; + } + } + + private void Align (int width) + { + FullWidth = width; + ShortenedWidth = (FullWidth - Constants.ActiveLabelXYSeparation) / 2; + + Y.Left = X.Left + ShortenedWidth + Constants.ActiveLabelXYSeparation; + Y.Width = ShortenedWidth; + } + #endregion Methods } } diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 96d598d..76a3bb8 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -1,6 +1,7 @@ using grapher.Models.Serialized; using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -19,6 +20,9 @@ namespace grapher.Models.Options CheckBox byComponentVectorXYLock, AccelOptionSet optionSetX, AccelOptionSet optionSetY, + OptionXY sensitivity, + Option rotation, + Label lockXYLabel, AccelCharts accelCharts) { WholeVectorMenuItem = wholeVectorMenuItem; @@ -33,8 +37,14 @@ namespace grapher.Models.Options ByComponentVectorXYLock = byComponentVectorXYLock; OptionSetX = optionSetX; OptionSetY = optionSetY; + Sensitivity = sensitivity; + Rotation = rotation; + LockXYLabel = lockXYLabel; AccelCharts = accelCharts; + LockXYLabel.AutoSize = false; + LockXYLabel.TextAlign = ContentAlignment.MiddleCenter; + ByComponentVectorXYLock.CheckedChanged += new System.EventHandler(OnByComponentXYLockChecked); ByComponentVectorXYLock.Checked = true; @@ -55,8 +65,16 @@ namespace grapher.Models.Options public AccelOptionSet OptionSetY { get; } + public OptionXY Sensitivity { get; } + + public Option Rotation { get; } + public AccelCharts AccelCharts { get; } + public Label ActiveValueTitleY { get; } + + public Label LockXYLabel { get; } + public bool IsWhole { get; private set; } #endregion Properties @@ -86,8 +104,18 @@ namespace grapher.Models.Options } - public void SetActiveValues(int xMode, int yMode, AccelArgs xArgs, AccelArgs yArgs, bool isWhole) + public void SetActiveValues( + double xSens, + double ySens, + double rotation, + int xMode, + int yMode, + AccelArgs xArgs, + AccelArgs yArgs, + bool isWhole) { + Sensitivity.SetActiveValues(xSens, ySens); + Rotation.SetActiveValue(rotation); OptionSetX.SetActiveValues(xMode, xArgs); OptionSetY.SetActiveValues(yMode, yArgs); WholeVectorMenuItem.Checked = isWhole; @@ -96,7 +124,15 @@ namespace grapher.Models.Options public void SetActiveValues(DriverSettings settings) { - SetActiveValues((int)settings.modes.x, (int)settings.modes.y, settings.args.x, settings.args.y, settings.combineMagnitudes); + SetActiveValues( + settings.sensitivity.x, + settings.sensitivity.x, + settings.rotation, + (int)settings.modes.x, + (int)settings.modes.y, + settings.args.x, + settings.args.y, + settings.combineMagnitudes); } public void OnWholeClicked(object sender, EventArgs e) @@ -135,6 +171,7 @@ namespace grapher.Models.Options OptionSetX.SetRegularMode(); OptionSetY.Hide(); AccelCharts.SetWidened(); + SetActiveTitlesWhole(); } public void ShowByComponentAsOneSet() @@ -186,6 +223,19 @@ namespace grapher.Models.Options ShowByComponentSet(); } + private void SetActiveTitlesWhole() + { + OptionSetX.ActiveValuesTitle.Left = OptionSetX.Options.Left + OptionSetX.Options.Width; + LockXYLabel.Width = (AccelCharts.SensitivityChart.Left - OptionSetX.ActiveValuesTitle.Left) / 2; + OptionSetX.ActiveValuesTitle.Width = LockXYLabel.Width; + LockXYLabel.Left = OptionSetX.ActiveValuesTitle.Left + OptionSetX.ActiveValuesTitle.Width; + Sensitivity.Fields.LockCheckBox.Left = LockXYLabel.Left + LockXYLabel.Width / 2 - Sensitivity.Fields.LockCheckBox.Width / 2; + ByComponentVectorXYLock.Left = Sensitivity.Fields.LockCheckBox.Left; + OptionSetX.AlignActiveValuesByTitle(); + Sensitivity.AlignActiveValues(OptionSetX.ActiveValuesTitle.Width); + Rotation.AlignActiveValues(OptionSetX.ActiveValuesTitle.Width); + } + #endregion Methods } } diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index a44b536..064a521 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -173,6 +173,11 @@ namespace grapher } } + public override void AlignActiveValues(int width) + { + CapOption.AlignActiveValues(width); + } + void OnSensitivityCapCheckClick(object sender, EventArgs e) { if (!LegacyCapCheck.Checked) diff --git a/grapher/Models/Options/OffsetOptions.cs b/grapher/Models/Options/OffsetOptions.cs index ffcb862..8942b0c 100644 --- a/grapher/Models/Options/OffsetOptions.cs +++ b/grapher/Models/Options/OffsetOptions.cs @@ -144,6 +144,11 @@ namespace grapher.Models.Options } } + public override void AlignActiveValues(int width) + { + OffsetOption.AlignActiveValues(width); + } + public void OnVelocityGainOffsetClick(object sender, EventArgs e) { if (!VelocityGainOffsetCheck.Checked) diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index 3c7b2ec..fd4a6fe 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -26,6 +26,8 @@ namespace grapher label.AutoSize = false; label.Width = Field.Left - left - Constants.OptionLabelBoxSeperation; label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + + ActiveValueLabel.Left = Field.Left + Field.Width; } public Option( @@ -82,6 +84,7 @@ namespace grapher { Field.Top = value; Label.Top = value; + ActiveValueLabel.Top = value; } } @@ -163,7 +166,12 @@ namespace grapher Show(); } - + + public override void AlignActiveValues(int width) + { + ActiveValueLabel.Width = width; + } + #endregion Methods } } diff --git a/grapher/Models/Options/OptionBase.cs b/grapher/Models/Options/OptionBase.cs index 7fb7c0e..d9ca952 100644 --- a/grapher/Models/Options/OptionBase.cs +++ b/grapher/Models/Options/OptionBase.cs @@ -29,6 +29,8 @@ namespace grapher.Models.Options public abstract void Hide(); + public abstract void AlignActiveValues(int width); + public virtual void SnapTo(IOption option) { Top = option.Beneath; diff --git a/grapher/Models/Options/OptionXY.cs b/grapher/Models/Options/OptionXY.cs index c1fd0b7..372bbe9 100644 --- a/grapher/Models/Options/OptionXY.cs +++ b/grapher/Models/Options/OptionXY.cs @@ -77,6 +77,11 @@ namespace grapher ActiveValueLabels.SetValues(x, y); } + public void AlignActiveValues(int width) + { + ActiveValueLabels.AlignActiveValues(width); + } + public void Hide() { Fields.Hide(); -- cgit v1.2.3 From 254a66eda9d9f6add21937b3570d29f64af4ab1e Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 01:09:19 -0700 Subject: Fix few small bugs --- grapher/Models/Fields/FieldXY.cs | 10 +++++++++- grapher/Models/Options/AccelTypeOptions.cs | 1 + grapher/Models/Options/ActiveValueLabelXY.cs | 25 ++++++++++++++++++++----- grapher/Models/Options/ApplyOptions.cs | 5 ++++- grapher/Models/Options/OptionXY.cs | 1 + 5 files changed, 35 insertions(+), 7 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Fields/FieldXY.cs b/grapher/Models/Fields/FieldXY.cs index 826be27..b1db220 100644 --- a/grapher/Models/Fields/FieldXY.cs +++ b/grapher/Models/Fields/FieldXY.cs @@ -61,13 +61,21 @@ namespace grapher public Field YField { get; } + public int CombinedWidth { get; } + + public int Left { + get + { + return XField.Left; + } + } + private bool Combined { get; set; } private int DefaultWidthX { get; } private int DefaultWidthY { get; } - private int CombinedWidth { get; } #endregion Properties diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 6a5dbc8..02d54d1 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -155,6 +155,7 @@ namespace grapher public override void Hide() { AccelDropdown.Hide(); + AccelTypeActiveValue.Hide(); Acceleration.Hide(); Cap.Hide(); diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs index 3f94847..e6e4f52 100644 --- a/grapher/Models/Options/ActiveValueLabelXY.cs +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -22,10 +22,7 @@ namespace grapher.Models.Options X = x; Y = y; - FullWidth = x.Width; - ShortenedWidth = (FullWidth - Constants.ActiveLabelXYSeparation) / 2; - - Y.Left = X.Left + ShortenedWidth + Constants.ActiveLabelXYSeparation; + Align(x.Width); Y.Width = ShortenedWidth; Y.FormatString = Constants.ShortenedFormatString; @@ -43,6 +40,19 @@ namespace grapher.Models.Options public bool Combined { get; private set; } + public int Left + { + get + { + return X.Left; + } + set + { + X.Left = value; + SetYLeft(); + } + } + private int FullWidth { get; set; } private int ShortenedWidth { get; set; } @@ -112,10 +122,15 @@ namespace grapher.Models.Options FullWidth = width; ShortenedWidth = (FullWidth - Constants.ActiveLabelXYSeparation) / 2; - Y.Left = X.Left + ShortenedWidth + Constants.ActiveLabelXYSeparation; + SetYLeft(); Y.Width = ShortenedWidth; } + private void SetYLeft() + { + Y.Left = X.Left + ShortenedWidth + Constants.ActiveLabelXYSeparation; + } + #endregion Methods } } diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 76a3bb8..5e4aef4 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -163,7 +163,10 @@ namespace grapher.Models.Options public void OnByComponentCheckedChange(object sender, EventArgs e) { - EnableByComponentApplication(); + if (ByComponentVectorMenuItem.Checked) + { + EnableByComponentApplication(); + } } public void ShowWholeSet() diff --git a/grapher/Models/Options/OptionXY.cs b/grapher/Models/Options/OptionXY.cs index 372bbe9..9741702 100644 --- a/grapher/Models/Options/OptionXY.cs +++ b/grapher/Models/Options/OptionXY.cs @@ -16,6 +16,7 @@ namespace grapher Fields = fields; Label = label; ActiveValueLabels = activeValueLabels; + ActiveValueLabels.Left = fields.CombinedWidth + fields.Left; } public OptionXY( -- cgit v1.2.3 From 6c019ffb8b23c237254b17cb9b3142e58631c1fc Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 01:19:07 -0700 Subject: Set correct active value y title --- grapher/Models/AccelGUIFactory.cs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 05cea70..569b716 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -70,7 +70,7 @@ namespace grapher.Models Label constantTwoLabelY, Label constantThreeLabelX, Label constantThreeLabelY, - Label activeValueTitle, + Label activeValueTitleX, Label activeValueTitleY, Label sensitivityActiveXLabel, Label sensitivityActiveYLabel, @@ -108,8 +108,8 @@ namespace grapher.Models 1, sensitivityLabel, new ActiveValueLabelXY( - new ActiveValueLabel(sensitivityActiveXLabel, activeValueTitle), - new ActiveValueLabel(sensitivityActiveYLabel, activeValueTitle)), + new ActiveValueLabel(sensitivityActiveXLabel, activeValueTitleX), + new ActiveValueLabel(sensitivityActiveYLabel, activeValueTitleX)), "Sensitivity"); var rotation = new Option( @@ -118,7 +118,7 @@ namespace grapher.Models 0, rotationLabel, 0, - new ActiveValueLabel(rotationActiveLabel, activeValueTitle), + new ActiveValueLabel(rotationActiveLabel, activeValueTitleX), "Rotation"); var optionSetYLeft = rotation.Left + rotation.Width; @@ -129,7 +129,7 @@ namespace grapher.Models 1, weightLabelX, 0, - new ActiveValueLabel(weightActiveXLabel, activeValueTitle), + new ActiveValueLabel(weightActiveXLabel, activeValueTitleX), "Weight"); var weightY = new Option( @@ -138,7 +138,7 @@ namespace grapher.Models 1, weightLabelY, optionSetYLeft, - new ActiveValueLabel(weightActiveYLabel, activeValueTitle), + new ActiveValueLabel(weightActiveYLabel, activeValueTitleY), "Weight"); var capX = new Option( @@ -147,7 +147,7 @@ namespace grapher.Models 0, capLabelX, 0, - new ActiveValueLabel(capActiveXLabel, activeValueTitle), + new ActiveValueLabel(capActiveXLabel, activeValueTitleX), "Cap"); var capY = new Option( @@ -156,7 +156,7 @@ namespace grapher.Models 0, capLabelY, optionSetYLeft, - new ActiveValueLabel(capActiveYLabel, activeValueTitle), + new ActiveValueLabel(capActiveYLabel, activeValueTitleY), "Cap"); var offsetX = new Option( @@ -165,7 +165,7 @@ namespace grapher.Models 0, offsetLabelX, 0, - new ActiveValueLabel(offsetActiveLabelX, activeValueTitle), + new ActiveValueLabel(offsetActiveLabelX, activeValueTitleX), "Offset"); var offsetY = new Option( @@ -174,7 +174,7 @@ namespace grapher.Models 0, offsetLabelY, optionSetYLeft, - new ActiveValueLabel(offsetActiveLabelY, activeValueTitle), + new ActiveValueLabel(offsetActiveLabelY, activeValueTitleY), "Offset"); var offsetOptionsX = new OffsetOptions( @@ -190,37 +190,37 @@ namespace grapher.Models var accelerationX = new Option( new Field(accelerationBoxX, form, 0), constantOneLabelX, - new ActiveValueLabel(accelerationActiveLabelX, activeValueTitle), + new ActiveValueLabel(accelerationActiveLabelX, activeValueTitleX), 0); var accelerationY = new Option( new Field(accelerationBoxY, form, 0), constantOneLabelY, - new ActiveValueLabel(accelerationActiveLabelY, activeValueTitle), + new ActiveValueLabel(accelerationActiveLabelY, activeValueTitleY), optionSetYLeft); var limitOrExponentX = new Option( new Field(limitBoxX, form, 2), constantTwoLabelX, - new ActiveValueLabel(limitExpActiveLabelX, activeValueTitle), + new ActiveValueLabel(limitExpActiveLabelX, activeValueTitleX), 0); var limitOrExponentY = new Option( new Field(limitBoxY, form, 2), constantTwoLabelY, - new ActiveValueLabel(limitExpActiveLabelY, activeValueTitle), + new ActiveValueLabel(limitExpActiveLabelY, activeValueTitleY), optionSetYLeft); var midpointX = new Option( new Field(midpointBoxX, form, 0), constantThreeLabelX, - new ActiveValueLabel(midpointActiveLabelX, activeValueTitle), + new ActiveValueLabel(midpointActiveLabelX, activeValueTitleY), 0); var midpointY = new Option( new Field(midpointBoxY, form, 0), constantThreeLabelY, - new ActiveValueLabel(midpointActiveLabelY, activeValueTitle), + new ActiveValueLabel(midpointActiveLabelY, activeValueTitleY), optionSetYLeft); var capOptionsX = new CapOptions( @@ -242,7 +242,7 @@ namespace grapher.Models limitOrExponentX, midpointX, writeButton, - new ActiveValueLabel(accelTypeActiveLabelX, activeValueTitle)); + new ActiveValueLabel(accelTypeActiveLabelX, activeValueTitleX)); var accelerationOptionsY = new AccelTypeOptions( accelTypeDropY, @@ -253,11 +253,11 @@ namespace grapher.Models limitOrExponentY, midpointY, writeButton, - new ActiveValueLabel(accelTypeActiveLabelY, activeValueTitle)); + new ActiveValueLabel(accelTypeActiveLabelY, activeValueTitleY)); var optionsSetX = new AccelOptionSet( optionSetXTitle, - activeValueTitle, + activeValueTitleX, rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, accelerationOptionsX); -- cgit v1.2.3 From 9502dcf7608475857b1487375997d20a9d29622e Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 01:26:22 -0700 Subject: Remove and sort usings en masse --- grapher/Constants/Constants.cs | 7 +------ grapher/Layouts/ClassicLayout.cs | 5 ----- grapher/Layouts/DefaultLayout.cs | 7 ------- grapher/Layouts/LayoutBase.cs | 5 ----- grapher/Layouts/LinearLayout.cs | 5 ----- grapher/Layouts/NaturalGainLayout.cs | 5 ----- grapher/Layouts/NaturalLayout.cs | 5 ----- grapher/Layouts/OffLayout.cs | 5 ----- grapher/Layouts/PowerLayout.cs | 5 ----- grapher/Layouts/SigmoidGainLayout.cs | 5 ----- grapher/Models/AccelGUI.cs | 7 ------- grapher/Models/AccelGUIFactory.cs | 5 ----- grapher/Models/Calculations/AccelCalculator.cs | 3 --- grapher/Models/Calculations/AccelChartData.cs | 2 -- grapher/Models/Calculations/AccelData.cs | 5 ----- grapher/Models/Charts/AccelCharts.cs | 6 ------ grapher/Models/Charts/ChartXY.cs | 11 +---------- grapher/Models/Charts/EstimatedPoints.cs | 5 ----- grapher/Models/Fields/Field.cs | 4 ---- grapher/Models/Fields/FieldXY.cs | 4 ---- grapher/Models/Mouse/MouseWatcher.cs | 5 ----- grapher/Models/Mouse/PointData.cs | 4 ---- grapher/Models/Options/AccelOptionSet.cs | 5 ----- grapher/Models/Options/AccelTypeOptions.cs | 2 -- grapher/Models/Options/ActiveValueLabel.cs | 7 +------ grapher/Models/Options/ActiveValueLabelXY.cs | 8 +------- grapher/Models/Options/ApplyOptions.cs | 5 ----- grapher/Models/Options/CapOptions.cs | 4 ---- grapher/Models/Options/IOption.cs | 8 +------- grapher/Models/Options/OffsetOptions.cs | 4 ---- grapher/Models/Options/Option.cs | 5 ----- grapher/Models/Options/OptionBase.cs | 8 +------- grapher/Models/Options/OptionXY.cs | 4 ---- grapher/Models/Serialized/GUISettings.cs | 6 ------ grapher/Models/Serialized/RawAccelSettings.cs | 6 ------ grapher/Program.cs | 3 --- 36 files changed, 6 insertions(+), 184 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 887c8aa..51cd0cb 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; namespace grapher { diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs index d02e11c..572566f 100644 --- a/grapher/Layouts/ClassicLayout.cs +++ b/grapher/Layouts/ClassicLayout.cs @@ -1,9 +1,4 @@ using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Layouts { diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index d9e1413..83535c2 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -1,11 +1,4 @@ using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - namespace grapher.Layouts { diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 629b0a4..6ed8fee 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -1,9 +1,4 @@ using grapher.Models.Options; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher.Layouts diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index b5c6434..fded8c7 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -1,9 +1,4 @@ using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Layouts { diff --git a/grapher/Layouts/NaturalGainLayout.cs b/grapher/Layouts/NaturalGainLayout.cs index ae73c80..b982b91 100644 --- a/grapher/Layouts/NaturalGainLayout.cs +++ b/grapher/Layouts/NaturalGainLayout.cs @@ -1,9 +1,4 @@ using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Layouts { diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index 0923e1d..aa5c22c 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -1,9 +1,4 @@ using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Layouts { diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index 2a2f414..85c8d3f 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -1,9 +1,4 @@ using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Layouts { diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index 4438c1a..e0dcaf8 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -1,9 +1,4 @@ using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Layouts { diff --git a/grapher/Layouts/SigmoidGainLayout.cs b/grapher/Layouts/SigmoidGainLayout.cs index 1704071..183e31f 100644 --- a/grapher/Layouts/SigmoidGainLayout.cs +++ b/grapher/Layouts/SigmoidGainLayout.cs @@ -1,9 +1,4 @@ using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Layouts { diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 36938b6..634aabf 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -3,14 +3,7 @@ using grapher.Models.Mouse; using grapher.Models.Options; using grapher.Models.Serialized; using System; -using System.CodeDom; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -using System.Windows.Forms.DataVisualization.Charting; namespace grapher { diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 569b716..35d2869 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -1,11 +1,6 @@ using grapher.Models.Calculations; using grapher.Models.Options; using grapher.Models.Serialized; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; diff --git a/grapher/Models/Calculations/AccelCalculator.cs b/grapher/Models/Calculations/AccelCalculator.cs index 4e44902..092a7aa 100644 --- a/grapher/Models/Calculations/AccelCalculator.cs +++ b/grapher/Models/Calculations/AccelCalculator.cs @@ -3,9 +3,6 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; namespace grapher.Models.Calculations { diff --git a/grapher/Models/Calculations/AccelChartData.cs b/grapher/Models/Calculations/AccelChartData.cs index 6b29f16..8c0c8ea 100644 --- a/grapher/Models/Calculations/AccelChartData.cs +++ b/grapher/Models/Calculations/AccelChartData.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Models.Calculations { diff --git a/grapher/Models/Calculations/AccelData.cs b/grapher/Models/Calculations/AccelData.cs index 3e1f987..eef4d01 100644 --- a/grapher/Models/Calculations/AccelData.cs +++ b/grapher/Models/Calculations/AccelData.cs @@ -1,10 +1,5 @@ using grapher.Models.Charts; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static grapher.AccelCharts; namespace grapher.Models.Calculations { diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 6d9f0a1..b3199d4 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -1,14 +1,8 @@ using grapher.Models.Calculations; using grapher.Models.Charts; using System; -using System.Collections.Generic; using System.Drawing; -using System.Linq; -using System.Security.Permissions; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -using System.Windows.Forms.DataVisualization.Charting; namespace grapher { diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 7998f7f..5ff2a8d 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -1,15 +1,6 @@ -using grapher.Models.Charts; -using grapher.Models.Mouse; -using System; +using grapher.Models.Mouse; using System.Collections; -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; -using static grapher.AccelCharts; namespace grapher { diff --git a/grapher/Models/Charts/EstimatedPoints.cs b/grapher/Models/Charts/EstimatedPoints.cs index 9ff0e5b..f7ba3ce 100644 --- a/grapher/Models/Charts/EstimatedPoints.cs +++ b/grapher/Models/Charts/EstimatedPoints.cs @@ -1,9 +1,4 @@ using grapher.Models.Mouse; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Models.Charts { diff --git a/grapher/Models/Fields/Field.cs b/grapher/Models/Fields/Field.cs index f8a9c2d..0d1813e 100644 --- a/grapher/Models/Fields/Field.cs +++ b/grapher/Models/Fields/Field.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher diff --git a/grapher/Models/Fields/FieldXY.cs b/grapher/Models/Fields/FieldXY.cs index b1db220..6f43998 100644 --- a/grapher/Models/Fields/FieldXY.cs +++ b/grapher/Models/Fields/FieldXY.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index 6f6b776..405110e 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher.Models.Mouse diff --git a/grapher/Models/Mouse/PointData.cs b/grapher/Models/Mouse/PointData.cs index 3641c23..374c52e 100644 --- a/grapher/Models/Mouse/PointData.cs +++ b/grapher/Models/Mouse/PointData.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace grapher.Models.Mouse { diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index 2a1436f..a5399da 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -1,10 +1,5 @@ using grapher.Models.Serialized; -using System; -using System.Collections.Generic; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher.Models.Options diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 02d54d1..3739189 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -4,8 +4,6 @@ using grapher.Models.Serialized; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher diff --git a/grapher/Models/Options/ActiveValueLabel.cs b/grapher/Models/Options/ActiveValueLabel.cs index 39af325..df7ac42 100644 --- a/grapher/Models/Options/ActiveValueLabel.cs +++ b/grapher/Models/Options/ActiveValueLabel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; using System.Windows.Forms; namespace grapher.Models.Options diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs index e6e4f52..ffe57b7 100644 --- a/grapher/Models/Options/ActiveValueLabelXY.cs +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace grapher.Models.Options +namespace grapher.Models.Options { public class ActiveValueLabelXY { diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 5e4aef4..6ff2753 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -1,12 +1,7 @@ using grapher.Models.Serialized; 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.Models.Options { diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index 064a521..8a0865a 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -1,9 +1,5 @@ using grapher.Models.Options; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher diff --git a/grapher/Models/Options/IOption.cs b/grapher/Models/Options/IOption.cs index b387971..fff1623 100644 --- a/grapher/Models/Options/IOption.cs +++ b/grapher/Models/Options/IOption.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace grapher.Models.Options +namespace grapher.Models.Options { public interface IOption { diff --git a/grapher/Models/Options/OffsetOptions.cs b/grapher/Models/Options/OffsetOptions.cs index 8942b0c..f68d16d 100644 --- a/grapher/Models/Options/OffsetOptions.cs +++ b/grapher/Models/Options/OffsetOptions.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher.Models.Options diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index fd4a6fe..f44e6b1 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -1,9 +1,4 @@ using grapher.Models.Options; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher diff --git a/grapher/Models/Options/OptionBase.cs b/grapher/Models/Options/OptionBase.cs index d9ca952..77a1038 100644 --- a/grapher/Models/Options/OptionBase.cs +++ b/grapher/Models/Options/OptionBase.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace grapher.Models.Options +namespace grapher.Models.Options { public abstract class OptionBase : IOption { diff --git a/grapher/Models/Options/OptionXY.cs b/grapher/Models/Options/OptionXY.cs index 9741702..9150587 100644 --- a/grapher/Models/Options/OptionXY.cs +++ b/grapher/Models/Options/OptionXY.cs @@ -1,9 +1,5 @@ using grapher.Models.Options; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher diff --git a/grapher/Models/Serialized/GUISettings.cs b/grapher/Models/Serialized/GUISettings.cs index 253e71d..abc3721 100644 --- a/grapher/Models/Serialized/GUISettings.cs +++ b/grapher/Models/Serialized/GUISettings.cs @@ -1,11 +1,5 @@ using Newtonsoft.Json; using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; namespace grapher.Models.Serialized { diff --git a/grapher/Models/Serialized/RawAccelSettings.cs b/grapher/Models/Serialized/RawAccelSettings.cs index 7466e82..3f5aebc 100644 --- a/grapher/Models/Serialized/RawAccelSettings.cs +++ b/grapher/Models/Serialized/RawAccelSettings.cs @@ -1,12 +1,6 @@ using Newtonsoft.Json; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; namespace grapher.Models.Serialized { diff --git a/grapher/Program.cs b/grapher/Program.cs index b36ece3..85fd040 100644 --- a/grapher/Program.cs +++ b/grapher/Program.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher -- cgit v1.2.3 From a6448c4a2447a090558da5f52dea3dc418389e8a Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 12:35:23 -0700 Subject: Fix few small bugs --- grapher/Models/Fields/FieldXY.cs | 44 ++++++++++++++++++++ grapher/Models/Options/AccelOptionSet.cs | 4 +- grapher/Models/Options/AccelTypeOptions.cs | 20 +++++---- grapher/Models/Options/ActiveValueLabel.cs | 28 +++++++++++-- grapher/Models/Options/ActiveValueLabelXY.cs | 17 +++++++- grapher/Models/Options/ApplyOptions.cs | 14 +++++-- grapher/Models/Options/CapOptions.cs | 4 +- grapher/Models/Options/OffsetOptions.cs | 4 +- grapher/Models/Options/Option.cs | 8 ++-- grapher/Models/Options/OptionBase.cs | 2 +- grapher/Models/Options/OptionXY.cs | 61 +++++++++++++++++++++++++--- 11 files changed, 174 insertions(+), 32 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Fields/FieldXY.cs b/grapher/Models/Fields/FieldXY.cs index 6f43998..15e6800 100644 --- a/grapher/Models/Fields/FieldXY.cs +++ b/grapher/Models/Fields/FieldXY.cs @@ -64,6 +64,50 @@ namespace grapher { return XField.Left; } + set + { + } + } + + public int Width + { + get + { + return CombinedWidth; + } + set + { + } + } + + public int Top + { + get + { + return XField.Top; + } + set + { + } + } + + public int Height + { + get + { + return XField.Height; + } + set + { + } + } + + public bool Visible + { + get + { + return XField.Box.Visible; + } } private bool Combined { get; set; } diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index a5399da..bc0d368 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -109,9 +109,9 @@ namespace grapher.Models.Options Options.SetActiveValues(mode, args); } - public void AlignActiveValuesByTitle() + public void AlignActiveValues() { - Options.AlignActiveValues(ActiveValuesTitle.Width); + Options.AlignActiveValues(); } } } diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 3739189..86a28f4 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -52,6 +52,8 @@ namespace grapher WriteButton = writeButton; AccelTypeActiveValue = accelTypeActiveValue; + AccelTypeActiveValue.Height = AccelDropdown.Height; + Layout("Off"); ShowingDefault = true; } @@ -166,6 +168,7 @@ namespace grapher public void Show() { AccelDropdown.Show(); + AccelTypeActiveValue.Show(); Layout(); } @@ -232,16 +235,15 @@ namespace grapher return args; } - public override void AlignActiveValues(int width) + public override void AlignActiveValues() { - AccelTypeActiveValue.Width = width; - - Acceleration.AlignActiveValues(width); - Cap.AlignActiveValues(width); - Offset.AlignActiveValues(width); - Weight.AlignActiveValues(width); - LimitOrExponent.AlignActiveValues(width); - Midpoint.AlignActiveValues(width); + AccelTypeActiveValue.Align(); + Acceleration.AlignActiveValues(); + Cap.AlignActiveValues(); + Offset.AlignActiveValues(); + Weight.AlignActiveValues(); + LimitOrExponent.AlignActiveValues(); + Midpoint.AlignActiveValues(); } private void OnIndexChanged(object sender, EventArgs e) diff --git a/grapher/Models/Options/ActiveValueLabel.cs b/grapher/Models/Options/ActiveValueLabel.cs index df7ac42..18a4400 100644 --- a/grapher/Models/Options/ActiveValueLabel.cs +++ b/grapher/Models/Options/ActiveValueLabel.cs @@ -22,11 +22,12 @@ namespace grapher.Models.Options public ActiveValueLabel(Label valueLabel, Label centeringLabel) { ValueLabel = valueLabel; - ValueLabel.ForeColor = Constants.ActiveValueFontColor; - Left = centeringLabel.Left; - Width = centeringLabel.Width; ValueLabel.AutoSize = false; ValueLabel.TextAlign = ContentAlignment.MiddleCenter; + ValueLabel.ForeColor = Constants.ActiveValueFontColor; + + CenteringLabel = centeringLabel; + Align(); FormatString = Constants.DefaultActiveValueFormatString; Prefix = string.Empty; @@ -98,6 +99,21 @@ namespace grapher.Models.Options } } + public int Height + { + get + { + return ValueLabel.Height; + } + + set + { + ValueLabel.Height = value; + } + } + + public Label CenteringLabel { get; } + #endregion Properties #region Methods @@ -127,6 +143,12 @@ namespace grapher.Models.Options ValueLabel.Text = string.IsNullOrWhiteSpace(Prefix) ? Value: $"{Prefix}: {Value}"; } + public void Align() + { + Left = CenteringLabel.Left; + Width = CenteringLabel.Width; + } + #endregion Methods } } diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs index ffe57b7..9498c66 100644 --- a/grapher/Models/Options/ActiveValueLabelXY.cs +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -47,6 +47,19 @@ } } + public int Height + { + get + { + return X.Height; + } + set + { + X.Height = value; + Y.Height = value; + } + } + private int FullWidth { get; set; } private int ShortenedWidth { get; set; } @@ -97,9 +110,9 @@ Combined = false; } - public void AlignActiveValues(int width) + public void AlignActiveValues() { - Align(width); + Align(X.CenteringLabel.Width); if (Combined) { diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 6ff2753..29f923d 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -43,6 +43,8 @@ namespace grapher.Models.Options ByComponentVectorXYLock.CheckedChanged += new System.EventHandler(OnByComponentXYLockChecked); ByComponentVectorXYLock.Checked = true; + Rotation.SnapTo(Sensitivity); + EnableWholeApplication(); } @@ -229,9 +231,15 @@ namespace grapher.Models.Options LockXYLabel.Left = OptionSetX.ActiveValuesTitle.Left + OptionSetX.ActiveValuesTitle.Width; Sensitivity.Fields.LockCheckBox.Left = LockXYLabel.Left + LockXYLabel.Width / 2 - Sensitivity.Fields.LockCheckBox.Width / 2; ByComponentVectorXYLock.Left = Sensitivity.Fields.LockCheckBox.Left; - OptionSetX.AlignActiveValuesByTitle(); - Sensitivity.AlignActiveValues(OptionSetX.ActiveValuesTitle.Width); - Rotation.AlignActiveValues(OptionSetX.ActiveValuesTitle.Width); + AlignActiveValues(); + } + + private void AlignActiveValues() + { + OptionSetX.AlignActiveValues(); + OptionSetY.AlignActiveValues(); + Sensitivity.AlignActiveValues(); + Rotation.AlignActiveValues(); } #endregion Methods diff --git a/grapher/Models/Options/CapOptions.cs b/grapher/Models/Options/CapOptions.cs index 8a0865a..5e47d7b 100644 --- a/grapher/Models/Options/CapOptions.cs +++ b/grapher/Models/Options/CapOptions.cs @@ -169,9 +169,9 @@ namespace grapher } } - public override void AlignActiveValues(int width) + public override void AlignActiveValues() { - CapOption.AlignActiveValues(width); + CapOption.AlignActiveValues(); } void OnSensitivityCapCheckClick(object sender, EventArgs e) diff --git a/grapher/Models/Options/OffsetOptions.cs b/grapher/Models/Options/OffsetOptions.cs index f68d16d..b351ab5 100644 --- a/grapher/Models/Options/OffsetOptions.cs +++ b/grapher/Models/Options/OffsetOptions.cs @@ -140,9 +140,9 @@ namespace grapher.Models.Options } } - public override void AlignActiveValues(int width) + public override void AlignActiveValues() { - OffsetOption.AlignActiveValues(width); + OffsetOption.AlignActiveValues(); } public void OnVelocityGainOffsetClick(object sender, EventArgs e) diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index f44e6b1..5dc022b 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -19,10 +19,12 @@ namespace grapher Left = left; label.AutoSize = false; - label.Width = Field.Left - left - Constants.OptionLabelBoxSeperation; label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + label.Width = Field.Left - left - Constants.OptionLabelBoxSeperation; + label.Height = Field.Height; ActiveValueLabel.Left = Field.Left + Field.Width; + ActiveValueLabel.Height = Field.Height; } public Option( @@ -162,9 +164,9 @@ namespace grapher Show(); } - public override void AlignActiveValues(int width) + public override void AlignActiveValues() { - ActiveValueLabel.Width = width; + ActiveValueLabel.Align(); } #endregion Methods diff --git a/grapher/Models/Options/OptionBase.cs b/grapher/Models/Options/OptionBase.cs index 77a1038..5f6dca1 100644 --- a/grapher/Models/Options/OptionBase.cs +++ b/grapher/Models/Options/OptionBase.cs @@ -23,7 +23,7 @@ public abstract void Hide(); - public abstract void AlignActiveValues(int width); + public abstract void AlignActiveValues(); public virtual void SnapTo(IOption option) { diff --git a/grapher/Models/Options/OptionXY.cs b/grapher/Models/Options/OptionXY.cs index 9150587..6d6129a 100644 --- a/grapher/Models/Options/OptionXY.cs +++ b/grapher/Models/Options/OptionXY.cs @@ -4,7 +4,7 @@ using System.Windows.Forms; namespace grapher { - public class OptionXY + public class OptionXY : OptionBase { #region Constructors public OptionXY(FieldXY fields, Label label, ActiveValueLabelXY activeValueLabels) @@ -58,6 +58,57 @@ namespace grapher public ActiveValueLabelXY ActiveValueLabels { get; } + public override int Top + { + get + { + return Fields.Top; + } + set + { + Fields.Top = value; + } + } + + public override int Height + { + get + { + return Fields.Height; + } + } + + public override int Left + { + get + { + return Fields.Left; + } + set + { + Fields.Left = value; + } + } + + public override int Width + { + get + { + return Fields.Width; + } + set + { + Fields.Width = value; + } + } + + public override bool Visible + { + get + { + return Fields.Visible; + } + } #endregion Properties #region Methods @@ -74,12 +125,12 @@ namespace grapher ActiveValueLabels.SetValues(x, y); } - public void AlignActiveValues(int width) + public override void AlignActiveValues() { - ActiveValueLabels.AlignActiveValues(width); + ActiveValueLabels.AlignActiveValues(); } - public void Hide() + public override void Hide() { Fields.Hide(); Fields.LockCheckBox.Hide(); @@ -93,7 +144,7 @@ namespace grapher Label.Show(); } - public void Show(string name) + public override void Show(string name) { SetName(name); -- cgit v1.2.3 From 29246993d2e9d75db304b0ea2b563658d374aa53 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 13:02:46 -0700 Subject: Fix accel type y active value alignment --- grapher/Models/Options/AccelTypeOptions.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 86a28f4..14c2019 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -52,6 +52,7 @@ namespace grapher WriteButton = writeButton; AccelTypeActiveValue = accelTypeActiveValue; + AccelTypeActiveValue.Left = AccelDropdown.Left + AccelDropdown.Width; AccelTypeActiveValue.Height = AccelDropdown.Height; Layout("Off"); @@ -121,7 +122,6 @@ namespace grapher set { AccelDropdown.Left = value; - AccelTypeActiveValue.Left = AccelDropdown.Left + Width; } } @@ -134,7 +134,6 @@ namespace grapher set { AccelDropdown.Width = value; - AccelTypeActiveValue.Left = Left + AccelDropdown.Width; } } -- cgit v1.2.3 From d31ef3c66c9919d3520ee34db062687a84bc5fa4 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 14:01:33 -0700 Subject: Add delay on button enable after writing to driver --- grapher/Constants/Constants.cs | 6 ++++++ grapher/Form1.Designer.cs | 1 - grapher/Form1.cs | 9 ++------- grapher/Models/AccelGUI.cs | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 8 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 51cd0cb..d74d045 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -80,6 +80,12 @@ namespace grapher /// Format string for default dropdowns. public const string AccelDropDownDefaultShortText = "Accel Type"; + /// Default text to be displayed on write button. + public const string WriteButtonDefaultText = "Write To Driver"; + + /// Default text to be displayed on write button. + public const string WriteButtonDelayText = "Delay"; + /// Default name of settings file. public const string DefaultSettingsFileName = @"settings.json"; diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 6ad2953..ad68b2c 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -330,7 +330,6 @@ namespace grapher this.writeButton.TabIndex = 21; this.writeButton.Text = "Write To Driver"; this.writeButton.UseVisualStyleBackColor = true; - this.writeButton.Click += new System.EventHandler(this.writeButton_Click); // // sensitivityBoxY // diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 1bdb05c..65212d5 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -141,16 +141,11 @@ namespace grapher } - private void writeButton_Click(object sender, EventArgs e) - { - AccelGUI.UpdateActiveSettingsFromFields(); - } - - #endregion Methods - private void RawAcceleration_Paint(object sender, PaintEventArgs e) { AccelGUI.AccelCharts.DrawPoints(); } + + #endregion Method } } diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 634aabf..a7fe5f9 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -35,6 +35,14 @@ namespace grapher MouseWatcher = new MouseWatcher(AccelForm, mouseMoveLabel, AccelCharts); ScaleMenuItem.Click += new System.EventHandler(OnScaleMenuItemClick); + WriteButton.Click += new System.EventHandler(OnWriteButtonClick); + + ButtonTimer = new Timer(); + ButtonTimer.Enabled = true; + ButtonTimer.Interval = Convert.ToInt32(ManagedAccel.WriteDelay); + ButtonTimer.Tick += new System.EventHandler(OnButtonTimerTick); + + SetWriteButtonDefault(); } #endregion Constructors @@ -53,6 +61,8 @@ namespace grapher public Button WriteButton { get; } + public Timer ButtonTimer { get; } + public MouseWatcher MouseWatcher { get; } public ToolStripMenuItem ScaleMenuItem { get; } @@ -81,6 +91,7 @@ namespace grapher { AccelForm.Invoke((MethodInvoker)delegate { + WriteButtonDelay(); UpdateGraph(); }); }); @@ -113,6 +124,35 @@ namespace grapher UpdateGraph(); } + private void OnWriteButtonClick(object sender, EventArgs e) + { + UpdateActiveSettingsFromFields(); + } + + private void OnButtonTimerTick(object sender, EventArgs e) + { + ButtonTimer.Stop(); + SetWriteButtonDefault(); + } + + private void WriteButtonDelay() + { + SetWriteButtonDelay(); + ButtonTimer.Start(); + } + + private void SetWriteButtonDefault() + { + WriteButton.Text = Constants.WriteButtonDefaultText; + WriteButton.Enabled = true; + } + + private void SetWriteButtonDelay() + { + WriteButton.Enabled = false; + WriteButton.Text = $"{Constants.WriteButtonDelayText} : {ButtonTimer.Interval} ms"; + } + #endregion Methods } -- cgit v1.2.3 From 79bb4f0bc1d72c36767ff73825b7f70db9615928 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 14:21:22 -0700 Subject: Set WriteButton vertical placement --- grapher/Constants/Constants.cs | 5 ++++- grapher/Models/AccelGUI.cs | 47 ++++++++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 19 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index d74d045..aaf8bb9 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -51,14 +51,17 @@ namespace grapher /// Width of charts when widened public const int WideChartWidth = 723; - /// Width of charts when widened + /// Left placement of charts when widened public const int WideChartLeft = 333; /// Width of charts when narrowed public const int NarrowChartWidth = 698; + /// Left placement of charts when narrowed public const int NarrowChartLeft = 482; + public const int WriteButtonVerticalOffset = 50; + /// Format string for shortened x and y textboxes. public const string ShortenedFormatString = "0.###"; diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index a7fe5f9..c150393 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -37,12 +37,8 @@ namespace grapher ScaleMenuItem.Click += new System.EventHandler(OnScaleMenuItemClick); WriteButton.Click += new System.EventHandler(OnWriteButtonClick); - ButtonTimer = new Timer(); - ButtonTimer.Enabled = true; - ButtonTimer.Interval = Convert.ToInt32(ManagedAccel.WriteDelay); - ButtonTimer.Tick += new System.EventHandler(OnButtonTimerTick); - - SetWriteButtonDefault(); + ButtonTimer = SetupButtonTimer(); + SetupWriteButton(); } #endregion Constructors @@ -119,6 +115,33 @@ namespace grapher ApplyOptions.SetActiveValues(Settings.RawAccelSettings.AccelerationSettings); } + private Timer SetupButtonTimer() + { + Timer buttonTimer = new Timer(); + buttonTimer.Enabled = true; + buttonTimer.Interval = Convert.ToInt32(ManagedAccel.WriteDelay); + buttonTimer.Tick += new System.EventHandler(OnButtonTimerTick); + return buttonTimer; + } + + private void SetupWriteButton() + { + WriteButton.Top = AccelCharts.SensitivityChart.Top + AccelCharts.SensitivityChart.Height - Constants.WriteButtonVerticalOffset; + SetWriteButtonDefault(); + } + + private void SetWriteButtonDefault() + { + WriteButton.Text = Constants.WriteButtonDefaultText; + WriteButton.Enabled = true; + } + + private void SetWriteButtonDelay() + { + WriteButton.Enabled = false; + WriteButton.Text = $"{Constants.WriteButtonDelayText} : {ButtonTimer.Interval} ms"; + } + private void OnScaleMenuItemClick(object sender, EventArgs e) { UpdateGraph(); @@ -141,18 +164,6 @@ namespace grapher ButtonTimer.Start(); } - private void SetWriteButtonDefault() - { - WriteButton.Text = Constants.WriteButtonDefaultText; - WriteButton.Enabled = true; - } - - private void SetWriteButtonDelay() - { - WriteButton.Enabled = false; - WriteButton.Text = $"{Constants.WriteButtonDelayText} : {ButtonTimer.Interval} ms"; - } - #endregion Methods } -- cgit v1.2.3 From ae8ee86fdaac66815827e132493c8bfcc5fbf8c9 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 14:29:37 -0700 Subject: Center write button --- grapher/Models/AccelGUIFactory.cs | 3 ++- grapher/Models/Charts/AccelCharts.cs | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 35d2869..a381192 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -93,7 +93,8 @@ namespace grapher.Models new ChartXY(accelerationChart, accelerationChartY), new ChartXY(velocityChart, velocityChartY), new ChartXY(gainChart, gainChartY), - showVelocityGainToolStripMenuItem); + showVelocityGainToolStripMenuItem, + writeButton); var sensitivity = new OptionXY( sensitivityBoxX, diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index b3199d4..9040851 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -15,7 +15,8 @@ namespace grapher ChartXY sensitivityChart, ChartXY velocityChart, ChartXY gainChart, - ToolStripMenuItem enableVelocityAndGain) + ToolStripMenuItem enableVelocityAndGain, + Button writeButton) { Estimated = new EstimatedPoints(); EstimatedX = new EstimatedPoints(); @@ -27,6 +28,7 @@ namespace grapher VelocityChart = velocityChart; GainChart = gainChart; EnableVelocityAndGain = enableVelocityAndGain; + WriteButton = writeButton; SensitivityChart.SetPointBinds(Estimated.Sensitivity, EstimatedX.Sensitivity, EstimatedY.Sensitivity); VelocityChart.SetPointBinds(Estimated.Velocity, EstimatedX.Velocity, EstimatedY.Velocity); @@ -63,6 +65,8 @@ namespace grapher public ToolStripMenuItem EnableVelocityAndGain { get; } + private Button WriteButton { get; } + public AccelData AccelData { get; } private EstimatedPoints Estimated { get; } @@ -132,6 +136,7 @@ namespace grapher VelocityChart.SetWidened(); GainChart.SetWidened(); UpdateFormWidth(); + AlignWriteButton(); } public void SetNarrowed() @@ -140,6 +145,7 @@ namespace grapher VelocityChart.SetNarrowed(); GainChart.SetNarrowed(); UpdateFormWidth(); + AlignWriteButton(); } private void OnEnableClick(object sender, EventArgs e) @@ -211,6 +217,11 @@ namespace grapher ContaingForm.Width = SensitivityChart.Left + SensitivityChart.Width; } + private void AlignWriteButton() + { + WriteButton.Left = SensitivityChart.Left / 2 - WriteButton.Width / 2; + } + #endregion Methods } } -- cgit v1.2.3 From 25ab05b2854428891b1615b7b78e9257c2d6db35 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 14:44:53 -0700 Subject: Add option to turn off last mouse move dot --- grapher/Form1.Designer.cs | 24 ++++++++++++++++++------ grapher/Form1.cs | 3 ++- grapher/Models/AccelGUIFactory.cs | 2 ++ grapher/Models/Charts/AccelCharts.cs | 31 +++++++++++++++++++++++++------ grapher/Models/Charts/ChartXY.cs | 8 +++++++- 5 files changed, 54 insertions(+), 14 deletions(-) (limited to 'grapher') 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); -- cgit v1.2.3 From b8a8eb8a70cf71c61e5dc851229a83027f43194d Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 15:20:31 -0700 Subject: By component, anisotropy full works --- grapher/Models/AccelGUI.cs | 6 ++++-- grapher/Models/Charts/AccelCharts.cs | 6 ++++-- grapher/Models/Charts/ChartXY.cs | 28 +++++++++++++++++++++------- 3 files changed, 29 insertions(+), 11 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index c150393..3acb943 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -96,7 +96,6 @@ namespace grapher public void RefreshOnRead() { - AccelCharts.RefreshXY(Settings.RawAccelSettings.AccelerationSettings.combineMagnitudes); UpdateGraph(); UpdateShownActiveValues(); } @@ -112,7 +111,10 @@ namespace grapher public void UpdateShownActiveValues() { - ApplyOptions.SetActiveValues(Settings.RawAccelSettings.AccelerationSettings); + var settings = Settings.RawAccelSettings.AccelerationSettings; + + AccelCharts.ShowActive(settings); + ApplyOptions.SetActiveValues(settings); } private Timer SetupButtonTimer() diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 84673b8..3f228c3 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -1,5 +1,6 @@ using grapher.Models.Calculations; using grapher.Models.Charts; +using grapher.Models.Serialized; using System; using System.Drawing; using System.Windows.Forms; @@ -51,6 +52,7 @@ namespace grapher EnableLastValue.CheckedChanged += new System.EventHandler(OnEnableLastMouseMoveCheckStateChange); HideVelocityAndGain(); + SensitivityChart.Show(); Combined = false; ShowCombined(); } @@ -127,9 +129,9 @@ namespace grapher } } - public void RefreshXY(bool isWhole) + public void ShowActive(DriverSettings driverSettings) { - if (isWhole) + if (driverSettings.combineMagnitudes) { ShowCombined(); } diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 2037190..30be229 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -21,6 +21,9 @@ namespace grapher SetupChart(ChartX); SetupChart(ChartY); + Combined = false; + SetCombined(); + Widened = false; SetWidened(); } @@ -72,6 +75,8 @@ namespace grapher public bool Widened { get; private set; } + public bool Visible { get; private set; } + private PointData CombinedPointData { get; set; } private PointData XPointData { get; set; } @@ -167,7 +172,7 @@ namespace grapher { if (Combined) { - if (ChartX.Visible) + if (Visible) { ChartY.Show(); } @@ -206,17 +211,26 @@ namespace grapher public void Hide() { - ChartX.Hide(); - ChartY.Hide(); + if (Visible) + { + ChartX.Hide(); + ChartY.Hide(); + Visible = false; + } } public void Show() { - ChartX.Show(); - - if (!Combined) + if (!Visible) { - ChartY.Show(); + ChartX.Show(); + + if (!Combined) + { + ChartY.Show(); + } + + Visible = true; } } -- cgit v1.2.3 From 9eb9e5e91a50c19207e507481ce1516187a89603 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 15:31:25 -0700 Subject: Fix active values y width --- grapher/Models/Options/ApplyOptions.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'grapher') diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 29f923d..241fe50 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -179,6 +179,7 @@ namespace grapher.Models.Options OptionSetX.SetTitleMode("X = Y"); OptionSetY.Hide(); AccelCharts.SetWidened(); + SetActiveTitlesByComponents(); } public void ShowByComponentAsTwoSets() @@ -234,6 +235,13 @@ namespace grapher.Models.Options AlignActiveValues(); } + private void SetActiveTitlesByComponents() + { + OptionSetY.ActiveValuesTitle.Left = OptionSetY.Options.Left + OptionSetY.Options.Width; + OptionSetY.ActiveValuesTitle.Width = Constants.NarrowChartLeft - OptionSetY.ActiveValuesTitle.Left; + AlignActiveValues(); + } + private void AlignActiveValues() { OptionSetX.AlignActiveValues(); -- cgit v1.2.3 From 16d5e4f666a874f87869d0648e51cb59fb19fd79 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 15:59:32 -0700 Subject: Save show last mouse value --- grapher/Models/AccelGUIFactory.cs | 3 ++- grapher/Models/Serialized/GUISettings.cs | 3 +++ grapher/Models/Serialized/SettingsManager.cs | 13 ++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 713c680..42a7b83 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -284,7 +284,8 @@ namespace grapher.Models activeAccel, accelCalculator.DPI, accelCalculator.PollRate, - autoWriteMenuItem); + autoWriteMenuItem, + showLastMouseMoveMenuItem); return new AccelGUI( form, diff --git a/grapher/Models/Serialized/GUISettings.cs b/grapher/Models/Serialized/GUISettings.cs index abc3721..2543104 100644 --- a/grapher/Models/Serialized/GUISettings.cs +++ b/grapher/Models/Serialized/GUISettings.cs @@ -30,6 +30,9 @@ namespace grapher.Models.Serialized [JsonProperty(Order = 3)] public int PollRate { get; set; } + [JsonProperty(Order = 4)] + public bool ShowLastMouseMove { get; set; } + #endregion Properties } } diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs index d7cf590..ccffc3f 100644 --- a/grapher/Models/Serialized/SettingsManager.cs +++ b/grapher/Models/Serialized/SettingsManager.cs @@ -12,12 +12,14 @@ namespace grapher.Models.Serialized ManagedAccel activeAccel, Field dpiField, Field pollRateField, - ToolStripMenuItem autoWrite) + ToolStripMenuItem autoWrite, + ToolStripMenuItem showLastMouseMove) { ActiveAccel = activeAccel; DpiField = dpiField; PollRateField = pollRateField; AutoWriteMenuItem = autoWrite; + ShowLastMouseMoveMenuItem = showLastMouseMove; } #endregion Constructors @@ -34,6 +36,8 @@ namespace grapher.Models.Serialized private ToolStripMenuItem AutoWriteMenuItem { get; set; } + private ToolStripMenuItem ShowLastMouseMoveMenuItem { get; set; } + #endregion Properties #region Methods @@ -47,7 +51,8 @@ namespace grapher.Models.Serialized { AutoWriteToDriverOnStartup = AutoWriteMenuItem.Checked, DPI = (int)DpiField.Data, - PollRate = (int)PollRateField.Data + PollRate = (int)PollRateField.Data, + ShowLastMouseMove = ShowLastMouseMoveMenuItem.Checked, }; RawAccelSettings.Save(); @@ -63,6 +68,7 @@ namespace grapher.Models.Serialized DpiField.SetToEntered(RawAccelSettings.GUISettings.DPI); PollRateField.SetToEntered(RawAccelSettings.GUISettings.PollRate); AutoWriteMenuItem.Checked = RawAccelSettings.GUISettings.AutoWriteToDriverOnStartup; + ShowLastMouseMoveMenuItem.Checked = RawAccelSettings.GUISettings.ShowLastMouseMove; } public void Startup() @@ -90,7 +96,8 @@ namespace grapher.Models.Serialized { AutoWriteToDriverOnStartup = AutoWriteMenuItem.Checked, DPI = (int)DpiField.Data, - PollRate = (int)PollRateField.Data + PollRate = (int)PollRateField.Data, + ShowLastMouseMove = ShowLastMouseMoveMenuItem.Checked, }); RawAccelSettings.Save(); } -- cgit v1.2.3