From de6b18db8226650cee9726c4694931bdc4b89fad Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sun, 10 Jan 2021 23:49:28 -0800 Subject: Implement direcitonality UI --- grapher/Models/AccelGUIFactory.cs | 73 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 5 deletions(-) (limited to 'grapher/Models/AccelGUIFactory.cs') diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 901a1b5..1035cb7 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -1,6 +1,7 @@ using grapher.Models.Calculations; using grapher.Models.Mouse; using grapher.Models.Options; +using grapher.Models.Options.Directionality; using grapher.Models.Serialized; using System; using System.Windows.Forms; @@ -27,8 +28,6 @@ namespace grapher.Models ButtonBase toggleButton, ToolStripMenuItem showVelocityGainToolStripMenuItem, ToolStripMenuItem showLastMouseMoveMenuItem, - ToolStripMenuItem wholeVectorToolStripMenuItem, - ToolStripMenuItem byVectorComponentToolStripMenuItem, ToolStripMenuItem velocityGainCapToolStripMenuItem, ToolStripMenuItem legacyCapToolStripMenuItem, ToolStripMenuItem gainOffsetToolStripMenuItem, @@ -37,6 +36,7 @@ namespace grapher.Models ToolStripMenuItem scaleMenuItem, ToolStripTextBox dpiTextBox, ToolStripTextBox pollRateTextBox, + Panel directionalityPanel, TextBox sensitivityBoxX, TextBox sensitivityBoxY, TextBox rotationBox, @@ -56,8 +56,16 @@ namespace grapher.Models TextBox expBoxY, TextBox midpointBoxX, TextBox midpointBoxY, + TextBox domainBoxX, + TextBox domainBoxY, + TextBox rangeBoxX, + TextBox rangeBoxY, + TextBox lpNormBox, CheckBox sensXYLock, CheckBox byComponentXYLock, + CheckBox fakeBox, + CheckBox wholeCheckBox, + CheckBox byComponentCheckBox, Label lockXYLabel, Label sensitivityLabel, Label rotationLabel, @@ -102,8 +110,23 @@ namespace grapher.Models Label accelTypeActiveLabelY, Label optionSetXTitle, Label optionSetYTitle, - Label mouseLabel) + Label mouseLabel, + Label directionalityLabel, + Label directionalityX, + Label directionalityY, + Label direcionalityActiveValueTitle, + Label lpNormLabel, + Label lpNormActiveLabel, + Label domainLabel, + Label domainActiveValueX, + Label domainActiveValueY, + Label rangeLabel, + Label rangeActiveValueX, + Label rangeActiveValueY) { + fakeBox.Checked = false; + fakeBox.Hide(); + var accelCalculator = new AccelCalculator( new Field(dpiTextBox.TextBox, form, Constants.DefaultDPI, 1), new Field(pollRateTextBox.TextBox, form, Constants.DefaultPollRate, 1)); @@ -141,6 +164,8 @@ namespace grapher.Models var optionSetYLeft = rotation.Left + rotation.Width; + var directionalityLeft = directionalityPanel.Left; + var weightX = new Option( weightBoxX, form, @@ -265,6 +290,34 @@ namespace grapher.Models new ActiveValueLabel(midpointActiveLabelY, activeValueTitleY), optionSetYLeft); + var lpNorm = new Option( + new Field(lpNormBox, form, 2), + lpNormLabel, + new ActiveValueLabel(lpNormActiveLabel, direcionalityActiveValueTitle), + directionalityLeft); + + var domain = new OptionXY( + domainBoxX, + domainBoxY, + fakeBox, + form, + 1, + domainLabel, + new ActiveValueLabelXY( + new ActiveValueLabel(domainActiveValueX, direcionalityActiveValueTitle), + new ActiveValueLabel(domainActiveValueY, direcionalityActiveValueTitle))); + + var range = new OptionXY( + rangeBoxX, + rangeBoxY, + fakeBox, + form, + 1, + rangeLabel, + new ActiveValueLabelXY( + new ActiveValueLabel(rangeActiveValueX, direcionalityActiveValueTitle), + new ActiveValueLabel(rangeActiveValueY, direcionalityActiveValueTitle))); + var capOptionsX = new CapOptions( velocityGainCapToolStripMenuItem, legacyCapToolStripMenuItem, @@ -313,12 +366,22 @@ namespace grapher.Models rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, accelerationOptionsY); + var directionalOptions = new DirectionalityOptions( + directionalityPanel, + directionalityLabel, + directionalityX, + directionalityY, + lpNorm, + domain, + range, + wholeCheckBox, + byComponentCheckBox); + var applyOptions = new ApplyOptions( - wholeVectorToolStripMenuItem, - byVectorComponentToolStripMenuItem, byComponentXYLock, optionsSetX, optionsSetY, + directionalOptions, sensitivity, rotation, lockXYLabel, -- cgit v1.2.3 From 0776e8313bc2aa406da4603ca2d77e4140e35a5a Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 11 Jan 2021 14:50:37 -0800 Subject: Directionality menu progress --- grapher/Models/AccelGUIFactory.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'grapher/Models/AccelGUIFactory.cs') diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 1035cb7..e8def16 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -371,6 +371,7 @@ namespace grapher.Models directionalityLabel, directionalityX, directionalityY, + direcionalityActiveValueTitle, lpNorm, domain, range, -- cgit v1.2.3 From 784f7cab713640f4a13880ebc3c5abc10894d23c Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 12 Jan 2021 09:25:48 -0800 Subject: Many small tweaks --- 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 e8def16..de01468 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -376,7 +376,8 @@ namespace grapher.Models domain, range, wholeCheckBox, - byComponentCheckBox); + byComponentCheckBox, + 245); var applyOptions = new ApplyOptions( byComponentXYLock, -- cgit v1.2.3 From b6d7c7e67b487143276ad17c9ab85c0dba13180d Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 12 Jan 2021 09:43:25 -0800 Subject: Fix xy anisotropy combining in gui --- grapher/Models/AccelGUIFactory.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'grapher/Models/AccelGUIFactory.cs') diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index de01468..802ce4b 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -305,7 +305,8 @@ namespace grapher.Models domainLabel, new ActiveValueLabelXY( new ActiveValueLabel(domainActiveValueX, direcionalityActiveValueTitle), - new ActiveValueLabel(domainActiveValueY, direcionalityActiveValueTitle))); + new ActiveValueLabel(domainActiveValueY, direcionalityActiveValueTitle)), + false); var range = new OptionXY( rangeBoxX, @@ -316,7 +317,8 @@ namespace grapher.Models rangeLabel, new ActiveValueLabelXY( new ActiveValueLabel(rangeActiveValueX, direcionalityActiveValueTitle), - new ActiveValueLabel(rangeActiveValueY, direcionalityActiveValueTitle))); + new ActiveValueLabel(rangeActiveValueY, direcionalityActiveValueTitle)), + false); var capOptionsX = new CapOptions( velocityGainCapToolStripMenuItem, -- cgit v1.2.3 From 6046120f67327411eafa9c6a9fa0601c2ea5c554 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Wed, 20 Jan 2021 18:25:31 -0800 Subject: Tweaks --- grapher/Models/AccelGUIFactory.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'grapher/Models/AccelGUIFactory.cs') diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 9ca1578..6a4c46f 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -406,7 +406,6 @@ namespace grapher.Models var mouseWatcher = new MouseWatcher(form, mouseLabel, accelCharts, settings); - return new AccelGUI( form, accelCalculator, -- cgit v1.2.3