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/Models/AccelGUIFactory.cs | 207 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 grapher/Models/AccelGUIFactory.cs (limited to 'grapher/Models/AccelGUIFactory.cs') 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 + } +} -- 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/Models/AccelGUIFactory.cs | 208 ++++++++++++++++++++++++++------------ 1 file changed, 143 insertions(+), 65 deletions(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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); -- 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/Models/AccelGUIFactory.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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, -- 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/Models/AccelGUIFactory.cs | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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, -- 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/Models/AccelGUIFactory.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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); -- 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/Models/AccelGUIFactory.cs | 59 +++++++++++++-------------------------- 1 file changed, 20 insertions(+), 39 deletions(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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, -- 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/Models/AccelGUIFactory.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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), -- 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/Models/AccelGUIFactory.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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); -- 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/Models/AccelGUIFactory.cs') 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/Models/AccelGUIFactory.cs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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; -- 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 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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, -- 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/Models/AccelGUIFactory.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'grapher/Models/AccelGUIFactory.cs') 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( -- 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 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grapher/Models/AccelGUIFactory.cs') 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, -- cgit v1.2.3