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.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'grapher/Form1.cs') 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, -- 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 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'grapher/Form1.cs') 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, -- 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/Form1.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grapher/Form1.cs') 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, -- 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 +++++++++++++++---------------------------------------- 1 file changed, 44 insertions(+), 115 deletions(-) (limited to 'grapher/Form1.cs') 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 -- 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/Form1.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'grapher/Form1.cs') 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, -- 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/Form1.cs | 54 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 18 deletions(-) (limited to 'grapher/Form1.cs') 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); } -- 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 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grapher/Form1.cs') 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, -- 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/Form1.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'grapher/Form1.cs') 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, -- 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/Form1.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'grapher/Form1.cs') 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 } } -- 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.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grapher/Form1.cs') 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 -- cgit v1.2.3