From a8d48325d5e6fe0466502b865c82317b6f7410a2 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Mon, 6 Sep 2021 23:24:51 -0400 Subject: get grapher building --- grapher/DeviceMenuForm.Designer.cs | 51 +++++++++ grapher/DeviceMenuForm.cs | 21 ++++ grapher/DeviceMenuForm.resx | 120 ++++++++++++++++++++ grapher/Form1.Designer.cs | 126 ++++++++++----------- grapher/Form1.cs | 5 +- grapher/Models/AccelGUI.cs | 59 ++++------ grapher/Models/AccelGUIFactory.cs | 11 +- grapher/Models/Calculations/AccelCalculator.cs | 20 ++-- .../Models/Calculations/Data/AccelDataCombined.cs | 4 +- .../Calculations/Data/AccelDataXYComponential.cs | 7 +- .../Calculations/Data/AccelDataXYDirectional.cs | 2 +- grapher/Models/Calculations/Data/IAccelData.cs | 2 +- grapher/Models/Charts/AccelCharts.cs | 8 +- grapher/Models/Charts/ChartState/ChartState.cs | 6 +- .../Models/Charts/ChartState/ChartStateManager.cs | 6 +- .../Models/Charts/ChartState/XYTwoGraphState.cs | 2 +- grapher/Models/Devices/DeviceIDManager.cs | 4 +- grapher/Models/Mouse/MouseWatcher.cs | 20 +--- grapher/Models/Options/AccelTypeOptions.cs | 56 +++++---- grapher/Models/Options/ApplyOptions.cs | 18 +-- .../Directionality/DirectionalityOptions.cs | 21 ++-- grapher/Models/Options/LUT/LUTPanelOptions.cs | 27 +++-- grapher/Models/Serialized/SettingsManager.cs | 118 ++++++++++--------- grapher/grapher.csproj | 9 ++ 24 files changed, 454 insertions(+), 269 deletions(-) create mode 100644 grapher/DeviceMenuForm.Designer.cs create mode 100644 grapher/DeviceMenuForm.cs create mode 100644 grapher/DeviceMenuForm.resx (limited to 'grapher') diff --git a/grapher/DeviceMenuForm.Designer.cs b/grapher/DeviceMenuForm.Designer.cs new file mode 100644 index 0000000..6b05645 --- /dev/null +++ b/grapher/DeviceMenuForm.Designer.cs @@ -0,0 +1,51 @@ + +namespace grapher +{ + partial class DeviceMenuForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // DeviceMenuForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(584, 361); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "DeviceMenuForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Device Menu"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/grapher/DeviceMenuForm.cs b/grapher/DeviceMenuForm.cs new file mode 100644 index 0000000..00b36a8 --- /dev/null +++ b/grapher/DeviceMenuForm.cs @@ -0,0 +1,21 @@ +using grapher.Models.Serialized; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace grapher +{ + public partial class DeviceMenuForm : Form + { + public DeviceMenuForm(SettingsManager sm) + { + InitializeComponent(); + } + } +} diff --git a/grapher/DeviceMenuForm.resx b/grapher/DeviceMenuForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/grapher/DeviceMenuForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 203397b..f15bce9 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -71,6 +71,12 @@ namespace grapher System.Windows.Forms.DataVisualization.Charting.Title title6 = new System.Windows.Forms.DataVisualization.Charting.Title(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RawAcceleration)); this.optionsPanel = new System.Windows.Forms.Panel(); + this.SmoothActiveYLabel = new System.Windows.Forms.Label(); + this.smoothLabelY = new System.Windows.Forms.Label(); + this.SmoothActiveXLabel = new System.Windows.Forms.Label(); + this.smoothLabelX = new System.Windows.Forms.Label(); + this.smoothBoxY = new System.Windows.Forms.TextBox(); + this.smoothBoxX = new System.Windows.Forms.TextBox(); this.GrowthRateActiveYLabel = new System.Windows.Forms.Label(); this.GrowthRateActiveXLabel = new System.Windows.Forms.Label(); this.DecayRateActiveYLabel = new System.Windows.Forms.Label(); @@ -209,7 +215,7 @@ namespace grapher this.streamingModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.advancedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AutoWriteMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.UseSpecificDeviceMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.DeviceMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.chartsPanel = new System.Windows.Forms.Panel(); this.GainChartY = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChartY = new System.Windows.Forms.DataVisualization.Charting.Chart(); @@ -217,12 +223,6 @@ namespace grapher this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); - this.smoothBoxX = new System.Windows.Forms.TextBox(); - this.smoothBoxY = new System.Windows.Forms.TextBox(); - this.smoothLabelX = new System.Windows.Forms.Label(); - this.SmoothActiveXLabel = new System.Windows.Forms.Label(); - this.smoothLabelY = new System.Windows.Forms.Label(); - this.SmoothActiveYLabel = new System.Windows.Forms.Label(); this.optionsPanel.SuspendLayout(); this.DirectionalityPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -358,6 +358,56 @@ namespace grapher this.optionsPanel.Size = new System.Drawing.Size(483, 956); this.optionsPanel.TabIndex = 34; // + // SmoothActiveYLabel + // + this.SmoothActiveYLabel.AutoSize = true; + this.SmoothActiveYLabel.Location = new System.Drawing.Point(414, 677); + this.SmoothActiveYLabel.Name = "SmoothActiveYLabel"; + this.SmoothActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.SmoothActiveYLabel.TabIndex = 193; + this.SmoothActiveYLabel.Text = "0"; + // + // smoothLabelY + // + this.smoothLabelY.AutoSize = true; + this.smoothLabelY.Location = new System.Drawing.Point(266, 677); + this.smoothLabelY.Name = "smoothLabelY"; + this.smoothLabelY.Size = new System.Drawing.Size(43, 13); + this.smoothLabelY.TabIndex = 192; + this.smoothLabelY.Text = "Smooth"; + // + // SmoothActiveXLabel + // + this.SmoothActiveXLabel.AutoSize = true; + this.SmoothActiveXLabel.Location = new System.Drawing.Point(200, 677); + this.SmoothActiveXLabel.Name = "SmoothActiveXLabel"; + this.SmoothActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.SmoothActiveXLabel.TabIndex = 191; + this.SmoothActiveXLabel.Text = "0"; + // + // smoothLabelX + // + this.smoothLabelX.AutoSize = true; + this.smoothLabelX.Location = new System.Drawing.Point(38, 677); + this.smoothLabelX.Name = "smoothLabelX"; + this.smoothLabelX.Size = new System.Drawing.Size(43, 13); + this.smoothLabelX.TabIndex = 190; + this.smoothLabelX.Text = "Smooth"; + // + // smoothBoxY + // + this.smoothBoxY.Location = new System.Drawing.Point(332, 671); + this.smoothBoxY.Name = "smoothBoxY"; + this.smoothBoxY.Size = new System.Drawing.Size(76, 20); + this.smoothBoxY.TabIndex = 189; + // + // smoothBoxX + // + this.smoothBoxX.Location = new System.Drawing.Point(106, 672); + this.smoothBoxX.Name = "smoothBoxX"; + this.smoothBoxX.Size = new System.Drawing.Size(76, 20); + this.smoothBoxX.TabIndex = 188; + // // GrowthRateActiveYLabel // this.GrowthRateActiveYLabel.AutoSize = true; @@ -1554,7 +1604,7 @@ namespace grapher // this.advancedToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.AutoWriteMenuItem, - this.UseSpecificDeviceMenuItem}); + this.DeviceMenuItem}); this.advancedToolStripMenuItem.Name = "advancedToolStripMenuItem"; this.advancedToolStripMenuItem.Size = new System.Drawing.Size(72, 20); this.advancedToolStripMenuItem.Text = "Advanced"; @@ -1568,11 +1618,11 @@ namespace grapher this.AutoWriteMenuItem.Size = new System.Drawing.Size(210, 22); this.AutoWriteMenuItem.Text = "Apply Settings On Startup"; // - // UseSpecificDeviceMenuItem + // DeviceMenuItem // - this.UseSpecificDeviceMenuItem.Name = "UseSpecificDeviceMenuItem"; - this.UseSpecificDeviceMenuItem.Size = new System.Drawing.Size(210, 22); - this.UseSpecificDeviceMenuItem.Text = "Use Specific Device"; + this.DeviceMenuItem.Name = "DeviceMenuItem"; + this.DeviceMenuItem.Size = new System.Drawing.Size(210, 22); + this.DeviceMenuItem.Text = "Device Menu"; // // chartsPanel // @@ -1826,56 +1876,6 @@ namespace grapher title6.Text = "Sensitivity"; this.AccelerationChart.Titles.Add(title6); // - // smoothBoxX - // - this.smoothBoxX.Location = new System.Drawing.Point(106, 672); - this.smoothBoxX.Name = "smoothBoxX"; - this.smoothBoxX.Size = new System.Drawing.Size(76, 20); - this.smoothBoxX.TabIndex = 188; - // - // smoothBoxY - // - this.smoothBoxY.Location = new System.Drawing.Point(332, 671); - this.smoothBoxY.Name = "smoothBoxY"; - this.smoothBoxY.Size = new System.Drawing.Size(76, 20); - this.smoothBoxY.TabIndex = 189; - // - // smoothLabelX - // - this.smoothLabelX.AutoSize = true; - this.smoothLabelX.Location = new System.Drawing.Point(38, 677); - this.smoothLabelX.Name = "smoothLabelX"; - this.smoothLabelX.Size = new System.Drawing.Size(43, 13); - this.smoothLabelX.TabIndex = 190; - this.smoothLabelX.Text = "Smooth"; - // - // SmoothActiveXLabel - // - this.SmoothActiveXLabel.AutoSize = true; - this.SmoothActiveXLabel.Location = new System.Drawing.Point(200, 677); - this.SmoothActiveXLabel.Name = "SmoothActiveXLabel"; - this.SmoothActiveXLabel.Size = new System.Drawing.Size(13, 13); - this.SmoothActiveXLabel.TabIndex = 191; - this.SmoothActiveXLabel.Text = "0"; - // - // smoothLabelY - // - this.smoothLabelY.AutoSize = true; - this.smoothLabelY.Location = new System.Drawing.Point(266, 677); - this.smoothLabelY.Name = "smoothLabelY"; - this.smoothLabelY.Size = new System.Drawing.Size(43, 13); - this.smoothLabelY.TabIndex = 192; - this.smoothLabelY.Text = "Smooth"; - // - // SmoothActiveYLabel - // - this.SmoothActiveYLabel.AutoSize = true; - this.SmoothActiveYLabel.Location = new System.Drawing.Point(414, 677); - this.SmoothActiveYLabel.Name = "SmoothActiveYLabel"; - this.SmoothActiveYLabel.Size = new System.Drawing.Size(13, 13); - this.SmoothActiveYLabel.TabIndex = 193; - this.SmoothActiveYLabel.Text = "0"; - // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2016,7 +2016,7 @@ namespace grapher private System.Windows.Forms.Label LpNormActiveValue; private System.Windows.Forms.Label RangeActiveValueY; private System.Windows.Forms.CheckBox FakeBox; - private System.Windows.Forms.ToolStripMenuItem UseSpecificDeviceMenuItem; + private System.Windows.Forms.ToolStripMenuItem DeviceMenuItem; private System.Windows.Forms.Label LUTTextLabelX; private System.Windows.Forms.Label LUTTextLabelY; private System.Windows.Forms.CheckBox gainSwitchX; diff --git a/grapher/Form1.cs b/grapher/Form1.cs index ba16a23..c492a9b 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -40,7 +40,6 @@ namespace grapher AccelGUI = AccelGUIFactory.Construct( this, - ManagedAccel.GetActive(), AccelerationChart, AccelerationChartY, VelocityChart, @@ -57,7 +56,7 @@ namespace grapher showLastMouseMoveToolStripMenuItem, streamingModeToolStripMenuItem, AutoWriteMenuItem, - UseSpecificDeviceMenuItem, + DeviceMenuItem, ScaleMenuItem, DPITextBox, PollRateTextBox, @@ -210,7 +209,7 @@ namespace grapher } else if (m.Msg == 0x00fe) // WM_INPUT_DEVICE_CHANGE { - AccelGUI.UpdateInputManagers(); + AccelGUI.Settings.OnDeviceChangeMessage(); } } diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 4ce6ed8..e4f924a 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -24,8 +24,7 @@ namespace grapher Button writeButton, ButtonBase resetButton, MouseWatcher mouseWatcher, - ToolStripMenuItem scaleMenuItem, - DeviceIDManager deviceIDManager) + ToolStripMenuItem scaleMenuItem) { AccelForm = accelForm; AccelCalculator = accelCalculator; @@ -38,14 +37,13 @@ namespace grapher DefaultButtonFont = WriteButton.Font; SmallButtonFont = new Font(WriteButton.Font.Name, WriteButton.Font.Size * Constants.SmallButtonSizeFactor); MouseWatcher = mouseWatcher; - DeviceIDManager = deviceIDManager; ScaleMenuItem.Click += new System.EventHandler(OnScaleMenuItemClick); WriteButton.Click += new System.EventHandler(OnWriteButtonClick); ResetButton.Click += new System.EventHandler(ResetDriverEventHandler); AccelForm.FormClosing += new FormClosingEventHandler(SaveGUISettingsOnClose); - ButtonTimerInterval = Convert.ToInt32(DriverSettings.WriteDelayMs); + ButtonTimerInterval = Convert.ToInt32(DriverConfig.WriteDelayMs); ButtonTimer = new Timer(); ButtonTimer.Tick += new System.EventHandler(OnButtonTimerTick); @@ -85,8 +83,6 @@ namespace grapher public ToolStripMenuItem ScaleMenuItem { get; } - public DeviceIDManager DeviceIDManager { get; } - private Timer ChartRefresh { get; } private Font SmallButtonFont { get; } @@ -112,21 +108,23 @@ namespace grapher } } - public DriverSettings MakeSettingsFromFields() + public Profile MakeSettingsFromFields() { - var settings = new DriverSettings(); + var settings = new Profile(); settings.rotation = ApplyOptions.Rotation.Field.Data; - settings.sensitivity = new Vec2 - { - x = ApplyOptions.Sensitivity.Fields.X, - y = ApplyOptions.Sensitivity.Fields.Y - }; + settings.sensitivity = ApplyOptions.Sensitivity.Fields.X; + + // TODO - separate sensitivity fields, add new label for ratio + settings.yxSensRatio = ApplyOptions.Sensitivity.Fields.Y; settings.combineMagnitudes = ApplyOptions.IsWhole; - ApplyOptions.SetArgs(ref settings.args); - settings.domainArgs = ApplyOptions.Directionality.GetDomainArgs(); + ApplyOptions.SetArgs(ref settings.argsX, ref settings.argsY); + + var (domWeights, lpNorm) = ApplyOptions.Directionality.GetDomainArgs(); + settings.domainXY = domWeights; + settings.lpNorm = lpNorm; + settings.rangeXY = ApplyOptions.Directionality.GetRangeXY(); - settings.deviceID = DeviceIDManager.ID; Settings.SetHiddenOptions(settings); @@ -141,16 +139,15 @@ namespace grapher { ButtonDelay(WriteButton); - var settings = MakeSettingsFromFields(); - SettingsErrors errors = Settings.TryActivate(settings); - if (errors.Empty()) + var cfg = DriverConfig.FromProfile(MakeSettingsFromFields()); + if (!Settings.TryActivate(cfg, out string errors)) { - RefreshActive(); - return; + error_message = errors.ToString(); } else { - error_message = errors.ToString(); + RefreshActive(); + return; } } catch (ApplicationException e) @@ -161,34 +158,24 @@ namespace grapher new MessageDialog(error_message, "bad input").ShowDialog(); } - - public void UpdateInputManagers() - { - MouseWatcher.UpdateHandles(Settings.ActiveSettings.baseSettings.deviceID); - DeviceIDManager.Update(Settings.ActiveSettings.baseSettings.deviceID); - } - public void RefreshActive() { - UpdateShownActiveValues(Settings.UserSettings); + UpdateShownActiveValues(Settings.ActiveProfile); UpdateGraph(); - UpdateInputManagers(); } public void RefreshUser() { - UpdateShownActiveValues(Settings.UserSettings); + UpdateShownActiveValues(Settings.UserProfile); } public void UpdateGraph() { - AccelCharts.Calculate( - Settings.ActiveAccel, - Settings.ActiveSettings.baseSettings); + AccelCharts.Calculate(Settings.ActiveAccel, Settings.ActiveProfile); AccelCharts.Bind(); } - public void UpdateShownActiveValues(DriverSettings args) + public void UpdateShownActiveValues(Profile args) { AccelForm.ResetAutoScroll(); AccelCharts.ShowActive(args); diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 7e5ae9b..cc43aeb 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -17,7 +17,6 @@ namespace grapher.Models public static AccelGUI Construct( RawAcceleration form, - ManagedAccel activeAccel, Chart accelerationChart, Chart accelerationChartY, Chart velocityChart, @@ -34,7 +33,7 @@ namespace grapher.Models ToolStripMenuItem showLastMouseMoveMenuItem, ToolStripMenuItem streamingModeToolStripMenuItem, ToolStripMenuItem autoWriteMenuItem, - ToolStripMenuItem useSpecificDeviceMenuItem, + ToolStripMenuItem deviceMenuItem, ToolStripMenuItem scaleMenuItem, ToolStripTextBox dpiTextBox, ToolStripTextBox pollRateTextBox, @@ -492,17 +491,14 @@ namespace grapher.Models lockXYLabel, accelCharts); - var deviceIdManager = new DeviceIDManager(useSpecificDeviceMenuItem); - var settings = new SettingsManager( - activeAccel, accelCalculator.DPI, accelCalculator.PollRate, autoWriteMenuItem, showLastMouseMoveMenuItem, showVelocityGainToolStripMenuItem, streamingModeToolStripMenuItem, - deviceIdManager); + deviceMenuItem); var mouseWatcher = new MouseWatcher(form, mouseLabel, accelCharts, settings); @@ -515,8 +511,7 @@ namespace grapher.Models writeButton, toggleButton, mouseWatcher, - scaleMenuItem, - deviceIdManager); + scaleMenuItem); } #endregion Methods diff --git a/grapher/Models/Calculations/AccelCalculator.cs b/grapher/Models/Calculations/AccelCalculator.cs index 574f55a..6b9cbf3 100644 --- a/grapher/Models/Calculations/AccelCalculator.cs +++ b/grapher/Models/Calculations/AccelCalculator.cs @@ -107,7 +107,7 @@ namespace grapher.Models.Calculations continue; } - var output = accel.Accelerate(simulatedInputDatum.x, simulatedInputDatum.y, simulatedInputDatum.time); + var output = accel.Accelerate(simulatedInputDatum.x, simulatedInputDatum.y, 1, simulatedInputDatum.time); var outMagnitude = DecimalCheck(Velocity(output.Item1, output.Item2, simulatedInputDatum.time)); var inDiff = Math.Round(simulatedInputDatum.velocity - lastInputMagnitude, 5); var outDiff = Math.Round(outMagnitude - lastOutputMagnitude, 5); @@ -193,7 +193,7 @@ namespace grapher.Models.Calculations data.MinGain = minSlope; } - public void CalculateDirectional(AccelChartData[] dataByAngle, ManagedAccel accel, DriverSettings settings, IReadOnlyCollection> simulatedInputData) + public void CalculateDirectional(AccelChartData[] dataByAngle, ManagedAccel accel, Profile settings, IReadOnlyCollection> simulatedInputData) { double maxRatio = 0.0; double minRatio = Double.MaxValue; @@ -219,7 +219,7 @@ namespace grapher.Models.Calculations continue; } - var output = accel.Accelerate(simulatedInputDatum.x, simulatedInputDatum.y, simulatedInputDatum.time); + var output = accel.Accelerate(simulatedInputDatum.x, simulatedInputDatum.y, 1, simulatedInputDatum.time); var magnitude = DecimalCheck(Velocity(output.Item1, output.Item2, simulatedInputDatum.time)); var inDiff = Math.Round(simulatedInputDatum.velocity - lastInputMagnitude, 5); var outDiff = Math.Round(magnitude - lastOutputMagnitude, 5); @@ -246,7 +246,7 @@ namespace grapher.Models.Calculations } var ratio = DecimalCheck(magnitude / simulatedInputDatum.velocity); - var slope = DecimalCheck(inDiff > 0 ? outDiff / inDiff : settings.sensitivity.x); + var slope = DecimalCheck(inDiff > 0 ? outDiff / inDiff : settings.sensitivity); bool indexToMeasureExtrema = (angleIndex == 0) || (angleIndex == (Constants.AngleDivisions - 1)); @@ -477,16 +477,16 @@ namespace grapher.Models.Calculations return Magnitude(x, y) / time; } - public static bool ShouldStripSens(ref DriverSettings settings) => - settings.sensitivity.x != settings.sensitivity.y; + public static bool ShouldStripSens(Profile settings) => + settings.yxSensRatio != 1; - public static bool ShouldStripRot(ref DriverSettings settings) => + public static bool ShouldStripRot(Profile settings) => settings.rotation > 0; - public static (double, double) GetSens(ref DriverSettings settings) => - (settings.sensitivity.x, settings.sensitivity.y); + public static (double, double) GetSens(Profile settings) => + (settings.sensitivity, settings.sensitivity * settings.yxSensRatio); - public static (double, double) GetRotVector(ref DriverSettings settings) => + public static (double, double) GetRotVector(Profile settings) => (Math.Cos(settings.rotation), Math.Sin(settings.rotation)); public static (double, double) StripSens(double outputX, double outputY, double sensitivityX, double sensitivityY) => diff --git a/grapher/Models/Calculations/Data/AccelDataCombined.cs b/grapher/Models/Calculations/Data/AccelDataCombined.cs index 8efb9ac..025a344 100644 --- a/grapher/Models/Calculations/Data/AccelDataCombined.cs +++ b/grapher/Models/Calculations/Data/AccelDataCombined.cs @@ -40,10 +40,10 @@ namespace grapher.Models.Calculations.Data X.Clear(); } - public void CreateGraphData(ManagedAccel accel, DriverSettings settings) + public void CreateGraphData(ManagedAccel accel, Profile settings) { Clear(); - Calculator.Calculate(X, accel, settings.sensitivity.x, Calculator.SimulatedInputCombined); + Calculator.Calculate(X, accel, settings.sensitivity, Calculator.SimulatedInputCombined); } } } diff --git a/grapher/Models/Calculations/Data/AccelDataXYComponential.cs b/grapher/Models/Calculations/Data/AccelDataXYComponential.cs index 6231eb3..f954230 100644 --- a/grapher/Models/Calculations/Data/AccelDataXYComponential.cs +++ b/grapher/Models/Calculations/Data/AccelDataXYComponential.cs @@ -54,11 +54,12 @@ namespace grapher.Models.Calculations.Data Y.Clear(); } - public void CreateGraphData(ManagedAccel accel, DriverSettings settings) + public void CreateGraphData(ManagedAccel accel, Profile settings) { Clear(); - Calculator.Calculate(X, accel, settings.sensitivity.x, Calculator.SimulatedInputX); - Calculator.Calculate(Y, accel, settings.sensitivity.y, Calculator.SimulatedInputY); + var sensY = settings.sensitivity * settings.yxSensRatio; + Calculator.Calculate(X, accel, settings.sensitivity, Calculator.SimulatedInputX); + Calculator.Calculate(Y, accel, sensY, Calculator.SimulatedInputY); } } } diff --git a/grapher/Models/Calculations/Data/AccelDataXYDirectional.cs b/grapher/Models/Calculations/Data/AccelDataXYDirectional.cs index 8bd889d..b139719 100644 --- a/grapher/Models/Calculations/Data/AccelDataXYDirectional.cs +++ b/grapher/Models/Calculations/Data/AccelDataXYDirectional.cs @@ -67,7 +67,7 @@ namespace grapher.Models.Calculations.Data } } - public void CreateGraphData(ManagedAccel accel, DriverSettings settings) + public void CreateGraphData(ManagedAccel accel, Profile settings) { Clear(); Calculator.CalculateDirectional(AngleToData, accel, settings, Calculator.SimulatedDirectionalInput); diff --git a/grapher/Models/Calculations/Data/IAccelData.cs b/grapher/Models/Calculations/Data/IAccelData.cs index 576e6df..2ae6716 100644 --- a/grapher/Models/Calculations/Data/IAccelData.cs +++ b/grapher/Models/Calculations/Data/IAccelData.cs @@ -10,7 +10,7 @@ namespace grapher.Models.Calculations.Data { void CalculateDots(double x, double y, double timeInMs); - void CreateGraphData(ManagedAccel accel, DriverSettings settings); + void CreateGraphData(ManagedAccel accel, Profile settings); void Clear(); diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 631c2e2..93c9218 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -121,9 +121,9 @@ namespace grapher ChartState.Bind(); } - public void ShowActive(DriverSettings driverSettings) + public void ShowActive(Profile args) { - ChartState = ChartStateManager.DetermineState(driverSettings); + ChartState = ChartStateManager.DetermineState(args); ChartState.Activate(); Bind(); } @@ -134,9 +134,9 @@ namespace grapher ChartState.Redraw(); } - public void Calculate(ManagedAccel accel, DriverSettings settings) + public void Calculate(ManagedAccel accel, Profile settings) { - ChartState.SetUpCalculate(settings); + ChartState.SetUpCalculate(); ChartState.Calculate(accel, settings); } diff --git a/grapher/Models/Charts/ChartState/ChartState.cs b/grapher/Models/Charts/ChartState/ChartState.cs index a50eaf0..eca2e43 100644 --- a/grapher/Models/Charts/ChartState/ChartState.cs +++ b/grapher/Models/Charts/ChartState/ChartState.cs @@ -35,7 +35,7 @@ namespace grapher.Models.Charts.ChartState public AccelCalculator Calculator { get; } - public virtual DriverSettings Settings { get; set; } + public virtual Profile Settings { get; set; } internal bool TwoDotsPerGraph { get; set; } @@ -48,7 +48,7 @@ namespace grapher.Models.Charts.ChartState public abstract void Activate(); - public virtual void Calculate(ManagedAccel accel, DriverSettings settings) + public virtual void Calculate(ManagedAccel accel, Profile settings) { Data.CreateGraphData(accel, settings); } @@ -60,7 +60,7 @@ namespace grapher.Models.Charts.ChartState GainChart.Update(); } - public virtual void SetUpCalculate(DriverSettings settings) + public virtual void SetUpCalculate() { Data.Clear(); Calculator.ScaleByMouseSettings(); diff --git a/grapher/Models/Charts/ChartState/ChartStateManager.cs b/grapher/Models/Charts/ChartState/ChartStateManager.cs index 3d4bbec..1e5386c 100644 --- a/grapher/Models/Charts/ChartState/ChartStateManager.cs +++ b/grapher/Models/Charts/ChartState/ChartStateManager.cs @@ -50,14 +50,14 @@ namespace grapher.Models.Charts.ChartState private XYTwoGraphState XYTwoGraphState { get; } - public ChartState DetermineState(DriverSettings settings) + public ChartState DetermineState(Profile settings) { ChartState chartState; if (settings.combineMagnitudes) { - if (settings.sensitivity.x != settings.sensitivity.y || - settings.domainArgs.domainXY.x != settings.domainArgs.domainXY.y || + if (settings.yxSensRatio != 1 || + settings.domainXY.x != settings.domainXY.y || settings.rangeXY.x != settings.rangeXY.y) { chartState = XYOneGraphState; diff --git a/grapher/Models/Charts/ChartState/XYTwoGraphState.cs b/grapher/Models/Charts/ChartState/XYTwoGraphState.cs index 5b6c2b8..387d1b1 100644 --- a/grapher/Models/Charts/ChartState/XYTwoGraphState.cs +++ b/grapher/Models/Charts/ChartState/XYTwoGraphState.cs @@ -23,7 +23,7 @@ namespace grapher.Models.Charts.ChartState Data = new AccelDataXYComponential(xPoints, yPoints, accelCalculator); } - public override DriverSettings Settings { get; set; } + public override Profile Settings { get; set; } public override void Activate() { diff --git a/grapher/Models/Devices/DeviceIDManager.cs b/grapher/Models/Devices/DeviceIDManager.cs index 39856a1..e0ee686 100644 --- a/grapher/Models/Devices/DeviceIDManager.cs +++ b/grapher/Models/Devices/DeviceIDManager.cs @@ -46,7 +46,7 @@ namespace grapher.Models.Devices if (found) SetActive(anyDevice); - foreach (string id in RawInputInterop.GetDeviceIDs()) +/* foreach (string id in RawInputInterop.GetDeviceIDs()) { var deviceItem = new DeviceIDItem(string.Empty, id, this); if (!found && deviceItem.ID.Equals(devID)) @@ -54,7 +54,7 @@ namespace grapher.Models.Devices SetActive(deviceItem); found = true; } - } + }*/ if (!found) { diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index c5c2ae5..c36ceb4 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -691,7 +691,6 @@ namespace grapher.Models.Mouse AccelCharts = accelCharts; SettingsManager = setMngr; MouseData = new MouseData(); - DeviceHandles = new List(); RAWINPUTDEVICE device = new RAWINPUTDEVICE(); device.WindowHandle = ContainingForm.Handle; @@ -722,10 +721,6 @@ namespace grapher.Models.Mouse private Stopwatch Stopwatch { get; } - private List DeviceHandles { get; } - - private bool AnyDevice { get; set; } - private double PollTime { get => 1000 / SettingsManager.PollRateField.Data; @@ -735,16 +730,6 @@ namespace grapher.Models.Mouse #region Methods - public void UpdateHandles(string devID) - { - DeviceHandles.Clear(); - AnyDevice = string.IsNullOrEmpty(devID); - if (!AnyDevice) - { - RawInputInterop.AddHandlesFromID(devID, DeviceHandles); - } - } - public void UpdateLastMove() { MouseData.Get(out var x, out var y); @@ -758,7 +743,7 @@ namespace grapher.Models.Mouse _ = GetRawInputData(message.LParam, RawInputCommand.Input, out rawInput, ref size, Marshal.SizeOf(typeof(RAWINPUTHEADER))); bool relative = !rawInput.Data.Mouse.Flags.HasFlag(RawMouseFlags.MoveAbsolute); - bool deviceMatch = AnyDevice || DeviceHandles.Contains(rawInput.Header.Device); + bool deviceMatch = SettingsManager.ActiveHandles.Contains(rawInput.Header.Device); if (relative && deviceMatch && (rawInput.Data.Mouse.LastX != 0 || rawInput.Data.Mouse.LastY != 0)) { @@ -772,8 +757,7 @@ namespace grapher.Models.Mouse // strip negative directional multipliers, charts calculated from positive input - Vec2 dirMults = SettingsManager.ActiveSettings.baseSettings - .directionalMultipliers; + Vec2 dirMults = SettingsManager.ActiveProfile.directionalMultipliers; if (dirMults.x > 0 && x < 0) { diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 44c9ea8..eab38a1 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -21,7 +21,6 @@ namespace grapher public static readonly LayoutBase Power = new PowerLayout(); public static readonly LayoutBase LUT = new LUTLayout(); public static readonly LayoutBase Off = new OffLayout(); - public static readonly LayoutBase Unsupported = new UnsupportedLayout(); #endregion Fields @@ -262,21 +261,22 @@ namespace grapher { AccelerationType = AccelTypeFromSettings(ref args); AccelTypeActiveValue.SetValue(AccelerationType.ActiveName); - GainSwitch.SetActiveValue(args.legacy); + GainSwitch.SetActiveValue(args.gain); Weight.SetActiveValue(args.weight); - Cap.SetActiveValue(args.cap); + Cap.SetActiveValue(args.cap.x); Offset.SetActiveValue(args.offset); - Acceleration.SetActiveValue(args.accelClassic); + Acceleration.SetActiveValue(args.acceleration); DecayRate.SetActiveValue(args.decayRate); GrowthRate.SetActiveValue(args.growthRate); Smooth.SetActiveValue(args.smooth); Scale.SetActiveValue(args.scale); Limit.SetActiveValue((args.mode == AccelMode.motivity) ? args.motivity : args.limit); - PowerClassic.SetActiveValue(args.power); - Exponent.SetActiveValue(args.exponent); + PowerClassic.SetActiveValue(args.exponentClassic); + Exponent.SetActiveValue(args.exponentPower); Midpoint.SetActiveValue(args.midpoint); - LutPanel.SetActiveValues(args.tableData.points, args.tableData.length); - LutApply.SetActiveValue(args.tableData.velocity); + LutPanel.SetActiveValues(args.data, args.length, args.mode); + // TODO - use GainSwitch only? + LutApply.SetActiveValue(args.gain); } public void ShowFull() @@ -308,17 +308,16 @@ namespace grapher public void SetArgs(ref AccelArgs args) { - if (AccelerationType == Unsupported) throw new NotImplementedException(); - args.mode = AccelerationType.Mode; - args.legacy = !GainSwitch.CheckBox.Checked; + args.gain = GainSwitch.CheckBox.Checked; - if (Acceleration.Visible) args.accelClassic = Acceleration.Field.Data; + if (Acceleration.Visible) args.acceleration = Acceleration.Field.Data; if (DecayRate.Visible) args.decayRate = DecayRate.Field.Data; if (GrowthRate.Visible) args.growthRate = GrowthRate.Field.Data; if (Smooth.Visible) args.smooth = Smooth.Field.Data; if (Scale.Visible) args.scale = Scale.Field.Data; - if (Cap.Visible) args.cap = Cap.Field.Data; + // TODO - make field for output and in_out cap + if (Cap.Visible) args.cap.x = Cap.Field.Data; if (Limit.Visible) { if (args.mode == AccelMode.motivity) @@ -328,20 +327,27 @@ namespace grapher else { args.limit = Limit.Field.Data; - } + } } - if (PowerClassic.Visible) args.power = PowerClassic.Field.Data; - if (Exponent.Visible)args.exponent = Exponent.Field.Data; + if (PowerClassic.Visible) args.exponentClassic = PowerClassic.Field.Data; + if (Exponent.Visible) args.exponentPower = Exponent.Field.Data; if (Offset.Visible) args.offset = Offset.Field.Data; if (Midpoint.Visible) args.midpoint = Midpoint.Field.Data; if (Weight.Visible) args.weight = Weight.Field.Data; if (LutPanel.Visible) { (var points, var length) = LutPanel.GetPoints(); - args.tableData.points = points; - args.tableData.length = length; + args.length = length * 2; + + for (int i = 0; i < length; i++) + { + ref var p = ref points[i]; + var data_idx = i * 2; + args.data[data_idx] = p.x; + args.data[data_idx + 1] = p.y; + } } - if (LutApply.Visible) args.tableData.velocity = LutApply.ApplyType == LutApplyOptions.LutApplyType.Velocity; + } public override void AlignActiveValues() @@ -407,19 +413,9 @@ namespace grapher private LayoutBase AccelTypeFromSettings(ref AccelArgs args) { - if (args.spacedTableArgs.mode != SpacedTableMode.off) - { - if (!AccelDropdown.Items.Contains(Unsupported)) - { - AccelDropdown.Items.Add(Unsupported); - } - - return Unsupported; - } - switch (args.mode) { - case AccelMode.classic: return (args.power == 2) ? Linear : Classic; + case AccelMode.classic: return (args.exponentClassic == 2) ? Linear : Classic; case AccelMode.jump: return Jump; case AccelMode.natural: return Natural; case AccelMode.motivity: return Motivity; diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 06854b8..0d87943 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -81,30 +81,30 @@ namespace grapher.Models.Options #region Methods - public void SetArgs(ref Vec2 args) + public void SetArgs(ref AccelArgs argsX, ref AccelArgs argsY) { - OptionSetX.SetArgs(ref args.x); + OptionSetX.SetArgs(ref argsX); if (ByComponentVectorXYLock.Checked) { - OptionSetX.SetArgs(ref args.y); + OptionSetX.SetArgs(ref argsY); } else { - OptionSetY.SetArgs(ref args.y); + OptionSetY.SetArgs(ref argsY); } } - public void SetActiveValues(DriverSettings settings) + public void SetActiveValues(Profile settings) { - Sensitivity.SetActiveValues(settings.sensitivity.x, settings.sensitivity.y); + Sensitivity.SetActiveValues(settings.sensitivity, settings.yxSensRatio); Rotation.SetActiveValue(settings.rotation); WholeVectorCheckBox.Checked = settings.combineMagnitudes; ByComponentVectorCheckBox.Checked = !settings.combineMagnitudes; - ByComponentVectorXYLock.Checked = settings.args.x.Equals(settings.args.y); - OptionSetX.SetActiveValues(ref settings.args.x); - OptionSetY.SetActiveValues(ref settings.args.y); + ByComponentVectorXYLock.Checked = settings.argsX.Equals(settings.argsY); + OptionSetX.SetActiveValues(ref settings.argsX); + OptionSetY.SetActiveValues(ref settings.argsY); Directionality.SetActiveValues(settings); diff --git a/grapher/Models/Options/Directionality/DirectionalityOptions.cs b/grapher/Models/Options/Directionality/DirectionalityOptions.cs index 9288132..35d2575 100644 --- a/grapher/Models/Options/Directionality/DirectionalityOptions.cs +++ b/grapher/Models/Options/Directionality/DirectionalityOptions.cs @@ -70,17 +70,16 @@ namespace grapher.Models.Options.Directionality private bool IsHidden { get; set; } - public DomainArgs GetDomainArgs() + public Tuple, double> GetDomainArgs() { - return new DomainArgs + var weights = new Vec2 { - domainXY = new Vec2 - { - x = Domain.Fields.X, - y = Domain.Fields.Y, - }, - lpNorm = ByComponentCheckBox.Checked ? 2 : LpNorm.Field.Data + x = Domain.Fields.X, + y = Domain.Fields.Y }; + double p = ByComponentCheckBox.Checked ? 2 : LpNorm.Field.Data; + + return new Tuple, double>(weights, p); } public Vec2 GetRangeXY() @@ -92,14 +91,14 @@ namespace grapher.Models.Options.Directionality }; } - public void SetActiveValues(DriverSettings settings) + public void SetActiveValues(Profile settings) { - Domain.SetActiveValues(settings.domainArgs.domainXY.x, settings.domainArgs.domainXY.y); + Domain.SetActiveValues(settings.domainXY.x, settings.domainXY.y); Range.SetActiveValues(settings.rangeXY.x, settings.rangeXY.y); if (settings.combineMagnitudes) { - LpNorm.SetActiveValue(settings.domainArgs.lpNorm); + LpNorm.SetActiveValue(settings.lpNorm); } else { diff --git a/grapher/Models/Options/LUT/LUTPanelOptions.cs b/grapher/Models/Options/LUT/LUTPanelOptions.cs index 3690c76..11550e4 100644 --- a/grapher/Models/Options/LUT/LUTPanelOptions.cs +++ b/grapher/Models/Options/LUT/LUTPanelOptions.cs @@ -111,15 +111,26 @@ namespace grapher.Models.Options.LUT // Nothing to do here. } - public void SetActiveValues(IEnumerable> activePoints, int length) + public void SetActiveValues(IEnumerable rawData, int length, AccelMode mode) { - if (length > 0 && activePoints.First().x != 0) + if (mode == AccelMode.lut && length > 1 && rawData.First() != 0) { - ActiveValuesTextBox.Text = PointsToActiveValuesText(activePoints, length); + var pointsLen = length / 2; + var points = new Vec2[pointsLen]; + for (int i = 0; i < pointsLen; i++) + { + var data_idx = i * 2; + points[i] = new Vec2 + { + x = rawData.ElementAt(data_idx), + y = rawData.ElementAt(data_idx + 1) + }; + } + ActiveValuesTextBox.Text = PointsToActiveValuesText(points, length); if (string.IsNullOrWhiteSpace(PointsTextBox.Text)) { - PointsTextBox.Text = PointsToEntryTextBoxText(activePoints, length); + PointsTextBox.Text = PointsToEntryTextBoxText(points, length); } } else @@ -135,14 +146,12 @@ namespace grapher.Models.Options.LUT private static (Vec2[], int length) UserTextToPoints(string userText) { - const int MaxPoints = 256; - if (string.IsNullOrWhiteSpace(userText)) { throw new ApplicationException("Text must be entered in text box to fill Look Up Table."); } - Vec2[] points = new Vec2[MaxPoints]; + Vec2[] points = new Vec2[AccelArgs.MaxLutPoints]; var userTextSplit = userText.Trim().Trim(';').Split(';'); int index = 0; @@ -155,9 +164,9 @@ namespace grapher.Models.Options.LUT throw new ApplicationException("At least 2 points required"); } - if (pointsCount > MaxPoints) + if (pointsCount > AccelArgs.MaxLutPoints) { - throw new ApplicationException($"Number of points exceeds max ({MaxPoints})"); + throw new ApplicationException($"Number of points exceeds max ({AccelArgs.MaxLutPoints})"); } foreach(var pointEntry in userTextSplit) diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs index 346bc9b..d92f18a 100644 --- a/grapher/Models/Serialized/SettingsManager.cs +++ b/grapher/Models/Serialized/SettingsManager.cs @@ -6,6 +6,7 @@ using System.Threading; using System.Text; using System.Drawing; using grapher.Models.Devices; +using System.Collections.Generic; namespace grapher.Models.Serialized { @@ -14,14 +15,13 @@ namespace grapher.Models.Serialized #region Constructors public SettingsManager( - ManagedAccel activeAccel, Field dpiField, Field pollRateField, ToolStripMenuItem autoWrite, ToolStripMenuItem showLastMouseMove, ToolStripMenuItem showVelocityAndGain, ToolStripMenuItem streamingMode, - DeviceIDManager deviceIDManager) + ToolStripMenuItem deviceMenuItem) { DpiField = dpiField; PollRateField = pollRateField; @@ -29,9 +29,14 @@ namespace grapher.Models.Serialized ShowLastMouseMoveMenuItem = showLastMouseMove; ShowVelocityAndGainMoveMenuItem = showVelocityAndGain; StreamingModeMenuItem = streamingMode; - DeviceIDManager = deviceIDManager; + deviceMenuItem.Click += (s, e) => new DeviceMenuForm(this).ShowDialog(); - SetActiveFields(activeAccel); + SystemDevices = new List(); + ActiveHandles = new List(); + + // TODO - remove ActiveConfig/AutoWrite entirely? + // shouldn't be needed with internal profiles support + ActiveConfig = DriverConfig.GetActive(); GuiSettings = GUISettings.MaybeLoad(); @@ -45,7 +50,7 @@ namespace grapher.Models.Serialized UpdateFieldsFromGUISettings(); } - UserSettings = InitUserSettings(); + UserConfig = InitUserSettings(); } #endregion Constructors @@ -54,23 +59,39 @@ namespace grapher.Models.Serialized public GUISettings GuiSettings { get; private set; } - public ManagedAccel ActiveAccel { get; private set; } + public DriverConfig ActiveConfig { get; private set; } + + public Profile ActiveProfile + { + get => ActiveConfig.profiles[0]; + } - public ExtendedSettings ActiveSettings { get; private set; } + public ManagedAccel ActiveAccel + { + get => ActiveConfig.accels[0]; + } - public DriverSettings UserSettings { get; private set; } + public DriverConfig UserConfig { get; private set; } + + public Profile UserProfile + { + get => UserConfig.profiles[0]; + } public Field DpiField { get; private set; } public Field PollRateField { get; private set; } - public DeviceIDManager DeviceIDManager { get; } + public IList SystemDevices { get; private set; } + + public List ActiveHandles { get; private set; } private ToolStripMenuItem AutoWriteMenuItem { get; set; } private ToolStripMenuItem ShowLastMouseMoveMenuItem { get; set; } private ToolStripMenuItem ShowVelocityAndGainMoveMenuItem { get; set; } + private ToolStripMenuItem StreamingModeMenuItem{ get; set; } #endregion Properties @@ -78,10 +99,8 @@ namespace grapher.Models.Serialized public void DisableDriver() { - var defaultSettings = new ExtendedSettings(); - ActiveSettings = defaultSettings; - ActiveAccel.Settings = defaultSettings; - new Thread(() => ActiveAccel.Activate()).Start(); + ActiveConfig = DriverConfig.GetDefault(); + new Thread(() => DriverConfig.Deactivate()).Start(); } public void UpdateFieldsFromGUISettings() @@ -94,36 +113,31 @@ namespace grapher.Models.Serialized AutoWriteMenuItem.Checked = GuiSettings.AutoWriteToDriverOnStartup; } - public SettingsErrors TryActivate(DriverSettings settings) + public bool TryActivate(DriverConfig settings, out string errors) { - var errors = new SettingsErrors(settings); + errors = settings.Errors(); - if (errors.Empty()) + if (errors == null) { GuiSettings = MakeGUISettingsFromFields(); GuiSettings.Save(); - UserSettings = settings; - File.WriteAllText(Constants.DefaultSettingsFileName, RaConvert.Settings(settings)); + UserConfig = settings; + ActiveConfig = settings; + File.WriteAllText(Constants.DefaultSettingsFileName, settings.ToJSON()); - ActiveSettings = new ExtendedSettings(settings); - ActiveAccel.Settings = ActiveSettings; - - new Thread(() => ActiveAccel.Activate()).Start(); + new Thread(() => ActiveConfig.Activate()).Start(); } - return errors; + return errors == null; } - public void SetHiddenOptions(DriverSettings settings) + public void SetHiddenOptions(Profile settings) { - settings.snap = UserSettings.snap; - settings.maximumSpeed = UserSettings.maximumSpeed; - settings.minimumSpeed = UserSettings.minimumSpeed; - settings.minimumTime = UserSettings.minimumTime; - settings.maximumTime = UserSettings.maximumTime; - settings.ignore = UserSettings.ignore; - settings.directionalMultipliers = UserSettings.directionalMultipliers; + settings.snap = UserProfile.snap; + settings.maximumSpeed = UserProfile.maximumSpeed; + settings.minimumSpeed = UserProfile.minimumSpeed; + settings.directionalMultipliers = UserProfile.directionalMultipliers; } public GUISettings MakeGUISettingsFromFields() @@ -139,31 +153,40 @@ namespace grapher.Models.Serialized }; } - public bool TableActive() + private void SetActiveHandles() + { + ActiveHandles.Clear(); + // TODO + foreach (var sysDev in SystemDevices) + { + ActiveHandles.AddRange(sysDev.handles); + } + } + + private void OnProfileSwitch() { - return ActiveSettings.tables.x != null || ActiveSettings.tables.y != null; + SetActiveHandles(); } - public void SetActiveFields(ManagedAccel activeAccel) + public void OnDeviceChangeMessage() { - ActiveAccel = activeAccel; - ActiveSettings = activeAccel.Settings; + SystemDevices = MultiHandleDevice.GetList(); + SetActiveHandles(); } - private DriverSettings InitUserSettings() + private DriverConfig InitUserSettings() { var path = Constants.DefaultSettingsFileName; if (File.Exists(path)) { try { - DriverSettings settings = RaConvert.Settings(File.ReadAllText(path)); + var (cfg, err) = DriverConfig.Convert(File.ReadAllText(path)); if (!GuiSettings.AutoWriteToDriverOnStartup || - TableActive() || - TryActivate(settings).Empty()) + (err == null && TryActivate(cfg, out string _))) { - return settings; + return cfg; } } @@ -173,17 +196,8 @@ namespace grapher.Models.Serialized } } - if (!TableActive()) - { - File.WriteAllText(path, RaConvert.Settings(ActiveSettings.baseSettings)); - return ActiveSettings.baseSettings; - } - else - { - var defaultSettings = new DriverSettings(); - File.WriteAllText(path, RaConvert.Settings(defaultSettings)); - return defaultSettings; - } + File.WriteAllText(path, ActiveConfig.ToJSON()); + return ActiveConfig; } #endregion Methods diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index 7b0ab02..9a9412b 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -78,6 +78,12 @@ AboutBox.cs + + Form + + + DeviceMenuForm.cs + @@ -148,6 +154,9 @@ AboutBox.cs Designer + + DeviceMenuForm.cs + Form1.cs -- cgit v1.2.3 From 265312d5759321010725e56a22b68c7294730545 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Tue, 7 Sep 2021 05:09:31 -0400 Subject: show power mode cap field --- grapher/Layouts/PowerLayout.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grapher') diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index 03d9efa..d11480f 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -15,7 +15,7 @@ GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); ScaleLayout = new OptionLayout(true, Scale); - CapLayout = new OptionLayout(false, string.Empty); + CapLayout = new OptionLayout(true, Cap); WeightLayout = new OptionLayout(true, Weight); OffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); -- cgit v1.2.3 From 00d39102b469b459c5803fe1a20e52d8217add08 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Tue, 7 Sep 2021 19:53:00 -0400 Subject: update SettingsManager load active config from driver only when necessary ignore devices that aren't running the active profile (in mousewatcher) --- grapher/Models/AccelGUI.cs | 3 +- grapher/Models/Serialized/SettingsManager.cs | 97 +++++++++++++++++++++++----- 2 files changed, 82 insertions(+), 18 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index e4f924a..6ad57d9 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -139,8 +139,7 @@ namespace grapher { ButtonDelay(WriteButton); - var cfg = DriverConfig.FromProfile(MakeSettingsFromFields()); - if (!Settings.TryActivate(cfg, out string errors)) + if (!Settings.TryActivate(MakeSettingsFromFields(), out string errors)) { error_message = errors.ToString(); } diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs index d92f18a..3789c05 100644 --- a/grapher/Models/Serialized/SettingsManager.cs +++ b/grapher/Models/Serialized/SettingsManager.cs @@ -7,6 +7,7 @@ using System.Text; using System.Drawing; using grapher.Models.Devices; using System.Collections.Generic; +using System.Linq; namespace grapher.Models.Serialized { @@ -34,10 +35,6 @@ namespace grapher.Models.Serialized SystemDevices = new List(); ActiveHandles = new List(); - // TODO - remove ActiveConfig/AutoWrite entirely? - // shouldn't be needed with internal profiles support - ActiveConfig = DriverConfig.GetActive(); - GuiSettings = GUISettings.MaybeLoad(); if (GuiSettings is null) @@ -50,20 +47,39 @@ namespace grapher.Models.Serialized UpdateFieldsFromGUISettings(); } - UserConfig = InitUserSettings(); + UserConfig = InitActiveAndGetUserConfig(); } #endregion Constructors + #region Fields + + private DriverConfig ActiveConfigField; + + #endregion Fields + #region Properties public GUISettings GuiSettings { get; private set; } - public DriverConfig ActiveConfig { get; private set; } + public DriverConfig ActiveConfig + { + get => ActiveConfigField; + + private set + { + if (ActiveConfigField != value) + { + ActiveConfigField = value; + ActiveProfileNamesSet = new HashSet(value.profiles.Select(p => p.name)); + } + } + } public Profile ActiveProfile { - get => ActiveConfig.profiles[0]; + get => ActiveConfigField.profiles[0]; + private set => ActiveConfigField.SetProfileAt(0, value); } public ManagedAccel ActiveAccel @@ -78,13 +94,15 @@ namespace grapher.Models.Serialized get => UserConfig.profiles[0]; } + public HashSet ActiveProfileNamesSet { get; private set; } + public Field DpiField { get; private set; } public Field PollRateField { get; private set; } public IList SystemDevices { get; private set; } - public List ActiveHandles { get; private set; } + public List ActiveHandles { get; } private ToolStripMenuItem AutoWriteMenuItem { get; set; } @@ -113,6 +131,18 @@ namespace grapher.Models.Serialized AutoWriteMenuItem.Checked = GuiSettings.AutoWriteToDriverOnStartup; } + public bool TryActivate(Profile settings, out string errors) + { + var old = ActiveProfile; + ActiveProfile = settings; + bool success = TryActivate(ActiveConfig, out errors); + if (!success) + { + ActiveProfile = old; + } + return success; + } + public bool TryActivate(DriverConfig settings, out string errors) { errors = settings.Errors(); @@ -156,14 +186,38 @@ namespace grapher.Models.Serialized private void SetActiveHandles() { ActiveHandles.Clear(); - // TODO - foreach (var sysDev in SystemDevices) + + bool ActiveProfileIsFirst = ActiveProfile == ActiveConfig.profiles[0]; + + foreach (var dev in SystemDevices) MaybeAdd(dev); + + void MaybeAdd(MultiHandleDevice dev) { - ActiveHandles.AddRange(sysDev.handles); + foreach (var settings in ActiveConfig.devices) + { + if (settings.id == dev.id) + { + if (!settings.config.disable && + ((ActiveProfileIsFirst && + (string.IsNullOrEmpty(settings.profile) || + !ActiveProfileNamesSet.Contains(settings.profile))) || + ActiveProfile.name == settings.profile)) + { + ActiveHandles.AddRange(dev.handles); + } + + return; + } + } + + if (ActiveProfileIsFirst && !ActiveConfig.defaultDeviceConfig.disable) + { + ActiveHandles.AddRange(dev.handles); + } } } - private void OnProfileSwitch() + public void OnProfileSelectionChange() { SetActiveHandles(); } @@ -174,7 +228,7 @@ namespace grapher.Models.Serialized SetActiveHandles(); } - private DriverConfig InitUserSettings() + private DriverConfig InitActiveAndGetUserConfig() { var path = Constants.DefaultSettingsFileName; if (File.Exists(path)) @@ -183,12 +237,22 @@ namespace grapher.Models.Serialized { var (cfg, err) = DriverConfig.Convert(File.ReadAllText(path)); - if (!GuiSettings.AutoWriteToDriverOnStartup || - (err == null && TryActivate(cfg, out string _))) + if (err == null) { + if (GuiSettings.AutoWriteToDriverOnStartup) + { + if (!TryActivate(cfg, out string _)) + { + throw new Exception("deserialization succeeded but TryActivate failed"); + } + } + else + { + ActiveConfig = DriverConfig.GetActive(); + } + return cfg; } - } catch (JsonException e) { @@ -196,6 +260,7 @@ namespace grapher.Models.Serialized } } + ActiveConfig = DriverConfig.GetActive(); File.WriteAllText(path, ActiveConfig.ToJSON()); return ActiveConfig; } -- cgit v1.2.3 From 2b568ff5a9c64c549a6d15a19aab0ca4d3a22c11 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Fri, 10 Sep 2021 23:07:02 -0700 Subject: Add y\x ratio to gui --- grapher/Form1.Designer.cs | 276 ++++++++++++++++--------------- grapher/Form1.cs | 6 +- grapher/Models/AccelGUI.cs | 4 +- grapher/Models/Options/AccelOptionSet.cs | 2 +- grapher/Models/Options/ApplyOptions.cs | 15 +- grapher/Models/Options/CheckBoxOption.cs | 3 + grapher/Models/Options/LockableOption.cs | 89 ++++++++++ grapher/grapher.csproj | 1 + 8 files changed, 252 insertions(+), 144 deletions(-) create mode 100644 grapher/Models/Options/LockableOption.cs (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index f15bce9..376809f 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -175,14 +175,14 @@ namespace grapher this.AccelerationActiveLabelX = new System.Windows.Forms.Label(); this.AccelTypeActiveLabelX = new System.Windows.Forms.Label(); this.RotationActiveLabel = new System.Windows.Forms.Label(); - this.SensitivityActiveYLabel = new System.Windows.Forms.Label(); - this.SensitivityActiveXLabel = new System.Windows.Forms.Label(); + this.VertHorzRatioActiveLabel = new System.Windows.Forms.Label(); + this.SensitivityMultiplierActiveLabel = new System.Windows.Forms.Label(); this.ActiveValueTitle = new System.Windows.Forms.Label(); this.MouseLabel = new System.Windows.Forms.Label(); this.LockXYLabel = new System.Windows.Forms.Label(); this.sensXYLock = new System.Windows.Forms.CheckBox(); this.capBoxY = new System.Windows.Forms.TextBox(); - this.sensitivityBoxY = new System.Windows.Forms.TextBox(); + this.VertHorzRatioBox = new System.Windows.Forms.TextBox(); this.writeButton = new System.Windows.Forms.Button(); this.offsetLabelX = new System.Windows.Forms.Label(); this.offsetBoxX = new System.Windows.Forms.TextBox(); @@ -223,6 +223,7 @@ namespace grapher this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.VertHorzRatioLabel = new System.Windows.Forms.Label(); this.optionsPanel.SuspendLayout(); this.DirectionalityPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -238,6 +239,7 @@ namespace grapher // optionsPanel // this.optionsPanel.AutoSize = true; + this.optionsPanel.Controls.Add(this.VertHorzRatioLabel); this.optionsPanel.Controls.Add(this.SmoothActiveYLabel); this.optionsPanel.Controls.Add(this.smoothLabelY); this.optionsPanel.Controls.Add(this.SmoothActiveXLabel); @@ -323,14 +325,14 @@ namespace grapher this.optionsPanel.Controls.Add(this.AccelerationActiveLabelX); this.optionsPanel.Controls.Add(this.AccelTypeActiveLabelX); this.optionsPanel.Controls.Add(this.RotationActiveLabel); - this.optionsPanel.Controls.Add(this.SensitivityActiveYLabel); - this.optionsPanel.Controls.Add(this.SensitivityActiveXLabel); + this.optionsPanel.Controls.Add(this.VertHorzRatioActiveLabel); + this.optionsPanel.Controls.Add(this.SensitivityMultiplierActiveLabel); this.optionsPanel.Controls.Add(this.ActiveValueTitle); this.optionsPanel.Controls.Add(this.MouseLabel); this.optionsPanel.Controls.Add(this.LockXYLabel); this.optionsPanel.Controls.Add(this.sensXYLock); this.optionsPanel.Controls.Add(this.capBoxY); - this.optionsPanel.Controls.Add(this.sensitivityBoxY); + this.optionsPanel.Controls.Add(this.VertHorzRatioBox); this.optionsPanel.Controls.Add(this.writeButton); this.optionsPanel.Controls.Add(this.offsetLabelX); this.optionsPanel.Controls.Add(this.offsetBoxX); @@ -361,7 +363,7 @@ namespace grapher // SmoothActiveYLabel // this.SmoothActiveYLabel.AutoSize = true; - this.SmoothActiveYLabel.Location = new System.Drawing.Point(414, 677); + this.SmoothActiveYLabel.Location = new System.Drawing.Point(414, 704); this.SmoothActiveYLabel.Name = "SmoothActiveYLabel"; this.SmoothActiveYLabel.Size = new System.Drawing.Size(13, 13); this.SmoothActiveYLabel.TabIndex = 193; @@ -370,7 +372,7 @@ namespace grapher // smoothLabelY // this.smoothLabelY.AutoSize = true; - this.smoothLabelY.Location = new System.Drawing.Point(266, 677); + this.smoothLabelY.Location = new System.Drawing.Point(266, 704); this.smoothLabelY.Name = "smoothLabelY"; this.smoothLabelY.Size = new System.Drawing.Size(43, 13); this.smoothLabelY.TabIndex = 192; @@ -379,7 +381,7 @@ namespace grapher // SmoothActiveXLabel // this.SmoothActiveXLabel.AutoSize = true; - this.SmoothActiveXLabel.Location = new System.Drawing.Point(200, 677); + this.SmoothActiveXLabel.Location = new System.Drawing.Point(200, 704); this.SmoothActiveXLabel.Name = "SmoothActiveXLabel"; this.SmoothActiveXLabel.Size = new System.Drawing.Size(13, 13); this.SmoothActiveXLabel.TabIndex = 191; @@ -388,7 +390,7 @@ namespace grapher // smoothLabelX // this.smoothLabelX.AutoSize = true; - this.smoothLabelX.Location = new System.Drawing.Point(38, 677); + this.smoothLabelX.Location = new System.Drawing.Point(38, 704); this.smoothLabelX.Name = "smoothLabelX"; this.smoothLabelX.Size = new System.Drawing.Size(43, 13); this.smoothLabelX.TabIndex = 190; @@ -396,14 +398,14 @@ namespace grapher // // smoothBoxY // - this.smoothBoxY.Location = new System.Drawing.Point(332, 671); + this.smoothBoxY.Location = new System.Drawing.Point(332, 698); this.smoothBoxY.Name = "smoothBoxY"; this.smoothBoxY.Size = new System.Drawing.Size(76, 20); this.smoothBoxY.TabIndex = 189; // // smoothBoxX // - this.smoothBoxX.Location = new System.Drawing.Point(106, 672); + this.smoothBoxX.Location = new System.Drawing.Point(106, 699); this.smoothBoxX.Name = "smoothBoxX"; this.smoothBoxX.Size = new System.Drawing.Size(76, 20); this.smoothBoxX.TabIndex = 188; @@ -411,7 +413,7 @@ namespace grapher // GrowthRateActiveYLabel // this.GrowthRateActiveYLabel.AutoSize = true; - this.GrowthRateActiveYLabel.Location = new System.Drawing.Point(417, 647); + this.GrowthRateActiveYLabel.Location = new System.Drawing.Point(417, 674); this.GrowthRateActiveYLabel.Name = "GrowthRateActiveYLabel"; this.GrowthRateActiveYLabel.Size = new System.Drawing.Size(13, 13); this.GrowthRateActiveYLabel.TabIndex = 187; @@ -420,7 +422,7 @@ namespace grapher // GrowthRateActiveXLabel // this.GrowthRateActiveXLabel.AutoSize = true; - this.GrowthRateActiveXLabel.Location = new System.Drawing.Point(200, 647); + this.GrowthRateActiveXLabel.Location = new System.Drawing.Point(200, 674); this.GrowthRateActiveXLabel.Name = "GrowthRateActiveXLabel"; this.GrowthRateActiveXLabel.Size = new System.Drawing.Size(13, 13); this.GrowthRateActiveXLabel.TabIndex = 186; @@ -429,7 +431,7 @@ namespace grapher // DecayRateActiveYLabel // this.DecayRateActiveYLabel.AutoSize = true; - this.DecayRateActiveYLabel.Location = new System.Drawing.Point(417, 626); + this.DecayRateActiveYLabel.Location = new System.Drawing.Point(417, 653); this.DecayRateActiveYLabel.Name = "DecayRateActiveYLabel"; this.DecayRateActiveYLabel.Size = new System.Drawing.Size(13, 13); this.DecayRateActiveYLabel.TabIndex = 185; @@ -438,7 +440,7 @@ namespace grapher // DecayRateActiveXLabel // this.DecayRateActiveXLabel.AutoSize = true; - this.DecayRateActiveXLabel.Location = new System.Drawing.Point(200, 622); + this.DecayRateActiveXLabel.Location = new System.Drawing.Point(200, 649); this.DecayRateActiveXLabel.Name = "DecayRateActiveXLabel"; this.DecayRateActiveXLabel.Size = new System.Drawing.Size(13, 13); this.DecayRateActiveXLabel.TabIndex = 184; @@ -447,7 +449,7 @@ namespace grapher // growthRateLabelY // this.growthRateLabelY.AutoSize = true; - this.growthRateLabelY.Location = new System.Drawing.Point(263, 648); + this.growthRateLabelY.Location = new System.Drawing.Point(263, 675); this.growthRateLabelY.Name = "growthRateLabelY"; this.growthRateLabelY.Size = new System.Drawing.Size(67, 13); this.growthRateLabelY.TabIndex = 183; @@ -456,7 +458,7 @@ namespace grapher // growthRateLabelX // this.growthRateLabelX.AutoSize = true; - this.growthRateLabelX.Location = new System.Drawing.Point(37, 648); + this.growthRateLabelX.Location = new System.Drawing.Point(37, 675); this.growthRateLabelX.Name = "growthRateLabelX"; this.growthRateLabelX.Size = new System.Drawing.Size(67, 13); this.growthRateLabelX.TabIndex = 182; @@ -465,7 +467,7 @@ namespace grapher // decayRateLabelY // this.decayRateLabelY.AutoSize = true; - this.decayRateLabelY.Location = new System.Drawing.Point(262, 622); + this.decayRateLabelY.Location = new System.Drawing.Point(262, 649); this.decayRateLabelY.Name = "decayRateLabelY"; this.decayRateLabelY.Size = new System.Drawing.Size(64, 13); this.decayRateLabelY.TabIndex = 181; @@ -474,7 +476,7 @@ namespace grapher // decayRateLabelX // this.decayRateLabelX.AutoSize = true; - this.decayRateLabelX.Location = new System.Drawing.Point(37, 622); + this.decayRateLabelX.Location = new System.Drawing.Point(37, 649); this.decayRateLabelX.Name = "decayRateLabelX"; this.decayRateLabelX.Size = new System.Drawing.Size(64, 13); this.decayRateLabelX.TabIndex = 180; @@ -482,28 +484,28 @@ namespace grapher // // growthRateBoxY // - this.growthRateBoxY.Location = new System.Drawing.Point(332, 644); + this.growthRateBoxY.Location = new System.Drawing.Point(332, 671); this.growthRateBoxY.Name = "growthRateBoxY"; this.growthRateBoxY.Size = new System.Drawing.Size(76, 20); this.growthRateBoxY.TabIndex = 179; // // growthRateBoxX // - this.growthRateBoxX.Location = new System.Drawing.Point(106, 645); + this.growthRateBoxX.Location = new System.Drawing.Point(106, 672); this.growthRateBoxX.Name = "growthRateBoxX"; this.growthRateBoxX.Size = new System.Drawing.Size(76, 20); this.growthRateBoxX.TabIndex = 178; // // decayRateBoxY // - this.decayRateBoxY.Location = new System.Drawing.Point(332, 619); + this.decayRateBoxY.Location = new System.Drawing.Point(332, 646); this.decayRateBoxY.Name = "decayRateBoxY"; this.decayRateBoxY.Size = new System.Drawing.Size(76, 20); this.decayRateBoxY.TabIndex = 177; // // decayRateBoxX // - this.decayRateBoxX.Location = new System.Drawing.Point(106, 619); + this.decayRateBoxX.Location = new System.Drawing.Point(106, 646); this.decayRateBoxX.Name = "decayRateBoxX"; this.decayRateBoxX.Size = new System.Drawing.Size(76, 20); this.decayRateBoxX.TabIndex = 176; @@ -511,7 +513,7 @@ namespace grapher // PowerClassicActiveYLabel // this.PowerClassicActiveYLabel.AutoSize = true; - this.PowerClassicActiveYLabel.Location = new System.Drawing.Point(417, 599); + this.PowerClassicActiveYLabel.Location = new System.Drawing.Point(417, 626); this.PowerClassicActiveYLabel.Name = "PowerClassicActiveYLabel"; this.PowerClassicActiveYLabel.Size = new System.Drawing.Size(13, 13); this.PowerClassicActiveYLabel.TabIndex = 175; @@ -520,7 +522,7 @@ namespace grapher // PowerClassicActiveXLabel // this.PowerClassicActiveXLabel.AutoSize = true; - this.PowerClassicActiveXLabel.Location = new System.Drawing.Point(200, 599); + this.PowerClassicActiveXLabel.Location = new System.Drawing.Point(200, 626); this.PowerClassicActiveXLabel.Name = "PowerClassicActiveXLabel"; this.PowerClassicActiveXLabel.Size = new System.Drawing.Size(13, 13); this.PowerClassicActiveXLabel.TabIndex = 174; @@ -529,7 +531,7 @@ namespace grapher // powerLabelY // this.powerLabelY.AutoSize = true; - this.powerLabelY.Location = new System.Drawing.Point(263, 599); + this.powerLabelY.Location = new System.Drawing.Point(263, 626); this.powerLabelY.Name = "powerLabelY"; this.powerLabelY.Size = new System.Drawing.Size(37, 13); this.powerLabelY.TabIndex = 173; @@ -538,7 +540,7 @@ namespace grapher // powerLabelX // this.powerLabelX.AutoSize = true; - this.powerLabelX.Location = new System.Drawing.Point(35, 595); + this.powerLabelX.Location = new System.Drawing.Point(35, 622); this.powerLabelX.Name = "powerLabelX"; this.powerLabelX.Size = new System.Drawing.Size(37, 13); this.powerLabelX.TabIndex = 172; @@ -546,21 +548,21 @@ namespace grapher // // powerBoxY // - this.powerBoxY.Location = new System.Drawing.Point(332, 594); + this.powerBoxY.Location = new System.Drawing.Point(332, 621); this.powerBoxY.Name = "powerBoxY"; this.powerBoxY.Size = new System.Drawing.Size(76, 20); this.powerBoxY.TabIndex = 171; // // powerBoxX // - this.powerBoxX.Location = new System.Drawing.Point(106, 595); + this.powerBoxX.Location = new System.Drawing.Point(106, 622); this.powerBoxX.Name = "powerBoxX"; this.powerBoxX.Size = new System.Drawing.Size(76, 20); this.powerBoxX.TabIndex = 170; // // YLutActiveValuesBox // - this.YLutActiveValuesBox.Location = new System.Drawing.Point(397, 369); + this.YLutActiveValuesBox.Location = new System.Drawing.Point(397, 396); this.YLutActiveValuesBox.Name = "YLutActiveValuesBox"; this.YLutActiveValuesBox.Size = new System.Drawing.Size(73, 72); this.YLutActiveValuesBox.TabIndex = 169; @@ -568,7 +570,7 @@ namespace grapher // // XLutActiveValuesBox // - this.XLutActiveValuesBox.Location = new System.Drawing.Point(317, 369); + this.XLutActiveValuesBox.Location = new System.Drawing.Point(317, 396); this.XLutActiveValuesBox.Name = "XLutActiveValuesBox"; this.XLutActiveValuesBox.Size = new System.Drawing.Size(68, 72); this.XLutActiveValuesBox.TabIndex = 168; @@ -577,7 +579,7 @@ namespace grapher // LutApplyActiveYLabel // this.LutApplyActiveYLabel.AutoSize = true; - this.LutApplyActiveYLabel.Location = new System.Drawing.Point(417, 565); + this.LutApplyActiveYLabel.Location = new System.Drawing.Point(417, 592); this.LutApplyActiveYLabel.Name = "LutApplyActiveYLabel"; this.LutApplyActiveYLabel.Size = new System.Drawing.Size(35, 13); this.LutApplyActiveYLabel.TabIndex = 167; @@ -586,7 +588,7 @@ namespace grapher // YLutApplyDropdown // this.YLutApplyDropdown.FormattingEnabled = true; - this.YLutApplyDropdown.Location = new System.Drawing.Point(397, 527); + this.YLutApplyDropdown.Location = new System.Drawing.Point(397, 554); this.YLutApplyDropdown.Name = "YLutApplyDropdown"; this.YLutApplyDropdown.Size = new System.Drawing.Size(73, 21); this.YLutApplyDropdown.TabIndex = 166; @@ -594,7 +596,7 @@ namespace grapher // XLutApplyDropdown // this.XLutApplyDropdown.FormattingEnabled = true; - this.XLutApplyDropdown.Location = new System.Drawing.Point(320, 527); + this.XLutApplyDropdown.Location = new System.Drawing.Point(320, 554); this.XLutApplyDropdown.Name = "XLutApplyDropdown"; this.XLutApplyDropdown.Size = new System.Drawing.Size(65, 21); this.XLutApplyDropdown.TabIndex = 165; @@ -602,7 +604,7 @@ namespace grapher // LutApplyActiveXLabel // this.LutApplyActiveXLabel.AutoSize = true; - this.LutApplyActiveXLabel.Location = new System.Drawing.Point(200, 565); + this.LutApplyActiveXLabel.Location = new System.Drawing.Point(200, 592); this.LutApplyActiveXLabel.Name = "LutApplyActiveXLabel"; this.LutApplyActiveXLabel.Size = new System.Drawing.Size(35, 13); this.LutApplyActiveXLabel.TabIndex = 164; @@ -611,7 +613,7 @@ namespace grapher // YLutApplyLabel // this.YLutApplyLabel.AutoSize = true; - this.YLutApplyLabel.Location = new System.Drawing.Point(397, 510); + this.YLutApplyLabel.Location = new System.Drawing.Point(397, 537); this.YLutApplyLabel.Name = "YLutApplyLabel"; this.YLutApplyLabel.Size = new System.Drawing.Size(47, 13); this.YLutApplyLabel.TabIndex = 163; @@ -620,7 +622,7 @@ namespace grapher // XLutApplyLabel // this.XLutApplyLabel.AutoSize = true; - this.XLutApplyLabel.Location = new System.Drawing.Point(317, 511); + this.XLutApplyLabel.Location = new System.Drawing.Point(317, 538); this.XLutApplyLabel.Name = "XLutApplyLabel"; this.XLutApplyLabel.Size = new System.Drawing.Size(47, 13); this.XLutApplyLabel.TabIndex = 162; @@ -628,7 +630,7 @@ namespace grapher // // YLutPointsBox // - this.YLutPointsBox.Location = new System.Drawing.Point(397, 447); + this.YLutPointsBox.Location = new System.Drawing.Point(397, 474); this.YLutPointsBox.Name = "YLutPointsBox"; this.YLutPointsBox.Size = new System.Drawing.Size(73, 57); this.YLutPointsBox.TabIndex = 161; @@ -636,7 +638,7 @@ namespace grapher // // XLutPointsBox // - this.XLutPointsBox.Location = new System.Drawing.Point(317, 447); + this.XLutPointsBox.Location = new System.Drawing.Point(317, 474); this.XLutPointsBox.Name = "XLutPointsBox"; this.XLutPointsBox.Size = new System.Drawing.Size(68, 57); this.XLutPointsBox.TabIndex = 160; @@ -645,7 +647,7 @@ namespace grapher // gainSwitchActiveLabelY // this.gainSwitchActiveLabelY.AutoSize = true; - this.gainSwitchActiveLabelY.Location = new System.Drawing.Point(417, 95); + this.gainSwitchActiveLabelY.Location = new System.Drawing.Point(417, 122); this.gainSwitchActiveLabelY.Name = "gainSwitchActiveLabelY"; this.gainSwitchActiveLabelY.Size = new System.Drawing.Size(29, 13); this.gainSwitchActiveLabelY.TabIndex = 157; @@ -654,7 +656,7 @@ namespace grapher // gainSwitchActiveLabelX // this.gainSwitchActiveLabelX.AutoSize = true; - this.gainSwitchActiveLabelX.Location = new System.Drawing.Point(200, 96); + this.gainSwitchActiveLabelX.Location = new System.Drawing.Point(200, 123); this.gainSwitchActiveLabelX.Name = "gainSwitchActiveLabelX"; this.gainSwitchActiveLabelX.Size = new System.Drawing.Size(29, 13); this.gainSwitchActiveLabelX.TabIndex = 156; @@ -665,7 +667,7 @@ namespace grapher this.gainSwitchY.AutoSize = true; this.gainSwitchY.Checked = true; this.gainSwitchY.CheckState = System.Windows.Forms.CheckState.Checked; - this.gainSwitchY.Location = new System.Drawing.Point(283, 116); + this.gainSwitchY.Location = new System.Drawing.Point(283, 143); this.gainSwitchY.Name = "gainSwitchY"; this.gainSwitchY.Size = new System.Drawing.Size(48, 17); this.gainSwitchY.TabIndex = 155; @@ -677,7 +679,7 @@ namespace grapher this.gainSwitchX.AutoSize = true; this.gainSwitchX.Checked = true; this.gainSwitchX.CheckState = System.Windows.Forms.CheckState.Checked; - this.gainSwitchX.Location = new System.Drawing.Point(38, 116); + this.gainSwitchX.Location = new System.Drawing.Point(38, 143); this.gainSwitchX.Name = "gainSwitchX"; this.gainSwitchX.Size = new System.Drawing.Size(48, 17); this.gainSwitchX.TabIndex = 154; @@ -687,7 +689,7 @@ namespace grapher // LUTTextLabelY // this.LUTTextLabelY.AutoSize = true; - this.LUTTextLabelY.Location = new System.Drawing.Point(266, 350); + this.LUTTextLabelY.Location = new System.Drawing.Point(266, 377); this.LUTTextLabelY.Name = "LUTTextLabelY"; this.LUTTextLabelY.Size = new System.Drawing.Size(52, 13); this.LUTTextLabelY.TabIndex = 153; @@ -696,7 +698,7 @@ namespace grapher // LUTTextLabelX // this.LUTTextLabelX.AutoSize = true; - this.LUTTextLabelX.Location = new System.Drawing.Point(38, 350); + this.LUTTextLabelX.Location = new System.Drawing.Point(38, 377); this.LUTTextLabelX.Name = "LUTTextLabelX"; this.LUTTextLabelX.Size = new System.Drawing.Size(52, 13); this.LUTTextLabelX.TabIndex = 152; @@ -705,7 +707,7 @@ namespace grapher // FakeBox // this.FakeBox.AutoSize = true; - this.FakeBox.Location = new System.Drawing.Point(31, 538); + this.FakeBox.Location = new System.Drawing.Point(31, 565); this.FakeBox.Name = "FakeBox"; this.FakeBox.Size = new System.Drawing.Size(47, 17); this.FakeBox.TabIndex = 151; @@ -733,7 +735,7 @@ namespace grapher this.DirectionalityPanel.Controls.Add(this.DomainBoxY); this.DirectionalityPanel.Controls.Add(this.DomainBoxX); this.DirectionalityPanel.Controls.Add(this.DirectionalityLabel); - this.DirectionalityPanel.Location = new System.Drawing.Point(12, 369); + this.DirectionalityPanel.Location = new System.Drawing.Point(12, 396); this.DirectionalityPanel.Name = "DirectionalityPanel"; this.DirectionalityPanel.Size = new System.Drawing.Size(298, 135); this.DirectionalityPanel.TabIndex = 150; @@ -906,7 +908,7 @@ namespace grapher // // toggleButton // - this.toggleButton.Location = new System.Drawing.Point(211, 534); + this.toggleButton.Location = new System.Drawing.Point(211, 561); this.toggleButton.Name = "toggleButton"; this.toggleButton.Size = new System.Drawing.Size(104, 24); this.toggleButton.TabIndex = 112; @@ -916,7 +918,7 @@ namespace grapher // scaleLabelY // this.scaleLabelY.AutoSize = true; - this.scaleLabelY.Location = new System.Drawing.Point(263, 333); + this.scaleLabelY.Location = new System.Drawing.Point(263, 360); this.scaleLabelY.Name = "scaleLabelY"; this.scaleLabelY.Size = new System.Drawing.Size(34, 13); this.scaleLabelY.TabIndex = 149; @@ -925,7 +927,7 @@ namespace grapher // ScaleActiveYLabel // this.ScaleActiveYLabel.AutoSize = true; - this.ScaleActiveYLabel.Location = new System.Drawing.Point(414, 333); + this.ScaleActiveYLabel.Location = new System.Drawing.Point(414, 360); this.ScaleActiveYLabel.Name = "ScaleActiveYLabel"; this.ScaleActiveYLabel.Size = new System.Drawing.Size(13, 13); this.ScaleActiveYLabel.TabIndex = 148; @@ -933,7 +935,7 @@ namespace grapher // // scaleBoxY // - this.scaleBoxY.Location = new System.Drawing.Point(332, 330); + this.scaleBoxY.Location = new System.Drawing.Point(332, 357); this.scaleBoxY.Name = "scaleBoxY"; this.scaleBoxY.Size = new System.Drawing.Size(76, 20); this.scaleBoxY.TabIndex = 102; @@ -941,7 +943,7 @@ namespace grapher // ScaleActiveXLabel // this.ScaleActiveXLabel.AutoSize = true; - this.ScaleActiveXLabel.Location = new System.Drawing.Point(197, 333); + this.ScaleActiveXLabel.Location = new System.Drawing.Point(197, 360); this.ScaleActiveXLabel.Name = "ScaleActiveXLabel"; this.ScaleActiveXLabel.Size = new System.Drawing.Size(13, 13); this.ScaleActiveXLabel.TabIndex = 147; @@ -950,7 +952,7 @@ namespace grapher // scaleLabelX // this.scaleLabelX.AutoSize = true; - this.scaleLabelX.Location = new System.Drawing.Point(37, 333); + this.scaleLabelX.Location = new System.Drawing.Point(37, 360); this.scaleLabelX.Name = "scaleLabelX"; this.scaleLabelX.Size = new System.Drawing.Size(34, 13); this.scaleLabelX.TabIndex = 146; @@ -959,7 +961,7 @@ namespace grapher // // scaleBoxX // - this.scaleBoxX.Location = new System.Drawing.Point(106, 330); + this.scaleBoxX.Location = new System.Drawing.Point(106, 357); this.scaleBoxX.Name = "scaleBoxX"; this.scaleBoxX.Size = new System.Drawing.Size(76, 20); this.scaleBoxX.TabIndex = 88; @@ -967,7 +969,7 @@ namespace grapher // expLabelY // this.expLabelY.AutoSize = true; - this.expLabelY.Location = new System.Drawing.Point(263, 276); + this.expLabelY.Location = new System.Drawing.Point(263, 303); this.expLabelY.Name = "expLabelY"; this.expLabelY.Size = new System.Drawing.Size(52, 13); this.expLabelY.TabIndex = 145; @@ -976,7 +978,7 @@ namespace grapher // ExpActiveYLabel // this.ExpActiveYLabel.AutoSize = true; - this.ExpActiveYLabel.Location = new System.Drawing.Point(414, 276); + this.ExpActiveYLabel.Location = new System.Drawing.Point(414, 303); this.ExpActiveYLabel.Name = "ExpActiveYLabel"; this.ExpActiveYLabel.Size = new System.Drawing.Size(13, 13); this.ExpActiveYLabel.TabIndex = 144; @@ -984,7 +986,7 @@ namespace grapher // // expBoxY // - this.expBoxY.Location = new System.Drawing.Point(332, 273); + this.expBoxY.Location = new System.Drawing.Point(332, 300); this.expBoxY.Name = "expBoxY"; this.expBoxY.Size = new System.Drawing.Size(76, 20); this.expBoxY.TabIndex = 109; @@ -992,7 +994,7 @@ namespace grapher // ExpActiveXLabel // this.ExpActiveXLabel.AutoSize = true; - this.ExpActiveXLabel.Location = new System.Drawing.Point(197, 276); + this.ExpActiveXLabel.Location = new System.Drawing.Point(197, 303); this.ExpActiveXLabel.Name = "ExpActiveXLabel"; this.ExpActiveXLabel.Size = new System.Drawing.Size(13, 13); this.ExpActiveXLabel.TabIndex = 143; @@ -1001,7 +1003,7 @@ namespace grapher // expLabelX // this.expLabelX.AutoSize = true; - this.expLabelX.Location = new System.Drawing.Point(37, 276); + this.expLabelX.Location = new System.Drawing.Point(37, 303); this.expLabelX.Name = "expLabelX"; this.expLabelX.Size = new System.Drawing.Size(52, 13); this.expLabelX.TabIndex = 142; @@ -1010,7 +1012,7 @@ namespace grapher // // expBoxX // - this.expBoxX.Location = new System.Drawing.Point(106, 273); + this.expBoxX.Location = new System.Drawing.Point(106, 300); this.expBoxX.Name = "expBoxX"; this.expBoxX.Size = new System.Drawing.Size(76, 20); this.expBoxX.TabIndex = 95; @@ -1027,7 +1029,7 @@ namespace grapher // AccelTypeActiveLabelY // this.AccelTypeActiveLabelY.AutoSize = true; - this.AccelTypeActiveLabelY.Location = new System.Drawing.Point(414, 116); + this.AccelTypeActiveLabelY.Location = new System.Drawing.Point(414, 143); this.AccelTypeActiveLabelY.Name = "AccelTypeActiveLabelY"; this.AccelTypeActiveLabelY.Size = new System.Drawing.Size(66, 13); this.AccelTypeActiveLabelY.TabIndex = 140; @@ -1036,7 +1038,7 @@ namespace grapher // OptionSetYTitle // this.OptionSetYTitle.AutoSize = true; - this.OptionSetYTitle.Location = new System.Drawing.Point(360, 97); + this.OptionSetYTitle.Location = new System.Drawing.Point(360, 124); this.OptionSetYTitle.Name = "OptionSetYTitle"; this.OptionSetYTitle.Size = new System.Drawing.Size(14, 13); this.OptionSetYTitle.TabIndex = 139; @@ -1045,7 +1047,7 @@ namespace grapher // OptionSetXTitle // this.OptionSetXTitle.AutoSize = true; - this.OptionSetXTitle.Location = new System.Drawing.Point(143, 97); + this.OptionSetXTitle.Location = new System.Drawing.Point(143, 124); this.OptionSetXTitle.Name = "OptionSetXTitle"; this.OptionSetXTitle.Size = new System.Drawing.Size(14, 13); this.OptionSetXTitle.TabIndex = 138; @@ -1054,7 +1056,7 @@ namespace grapher // constantThreeLabelY // this.constantThreeLabelY.AutoSize = true; - this.constantThreeLabelY.Location = new System.Drawing.Point(263, 303); + this.constantThreeLabelY.Location = new System.Drawing.Point(263, 330); this.constantThreeLabelY.Name = "constantThreeLabelY"; this.constantThreeLabelY.Size = new System.Drawing.Size(47, 13); this.constantThreeLabelY.TabIndex = 137; @@ -1063,7 +1065,7 @@ namespace grapher // limitLabelY // this.limitLabelY.AutoSize = true; - this.limitLabelY.Location = new System.Drawing.Point(263, 247); + this.limitLabelY.Location = new System.Drawing.Point(263, 274); this.limitLabelY.Name = "limitLabelY"; this.limitLabelY.Size = new System.Drawing.Size(28, 13); this.limitLabelY.TabIndex = 136; @@ -1072,7 +1074,7 @@ namespace grapher // offsetLabelY // this.offsetLabelY.AutoSize = true; - this.offsetLabelY.Location = new System.Drawing.Point(263, 221); + this.offsetLabelY.Location = new System.Drawing.Point(263, 248); this.offsetLabelY.Name = "offsetLabelY"; this.offsetLabelY.Size = new System.Drawing.Size(35, 13); this.offsetLabelY.TabIndex = 135; @@ -1081,7 +1083,7 @@ namespace grapher // weightLabelY // this.weightLabelY.AutoSize = true; - this.weightLabelY.Location = new System.Drawing.Point(263, 195); + this.weightLabelY.Location = new System.Drawing.Point(263, 222); this.weightLabelY.Name = "weightLabelY"; this.weightLabelY.Size = new System.Drawing.Size(41, 13); this.weightLabelY.TabIndex = 134; @@ -1090,7 +1092,7 @@ namespace grapher // capLabelY // this.capLabelY.AutoSize = true; - this.capLabelY.Location = new System.Drawing.Point(263, 169); + this.capLabelY.Location = new System.Drawing.Point(263, 196); this.capLabelY.Name = "capLabelY"; this.capLabelY.Size = new System.Drawing.Size(26, 13); this.capLabelY.TabIndex = 133; @@ -1099,7 +1101,7 @@ namespace grapher // constantOneLabelY // this.constantOneLabelY.AutoSize = true; - this.constantOneLabelY.Location = new System.Drawing.Point(263, 143); + this.constantOneLabelY.Location = new System.Drawing.Point(263, 170); this.constantOneLabelY.Name = "constantOneLabelY"; this.constantOneLabelY.Size = new System.Drawing.Size(66, 13); this.constantOneLabelY.TabIndex = 132; @@ -1110,7 +1112,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(283, 96); + this.ByComponentXYLock.Location = new System.Drawing.Point(283, 123); this.ByComponentXYLock.Name = "ByComponentXYLock"; this.ByComponentXYLock.Size = new System.Drawing.Size(15, 14); this.ByComponentXYLock.TabIndex = 98; @@ -1119,7 +1121,7 @@ namespace grapher // MidpointActiveYLabel // this.MidpointActiveYLabel.AutoSize = true; - this.MidpointActiveYLabel.Location = new System.Drawing.Point(414, 303); + this.MidpointActiveYLabel.Location = new System.Drawing.Point(414, 330); this.MidpointActiveYLabel.Name = "MidpointActiveYLabel"; this.MidpointActiveYLabel.Size = new System.Drawing.Size(13, 13); this.MidpointActiveYLabel.TabIndex = 131; @@ -1128,7 +1130,7 @@ namespace grapher // LimitActiveYLabel // this.LimitActiveYLabel.AutoSize = true; - this.LimitActiveYLabel.Location = new System.Drawing.Point(414, 247); + this.LimitActiveYLabel.Location = new System.Drawing.Point(414, 274); this.LimitActiveYLabel.Name = "LimitActiveYLabel"; this.LimitActiveYLabel.Size = new System.Drawing.Size(13, 13); this.LimitActiveYLabel.TabIndex = 130; @@ -1137,7 +1139,7 @@ namespace grapher // OffsetActiveYLabel // this.OffsetActiveYLabel.AutoSize = true; - this.OffsetActiveYLabel.Location = new System.Drawing.Point(414, 221); + this.OffsetActiveYLabel.Location = new System.Drawing.Point(414, 248); this.OffsetActiveYLabel.Name = "OffsetActiveYLabel"; this.OffsetActiveYLabel.Size = new System.Drawing.Size(13, 13); this.OffsetActiveYLabel.TabIndex = 129; @@ -1146,7 +1148,7 @@ namespace grapher // AccelerationActiveLabelY // this.AccelerationActiveLabelY.AutoSize = true; - this.AccelerationActiveLabelY.Location = new System.Drawing.Point(414, 143); + this.AccelerationActiveLabelY.Location = new System.Drawing.Point(414, 170); this.AccelerationActiveLabelY.Name = "AccelerationActiveLabelY"; this.AccelerationActiveLabelY.Size = new System.Drawing.Size(13, 13); this.AccelerationActiveLabelY.TabIndex = 128; @@ -1155,7 +1157,7 @@ namespace grapher // accelTypeDropY // this.accelTypeDropY.FormattingEnabled = true; - this.accelTypeDropY.Location = new System.Drawing.Point(332, 113); + this.accelTypeDropY.Location = new System.Drawing.Point(332, 140); this.accelTypeDropY.Name = "accelTypeDropY"; this.accelTypeDropY.Size = new System.Drawing.Size(76, 21); this.accelTypeDropY.TabIndex = 99; @@ -1163,28 +1165,28 @@ namespace grapher // // midpointBoxY // - this.midpointBoxY.Location = new System.Drawing.Point(332, 300); + this.midpointBoxY.Location = new System.Drawing.Point(332, 327); this.midpointBoxY.Name = "midpointBoxY"; this.midpointBoxY.Size = new System.Drawing.Size(76, 20); this.midpointBoxY.TabIndex = 110; // // limitBoxY // - this.limitBoxY.Location = new System.Drawing.Point(332, 244); + this.limitBoxY.Location = new System.Drawing.Point(332, 271); this.limitBoxY.Name = "limitBoxY"; this.limitBoxY.Size = new System.Drawing.Size(76, 20); this.limitBoxY.TabIndex = 108; // // offsetBoxY // - this.offsetBoxY.Location = new System.Drawing.Point(332, 218); + this.offsetBoxY.Location = new System.Drawing.Point(332, 245); this.offsetBoxY.Name = "offsetBoxY"; this.offsetBoxY.Size = new System.Drawing.Size(76, 20); this.offsetBoxY.TabIndex = 106; // // accelerationBoxY // - this.accelerationBoxY.Location = new System.Drawing.Point(332, 140); + this.accelerationBoxY.Location = new System.Drawing.Point(332, 167); this.accelerationBoxY.Name = "accelerationBoxY"; this.accelerationBoxY.Size = new System.Drawing.Size(76, 20); this.accelerationBoxY.TabIndex = 100; @@ -1192,7 +1194,7 @@ namespace grapher // MidpointActiveXLabel // this.MidpointActiveXLabel.AutoSize = true; - this.MidpointActiveXLabel.Location = new System.Drawing.Point(197, 303); + this.MidpointActiveXLabel.Location = new System.Drawing.Point(197, 330); this.MidpointActiveXLabel.Name = "MidpointActiveXLabel"; this.MidpointActiveXLabel.Size = new System.Drawing.Size(13, 13); this.MidpointActiveXLabel.TabIndex = 127; @@ -1201,7 +1203,7 @@ namespace grapher // LimitActiveXLabel // this.LimitActiveXLabel.AutoSize = true; - this.LimitActiveXLabel.Location = new System.Drawing.Point(197, 247); + this.LimitActiveXLabel.Location = new System.Drawing.Point(197, 274); this.LimitActiveXLabel.Name = "LimitActiveXLabel"; this.LimitActiveXLabel.Size = new System.Drawing.Size(13, 13); this.LimitActiveXLabel.TabIndex = 126; @@ -1210,7 +1212,7 @@ namespace grapher // OffsetActiveXLabel // this.OffsetActiveXLabel.AutoSize = true; - this.OffsetActiveXLabel.Location = new System.Drawing.Point(197, 221); + this.OffsetActiveXLabel.Location = new System.Drawing.Point(197, 248); this.OffsetActiveXLabel.Name = "OffsetActiveXLabel"; this.OffsetActiveXLabel.Size = new System.Drawing.Size(13, 13); this.OffsetActiveXLabel.TabIndex = 125; @@ -1219,7 +1221,7 @@ namespace grapher // CapActiveYLabel // this.CapActiveYLabel.AutoSize = true; - this.CapActiveYLabel.Location = new System.Drawing.Point(414, 169); + this.CapActiveYLabel.Location = new System.Drawing.Point(414, 196); this.CapActiveYLabel.Name = "CapActiveYLabel"; this.CapActiveYLabel.Size = new System.Drawing.Size(13, 13); this.CapActiveYLabel.TabIndex = 124; @@ -1228,7 +1230,7 @@ namespace grapher // WeightActiveYLabel // this.WeightActiveYLabel.AutoSize = true; - this.WeightActiveYLabel.Location = new System.Drawing.Point(414, 195); + this.WeightActiveYLabel.Location = new System.Drawing.Point(414, 222); this.WeightActiveYLabel.Name = "WeightActiveYLabel"; this.WeightActiveYLabel.Size = new System.Drawing.Size(13, 13); this.WeightActiveYLabel.TabIndex = 123; @@ -1237,7 +1239,7 @@ namespace grapher // WeightActiveXLabel // this.WeightActiveXLabel.AutoSize = true; - this.WeightActiveXLabel.Location = new System.Drawing.Point(197, 195); + this.WeightActiveXLabel.Location = new System.Drawing.Point(197, 222); this.WeightActiveXLabel.Name = "WeightActiveXLabel"; this.WeightActiveXLabel.Size = new System.Drawing.Size(13, 13); this.WeightActiveXLabel.TabIndex = 122; @@ -1246,7 +1248,7 @@ namespace grapher // CapActiveXLabel // this.CapActiveXLabel.AutoSize = true; - this.CapActiveXLabel.Location = new System.Drawing.Point(197, 169); + this.CapActiveXLabel.Location = new System.Drawing.Point(197, 196); this.CapActiveXLabel.Name = "CapActiveXLabel"; this.CapActiveXLabel.Size = new System.Drawing.Size(13, 13); this.CapActiveXLabel.TabIndex = 121; @@ -1255,7 +1257,7 @@ namespace grapher // AccelerationActiveLabelX // this.AccelerationActiveLabelX.AutoSize = true; - this.AccelerationActiveLabelX.Location = new System.Drawing.Point(197, 143); + this.AccelerationActiveLabelX.Location = new System.Drawing.Point(197, 170); this.AccelerationActiveLabelX.Name = "AccelerationActiveLabelX"; this.AccelerationActiveLabelX.Size = new System.Drawing.Size(13, 13); this.AccelerationActiveLabelX.TabIndex = 120; @@ -1264,7 +1266,7 @@ namespace grapher // AccelTypeActiveLabelX // this.AccelTypeActiveLabelX.AutoSize = true; - this.AccelTypeActiveLabelX.Location = new System.Drawing.Point(197, 116); + this.AccelTypeActiveLabelX.Location = new System.Drawing.Point(197, 143); this.AccelTypeActiveLabelX.Name = "AccelTypeActiveLabelX"; this.AccelTypeActiveLabelX.Size = new System.Drawing.Size(66, 13); this.AccelTypeActiveLabelX.TabIndex = 119; @@ -1273,29 +1275,29 @@ namespace grapher // RotationActiveLabel // this.RotationActiveLabel.AutoSize = true; - this.RotationActiveLabel.Location = new System.Drawing.Point(197, 78); + this.RotationActiveLabel.Location = new System.Drawing.Point(197, 105); this.RotationActiveLabel.Name = "RotationActiveLabel"; this.RotationActiveLabel.Size = new System.Drawing.Size(13, 13); this.RotationActiveLabel.TabIndex = 118; this.RotationActiveLabel.Text = "0"; // - // SensitivityActiveYLabel + // VertHorzRatioActiveLabel // - this.SensitivityActiveYLabel.AutoSize = true; - this.SensitivityActiveYLabel.Location = new System.Drawing.Point(217, 52); - this.SensitivityActiveYLabel.Name = "SensitivityActiveYLabel"; - this.SensitivityActiveYLabel.Size = new System.Drawing.Size(14, 13); - this.SensitivityActiveYLabel.TabIndex = 117; - this.SensitivityActiveYLabel.Text = "Y"; + this.VertHorzRatioActiveLabel.AutoSize = true; + this.VertHorzRatioActiveLabel.Location = new System.Drawing.Point(196, 76); + this.VertHorzRatioActiveLabel.Name = "VertHorzRatioActiveLabel"; + this.VertHorzRatioActiveLabel.Size = new System.Drawing.Size(13, 13); + this.VertHorzRatioActiveLabel.TabIndex = 117; + this.VertHorzRatioActiveLabel.Text = "0"; // - // SensitivityActiveXLabel + // SensitivityMultiplierActiveLabel // - this.SensitivityActiveXLabel.AutoSize = true; - this.SensitivityActiveXLabel.Location = new System.Drawing.Point(188, 52); - this.SensitivityActiveXLabel.Name = "SensitivityActiveXLabel"; - this.SensitivityActiveXLabel.Size = new System.Drawing.Size(14, 13); - this.SensitivityActiveXLabel.TabIndex = 116; - this.SensitivityActiveXLabel.Text = "X"; + this.SensitivityMultiplierActiveLabel.AutoSize = true; + this.SensitivityMultiplierActiveLabel.Location = new System.Drawing.Point(195, 52); + this.SensitivityMultiplierActiveLabel.Name = "SensitivityMultiplierActiveLabel"; + this.SensitivityMultiplierActiveLabel.Size = new System.Drawing.Size(13, 13); + this.SensitivityMultiplierActiveLabel.TabIndex = 116; + this.SensitivityMultiplierActiveLabel.Text = "0"; // // ActiveValueTitle // @@ -1329,7 +1331,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(283, 49); + this.sensXYLock.Location = new System.Drawing.Point(282, 75); this.sensXYLock.Name = "sensXYLock"; this.sensXYLock.Size = new System.Drawing.Size(15, 14); this.sensXYLock.TabIndex = 82; @@ -1337,22 +1339,22 @@ namespace grapher // // capBoxY // - this.capBoxY.Location = new System.Drawing.Point(332, 166); + this.capBoxY.Location = new System.Drawing.Point(332, 193); this.capBoxY.Name = "capBoxY"; this.capBoxY.Size = new System.Drawing.Size(76, 20); this.capBoxY.TabIndex = 103; // - // sensitivityBoxY + // VertHorzRatioBox // - this.sensitivityBoxY.Location = new System.Drawing.Point(148, 49); - this.sensitivityBoxY.Name = "sensitivityBoxY"; - this.sensitivityBoxY.Size = new System.Drawing.Size(34, 20); - this.sensitivityBoxY.TabIndex = 81; + this.VertHorzRatioBox.Location = new System.Drawing.Point(106, 76); + this.VertHorzRatioBox.Name = "VertHorzRatioBox"; + this.VertHorzRatioBox.Size = new System.Drawing.Size(76, 20); + this.VertHorzRatioBox.TabIndex = 81; // // writeButton // this.writeButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); - this.writeButton.Location = new System.Drawing.Point(90, 527); + this.writeButton.Location = new System.Drawing.Point(90, 554); this.writeButton.Name = "writeButton"; this.writeButton.Size = new System.Drawing.Size(92, 35); this.writeButton.TabIndex = 111; @@ -1362,7 +1364,7 @@ namespace grapher // offsetLabelX // this.offsetLabelX.AutoSize = true; - this.offsetLabelX.Location = new System.Drawing.Point(37, 221); + this.offsetLabelX.Location = new System.Drawing.Point(37, 248); this.offsetLabelX.Name = "offsetLabelX"; this.offsetLabelX.Size = new System.Drawing.Size(35, 13); this.offsetLabelX.TabIndex = 107; @@ -1371,7 +1373,7 @@ namespace grapher // // offsetBoxX // - this.offsetBoxX.Location = new System.Drawing.Point(106, 218); + this.offsetBoxX.Location = new System.Drawing.Point(106, 245); this.offsetBoxX.Name = "offsetBoxX"; this.offsetBoxX.Size = new System.Drawing.Size(76, 20); this.offsetBoxX.TabIndex = 92; @@ -1379,7 +1381,7 @@ namespace grapher // constantThreeLabelX // this.constantThreeLabelX.AutoSize = true; - this.constantThreeLabelX.Location = new System.Drawing.Point(37, 303); + this.constantThreeLabelX.Location = new System.Drawing.Point(37, 330); this.constantThreeLabelX.Name = "constantThreeLabelX"; this.constantThreeLabelX.Size = new System.Drawing.Size(47, 13); this.constantThreeLabelX.TabIndex = 105; @@ -1388,7 +1390,7 @@ namespace grapher // // midpointBoxX // - this.midpointBoxX.Location = new System.Drawing.Point(106, 300); + this.midpointBoxX.Location = new System.Drawing.Point(106, 327); this.midpointBoxX.Name = "midpointBoxX"; this.midpointBoxX.Size = new System.Drawing.Size(76, 20); this.midpointBoxX.TabIndex = 96; @@ -1396,7 +1398,7 @@ namespace grapher // limitLabelX // this.limitLabelX.AutoSize = true; - this.limitLabelX.Location = new System.Drawing.Point(37, 247); + this.limitLabelX.Location = new System.Drawing.Point(37, 274); this.limitLabelX.Name = "limitLabelX"; this.limitLabelX.Size = new System.Drawing.Size(28, 13); this.limitLabelX.TabIndex = 101; @@ -1405,14 +1407,14 @@ namespace grapher // // limitBoxX // - this.limitBoxX.Location = new System.Drawing.Point(106, 244); + this.limitBoxX.Location = new System.Drawing.Point(106, 271); this.limitBoxX.Name = "limitBoxX"; this.limitBoxX.Size = new System.Drawing.Size(76, 20); this.limitBoxX.TabIndex = 93; // // weightBoxY // - this.weightBoxY.Location = new System.Drawing.Point(332, 192); + this.weightBoxY.Location = new System.Drawing.Point(332, 219); this.weightBoxY.Name = "weightBoxY"; this.weightBoxY.Size = new System.Drawing.Size(76, 20); this.weightBoxY.TabIndex = 104; @@ -1420,7 +1422,7 @@ namespace grapher // weightLabelX // this.weightLabelX.AutoSize = true; - this.weightLabelX.Location = new System.Drawing.Point(37, 195); + this.weightLabelX.Location = new System.Drawing.Point(37, 222); this.weightLabelX.Name = "weightLabelX"; this.weightLabelX.Size = new System.Drawing.Size(41, 13); this.weightLabelX.TabIndex = 97; @@ -1429,7 +1431,7 @@ namespace grapher // // weightBoxX // - this.weightBoxX.Location = new System.Drawing.Point(106, 192); + this.weightBoxX.Location = new System.Drawing.Point(106, 219); this.weightBoxX.Name = "weightBoxX"; this.weightBoxX.Size = new System.Drawing.Size(76, 20); this.weightBoxX.TabIndex = 90; @@ -1437,7 +1439,7 @@ namespace grapher // capLabelX // this.capLabelX.AutoSize = true; - this.capLabelX.Location = new System.Drawing.Point(37, 169); + this.capLabelX.Location = new System.Drawing.Point(37, 196); this.capLabelX.Name = "capLabelX"; this.capLabelX.Size = new System.Drawing.Size(26, 13); this.capLabelX.TabIndex = 94; @@ -1446,7 +1448,7 @@ namespace grapher // // capBoxX // - this.capBoxX.Location = new System.Drawing.Point(106, 166); + this.capBoxX.Location = new System.Drawing.Point(106, 193); this.capBoxX.Name = "capBoxX"; this.capBoxX.Size = new System.Drawing.Size(76, 20); this.capBoxX.TabIndex = 89; @@ -1454,7 +1456,7 @@ namespace grapher // constantOneLabelX // this.constantOneLabelX.AutoSize = true; - this.constantOneLabelX.Location = new System.Drawing.Point(37, 143); + this.constantOneLabelX.Location = new System.Drawing.Point(37, 170); this.constantOneLabelX.Name = "constantOneLabelX"; this.constantOneLabelX.Size = new System.Drawing.Size(66, 13); this.constantOneLabelX.TabIndex = 91; @@ -1463,7 +1465,7 @@ namespace grapher // // accelerationBoxX // - this.accelerationBoxX.Location = new System.Drawing.Point(106, 140); + this.accelerationBoxX.Location = new System.Drawing.Point(106, 167); this.accelerationBoxX.Name = "accelerationBoxX"; this.accelerationBoxX.Size = new System.Drawing.Size(76, 20); this.accelerationBoxX.TabIndex = 86; @@ -1471,7 +1473,7 @@ namespace grapher // rotationLabel // this.rotationLabel.AutoSize = true; - this.rotationLabel.Location = new System.Drawing.Point(35, 78); + this.rotationLabel.Location = new System.Drawing.Point(35, 105); this.rotationLabel.Name = "rotationLabel"; this.rotationLabel.Size = new System.Drawing.Size(47, 13); this.rotationLabel.TabIndex = 87; @@ -1479,7 +1481,7 @@ namespace grapher // // rotationBox // - this.rotationBox.Location = new System.Drawing.Point(106, 75); + this.rotationBox.Location = new System.Drawing.Point(106, 102); this.rotationBox.Name = "rotationBox"; this.rotationBox.Size = new System.Drawing.Size(76, 20); this.rotationBox.TabIndex = 83; @@ -1497,13 +1499,13 @@ namespace grapher // this.sensitivityBoxX.Location = new System.Drawing.Point(106, 49); this.sensitivityBoxX.Name = "sensitivityBoxX"; - this.sensitivityBoxX.Size = new System.Drawing.Size(34, 20); + this.sensitivityBoxX.Size = new System.Drawing.Size(76, 20); this.sensitivityBoxX.TabIndex = 80; // // accelTypeDropX // this.accelTypeDropX.FormattingEnabled = true; - this.accelTypeDropX.Location = new System.Drawing.Point(106, 113); + this.accelTypeDropX.Location = new System.Drawing.Point(106, 140); this.accelTypeDropX.Name = "accelTypeDropX"; this.accelTypeDropX.Size = new System.Drawing.Size(76, 21); this.accelTypeDropX.TabIndex = 84; @@ -1876,6 +1878,15 @@ namespace grapher title6.Text = "Sensitivity"; this.AccelerationChart.Titles.Add(title6); // + // VertHorzRatioLabel + // + this.VertHorzRatioLabel.AutoSize = true; + this.VertHorzRatioLabel.Location = new System.Drawing.Point(28, 79); + this.VertHorzRatioLabel.Name = "VertHorzRatioLabel"; + this.VertHorzRatioLabel.Size = new System.Drawing.Size(59, 13); + this.VertHorzRatioLabel.TabIndex = 194; + this.VertHorzRatioLabel.Text = "Y to X ratio"; + // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1949,14 +1960,14 @@ namespace grapher private System.Windows.Forms.Label AccelerationActiveLabelX; private System.Windows.Forms.Label AccelTypeActiveLabelX; private System.Windows.Forms.Label RotationActiveLabel; - private System.Windows.Forms.Label SensitivityActiveYLabel; - private System.Windows.Forms.Label SensitivityActiveXLabel; + private System.Windows.Forms.Label VertHorzRatioActiveLabel; + private System.Windows.Forms.Label SensitivityMultiplierActiveLabel; private System.Windows.Forms.Label ActiveValueTitle; private System.Windows.Forms.Label MouseLabel; private System.Windows.Forms.Label LockXYLabel; private System.Windows.Forms.CheckBox sensXYLock; private System.Windows.Forms.TextBox capBoxY; - private System.Windows.Forms.TextBox sensitivityBoxY; + private System.Windows.Forms.TextBox VertHorzRatioBox; private System.Windows.Forms.Button writeButton; private System.Windows.Forms.Label offsetLabelX; private System.Windows.Forms.TextBox offsetBoxX; @@ -2058,6 +2069,7 @@ namespace grapher private System.Windows.Forms.Label smoothLabelX; private System.Windows.Forms.TextBox smoothBoxY; private System.Windows.Forms.TextBox smoothBoxX; + private System.Windows.Forms.Label VertHorzRatioLabel; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index c492a9b..91bc980 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -62,7 +62,7 @@ namespace grapher PollRateTextBox, DirectionalityPanel, sensitivityBoxX, - sensitivityBoxY, + VertHorzRatioBox, rotationBox, weightBoxX, weightBoxY, @@ -135,8 +135,8 @@ namespace grapher constantThreeLabelY, ActiveValueTitle, ActiveValueTitleY, - SensitivityActiveXLabel, - SensitivityActiveYLabel, + SensitivityMultiplierActiveLabel, + VertHorzRatioActiveLabel, RotationActiveLabel, WeightActiveXLabel, WeightActiveYLabel, diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 6ad57d9..801fd8d 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -113,12 +113,12 @@ namespace grapher var settings = new Profile(); settings.rotation = ApplyOptions.Rotation.Field.Data; - settings.sensitivity = ApplyOptions.Sensitivity.Fields.X; + settings.sensitivity = ApplyOptions.Sensitivity.Field.Data; // TODO - separate sensitivity fields, add new label for ratio settings.yxSensRatio = ApplyOptions.Sensitivity.Fields.Y; settings.combineMagnitudes = ApplyOptions.IsWhole; - ApplyOptions.SetArgs(ref settings.argsX, ref settings.argsY); + ApplyOptions.SetArgsFromActiveValues(ref settings.argsX, ref settings.argsY); var (domWeights, lpNorm) = ApplyOptions.Directionality.GetDomainArgs(); settings.domainXY = domWeights; diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index 75eb017..3451402 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -99,7 +99,7 @@ namespace grapher.Models.Options Options.Top = TopAnchor; } - public void SetArgs(ref AccelArgs args) + public void SetArgsFromActiveValues(ref AccelArgs args) { Options.SetArgs(ref args); } diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 0d87943..5c3494c 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -65,7 +65,9 @@ namespace grapher.Models.Options public DirectionalityOptions Directionality { get; } - public OptionXY Sensitivity { get; } + public Option Sensitivity { get; } + + public Option YToXRatio { get; } public Option Rotation { get; } @@ -81,23 +83,24 @@ namespace grapher.Models.Options #region Methods - public void SetArgs(ref AccelArgs argsX, ref AccelArgs argsY) + public void SetArgsFromActiveValues(ref AccelArgs argsX, ref AccelArgs argsY) { - OptionSetX.SetArgs(ref argsX); + OptionSetX.SetArgsFromActiveValues(ref argsX); if (ByComponentVectorXYLock.Checked) { - OptionSetX.SetArgs(ref argsY); + OptionSetX.SetArgsFromActiveValues(ref argsY); } else { - OptionSetY.SetArgs(ref argsY); + OptionSetY.SetArgsFromActiveValues(ref argsY); } } public void SetActiveValues(Profile settings) { - Sensitivity.SetActiveValues(settings.sensitivity, settings.yxSensRatio); + Sensitivity.SetActiveValue(settings.sensitivity); + YToXRatio.SetActiveValue(settings.yxSensRatio); Rotation.SetActiveValue(settings.rotation); WholeVectorCheckBox.Checked = settings.combineMagnitudes; diff --git a/grapher/Models/Options/CheckBoxOption.cs b/grapher/Models/Options/CheckBoxOption.cs index abf96d3..1a4245d 100644 --- a/grapher/Models/Options/CheckBoxOption.cs +++ b/grapher/Models/Options/CheckBoxOption.cs @@ -2,6 +2,9 @@ namespace grapher.Models.Options { + /// + /// This is an option type that is just a checkbox. + /// public class CheckBoxOption : OptionBase { public CheckBoxOption( diff --git a/grapher/Models/Options/LockableOption.cs b/grapher/Models/Options/LockableOption.cs new file mode 100644 index 0000000..bf77520 --- /dev/null +++ b/grapher/Models/Options/LockableOption.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace grapher.Models.Options +{ + /// + /// This is an option type that is a regular option with a checkbox that disables it. + /// + public class LockableOption : OptionBase + { + public LockableOption( + Option option, + CheckBox checkBox, + int lockedvalue) + { + Option = option; + LockBox = checkBox; + LockedValue = lockedvalue; + } + + public Option Option { get; } + + public CheckBox LockBox { get; } + + public int LockedValue { get; } + + public override int Left + { + get => Option.Left; + + set + { + Option.Left = value; + } + } + + public override int Top + { + get => Option.Top; + + set + { + Option.Top = value; + LockBox.Top = value; + } + } + + public override int Width + { + get => Option.Width; + + set + { + Option.Width = value; + } + } + + public override int Height + { + get => Option.Height; + } + + public override bool Visible + { + get => Option.Visible; + } + + public override void AlignActiveValues() + { + Option.AlignActiveValues(); + } + + public override void Hide() + { + Option.Hide(); + LockBox.Hide(); + } + + public override void Show(string Name) + { + Option.Show(Name); + LockBox.Show(); + } + } +} diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index 9a9412b..abc06df 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -137,6 +137,7 @@ + -- cgit v1.2.3 From affc97b1ef41437e7caba31be8e9b9212805182e Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sat, 11 Sep 2021 17:38:59 -0700 Subject: YToXRatio fully works --- grapher/Constants/Constants.cs | 4 +-- grapher/Form1.Designer.cs | 24 ++++++++-------- grapher/Form1.cs | 1 + grapher/Models/AccelGUI.cs | 2 +- grapher/Models/AccelGUIFactory.cs | 27 ++++++++++++------ grapher/Models/Options/ApplyOptions.cs | 13 +++++---- grapher/Models/Options/LockableOption.cs | 48 ++++++++++++++++++++++++++++++++ 7 files changed, 91 insertions(+), 28 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 383d7f4..179c45e 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -44,7 +44,7 @@ namespace grapher public const int DropDownLeftSeparation = 10; /// Height of sensitivity chart when displayed alone. - public const int SensitivityChartAloneHeight = 480; + public const int SensitivityChartAloneHeight = 510; /// Height of sensitivity chart when displayed alongside Velocity and Gain charts. public const int SensitivityChartTogetherHeight = 328; @@ -65,7 +65,7 @@ namespace grapher public const int ButtonVerticalOffset = 60; /// Vertical placement of directionality panel below top of containing form - public const int DirectionalityVerticalOffset = 285; + public const int DirectionalityVerticalOffset = 315; /// Padding between directionality title and containing panel public const int DirectionalityTitlePad = 8; diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 376809f..0356683 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -71,6 +71,7 @@ namespace grapher System.Windows.Forms.DataVisualization.Charting.Title title6 = new System.Windows.Forms.DataVisualization.Charting.Title(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RawAcceleration)); this.optionsPanel = new System.Windows.Forms.Panel(); + this.VertHorzRatioLabel = new System.Windows.Forms.Label(); this.SmoothActiveYLabel = new System.Windows.Forms.Label(); this.smoothLabelY = new System.Windows.Forms.Label(); this.SmoothActiveXLabel = new System.Windows.Forms.Label(); @@ -223,7 +224,6 @@ namespace grapher this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); - this.VertHorzRatioLabel = new System.Windows.Forms.Label(); this.optionsPanel.SuspendLayout(); this.DirectionalityPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -360,6 +360,15 @@ namespace grapher this.optionsPanel.Size = new System.Drawing.Size(483, 956); this.optionsPanel.TabIndex = 34; // + // VertHorzRatioLabel + // + this.VertHorzRatioLabel.AutoSize = true; + this.VertHorzRatioLabel.Location = new System.Drawing.Point(28, 79); + this.VertHorzRatioLabel.Name = "VertHorzRatioLabel"; + this.VertHorzRatioLabel.Size = new System.Drawing.Size(59, 13); + this.VertHorzRatioLabel.TabIndex = 194; + this.VertHorzRatioLabel.Text = "Y to X ratio"; + // // SmoothActiveYLabel // this.SmoothActiveYLabel.AutoSize = true; @@ -1157,7 +1166,7 @@ namespace grapher // accelTypeDropY // this.accelTypeDropY.FormattingEnabled = true; - this.accelTypeDropY.Location = new System.Drawing.Point(332, 140); + this.accelTypeDropY.Location = new System.Drawing.Point(332, 138); this.accelTypeDropY.Name = "accelTypeDropY"; this.accelTypeDropY.Size = new System.Drawing.Size(76, 21); this.accelTypeDropY.TabIndex = 99; @@ -1505,7 +1514,7 @@ namespace grapher // accelTypeDropX // this.accelTypeDropX.FormattingEnabled = true; - this.accelTypeDropX.Location = new System.Drawing.Point(106, 140); + this.accelTypeDropX.Location = new System.Drawing.Point(106, 138); this.accelTypeDropX.Name = "accelTypeDropX"; this.accelTypeDropX.Size = new System.Drawing.Size(76, 21); this.accelTypeDropX.TabIndex = 84; @@ -1878,15 +1887,6 @@ namespace grapher title6.Text = "Sensitivity"; this.AccelerationChart.Titles.Add(title6); // - // VertHorzRatioLabel - // - this.VertHorzRatioLabel.AutoSize = true; - this.VertHorzRatioLabel.Location = new System.Drawing.Point(28, 79); - this.VertHorzRatioLabel.Name = "VertHorzRatioLabel"; - this.VertHorzRatioLabel.Size = new System.Drawing.Size(59, 13); - this.VertHorzRatioLabel.TabIndex = 194; - this.VertHorzRatioLabel.Text = "Y to X ratio"; - // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 91bc980..5f2c90e 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -106,6 +106,7 @@ namespace grapher YLutPointsBox, LockXYLabel, sensitivityLabel, + VertHorzRatioLabel, rotationLabel, weightLabelX, weightLabelY, diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 801fd8d..e15aba9 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -116,7 +116,7 @@ namespace grapher settings.sensitivity = ApplyOptions.Sensitivity.Field.Data; // TODO - separate sensitivity fields, add new label for ratio - settings.yxSensRatio = ApplyOptions.Sensitivity.Fields.Y; + settings.yxSensRatio = ApplyOptions.YToXRatio.Value; settings.combineMagnitudes = ApplyOptions.IsWhole; ApplyOptions.SetArgsFromActiveValues(ref settings.argsX, ref settings.argsY); diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index cc43aeb..20040fb 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -83,6 +83,7 @@ namespace grapher.Models RichTextBox yLutPointsBox, Label lockXYLabel, Label sensitivityLabel, + Label yxRatioLabel, Label rotationLabel, Label weightLabelX, Label weightLabelY, @@ -112,8 +113,8 @@ namespace grapher.Models Label constantThreeLabelY, Label activeValueTitleX, Label activeValueTitleY, - Label sensitivityActiveXLabel, - Label sensitivityActiveYLabel, + Label sensitivityActiveLabel, + Label yxRatioActiveLabel, Label rotationActiveLabel, Label weightActiveXLabel, Label weightActiveYLabel, @@ -181,18 +182,27 @@ namespace grapher.Models writeButton, accelCalculator); - var sensitivity = new OptionXY( + var sensitivity = new Option( sensitivityBoxX, - sensitivityBoxY, - sensXYLock, form, 1, sensitivityLabel, - new ActiveValueLabelXY( - new ActiveValueLabel(sensitivityActiveXLabel, activeValueTitleX), - new ActiveValueLabel(sensitivityActiveYLabel, activeValueTitleX)), + 0, + new ActiveValueLabel(sensitivityActiveLabel, activeValueTitleX), "Sens Multiplier"); + var yxRatio = new LockableOption( + new Option( + sensitivityBoxY, + form, + 1, + yxRatioLabel, + 0, + new ActiveValueLabel(yxRatioActiveLabel, activeValueTitleX), + "Y/X Ratio"), + sensXYLock, + 1); + var rotation = new Option( rotationBox, form, @@ -487,6 +497,7 @@ namespace grapher.Models optionsSetY, directionalOptions, sensitivity, + yxRatio, rotation, lockXYLabel, accelCharts); diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 5c3494c..4946414 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -15,7 +15,8 @@ namespace grapher.Models.Options AccelOptionSet optionSetX, AccelOptionSet optionSetY, DirectionalityOptions directionalityOptions, - OptionXY sensitivity, + Option sensitivity, + LockableOption yxRatio, Option rotation, Label lockXYLabel, AccelCharts accelCharts) @@ -34,6 +35,7 @@ namespace grapher.Models.Options OptionSetX = optionSetX; OptionSetY = optionSetY; Sensitivity = sensitivity; + YToXRatio = yxRatio; Rotation = rotation; LockXYLabel = lockXYLabel; AccelCharts = accelCharts; @@ -44,7 +46,8 @@ namespace grapher.Models.Options ByComponentVectorXYLock.CheckedChanged += new System.EventHandler(OnByComponentXYLockChecked); ByComponentVectorXYLock.Checked = true; - Rotation.SnapTo(Sensitivity); + YToXRatio.SnapTo(Sensitivity); + Rotation.SnapTo(YToXRatio); EnableWholeApplication(); } @@ -67,7 +70,7 @@ namespace grapher.Models.Options public Option Sensitivity { get; } - public Option YToXRatio { get; } + public LockableOption YToXRatio { get; } public Option Rotation { get; } @@ -213,8 +216,8 @@ namespace grapher.Models.Options LockXYLabel.Width = (AccelCharts.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; + YToXRatio.LockBox.Left = LockXYLabel.Left + LockXYLabel.Width / 2 - YToXRatio.LockBox.Width / 2; + ByComponentVectorXYLock.Left = YToXRatio.LockBox.Left; AlignActiveValues(); } diff --git a/grapher/Models/Options/LockableOption.cs b/grapher/Models/Options/LockableOption.cs index bf77520..6e78783 100644 --- a/grapher/Models/Options/LockableOption.cs +++ b/grapher/Models/Options/LockableOption.cs @@ -20,6 +20,12 @@ namespace grapher.Models.Options Option = option; LockBox = checkBox; LockedValue = lockedvalue; + + LockBox.Click += OnLockedBoxClicked; + LockBox.AutoCheck = false; + + Option.Field.SetNewDefault(LockedValue); + SetLocked(); } public Option Option { get; } @@ -69,6 +75,25 @@ namespace grapher.Models.Options get => Option.Visible; } + public double Value + { + get => LockBox.Checked ? LockedValue : Option.Field.Data; + } + + public void SetActiveValue(double activeValue) + { + Option.SetActiveValue(activeValue); + + if (activeValue == LockedValue) + { + SetLocked(); + } + else + { + SetUnlocked(); + } + } + public override void AlignActiveValues() { Option.AlignActiveValues(); @@ -85,5 +110,28 @@ namespace grapher.Models.Options Option.Show(Name); LockBox.Show(); } + private void SetLocked() + { + LockBox.Checked = true; + Option.Field.SetToUnavailable(); + } + + private void SetUnlocked() + { + LockBox.Checked = false; + Option.Field.SetToDefault(); + } + + private void OnLockedBoxClicked(object sender, EventArgs e) + { + if (LockBox.Checked) + { + SetUnlocked(); + } + else + { + SetLocked(); + } + } } } -- cgit v1.2.3 From c0f2aa4a41de22936a5ed177c3b83792cc8231a8 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 13 Sep 2021 00:40:57 -0700 Subject: Most of Cap Type options in GUI --- grapher/Models/Options/Cap/CapOptions.cs | 147 ++++++++++++++++++++++++++ grapher/Models/Options/Cap/CapTypeOptions.cs | 93 ++++++++++++++++ grapher/Models/Options/ComboBoxOptionsBase.cs | 129 ++++++++++++++++++++++ grapher/Models/Options/LUT/LutApplyOptions.cs | 138 ++++++------------------ 4 files changed, 401 insertions(+), 106 deletions(-) create mode 100644 grapher/Models/Options/Cap/CapOptions.cs create mode 100644 grapher/Models/Options/Cap/CapTypeOptions.cs create mode 100644 grapher/Models/Options/ComboBoxOptionsBase.cs (limited to 'grapher') diff --git a/grapher/Models/Options/Cap/CapOptions.cs b/grapher/Models/Options/Cap/CapOptions.cs new file mode 100644 index 0000000..144cd79 --- /dev/null +++ b/grapher/Models/Options/Cap/CapOptions.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace grapher.Models.Options.Cap +{ + public class CapOptions : OptionBase + { + public enum CapType + { + In, + Out, + Both, + } + + public CapOptions( + ComboBox capTypeDropDown, + Option capIn, + Option capOut, + Option slope) + { + CapTypeDropdown = capTypeDropDown; + In = capIn; + Out = capOut; + Slope = slope; + + SetupCapTypeDropdown(CapTypeDropdown); + CapTypeDropdown.SelectedItem = CapType.In; + } + + public ComboBox CapTypeDropdown { get; } + + public Option In { get; } + + public Option Out { get; } + + public Option Slope { get; } + + public CapType SelectedCapType { get; private set; } + + public override int Left + { + get => In.Left; + + set + { + In.Left = value; + Out.Left = value; + Slope.Left = value; + } + } + + public override int Top + { + get => CapTypeDropdown.Top; + set + { + CapTypeDropdown.Top = value; + Layout(); + } + } + + public override int Height + { + get => BottomElement.Top + BottomElement.Height - CapTypeDropdown.Top; + } + + public override int Width + { + get => CapTypeDropdown.Width; + + set + { + CapTypeDropdown.Width = value; + In.Width = value; + Out.Width = value; + Slope.Width = value; + } + } + + public override bool Visible + { + get => CapTypeDropdown.Visible; + } + + private Option BottomElement { get; set; } + + public void Layout() + { + Layout(CapTypeDropdown.Top + CapTypeDropdown.Height + Constants.OptionVerticalSeperation); + } + + private void Layout(int top) + { + switch (SelectedCapType) + { + case CapType.In: + Slope.Show(); + In.Show(); + Out.Hide(); + + Slope.Top = top; + In.SnapTo(Slope); + BottomElement = In; + break; + case CapType.Out: + Slope.Show(); + In.Hide(); + Out.Show(); + + Slope.Top = top; + In.SnapTo(Slope); + BottomElement = In; + break; + case CapType.Both: + Slope.Hide(); + In.Show(); + Out.Show(); + + In.Top = top; + Out.SnapTo(In); + BottomElement = Out; + break; + } + } + + private void FindSelectedTypeFromDropdown() + { + SelectedCapType = (CapType)CapTypeDropdown.SelectedItem; + } + + private void OnCapTypeDropdownSelectedItemChanged(object sender, EventArgs e) + { + FindSelectedTypeFromDropdown(); + Layout(); + } + + private void SetupCapTypeDropdown(ComboBox capTypeDropDown) + { + capTypeDropDown.Items.Clear(); + capTypeDropDown.DataSource = Enum.GetValues(typeof(CapType)); + } + } +} diff --git a/grapher/Models/Options/Cap/CapTypeOptions.cs b/grapher/Models/Options/Cap/CapTypeOptions.cs new file mode 100644 index 0000000..b2cca57 --- /dev/null +++ b/grapher/Models/Options/Cap/CapTypeOptions.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace grapher.Models.Options.Cap +{ + public class CapTypeOptions : ComboBoxOptionsBase + { + #region Enum + + public enum CapType + { + In, + Out, + Both, + } + + #endregion Enum + + #region Classes + + public class CapTypeOption + { + public CapType Type { get; set; } + + public string Name => Type.ToString(); + + public override string ToString() => Name; + } + + #endregion Classes + + #region Static + + public static readonly CapTypeOption InCap = new CapTypeOption + { + Type = CapType.In, + }; + + public static readonly CapTypeOption OutCap = new CapTypeOption + { + Type = CapType.Out, + }; + + public static readonly CapTypeOption BothCap = new CapTypeOption + { + Type = CapType.Both, + }; + + public static readonly CapTypeOption[] AllCapTypeOptions = new CapTypeOption[] + { + InCap, + OutCap, + BothCap + }; + + #endregion Static + + #region Constructors + + public CapTypeOptions( + Label label, + ComboBox dropdown, + ActiveValueLabel activeValueLabel) + : base( + label, + dropdown, + activeValueLabel) + { + } + + #endregion Constructors + + #region Properties + + CapTypeOption CapOption + { + get + { + return OptionsDropdown.SelectedItem as CapTypeOption; + } + set + { + OptionsDropdown.SelectedItem = value; + } + } + + #endregion Properties + } +} diff --git a/grapher/Models/Options/ComboBoxOptionsBase.cs b/grapher/Models/Options/ComboBoxOptionsBase.cs new file mode 100644 index 0000000..64e0092 --- /dev/null +++ b/grapher/Models/Options/ComboBoxOptionsBase.cs @@ -0,0 +1,129 @@ +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 abstract class ComboBoxOptionsBase : OptionBase + { + #region Constructors + + public ComboBoxOptionsBase( + Label label, + ComboBox dropdown, + ActiveValueLabel activeValueLabel) + { + OptionsDropdown = dropdown; + OptionsDropdown.Items.Clear(); + + Label = label; + Label.AutoSize = false; + Label.Width = 50; + + ActiveValueLabel = activeValueLabel; + } + + #endregion Constructors + + #region Properties + + public Label Label { get; } + + public ActiveValueLabel ActiveValueLabel { get; } + + public ComboBox OptionsDropdown { get; } + + public override bool Visible + { + get + { + return Label.Visible || ShouldShow; + } + } + + public override int Left + { + get + { + return Label.Left; + } + set + { + Label.Left = value; + OptionsDropdown.Left = Label.Left + Label.Width + Constants.OptionVerticalSeperation; + } + } + + public override int Height + { + get + { + return Label.Height; + } + } + + public override int Top + { + get + { + return Label.Top; + } + set + { + OptionsDropdown.Top = value; + Label.Top = (OptionsDropdown.Height - Label.Height) / 2 + OptionsDropdown.Top; + ActiveValueLabel.Top = value; + } + } + + public override int Width + { + get + { + return Label.Width; + } + set + { + OptionsDropdown.Width = value - Label.Width - Constants.OptionLabelBoxSeperation; + } + } + + protected bool ShouldShow { get; set; } + + #endregion Properties + + #region Methods + + public override void Hide() + { + Label.Hide(); + OptionsDropdown.Hide(); + ActiveValueLabel.Hide(); + ShouldShow = false; + } + + public override void Show(string labelText) + { + Label.Show(); + + if (!string.IsNullOrWhiteSpace(labelText)) + { + Label.Text = labelText; + } + + OptionsDropdown.Show(); + ActiveValueLabel.Show(); + ShouldShow = true; + } + + public override void AlignActiveValues() + { + ActiveValueLabel.Align(); + } + + #endregion Methods + } +} diff --git a/grapher/Models/Options/LUT/LutApplyOptions.cs b/grapher/Models/Options/LUT/LutApplyOptions.cs index 7d8c737..61cae61 100644 --- a/grapher/Models/Options/LUT/LutApplyOptions.cs +++ b/grapher/Models/Options/LUT/LutApplyOptions.cs @@ -7,10 +7,9 @@ using System.Windows.Forms; namespace grapher.Models.Options.LUT { - public class LutApplyOptions : OptionBase + public class LutApplyOptions : ComboBoxOptionsBase { - public const string LUTApplyOptionsLabelText = "Apply as:"; - public const int LUTApplyLabelDropdownSeparation = 4; + #region Enum public enum LutApplyType { @@ -18,6 +17,10 @@ namespace grapher.Models.Options.LUT Velocity } + #endregion Enum + + #region Classes + public class LutApplyOption { public LutApplyType Type { get; set; } @@ -27,6 +30,10 @@ namespace grapher.Models.Options.LUT public override string ToString() => Name; } + #endregion Classes + + #region Static + public static readonly LutApplyOption Sensitivity = new LutApplyOption { Type = LutApplyType.Sensitivity, @@ -37,129 +44,58 @@ namespace grapher.Models.Options.LUT Type = LutApplyType.Velocity, }; + #endregion Static + + #region Constructors + public LutApplyOptions( Label label, ComboBox applyOptionsDropdown, ActiveValueLabel lutApplyActiveValue) + : base( + label, + applyOptionsDropdown, + lutApplyActiveValue) { - ApplyOptions = applyOptionsDropdown; - ApplyOptions.Items.Clear(); - ApplyOptions.Items.AddRange( + OptionsDropdown.Items.AddRange( new LutApplyOption[] { Sensitivity, Velocity, }); + } - Label = label; - Label.Text = LUTApplyOptionsLabelText; - Label.AutoSize = false; - Label.Width = 50; + #endregion Constructors - ActiveValueLabel = lutApplyActiveValue; - } + #region Properties public LutApplyType ApplyType { get => ApplyOption.Type; } public LutApplyOption ApplyOption { get { - return ApplyOptions.SelectedItem as LutApplyOption; - } - set - { - ApplyOptions.SelectedItem = value; - } - } - - public Label Label { get; } - - public ActiveValueLabel ActiveValueLabel { get; } - - public ComboBox ApplyOptions { get; } - - public override bool Visible - { - get - { - return Label.Visible || ShouldShow; - } - } - - public override int Left - { - get - { - return Label.Left; + return OptionsDropdown.SelectedItem as LutApplyOption; } set { - Label.Left = value; - ApplyOptions.Left = Label.Left + Label.Width + LUTApplyLabelDropdownSeparation; + OptionsDropdown.SelectedItem = value; } } - public override int Height - { - get - { - return Label.Height; - } - } + #endregion Properties - public override int Top - { - get - { - return Label.Top; - } - set - { - ApplyOptions.Top = value; - Label.Top = (ApplyOptions.Height - Label.Height) / 2 + ApplyOptions.Top; - ActiveValueLabel.Top = value; - } - } + #region Methods - public override int Width + public static LutApplyOption ApplyOptionFromSettings(bool applyAsVelocity) { - get - { - return Label.Width; - } - set + if (applyAsVelocity) { - ApplyOptions.Width = value - Label.Width - Constants.OptionLabelBoxSeperation; + return Velocity; } - } - - private bool ShouldShow { get; set; } - - public override void Hide() - { - Label.Hide(); - ApplyOptions.Hide(); - ActiveValueLabel.Hide(); - ShouldShow = false; - } - - public override void Show(string labelText) - { - Label.Show(); - - if (!string.IsNullOrWhiteSpace(labelText)) + else { - Label.Text = labelText; + return Sensitivity; } - - ApplyOptions.Show(); - ActiveValueLabel.Show(); - ShouldShow = true; - } - - public override void AlignActiveValues() - { - ActiveValueLabel.Align(); } public void SetActiveValue(bool applyAsVelocity) @@ -168,16 +104,6 @@ namespace grapher.Models.Options.LUT ActiveValueLabel.SetValue(ApplyOption.Name); } - public LutApplyOption ApplyOptionFromSettings(bool applyAsVelocity) - { - if (applyAsVelocity) - { - return Velocity; - } - else - { - return Sensitivity; - } - } + #endregion Methods } } -- cgit v1.2.3 From 41c79072e5713ab8750f058b6de0623b3b17f366 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 13 Sep 2021 01:02:57 -0700 Subject: Some reorganizing --- grapher/Models/Options/Cap/CapOptions.cs | 44 +++++++++------------------- grapher/Models/Options/Cap/CapTypeOptions.cs | 43 +++++++++++++++++++++++---- grapher/grapher.csproj | 3 ++ 3 files changed, 55 insertions(+), 35 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Options/Cap/CapOptions.cs b/grapher/Models/Options/Cap/CapOptions.cs index 144cd79..2fe44b0 100644 --- a/grapher/Models/Options/Cap/CapOptions.cs +++ b/grapher/Models/Options/Cap/CapOptions.cs @@ -4,34 +4,26 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using static grapher.Models.Options.Cap.CapTypeOptions; namespace grapher.Models.Options.Cap { public class CapOptions : OptionBase { - public enum CapType - { - In, - Out, - Both, - } public CapOptions( - ComboBox capTypeDropDown, + CapTypeOptions capTypeOptions, Option capIn, Option capOut, Option slope) { - CapTypeDropdown = capTypeDropDown; + CapTypeOptions = capTypeOptions; In = capIn; Out = capOut; Slope = slope; - - SetupCapTypeDropdown(CapTypeDropdown); - CapTypeDropdown.SelectedItem = CapType.In; } - public ComboBox CapTypeDropdown { get; } + public CapTypeOptions CapTypeOptions { get; } public Option In { get; } @@ -39,8 +31,6 @@ namespace grapher.Models.Options.Cap public Option Slope { get; } - public CapType SelectedCapType { get; private set; } - public override int Left { get => In.Left; @@ -55,26 +45,26 @@ namespace grapher.Models.Options.Cap public override int Top { - get => CapTypeDropdown.Top; + get => CapTypeOptions.Top; set { - CapTypeDropdown.Top = value; + CapTypeOptions.Top = value; Layout(); } } public override int Height { - get => BottomElement.Top + BottomElement.Height - CapTypeDropdown.Top; + get => BottomElement.Top + BottomElement.Height - CapTypeOptions.Top; } public override int Width { - get => CapTypeDropdown.Width; + get => CapTypeOptions.Width; set { - CapTypeDropdown.Width = value; + CapTypeOptions.Width = value; In.Width = value; Out.Width = value; Slope.Width = value; @@ -83,21 +73,21 @@ namespace grapher.Models.Options.Cap public override bool Visible { - get => CapTypeDropdown.Visible; + get => CapTypeOptions.Visible; } private Option BottomElement { get; set; } public void Layout() { - Layout(CapTypeDropdown.Top + CapTypeDropdown.Height + Constants.OptionVerticalSeperation); + Layout(CapTypeOptions.Top + CapTypeOptions.Height + Constants.OptionVerticalSeperation); } private void Layout(int top) { - switch (SelectedCapType) + switch (CapTypeOptions.SelectedCapType) { - case CapType.In: + case CapType.Input: Slope.Show(); In.Show(); Out.Hide(); @@ -106,7 +96,7 @@ namespace grapher.Models.Options.Cap In.SnapTo(Slope); BottomElement = In; break; - case CapType.Out: + case CapType.Output: Slope.Show(); In.Hide(); Out.Show(); @@ -127,14 +117,8 @@ namespace grapher.Models.Options.Cap } } - private void FindSelectedTypeFromDropdown() - { - SelectedCapType = (CapType)CapTypeDropdown.SelectedItem; - } - private void OnCapTypeDropdownSelectedItemChanged(object sender, EventArgs e) { - FindSelectedTypeFromDropdown(); Layout(); } diff --git a/grapher/Models/Options/Cap/CapTypeOptions.cs b/grapher/Models/Options/Cap/CapTypeOptions.cs index b2cca57..4ea372b 100644 --- a/grapher/Models/Options/Cap/CapTypeOptions.cs +++ b/grapher/Models/Options/Cap/CapTypeOptions.cs @@ -13,8 +13,8 @@ namespace grapher.Models.Options.Cap public enum CapType { - In, - Out, + Input, + Output, Both, } @@ -37,12 +37,12 @@ namespace grapher.Models.Options.Cap public static readonly CapTypeOption InCap = new CapTypeOption { - Type = CapType.In, + Type = CapType.Input, }; public static readonly CapTypeOption OutCap = new CapTypeOption { - Type = CapType.Out, + Type = CapType.Output, }; public static readonly CapTypeOption BothCap = new CapTypeOption @@ -70,13 +70,22 @@ namespace grapher.Models.Options.Cap dropdown, activeValueLabel) { + OptionsDropdown.Items.AddRange( + new CapTypeOption[] + { + InCap, + OutCap, + BothCap + }); } #endregion Constructors #region Properties - CapTypeOption CapOption + public CapType SelectedCapType => SelectedCapOption.Type; + + public CapTypeOption SelectedCapOption { get { @@ -89,5 +98,29 @@ namespace grapher.Models.Options.Cap } #endregion Properties + + #region Methods + + public static CapTypeOption CapTypeOptionFromSettings(ClassicCapMode capMode) + { + switch (capMode) + { + case ClassicCapMode.output: + return OutCap; + case ClassicCapMode.in_out: + return BothCap; + case ClassicCapMode.input: + default: + return InCap; + } + } + + public void SetActiveValue(ClassicCapMode capMode) + { + SelectedCapOption = CapTypeOptionFromSettings(capMode); + ActiveValueLabel.SetValue(SelectedCapOption.Name); + } + + #endregion Methods } } diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index abc06df..bd6674d 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -135,7 +135,10 @@ + + + -- cgit v1.2.3 From 6c037f92a350d8622f3739b1033c909912860d77 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 14 Sep 2021 00:55:21 -0700 Subject: Mostly working cap type in GUI --- grapher/Form1.Designer.cs | 254 +++++++++++++++++++++------ grapher/Form1.cs | 28 ++- grapher/Layouts/ClassicLayout.cs | 5 +- grapher/Layouts/DefaultLayout.cs | 5 +- grapher/Layouts/JumpLayout.cs | 5 +- grapher/Layouts/LUTLayout.cs | 5 +- grapher/Layouts/LayoutBase.cs | 35 ++-- grapher/Layouts/LinearLayout.cs | 5 +- grapher/Layouts/MotivityLayout.cs | 5 +- grapher/Layouts/NaturalLayout.cs | 5 +- grapher/Layouts/OffLayout.cs | 5 +- grapher/Layouts/PowerLayout.cs | 5 +- grapher/Layouts/UnsupportedLayout.cs | 5 +- grapher/Models/AccelGUIFactory.cs | 123 +++++++++---- grapher/Models/Options/AccelTypeOptions.cs | 75 ++++---- grapher/Models/Options/Cap/CapOptions.cs | 107 ++++++++--- grapher/Models/Options/Cap/CapTypeOptions.cs | 11 ++ 17 files changed, 481 insertions(+), 202 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 0356683..532eab4 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -154,7 +154,7 @@ namespace grapher this.limitLabelY = new System.Windows.Forms.Label(); this.offsetLabelY = new System.Windows.Forms.Label(); this.weightLabelY = new System.Windows.Forms.Label(); - this.capLabelY = new System.Windows.Forms.Label(); + this.inCapLabelY = new System.Windows.Forms.Label(); this.constantOneLabelY = new System.Windows.Forms.Label(); this.ByComponentXYLock = new System.Windows.Forms.CheckBox(); this.MidpointActiveYLabel = new System.Windows.Forms.Label(); @@ -169,10 +169,10 @@ namespace grapher this.MidpointActiveXLabel = new System.Windows.Forms.Label(); this.LimitActiveXLabel = new System.Windows.Forms.Label(); this.OffsetActiveXLabel = new System.Windows.Forms.Label(); - this.CapActiveYLabel = new System.Windows.Forms.Label(); + this.InCapActiveYLabel = new System.Windows.Forms.Label(); this.WeightActiveYLabel = new System.Windows.Forms.Label(); this.WeightActiveXLabel = new System.Windows.Forms.Label(); - this.CapActiveXLabel = new System.Windows.Forms.Label(); + this.InCapActiveXLabel = new System.Windows.Forms.Label(); this.AccelerationActiveLabelX = new System.Windows.Forms.Label(); this.AccelTypeActiveLabelX = new System.Windows.Forms.Label(); this.RotationActiveLabel = new System.Windows.Forms.Label(); @@ -182,7 +182,7 @@ namespace grapher this.MouseLabel = new System.Windows.Forms.Label(); this.LockXYLabel = new System.Windows.Forms.Label(); this.sensXYLock = new System.Windows.Forms.CheckBox(); - this.capBoxY = new System.Windows.Forms.TextBox(); + this.inCapBoxY = new System.Windows.Forms.TextBox(); this.VertHorzRatioBox = new System.Windows.Forms.TextBox(); this.writeButton = new System.Windows.Forms.Button(); this.offsetLabelX = new System.Windows.Forms.Label(); @@ -194,8 +194,8 @@ namespace grapher this.weightBoxY = new System.Windows.Forms.TextBox(); this.weightLabelX = new System.Windows.Forms.Label(); this.weightBoxX = new System.Windows.Forms.TextBox(); - this.capLabelX = new System.Windows.Forms.Label(); - this.capBoxX = new System.Windows.Forms.TextBox(); + this.inCapLabelX = new System.Windows.Forms.Label(); + this.inCapBoxX = new System.Windows.Forms.TextBox(); this.constantOneLabelX = new System.Windows.Forms.Label(); this.accelerationBoxX = new System.Windows.Forms.TextBox(); this.rotationLabel = new System.Windows.Forms.Label(); @@ -224,6 +224,18 @@ namespace grapher this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.CapTypeDropdownX = new System.Windows.Forms.ComboBox(); + this.CapTypeDropdownY = new System.Windows.Forms.ComboBox(); + this.CapTypeLabelX = new System.Windows.Forms.Label(); + this.CapTypeLabelY = new System.Windows.Forms.Label(); + this.outCapBoxX = new System.Windows.Forms.TextBox(); + this.outCapBoxY = new System.Windows.Forms.TextBox(); + this.outCapLabelX = new System.Windows.Forms.Label(); + this.outCapLabelY = new System.Windows.Forms.Label(); + this.OutCapActiveXLabel = new System.Windows.Forms.Label(); + this.OutCapActiveYLabel = new System.Windows.Forms.Label(); + this.CapTypeActiveXLabel = new System.Windows.Forms.Label(); + this.CapTypeActiveYLabel = new System.Windows.Forms.Label(); this.optionsPanel.SuspendLayout(); this.DirectionalityPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -239,6 +251,18 @@ namespace grapher // optionsPanel // this.optionsPanel.AutoSize = true; + this.optionsPanel.Controls.Add(this.CapTypeActiveYLabel); + this.optionsPanel.Controls.Add(this.CapTypeActiveXLabel); + this.optionsPanel.Controls.Add(this.OutCapActiveYLabel); + this.optionsPanel.Controls.Add(this.OutCapActiveXLabel); + this.optionsPanel.Controls.Add(this.outCapLabelY); + this.optionsPanel.Controls.Add(this.outCapLabelX); + this.optionsPanel.Controls.Add(this.outCapBoxY); + this.optionsPanel.Controls.Add(this.outCapBoxX); + this.optionsPanel.Controls.Add(this.CapTypeLabelY); + this.optionsPanel.Controls.Add(this.CapTypeLabelX); + this.optionsPanel.Controls.Add(this.CapTypeDropdownY); + this.optionsPanel.Controls.Add(this.CapTypeDropdownX); this.optionsPanel.Controls.Add(this.VertHorzRatioLabel); this.optionsPanel.Controls.Add(this.SmoothActiveYLabel); this.optionsPanel.Controls.Add(this.smoothLabelY); @@ -303,7 +327,7 @@ namespace grapher this.optionsPanel.Controls.Add(this.limitLabelY); this.optionsPanel.Controls.Add(this.offsetLabelY); this.optionsPanel.Controls.Add(this.weightLabelY); - this.optionsPanel.Controls.Add(this.capLabelY); + this.optionsPanel.Controls.Add(this.inCapLabelY); this.optionsPanel.Controls.Add(this.constantOneLabelY); this.optionsPanel.Controls.Add(this.ByComponentXYLock); this.optionsPanel.Controls.Add(this.MidpointActiveYLabel); @@ -318,10 +342,10 @@ namespace grapher this.optionsPanel.Controls.Add(this.MidpointActiveXLabel); this.optionsPanel.Controls.Add(this.LimitActiveXLabel); this.optionsPanel.Controls.Add(this.OffsetActiveXLabel); - this.optionsPanel.Controls.Add(this.CapActiveYLabel); + this.optionsPanel.Controls.Add(this.InCapActiveYLabel); this.optionsPanel.Controls.Add(this.WeightActiveYLabel); this.optionsPanel.Controls.Add(this.WeightActiveXLabel); - this.optionsPanel.Controls.Add(this.CapActiveXLabel); + this.optionsPanel.Controls.Add(this.InCapActiveXLabel); this.optionsPanel.Controls.Add(this.AccelerationActiveLabelX); this.optionsPanel.Controls.Add(this.AccelTypeActiveLabelX); this.optionsPanel.Controls.Add(this.RotationActiveLabel); @@ -331,7 +355,7 @@ namespace grapher this.optionsPanel.Controls.Add(this.MouseLabel); this.optionsPanel.Controls.Add(this.LockXYLabel); this.optionsPanel.Controls.Add(this.sensXYLock); - this.optionsPanel.Controls.Add(this.capBoxY); + this.optionsPanel.Controls.Add(this.inCapBoxY); this.optionsPanel.Controls.Add(this.VertHorzRatioBox); this.optionsPanel.Controls.Add(this.writeButton); this.optionsPanel.Controls.Add(this.offsetLabelX); @@ -343,8 +367,8 @@ namespace grapher this.optionsPanel.Controls.Add(this.weightBoxY); this.optionsPanel.Controls.Add(this.weightLabelX); this.optionsPanel.Controls.Add(this.weightBoxX); - this.optionsPanel.Controls.Add(this.capLabelX); - this.optionsPanel.Controls.Add(this.capBoxX); + this.optionsPanel.Controls.Add(this.inCapLabelX); + this.optionsPanel.Controls.Add(this.inCapBoxX); this.optionsPanel.Controls.Add(this.constantOneLabelX); this.optionsPanel.Controls.Add(this.accelerationBoxX); this.optionsPanel.Controls.Add(this.rotationLabel); @@ -485,7 +509,7 @@ namespace grapher // decayRateLabelX // this.decayRateLabelX.AutoSize = true; - this.decayRateLabelX.Location = new System.Drawing.Point(37, 649); + this.decayRateLabelX.Location = new System.Drawing.Point(35, 649); this.decayRateLabelX.Name = "decayRateLabelX"; this.decayRateLabelX.Size = new System.Drawing.Size(64, 13); this.decayRateLabelX.TabIndex = 180; @@ -1098,14 +1122,14 @@ namespace grapher this.weightLabelY.TabIndex = 134; this.weightLabelY.Text = "Weight"; // - // capLabelY + // inCapLabelY // - this.capLabelY.AutoSize = true; - this.capLabelY.Location = new System.Drawing.Point(263, 196); - this.capLabelY.Name = "capLabelY"; - this.capLabelY.Size = new System.Drawing.Size(26, 13); - this.capLabelY.TabIndex = 133; - this.capLabelY.Text = "Cap"; + this.inCapLabelY.AutoSize = true; + this.inCapLabelY.Location = new System.Drawing.Point(263, 196); + this.inCapLabelY.Name = "inCapLabelY"; + this.inCapLabelY.Size = new System.Drawing.Size(56, 13); + this.inCapLabelY.TabIndex = 133; + this.inCapLabelY.Text = "Cap: Input"; // // constantOneLabelY // @@ -1227,14 +1251,14 @@ namespace grapher this.OffsetActiveXLabel.TabIndex = 125; this.OffsetActiveXLabel.Text = "0"; // - // CapActiveYLabel + // InCapActiveYLabel // - this.CapActiveYLabel.AutoSize = true; - this.CapActiveYLabel.Location = new System.Drawing.Point(414, 196); - this.CapActiveYLabel.Name = "CapActiveYLabel"; - this.CapActiveYLabel.Size = new System.Drawing.Size(13, 13); - this.CapActiveYLabel.TabIndex = 124; - this.CapActiveYLabel.Text = "0"; + this.InCapActiveYLabel.AutoSize = true; + this.InCapActiveYLabel.Location = new System.Drawing.Point(414, 196); + this.InCapActiveYLabel.Name = "InCapActiveYLabel"; + this.InCapActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.InCapActiveYLabel.TabIndex = 124; + this.InCapActiveYLabel.Text = "0"; // // WeightActiveYLabel // @@ -1254,14 +1278,14 @@ namespace grapher this.WeightActiveXLabel.TabIndex = 122; this.WeightActiveXLabel.Text = "0"; // - // CapActiveXLabel + // InCapActiveXLabel // - this.CapActiveXLabel.AutoSize = true; - this.CapActiveXLabel.Location = new System.Drawing.Point(197, 196); - this.CapActiveXLabel.Name = "CapActiveXLabel"; - this.CapActiveXLabel.Size = new System.Drawing.Size(13, 13); - this.CapActiveXLabel.TabIndex = 121; - this.CapActiveXLabel.Text = "0"; + this.InCapActiveXLabel.AutoSize = true; + this.InCapActiveXLabel.Location = new System.Drawing.Point(197, 196); + this.InCapActiveXLabel.Name = "InCapActiveXLabel"; + this.InCapActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.InCapActiveXLabel.TabIndex = 121; + this.InCapActiveXLabel.Text = "0"; // // AccelerationActiveLabelX // @@ -1346,12 +1370,12 @@ namespace grapher this.sensXYLock.TabIndex = 82; this.sensXYLock.UseVisualStyleBackColor = true; // - // capBoxY + // inCapBoxY // - this.capBoxY.Location = new System.Drawing.Point(332, 193); - this.capBoxY.Name = "capBoxY"; - this.capBoxY.Size = new System.Drawing.Size(76, 20); - this.capBoxY.TabIndex = 103; + this.inCapBoxY.Location = new System.Drawing.Point(332, 193); + this.inCapBoxY.Name = "inCapBoxY"; + this.inCapBoxY.Size = new System.Drawing.Size(76, 20); + this.inCapBoxY.TabIndex = 103; // // VertHorzRatioBox // @@ -1445,22 +1469,22 @@ namespace grapher this.weightBoxX.Size = new System.Drawing.Size(76, 20); this.weightBoxX.TabIndex = 90; // - // capLabelX + // inCapLabelX // - this.capLabelX.AutoSize = true; - this.capLabelX.Location = new System.Drawing.Point(37, 196); - this.capLabelX.Name = "capLabelX"; - this.capLabelX.Size = new System.Drawing.Size(26, 13); - this.capLabelX.TabIndex = 94; - this.capLabelX.Text = "Cap"; - this.capLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.inCapLabelX.AutoSize = true; + this.inCapLabelX.Location = new System.Drawing.Point(37, 196); + this.inCapLabelX.Name = "inCapLabelX"; + this.inCapLabelX.Size = new System.Drawing.Size(56, 13); + this.inCapLabelX.TabIndex = 94; + this.inCapLabelX.Text = "Cap: Input"; + this.inCapLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // capBoxX + // inCapBoxX // - this.capBoxX.Location = new System.Drawing.Point(106, 193); - this.capBoxX.Name = "capBoxX"; - this.capBoxX.Size = new System.Drawing.Size(76, 20); - this.capBoxX.TabIndex = 89; + this.inCapBoxX.Location = new System.Drawing.Point(106, 193); + this.inCapBoxX.Name = "inCapBoxX"; + this.inCapBoxX.Size = new System.Drawing.Size(76, 20); + this.inCapBoxX.TabIndex = 89; // // constantOneLabelX // @@ -1887,6 +1911,108 @@ namespace grapher title6.Text = "Sensitivity"; this.AccelerationChart.Titles.Add(title6); // + // CapTypeDropdownX + // + this.CapTypeDropdownX.FormattingEnabled = true; + this.CapTypeDropdownX.Location = new System.Drawing.Point(106, 726); + this.CapTypeDropdownX.Name = "CapTypeDropdownX"; + this.CapTypeDropdownX.Size = new System.Drawing.Size(76, 21); + this.CapTypeDropdownX.TabIndex = 195; + // + // CapTypeDropdownY + // + this.CapTypeDropdownY.FormattingEnabled = true; + this.CapTypeDropdownY.Location = new System.Drawing.Point(332, 725); + this.CapTypeDropdownY.Name = "CapTypeDropdownY"; + this.CapTypeDropdownY.Size = new System.Drawing.Size(76, 21); + this.CapTypeDropdownY.TabIndex = 196; + // + // CapTypeLabelX + // + this.CapTypeLabelX.AutoSize = true; + this.CapTypeLabelX.Location = new System.Drawing.Point(38, 728); + this.CapTypeLabelX.Name = "CapTypeLabelX"; + this.CapTypeLabelX.Size = new System.Drawing.Size(53, 13); + this.CapTypeLabelX.TabIndex = 197; + this.CapTypeLabelX.Text = "Cap Type"; + // + // CapTypeLabelY + // + this.CapTypeLabelY.AutoSize = true; + this.CapTypeLabelY.Location = new System.Drawing.Point(263, 729); + this.CapTypeLabelY.Name = "CapTypeLabelY"; + this.CapTypeLabelY.Size = new System.Drawing.Size(53, 13); + this.CapTypeLabelY.TabIndex = 198; + this.CapTypeLabelY.Text = "Cap Type"; + // + // outCapBoxX + // + this.outCapBoxX.Location = new System.Drawing.Point(106, 754); + this.outCapBoxX.Name = "outCapBoxX"; + this.outCapBoxX.Size = new System.Drawing.Size(76, 20); + this.outCapBoxX.TabIndex = 199; + // + // outCapBoxY + // + this.outCapBoxY.Location = new System.Drawing.Point(332, 754); + this.outCapBoxY.Name = "outCapBoxY"; + this.outCapBoxY.Size = new System.Drawing.Size(76, 20); + this.outCapBoxY.TabIndex = 200; + // + // outCapLabelX + // + this.outCapLabelX.AutoSize = true; + this.outCapLabelX.Location = new System.Drawing.Point(35, 757); + this.outCapLabelX.Name = "outCapLabelX"; + this.outCapLabelX.Size = new System.Drawing.Size(64, 13); + this.outCapLabelX.TabIndex = 201; + this.outCapLabelX.Text = "Cap: Output"; + // + // outCapLabelY + // + this.outCapLabelY.AutoSize = true; + this.outCapLabelY.Location = new System.Drawing.Point(262, 757); + this.outCapLabelY.Name = "outCapLabelY"; + this.outCapLabelY.Size = new System.Drawing.Size(64, 13); + this.outCapLabelY.TabIndex = 202; + this.outCapLabelY.Text = "Cap: Output"; + // + // OutCapActiveXLabel + // + this.OutCapActiveXLabel.AutoSize = true; + this.OutCapActiveXLabel.Location = new System.Drawing.Point(200, 757); + this.OutCapActiveXLabel.Name = "OutCapActiveXLabel"; + this.OutCapActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.OutCapActiveXLabel.TabIndex = 203; + this.OutCapActiveXLabel.Text = "0"; + // + // OutCapActiveYLabel + // + this.OutCapActiveYLabel.AutoSize = true; + this.OutCapActiveYLabel.Location = new System.Drawing.Point(414, 757); + this.OutCapActiveYLabel.Name = "OutCapActiveYLabel"; + this.OutCapActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.OutCapActiveYLabel.TabIndex = 204; + this.OutCapActiveYLabel.Text = "0"; + // + // CapTypeActiveXLabel + // + this.CapTypeActiveXLabel.AutoSize = true; + this.CapTypeActiveXLabel.Location = new System.Drawing.Point(200, 728); + this.CapTypeActiveXLabel.Name = "CapTypeActiveXLabel"; + this.CapTypeActiveXLabel.Size = new System.Drawing.Size(16, 13); + this.CapTypeActiveXLabel.TabIndex = 205; + this.CapTypeActiveXLabel.Text = "In"; + // + // CapTypeActiveYLabel + // + this.CapTypeActiveYLabel.AutoSize = true; + this.CapTypeActiveYLabel.Location = new System.Drawing.Point(415, 732); + this.CapTypeActiveYLabel.Name = "CapTypeActiveYLabel"; + this.CapTypeActiveYLabel.Size = new System.Drawing.Size(16, 13); + this.CapTypeActiveYLabel.TabIndex = 206; + this.CapTypeActiveYLabel.Text = "In"; + // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1938,7 +2064,7 @@ namespace grapher private System.Windows.Forms.Label limitLabelY; private System.Windows.Forms.Label offsetLabelY; private System.Windows.Forms.Label weightLabelY; - private System.Windows.Forms.Label capLabelY; + private System.Windows.Forms.Label inCapLabelY; private System.Windows.Forms.Label constantOneLabelY; private System.Windows.Forms.CheckBox ByComponentXYLock; private System.Windows.Forms.Label MidpointActiveYLabel; @@ -1953,10 +2079,10 @@ namespace grapher private System.Windows.Forms.Label MidpointActiveXLabel; private System.Windows.Forms.Label LimitActiveXLabel; private System.Windows.Forms.Label OffsetActiveXLabel; - private System.Windows.Forms.Label CapActiveYLabel; + private System.Windows.Forms.Label InCapActiveYLabel; private System.Windows.Forms.Label WeightActiveYLabel; private System.Windows.Forms.Label WeightActiveXLabel; - private System.Windows.Forms.Label CapActiveXLabel; + private System.Windows.Forms.Label InCapActiveXLabel; private System.Windows.Forms.Label AccelerationActiveLabelX; private System.Windows.Forms.Label AccelTypeActiveLabelX; private System.Windows.Forms.Label RotationActiveLabel; @@ -1966,7 +2092,7 @@ namespace grapher private System.Windows.Forms.Label MouseLabel; private System.Windows.Forms.Label LockXYLabel; private System.Windows.Forms.CheckBox sensXYLock; - private System.Windows.Forms.TextBox capBoxY; + private System.Windows.Forms.TextBox inCapBoxY; private System.Windows.Forms.TextBox VertHorzRatioBox; private System.Windows.Forms.Button writeButton; private System.Windows.Forms.Label offsetLabelX; @@ -1978,8 +2104,8 @@ namespace grapher private System.Windows.Forms.TextBox weightBoxY; private System.Windows.Forms.Label weightLabelX; private System.Windows.Forms.TextBox weightBoxX; - private System.Windows.Forms.Label capLabelX; - private System.Windows.Forms.TextBox capBoxX; + private System.Windows.Forms.Label inCapLabelX; + private System.Windows.Forms.TextBox inCapBoxX; private System.Windows.Forms.Label constantOneLabelX; private System.Windows.Forms.TextBox accelerationBoxX; private System.Windows.Forms.Label rotationLabel; @@ -2070,6 +2196,18 @@ namespace grapher private System.Windows.Forms.TextBox smoothBoxY; private System.Windows.Forms.TextBox smoothBoxX; private System.Windows.Forms.Label VertHorzRatioLabel; + private System.Windows.Forms.ComboBox CapTypeDropdownY; + private System.Windows.Forms.ComboBox CapTypeDropdownX; + private System.Windows.Forms.Label CapTypeLabelY; + private System.Windows.Forms.Label CapTypeLabelX; + private System.Windows.Forms.Label outCapLabelY; + private System.Windows.Forms.Label outCapLabelX; + private System.Windows.Forms.TextBox outCapBoxY; + private System.Windows.Forms.TextBox outCapBoxX; + private System.Windows.Forms.Label OutCapActiveXLabel; + private System.Windows.Forms.Label OutCapActiveYLabel; + private System.Windows.Forms.Label CapTypeActiveYLabel; + private System.Windows.Forms.Label CapTypeActiveXLabel; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 5f2c90e..9eb50cc 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -50,6 +50,8 @@ namespace grapher accelTypeDropY, XLutApplyDropdown, YLutApplyDropdown, + CapTypeDropdownX, + CapTypeDropdownY, writeButton, toggleButton, showVelocityGainToolStripMenuItem, @@ -66,8 +68,10 @@ namespace grapher rotationBox, weightBoxX, weightBoxY, - capBoxX, - capBoxY, + inCapBoxX, + inCapBoxY, + outCapBoxX, + outCapBoxY, offsetBoxX, offsetBoxY, accelerationBoxX, @@ -110,8 +114,12 @@ namespace grapher rotationLabel, weightLabelX, weightLabelY, - capLabelX, - capLabelY, + inCapLabelX, + inCapLabelY, + outCapLabelX, + outCapLabelY, + CapTypeLabelX, + CapTypeLabelY, offsetLabelX, offsetLabelY, constantOneLabelX, @@ -141,8 +149,12 @@ namespace grapher RotationActiveLabel, WeightActiveXLabel, WeightActiveYLabel, - CapActiveXLabel, - CapActiveYLabel, + InCapActiveXLabel, + InCapActiveYLabel, + OutCapActiveXLabel, + OutCapActiveYLabel, + CapTypeActiveXLabel, + CapTypeActiveYLabel, OffsetActiveXLabel, OffsetActiveYLabel, AccelerationActiveLabelX, @@ -243,6 +255,6 @@ namespace grapher } - #endregion Method - } + #endregion Method + } } diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs index fb8fa02..f8fb9ef 100644 --- a/grapher/Layouts/ClassicLayout.cs +++ b/grapher/Layouts/ClassicLayout.cs @@ -11,12 +11,11 @@ namespace grapher.Layouts Mode = AccelMode.classic; GainSwitchOptionLayout = new OptionLayout(true, Gain); - AccelLayout = new OptionLayout(true, Acceleration); + ClassicCapLayout = new OptionLayout(true, CapType); + PowerCapLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(true, Cap); WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index 29d28f7..951052a 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -12,12 +12,11 @@ namespace grapher.Layouts LogarithmicCharts = false; GainSwitchOptionLayout = new OptionLayout(true, Gain); - AccelLayout = new OptionLayout(true, Acceleration); + ClassicCapLayout = new OptionLayout(false, string.Empty); + PowerCapLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(true, DecayRate); GrowthRateLayout = new OptionLayout(true, GrowthRate); SmoothLayout = new OptionLayout(true, Smooth); - ScaleLayout = new OptionLayout(true, Scale); - CapLayout = new OptionLayout(true, Cap); WeightLayout = new OptionLayout(true, Weight); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(true, Limit); diff --git a/grapher/Layouts/JumpLayout.cs b/grapher/Layouts/JumpLayout.cs index 277297c..550e821 100644 --- a/grapher/Layouts/JumpLayout.cs +++ b/grapher/Layouts/JumpLayout.cs @@ -12,12 +12,11 @@ namespace grapher.Layouts LogarithmicCharts = false; GainSwitchOptionLayout = new OptionLayout(true, Gain); - AccelLayout = new OptionLayout(false, string.Empty); + ClassicCapLayout = new OptionLayout(false, string.Empty); + PowerCapLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(true, Smooth); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(true, Cap); WeightLayout = new OptionLayout(false, Weight); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(false, Limit); diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs index 5848adb..2a6e70c 100644 --- a/grapher/Layouts/LUTLayout.cs +++ b/grapher/Layouts/LUTLayout.cs @@ -20,12 +20,11 @@ namespace grapher.Layouts Mode = AccelMode.lut; GainSwitchOptionLayout = new OptionLayout(false, string.Empty); - AccelLayout = new OptionLayout(false, Acceleration); + ClassicCapLayout = new OptionLayout(false, string.Empty); + PowerCapLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(false, Cap); WeightLayout = new OptionLayout(false, Weight); OffsetLayout = new OptionLayout(false, Offset); LimitLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 66260eb..f16be64 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -15,18 +15,18 @@ namespace grapher.Layouts public const string Motivity = "Motivity"; public const string Offset = "Offset"; public const string Cap = "Cap"; + public const string CapType = "Cap Type"; public const string Weight = "Weight"; public const string Smooth = "Smooth"; public const string Gain = "Gain"; public LayoutBase() { - AccelLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(false, string.Empty); + ClassicCapLayout = new OptionLayout(false, string.Empty); + PowerCapLayout = new OptionLayout(false, string.Empty); WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); @@ -49,17 +49,15 @@ namespace grapher.Layouts public bool LogarithmicCharts { get; protected set; } - protected OptionLayout AccelLayout { get; set; } - protected OptionLayout DecayRateLayout { get; set; } protected OptionLayout GrowthRateLayout { get; set; } protected OptionLayout SmoothLayout { get; set; } - protected OptionLayout ScaleLayout { get; set; } + protected OptionLayout ClassicCapLayout { get; set; } - protected OptionLayout CapLayout { get; set; } + protected OptionLayout PowerCapLayout { get; set; } protected OptionLayout WeightLayout { get; set; } @@ -88,12 +86,11 @@ namespace grapher.Layouts public void Layout( IOption gainSwitchOption, - IOption accelOption, + IOption classicCapOption, + IOption powerCapOption, IOption decayRateOption, IOption growthRateOption, IOption smoothOption, - IOption scaleOption, - IOption capOption, IOption weightOption, IOption offsetOption, IOption limitOption, @@ -110,12 +107,12 @@ namespace grapher.Layouts foreach (var option in new (OptionLayout, IOption)[] { (GainSwitchOptionLayout, gainSwitchOption), - (AccelLayout, accelOption), + (ClassicCapLayout, classicCapOption), + (PowerCapLayout, powerCapOption), + (GainSwitchOptionLayout, gainSwitchOption), (DecayRateLayout, decayRateOption), (GrowthRateLayout, growthRateOption), (SmoothLayout, smoothOption), - (ScaleLayout, scaleOption), - (CapLayout, capOption), (WeightLayout, weightOption), (OffsetLayout, offsetOption), (LimitLayout, limitOption), @@ -146,12 +143,11 @@ namespace grapher.Layouts public void Layout( IOption gainSwitchOption, - IOption accelOption, + IOption classicCapOption, + IOption powerCapOption, IOption decayRateOption, IOption growthRateOption, IOption smoothOption, - IOption scaleOption, - IOption capOption, IOption weightOption, IOption offsetOption, IOption limitOption, @@ -163,12 +159,11 @@ namespace grapher.Layouts IOption lutApplyOption) { Layout(gainSwitchOption, - accelOption, + classicCapOption, + powerCapOption, decayRateOption, growthRateOption, smoothOption, - scaleOption, - capOption, weightOption, offsetOption, limitOption, @@ -178,7 +173,7 @@ namespace grapher.Layouts lutTextOption, lutPanelOption, lutApplyOption, - accelOption.Top); + gainSwitchOption.Top); } } } diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index 6108a0b..36b0f74 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -14,12 +14,11 @@ namespace grapher.Layouts LogarithmicCharts = false; GainSwitchOptionLayout = new OptionLayout(true, Gain); - AccelLayout = new OptionLayout(true, Acceleration); + ClassicCapLayout = new OptionLayout(true, CapType); + PowerCapLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(true, Cap); WeightLayout = new OptionLayout(false, Weight); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/MotivityLayout.cs b/grapher/Layouts/MotivityLayout.cs index 5443715..d47926a 100644 --- a/grapher/Layouts/MotivityLayout.cs +++ b/grapher/Layouts/MotivityLayout.cs @@ -17,12 +17,11 @@ namespace grapher.Layouts LogarithmicCharts = true; GainSwitchOptionLayout = new OptionLayout(true, Gain); - AccelLayout = new OptionLayout(false, string.Empty); + ClassicCapLayout = new OptionLayout(false, string.Empty); + PowerCapLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(true, GrowthRate); SmoothLayout = new OptionLayout(false, string.Empty); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(false, string.Empty); WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(true, Motivity); diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index 15166cb..d763b3b 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -12,12 +12,11 @@ namespace grapher.Layouts LogarithmicCharts = false; GainSwitchOptionLayout = new OptionLayout(true, Gain); - AccelLayout = new OptionLayout(false, string.Empty); + ClassicCapLayout = new OptionLayout(false, string.Empty); + PowerCapLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(true, DecayRate); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(false, string.Empty); WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(true, Limit); diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index d742ef8..b696988 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -12,12 +12,11 @@ namespace grapher.Layouts LogarithmicCharts = false; GainSwitchOptionLayout = new OptionLayout(false, string.Empty); - AccelLayout = new OptionLayout(false, string.Empty); + ClassicCapLayout = new OptionLayout(false, string.Empty); + PowerCapLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(false, string.Empty); WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index d11480f..a1b7e67 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -10,12 +10,11 @@ LogarithmicCharts = false; GainSwitchOptionLayout = new OptionLayout(true, Gain); - AccelLayout = new OptionLayout(false, string.Empty); + ClassicCapLayout = new OptionLayout(false, string.Empty); + PowerCapLayout = new OptionLayout(true, CapType); DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - ScaleLayout = new OptionLayout(true, Scale); - CapLayout = new OptionLayout(true, Cap); WeightLayout = new OptionLayout(true, Weight); OffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/UnsupportedLayout.cs b/grapher/Layouts/UnsupportedLayout.cs index 4a401a4..3cf1d41 100644 --- a/grapher/Layouts/UnsupportedLayout.cs +++ b/grapher/Layouts/UnsupportedLayout.cs @@ -17,12 +17,11 @@ namespace grapher.Layouts Mode = AccelMode.noaccel + 1; GainSwitchOptionLayout = new OptionLayout(false, string.Empty); - AccelLayout = new OptionLayout(false, Acceleration); + ClassicCapLayout = new OptionLayout(false, string.Empty); + PowerCapLayout = new OptionLayout(false, string.Empty); DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - ScaleLayout = new OptionLayout(false, string.Empty); - CapLayout = new OptionLayout(false, Cap); WeightLayout = new OptionLayout(false, Weight); OffsetLayout = new OptionLayout(false, Offset); LimitLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 20040fb..156606e 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -2,6 +2,7 @@ using grapher.Models.Devices; using grapher.Models.Mouse; using grapher.Models.Options; +using grapher.Models.Options.Cap; using grapher.Models.Options.Directionality; using grapher.Models.Options.LUT; using grapher.Models.Serialized; @@ -27,6 +28,8 @@ namespace grapher.Models ComboBox accelTypeDropY, ComboBox lutApplyDropdownX, ComboBox lutApplyDropdownY, + ComboBox capTypeDropdownX, + ComboBox capTypeDropdownY, Button writeButton, ButtonBase toggleButton, ToolStripMenuItem showVelocityGainToolStripMenuItem, @@ -43,8 +46,10 @@ namespace grapher.Models TextBox rotationBox, TextBox weightBoxX, TextBox weightBoxY, - TextBox capBoxX, - TextBox capBoxY, + TextBox inCapBoxX, + TextBox inCapBoxY, + TextBox outCapBoxX, + TextBox outCapBoxY, TextBox offsetBoxX, TextBox offsetBoxY, TextBox accelerationBoxX, @@ -87,8 +92,12 @@ namespace grapher.Models Label rotationLabel, Label weightLabelX, Label weightLabelY, - Label capLabelX, - Label capLabelY, + Label inCapLabelX, + Label inCapLabelY, + Label outCapLabelX, + Label outCapLabelY, + Label capTypeLabelX, + Label capTypeLabelY, Label offsetLabelX, Label offsetLabelY, Label constantOneLabelX, @@ -118,8 +127,12 @@ namespace grapher.Models Label rotationActiveLabel, Label weightActiveXLabel, Label weightActiveYLabel, - Label capActiveXLabel, - Label capActiveYLabel, + Label inCapActiveXLabel, + Label inCapActiveYLabel, + Label outCapActiveXLabel, + Label outCapActiveYLabel, + Label capTypeActiveXLabel, + Label capTypeActiveYLabel, Label offsetActiveLabelX, Label offsetActiveLabelY, Label accelerationActiveLabelX, @@ -234,24 +247,6 @@ namespace grapher.Models new ActiveValueLabel(weightActiveYLabel, activeValueTitleY), "Weight"); - var capX = new Option( - capBoxX, - form, - 0, - capLabelX, - 0, - new ActiveValueLabel(capActiveXLabel, activeValueTitleX), - "Cap"); - - var capY = new Option( - capBoxY, - form, - 0, - capLabelY, - optionSetYLeft, - new ActiveValueLabel(capActiveYLabel, activeValueTitleY), - "Cap"); - var offsetX = new Option( offsetBoxX, form, @@ -378,6 +373,76 @@ namespace grapher.Models new ActiveValueLabel(midpointActiveLabelY, activeValueTitleY), optionSetYLeft); + var inCapX = new Option( + inCapBoxX, + form, + 0, + inCapLabelX, + 0, + new ActiveValueLabel(inCapActiveXLabel, activeValueTitleX), + "Cap: Input"); + + var inCapY = new Option( + inCapBoxY, + form, + 0, + inCapLabelY, + optionSetYLeft, + new ActiveValueLabel(inCapActiveYLabel, activeValueTitleY), + "Cap"); + + var outCapX = new Option( + outCapBoxX, + form, + 0, + outCapLabelX, + 0, + new ActiveValueLabel(outCapActiveXLabel, activeValueTitleX), + "Cap: Input"); + + var outCapY = new Option( + outCapBoxY, + form, + 0, + outCapLabelY, + optionSetYLeft, + new ActiveValueLabel(outCapActiveYLabel, activeValueTitleY), + "Cap"); + + var capTypeX = new CapTypeOptions( + capTypeLabelX, + capTypeDropdownX, + new ActiveValueLabel(capTypeActiveXLabel, activeValueTitleX)); + + var capTypeY = new CapTypeOptions( + capTypeLabelY, + capTypeDropdownY, + new ActiveValueLabel(capTypeActiveYLabel, activeValueTitleY)); + + var accelCapOptionsX = new CapOptions( + capTypeX, + inCapX, + outCapX, + accelerationX); + + var accelCapOptionsY = new CapOptions( + capTypeY, + inCapY, + outCapY, + accelerationY); + + var powerCapOptionsX = new CapOptions( + capTypeX, + inCapX, + outCapX, + accelerationX); + + var powerCapOptionsY = new CapOptions( + capTypeY, + inCapY, + outCapY, + accelerationY); + var lpNorm = new Option( new Field(lpNormBox, form, 2), lpNormLabel, @@ -421,12 +486,11 @@ namespace grapher.Models var accelerationOptionsX = new AccelTypeOptions( accelTypeDropX, gainSwitchOptionX, - accelerationX, + accelCapOptionsX, + powerCapOptionsX, decayRateX, growthRateX, smoothX, - scaleX, - capX, weightX, offsetX, limitX, @@ -445,12 +509,11 @@ namespace grapher.Models var accelerationOptionsY = new AccelTypeOptions( accelTypeDropY, gainSwitchOptionY, - accelerationY, + accelCapOptionsY, + powerCapOptionsY, decayRateY, growthRateY, smoothY, - scaleY, - capY, weightY, offsetY, limitY, diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index eab38a1..9086b41 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.Options.Cap; using grapher.Models.Options.LUT; using grapher.Models.Serialized; using System; @@ -29,12 +30,11 @@ namespace grapher public AccelTypeOptions( ComboBox accelDropdown, CheckBoxOption gainSwitch, - Option acceleration, + CapOptions classicCap, + CapOptions powerCap, Option decayRate, Option growthRate, Option smooth, - Option scale, - Option cap, Option weight, Option offset, Option limit, @@ -65,12 +65,11 @@ namespace grapher AccelDropdown.SelectedIndexChanged += new System.EventHandler(OnIndexChanged); GainSwitch = gainSwitch; - Acceleration = acceleration; DecayRate = decayRate; GrowthRate = growthRate; Smooth = smooth; - Scale = scale; - Cap = cap; + ClassicCap = classicCap; + PowerCap = powerCap; Weight = weight; Offset = offset; Limit = limit; @@ -85,7 +84,7 @@ namespace grapher AccelTypeActiveValue.Left = AccelDropdown.Left + AccelDropdown.Width; AccelTypeActiveValue.Height = AccelDropdown.Height; - GainSwitch.Left = Acceleration.Field.Left; + GainSwitch.Left = DecayRate.Field.Left; LutPanel.Left = AccelDropdown.Left; LutPanel.Width = AccelDropdown.Width + AccelTypeActiveValue.Width; @@ -108,17 +107,15 @@ namespace grapher public ActiveValueLabel AccelTypeActiveValue { get; } - public Option Acceleration { get; } - public Option DecayRate { get; } public Option GrowthRate { get; } public Option Smooth { get; } - public Option Scale { get; } + public CapOptions ClassicCap { get; } - public Option Cap { get; } + public CapOptions PowerCap { get; } public Option Weight { get; } @@ -228,12 +225,11 @@ namespace grapher AccelTypeActiveValue.Hide(); GainSwitch.Hide(); - Acceleration.Hide(); DecayRate.Hide(); GrowthRate.Hide(); Smooth.Hide(); - Scale.Hide(); - Cap.Hide(); + ClassicCap.Hide(); + PowerCap.Hide(); Weight.Hide(); Offset.Hide(); Limit.Hide(); @@ -263,13 +259,20 @@ namespace grapher AccelTypeActiveValue.SetValue(AccelerationType.ActiveName); GainSwitch.SetActiveValue(args.gain); Weight.SetActiveValue(args.weight); - Cap.SetActiveValue(args.cap.x); + ClassicCap.SetActiveValues( + args.acceleration, + args.cap.x, + args.cap.y, + args.capMode); + PowerCap.SetActiveValues( + args.scale, + args.cap.x, + args.cap.y, + args.capMode); Offset.SetActiveValue(args.offset); - Acceleration.SetActiveValue(args.acceleration); DecayRate.SetActiveValue(args.decayRate); GrowthRate.SetActiveValue(args.growthRate); Smooth.SetActiveValue(args.smooth); - Scale.SetActiveValue(args.scale); Limit.SetActiveValue((args.mode == AccelMode.motivity) ? args.motivity : args.limit); PowerClassic.SetActiveValue(args.exponentClassic); Exponent.SetActiveValue(args.exponentPower); @@ -286,8 +289,8 @@ namespace grapher AccelDropdown.Text = Constants.AccelDropDownDefaultFullText; } - Left = Acceleration.Left + Constants.DropDownLeftSeparation; - Width = Acceleration.Width - Constants.DropDownLeftSeparation; + Left = DecayRate.Left + Constants.DropDownLeftSeparation; + Width = DecayRate.Width - Constants.DropDownLeftSeparation; LutText.Expand(); HandleLUTOptionsOnResize(); @@ -300,8 +303,8 @@ namespace grapher AccelDropdown.Text = Constants.AccelDropDownDefaultShortText; } - Left = Acceleration.Field.Left; - Width = Acceleration.Field.Width; + Left = DecayRate.Field.Left; + Width = DecayRate.Field.Width; LutText.Shorten(); } @@ -311,13 +314,23 @@ namespace grapher args.mode = AccelerationType.Mode; args.gain = GainSwitch.CheckBox.Checked; - if (Acceleration.Visible) args.acceleration = Acceleration.Field.Data; if (DecayRate.Visible) args.decayRate = DecayRate.Field.Data; if (GrowthRate.Visible) args.growthRate = GrowthRate.Field.Data; if (Smooth.Visible) args.smooth = Smooth.Field.Data; - if (Scale.Visible) args.scale = Scale.Field.Data; - // TODO - make field for output and in_out cap - if (Cap.Visible) args.cap.x = Cap.Field.Data; + if (ClassicCap.Visible) + { + args.acceleration = ClassicCap.Slope.Field.Data; + args.cap.x = ClassicCap.In.Field.Data; + args.cap.y = ClassicCap.Out.Field.Data; + args.capMode = ClassicCap.CapTypeOptions.GetSelectedCapMode(); + } + if (PowerCap.Visible) + { + args.scale = ClassicCap.Slope.Field.Data; + args.cap.x = PowerCap.In.Field.Data; + args.cap.y = PowerCap.Out.Field.Data; + args.capMode = PowerCap.CapTypeOptions.GetSelectedCapMode(); + } if (Limit.Visible) { if (args.mode == AccelMode.motivity) @@ -354,12 +367,11 @@ namespace grapher { AccelTypeActiveValue.Align(); GainSwitch.AlignActiveValues(); - Acceleration.AlignActiveValues(); DecayRate.AlignActiveValues(); GrowthRate.AlignActiveValues(); Smooth.AlignActiveValues(); - Scale.AlignActiveValues(); - Cap.AlignActiveValues(); + ClassicCap.AlignActiveValues(); + PowerCap.AlignActiveValues(); Offset.AlignActiveValues(); Weight.AlignActiveValues(); Limit.AlignActiveValues(); @@ -373,7 +385,7 @@ namespace grapher { LutText.Left = AccelDropdown.Left; LutPanel.Left = GainSwitch.Left - 100; - LutPanel.Width = Acceleration.ActiveValueLabel.CenteringLabel.Right - LutPanel.Left; + LutPanel.Width = DecayRate.ActiveValueLabel.CenteringLabel.Right - LutPanel.Left; LutApply.Left = LutPanel.Left; LutApply.Width = AccelDropdown.Right - LutPanel.Left; } @@ -393,12 +405,11 @@ namespace grapher AccelerationType.Layout( GainSwitch, - Acceleration, + ClassicCap, + PowerCap, DecayRate, GrowthRate, Smooth, - Scale, - Cap, Weight, Offset, Limit, diff --git a/grapher/Models/Options/Cap/CapOptions.cs b/grapher/Models/Options/Cap/CapOptions.cs index 2fe44b0..e959dee 100644 --- a/grapher/Models/Options/Cap/CapOptions.cs +++ b/grapher/Models/Options/Cap/CapOptions.cs @@ -21,6 +21,11 @@ namespace grapher.Models.Options.Cap In = capIn; Out = capOut; Slope = slope; + + ShouldShow = true; + TopElement = Slope; + BottomElement = In; + CapTypeOptions.OptionsDropdown.SelectedIndexChanged += OnCapTypeDropdownSelectedItemChanged; } public CapTypeOptions CapTypeOptions { get; } @@ -45,17 +50,16 @@ namespace grapher.Models.Options.Cap public override int Top { - get => CapTypeOptions.Top; + get => TopElement.Top; set { - CapTypeOptions.Top = value; - Layout(); + Layout(value); } } public override int Height { - get => BottomElement.Top + BottomElement.Height - CapTypeOptions.Top; + get => BottomElement.Top + BottomElement.Height - TopElement.Top; } public override int Width @@ -73,45 +77,100 @@ namespace grapher.Models.Options.Cap public override bool Visible { - get => CapTypeOptions.Visible; + get => ShouldShow; + } + + private bool ShouldShow { get; set; } + + private IOption BottomElement { get; set; } + + private IOption TopElement { get; set; } + + public override void AlignActiveValues() + { + Slope.AlignActiveValues(); + CapTypeOptions.AlignActiveValues(); + In.AlignActiveValues(); + Out.AlignActiveValues(); + } + + public override void Show(string name) + { + ShouldShow = true; + Layout(Top, name); } - private Option BottomElement { get; set; } + public override void Hide() + { + ShouldShow = false; + CapTypeOptions.Hide(); + Slope.Hide(); + In.Hide(); + Out.Hide(); + } - public void Layout() + public void SetActiveValues( + double scale, + double inCap, + double outCap, + ClassicCapMode capMode) { - Layout(CapTypeOptions.Top + CapTypeOptions.Height + Constants.OptionVerticalSeperation); + Slope.SetActiveValue(scale); + In.SetActiveValue(inCap); + Out.SetActiveValue(outCap); + CapTypeOptions.SetActiveValue(capMode); } - private void Layout(int top) + private void Layout(int top, string name = null) { switch (CapTypeOptions.SelectedCapType) { case CapType.Input: - Slope.Show(); - In.Show(); - Out.Hide(); + if (ShouldShow) + { + Slope.Show(); + CapTypeOptions.Show(name); + In.Show(); + Out.Hide(); + } Slope.Top = top; - In.SnapTo(Slope); + CapTypeOptions.SnapTo(Slope); + In.SnapTo(CapTypeOptions); + + TopElement = CapTypeOptions; BottomElement = In; break; case CapType.Output: - Slope.Show(); - In.Hide(); - Out.Show(); + if (ShouldShow) + { + Slope.Show(); + CapTypeOptions.Show(name); + In.Hide(); + Out.Show(); + } Slope.Top = top; - In.SnapTo(Slope); - BottomElement = In; + CapTypeOptions.SnapTo(Slope); + Out.SnapTo(CapTypeOptions); + + TopElement = CapTypeOptions; + BottomElement = Out; break; case CapType.Both: - Slope.Hide(); - In.Show(); - Out.Show(); - - In.Top = top; + if (ShouldShow) + { + CapTypeOptions.Show(name); + Slope.Hide(); + In.Show(); + Out.Show(); + } + + CapTypeOptions.Top = top; + In.SnapTo(CapTypeOptions); Out.SnapTo(In); + + TopElement = In; BottomElement = Out; break; } @@ -119,7 +178,7 @@ namespace grapher.Models.Options.Cap private void OnCapTypeDropdownSelectedItemChanged(object sender, EventArgs e) { - Layout(); + Layout(Top); } private void SetupCapTypeDropdown(ComboBox capTypeDropDown) diff --git a/grapher/Models/Options/Cap/CapTypeOptions.cs b/grapher/Models/Options/Cap/CapTypeOptions.cs index 4ea372b..f0c5617 100644 --- a/grapher/Models/Options/Cap/CapTypeOptions.cs +++ b/grapher/Models/Options/Cap/CapTypeOptions.cs @@ -97,6 +97,17 @@ namespace grapher.Models.Options.Cap } } + public ClassicCapMode GetSelectedCapMode() + { + switch(SelectedCapType) + { + case CapType.Output: return ClassicCapMode.output; + case CapType.Both: return ClassicCapMode.in_out; + case CapType.Input: + default: return ClassicCapMode.input; + } + } + #endregion Properties #region Methods -- cgit v1.2.3 From 8878091a2cab77b0433daea7a47033e1c35e42c1 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Wed, 15 Sep 2021 23:16:43 -0700 Subject: Cap type options now fully working --- grapher/Form1.Designer.cs | 576 +++++++++++++++++--------- grapher/Form1.cs | 54 ++- grapher/Layouts/LayoutBase.cs | 2 - grapher/Layouts/LinearLayout.cs | 1 - grapher/Models/AccelGUIFactory.cs | 188 ++++++--- grapher/Models/Options/AccelTypeOptions.cs | 3 - grapher/Models/Options/Cap/CapOptions.cs | 62 ++- grapher/Models/Options/Cap/CapTypeOptions.cs | 27 +- grapher/Models/Options/ComboBoxOptionsBase.cs | 11 +- 9 files changed, 625 insertions(+), 299 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 532eab4..f162801 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -71,6 +71,18 @@ namespace grapher System.Windows.Forms.DataVisualization.Charting.Title title6 = new System.Windows.Forms.DataVisualization.Charting.Title(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RawAcceleration)); this.optionsPanel = new System.Windows.Forms.Panel(); + this.CapTypeActiveYLabelClassic = new System.Windows.Forms.Label(); + this.CapTypeActiveXLabelClassic = new System.Windows.Forms.Label(); + this.OutCapActiveYLabelClassic = new System.Windows.Forms.Label(); + this.OutCapActiveXLabelClassic = new System.Windows.Forms.Label(); + this.outCapLabelYClassic = new System.Windows.Forms.Label(); + this.outCapLabelXClassic = new System.Windows.Forms.Label(); + this.outCapBoxYClassic = new System.Windows.Forms.TextBox(); + this.outCapBoxXClassic = new System.Windows.Forms.TextBox(); + this.CapTypeLabelYClassic = new System.Windows.Forms.Label(); + this.CapTypeLabelXClassic = new System.Windows.Forms.Label(); + this.CapTypeDropdownYClassic = new System.Windows.Forms.ComboBox(); + this.CapTypeDropdownXClassic = new System.Windows.Forms.ComboBox(); this.VertHorzRatioLabel = new System.Windows.Forms.Label(); this.SmoothActiveYLabel = new System.Windows.Forms.Label(); this.smoothLabelY = new System.Windows.Forms.Label(); @@ -154,7 +166,7 @@ namespace grapher this.limitLabelY = new System.Windows.Forms.Label(); this.offsetLabelY = new System.Windows.Forms.Label(); this.weightLabelY = new System.Windows.Forms.Label(); - this.inCapLabelY = new System.Windows.Forms.Label(); + this.inCapLabelYClassic = new System.Windows.Forms.Label(); this.constantOneLabelY = new System.Windows.Forms.Label(); this.ByComponentXYLock = new System.Windows.Forms.CheckBox(); this.MidpointActiveYLabel = new System.Windows.Forms.Label(); @@ -169,10 +181,10 @@ namespace grapher this.MidpointActiveXLabel = new System.Windows.Forms.Label(); this.LimitActiveXLabel = new System.Windows.Forms.Label(); this.OffsetActiveXLabel = new System.Windows.Forms.Label(); - this.InCapActiveYLabel = new System.Windows.Forms.Label(); + this.InCapActiveYLabelClassic = new System.Windows.Forms.Label(); this.WeightActiveYLabel = new System.Windows.Forms.Label(); this.WeightActiveXLabel = new System.Windows.Forms.Label(); - this.InCapActiveXLabel = new System.Windows.Forms.Label(); + this.InCapActiveXLabelClassic = new System.Windows.Forms.Label(); this.AccelerationActiveLabelX = new System.Windows.Forms.Label(); this.AccelTypeActiveLabelX = new System.Windows.Forms.Label(); this.RotationActiveLabel = new System.Windows.Forms.Label(); @@ -182,7 +194,7 @@ namespace grapher this.MouseLabel = new System.Windows.Forms.Label(); this.LockXYLabel = new System.Windows.Forms.Label(); this.sensXYLock = new System.Windows.Forms.CheckBox(); - this.inCapBoxY = new System.Windows.Forms.TextBox(); + this.inCapBoxYClassic = new System.Windows.Forms.TextBox(); this.VertHorzRatioBox = new System.Windows.Forms.TextBox(); this.writeButton = new System.Windows.Forms.Button(); this.offsetLabelX = new System.Windows.Forms.Label(); @@ -194,8 +206,8 @@ namespace grapher this.weightBoxY = new System.Windows.Forms.TextBox(); this.weightLabelX = new System.Windows.Forms.Label(); this.weightBoxX = new System.Windows.Forms.TextBox(); - this.inCapLabelX = new System.Windows.Forms.Label(); - this.inCapBoxX = new System.Windows.Forms.TextBox(); + this.inCapLabelXClassic = new System.Windows.Forms.Label(); + this.inCapBoxXClassic = new System.Windows.Forms.TextBox(); this.constantOneLabelX = new System.Windows.Forms.Label(); this.accelerationBoxX = new System.Windows.Forms.TextBox(); this.rotationLabel = new System.Windows.Forms.Label(); @@ -224,18 +236,24 @@ namespace grapher this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); - this.CapTypeDropdownX = new System.Windows.Forms.ComboBox(); - this.CapTypeDropdownY = new System.Windows.Forms.ComboBox(); - this.CapTypeLabelX = new System.Windows.Forms.Label(); - this.CapTypeLabelY = new System.Windows.Forms.Label(); - this.outCapBoxX = new System.Windows.Forms.TextBox(); - this.outCapBoxY = new System.Windows.Forms.TextBox(); - this.outCapLabelX = new System.Windows.Forms.Label(); - this.outCapLabelY = new System.Windows.Forms.Label(); - this.OutCapActiveXLabel = new System.Windows.Forms.Label(); - this.OutCapActiveYLabel = new System.Windows.Forms.Label(); - this.CapTypeActiveXLabel = new System.Windows.Forms.Label(); - this.CapTypeActiveYLabel = new System.Windows.Forms.Label(); + this.CapTypeDropdownXPower = new System.Windows.Forms.ComboBox(); + this.CapTypeDropdownYPower = new System.Windows.Forms.ComboBox(); + this.inCapBoxXPower = new System.Windows.Forms.TextBox(); + this.inCapBoxYPower = new System.Windows.Forms.TextBox(); + this.outCapBoxXPower = new System.Windows.Forms.TextBox(); + this.outCapBoxYPower = new System.Windows.Forms.TextBox(); + this.CapTypeLabelXPower = new System.Windows.Forms.Label(); + this.inCapLabelXPower = new System.Windows.Forms.Label(); + this.outCapLabelXPower = new System.Windows.Forms.Label(); + this.CapTypeLabelYPower = new System.Windows.Forms.Label(); + this.inCapLabelYPower = new System.Windows.Forms.Label(); + this.outCapLabelYPower = new System.Windows.Forms.Label(); + this.CapTypeActiveXLabelPower = new System.Windows.Forms.Label(); + this.CapTypeActiveYLabelPower = new System.Windows.Forms.Label(); + this.InCapActiveXLabelPower = new System.Windows.Forms.Label(); + this.OutCapActiveXLabelPower = new System.Windows.Forms.Label(); + this.InCapActiveYLabelPower = new System.Windows.Forms.Label(); + this.OutCapActiveYLabelPower = new System.Windows.Forms.Label(); this.optionsPanel.SuspendLayout(); this.DirectionalityPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -251,18 +269,36 @@ namespace grapher // optionsPanel // this.optionsPanel.AutoSize = true; - this.optionsPanel.Controls.Add(this.CapTypeActiveYLabel); - this.optionsPanel.Controls.Add(this.CapTypeActiveXLabel); - this.optionsPanel.Controls.Add(this.OutCapActiveYLabel); - this.optionsPanel.Controls.Add(this.OutCapActiveXLabel); - this.optionsPanel.Controls.Add(this.outCapLabelY); - this.optionsPanel.Controls.Add(this.outCapLabelX); - this.optionsPanel.Controls.Add(this.outCapBoxY); - this.optionsPanel.Controls.Add(this.outCapBoxX); - this.optionsPanel.Controls.Add(this.CapTypeLabelY); - this.optionsPanel.Controls.Add(this.CapTypeLabelX); - this.optionsPanel.Controls.Add(this.CapTypeDropdownY); - this.optionsPanel.Controls.Add(this.CapTypeDropdownX); + this.optionsPanel.Controls.Add(this.OutCapActiveYLabelPower); + this.optionsPanel.Controls.Add(this.InCapActiveYLabelPower); + this.optionsPanel.Controls.Add(this.OutCapActiveXLabelPower); + this.optionsPanel.Controls.Add(this.InCapActiveXLabelPower); + this.optionsPanel.Controls.Add(this.CapTypeActiveYLabelPower); + this.optionsPanel.Controls.Add(this.CapTypeActiveXLabelPower); + this.optionsPanel.Controls.Add(this.outCapLabelYPower); + this.optionsPanel.Controls.Add(this.inCapLabelYPower); + this.optionsPanel.Controls.Add(this.CapTypeLabelYPower); + this.optionsPanel.Controls.Add(this.outCapLabelXPower); + this.optionsPanel.Controls.Add(this.inCapLabelXPower); + this.optionsPanel.Controls.Add(this.CapTypeLabelXPower); + this.optionsPanel.Controls.Add(this.outCapBoxYPower); + this.optionsPanel.Controls.Add(this.outCapBoxXPower); + this.optionsPanel.Controls.Add(this.inCapBoxYPower); + this.optionsPanel.Controls.Add(this.inCapBoxXPower); + this.optionsPanel.Controls.Add(this.CapTypeDropdownYPower); + this.optionsPanel.Controls.Add(this.CapTypeDropdownXPower); + this.optionsPanel.Controls.Add(this.CapTypeActiveYLabelClassic); + this.optionsPanel.Controls.Add(this.CapTypeActiveXLabelClassic); + this.optionsPanel.Controls.Add(this.OutCapActiveYLabelClassic); + this.optionsPanel.Controls.Add(this.OutCapActiveXLabelClassic); + this.optionsPanel.Controls.Add(this.outCapLabelYClassic); + this.optionsPanel.Controls.Add(this.outCapLabelXClassic); + this.optionsPanel.Controls.Add(this.outCapBoxYClassic); + this.optionsPanel.Controls.Add(this.outCapBoxXClassic); + this.optionsPanel.Controls.Add(this.CapTypeLabelYClassic); + this.optionsPanel.Controls.Add(this.CapTypeLabelXClassic); + this.optionsPanel.Controls.Add(this.CapTypeDropdownYClassic); + this.optionsPanel.Controls.Add(this.CapTypeDropdownXClassic); this.optionsPanel.Controls.Add(this.VertHorzRatioLabel); this.optionsPanel.Controls.Add(this.SmoothActiveYLabel); this.optionsPanel.Controls.Add(this.smoothLabelY); @@ -327,7 +363,7 @@ namespace grapher this.optionsPanel.Controls.Add(this.limitLabelY); this.optionsPanel.Controls.Add(this.offsetLabelY); this.optionsPanel.Controls.Add(this.weightLabelY); - this.optionsPanel.Controls.Add(this.inCapLabelY); + this.optionsPanel.Controls.Add(this.inCapLabelYClassic); this.optionsPanel.Controls.Add(this.constantOneLabelY); this.optionsPanel.Controls.Add(this.ByComponentXYLock); this.optionsPanel.Controls.Add(this.MidpointActiveYLabel); @@ -342,10 +378,10 @@ namespace grapher this.optionsPanel.Controls.Add(this.MidpointActiveXLabel); this.optionsPanel.Controls.Add(this.LimitActiveXLabel); this.optionsPanel.Controls.Add(this.OffsetActiveXLabel); - this.optionsPanel.Controls.Add(this.InCapActiveYLabel); + this.optionsPanel.Controls.Add(this.InCapActiveYLabelClassic); this.optionsPanel.Controls.Add(this.WeightActiveYLabel); this.optionsPanel.Controls.Add(this.WeightActiveXLabel); - this.optionsPanel.Controls.Add(this.InCapActiveXLabel); + this.optionsPanel.Controls.Add(this.InCapActiveXLabelClassic); this.optionsPanel.Controls.Add(this.AccelerationActiveLabelX); this.optionsPanel.Controls.Add(this.AccelTypeActiveLabelX); this.optionsPanel.Controls.Add(this.RotationActiveLabel); @@ -355,7 +391,7 @@ namespace grapher this.optionsPanel.Controls.Add(this.MouseLabel); this.optionsPanel.Controls.Add(this.LockXYLabel); this.optionsPanel.Controls.Add(this.sensXYLock); - this.optionsPanel.Controls.Add(this.inCapBoxY); + this.optionsPanel.Controls.Add(this.inCapBoxYClassic); this.optionsPanel.Controls.Add(this.VertHorzRatioBox); this.optionsPanel.Controls.Add(this.writeButton); this.optionsPanel.Controls.Add(this.offsetLabelX); @@ -367,8 +403,8 @@ namespace grapher this.optionsPanel.Controls.Add(this.weightBoxY); this.optionsPanel.Controls.Add(this.weightLabelX); this.optionsPanel.Controls.Add(this.weightBoxX); - this.optionsPanel.Controls.Add(this.inCapLabelX); - this.optionsPanel.Controls.Add(this.inCapBoxX); + this.optionsPanel.Controls.Add(this.inCapLabelXClassic); + this.optionsPanel.Controls.Add(this.inCapBoxXClassic); this.optionsPanel.Controls.Add(this.constantOneLabelX); this.optionsPanel.Controls.Add(this.accelerationBoxX); this.optionsPanel.Controls.Add(this.rotationLabel); @@ -384,6 +420,108 @@ namespace grapher this.optionsPanel.Size = new System.Drawing.Size(483, 956); this.optionsPanel.TabIndex = 34; // + // CapTypeActiveYLabelClassic + // + this.CapTypeActiveYLabelClassic.AutoSize = true; + this.CapTypeActiveYLabelClassic.Location = new System.Drawing.Point(415, 732); + this.CapTypeActiveYLabelClassic.Name = "CapTypeActiveYLabelClassic"; + this.CapTypeActiveYLabelClassic.Size = new System.Drawing.Size(16, 13); + this.CapTypeActiveYLabelClassic.TabIndex = 206; + this.CapTypeActiveYLabelClassic.Text = "In"; + // + // CapTypeActiveXLabelClassic + // + this.CapTypeActiveXLabelClassic.AutoSize = true; + this.CapTypeActiveXLabelClassic.Location = new System.Drawing.Point(200, 728); + this.CapTypeActiveXLabelClassic.Name = "CapTypeActiveXLabelClassic"; + this.CapTypeActiveXLabelClassic.Size = new System.Drawing.Size(16, 13); + this.CapTypeActiveXLabelClassic.TabIndex = 205; + this.CapTypeActiveXLabelClassic.Text = "In"; + // + // OutCapActiveYLabelClassic + // + this.OutCapActiveYLabelClassic.AutoSize = true; + this.OutCapActiveYLabelClassic.Location = new System.Drawing.Point(414, 757); + this.OutCapActiveYLabelClassic.Name = "OutCapActiveYLabelClassic"; + this.OutCapActiveYLabelClassic.Size = new System.Drawing.Size(13, 13); + this.OutCapActiveYLabelClassic.TabIndex = 204; + this.OutCapActiveYLabelClassic.Text = "0"; + // + // OutCapActiveXLabelClassic + // + this.OutCapActiveXLabelClassic.AutoSize = true; + this.OutCapActiveXLabelClassic.Location = new System.Drawing.Point(200, 757); + this.OutCapActiveXLabelClassic.Name = "OutCapActiveXLabelClassic"; + this.OutCapActiveXLabelClassic.Size = new System.Drawing.Size(13, 13); + this.OutCapActiveXLabelClassic.TabIndex = 203; + this.OutCapActiveXLabelClassic.Text = "0"; + // + // outCapLabelYClassic + // + this.outCapLabelYClassic.AutoSize = true; + this.outCapLabelYClassic.Location = new System.Drawing.Point(262, 757); + this.outCapLabelYClassic.Name = "outCapLabelYClassic"; + this.outCapLabelYClassic.Size = new System.Drawing.Size(64, 13); + this.outCapLabelYClassic.TabIndex = 202; + this.outCapLabelYClassic.Text = "Cap: Output"; + // + // outCapLabelXClassic + // + this.outCapLabelXClassic.AutoSize = true; + this.outCapLabelXClassic.Location = new System.Drawing.Point(35, 757); + this.outCapLabelXClassic.Name = "outCapLabelXClassic"; + this.outCapLabelXClassic.Size = new System.Drawing.Size(64, 13); + this.outCapLabelXClassic.TabIndex = 201; + this.outCapLabelXClassic.Text = "Cap: Output"; + // + // outCapBoxYClassic + // + this.outCapBoxYClassic.Location = new System.Drawing.Point(332, 754); + this.outCapBoxYClassic.Name = "outCapBoxYClassic"; + this.outCapBoxYClassic.Size = new System.Drawing.Size(76, 20); + this.outCapBoxYClassic.TabIndex = 200; + // + // outCapBoxXClassic + // + this.outCapBoxXClassic.Location = new System.Drawing.Point(106, 754); + this.outCapBoxXClassic.Name = "outCapBoxXClassic"; + this.outCapBoxXClassic.Size = new System.Drawing.Size(76, 20); + this.outCapBoxXClassic.TabIndex = 199; + // + // CapTypeLabelYClassic + // + this.CapTypeLabelYClassic.AutoSize = true; + this.CapTypeLabelYClassic.Location = new System.Drawing.Point(263, 729); + this.CapTypeLabelYClassic.Name = "CapTypeLabelYClassic"; + this.CapTypeLabelYClassic.Size = new System.Drawing.Size(53, 13); + this.CapTypeLabelYClassic.TabIndex = 198; + this.CapTypeLabelYClassic.Text = "Cap Type"; + // + // CapTypeLabelXClassic + // + this.CapTypeLabelXClassic.AutoSize = true; + this.CapTypeLabelXClassic.Location = new System.Drawing.Point(38, 728); + this.CapTypeLabelXClassic.Name = "CapTypeLabelXClassic"; + this.CapTypeLabelXClassic.Size = new System.Drawing.Size(53, 13); + this.CapTypeLabelXClassic.TabIndex = 197; + this.CapTypeLabelXClassic.Text = "Cap Type"; + // + // CapTypeDropdownYClassic + // + this.CapTypeDropdownYClassic.FormattingEnabled = true; + this.CapTypeDropdownYClassic.Location = new System.Drawing.Point(332, 725); + this.CapTypeDropdownYClassic.Name = "CapTypeDropdownYClassic"; + this.CapTypeDropdownYClassic.Size = new System.Drawing.Size(76, 21); + this.CapTypeDropdownYClassic.TabIndex = 196; + // + // CapTypeDropdownXClassic + // + this.CapTypeDropdownXClassic.FormattingEnabled = true; + this.CapTypeDropdownXClassic.Location = new System.Drawing.Point(106, 726); + this.CapTypeDropdownXClassic.Name = "CapTypeDropdownXClassic"; + this.CapTypeDropdownXClassic.Size = new System.Drawing.Size(76, 21); + this.CapTypeDropdownXClassic.TabIndex = 195; + // // VertHorzRatioLabel // this.VertHorzRatioLabel.AutoSize = true; @@ -1122,14 +1260,14 @@ namespace grapher this.weightLabelY.TabIndex = 134; this.weightLabelY.Text = "Weight"; // - // inCapLabelY + // inCapLabelYClassic // - this.inCapLabelY.AutoSize = true; - this.inCapLabelY.Location = new System.Drawing.Point(263, 196); - this.inCapLabelY.Name = "inCapLabelY"; - this.inCapLabelY.Size = new System.Drawing.Size(56, 13); - this.inCapLabelY.TabIndex = 133; - this.inCapLabelY.Text = "Cap: Input"; + this.inCapLabelYClassic.AutoSize = true; + this.inCapLabelYClassic.Location = new System.Drawing.Point(263, 196); + this.inCapLabelYClassic.Name = "inCapLabelYClassic"; + this.inCapLabelYClassic.Size = new System.Drawing.Size(56, 13); + this.inCapLabelYClassic.TabIndex = 133; + this.inCapLabelYClassic.Text = "Cap: Input"; // // constantOneLabelY // @@ -1251,14 +1389,14 @@ namespace grapher this.OffsetActiveXLabel.TabIndex = 125; this.OffsetActiveXLabel.Text = "0"; // - // InCapActiveYLabel + // InCapActiveYLabelClassic // - this.InCapActiveYLabel.AutoSize = true; - this.InCapActiveYLabel.Location = new System.Drawing.Point(414, 196); - this.InCapActiveYLabel.Name = "InCapActiveYLabel"; - this.InCapActiveYLabel.Size = new System.Drawing.Size(13, 13); - this.InCapActiveYLabel.TabIndex = 124; - this.InCapActiveYLabel.Text = "0"; + this.InCapActiveYLabelClassic.AutoSize = true; + this.InCapActiveYLabelClassic.Location = new System.Drawing.Point(414, 196); + this.InCapActiveYLabelClassic.Name = "InCapActiveYLabelClassic"; + this.InCapActiveYLabelClassic.Size = new System.Drawing.Size(13, 13); + this.InCapActiveYLabelClassic.TabIndex = 124; + this.InCapActiveYLabelClassic.Text = "0"; // // WeightActiveYLabel // @@ -1278,14 +1416,14 @@ namespace grapher this.WeightActiveXLabel.TabIndex = 122; this.WeightActiveXLabel.Text = "0"; // - // InCapActiveXLabel + // InCapActiveXLabelClassic // - this.InCapActiveXLabel.AutoSize = true; - this.InCapActiveXLabel.Location = new System.Drawing.Point(197, 196); - this.InCapActiveXLabel.Name = "InCapActiveXLabel"; - this.InCapActiveXLabel.Size = new System.Drawing.Size(13, 13); - this.InCapActiveXLabel.TabIndex = 121; - this.InCapActiveXLabel.Text = "0"; + this.InCapActiveXLabelClassic.AutoSize = true; + this.InCapActiveXLabelClassic.Location = new System.Drawing.Point(197, 196); + this.InCapActiveXLabelClassic.Name = "InCapActiveXLabelClassic"; + this.InCapActiveXLabelClassic.Size = new System.Drawing.Size(13, 13); + this.InCapActiveXLabelClassic.TabIndex = 121; + this.InCapActiveXLabelClassic.Text = "0"; // // AccelerationActiveLabelX // @@ -1370,12 +1508,12 @@ namespace grapher this.sensXYLock.TabIndex = 82; this.sensXYLock.UseVisualStyleBackColor = true; // - // inCapBoxY + // inCapBoxYClassic // - this.inCapBoxY.Location = new System.Drawing.Point(332, 193); - this.inCapBoxY.Name = "inCapBoxY"; - this.inCapBoxY.Size = new System.Drawing.Size(76, 20); - this.inCapBoxY.TabIndex = 103; + this.inCapBoxYClassic.Location = new System.Drawing.Point(332, 193); + this.inCapBoxYClassic.Name = "inCapBoxYClassic"; + this.inCapBoxYClassic.Size = new System.Drawing.Size(76, 20); + this.inCapBoxYClassic.TabIndex = 103; // // VertHorzRatioBox // @@ -1469,22 +1607,22 @@ namespace grapher this.weightBoxX.Size = new System.Drawing.Size(76, 20); this.weightBoxX.TabIndex = 90; // - // inCapLabelX + // inCapLabelXClassic // - this.inCapLabelX.AutoSize = true; - this.inCapLabelX.Location = new System.Drawing.Point(37, 196); - this.inCapLabelX.Name = "inCapLabelX"; - this.inCapLabelX.Size = new System.Drawing.Size(56, 13); - this.inCapLabelX.TabIndex = 94; - this.inCapLabelX.Text = "Cap: Input"; - this.inCapLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.inCapLabelXClassic.AutoSize = true; + this.inCapLabelXClassic.Location = new System.Drawing.Point(37, 196); + this.inCapLabelXClassic.Name = "inCapLabelXClassic"; + this.inCapLabelXClassic.Size = new System.Drawing.Size(56, 13); + this.inCapLabelXClassic.TabIndex = 94; + this.inCapLabelXClassic.Text = "Cap: Input"; + this.inCapLabelXClassic.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // inCapBoxX + // inCapBoxXClassic // - this.inCapBoxX.Location = new System.Drawing.Point(106, 193); - this.inCapBoxX.Name = "inCapBoxX"; - this.inCapBoxX.Size = new System.Drawing.Size(76, 20); - this.inCapBoxX.TabIndex = 89; + this.inCapBoxXClassic.Location = new System.Drawing.Point(106, 193); + this.inCapBoxXClassic.Name = "inCapBoxXClassic"; + this.inCapBoxXClassic.Size = new System.Drawing.Size(76, 20); + this.inCapBoxXClassic.TabIndex = 89; // // constantOneLabelX // @@ -1911,107 +2049,157 @@ namespace grapher title6.Text = "Sensitivity"; this.AccelerationChart.Titles.Add(title6); // - // CapTypeDropdownX - // - this.CapTypeDropdownX.FormattingEnabled = true; - this.CapTypeDropdownX.Location = new System.Drawing.Point(106, 726); - this.CapTypeDropdownX.Name = "CapTypeDropdownX"; - this.CapTypeDropdownX.Size = new System.Drawing.Size(76, 21); - this.CapTypeDropdownX.TabIndex = 195; - // - // CapTypeDropdownY - // - this.CapTypeDropdownY.FormattingEnabled = true; - this.CapTypeDropdownY.Location = new System.Drawing.Point(332, 725); - this.CapTypeDropdownY.Name = "CapTypeDropdownY"; - this.CapTypeDropdownY.Size = new System.Drawing.Size(76, 21); - this.CapTypeDropdownY.TabIndex = 196; - // - // CapTypeLabelX - // - this.CapTypeLabelX.AutoSize = true; - this.CapTypeLabelX.Location = new System.Drawing.Point(38, 728); - this.CapTypeLabelX.Name = "CapTypeLabelX"; - this.CapTypeLabelX.Size = new System.Drawing.Size(53, 13); - this.CapTypeLabelX.TabIndex = 197; - this.CapTypeLabelX.Text = "Cap Type"; - // - // CapTypeLabelY - // - this.CapTypeLabelY.AutoSize = true; - this.CapTypeLabelY.Location = new System.Drawing.Point(263, 729); - this.CapTypeLabelY.Name = "CapTypeLabelY"; - this.CapTypeLabelY.Size = new System.Drawing.Size(53, 13); - this.CapTypeLabelY.TabIndex = 198; - this.CapTypeLabelY.Text = "Cap Type"; - // - // outCapBoxX - // - this.outCapBoxX.Location = new System.Drawing.Point(106, 754); - this.outCapBoxX.Name = "outCapBoxX"; - this.outCapBoxX.Size = new System.Drawing.Size(76, 20); - this.outCapBoxX.TabIndex = 199; - // - // outCapBoxY - // - this.outCapBoxY.Location = new System.Drawing.Point(332, 754); - this.outCapBoxY.Name = "outCapBoxY"; - this.outCapBoxY.Size = new System.Drawing.Size(76, 20); - this.outCapBoxY.TabIndex = 200; - // - // outCapLabelX - // - this.outCapLabelX.AutoSize = true; - this.outCapLabelX.Location = new System.Drawing.Point(35, 757); - this.outCapLabelX.Name = "outCapLabelX"; - this.outCapLabelX.Size = new System.Drawing.Size(64, 13); - this.outCapLabelX.TabIndex = 201; - this.outCapLabelX.Text = "Cap: Output"; - // - // outCapLabelY + // CapTypeDropdownXPower // - this.outCapLabelY.AutoSize = true; - this.outCapLabelY.Location = new System.Drawing.Point(262, 757); - this.outCapLabelY.Name = "outCapLabelY"; - this.outCapLabelY.Size = new System.Drawing.Size(64, 13); - this.outCapLabelY.TabIndex = 202; - this.outCapLabelY.Text = "Cap: Output"; + this.CapTypeDropdownXPower.FormattingEnabled = true; + this.CapTypeDropdownXPower.Location = new System.Drawing.Point(106, 780); + this.CapTypeDropdownXPower.Name = "CapTypeDropdownXPower"; + this.CapTypeDropdownXPower.Size = new System.Drawing.Size(76, 21); + this.CapTypeDropdownXPower.TabIndex = 207; // - // OutCapActiveXLabel + // CapTypeDropdownYPower // - this.OutCapActiveXLabel.AutoSize = true; - this.OutCapActiveXLabel.Location = new System.Drawing.Point(200, 757); - this.OutCapActiveXLabel.Name = "OutCapActiveXLabel"; - this.OutCapActiveXLabel.Size = new System.Drawing.Size(13, 13); - this.OutCapActiveXLabel.TabIndex = 203; - this.OutCapActiveXLabel.Text = "0"; + this.CapTypeDropdownYPower.FormattingEnabled = true; + this.CapTypeDropdownYPower.Location = new System.Drawing.Point(332, 780); + this.CapTypeDropdownYPower.Name = "CapTypeDropdownYPower"; + this.CapTypeDropdownYPower.Size = new System.Drawing.Size(76, 21); + this.CapTypeDropdownYPower.TabIndex = 208; // - // OutCapActiveYLabel + // inCapBoxXPower // - this.OutCapActiveYLabel.AutoSize = true; - this.OutCapActiveYLabel.Location = new System.Drawing.Point(414, 757); - this.OutCapActiveYLabel.Name = "OutCapActiveYLabel"; - this.OutCapActiveYLabel.Size = new System.Drawing.Size(13, 13); - this.OutCapActiveYLabel.TabIndex = 204; - this.OutCapActiveYLabel.Text = "0"; + this.inCapBoxXPower.Location = new System.Drawing.Point(106, 807); + this.inCapBoxXPower.Name = "inCapBoxXPower"; + this.inCapBoxXPower.Size = new System.Drawing.Size(76, 20); + this.inCapBoxXPower.TabIndex = 209; + // + // inCapBoxYPower // - // CapTypeActiveXLabel + this.inCapBoxYPower.Location = new System.Drawing.Point(332, 807); + this.inCapBoxYPower.Name = "inCapBoxYPower"; + this.inCapBoxYPower.Size = new System.Drawing.Size(76, 20); + this.inCapBoxYPower.TabIndex = 210; // - this.CapTypeActiveXLabel.AutoSize = true; - this.CapTypeActiveXLabel.Location = new System.Drawing.Point(200, 728); - this.CapTypeActiveXLabel.Name = "CapTypeActiveXLabel"; - this.CapTypeActiveXLabel.Size = new System.Drawing.Size(16, 13); - this.CapTypeActiveXLabel.TabIndex = 205; - this.CapTypeActiveXLabel.Text = "In"; + // outCapBoxXPower + // + this.outCapBoxXPower.Location = new System.Drawing.Point(106, 833); + this.outCapBoxXPower.Name = "outCapBoxXPower"; + this.outCapBoxXPower.Size = new System.Drawing.Size(76, 20); + this.outCapBoxXPower.TabIndex = 211; // - // CapTypeActiveYLabel + // outCapBoxYPower + // + this.outCapBoxYPower.Location = new System.Drawing.Point(332, 834); + this.outCapBoxYPower.Name = "outCapBoxYPower"; + this.outCapBoxYPower.Size = new System.Drawing.Size(76, 20); + this.outCapBoxYPower.TabIndex = 212; + // + // CapTypeLabelXPower // - this.CapTypeActiveYLabel.AutoSize = true; - this.CapTypeActiveYLabel.Location = new System.Drawing.Point(415, 732); - this.CapTypeActiveYLabel.Name = "CapTypeActiveYLabel"; - this.CapTypeActiveYLabel.Size = new System.Drawing.Size(16, 13); - this.CapTypeActiveYLabel.TabIndex = 206; - this.CapTypeActiveYLabel.Text = "In"; + this.CapTypeLabelXPower.AutoSize = true; + this.CapTypeLabelXPower.Location = new System.Drawing.Point(40, 783); + this.CapTypeLabelXPower.Name = "CapTypeLabelXPower"; + this.CapTypeLabelXPower.Size = new System.Drawing.Size(53, 13); + this.CapTypeLabelXPower.TabIndex = 213; + this.CapTypeLabelXPower.Text = "Cap Type"; + // + // inCapLabelXPower + // + this.inCapLabelXPower.AutoSize = true; + this.inCapLabelXPower.Location = new System.Drawing.Point(38, 810); + this.inCapLabelXPower.Name = "inCapLabelXPower"; + this.inCapLabelXPower.Size = new System.Drawing.Size(56, 13); + this.inCapLabelXPower.TabIndex = 214; + this.inCapLabelXPower.Text = "Cap: Input"; + // + // outCapLabelXPower + // + this.outCapLabelXPower.AutoSize = true; + this.outCapLabelXPower.Location = new System.Drawing.Point(35, 836); + this.outCapLabelXPower.Name = "outCapLabelXPower"; + this.outCapLabelXPower.Size = new System.Drawing.Size(64, 13); + this.outCapLabelXPower.TabIndex = 215; + this.outCapLabelXPower.Text = "Cap: Output"; + // + // CapTypeLabelYPower + // + this.CapTypeLabelYPower.AutoSize = true; + this.CapTypeLabelYPower.Location = new System.Drawing.Point(262, 783); + this.CapTypeLabelYPower.Name = "CapTypeLabelYPower"; + this.CapTypeLabelYPower.Size = new System.Drawing.Size(53, 13); + this.CapTypeLabelYPower.TabIndex = 216; + this.CapTypeLabelYPower.Text = "Cap Type"; + // + // inCapLabelYPower + // + this.inCapLabelYPower.AutoSize = true; + this.inCapLabelYPower.Location = new System.Drawing.Point(262, 810); + this.inCapLabelYPower.Name = "inCapLabelYPower"; + this.inCapLabelYPower.Size = new System.Drawing.Size(56, 13); + this.inCapLabelYPower.TabIndex = 217; + this.inCapLabelYPower.Text = "Cap: Input"; + // + // outCapLabelYPower + // + this.outCapLabelYPower.AutoSize = true; + this.outCapLabelYPower.Location = new System.Drawing.Point(262, 837); + this.outCapLabelYPower.Name = "outCapLabelYPower"; + this.outCapLabelYPower.Size = new System.Drawing.Size(64, 13); + this.outCapLabelYPower.TabIndex = 218; + this.outCapLabelYPower.Text = "Cap: Output"; + // + // CapTypeActiveXLabelPower + // + this.CapTypeActiveXLabelPower.AutoSize = true; + this.CapTypeActiveXLabelPower.Location = new System.Drawing.Point(200, 788); + this.CapTypeActiveXLabelPower.Name = "CapTypeActiveXLabelPower"; + this.CapTypeActiveXLabelPower.Size = new System.Drawing.Size(16, 13); + this.CapTypeActiveXLabelPower.TabIndex = 219; + this.CapTypeActiveXLabelPower.Text = "In"; + // + // CapTypeActiveYLabelPower + // + this.CapTypeActiveYLabelPower.AutoSize = true; + this.CapTypeActiveYLabelPower.Location = new System.Drawing.Point(414, 783); + this.CapTypeActiveYLabelPower.Name = "CapTypeActiveYLabelPower"; + this.CapTypeActiveYLabelPower.Size = new System.Drawing.Size(16, 13); + this.CapTypeActiveYLabelPower.TabIndex = 220; + this.CapTypeActiveYLabelPower.Text = "In"; + // + // InCapActiveXLabelPower + // + this.InCapActiveXLabelPower.AutoSize = true; + this.InCapActiveXLabelPower.Location = new System.Drawing.Point(200, 810); + this.InCapActiveXLabelPower.Name = "InCapActiveXLabelPower"; + this.InCapActiveXLabelPower.Size = new System.Drawing.Size(13, 13); + this.InCapActiveXLabelPower.TabIndex = 221; + this.InCapActiveXLabelPower.Text = "0"; + // + // OutCapActiveXLabelPower + // + this.OutCapActiveXLabelPower.AutoSize = true; + this.OutCapActiveXLabelPower.Location = new System.Drawing.Point(200, 837); + this.OutCapActiveXLabelPower.Name = "OutCapActiveXLabelPower"; + this.OutCapActiveXLabelPower.Size = new System.Drawing.Size(13, 13); + this.OutCapActiveXLabelPower.TabIndex = 222; + this.OutCapActiveXLabelPower.Text = "0"; + // + // InCapActiveYLabelPower + // + this.InCapActiveYLabelPower.AutoSize = true; + this.InCapActiveYLabelPower.Location = new System.Drawing.Point(417, 810); + this.InCapActiveYLabelPower.Name = "InCapActiveYLabelPower"; + this.InCapActiveYLabelPower.Size = new System.Drawing.Size(13, 13); + this.InCapActiveYLabelPower.TabIndex = 223; + this.InCapActiveYLabelPower.Text = "0"; + // + // OutCapActiveYLabelPower + // + this.OutCapActiveYLabelPower.AutoSize = true; + this.OutCapActiveYLabelPower.Location = new System.Drawing.Point(414, 836); + this.OutCapActiveYLabelPower.Name = "OutCapActiveYLabelPower"; + this.OutCapActiveYLabelPower.Size = new System.Drawing.Size(13, 13); + this.OutCapActiveYLabelPower.TabIndex = 224; + this.OutCapActiveYLabelPower.Text = "0"; // // RawAcceleration // @@ -2064,7 +2252,7 @@ namespace grapher private System.Windows.Forms.Label limitLabelY; private System.Windows.Forms.Label offsetLabelY; private System.Windows.Forms.Label weightLabelY; - private System.Windows.Forms.Label inCapLabelY; + private System.Windows.Forms.Label inCapLabelYClassic; private System.Windows.Forms.Label constantOneLabelY; private System.Windows.Forms.CheckBox ByComponentXYLock; private System.Windows.Forms.Label MidpointActiveYLabel; @@ -2079,10 +2267,10 @@ namespace grapher private System.Windows.Forms.Label MidpointActiveXLabel; private System.Windows.Forms.Label LimitActiveXLabel; private System.Windows.Forms.Label OffsetActiveXLabel; - private System.Windows.Forms.Label InCapActiveYLabel; + private System.Windows.Forms.Label InCapActiveYLabelClassic; private System.Windows.Forms.Label WeightActiveYLabel; private System.Windows.Forms.Label WeightActiveXLabel; - private System.Windows.Forms.Label InCapActiveXLabel; + private System.Windows.Forms.Label InCapActiveXLabelClassic; private System.Windows.Forms.Label AccelerationActiveLabelX; private System.Windows.Forms.Label AccelTypeActiveLabelX; private System.Windows.Forms.Label RotationActiveLabel; @@ -2092,7 +2280,7 @@ namespace grapher private System.Windows.Forms.Label MouseLabel; private System.Windows.Forms.Label LockXYLabel; private System.Windows.Forms.CheckBox sensXYLock; - private System.Windows.Forms.TextBox inCapBoxY; + private System.Windows.Forms.TextBox inCapBoxYClassic; private System.Windows.Forms.TextBox VertHorzRatioBox; private System.Windows.Forms.Button writeButton; private System.Windows.Forms.Label offsetLabelX; @@ -2104,8 +2292,8 @@ namespace grapher private System.Windows.Forms.TextBox weightBoxY; private System.Windows.Forms.Label weightLabelX; private System.Windows.Forms.TextBox weightBoxX; - private System.Windows.Forms.Label inCapLabelX; - private System.Windows.Forms.TextBox inCapBoxX; + private System.Windows.Forms.Label inCapLabelXClassic; + private System.Windows.Forms.TextBox inCapBoxXClassic; private System.Windows.Forms.Label constantOneLabelX; private System.Windows.Forms.TextBox accelerationBoxX; private System.Windows.Forms.Label rotationLabel; @@ -2196,18 +2384,36 @@ namespace grapher private System.Windows.Forms.TextBox smoothBoxY; private System.Windows.Forms.TextBox smoothBoxX; private System.Windows.Forms.Label VertHorzRatioLabel; - private System.Windows.Forms.ComboBox CapTypeDropdownY; - private System.Windows.Forms.ComboBox CapTypeDropdownX; - private System.Windows.Forms.Label CapTypeLabelY; - private System.Windows.Forms.Label CapTypeLabelX; - private System.Windows.Forms.Label outCapLabelY; - private System.Windows.Forms.Label outCapLabelX; - private System.Windows.Forms.TextBox outCapBoxY; - private System.Windows.Forms.TextBox outCapBoxX; - private System.Windows.Forms.Label OutCapActiveXLabel; - private System.Windows.Forms.Label OutCapActiveYLabel; - private System.Windows.Forms.Label CapTypeActiveYLabel; - private System.Windows.Forms.Label CapTypeActiveXLabel; + private System.Windows.Forms.ComboBox CapTypeDropdownYClassic; + private System.Windows.Forms.ComboBox CapTypeDropdownXClassic; + private System.Windows.Forms.Label CapTypeLabelYClassic; + private System.Windows.Forms.Label CapTypeLabelXClassic; + private System.Windows.Forms.Label outCapLabelYClassic; + private System.Windows.Forms.Label outCapLabelXClassic; + private System.Windows.Forms.TextBox outCapBoxYClassic; + private System.Windows.Forms.TextBox outCapBoxXClassic; + private System.Windows.Forms.Label OutCapActiveXLabelClassic; + private System.Windows.Forms.Label OutCapActiveYLabelClassic; + private System.Windows.Forms.Label CapTypeActiveYLabelClassic; + private System.Windows.Forms.Label CapTypeActiveXLabelClassic; + private System.Windows.Forms.ComboBox CapTypeDropdownYPower; + private System.Windows.Forms.ComboBox CapTypeDropdownXPower; + private System.Windows.Forms.Label OutCapActiveYLabelPower; + private System.Windows.Forms.Label InCapActiveYLabelPower; + private System.Windows.Forms.Label OutCapActiveXLabelPower; + private System.Windows.Forms.Label InCapActiveXLabelPower; + private System.Windows.Forms.Label CapTypeActiveYLabelPower; + private System.Windows.Forms.Label CapTypeActiveXLabelPower; + private System.Windows.Forms.Label outCapLabelYPower; + private System.Windows.Forms.Label inCapLabelYPower; + private System.Windows.Forms.Label CapTypeLabelYPower; + private System.Windows.Forms.Label outCapLabelXPower; + private System.Windows.Forms.Label inCapLabelXPower; + private System.Windows.Forms.Label CapTypeLabelXPower; + private System.Windows.Forms.TextBox outCapBoxYPower; + private System.Windows.Forms.TextBox outCapBoxXPower; + private System.Windows.Forms.TextBox inCapBoxYPower; + private System.Windows.Forms.TextBox inCapBoxXPower; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 9eb50cc..b41afc2 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -50,8 +50,10 @@ namespace grapher accelTypeDropY, XLutApplyDropdown, YLutApplyDropdown, - CapTypeDropdownX, - CapTypeDropdownY, + CapTypeDropdownXClassic, + CapTypeDropdownYClassic, + CapTypeDropdownXPower, + CapTypeDropdownYPower, writeButton, toggleButton, showVelocityGainToolStripMenuItem, @@ -68,10 +70,14 @@ namespace grapher rotationBox, weightBoxX, weightBoxY, - inCapBoxX, - inCapBoxY, - outCapBoxX, - outCapBoxY, + inCapBoxXClassic, + inCapBoxYClassic, + outCapBoxXClassic, + outCapBoxYClassic, + inCapBoxXPower, + inCapBoxYPower, + outCapBoxXPower, + outCapBoxYPower, offsetBoxX, offsetBoxY, accelerationBoxX, @@ -114,12 +120,18 @@ namespace grapher rotationLabel, weightLabelX, weightLabelY, - inCapLabelX, - inCapLabelY, - outCapLabelX, - outCapLabelY, - CapTypeLabelX, - CapTypeLabelY, + inCapLabelXClassic, + inCapLabelYClassic, + outCapLabelXClassic, + outCapLabelYClassic, + CapTypeLabelXClassic, + CapTypeLabelYClassic, + inCapLabelXPower, + inCapLabelYPower, + outCapLabelXPower, + outCapLabelYPower, + CapTypeLabelXPower, + CapTypeLabelYPower, offsetLabelX, offsetLabelY, constantOneLabelX, @@ -149,12 +161,18 @@ namespace grapher RotationActiveLabel, WeightActiveXLabel, WeightActiveYLabel, - InCapActiveXLabel, - InCapActiveYLabel, - OutCapActiveXLabel, - OutCapActiveYLabel, - CapTypeActiveXLabel, - CapTypeActiveYLabel, + InCapActiveXLabelClassic, + InCapActiveYLabelClassic, + OutCapActiveXLabelClassic, + OutCapActiveYLabelClassic, + CapTypeActiveXLabelClassic, + CapTypeActiveYLabelClassic, + InCapActiveXLabelPower, + InCapActiveYLabelPower, + OutCapActiveXLabelPower, + OutCapActiveYLabelPower, + CapTypeActiveXLabelPower, + CapTypeActiveYLabelPower, OffsetActiveXLabel, OffsetActiveYLabel, AccelerationActiveLabelX, diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index f16be64..4a87504 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -14,7 +14,6 @@ namespace grapher.Layouts public const string Midpoint = "Midpoint"; public const string Motivity = "Motivity"; public const string Offset = "Offset"; - public const string Cap = "Cap"; public const string CapType = "Cap Type"; public const string Weight = "Weight"; public const string Smooth = "Smooth"; @@ -109,7 +108,6 @@ namespace grapher.Layouts (GainSwitchOptionLayout, gainSwitchOption), (ClassicCapLayout, classicCapOption), (PowerCapLayout, powerCapOption), - (GainSwitchOptionLayout, gainSwitchOption), (DecayRateLayout, decayRateOption), (GrowthRateLayout, growthRateOption), (SmoothLayout, smoothOption), diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index 36b0f74..63c5ff6 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -11,7 +11,6 @@ namespace grapher.Layouts { Name = LinearName; Mode = AccelMode.classic; - LogarithmicCharts = false; GainSwitchOptionLayout = new OptionLayout(true, Gain); ClassicCapLayout = new OptionLayout(true, CapType); diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 156606e..4d0a483 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -28,8 +28,10 @@ namespace grapher.Models ComboBox accelTypeDropY, ComboBox lutApplyDropdownX, ComboBox lutApplyDropdownY, - ComboBox capTypeDropdownX, - ComboBox capTypeDropdownY, + ComboBox capTypeDropdownXClassic, + ComboBox capTypeDropdownYClassic, + ComboBox capTypeDropdownXPower, + ComboBox capTypeDropdownYPower, Button writeButton, ButtonBase toggleButton, ToolStripMenuItem showVelocityGainToolStripMenuItem, @@ -46,10 +48,14 @@ namespace grapher.Models TextBox rotationBox, TextBox weightBoxX, TextBox weightBoxY, - TextBox inCapBoxX, - TextBox inCapBoxY, - TextBox outCapBoxX, - TextBox outCapBoxY, + TextBox inCapBoxXClassic, + TextBox inCapBoxYClassic, + TextBox outCapBoxXClassic, + TextBox outCapBoxYClassic, + TextBox inCapBoxXPower, + TextBox inCapBoxYPower, + TextBox outCapBoxXPower, + TextBox outCapBoxYPower, TextBox offsetBoxX, TextBox offsetBoxY, TextBox accelerationBoxX, @@ -92,12 +98,18 @@ namespace grapher.Models Label rotationLabel, Label weightLabelX, Label weightLabelY, - Label inCapLabelX, - Label inCapLabelY, - Label outCapLabelX, - Label outCapLabelY, - Label capTypeLabelX, - Label capTypeLabelY, + Label inCapLabelXClassic, + Label inCapLabelYClassic, + Label outCapLabelXClassic, + Label outCapLabelYClassic, + Label capTypeLabelXClassic, + Label capTypeLabelYClassic, + Label inCapLabelXPower, + Label inCapLabelYPower, + Label outCapLabelXPower, + Label outCapLabelYPower, + Label capTypeLabelXPower, + Label capTypeLabelYPower, Label offsetLabelX, Label offsetLabelY, Label constantOneLabelX, @@ -127,12 +139,18 @@ namespace grapher.Models Label rotationActiveLabel, Label weightActiveXLabel, Label weightActiveYLabel, - Label inCapActiveXLabel, - Label inCapActiveYLabel, - Label outCapActiveXLabel, - Label outCapActiveYLabel, - Label capTypeActiveXLabel, - Label capTypeActiveYLabel, + Label inCapActiveXLabelClassic, + Label inCapActiveYLabelClassic, + Label outCapActiveXLabelClassic, + Label outCapActiveYLabelClassic, + Label capTypeActiveXLabelClassic, + Label capTypeActiveYLabelClassic, + Label inCapActiveXLabelPower, + Label inCapActiveYLabelPower, + Label outCapActiveXLabelPower, + Label outCapActiveYLabelPower, + Label capTypeActiveXLabelPower, + Label capTypeActiveYLabelPower, Label offsetActiveLabelX, Label offsetActiveLabelY, Label accelerationActiveLabelX, @@ -373,75 +391,125 @@ namespace grapher.Models new ActiveValueLabel(midpointActiveLabelY, activeValueTitleY), optionSetYLeft); - var inCapX = new Option( - inCapBoxX, + var inCapXClassic = new Option( + inCapBoxXClassic, form, 0, - inCapLabelX, + inCapLabelXClassic, 0, - new ActiveValueLabel(inCapActiveXLabel, activeValueTitleX), + new ActiveValueLabel(inCapActiveXLabelClassic, activeValueTitleX), "Cap: Input"); - var inCapY = new Option( - inCapBoxY, + var inCapYClassic = new Option( + inCapBoxYClassic, form, 0, - inCapLabelY, + inCapLabelYClassic, optionSetYLeft, - new ActiveValueLabel(inCapActiveYLabel, activeValueTitleY), + new ActiveValueLabel(inCapActiveYLabelClassic, activeValueTitleY), "Cap"); - var outCapX = new Option( - outCapBoxX, + var outCapXClassic = new Option( + outCapBoxXClassic, form, 0, - outCapLabelX, + outCapLabelXClassic, 0, - new ActiveValueLabel(outCapActiveXLabel, activeValueTitleX), + new ActiveValueLabel(outCapActiveXLabelClassic, activeValueTitleX), "Cap: Input"); - var outCapY = new Option( - outCapBoxY, + var outCapYClassic = new Option( + outCapBoxYClassic, form, 0, - outCapLabelY, + outCapLabelYClassic, optionSetYLeft, - new ActiveValueLabel(outCapActiveYLabel, activeValueTitleY), + new ActiveValueLabel(outCapActiveYLabelClassic, activeValueTitleY), "Cap"); - var capTypeX = new CapTypeOptions( - capTypeLabelX, - capTypeDropdownX, - new ActiveValueLabel(capTypeActiveXLabel, activeValueTitleX)); + var capTypeXClassic = new CapTypeOptions( + capTypeLabelXClassic, + capTypeDropdownXClassic, + new ActiveValueLabel(capTypeActiveXLabelClassic, activeValueTitleX), + 0); - var capTypeY = new CapTypeOptions( - capTypeLabelY, - capTypeDropdownY, - new ActiveValueLabel(capTypeActiveYLabel, activeValueTitleY)); + var capTypeYClassic = new CapTypeOptions( + capTypeLabelYClassic, + capTypeDropdownYClassic, + new ActiveValueLabel(capTypeActiveYLabelClassic, activeValueTitleY), + optionSetYLeft); - var accelCapOptionsX = new CapOptions( - capTypeX, - inCapX, - outCapX, + var classicCapOptionsX = new CapOptions( + capTypeXClassic, + inCapXClassic, + outCapXClassic, accelerationX); - var accelCapOptionsY = new CapOptions( - capTypeY, - inCapY, - outCapY, + var classicCapOptionsY = new CapOptions( + capTypeYClassic, + inCapYClassic, + outCapYClassic, accelerationY); + var inCapXPower = new Option( + inCapBoxXPower, + form, + 0, + inCapLabelXPower, + 0, + new ActiveValueLabel(inCapActiveXLabelPower, activeValueTitleX), + "Cap: Input"); + + var inCapYPower = new Option( + inCapBoxYPower, + form, + 0, + inCapLabelYPower, + optionSetYLeft, + new ActiveValueLabel(inCapActiveYLabelPower, activeValueTitleY), + "Cap"); + + var outCapXPower = new Option( + outCapBoxXPower, + form, + 0, + outCapLabelXPower, + 0, + new ActiveValueLabel(outCapActiveXLabelPower, activeValueTitleX), + "Cap: Input"); + + var outCapYPower = new Option( + outCapBoxYPower, + form, + 0, + outCapLabelYPower, + optionSetYLeft, + new ActiveValueLabel(outCapActiveYLabelPower, activeValueTitleY), + "Cap"); + + var capTypeXPower = new CapTypeOptions( + capTypeLabelXPower, + capTypeDropdownXPower, + new ActiveValueLabel(capTypeActiveXLabelPower, activeValueTitleX), + 0); + + var capTypeYPower = new CapTypeOptions( + capTypeLabelYPower, + capTypeDropdownYPower, + new ActiveValueLabel(capTypeActiveYLabelPower, activeValueTitleY), + optionSetYLeft); + var powerCapOptionsX = new CapOptions( - capTypeX, - inCapX, - outCapX, - accelerationX); + capTypeXPower, + inCapXPower, + outCapXPower, + scaleX); var powerCapOptionsY = new CapOptions( - capTypeY, - inCapY, - outCapY, - accelerationY); + capTypeYPower, + inCapYPower, + outCapYPower, + scaleY); var lpNorm = new Option( new Field(lpNormBox, form, 2), @@ -486,7 +554,7 @@ namespace grapher.Models var accelerationOptionsX = new AccelTypeOptions( accelTypeDropX, gainSwitchOptionX, - accelCapOptionsX, + classicCapOptionsX, powerCapOptionsX, decayRateX, growthRateX, @@ -509,7 +577,7 @@ namespace grapher.Models var accelerationOptionsY = new AccelTypeOptions( accelTypeDropY, gainSwitchOptionY, - accelCapOptionsY, + classicCapOptionsY, powerCapOptionsY, decayRateY, growthRateY, diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 9086b41..3d2f840 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -2,10 +2,7 @@ using grapher.Models.Options; using grapher.Models.Options.Cap; using grapher.Models.Options.LUT; -using grapher.Models.Serialized; using System; -using System.Collections.Generic; -using System.Linq; using System.Windows.Forms; namespace grapher diff --git a/grapher/Models/Options/Cap/CapOptions.cs b/grapher/Models/Options/Cap/CapOptions.cs index e959dee..ac34abf 100644 --- a/grapher/Models/Options/Cap/CapOptions.cs +++ b/grapher/Models/Options/Cap/CapOptions.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; using static grapher.Models.Options.Cap.CapTypeOptions; @@ -10,6 +6,20 @@ namespace grapher.Models.Options.Cap { public class CapOptions : OptionBase { + #region Constants + + public const string InCapLabel = "Cap: Input"; + public const string OutCapLabel = "Cap: Output"; + + #endregion Constants + + #region Fields + + private int _top; + + #endregion Fields + + #region Constructors public CapOptions( CapTypeOptions capTypeOptions, @@ -23,11 +33,16 @@ namespace grapher.Models.Options.Cap Slope = slope; ShouldShow = true; - TopElement = Slope; + _top = Slope.Top; BottomElement = In; CapTypeOptions.OptionsDropdown.SelectedIndexChanged += OnCapTypeDropdownSelectedItemChanged; + CapTypeOptions.SelectedCapOption = InCap; } + #endregion Constructors + + #region Properties + public CapTypeOptions CapTypeOptions { get; } public Option In { get; } @@ -50,16 +65,17 @@ namespace grapher.Models.Options.Cap public override int Top { - get => TopElement.Top; + get => _top; set { + _top = value; Layout(value); } } public override int Height { - get => BottomElement.Top + BottomElement.Height - TopElement.Top; + get => BottomElement.Top + BottomElement.Height - Top; } public override int Width @@ -84,7 +100,9 @@ namespace grapher.Models.Options.Cap private IOption BottomElement { get; set; } - private IOption TopElement { get; set; } + #endregion Properties + + #region Methods public override void AlignActiveValues() { @@ -130,7 +148,7 @@ namespace grapher.Models.Options.Cap { Slope.Show(); CapTypeOptions.Show(name); - In.Show(); + ShowInCap(); Out.Hide(); } @@ -138,7 +156,6 @@ namespace grapher.Models.Options.Cap CapTypeOptions.SnapTo(Slope); In.SnapTo(CapTypeOptions); - TopElement = CapTypeOptions; BottomElement = In; break; case CapType.Output: @@ -147,14 +164,13 @@ namespace grapher.Models.Options.Cap Slope.Show(); CapTypeOptions.Show(name); In.Hide(); - Out.Show(); + ShowOutCap(); } Slope.Top = top; CapTypeOptions.SnapTo(Slope); Out.SnapTo(CapTypeOptions); - TopElement = CapTypeOptions; BottomElement = Out; break; case CapType.Both: @@ -162,29 +178,35 @@ namespace grapher.Models.Options.Cap { CapTypeOptions.Show(name); Slope.Hide(); - In.Show(); - Out.Show(); + ShowInCap(); + ShowOutCap(); } CapTypeOptions.Top = top; In.SnapTo(CapTypeOptions); Out.SnapTo(In); - TopElement = In; BottomElement = Out; break; } } - private void OnCapTypeDropdownSelectedItemChanged(object sender, EventArgs e) + private void ShowInCap() { - Layout(Top); + In.Show(InCapLabel); + } + + private void ShowOutCap() + { + Out.Show(OutCapLabel); } - private void SetupCapTypeDropdown(ComboBox capTypeDropDown) + private void OnCapTypeDropdownSelectedItemChanged(object sender, EventArgs e) { - capTypeDropDown.Items.Clear(); - capTypeDropDown.DataSource = Enum.GetValues(typeof(CapType)); + Layout(Top); + CapTypeOptions.CheckIfDefault(); } + + #endregion Methods } } diff --git a/grapher/Models/Options/Cap/CapTypeOptions.cs b/grapher/Models/Options/Cap/CapTypeOptions.cs index f0c5617..1e7bd58 100644 --- a/grapher/Models/Options/Cap/CapTypeOptions.cs +++ b/grapher/Models/Options/Cap/CapTypeOptions.cs @@ -64,7 +64,8 @@ namespace grapher.Models.Options.Cap public CapTypeOptions( Label label, ComboBox dropdown, - ActiveValueLabel activeValueLabel) + ActiveValueLabel activeValueLabel, + int left) : base( label, dropdown, @@ -77,6 +78,13 @@ namespace grapher.Models.Options.Cap OutCap, BothCap }); + + Default = OutCap; + + label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + label.Left = left; + label.Width = OptionsDropdown.Left - left - Constants.OptionLabelBoxSeperation; + label.Height = OptionsDropdown.Height; } #endregion Constructors @@ -97,6 +105,8 @@ namespace grapher.Models.Options.Cap } } + private CapTypeOption Default { get; set; } + public ClassicCapMode GetSelectedCapMode() { switch(SelectedCapType) @@ -128,10 +138,23 @@ namespace grapher.Models.Options.Cap public void SetActiveValue(ClassicCapMode capMode) { - SelectedCapOption = CapTypeOptionFromSettings(capMode); + Default = CapTypeOptionFromSettings(capMode); + SelectedCapOption = Default; ActiveValueLabel.SetValue(SelectedCapOption.Name); } + public void CheckIfDefault() + { + if (SelectedCapOption.Equals(Default)) + { + OptionsDropdown.ForeColor = System.Drawing.Color.Gray; + } + else + { + OptionsDropdown.ForeColor = System.Drawing.Color.Black; + } + } + #endregion Methods } } diff --git a/grapher/Models/Options/ComboBoxOptionsBase.cs b/grapher/Models/Options/ComboBoxOptionsBase.cs index 64e0092..6999e99 100644 --- a/grapher/Models/Options/ComboBoxOptionsBase.cs +++ b/grapher/Models/Options/ComboBoxOptionsBase.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +using System.Windows.Forms; namespace grapher.Models.Options { @@ -61,7 +56,7 @@ namespace grapher.Models.Options { get { - return Label.Height; + return OptionsDropdown.Height; } } @@ -69,7 +64,7 @@ namespace grapher.Models.Options { get { - return Label.Top; + return OptionsDropdown.Top; } set { -- cgit v1.2.3 From 6b3eacb1870480be23aaa25b306da316ac96e6d4 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Mon, 13 Sep 2021 03:39:58 -0400 Subject: add fn for making a shortcut in startup folder --- grapher/Form1.cs | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) (limited to 'grapher') diff --git a/grapher/Form1.cs b/grapher/Form1.cs index b41afc2..32c5c77 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -15,6 +15,7 @@ using grapher.Models.Serialized; using grapher.Models; using System.Reflection; using System.Diagnostics; +using System.IO; namespace grapher { @@ -274,5 +275,67 @@ namespace grapher } #endregion Method - } + + static void MakeStartupShortcut(bool gui) + { + var startupFolder = Environment.GetFolderPath(Environment.SpecialFolder.Startup); + + if (string.IsNullOrEmpty(startupFolder)) + { + throw new Exception("Startup folder does not exist"); + } + + //Windows Script Host Shell Object + Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); + dynamic shell = Activator.CreateInstance(t); + + try + { + // Delete any other RA related startup shortcuts + var candidates = new[] { "rawaccel", "raw accel", "writer" }; + + foreach (string path in Directory.EnumerateFiles(startupFolder, "*.lnk") + .Where(f => candidates.Any(f.Substring(startupFolder.Length).ToLower().Contains))) + { + var link = shell.CreateShortcut(path); + try + { + string targetPath = link.TargetPath; + + if (!(targetPath is null) && + (targetPath.EndsWith("rawaccel.exe") || + targetPath.EndsWith("writer.exe") && + new FileInfo(targetPath).Directory.GetFiles("rawaccel.exe").Any())) + { + File.Delete(path); + } + } + finally + { + Marshal.FinalReleaseComObject(link); + } + } + + var name = gui ? "rawaccel" : "writer"; + + var lnk = shell.CreateShortcut($@"{startupFolder}\{name}.lnk"); + + try + { + if (!gui) lnk.Arguments = Constants.DefaultSettingsFileName; + lnk.TargetPath = $@"{Application.StartupPath}\{name}.exe"; + lnk.Save(); + } + finally + { + Marshal.FinalReleaseComObject(lnk); + } + + } + finally + { + Marshal.FinalReleaseComObject(shell); + } + } + } } -- cgit v1.2.3 From 138ddb54e42e71a384e059afe69e4e8172935d6d Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Mon, 13 Sep 2021 23:00:53 -0400 Subject: fix potential leaks forms displayed with ShowDialog are only hidden when closed; Dispose must be called manually --- grapher/Form1.cs | 7 ++++++- grapher/Models/AccelGUI.cs | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 32c5c77..b5a49c8 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -34,7 +34,12 @@ namespace grapher ToolStripMenuItem HelpMenuItem = new ToolStripMenuItem("&Help"); HelpMenuItem.DropDownItems.AddRange(new ToolStripItem[] { - new ToolStripMenuItem("&About", null, (s, e) => new AboutBox(driverVersion).ShowDialog()) + new ToolStripMenuItem("&About", null, (s, e) => { + using (var form = new AboutBox(driverVersion)) + { + form.ShowDialog(); + } + }) }); menuStrip1.Items.AddRange(new ToolStripItem[] { HelpMenuItem }); diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index e15aba9..1836b65 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -154,7 +154,10 @@ namespace grapher error_message = e.Message; } - new MessageDialog(error_message, "bad input").ShowDialog(); + using (var form = new MessageDialog(error_message, "bad input")) + { + form.ShowDialog(); + } } public void RefreshActive() -- cgit v1.2.3 From 7c0305ae2c99c191baf61eb920025826057d5753 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Wed, 15 Sep 2021 06:41:57 -0400 Subject: add device menu --- grapher/DeviceMenuForm.Designer.cs | 51 ---- grapher/DeviceMenuForm.cs | 402 ++++++++++++++++++++++++++- grapher/DeviceMenuForm.resx | 120 -------- grapher/Models/AccelGUI.cs | 23 +- grapher/Models/AccelGUIFactory.cs | 6 +- grapher/Models/Devices/DeviceDialogItem.cs | 26 ++ grapher/Models/Devices/DeviceIDItem.cs | 73 ----- grapher/Models/Devices/DeviceIDManager.cs | 68 ----- grapher/Models/Serialized/SettingsManager.cs | 67 ++++- grapher/grapher.csproj | 9 +- 10 files changed, 501 insertions(+), 344 deletions(-) delete mode 100644 grapher/DeviceMenuForm.Designer.cs delete mode 100644 grapher/DeviceMenuForm.resx create mode 100644 grapher/Models/Devices/DeviceDialogItem.cs delete mode 100644 grapher/Models/Devices/DeviceIDItem.cs delete mode 100644 grapher/Models/Devices/DeviceIDManager.cs (limited to 'grapher') diff --git a/grapher/DeviceMenuForm.Designer.cs b/grapher/DeviceMenuForm.Designer.cs deleted file mode 100644 index 6b05645..0000000 --- a/grapher/DeviceMenuForm.Designer.cs +++ /dev/null @@ -1,51 +0,0 @@ - -namespace grapher -{ - partial class DeviceMenuForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // DeviceMenuForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(584, 361); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "DeviceMenuForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Device Menu"; - this.ResumeLayout(false); - - } - - #endregion - } -} \ No newline at end of file diff --git a/grapher/DeviceMenuForm.cs b/grapher/DeviceMenuForm.cs index 00b36a8..dd946f4 100644 --- a/grapher/DeviceMenuForm.cs +++ b/grapher/DeviceMenuForm.cs @@ -1,21 +1,405 @@ -using grapher.Models.Serialized; +using grapher.Models.Devices; +using grapher.Models.Serialized; using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace grapher { - public partial class DeviceMenuForm : Form + public class DeviceMenuForm : Form { + #region Constructors public DeviceMenuForm(SettingsManager sm) { - InitializeComponent(); + Manager = sm; + defaultConfig = Manager.UserConfig.defaultDeviceConfig; + + var columns = 3; + var rows = 9; + var tablePanel = new TableLayoutPanel + { + Dock = DockStyle.Fill, + ColumnCount = columns, + RowCount = rows + }; + + SuspendLayout(); + tablePanel.SuspendLayout(); + + Label MakeConfigLabel(string text) + { + return new Label + { + Text = text, + Anchor = AnchorStyles.Left, + AutoSize = true, + }; + } + + DpiLabel = MakeConfigLabel("DPI:"); + RateLabel = MakeConfigLabel("Polling rate:"); + DisableLabel = MakeConfigLabel("Disable:"); + OverrideLabel = MakeConfigLabel("Override defaults:"); + + var maxLabel = OverrideLabel; + tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 2)); + tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, maxLabel.PreferredSize.Width + maxLabel.Margin.Left + maxLabel.Margin.Right)); + tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1)); + + var middleRowCount = rows - 2; + tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize)); + for (int i = 0; i < middleRowCount; i++) + { + tablePanel.RowStyles.Add(new RowStyle(SizeType.Percent, 1)); + } + tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize)); + + var topPanel = new FlowLayoutPanel + { + AutoSize = true, + }; + + DefaultDisableCheck = new CheckBox + { + Text = "Disable by default", + AutoSize = true, + Checked = defaultConfig.disable, + }; + + topPanel.Controls.Add(DefaultDisableCheck); + + tablePanel.Controls.Add(topPanel, 0, 0); + tablePanel.SetColumnSpan(topPanel, columns); + + var bottomPanel = new FlowLayoutPanel + { + AutoSize = true, + Anchor = AnchorStyles.Right | AnchorStyles.Bottom, + }; + + var applyButton = new Button + { + Text = "Apply", + DialogResult = DialogResult.OK, + }; + + bottomPanel.Controls.AddRange(new Control[] { + applyButton, + new Button + { + Text = "Cancel", + DialogResult = DialogResult.Cancel, + }, + }); + + tablePanel.Controls.Add(bottomPanel, 0, rows - 1); + tablePanel.SetColumnSpan(bottomPanel, columns); + + IdPanel = new Panel + { + Dock = DockStyle.Fill, + }; + + IdText = new TextBox + { + ReadOnly = true, + BorderStyle = BorderStyle.None, + BackColor = this.BackColor, + TabStop = false, + TextAlign = HorizontalAlignment.Center, + Dock = DockStyle.Fill, + }; + + IdPanel.Controls.Add(IdText); + IdPanel.Controls.Add(new Label + { + // divider + Height = 2, + BorderStyle = BorderStyle.Fixed3D, + AutoSize = false, + Text = string.Empty, + Dock = DockStyle.Bottom, + }); + + tablePanel.Controls.Add(IdPanel, 1, 1); + tablePanel.SetColumnSpan(IdPanel, 2); + + NumericUpDown MakeNumericInput(int val = 0, int min = 0, int max = 999999) + { + return new NumericUpDown + { + Value = val, + Minimum = min, + Maximum = max, + Dock = DockStyle.Fill, + Anchor = AnchorStyles.Left, + AutoSize = true, + }; + } + + CheckBox MakeCheck() + { + return new CheckBox + { + Text = string.Empty, + AutoSize = true, + Anchor = AnchorStyles.Left, + }; + } + + DpiInput = MakeNumericInput(); + RateInput = MakeNumericInput(); + DisableCheck = MakeCheck(); + OverrideCheck = MakeCheck(); + + tablePanel.Controls.Add(OverrideLabel, 1, 2); + tablePanel.Controls.Add(OverrideCheck, 2, 2); + tablePanel.Controls.Add(DisableLabel, 1, 3); + tablePanel.Controls.Add(DisableCheck, 2, 3); + tablePanel.Controls.Add(DpiLabel, 1, 5); + tablePanel.Controls.Add(DpiInput, 2, 5); + tablePanel.Controls.Add(RateLabel, 1, 6); + tablePanel.Controls.Add(RateInput, 2, 6); + + DeviceSelect = new ListBox + { + Dock = DockStyle.Fill, + IntegralHeight = false, + HorizontalScrollbar = true + }; + + tablePanel.Controls.Add(DeviceSelect, 0, 1); + tablePanel.SetRowSpan(DeviceSelect, middleRowCount); + + ResetDataAndSelection(); + SetEnabled(false); + SetVisible(false); + + applyButton.Click += ApplyButton_Click; + OverrideCheck.Click += OverrideCheck_Click; + OverrideCheck.CheckedChanged += OverrideCheck_Checked; + DefaultDisableCheck.CheckedChanged += DefaultDisableCheck_Checked; + IdText.DoubleClick += SelectAllText; + DeviceSelect.SelectedIndexChanged += DeviceSelect_SelectedIndexChanged; + Manager.DeviceChange += OnDeviceChange; + Disposed += OnDispose; + + var toolTip = new ToolTip(); + toolTip.SetToolTip(IdText, "Device ID"); + + var rateTip = "Keep at 0 for automatic adjustment"; + toolTip.SetToolTip(RateInput, rateTip); + toolTip.SetToolTip(RateLabel, rateTip); + + var dpiTip = "Normalizes sensitivity and input speed to 1000 DPI"; + toolTip.SetToolTip(DpiInput, dpiTip); + toolTip.SetToolTip(DpiLabel, dpiTip); + + + Name = "DeviceMenuForm"; + Text = "Devices"; + MaximizeBox = false; + MinimizeBox = false; + FormBorderStyle = FormBorderStyle.FixedDialog; + StartPosition = FormStartPosition.CenterParent; + AutoScaleDimensions = new SizeF(6F, 13F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(500, 300); + + Controls.Add(tablePanel); + + tablePanel.ResumeLayout(false); + ResumeLayout(false); } + + #endregion Constructors + + #region Fields + + public DeviceConfig defaultConfig; + + #endregion Fields + + #region Properties + + public DeviceDialogItem[] Items { get; private set; } + + private DeviceDialogItem Selected + { + get => (DeviceDialogItem)DeviceSelect.SelectedItem; + } + + private bool AnySelected + { + get => DeviceSelect.SelectedIndex != -1; + } + + private int LastSelectedIndex { get; set; } + + private SettingsManager Manager { get; } + + private ListBox DeviceSelect { get; } + + private CheckBox DefaultDisableCheck { get; } + + private TextBox IdText { get; } + private Panel IdPanel { get; } + + private Label OverrideLabel { get; } + private CheckBox OverrideCheck { get; } + + private Label DisableLabel { get; } + private CheckBox DisableCheck { get; } + + private Label DpiLabel { get; } + private NumericUpDown DpiInput { get; } + + private Label RateLabel { get; } + private NumericUpDown RateInput { get; } + + #endregion Properties + + #region Methods + + private void ResetDataAndSelection() + { + var count = Manager.SystemDevices.Count; + Items = new DeviceDialogItem[count]; + + for (int i = 0; i < count; i++) + { + var sysDev = Manager.SystemDevices[i]; + var settings = Manager.UserConfig.devices.Find(s => s.id == sysDev.id); + bool found = !(settings is null); + + Items[i] = new DeviceDialogItem + { + device = sysDev, + overrideDefaultConfig = found, + oldSettings = settings, + newConfig = found ? + settings.config : + Manager.UserConfig.defaultDeviceConfig, + newProfile = found ? + settings.profile : + Manager.UserConfig.profiles[0].name + }; + } + + LastSelectedIndex = -1; + DeviceSelect.ClearSelected(); + DeviceSelect.Items.Clear(); + DeviceSelect.Items.AddRange(Items); + } + + private void SetVisible(bool visible) + { + IdPanel.Visible = visible; + OverrideLabel.Visible = visible; + OverrideCheck.Visible = visible; + DisableLabel.Visible = visible; + DisableCheck.Visible = visible; + DpiInput.Visible = visible; + DpiLabel.Visible = visible; + RateInput.Visible = visible; + RateLabel.Visible = visible; + } + + private void SetEnabled(bool enable) + { + DisableLabel.Enabled = enable; + DisableCheck.Enabled = enable; + DpiInput.Enabled = enable; + DpiLabel.Enabled = enable; + RateInput.Enabled = enable; + RateLabel.Enabled = enable; + } + + private void SetInputsFromNewSelection() + { + IdText.Text = Selected.device.id; + OverrideCheck.Checked = Selected.overrideDefaultConfig; + + SetOverrideDependentInputs(); + } + + private void SetOverrideDependentInputs() + { + var item = Selected; + bool oride = item.overrideDefaultConfig; + DisableCheck.Checked = oride ? item.newConfig.disable : defaultConfig.disable; + DpiInput.Value = oride ? item.newConfig.dpi : defaultConfig.dpi; + RateInput.Value = oride ? item.newConfig.pollingRate : defaultConfig.pollingRate; + } + + private void UpdateLastSelected() + { + var item = Items[LastSelectedIndex]; + bool oride = OverrideCheck.Checked; + item.overrideDefaultConfig = oride; + item.newConfig.disable = oride ? DisableCheck.Checked : defaultConfig.disable; + item.newConfig.dpi = oride ? (int)DpiInput.Value : defaultConfig.dpi; + item.newConfig.pollingRate = oride ? (int)RateInput.Value : defaultConfig.pollingRate; + } + + private void ApplyButton_Click(object sender, EventArgs e) + { + if (AnySelected) UpdateLastSelected(); + } + + private void OverrideCheck_Checked(object sender, EventArgs e) + { + SetEnabled(OverrideCheck.Checked); + } + + private void OverrideCheck_Click(object sender, EventArgs e) + { + UpdateLastSelected(); + SetOverrideDependentInputs(); + } + + private void DefaultDisableCheck_Checked(object sender, EventArgs e) + { + defaultConfig.disable = DefaultDisableCheck.Checked; + + if (AnySelected && !Selected.overrideDefaultConfig) + { + DisableCheck.Checked = DefaultDisableCheck.Checked; + } + } + + private void DeviceSelect_SelectedIndexChanged(object sender, EventArgs e) + { + if (AnySelected) + { + if (LastSelectedIndex != -1) + { + UpdateLastSelected(); + } + + SetInputsFromNewSelection(); + } + + LastSelectedIndex = DeviceSelect.SelectedIndex; + + SetVisible(AnySelected); + } + + private void OnDeviceChange(object sender, EventArgs e) + { + ResetDataAndSelection(); + } + + private void OnDispose(object sender, EventArgs e) + { + Manager.DeviceChange -= OnDeviceChange; + } + + private static void SelectAllText(object sender, EventArgs e) + { + ((TextBoxBase)sender).SelectAll(); + } + + #endregion Methods } } diff --git a/grapher/DeviceMenuForm.resx b/grapher/DeviceMenuForm.resx deleted file mode 100644 index 1af7de1..0000000 --- a/grapher/DeviceMenuForm.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 1836b65..51e31a6 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -4,6 +4,7 @@ using grapher.Models.Mouse; using grapher.Models.Options; using grapher.Models.Serialized; using System; +using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; @@ -24,7 +25,8 @@ namespace grapher Button writeButton, ButtonBase resetButton, MouseWatcher mouseWatcher, - ToolStripMenuItem scaleMenuItem) + ToolStripMenuItem scaleMenuItem, + ToolStripMenuItem deviceMenuItem) { AccelForm = accelForm; AccelCalculator = accelCalculator; @@ -33,11 +35,13 @@ namespace grapher WriteButton = writeButton; ResetButton = (CheckBox)resetButton; ScaleMenuItem = scaleMenuItem; + DeviceMenuItem = deviceMenuItem; Settings = settings; DefaultButtonFont = WriteButton.Font; SmallButtonFont = new Font(WriteButton.Font.Name, WriteButton.Font.Size * Constants.SmallButtonSizeFactor); MouseWatcher = mouseWatcher; + DeviceMenuItem.Click += DeviceMenuItemClick; ScaleMenuItem.Click += new System.EventHandler(OnScaleMenuItemClick); WriteButton.Click += new System.EventHandler(OnWriteButtonClick); ResetButton.Click += new System.EventHandler(ResetDriverEventHandler); @@ -83,6 +87,8 @@ namespace grapher public ToolStripMenuItem ScaleMenuItem { get; } + public ToolStripMenuItem DeviceMenuItem { get; } + private Timer ChartRefresh { get; } private Font SmallButtonFont { get; } @@ -146,6 +152,7 @@ namespace grapher else { RefreshActive(); + Settings.SetActiveHandles(); return; } } @@ -240,10 +247,12 @@ namespace grapher { ButtonTimer.Stop(); SetButtonDefaults(); + DeviceMenuItem.Enabled = true; } private void StartButtonTimer() { + DeviceMenuItem.Enabled = false; ButtonTimer.Interval = ButtonTimerInterval; ButtonTimer.Start(); } @@ -268,6 +277,18 @@ namespace grapher MouseWatcher.UpdateLastMove(); } + private void DeviceMenuItemClick(object sender, EventArgs e) + { + using (var devMenu = new DeviceMenuForm(Settings)) + { + if (devMenu.ShowDialog() == DialogResult.OK) + { + Settings.Submit(devMenu.defaultConfig, devMenu.Items); + UpdateActiveSettingsFromFields(); + } + } + } + #endregion Methods } diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 4d0a483..91a649a 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -639,8 +639,7 @@ namespace grapher.Models autoWriteMenuItem, showLastMouseMoveMenuItem, showVelocityGainToolStripMenuItem, - streamingModeToolStripMenuItem, - deviceMenuItem); + streamingModeToolStripMenuItem); var mouseWatcher = new MouseWatcher(form, mouseLabel, accelCharts, settings); @@ -653,7 +652,8 @@ namespace grapher.Models writeButton, toggleButton, mouseWatcher, - scaleMenuItem); + scaleMenuItem, + deviceMenuItem); } #endregion Methods diff --git a/grapher/Models/Devices/DeviceDialogItem.cs b/grapher/Models/Devices/DeviceDialogItem.cs new file mode 100644 index 0000000..9ca5528 --- /dev/null +++ b/grapher/Models/Devices/DeviceDialogItem.cs @@ -0,0 +1,26 @@ +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.Devices +{ + public class DeviceDialogItem + { + public MultiHandleDevice device; + public DeviceSettings oldSettings; + public DeviceConfig newConfig; + public string newProfile; + public bool overrideDefaultConfig; + + public override string ToString() + { + return string.IsNullOrWhiteSpace(device.name) ? + device.id : + device.name; + } + } +} diff --git a/grapher/Models/Devices/DeviceIDItem.cs b/grapher/Models/Devices/DeviceIDItem.cs deleted file mode 100644 index 8f1587b..0000000 --- a/grapher/Models/Devices/DeviceIDItem.cs +++ /dev/null @@ -1,73 +0,0 @@ -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.Devices -{ - public class DeviceIDItem - { - public DeviceIDItem(string name, string id, DeviceIDManager manager) - { - Name = name; - ID = id; - Manager = manager; - DeviceIDMenuItem = new ToolStripMenuItem(); - DeviceIDMenuItem.Checked = false; - DeviceIDMenuItem.Text = MenuItemText(); - DeviceIDMenuItem.Click += OnClicked; - manager.DeviceIDsMenuItem.DropDownItems.Add(DeviceIDMenuItem); - } - - private ToolStripMenuItem DeviceIDMenuItem { get; } - - public string Name { get; } - - public string ID { get; } - - private DeviceIDManager Manager { get; } - - public void SetActivated() - { - DeviceIDMenuItem.Checked = true; - } - - public void SetDeactivated() - { - DeviceIDMenuItem.Checked = false; - } - - private string MenuItemText() => string.IsNullOrEmpty(ID) ? $"{Name}" : ID.Replace("&", "&&"); - - private string DisconnectedText() => $"Disconnected: {ID}"; - - public void SetDisconnected() - { - DeviceIDMenuItem.ForeColor = Color.DarkGray; - DeviceIDMenuItem.Text = DisconnectedText(); - } - - public void OnClicked(object sender, EventArgs e) - { - Manager.SetActive(this); - } - - public override bool Equals(object obj) - { - return obj is DeviceIDItem item && - Name == item.Name && - ID == item.ID; - } - - public override int GetHashCode() - { - int hashCode = -1692744877; - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Name); - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ID); - return hashCode; - } - } -} diff --git a/grapher/Models/Devices/DeviceIDManager.cs b/grapher/Models/Devices/DeviceIDManager.cs deleted file mode 100644 index e0ee686..0000000 --- a/grapher/Models/Devices/DeviceIDManager.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Management; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace grapher.Models.Devices -{ - public class DeviceIDManager - { - public DeviceIDManager(ToolStripMenuItem deviceIDs) - { - DeviceIDsMenuItem = deviceIDs; - DeviceIDsMenuItem.Checked = false; - } - - public ToolStripMenuItem DeviceIDsMenuItem { get; } - - public string ID { get => SelectedDeviceID.ID; } - - public DeviceIDItem SelectedDeviceID { get; private set; } - - public Dictionary DeviceIDs { get; private set; } - - public void SetActive(DeviceIDItem deviceIDItem) - { - if (SelectedDeviceID != null) - { - SelectedDeviceID.SetDeactivated(); - } - - SelectedDeviceID = deviceIDItem; - SelectedDeviceID.SetActivated(); - } - - public void Update(string devID) - { - DeviceIDsMenuItem.DropDownItems.Clear(); - - bool found = string.IsNullOrEmpty(devID); - - var anyDevice = new DeviceIDItem("Any", string.Empty, this); - - if (found) SetActive(anyDevice); - -/* foreach (string id in RawInputInterop.GetDeviceIDs()) - { - var deviceItem = new DeviceIDItem(string.Empty, id, this); - if (!found && deviceItem.ID.Equals(devID)) - { - SetActive(deviceItem); - found = true; - } - }*/ - - if (!found) - { - var deviceItem = new DeviceIDItem(string.Empty, devID, this); - deviceItem.SetDisconnected(); - SetActive(deviceItem); - } - } - - } -} diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs index 3789c05..8c8bf15 100644 --- a/grapher/Models/Serialized/SettingsManager.cs +++ b/grapher/Models/Serialized/SettingsManager.cs @@ -21,8 +21,7 @@ namespace grapher.Models.Serialized ToolStripMenuItem autoWrite, ToolStripMenuItem showLastMouseMove, ToolStripMenuItem showVelocityAndGain, - ToolStripMenuItem streamingMode, - ToolStripMenuItem deviceMenuItem) + ToolStripMenuItem streamingMode) { DpiField = dpiField; PollRateField = pollRateField; @@ -30,7 +29,6 @@ namespace grapher.Models.Serialized ShowLastMouseMoveMenuItem = showLastMouseMove; ShowVelocityAndGainMoveMenuItem = showVelocityAndGain; StreamingModeMenuItem = streamingMode; - deviceMenuItem.Click += (s, e) => new DeviceMenuForm(this).ShowDialog(); SystemDevices = new List(); ActiveHandles = new List(); @@ -47,14 +45,17 @@ namespace grapher.Models.Serialized UpdateFieldsFromGUISettings(); } - UserConfig = InitActiveAndGetUserConfig(); + UserConfigField = InitActiveAndGetUserConfig(); } #endregion Constructors #region Fields + private EventHandler DeviceChangeField; + private DriverConfig ActiveConfigField; + private DriverConfig UserConfigField; #endregion Fields @@ -62,6 +63,12 @@ namespace grapher.Models.Serialized public GUISettings GuiSettings { get; private set; } + public event EventHandler DeviceChange + { + add => DeviceChangeField += value; + remove => DeviceChangeField -= value; + } + public DriverConfig ActiveConfig { get => ActiveConfigField; @@ -87,11 +94,16 @@ namespace grapher.Models.Serialized get => ActiveConfig.accels[0]; } - public DriverConfig UserConfig { get; private set; } + public DriverConfig UserConfig + { + get => UserConfigField; + private set => UserConfigField = value; + } public Profile UserProfile { - get => UserConfig.profiles[0]; + get => UserConfigField.profiles[0]; + private set => UserConfigField.SetProfileAt(0, value); } public HashSet ActiveProfileNamesSet { get; private set; } @@ -133,12 +145,12 @@ namespace grapher.Models.Serialized public bool TryActivate(Profile settings, out string errors) { - var old = ActiveProfile; - ActiveProfile = settings; - bool success = TryActivate(ActiveConfig, out errors); + var old = UserProfile; + UserProfile = settings; + bool success = TryActivate(UserConfig, out errors); if (!success) { - ActiveProfile = old; + UserProfile = old; } return success; } @@ -183,7 +195,7 @@ namespace grapher.Models.Serialized }; } - private void SetActiveHandles() + public void SetActiveHandles() { ActiveHandles.Clear(); @@ -217,6 +229,37 @@ namespace grapher.Models.Serialized } } + public void Submit(DeviceConfig newDefaultConfig, DeviceDialogItem[] items) + { + UserConfig.defaultDeviceConfig = newDefaultConfig; + foreach (var item in items) + { + if (item.overrideDefaultConfig) + { + if (item.oldSettings is null) + { + UserConfig.devices.Add( + new DeviceSettings + { + name = item.device.name, + profile = item.newProfile, + id = item.device.id, + config = item.newConfig + }); + } + else + { + item.oldSettings.config = item.newConfig; + item.oldSettings.profile = item.newProfile; + } + } + else if (!(item.oldSettings is null)) + { + UserConfig.devices.Remove(item.oldSettings); + } + } + } + public void OnProfileSelectionChange() { SetActiveHandles(); @@ -226,6 +269,8 @@ namespace grapher.Models.Serialized { SystemDevices = MultiHandleDevice.GetList(); SetActiveHandles(); + + DeviceChangeField?.Invoke(this, EventArgs.Empty); } private DriverConfig InitActiveAndGetUserConfig() diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index bd6674d..702d89e 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -81,9 +81,6 @@ Form - - DeviceMenuForm.cs - @@ -109,8 +106,7 @@ - - + @@ -158,9 +154,6 @@ AboutBox.cs Designer - - DeviceMenuForm.cs - Form1.cs -- cgit v1.2.3 From feba2ca96fcfdc161c5ffd1c0cceb8db38b894e0 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Wed, 15 Sep 2021 23:48:32 -0700 Subject: Fix gain switch GUI --- grapher/Models/Options/CheckBoxOption.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Options/CheckBoxOption.cs b/grapher/Models/Options/CheckBoxOption.cs index 1a4245d..8c125ec 100644 --- a/grapher/Models/Options/CheckBoxOption.cs +++ b/grapher/Models/Options/CheckBoxOption.cs @@ -102,10 +102,10 @@ namespace grapher.Models.Options ActiveValueLabel.Show(); } - public void SetActiveValue(bool legacy) + public void SetActiveValue(bool gain) { - CheckBox.Checked = !legacy; - var activeValueString = legacy ? "Legacy" : "Gain"; + CheckBox.Checked = gain; + var activeValueString = gain ? "Gain" : "Legacy"; ActiveValueLabel.SetValue(activeValueString); } } -- cgit v1.2.3 From 7361457ed17670b37279f12fe334e7a9ce7ea34e Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 16 Sep 2021 01:29:51 -0700 Subject: Get power cap working --- grapher/Models/Options/AccelTypeOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grapher') diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 3d2f840..b7a7b7b 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -323,7 +323,7 @@ namespace grapher } if (PowerCap.Visible) { - args.scale = ClassicCap.Slope.Field.Data; + args.scale = PowerCap.Slope.Field.Data; args.cap.x = PowerCap.In.Field.Data; args.cap.y = PowerCap.Out.Field.Data; args.capMode = PowerCap.CapTypeOptions.GetSelectedCapMode(); -- cgit v1.2.3 From 4197e030c5cfeda5592816c8028152d9b7b599e0 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 16 Sep 2021 13:07:43 -0700 Subject: Remove weight --- grapher/Form1.Designer.cs | 409 ++++++++++++----------------- grapher/Form1.cs | 6 - grapher/Layouts/ClassicLayout.cs | 1 - grapher/Layouts/DefaultLayout.cs | 1 - grapher/Layouts/JumpLayout.cs | 1 - grapher/Layouts/LUTLayout.cs | 1 - grapher/Layouts/LayoutBase.cs | 7 - grapher/Layouts/LinearLayout.cs | 1 - grapher/Layouts/MotivityLayout.cs | 1 - grapher/Layouts/NaturalLayout.cs | 1 - grapher/Layouts/OffLayout.cs | 1 - grapher/Layouts/PowerLayout.cs | 1 - grapher/Layouts/UnsupportedLayout.cs | 1 - grapher/Models/AccelGUIFactory.cs | 26 -- grapher/Models/Options/AccelTypeOptions.cs | 9 - 15 files changed, 170 insertions(+), 297 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index f162801..a0b102e 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -71,6 +71,24 @@ namespace grapher System.Windows.Forms.DataVisualization.Charting.Title title6 = new System.Windows.Forms.DataVisualization.Charting.Title(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RawAcceleration)); this.optionsPanel = new System.Windows.Forms.Panel(); + this.OutCapActiveYLabelPower = new System.Windows.Forms.Label(); + this.InCapActiveYLabelPower = new System.Windows.Forms.Label(); + this.OutCapActiveXLabelPower = new System.Windows.Forms.Label(); + this.InCapActiveXLabelPower = new System.Windows.Forms.Label(); + this.CapTypeActiveYLabelPower = new System.Windows.Forms.Label(); + this.CapTypeActiveXLabelPower = new System.Windows.Forms.Label(); + this.outCapLabelYPower = new System.Windows.Forms.Label(); + this.inCapLabelYPower = new System.Windows.Forms.Label(); + this.CapTypeLabelYPower = new System.Windows.Forms.Label(); + this.outCapLabelXPower = new System.Windows.Forms.Label(); + this.inCapLabelXPower = new System.Windows.Forms.Label(); + this.CapTypeLabelXPower = new System.Windows.Forms.Label(); + this.outCapBoxYPower = new System.Windows.Forms.TextBox(); + this.outCapBoxXPower = new System.Windows.Forms.TextBox(); + this.inCapBoxYPower = new System.Windows.Forms.TextBox(); + this.inCapBoxXPower = new System.Windows.Forms.TextBox(); + this.CapTypeDropdownYPower = new System.Windows.Forms.ComboBox(); + this.CapTypeDropdownXPower = new System.Windows.Forms.ComboBox(); this.CapTypeActiveYLabelClassic = new System.Windows.Forms.Label(); this.CapTypeActiveXLabelClassic = new System.Windows.Forms.Label(); this.OutCapActiveYLabelClassic = new System.Windows.Forms.Label(); @@ -165,7 +183,6 @@ namespace grapher this.constantThreeLabelY = new System.Windows.Forms.Label(); this.limitLabelY = new System.Windows.Forms.Label(); this.offsetLabelY = new System.Windows.Forms.Label(); - this.weightLabelY = new System.Windows.Forms.Label(); this.inCapLabelYClassic = new System.Windows.Forms.Label(); this.constantOneLabelY = new System.Windows.Forms.Label(); this.ByComponentXYLock = new System.Windows.Forms.CheckBox(); @@ -182,8 +199,6 @@ namespace grapher this.LimitActiveXLabel = new System.Windows.Forms.Label(); this.OffsetActiveXLabel = new System.Windows.Forms.Label(); this.InCapActiveYLabelClassic = new System.Windows.Forms.Label(); - this.WeightActiveYLabel = new System.Windows.Forms.Label(); - this.WeightActiveXLabel = new System.Windows.Forms.Label(); this.InCapActiveXLabelClassic = new System.Windows.Forms.Label(); this.AccelerationActiveLabelX = new System.Windows.Forms.Label(); this.AccelTypeActiveLabelX = new System.Windows.Forms.Label(); @@ -203,9 +218,6 @@ namespace grapher this.midpointBoxX = new System.Windows.Forms.TextBox(); this.limitLabelX = new System.Windows.Forms.Label(); this.limitBoxX = new System.Windows.Forms.TextBox(); - this.weightBoxY = new System.Windows.Forms.TextBox(); - this.weightLabelX = new System.Windows.Forms.Label(); - this.weightBoxX = new System.Windows.Forms.TextBox(); this.inCapLabelXClassic = new System.Windows.Forms.Label(); this.inCapBoxXClassic = new System.Windows.Forms.TextBox(); this.constantOneLabelX = new System.Windows.Forms.Label(); @@ -236,24 +248,6 @@ namespace grapher this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); - this.CapTypeDropdownXPower = new System.Windows.Forms.ComboBox(); - this.CapTypeDropdownYPower = new System.Windows.Forms.ComboBox(); - this.inCapBoxXPower = new System.Windows.Forms.TextBox(); - this.inCapBoxYPower = new System.Windows.Forms.TextBox(); - this.outCapBoxXPower = new System.Windows.Forms.TextBox(); - this.outCapBoxYPower = new System.Windows.Forms.TextBox(); - this.CapTypeLabelXPower = new System.Windows.Forms.Label(); - this.inCapLabelXPower = new System.Windows.Forms.Label(); - this.outCapLabelXPower = new System.Windows.Forms.Label(); - this.CapTypeLabelYPower = new System.Windows.Forms.Label(); - this.inCapLabelYPower = new System.Windows.Forms.Label(); - this.outCapLabelYPower = new System.Windows.Forms.Label(); - this.CapTypeActiveXLabelPower = new System.Windows.Forms.Label(); - this.CapTypeActiveYLabelPower = new System.Windows.Forms.Label(); - this.InCapActiveXLabelPower = new System.Windows.Forms.Label(); - this.OutCapActiveXLabelPower = new System.Windows.Forms.Label(); - this.InCapActiveYLabelPower = new System.Windows.Forms.Label(); - this.OutCapActiveYLabelPower = new System.Windows.Forms.Label(); this.optionsPanel.SuspendLayout(); this.DirectionalityPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -362,7 +356,6 @@ namespace grapher this.optionsPanel.Controls.Add(this.constantThreeLabelY); this.optionsPanel.Controls.Add(this.limitLabelY); this.optionsPanel.Controls.Add(this.offsetLabelY); - this.optionsPanel.Controls.Add(this.weightLabelY); this.optionsPanel.Controls.Add(this.inCapLabelYClassic); this.optionsPanel.Controls.Add(this.constantOneLabelY); this.optionsPanel.Controls.Add(this.ByComponentXYLock); @@ -379,8 +372,6 @@ namespace grapher this.optionsPanel.Controls.Add(this.LimitActiveXLabel); this.optionsPanel.Controls.Add(this.OffsetActiveXLabel); this.optionsPanel.Controls.Add(this.InCapActiveYLabelClassic); - this.optionsPanel.Controls.Add(this.WeightActiveYLabel); - this.optionsPanel.Controls.Add(this.WeightActiveXLabel); this.optionsPanel.Controls.Add(this.InCapActiveXLabelClassic); this.optionsPanel.Controls.Add(this.AccelerationActiveLabelX); this.optionsPanel.Controls.Add(this.AccelTypeActiveLabelX); @@ -400,9 +391,6 @@ namespace grapher this.optionsPanel.Controls.Add(this.midpointBoxX); this.optionsPanel.Controls.Add(this.limitLabelX); this.optionsPanel.Controls.Add(this.limitBoxX); - this.optionsPanel.Controls.Add(this.weightBoxY); - this.optionsPanel.Controls.Add(this.weightLabelX); - this.optionsPanel.Controls.Add(this.weightBoxX); this.optionsPanel.Controls.Add(this.inCapLabelXClassic); this.optionsPanel.Controls.Add(this.inCapBoxXClassic); this.optionsPanel.Controls.Add(this.constantOneLabelX); @@ -420,6 +408,158 @@ namespace grapher this.optionsPanel.Size = new System.Drawing.Size(483, 956); this.optionsPanel.TabIndex = 34; // + // OutCapActiveYLabelPower + // + this.OutCapActiveYLabelPower.AutoSize = true; + this.OutCapActiveYLabelPower.Location = new System.Drawing.Point(414, 836); + this.OutCapActiveYLabelPower.Name = "OutCapActiveYLabelPower"; + this.OutCapActiveYLabelPower.Size = new System.Drawing.Size(13, 13); + this.OutCapActiveYLabelPower.TabIndex = 224; + this.OutCapActiveYLabelPower.Text = "0"; + // + // InCapActiveYLabelPower + // + this.InCapActiveYLabelPower.AutoSize = true; + this.InCapActiveYLabelPower.Location = new System.Drawing.Point(417, 810); + this.InCapActiveYLabelPower.Name = "InCapActiveYLabelPower"; + this.InCapActiveYLabelPower.Size = new System.Drawing.Size(13, 13); + this.InCapActiveYLabelPower.TabIndex = 223; + this.InCapActiveYLabelPower.Text = "0"; + // + // OutCapActiveXLabelPower + // + this.OutCapActiveXLabelPower.AutoSize = true; + this.OutCapActiveXLabelPower.Location = new System.Drawing.Point(200, 837); + this.OutCapActiveXLabelPower.Name = "OutCapActiveXLabelPower"; + this.OutCapActiveXLabelPower.Size = new System.Drawing.Size(13, 13); + this.OutCapActiveXLabelPower.TabIndex = 222; + this.OutCapActiveXLabelPower.Text = "0"; + // + // InCapActiveXLabelPower + // + this.InCapActiveXLabelPower.AutoSize = true; + this.InCapActiveXLabelPower.Location = new System.Drawing.Point(200, 810); + this.InCapActiveXLabelPower.Name = "InCapActiveXLabelPower"; + this.InCapActiveXLabelPower.Size = new System.Drawing.Size(13, 13); + this.InCapActiveXLabelPower.TabIndex = 221; + this.InCapActiveXLabelPower.Text = "0"; + // + // CapTypeActiveYLabelPower + // + this.CapTypeActiveYLabelPower.AutoSize = true; + this.CapTypeActiveYLabelPower.Location = new System.Drawing.Point(414, 783); + this.CapTypeActiveYLabelPower.Name = "CapTypeActiveYLabelPower"; + this.CapTypeActiveYLabelPower.Size = new System.Drawing.Size(16, 13); + this.CapTypeActiveYLabelPower.TabIndex = 220; + this.CapTypeActiveYLabelPower.Text = "In"; + // + // CapTypeActiveXLabelPower + // + this.CapTypeActiveXLabelPower.AutoSize = true; + this.CapTypeActiveXLabelPower.Location = new System.Drawing.Point(200, 788); + this.CapTypeActiveXLabelPower.Name = "CapTypeActiveXLabelPower"; + this.CapTypeActiveXLabelPower.Size = new System.Drawing.Size(16, 13); + this.CapTypeActiveXLabelPower.TabIndex = 219; + this.CapTypeActiveXLabelPower.Text = "In"; + // + // outCapLabelYPower + // + this.outCapLabelYPower.AutoSize = true; + this.outCapLabelYPower.Location = new System.Drawing.Point(262, 837); + this.outCapLabelYPower.Name = "outCapLabelYPower"; + this.outCapLabelYPower.Size = new System.Drawing.Size(64, 13); + this.outCapLabelYPower.TabIndex = 218; + this.outCapLabelYPower.Text = "Cap: Output"; + // + // inCapLabelYPower + // + this.inCapLabelYPower.AutoSize = true; + this.inCapLabelYPower.Location = new System.Drawing.Point(262, 810); + this.inCapLabelYPower.Name = "inCapLabelYPower"; + this.inCapLabelYPower.Size = new System.Drawing.Size(56, 13); + this.inCapLabelYPower.TabIndex = 217; + this.inCapLabelYPower.Text = "Cap: Input"; + // + // CapTypeLabelYPower + // + this.CapTypeLabelYPower.AutoSize = true; + this.CapTypeLabelYPower.Location = new System.Drawing.Point(262, 783); + this.CapTypeLabelYPower.Name = "CapTypeLabelYPower"; + this.CapTypeLabelYPower.Size = new System.Drawing.Size(53, 13); + this.CapTypeLabelYPower.TabIndex = 216; + this.CapTypeLabelYPower.Text = "Cap Type"; + // + // outCapLabelXPower + // + this.outCapLabelXPower.AutoSize = true; + this.outCapLabelXPower.Location = new System.Drawing.Point(35, 836); + this.outCapLabelXPower.Name = "outCapLabelXPower"; + this.outCapLabelXPower.Size = new System.Drawing.Size(64, 13); + this.outCapLabelXPower.TabIndex = 215; + this.outCapLabelXPower.Text = "Cap: Output"; + // + // inCapLabelXPower + // + this.inCapLabelXPower.AutoSize = true; + this.inCapLabelXPower.Location = new System.Drawing.Point(38, 810); + this.inCapLabelXPower.Name = "inCapLabelXPower"; + this.inCapLabelXPower.Size = new System.Drawing.Size(56, 13); + this.inCapLabelXPower.TabIndex = 214; + this.inCapLabelXPower.Text = "Cap: Input"; + // + // CapTypeLabelXPower + // + this.CapTypeLabelXPower.AutoSize = true; + this.CapTypeLabelXPower.Location = new System.Drawing.Point(40, 783); + this.CapTypeLabelXPower.Name = "CapTypeLabelXPower"; + this.CapTypeLabelXPower.Size = new System.Drawing.Size(53, 13); + this.CapTypeLabelXPower.TabIndex = 213; + this.CapTypeLabelXPower.Text = "Cap Type"; + // + // outCapBoxYPower + // + this.outCapBoxYPower.Location = new System.Drawing.Point(332, 834); + this.outCapBoxYPower.Name = "outCapBoxYPower"; + this.outCapBoxYPower.Size = new System.Drawing.Size(76, 20); + this.outCapBoxYPower.TabIndex = 212; + // + // outCapBoxXPower + // + this.outCapBoxXPower.Location = new System.Drawing.Point(106, 833); + this.outCapBoxXPower.Name = "outCapBoxXPower"; + this.outCapBoxXPower.Size = new System.Drawing.Size(76, 20); + this.outCapBoxXPower.TabIndex = 211; + // + // inCapBoxYPower + // + this.inCapBoxYPower.Location = new System.Drawing.Point(332, 807); + this.inCapBoxYPower.Name = "inCapBoxYPower"; + this.inCapBoxYPower.Size = new System.Drawing.Size(76, 20); + this.inCapBoxYPower.TabIndex = 210; + // + // inCapBoxXPower + // + this.inCapBoxXPower.Location = new System.Drawing.Point(106, 807); + this.inCapBoxXPower.Name = "inCapBoxXPower"; + this.inCapBoxXPower.Size = new System.Drawing.Size(76, 20); + this.inCapBoxXPower.TabIndex = 209; + // + // CapTypeDropdownYPower + // + this.CapTypeDropdownYPower.FormattingEnabled = true; + this.CapTypeDropdownYPower.Location = new System.Drawing.Point(332, 780); + this.CapTypeDropdownYPower.Name = "CapTypeDropdownYPower"; + this.CapTypeDropdownYPower.Size = new System.Drawing.Size(76, 21); + this.CapTypeDropdownYPower.TabIndex = 208; + // + // CapTypeDropdownXPower + // + this.CapTypeDropdownXPower.FormattingEnabled = true; + this.CapTypeDropdownXPower.Location = new System.Drawing.Point(106, 780); + this.CapTypeDropdownXPower.Name = "CapTypeDropdownXPower"; + this.CapTypeDropdownXPower.Size = new System.Drawing.Size(76, 21); + this.CapTypeDropdownXPower.TabIndex = 207; + // // CapTypeActiveYLabelClassic // this.CapTypeActiveYLabelClassic.AutoSize = true; @@ -1251,15 +1391,6 @@ namespace grapher this.offsetLabelY.TabIndex = 135; this.offsetLabelY.Text = "Offset"; // - // weightLabelY - // - this.weightLabelY.AutoSize = true; - this.weightLabelY.Location = new System.Drawing.Point(263, 222); - this.weightLabelY.Name = "weightLabelY"; - this.weightLabelY.Size = new System.Drawing.Size(41, 13); - this.weightLabelY.TabIndex = 134; - this.weightLabelY.Text = "Weight"; - // // inCapLabelYClassic // this.inCapLabelYClassic.AutoSize = true; @@ -1398,24 +1529,6 @@ namespace grapher this.InCapActiveYLabelClassic.TabIndex = 124; this.InCapActiveYLabelClassic.Text = "0"; // - // WeightActiveYLabel - // - this.WeightActiveYLabel.AutoSize = true; - this.WeightActiveYLabel.Location = new System.Drawing.Point(414, 222); - this.WeightActiveYLabel.Name = "WeightActiveYLabel"; - this.WeightActiveYLabel.Size = new System.Drawing.Size(13, 13); - this.WeightActiveYLabel.TabIndex = 123; - this.WeightActiveYLabel.Text = "0"; - // - // WeightActiveXLabel - // - this.WeightActiveXLabel.AutoSize = true; - this.WeightActiveXLabel.Location = new System.Drawing.Point(197, 222); - this.WeightActiveXLabel.Name = "WeightActiveXLabel"; - this.WeightActiveXLabel.Size = new System.Drawing.Size(13, 13); - this.WeightActiveXLabel.TabIndex = 122; - this.WeightActiveXLabel.Text = "0"; - // // InCapActiveXLabelClassic // this.InCapActiveXLabelClassic.AutoSize = true; @@ -1583,30 +1696,6 @@ namespace grapher this.limitBoxX.Size = new System.Drawing.Size(76, 20); this.limitBoxX.TabIndex = 93; // - // weightBoxY - // - this.weightBoxY.Location = new System.Drawing.Point(332, 219); - this.weightBoxY.Name = "weightBoxY"; - this.weightBoxY.Size = new System.Drawing.Size(76, 20); - this.weightBoxY.TabIndex = 104; - // - // weightLabelX - // - this.weightLabelX.AutoSize = true; - this.weightLabelX.Location = new System.Drawing.Point(37, 222); - this.weightLabelX.Name = "weightLabelX"; - this.weightLabelX.Size = new System.Drawing.Size(41, 13); - this.weightLabelX.TabIndex = 97; - this.weightLabelX.Text = "Weight"; - this.weightLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // weightBoxX - // - this.weightBoxX.Location = new System.Drawing.Point(106, 219); - this.weightBoxX.Name = "weightBoxX"; - this.weightBoxX.Size = new System.Drawing.Size(76, 20); - this.weightBoxX.TabIndex = 90; - // // inCapLabelXClassic // this.inCapLabelXClassic.AutoSize = true; @@ -2049,158 +2138,6 @@ namespace grapher title6.Text = "Sensitivity"; this.AccelerationChart.Titles.Add(title6); // - // CapTypeDropdownXPower - // - this.CapTypeDropdownXPower.FormattingEnabled = true; - this.CapTypeDropdownXPower.Location = new System.Drawing.Point(106, 780); - this.CapTypeDropdownXPower.Name = "CapTypeDropdownXPower"; - this.CapTypeDropdownXPower.Size = new System.Drawing.Size(76, 21); - this.CapTypeDropdownXPower.TabIndex = 207; - // - // CapTypeDropdownYPower - // - this.CapTypeDropdownYPower.FormattingEnabled = true; - this.CapTypeDropdownYPower.Location = new System.Drawing.Point(332, 780); - this.CapTypeDropdownYPower.Name = "CapTypeDropdownYPower"; - this.CapTypeDropdownYPower.Size = new System.Drawing.Size(76, 21); - this.CapTypeDropdownYPower.TabIndex = 208; - // - // inCapBoxXPower - // - this.inCapBoxXPower.Location = new System.Drawing.Point(106, 807); - this.inCapBoxXPower.Name = "inCapBoxXPower"; - this.inCapBoxXPower.Size = new System.Drawing.Size(76, 20); - this.inCapBoxXPower.TabIndex = 209; - // - // inCapBoxYPower - // - this.inCapBoxYPower.Location = new System.Drawing.Point(332, 807); - this.inCapBoxYPower.Name = "inCapBoxYPower"; - this.inCapBoxYPower.Size = new System.Drawing.Size(76, 20); - this.inCapBoxYPower.TabIndex = 210; - // - // outCapBoxXPower - // - this.outCapBoxXPower.Location = new System.Drawing.Point(106, 833); - this.outCapBoxXPower.Name = "outCapBoxXPower"; - this.outCapBoxXPower.Size = new System.Drawing.Size(76, 20); - this.outCapBoxXPower.TabIndex = 211; - // - // outCapBoxYPower - // - this.outCapBoxYPower.Location = new System.Drawing.Point(332, 834); - this.outCapBoxYPower.Name = "outCapBoxYPower"; - this.outCapBoxYPower.Size = new System.Drawing.Size(76, 20); - this.outCapBoxYPower.TabIndex = 212; - // - // CapTypeLabelXPower - // - this.CapTypeLabelXPower.AutoSize = true; - this.CapTypeLabelXPower.Location = new System.Drawing.Point(40, 783); - this.CapTypeLabelXPower.Name = "CapTypeLabelXPower"; - this.CapTypeLabelXPower.Size = new System.Drawing.Size(53, 13); - this.CapTypeLabelXPower.TabIndex = 213; - this.CapTypeLabelXPower.Text = "Cap Type"; - // - // inCapLabelXPower - // - this.inCapLabelXPower.AutoSize = true; - this.inCapLabelXPower.Location = new System.Drawing.Point(38, 810); - this.inCapLabelXPower.Name = "inCapLabelXPower"; - this.inCapLabelXPower.Size = new System.Drawing.Size(56, 13); - this.inCapLabelXPower.TabIndex = 214; - this.inCapLabelXPower.Text = "Cap: Input"; - // - // outCapLabelXPower - // - this.outCapLabelXPower.AutoSize = true; - this.outCapLabelXPower.Location = new System.Drawing.Point(35, 836); - this.outCapLabelXPower.Name = "outCapLabelXPower"; - this.outCapLabelXPower.Size = new System.Drawing.Size(64, 13); - this.outCapLabelXPower.TabIndex = 215; - this.outCapLabelXPower.Text = "Cap: Output"; - // - // CapTypeLabelYPower - // - this.CapTypeLabelYPower.AutoSize = true; - this.CapTypeLabelYPower.Location = new System.Drawing.Point(262, 783); - this.CapTypeLabelYPower.Name = "CapTypeLabelYPower"; - this.CapTypeLabelYPower.Size = new System.Drawing.Size(53, 13); - this.CapTypeLabelYPower.TabIndex = 216; - this.CapTypeLabelYPower.Text = "Cap Type"; - // - // inCapLabelYPower - // - this.inCapLabelYPower.AutoSize = true; - this.inCapLabelYPower.Location = new System.Drawing.Point(262, 810); - this.inCapLabelYPower.Name = "inCapLabelYPower"; - this.inCapLabelYPower.Size = new System.Drawing.Size(56, 13); - this.inCapLabelYPower.TabIndex = 217; - this.inCapLabelYPower.Text = "Cap: Input"; - // - // outCapLabelYPower - // - this.outCapLabelYPower.AutoSize = true; - this.outCapLabelYPower.Location = new System.Drawing.Point(262, 837); - this.outCapLabelYPower.Name = "outCapLabelYPower"; - this.outCapLabelYPower.Size = new System.Drawing.Size(64, 13); - this.outCapLabelYPower.TabIndex = 218; - this.outCapLabelYPower.Text = "Cap: Output"; - // - // CapTypeActiveXLabelPower - // - this.CapTypeActiveXLabelPower.AutoSize = true; - this.CapTypeActiveXLabelPower.Location = new System.Drawing.Point(200, 788); - this.CapTypeActiveXLabelPower.Name = "CapTypeActiveXLabelPower"; - this.CapTypeActiveXLabelPower.Size = new System.Drawing.Size(16, 13); - this.CapTypeActiveXLabelPower.TabIndex = 219; - this.CapTypeActiveXLabelPower.Text = "In"; - // - // CapTypeActiveYLabelPower - // - this.CapTypeActiveYLabelPower.AutoSize = true; - this.CapTypeActiveYLabelPower.Location = new System.Drawing.Point(414, 783); - this.CapTypeActiveYLabelPower.Name = "CapTypeActiveYLabelPower"; - this.CapTypeActiveYLabelPower.Size = new System.Drawing.Size(16, 13); - this.CapTypeActiveYLabelPower.TabIndex = 220; - this.CapTypeActiveYLabelPower.Text = "In"; - // - // InCapActiveXLabelPower - // - this.InCapActiveXLabelPower.AutoSize = true; - this.InCapActiveXLabelPower.Location = new System.Drawing.Point(200, 810); - this.InCapActiveXLabelPower.Name = "InCapActiveXLabelPower"; - this.InCapActiveXLabelPower.Size = new System.Drawing.Size(13, 13); - this.InCapActiveXLabelPower.TabIndex = 221; - this.InCapActiveXLabelPower.Text = "0"; - // - // OutCapActiveXLabelPower - // - this.OutCapActiveXLabelPower.AutoSize = true; - this.OutCapActiveXLabelPower.Location = new System.Drawing.Point(200, 837); - this.OutCapActiveXLabelPower.Name = "OutCapActiveXLabelPower"; - this.OutCapActiveXLabelPower.Size = new System.Drawing.Size(13, 13); - this.OutCapActiveXLabelPower.TabIndex = 222; - this.OutCapActiveXLabelPower.Text = "0"; - // - // InCapActiveYLabelPower - // - this.InCapActiveYLabelPower.AutoSize = true; - this.InCapActiveYLabelPower.Location = new System.Drawing.Point(417, 810); - this.InCapActiveYLabelPower.Name = "InCapActiveYLabelPower"; - this.InCapActiveYLabelPower.Size = new System.Drawing.Size(13, 13); - this.InCapActiveYLabelPower.TabIndex = 223; - this.InCapActiveYLabelPower.Text = "0"; - // - // OutCapActiveYLabelPower - // - this.OutCapActiveYLabelPower.AutoSize = true; - this.OutCapActiveYLabelPower.Location = new System.Drawing.Point(414, 836); - this.OutCapActiveYLabelPower.Name = "OutCapActiveYLabelPower"; - this.OutCapActiveYLabelPower.Size = new System.Drawing.Size(13, 13); - this.OutCapActiveYLabelPower.TabIndex = 224; - this.OutCapActiveYLabelPower.Text = "0"; - // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2251,7 +2188,6 @@ namespace grapher private System.Windows.Forms.Label constantThreeLabelY; private System.Windows.Forms.Label limitLabelY; private System.Windows.Forms.Label offsetLabelY; - private System.Windows.Forms.Label weightLabelY; private System.Windows.Forms.Label inCapLabelYClassic; private System.Windows.Forms.Label constantOneLabelY; private System.Windows.Forms.CheckBox ByComponentXYLock; @@ -2268,8 +2204,6 @@ namespace grapher private System.Windows.Forms.Label LimitActiveXLabel; private System.Windows.Forms.Label OffsetActiveXLabel; private System.Windows.Forms.Label InCapActiveYLabelClassic; - private System.Windows.Forms.Label WeightActiveYLabel; - private System.Windows.Forms.Label WeightActiveXLabel; private System.Windows.Forms.Label InCapActiveXLabelClassic; private System.Windows.Forms.Label AccelerationActiveLabelX; private System.Windows.Forms.Label AccelTypeActiveLabelX; @@ -2289,9 +2223,6 @@ namespace grapher private System.Windows.Forms.TextBox midpointBoxX; private System.Windows.Forms.Label limitLabelX; private System.Windows.Forms.TextBox limitBoxX; - private System.Windows.Forms.TextBox weightBoxY; - private System.Windows.Forms.Label weightLabelX; - private System.Windows.Forms.TextBox weightBoxX; private System.Windows.Forms.Label inCapLabelXClassic; private System.Windows.Forms.TextBox inCapBoxXClassic; private System.Windows.Forms.Label constantOneLabelX; diff --git a/grapher/Form1.cs b/grapher/Form1.cs index b5a49c8..4d1e57d 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -74,8 +74,6 @@ namespace grapher sensitivityBoxX, VertHorzRatioBox, rotationBox, - weightBoxX, - weightBoxY, inCapBoxXClassic, inCapBoxYClassic, outCapBoxXClassic, @@ -124,8 +122,6 @@ namespace grapher sensitivityLabel, VertHorzRatioLabel, rotationLabel, - weightLabelX, - weightLabelY, inCapLabelXClassic, inCapLabelYClassic, outCapLabelXClassic, @@ -165,8 +161,6 @@ namespace grapher SensitivityMultiplierActiveLabel, VertHorzRatioActiveLabel, RotationActiveLabel, - WeightActiveXLabel, - WeightActiveYLabel, InCapActiveXLabelClassic, InCapActiveYLabelClassic, OutCapActiveXLabelClassic, diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs index f8fb9ef..1248a9c 100644 --- a/grapher/Layouts/ClassicLayout.cs +++ b/grapher/Layouts/ClassicLayout.cs @@ -16,7 +16,6 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(true, PowerClassic); diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index 951052a..9ae10b2 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -17,7 +17,6 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(true, DecayRate); GrowthRateLayout = new OptionLayout(true, GrowthRate); SmoothLayout = new OptionLayout(true, Smooth); - WeightLayout = new OptionLayout(true, Weight); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(true, Limit); PowerClassicLayout = new OptionLayout(true, PowerClassic); diff --git a/grapher/Layouts/JumpLayout.cs b/grapher/Layouts/JumpLayout.cs index 550e821..ab2bc17 100644 --- a/grapher/Layouts/JumpLayout.cs +++ b/grapher/Layouts/JumpLayout.cs @@ -17,7 +17,6 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(true, Smooth); - WeightLayout = new OptionLayout(false, Weight); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(false, Limit); PowerClassicLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs index 2a6e70c..86287b1 100644 --- a/grapher/Layouts/LUTLayout.cs +++ b/grapher/Layouts/LUTLayout.cs @@ -25,7 +25,6 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(false, Weight); OffsetLayout = new OptionLayout(false, Offset); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 4a87504..e7b654f 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -26,7 +26,6 @@ namespace grapher.Layouts SmoothLayout = new OptionLayout(false, string.Empty); ClassicCapLayout = new OptionLayout(false, string.Empty); PowerCapLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); @@ -58,8 +57,6 @@ namespace grapher.Layouts protected OptionLayout PowerCapLayout { get; set; } - protected OptionLayout WeightLayout { get; set; } - protected OptionLayout OffsetLayout { get; set; } protected OptionLayout LimitLayout { get; set; } @@ -90,7 +87,6 @@ namespace grapher.Layouts IOption decayRateOption, IOption growthRateOption, IOption smoothOption, - IOption weightOption, IOption offsetOption, IOption limitOption, IOption powerClassicOption, @@ -111,7 +107,6 @@ namespace grapher.Layouts (DecayRateLayout, decayRateOption), (GrowthRateLayout, growthRateOption), (SmoothLayout, smoothOption), - (WeightLayout, weightOption), (OffsetLayout, offsetOption), (LimitLayout, limitOption), (PowerClassicLayout, powerClassicOption), @@ -146,7 +141,6 @@ namespace grapher.Layouts IOption decayRateOption, IOption growthRateOption, IOption smoothOption, - IOption weightOption, IOption offsetOption, IOption limitOption, IOption powerClassicOption, @@ -162,7 +156,6 @@ namespace grapher.Layouts decayRateOption, growthRateOption, smoothOption, - weightOption, offsetOption, limitOption, powerClassicOption, diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index 63c5ff6..7aa0965 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -18,7 +18,6 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(false, Weight); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/MotivityLayout.cs b/grapher/Layouts/MotivityLayout.cs index d47926a..77c20ab 100644 --- a/grapher/Layouts/MotivityLayout.cs +++ b/grapher/Layouts/MotivityLayout.cs @@ -22,7 +22,6 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(true, GrowthRate); SmoothLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(true, Motivity); PowerClassicLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index d763b3b..452c6aa 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -17,7 +17,6 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(true, DecayRate); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(true, Limit); PowerClassicLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index b696988..64902a5 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -17,7 +17,6 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(false, string.Empty); OffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index a1b7e67..cdc9b98 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -15,7 +15,6 @@ DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(true, Weight); OffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/UnsupportedLayout.cs b/grapher/Layouts/UnsupportedLayout.cs index 3cf1d41..87bf5f8 100644 --- a/grapher/Layouts/UnsupportedLayout.cs +++ b/grapher/Layouts/UnsupportedLayout.cs @@ -22,7 +22,6 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - WeightLayout = new OptionLayout(false, Weight); OffsetLayout = new OptionLayout(false, Offset); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 91a649a..d95489b 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -46,8 +46,6 @@ namespace grapher.Models TextBox sensitivityBoxX, TextBox sensitivityBoxY, TextBox rotationBox, - TextBox weightBoxX, - TextBox weightBoxY, TextBox inCapBoxXClassic, TextBox inCapBoxYClassic, TextBox outCapBoxXClassic, @@ -96,8 +94,6 @@ namespace grapher.Models Label sensitivityLabel, Label yxRatioLabel, Label rotationLabel, - Label weightLabelX, - Label weightLabelY, Label inCapLabelXClassic, Label inCapLabelYClassic, Label outCapLabelXClassic, @@ -137,8 +133,6 @@ namespace grapher.Models Label sensitivityActiveLabel, Label yxRatioActiveLabel, Label rotationActiveLabel, - Label weightActiveXLabel, - Label weightActiveYLabel, Label inCapActiveXLabelClassic, Label inCapActiveYLabelClassic, Label outCapActiveXLabelClassic, @@ -247,24 +241,6 @@ namespace grapher.Models var directionalityLeft = directionalityPanel.Left; - var weightX = new Option( - weightBoxX, - form, - 1, - weightLabelX, - 0, - new ActiveValueLabel(weightActiveXLabel, activeValueTitleX), - "Weight"); - - var weightY = new Option( - weightBoxY, - form, - 1, - weightLabelY, - optionSetYLeft, - new ActiveValueLabel(weightActiveYLabel, activeValueTitleY), - "Weight"); - var offsetX = new Option( offsetBoxX, form, @@ -559,7 +535,6 @@ namespace grapher.Models decayRateX, growthRateX, smoothX, - weightX, offsetX, limitX, powerClassicX, @@ -582,7 +557,6 @@ namespace grapher.Models decayRateY, growthRateY, smoothY, - weightY, offsetY, limitY, powerClassicY, diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index b7a7b7b..029a93e 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -32,7 +32,6 @@ namespace grapher Option decayRate, Option growthRate, Option smooth, - Option weight, Option offset, Option limit, Option powerClassic, @@ -67,7 +66,6 @@ namespace grapher Smooth = smooth; ClassicCap = classicCap; PowerCap = powerCap; - Weight = weight; Offset = offset; Limit = limit; PowerClassic = powerClassic; @@ -114,8 +112,6 @@ namespace grapher public CapOptions PowerCap { get; } - public Option Weight { get; } - public Option Offset { get; } public Option Limit { get; } @@ -227,7 +223,6 @@ namespace grapher Smooth.Hide(); ClassicCap.Hide(); PowerCap.Hide(); - Weight.Hide(); Offset.Hide(); Limit.Hide(); PowerClassic.Hide(); @@ -255,7 +250,6 @@ namespace grapher AccelerationType = AccelTypeFromSettings(ref args); AccelTypeActiveValue.SetValue(AccelerationType.ActiveName); GainSwitch.SetActiveValue(args.gain); - Weight.SetActiveValue(args.weight); ClassicCap.SetActiveValues( args.acceleration, args.cap.x, @@ -343,7 +337,6 @@ namespace grapher if (Exponent.Visible) args.exponentPower = Exponent.Field.Data; if (Offset.Visible) args.offset = Offset.Field.Data; if (Midpoint.Visible) args.midpoint = Midpoint.Field.Data; - if (Weight.Visible) args.weight = Weight.Field.Data; if (LutPanel.Visible) { (var points, var length) = LutPanel.GetPoints(); @@ -370,7 +363,6 @@ namespace grapher ClassicCap.AlignActiveValues(); PowerCap.AlignActiveValues(); Offset.AlignActiveValues(); - Weight.AlignActiveValues(); Limit.AlignActiveValues(); PowerClassic.AlignActiveValues(); Exponent.AlignActiveValues(); @@ -407,7 +399,6 @@ namespace grapher DecayRate, GrowthRate, Smooth, - Weight, Offset, Limit, PowerClassic, -- cgit v1.2.3 From 9cdad754cc299f44ebac1a39e89ce28d01714290 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 16 Sep 2021 13:45:51 -0700 Subject: Fix error in LUT gui --- grapher/Models/Options/LUT/LUTPanelOptions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Options/LUT/LUTPanelOptions.cs b/grapher/Models/Options/LUT/LUTPanelOptions.cs index 11550e4..eedcfa8 100644 --- a/grapher/Models/Options/LUT/LUTPanelOptions.cs +++ b/grapher/Models/Options/LUT/LUTPanelOptions.cs @@ -126,11 +126,11 @@ namespace grapher.Models.Options.LUT y = rawData.ElementAt(data_idx + 1) }; } - ActiveValuesTextBox.Text = PointsToActiveValuesText(points, length); + ActiveValuesTextBox.Text = PointsToActiveValuesText(points, pointsLen); if (string.IsNullOrWhiteSpace(PointsTextBox.Text)) { - PointsTextBox.Text = PointsToEntryTextBoxText(points, length); + PointsTextBox.Text = PointsToEntryTextBoxText(points, pointsLen); } } else -- cgit v1.2.3 From 1fd8881608e4ce6ab21fd78d3ebb42a941cd0e93 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 16 Sep 2021 18:33:30 -0700 Subject: Add power start from one --- grapher/Form1.Designer.cs | 94 +++++++++++++++++ grapher/Form1.cs | 8 ++ grapher/Layouts/ClassicLayout.cs | 1 + grapher/Layouts/DefaultLayout.cs | 1 + grapher/Layouts/JumpLayout.cs | 1 + grapher/Layouts/LUTLayout.cs | 1 + grapher/Layouts/LayoutBase.cs | 8 ++ grapher/Layouts/LinearLayout.cs | 1 + grapher/Layouts/MotivityLayout.cs | 1 + grapher/Layouts/NaturalLayout.cs | 1 + grapher/Layouts/OffLayout.cs | 1 + grapher/Layouts/PowerLayout.cs | 1 + grapher/Layouts/UnsupportedLayout.cs | 1 + grapher/Models/AccelGUIFactory.cs | 24 +++++ grapher/Models/Options/AccelTypeOptions.cs | 9 ++ grapher/Models/Options/SwitchOption.cs | 162 +++++++++++++++++++++++++++++ grapher/grapher.csproj | 1 + 17 files changed, 316 insertions(+) create mode 100644 grapher/Models/Options/SwitchOption.cs (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index a0b102e..6905de1 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -71,6 +71,12 @@ namespace grapher System.Windows.Forms.DataVisualization.Charting.Title title6 = new System.Windows.Forms.DataVisualization.Charting.Title(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RawAcceleration)); this.optionsPanel = new System.Windows.Forms.Panel(); + this.powerStartsFromOneBoxY = new System.Windows.Forms.CheckBox(); + this.powerStartsFromZeroBoxY = new System.Windows.Forms.CheckBox(); + this.powerStartsFromOneBoxX = new System.Windows.Forms.CheckBox(); + this.powerStartsFromZeroBoxX = new System.Windows.Forms.CheckBox(); + this.powerStartFromLabelY = new System.Windows.Forms.Label(); + this.powerStartFromLabelX = new System.Windows.Forms.Label(); this.OutCapActiveYLabelPower = new System.Windows.Forms.Label(); this.InCapActiveYLabelPower = new System.Windows.Forms.Label(); this.OutCapActiveXLabelPower = new System.Windows.Forms.Label(); @@ -248,6 +254,8 @@ namespace grapher this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.powerStartFromActiveLabelX = new System.Windows.Forms.Label(); + this.powerStartFromActiveLabelY = new System.Windows.Forms.Label(); this.optionsPanel.SuspendLayout(); this.DirectionalityPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -263,6 +271,14 @@ namespace grapher // optionsPanel // this.optionsPanel.AutoSize = true; + this.optionsPanel.Controls.Add(this.powerStartFromActiveLabelY); + this.optionsPanel.Controls.Add(this.powerStartFromActiveLabelX); + this.optionsPanel.Controls.Add(this.powerStartsFromOneBoxY); + this.optionsPanel.Controls.Add(this.powerStartsFromZeroBoxY); + this.optionsPanel.Controls.Add(this.powerStartsFromOneBoxX); + this.optionsPanel.Controls.Add(this.powerStartsFromZeroBoxX); + this.optionsPanel.Controls.Add(this.powerStartFromLabelY); + this.optionsPanel.Controls.Add(this.powerStartFromLabelX); this.optionsPanel.Controls.Add(this.OutCapActiveYLabelPower); this.optionsPanel.Controls.Add(this.InCapActiveYLabelPower); this.optionsPanel.Controls.Add(this.OutCapActiveXLabelPower); @@ -408,6 +424,58 @@ namespace grapher this.optionsPanel.Size = new System.Drawing.Size(483, 956); this.optionsPanel.TabIndex = 34; // + // powerStartsFromOneBoxY + // + this.powerStartsFromOneBoxY.Location = new System.Drawing.Point(363, 220); + this.powerStartsFromOneBoxY.Name = "powerStartsFromOneBoxY"; + this.powerStartsFromOneBoxY.Size = new System.Drawing.Size(32, 17); + this.powerStartsFromOneBoxY.TabIndex = 0; + this.powerStartsFromOneBoxY.Text = "1"; + this.powerStartsFromOneBoxY.UseVisualStyleBackColor = true; + // + // powerStartsFromZeroBoxY + // + this.powerStartsFromZeroBoxY.Location = new System.Drawing.Point(332, 220); + this.powerStartsFromZeroBoxY.Name = "powerStartsFromZeroBoxY"; + this.powerStartsFromZeroBoxY.Size = new System.Drawing.Size(32, 17); + this.powerStartsFromZeroBoxY.TabIndex = 0; + this.powerStartsFromZeroBoxY.Text = "0"; + this.powerStartsFromZeroBoxY.UseVisualStyleBackColor = true; + // + // powerStartsFromOneBoxX + // + this.powerStartsFromOneBoxX.Location = new System.Drawing.Point(136, 220); + this.powerStartsFromOneBoxX.Name = "powerStartsFromOneBoxX"; + this.powerStartsFromOneBoxX.Size = new System.Drawing.Size(32, 17); + this.powerStartsFromOneBoxX.TabIndex = 0; + this.powerStartsFromOneBoxX.Text = "1"; + this.powerStartsFromOneBoxX.UseVisualStyleBackColor = true; + // + // powerStartsFromZeroBoxX + // + this.powerStartsFromZeroBoxX.Location = new System.Drawing.Point(106, 220); + this.powerStartsFromZeroBoxX.Name = "powerStartsFromZeroBoxX"; + this.powerStartsFromZeroBoxX.Size = new System.Drawing.Size(32, 17); + this.powerStartsFromZeroBoxX.TabIndex = 0; + this.powerStartsFromZeroBoxX.Text = "0"; + this.powerStartsFromZeroBoxX.UseVisualStyleBackColor = true; + // + // powerStartFromLabelY + // + this.powerStartFromLabelY.Location = new System.Drawing.Point(266, 220); + this.powerStartFromLabelY.Name = "powerStartFromLabelY"; + this.powerStartFromLabelY.Size = new System.Drawing.Size(52, 13); + this.powerStartFromLabelY.TabIndex = 0; + this.powerStartFromLabelY.Text = "Start from"; + // + // powerStartFromLabelX + // + this.powerStartFromLabelX.Location = new System.Drawing.Point(38, 220); + this.powerStartFromLabelX.Name = "powerStartFromLabelX"; + this.powerStartFromLabelX.Size = new System.Drawing.Size(55, 13); + this.powerStartFromLabelX.TabIndex = 0; + this.powerStartFromLabelX.Text = "Start from"; + // // OutCapActiveYLabelPower // this.OutCapActiveYLabelPower.AutoSize = true; @@ -2138,6 +2206,24 @@ namespace grapher title6.Text = "Sensitivity"; this.AccelerationChart.Titles.Add(title6); // + // powerStartFromActiveLabelX + // + this.powerStartFromActiveLabelX.AutoSize = true; + this.powerStartFromActiveLabelX.Location = new System.Drawing.Point(197, 220); + this.powerStartFromActiveLabelX.Name = "powerStartFromActiveLabelX"; + this.powerStartFromActiveLabelX.Size = new System.Drawing.Size(13, 13); + this.powerStartFromActiveLabelX.TabIndex = 225; + this.powerStartFromActiveLabelX.Text = "0"; + // + // powerStartFromActiveLabelY + // + this.powerStartFromActiveLabelY.AutoSize = true; + this.powerStartFromActiveLabelY.Location = new System.Drawing.Point(414, 221); + this.powerStartFromActiveLabelY.Name = "powerStartFromActiveLabelY"; + this.powerStartFromActiveLabelY.Size = new System.Drawing.Size(13, 13); + this.powerStartFromActiveLabelY.TabIndex = 226; + this.powerStartFromActiveLabelY.Text = "0"; + // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2345,6 +2431,14 @@ namespace grapher private System.Windows.Forms.TextBox outCapBoxXPower; private System.Windows.Forms.TextBox inCapBoxYPower; private System.Windows.Forms.TextBox inCapBoxXPower; + private System.Windows.Forms.CheckBox powerStartsFromOneBoxY; + private System.Windows.Forms.CheckBox powerStartsFromZeroBoxY; + private System.Windows.Forms.CheckBox powerStartsFromOneBoxX; + private System.Windows.Forms.CheckBox powerStartsFromZeroBoxX; + private System.Windows.Forms.Label powerStartFromLabelY; + private System.Windows.Forms.Label powerStartFromLabelX; + private System.Windows.Forms.Label powerStartFromActiveLabelX; + private System.Windows.Forms.Label powerStartFromActiveLabelY; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 4d1e57d..9e88912 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -114,6 +114,10 @@ namespace grapher ByComponentCheckBox, gainSwitchX, gainSwitchY, + powerStartsFromZeroBoxX, + powerStartsFromOneBoxX, + powerStartsFromZeroBoxY, + powerStartsFromOneBoxY, XLutActiveValuesBox, YLutActiveValuesBox, XLutPointsBox, @@ -152,6 +156,8 @@ namespace grapher powerLabelY, expLabelX, expLabelY, + powerStartFromLabelX, + powerStartFromLabelY, LUTTextLabelX, LUTTextLabelY, constantThreeLabelX, @@ -191,6 +197,8 @@ namespace grapher PowerClassicActiveYLabel, ExpActiveXLabel, ExpActiveYLabel, + powerStartFromActiveLabelX, + powerStartFromActiveLabelY, MidpointActiveXLabel, MidpointActiveYLabel, AccelTypeActiveLabelX, diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs index 1248a9c..05c590f 100644 --- a/grapher/Layouts/ClassicLayout.cs +++ b/grapher/Layouts/ClassicLayout.cs @@ -20,6 +20,7 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(true, PowerClassic); ExponentLayout = new OptionLayout(false, string.Empty); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index 9ae10b2..1b45307 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -21,6 +21,7 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(true, Limit); PowerClassicLayout = new OptionLayout(true, PowerClassic); ExponentLayout = new OptionLayout(true, Exponent); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(true, Midpoint); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/JumpLayout.cs b/grapher/Layouts/JumpLayout.cs index ab2bc17..40e7629 100644 --- a/grapher/Layouts/JumpLayout.cs +++ b/grapher/Layouts/JumpLayout.cs @@ -21,6 +21,7 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, Limit); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs index 86287b1..5412294 100644 --- a/grapher/Layouts/LUTLayout.cs +++ b/grapher/Layouts/LUTLayout.cs @@ -28,6 +28,7 @@ namespace grapher.Layouts OffsetLayout = new OptionLayout(false, Offset); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, Exponent); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(true, string.Empty); diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index e7b654f..a283008 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -9,6 +9,7 @@ namespace grapher.Layouts public const string DecayRate = "Decay Rate"; public const string Scale = "Scale"; public const string Exponent = "Exponent"; + public const string StartsFrom = "Start from"; public const string PowerClassic = "Power"; public const string Limit = "Limit"; public const string Midpoint = "Midpoint"; @@ -30,6 +31,7 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); @@ -65,6 +67,8 @@ namespace grapher.Layouts protected OptionLayout ExponentLayout { get; set; } + protected OptionLayout PowerStartsFromLayout { get; set; } + protected OptionLayout MidpointLayout { get; set; } protected OptionLayout LutTextLayout { get; set; } @@ -91,6 +95,7 @@ namespace grapher.Layouts IOption limitOption, IOption powerClassicOption, IOption expOption, + IOption startsFromOption, IOption midpointOption, IOption lutTextOption, IOption lutPanelOption, @@ -111,6 +116,7 @@ namespace grapher.Layouts (LimitLayout, limitOption), (PowerClassicLayout, powerClassicOption), (ExponentLayout, expOption), + (PowerStartsFromLayout, startsFromOption), (MidpointLayout, midpointOption), (LutTextLayout, lutTextOption), (LutPanelLayout, lutPanelOption), @@ -145,6 +151,7 @@ namespace grapher.Layouts IOption limitOption, IOption powerClassicOption, IOption expOption, + IOption startsFromOption, IOption midpointOption, IOption lutTextOption, IOption lutPanelOption, @@ -160,6 +167,7 @@ namespace grapher.Layouts limitOption, powerClassicOption, expOption, + startsFromOption, midpointOption, lutTextOption, lutPanelOption, diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index 7aa0965..f6b3cc0 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -21,6 +21,7 @@ namespace grapher.Layouts OffsetLayout = new OptionLayout(true, Offset); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/MotivityLayout.cs b/grapher/Layouts/MotivityLayout.cs index 77c20ab..ebce103 100644 --- a/grapher/Layouts/MotivityLayout.cs +++ b/grapher/Layouts/MotivityLayout.cs @@ -26,6 +26,7 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(true, Motivity); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(true, Midpoint); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index 452c6aa..ed5ade9 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -21,6 +21,7 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(true, Limit); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index 64902a5..92333d9 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -21,6 +21,7 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index cdc9b98..c25bbbb 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -19,6 +19,7 @@ LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(true, Exponent); + PowerStartsFromLayout = new OptionLayout(true, StartsFrom); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/UnsupportedLayout.cs b/grapher/Layouts/UnsupportedLayout.cs index 87bf5f8..3faf721 100644 --- a/grapher/Layouts/UnsupportedLayout.cs +++ b/grapher/Layouts/UnsupportedLayout.cs @@ -26,6 +26,7 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, Exponent); + PowerStartsFromLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(true, LUTLayoutText); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index d95489b..89318e2 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -86,6 +86,10 @@ namespace grapher.Models CheckBox byComponentCheckBox, CheckBox gainSwitchX, CheckBox gainSwitchY, + CheckBox powerStartsFromZeroBoxX, + CheckBox powerStartsFromOneBoxX, + CheckBox powerStartsFromZeroBoxY, + CheckBox powerStartsFromOneBoxY, RichTextBox xLutActiveValuesBox, RichTextBox yLutActiveValuesBox, RichTextBox xLutPointsBox, @@ -124,6 +128,8 @@ namespace grapher.Models Label powerClassicLabelY, Label expLabelX, Label expLabelY, + Label powerStartsFromLabelX, + Label powerStartsFromLabelY, Label lutTextLabelX, Label lutTextLabelY, Label constantThreeLabelX, @@ -163,6 +169,8 @@ namespace grapher.Models Label powerClassicActiveLabelY, Label expActiveLabelX, Label expActiveLabelY, + Label powerStartsFromActiveLabelX, + Label powerStartsFromActiveLabelY, Label midpointActiveLabelX, Label midpointActiveLabelY, Label accelTypeActiveLabelX, @@ -487,6 +495,20 @@ namespace grapher.Models outCapYPower, scaleY); + var powerStartsFromX = new SwitchOption( + powerStartsFromLabelX, + powerStartsFromZeroBoxX, + powerStartsFromOneBoxX, + new ActiveValueLabel(powerStartsFromActiveLabelX, activeValueTitleX), + 0); + + var powerStartsFromY = new SwitchOption( + powerStartsFromLabelY, + powerStartsFromZeroBoxY, + powerStartsFromOneBoxY, + new ActiveValueLabel(powerStartsFromActiveLabelY, activeValueTitleY), + optionSetYLeft); + var lpNorm = new Option( new Field(lpNormBox, form, 2), lpNormLabel, @@ -532,6 +554,7 @@ namespace grapher.Models gainSwitchOptionX, classicCapOptionsX, powerCapOptionsX, + powerStartsFromX, decayRateX, growthRateX, smoothX, @@ -554,6 +577,7 @@ namespace grapher.Models gainSwitchOptionY, classicCapOptionsY, powerCapOptionsY, + powerStartsFromY, decayRateY, growthRateY, smoothY, diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 029a93e..b3153ed 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -29,6 +29,7 @@ namespace grapher CheckBoxOption gainSwitch, CapOptions classicCap, CapOptions powerCap, + SwitchOption powerStartsFrom, Option decayRate, Option growthRate, Option smooth, @@ -70,6 +71,7 @@ namespace grapher Limit = limit; PowerClassic = powerClassic; Exponent = exponent; + PowerStartsFrom = powerStartsFrom; Midpoint = midpoint; WriteButton = writeButton; AccelTypeActiveValue = accelTypeActiveValue; @@ -112,6 +114,8 @@ namespace grapher public CapOptions PowerCap { get; } + public SwitchOption PowerStartsFrom { get; } + public Option Offset { get; } public Option Limit { get; } @@ -223,6 +227,7 @@ namespace grapher Smooth.Hide(); ClassicCap.Hide(); PowerCap.Hide(); + PowerStartsFrom.Hide(); Offset.Hide(); Limit.Hide(); PowerClassic.Hide(); @@ -260,6 +265,7 @@ namespace grapher args.cap.x, args.cap.y, args.capMode); + PowerStartsFrom.SetActiveValue(!args.powerStartFromOne); Offset.SetActiveValue(args.offset); DecayRate.SetActiveValue(args.decayRate); GrowthRate.SetActiveValue(args.growthRate); @@ -322,6 +328,7 @@ namespace grapher args.cap.y = PowerCap.Out.Field.Data; args.capMode = PowerCap.CapTypeOptions.GetSelectedCapMode(); } + if (PowerStartsFrom.Visible) args.powerStartFromOne = PowerStartsFrom.Second.Checked; if (Limit.Visible) { if (args.mode == AccelMode.motivity) @@ -362,6 +369,7 @@ namespace grapher Smooth.AlignActiveValues(); ClassicCap.AlignActiveValues(); PowerCap.AlignActiveValues(); + PowerStartsFrom.AlignActiveValues(); Offset.AlignActiveValues(); Limit.AlignActiveValues(); PowerClassic.AlignActiveValues(); @@ -403,6 +411,7 @@ namespace grapher Limit, PowerClassic, Exponent, + PowerStartsFrom, Midpoint, LutText, LutPanel, diff --git a/grapher/Models/Options/SwitchOption.cs b/grapher/Models/Options/SwitchOption.cs new file mode 100644 index 0000000..79991c1 --- /dev/null +++ b/grapher/Models/Options/SwitchOption.cs @@ -0,0 +1,162 @@ +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 SwitchOption : OptionBase + { + + #region Constructors + + public SwitchOption( + Label label, + CheckBox firstCheckBox, + CheckBox secondCheckBox, + ActiveValueLabel activeValueLabel, + int left) + { + Label = label; + First = firstCheckBox; + Second = secondCheckBox; + ActiveValueLabel = activeValueLabel; + Left = left; + + label.AutoSize = false; + label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + label.Width = First.Left - left - Constants.OptionLabelBoxSeperation; + label.Height = First.Height; + + ActiveValueLabel.Height = First.Height; + + First.CheckedChanged += OnFirstCheckedChange; + Second.CheckedChanged += OnSecondCheckedChange; + + First.Checked = true; + Second.Left = First.Left + First.Width + Constants.OptionLabelBoxSeperation; + Show(string.Empty); + } + + #endregion Constructors + + #region Properties + + public Label Label { get; } + + public CheckBox First { get; } + + public CheckBox Second { get; } + + public ActiveValueLabel ActiveValueLabel { get; } + + public override int Height + { + get => Label.Height; + } + + public override int Left + { + get => Label.Left; + set + { + Label.Left = value; + } + } + + public override bool Visible + { + get => ShouldShow; + } + + public override int Width + { + get => Second.Left + Second.Width - Label.Left; + set + { + } + } + + public override int Top + { + get => Label.Top; + set + { + Label.Top = value; + First.Top = value; + Second.Top = value; + ActiveValueLabel.Top = value; + } + } + + private bool ShouldShow { get; set; } + + #endregion Properties + + #region Methods + + public override void AlignActiveValues() + { + ActiveValueLabel.Align(); + } + + public override void Hide() + { + ShouldShow = false; + + Label.Hide(); + First.Hide(); + Second.Hide(); + ActiveValueLabel.Hide(); + } + + public override void Show(string name) + { + ShouldShow = true; + + if (!string.IsNullOrWhiteSpace(name)) + { + Label.Text = name; + } + + Label.Show(); + First.Show(); + Second.Show(); + ActiveValueLabel.Show(); + } + + public void SetActiveValue(bool shouldFirstBeChecked) + { + if (shouldFirstBeChecked) + { + First.Checked = true; + ActiveValueLabel.SetValue(First.Text); + } + else + { + Second.Checked = true; + ActiveValueLabel.SetValue(Second.Text); + } + } + + private void OnFirstCheckedChange(object sender, EventArgs e) + { + if (First.Checked) + { + Second.Checked = false; + } + } + + private void OnSecondCheckedChange(object sender, EventArgs e) + { + if (Second.Checked) + { + First.Checked = false; + } + } + + #endregion Methods + } +} diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index 702d89e..51c7fb6 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -145,6 +145,7 @@ + -- cgit v1.2.3 From 115030165d539fde5440f6232879c7a076dea2ec Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Sat, 18 Sep 2021 05:20:53 -0400 Subject: generalize power start-from-1 starting output is determined by (gain) offset --- grapher/Form1.Designer.cs | 255 ++++++++++++----------------- grapher/Form1.cs | 26 ++- grapher/Layouts/ClassicLayout.cs | 4 +- grapher/Layouts/DefaultLayout.cs | 4 +- grapher/Layouts/JumpLayout.cs | 4 +- grapher/Layouts/LUTLayout.cs | 4 +- grapher/Layouts/LayoutBase.cs | 28 ++-- grapher/Layouts/LinearLayout.cs | 4 +- grapher/Layouts/MotivityLayout.cs | 4 +- grapher/Layouts/NaturalLayout.cs | 4 +- grapher/Layouts/OffLayout.cs | 4 +- grapher/Layouts/PowerLayout.cs | 4 +- grapher/Layouts/UnsupportedLayout.cs | 4 +- grapher/Models/AccelGUIFactory.cs | 82 +++++----- grapher/Models/Options/AccelTypeOptions.cs | 32 ++-- 15 files changed, 213 insertions(+), 250 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 6905de1..4625bca 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -71,12 +71,6 @@ namespace grapher System.Windows.Forms.DataVisualization.Charting.Title title6 = new System.Windows.Forms.DataVisualization.Charting.Title(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RawAcceleration)); this.optionsPanel = new System.Windows.Forms.Panel(); - this.powerStartsFromOneBoxY = new System.Windows.Forms.CheckBox(); - this.powerStartsFromZeroBoxY = new System.Windows.Forms.CheckBox(); - this.powerStartsFromOneBoxX = new System.Windows.Forms.CheckBox(); - this.powerStartsFromZeroBoxX = new System.Windows.Forms.CheckBox(); - this.powerStartFromLabelY = new System.Windows.Forms.Label(); - this.powerStartFromLabelX = new System.Windows.Forms.Label(); this.OutCapActiveYLabelPower = new System.Windows.Forms.Label(); this.InCapActiveYLabelPower = new System.Windows.Forms.Label(); this.OutCapActiveXLabelPower = new System.Windows.Forms.Label(); @@ -188,22 +182,26 @@ namespace grapher this.OptionSetXTitle = new System.Windows.Forms.Label(); this.constantThreeLabelY = new System.Windows.Forms.Label(); this.limitLabelY = new System.Windows.Forms.Label(); - this.offsetLabelY = new System.Windows.Forms.Label(); + this.inputOffsetLabelY = new System.Windows.Forms.Label(); + this.outputOffsetLabelY = new System.Windows.Forms.Label(); this.inCapLabelYClassic = new System.Windows.Forms.Label(); this.constantOneLabelY = new System.Windows.Forms.Label(); this.ByComponentXYLock = new System.Windows.Forms.CheckBox(); this.MidpointActiveYLabel = new System.Windows.Forms.Label(); this.LimitActiveYLabel = new System.Windows.Forms.Label(); - this.OffsetActiveYLabel = new System.Windows.Forms.Label(); + this.InputOffsetActiveYLabel = new System.Windows.Forms.Label(); + this.OutputOffsetActiveYLabel = new System.Windows.Forms.Label(); this.AccelerationActiveLabelY = new System.Windows.Forms.Label(); this.accelTypeDropY = new System.Windows.Forms.ComboBox(); this.midpointBoxY = new System.Windows.Forms.TextBox(); this.limitBoxY = new System.Windows.Forms.TextBox(); - this.offsetBoxY = new System.Windows.Forms.TextBox(); + this.inputOffsetBoxY = new System.Windows.Forms.TextBox(); + this.outputOffsetBoxY = new System.Windows.Forms.TextBox(); this.accelerationBoxY = new System.Windows.Forms.TextBox(); this.MidpointActiveXLabel = new System.Windows.Forms.Label(); this.LimitActiveXLabel = new System.Windows.Forms.Label(); - this.OffsetActiveXLabel = new System.Windows.Forms.Label(); + this.InputOffsetActiveXLabel = new System.Windows.Forms.Label(); + this.OutputOffsetActiveXLabel = new System.Windows.Forms.Label(); this.InCapActiveYLabelClassic = new System.Windows.Forms.Label(); this.InCapActiveXLabelClassic = new System.Windows.Forms.Label(); this.AccelerationActiveLabelX = new System.Windows.Forms.Label(); @@ -218,8 +216,10 @@ namespace grapher this.inCapBoxYClassic = new System.Windows.Forms.TextBox(); this.VertHorzRatioBox = new System.Windows.Forms.TextBox(); this.writeButton = new System.Windows.Forms.Button(); - this.offsetLabelX = new System.Windows.Forms.Label(); - this.offsetBoxX = new System.Windows.Forms.TextBox(); + this.inputOffsetLabelX = new System.Windows.Forms.Label(); + this.outputOffsetLabelX = new System.Windows.Forms.Label(); + this.inputOffsetBoxX = new System.Windows.Forms.TextBox(); + this.outputOffsetBoxX = new System.Windows.Forms.TextBox(); this.constantThreeLabelX = new System.Windows.Forms.Label(); this.midpointBoxX = new System.Windows.Forms.TextBox(); this.limitLabelX = new System.Windows.Forms.Label(); @@ -254,8 +254,6 @@ namespace grapher this.GainChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.VelocityChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); - this.powerStartFromActiveLabelX = new System.Windows.Forms.Label(); - this.powerStartFromActiveLabelY = new System.Windows.Forms.Label(); this.optionsPanel.SuspendLayout(); this.DirectionalityPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -271,14 +269,6 @@ namespace grapher // optionsPanel // this.optionsPanel.AutoSize = true; - this.optionsPanel.Controls.Add(this.powerStartFromActiveLabelY); - this.optionsPanel.Controls.Add(this.powerStartFromActiveLabelX); - this.optionsPanel.Controls.Add(this.powerStartsFromOneBoxY); - this.optionsPanel.Controls.Add(this.powerStartsFromZeroBoxY); - this.optionsPanel.Controls.Add(this.powerStartsFromOneBoxX); - this.optionsPanel.Controls.Add(this.powerStartsFromZeroBoxX); - this.optionsPanel.Controls.Add(this.powerStartFromLabelY); - this.optionsPanel.Controls.Add(this.powerStartFromLabelX); this.optionsPanel.Controls.Add(this.OutCapActiveYLabelPower); this.optionsPanel.Controls.Add(this.InCapActiveYLabelPower); this.optionsPanel.Controls.Add(this.OutCapActiveXLabelPower); @@ -371,22 +361,26 @@ namespace grapher this.optionsPanel.Controls.Add(this.OptionSetXTitle); this.optionsPanel.Controls.Add(this.constantThreeLabelY); this.optionsPanel.Controls.Add(this.limitLabelY); - this.optionsPanel.Controls.Add(this.offsetLabelY); + this.optionsPanel.Controls.Add(this.inputOffsetLabelY); + this.optionsPanel.Controls.Add(this.outputOffsetLabelY); this.optionsPanel.Controls.Add(this.inCapLabelYClassic); this.optionsPanel.Controls.Add(this.constantOneLabelY); this.optionsPanel.Controls.Add(this.ByComponentXYLock); this.optionsPanel.Controls.Add(this.MidpointActiveYLabel); this.optionsPanel.Controls.Add(this.LimitActiveYLabel); - this.optionsPanel.Controls.Add(this.OffsetActiveYLabel); + this.optionsPanel.Controls.Add(this.InputOffsetActiveYLabel); + this.optionsPanel.Controls.Add(this.OutputOffsetActiveYLabel); this.optionsPanel.Controls.Add(this.AccelerationActiveLabelY); this.optionsPanel.Controls.Add(this.accelTypeDropY); this.optionsPanel.Controls.Add(this.midpointBoxY); this.optionsPanel.Controls.Add(this.limitBoxY); - this.optionsPanel.Controls.Add(this.offsetBoxY); + this.optionsPanel.Controls.Add(this.inputOffsetBoxY); + this.optionsPanel.Controls.Add(this.outputOffsetBoxY); this.optionsPanel.Controls.Add(this.accelerationBoxY); this.optionsPanel.Controls.Add(this.MidpointActiveXLabel); this.optionsPanel.Controls.Add(this.LimitActiveXLabel); - this.optionsPanel.Controls.Add(this.OffsetActiveXLabel); + this.optionsPanel.Controls.Add(this.InputOffsetActiveXLabel); + this.optionsPanel.Controls.Add(this.OutputOffsetActiveXLabel); this.optionsPanel.Controls.Add(this.InCapActiveYLabelClassic); this.optionsPanel.Controls.Add(this.InCapActiveXLabelClassic); this.optionsPanel.Controls.Add(this.AccelerationActiveLabelX); @@ -401,8 +395,10 @@ namespace grapher this.optionsPanel.Controls.Add(this.inCapBoxYClassic); this.optionsPanel.Controls.Add(this.VertHorzRatioBox); this.optionsPanel.Controls.Add(this.writeButton); - this.optionsPanel.Controls.Add(this.offsetLabelX); - this.optionsPanel.Controls.Add(this.offsetBoxX); + this.optionsPanel.Controls.Add(this.inputOffsetLabelX); + this.optionsPanel.Controls.Add(this.outputOffsetLabelX); + this.optionsPanel.Controls.Add(this.inputOffsetBoxX); + this.optionsPanel.Controls.Add(this.outputOffsetBoxX); this.optionsPanel.Controls.Add(this.constantThreeLabelX); this.optionsPanel.Controls.Add(this.midpointBoxX); this.optionsPanel.Controls.Add(this.limitLabelX); @@ -423,59 +419,7 @@ namespace grapher this.optionsPanel.Name = "optionsPanel"; this.optionsPanel.Size = new System.Drawing.Size(483, 956); this.optionsPanel.TabIndex = 34; - // - // powerStartsFromOneBoxY - // - this.powerStartsFromOneBoxY.Location = new System.Drawing.Point(363, 220); - this.powerStartsFromOneBoxY.Name = "powerStartsFromOneBoxY"; - this.powerStartsFromOneBoxY.Size = new System.Drawing.Size(32, 17); - this.powerStartsFromOneBoxY.TabIndex = 0; - this.powerStartsFromOneBoxY.Text = "1"; - this.powerStartsFromOneBoxY.UseVisualStyleBackColor = true; - // - // powerStartsFromZeroBoxY - // - this.powerStartsFromZeroBoxY.Location = new System.Drawing.Point(332, 220); - this.powerStartsFromZeroBoxY.Name = "powerStartsFromZeroBoxY"; - this.powerStartsFromZeroBoxY.Size = new System.Drawing.Size(32, 17); - this.powerStartsFromZeroBoxY.TabIndex = 0; - this.powerStartsFromZeroBoxY.Text = "0"; - this.powerStartsFromZeroBoxY.UseVisualStyleBackColor = true; - // - // powerStartsFromOneBoxX - // - this.powerStartsFromOneBoxX.Location = new System.Drawing.Point(136, 220); - this.powerStartsFromOneBoxX.Name = "powerStartsFromOneBoxX"; - this.powerStartsFromOneBoxX.Size = new System.Drawing.Size(32, 17); - this.powerStartsFromOneBoxX.TabIndex = 0; - this.powerStartsFromOneBoxX.Text = "1"; - this.powerStartsFromOneBoxX.UseVisualStyleBackColor = true; - // - // powerStartsFromZeroBoxX - // - this.powerStartsFromZeroBoxX.Location = new System.Drawing.Point(106, 220); - this.powerStartsFromZeroBoxX.Name = "powerStartsFromZeroBoxX"; - this.powerStartsFromZeroBoxX.Size = new System.Drawing.Size(32, 17); - this.powerStartsFromZeroBoxX.TabIndex = 0; - this.powerStartsFromZeroBoxX.Text = "0"; - this.powerStartsFromZeroBoxX.UseVisualStyleBackColor = true; - // - // powerStartFromLabelY - // - this.powerStartFromLabelY.Location = new System.Drawing.Point(266, 220); - this.powerStartFromLabelY.Name = "powerStartFromLabelY"; - this.powerStartFromLabelY.Size = new System.Drawing.Size(52, 13); - this.powerStartFromLabelY.TabIndex = 0; - this.powerStartFromLabelY.Text = "Start from"; - // - // powerStartFromLabelX - // - this.powerStartFromLabelX.Location = new System.Drawing.Point(38, 220); - this.powerStartFromLabelX.Name = "powerStartFromLabelX"; - this.powerStartFromLabelX.Size = new System.Drawing.Size(55, 13); - this.powerStartFromLabelX.TabIndex = 0; - this.powerStartFromLabelX.Text = "Start from"; - // + // // OutCapActiveYLabelPower // this.OutCapActiveYLabelPower.AutoSize = true; @@ -1452,12 +1396,19 @@ namespace grapher // // offsetLabelY // - this.offsetLabelY.AutoSize = true; - this.offsetLabelY.Location = new System.Drawing.Point(263, 248); - this.offsetLabelY.Name = "offsetLabelY"; - this.offsetLabelY.Size = new System.Drawing.Size(35, 13); - this.offsetLabelY.TabIndex = 135; - this.offsetLabelY.Text = "Offset"; + this.inputOffsetLabelY.AutoSize = true; + this.inputOffsetLabelY.Location = new System.Drawing.Point(263, 248); + this.inputOffsetLabelY.Name = "inputOffsetLabelY"; + this.inputOffsetLabelY.Size = new System.Drawing.Size(35, 13); + this.inputOffsetLabelY.TabIndex = 135; + this.inputOffsetLabelY.Text = "Input Offset"; + + this.outputOffsetLabelY.AutoSize = true; + this.outputOffsetLabelY.Location = new System.Drawing.Point(263, 248); + this.outputOffsetLabelY.Name = "outputOffsetLabelY"; + this.outputOffsetLabelY.Size = new System.Drawing.Size(35, 13); + this.outputOffsetLabelY.TabIndex = 135; + this.outputOffsetLabelY.Text = "Output Offset"; // // inCapLabelYClassic // @@ -1508,12 +1459,19 @@ namespace grapher // // OffsetActiveYLabel // - this.OffsetActiveYLabel.AutoSize = true; - this.OffsetActiveYLabel.Location = new System.Drawing.Point(414, 248); - this.OffsetActiveYLabel.Name = "OffsetActiveYLabel"; - this.OffsetActiveYLabel.Size = new System.Drawing.Size(13, 13); - this.OffsetActiveYLabel.TabIndex = 129; - this.OffsetActiveYLabel.Text = "0"; + this.InputOffsetActiveYLabel.AutoSize = true; + this.InputOffsetActiveYLabel.Location = new System.Drawing.Point(414, 248); + this.InputOffsetActiveYLabel.Name = "InputOffsetActiveYLabel"; + this.InputOffsetActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.InputOffsetActiveYLabel.TabIndex = 129; + this.InputOffsetActiveYLabel.Text = "0"; + + this.OutputOffsetActiveYLabel.AutoSize = true; + this.OutputOffsetActiveYLabel.Location = new System.Drawing.Point(414, 248); + this.OutputOffsetActiveYLabel.Name = "OutputOffsetActiveYLabel"; + this.OutputOffsetActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.OutputOffsetActiveYLabel.TabIndex = 129; + this.OutputOffsetActiveYLabel.Text = "0"; // // AccelerationActiveLabelY // @@ -1549,10 +1507,15 @@ namespace grapher // // offsetBoxY // - this.offsetBoxY.Location = new System.Drawing.Point(332, 245); - this.offsetBoxY.Name = "offsetBoxY"; - this.offsetBoxY.Size = new System.Drawing.Size(76, 20); - this.offsetBoxY.TabIndex = 106; + this.inputOffsetBoxY.Location = new System.Drawing.Point(332, 245); + this.inputOffsetBoxY.Name = "inputOffsetBoxY"; + this.inputOffsetBoxY.Size = new System.Drawing.Size(76, 20); + this.inputOffsetBoxY.TabIndex = 106; + + this.outputOffsetBoxY.Location = new System.Drawing.Point(332, 245); + this.outputOffsetBoxY.Name = "outputOffsetBoxY"; + this.outputOffsetBoxY.Size = new System.Drawing.Size(76, 20); + this.outputOffsetBoxY.TabIndex = 106; // // accelerationBoxY // @@ -1581,12 +1544,19 @@ namespace grapher // // OffsetActiveXLabel // - this.OffsetActiveXLabel.AutoSize = true; - this.OffsetActiveXLabel.Location = new System.Drawing.Point(197, 248); - this.OffsetActiveXLabel.Name = "OffsetActiveXLabel"; - this.OffsetActiveXLabel.Size = new System.Drawing.Size(13, 13); - this.OffsetActiveXLabel.TabIndex = 125; - this.OffsetActiveXLabel.Text = "0"; + this.InputOffsetActiveXLabel.AutoSize = true; + this.InputOffsetActiveXLabel.Location = new System.Drawing.Point(197, 248); + this.InputOffsetActiveXLabel.Name = "InputOffsetActiveXLabel"; + this.InputOffsetActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.InputOffsetActiveXLabel.TabIndex = 125; + this.InputOffsetActiveXLabel.Text = "0"; + + this.OutputOffsetActiveXLabel.AutoSize = true; + this.OutputOffsetActiveXLabel.Location = new System.Drawing.Point(197, 248); + this.OutputOffsetActiveXLabel.Name = "OutputOffsetActiveXLabel"; + this.OutputOffsetActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.OutputOffsetActiveXLabel.TabIndex = 125; + this.OutputOffsetActiveXLabel.Text = "0"; // // InCapActiveYLabelClassic // @@ -1715,20 +1685,33 @@ namespace grapher // // offsetLabelX // - this.offsetLabelX.AutoSize = true; - this.offsetLabelX.Location = new System.Drawing.Point(37, 248); - this.offsetLabelX.Name = "offsetLabelX"; - this.offsetLabelX.Size = new System.Drawing.Size(35, 13); - this.offsetLabelX.TabIndex = 107; - this.offsetLabelX.Text = "Offset"; - this.offsetLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.inputOffsetLabelX.AutoSize = true; + this.inputOffsetLabelX.Location = new System.Drawing.Point(37, 248); + this.inputOffsetLabelX.Name = "inputOffsetLabelX"; + this.inputOffsetLabelX.Size = new System.Drawing.Size(35, 13); + this.inputOffsetLabelX.TabIndex = 107; + this.inputOffsetLabelX.Text = "Input Offset"; + this.inputOffsetLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + + this.outputOffsetLabelX.AutoSize = true; + this.outputOffsetLabelX.Location = new System.Drawing.Point(37, 248); + this.outputOffsetLabelX.Name = "outputOffsetLabelX"; + this.outputOffsetLabelX.Size = new System.Drawing.Size(35, 13); + this.outputOffsetLabelX.TabIndex = 107; + this.outputOffsetLabelX.Text = "Output Offset"; + this.outputOffsetLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // offsetBoxX // - this.offsetBoxX.Location = new System.Drawing.Point(106, 245); - this.offsetBoxX.Name = "offsetBoxX"; - this.offsetBoxX.Size = new System.Drawing.Size(76, 20); - this.offsetBoxX.TabIndex = 92; + this.inputOffsetBoxX.Location = new System.Drawing.Point(106, 245); + this.inputOffsetBoxX.Name = "inputOffsetBoxX"; + this.inputOffsetBoxX.Size = new System.Drawing.Size(76, 20); + this.inputOffsetBoxX.TabIndex = 92; + + this.outputOffsetBoxX.Location = new System.Drawing.Point(106, 245); + this.outputOffsetBoxX.Name = "outputOffsetBoxX"; + this.outputOffsetBoxX.Size = new System.Drawing.Size(76, 20); + this.outputOffsetBoxX.TabIndex = 92; // // constantThreeLabelX // @@ -2206,24 +2189,6 @@ namespace grapher title6.Text = "Sensitivity"; this.AccelerationChart.Titles.Add(title6); // - // powerStartFromActiveLabelX - // - this.powerStartFromActiveLabelX.AutoSize = true; - this.powerStartFromActiveLabelX.Location = new System.Drawing.Point(197, 220); - this.powerStartFromActiveLabelX.Name = "powerStartFromActiveLabelX"; - this.powerStartFromActiveLabelX.Size = new System.Drawing.Size(13, 13); - this.powerStartFromActiveLabelX.TabIndex = 225; - this.powerStartFromActiveLabelX.Text = "0"; - // - // powerStartFromActiveLabelY - // - this.powerStartFromActiveLabelY.AutoSize = true; - this.powerStartFromActiveLabelY.Location = new System.Drawing.Point(414, 221); - this.powerStartFromActiveLabelY.Name = "powerStartFromActiveLabelY"; - this.powerStartFromActiveLabelY.Size = new System.Drawing.Size(13, 13); - this.powerStartFromActiveLabelY.TabIndex = 226; - this.powerStartFromActiveLabelY.Text = "0"; - // // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2273,22 +2238,26 @@ namespace grapher private System.Windows.Forms.Label OptionSetXTitle; private System.Windows.Forms.Label constantThreeLabelY; private System.Windows.Forms.Label limitLabelY; - private System.Windows.Forms.Label offsetLabelY; + private System.Windows.Forms.Label inputOffsetLabelY; + private System.Windows.Forms.Label outputOffsetLabelY; private System.Windows.Forms.Label inCapLabelYClassic; private System.Windows.Forms.Label constantOneLabelY; private System.Windows.Forms.CheckBox ByComponentXYLock; private System.Windows.Forms.Label MidpointActiveYLabel; private System.Windows.Forms.Label LimitActiveYLabel; - private System.Windows.Forms.Label OffsetActiveYLabel; + private System.Windows.Forms.Label InputOffsetActiveYLabel; + private System.Windows.Forms.Label OutputOffsetActiveYLabel; private System.Windows.Forms.Label AccelerationActiveLabelY; private System.Windows.Forms.ComboBox accelTypeDropY; private System.Windows.Forms.TextBox midpointBoxY; private System.Windows.Forms.TextBox limitBoxY; - private System.Windows.Forms.TextBox offsetBoxY; + private System.Windows.Forms.TextBox inputOffsetBoxY; + private System.Windows.Forms.TextBox outputOffsetBoxY; private System.Windows.Forms.TextBox accelerationBoxY; private System.Windows.Forms.Label MidpointActiveXLabel; private System.Windows.Forms.Label LimitActiveXLabel; - private System.Windows.Forms.Label OffsetActiveXLabel; + private System.Windows.Forms.Label InputOffsetActiveXLabel; + private System.Windows.Forms.Label OutputOffsetActiveXLabel; private System.Windows.Forms.Label InCapActiveYLabelClassic; private System.Windows.Forms.Label InCapActiveXLabelClassic; private System.Windows.Forms.Label AccelerationActiveLabelX; @@ -2303,8 +2272,10 @@ namespace grapher private System.Windows.Forms.TextBox inCapBoxYClassic; private System.Windows.Forms.TextBox VertHorzRatioBox; private System.Windows.Forms.Button writeButton; - private System.Windows.Forms.Label offsetLabelX; - private System.Windows.Forms.TextBox offsetBoxX; + private System.Windows.Forms.Label inputOffsetLabelX; + private System.Windows.Forms.Label outputOffsetLabelX; + private System.Windows.Forms.TextBox inputOffsetBoxX; + private System.Windows.Forms.TextBox outputOffsetBoxX; private System.Windows.Forms.Label constantThreeLabelX; private System.Windows.Forms.TextBox midpointBoxX; private System.Windows.Forms.Label limitLabelX; @@ -2431,14 +2402,6 @@ namespace grapher private System.Windows.Forms.TextBox outCapBoxXPower; private System.Windows.Forms.TextBox inCapBoxYPower; private System.Windows.Forms.TextBox inCapBoxXPower; - private System.Windows.Forms.CheckBox powerStartsFromOneBoxY; - private System.Windows.Forms.CheckBox powerStartsFromZeroBoxY; - private System.Windows.Forms.CheckBox powerStartsFromOneBoxX; - private System.Windows.Forms.CheckBox powerStartsFromZeroBoxX; - private System.Windows.Forms.Label powerStartFromLabelY; - private System.Windows.Forms.Label powerStartFromLabelX; - private System.Windows.Forms.Label powerStartFromActiveLabelX; - private System.Windows.Forms.Label powerStartFromActiveLabelY; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 9e88912..00483d5 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -82,8 +82,10 @@ namespace grapher inCapBoxYPower, outCapBoxXPower, outCapBoxYPower, - offsetBoxX, - offsetBoxY, + inputOffsetBoxX, + inputOffsetBoxY, + outputOffsetBoxX, + outputOffsetBoxY, accelerationBoxX, accelerationBoxY, decayRateBoxX, @@ -114,10 +116,6 @@ namespace grapher ByComponentCheckBox, gainSwitchX, gainSwitchY, - powerStartsFromZeroBoxX, - powerStartsFromOneBoxX, - powerStartsFromZeroBoxY, - powerStartsFromOneBoxY, XLutActiveValuesBox, YLutActiveValuesBox, XLutPointsBox, @@ -138,8 +136,10 @@ namespace grapher outCapLabelYPower, CapTypeLabelXPower, CapTypeLabelYPower, - offsetLabelX, - offsetLabelY, + inputOffsetLabelX, + inputOffsetLabelY, + outputOffsetLabelX, + outputOffsetLabelY, constantOneLabelX, constantOneLabelY, decayRateLabelX, @@ -156,8 +156,6 @@ namespace grapher powerLabelY, expLabelX, expLabelY, - powerStartFromLabelX, - powerStartFromLabelY, LUTTextLabelX, LUTTextLabelY, constantThreeLabelX, @@ -179,8 +177,10 @@ namespace grapher OutCapActiveYLabelPower, CapTypeActiveXLabelPower, CapTypeActiveYLabelPower, - OffsetActiveXLabel, - OffsetActiveYLabel, + InputOffsetActiveXLabel, + InputOffsetActiveYLabel, + OutputOffsetActiveXLabel, + OutputOffsetActiveYLabel, AccelerationActiveLabelX, AccelerationActiveLabelY, DecayRateActiveXLabel, @@ -197,8 +197,6 @@ namespace grapher PowerClassicActiveYLabel, ExpActiveXLabel, ExpActiveYLabel, - powerStartFromActiveLabelX, - powerStartFromActiveLabelY, MidpointActiveXLabel, MidpointActiveYLabel, AccelTypeActiveLabelX, diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs index 05c590f..4f82e8a 100644 --- a/grapher/Layouts/ClassicLayout.cs +++ b/grapher/Layouts/ClassicLayout.cs @@ -16,11 +16,11 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - OffsetLayout = new OptionLayout(true, Offset); + InputOffsetLayout = new OptionLayout(true, InputOffset); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(true, PowerClassic); ExponentLayout = new OptionLayout(false, string.Empty); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index 1b45307..f44de01 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -17,11 +17,11 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(true, DecayRate); GrowthRateLayout = new OptionLayout(true, GrowthRate); SmoothLayout = new OptionLayout(true, Smooth); - OffsetLayout = new OptionLayout(true, Offset); + InputOffsetLayout = new OptionLayout(true, InputOffset); LimitLayout = new OptionLayout(true, Limit); PowerClassicLayout = new OptionLayout(true, PowerClassic); ExponentLayout = new OptionLayout(true, Exponent); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(true, Midpoint); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/JumpLayout.cs b/grapher/Layouts/JumpLayout.cs index 40e7629..9554175 100644 --- a/grapher/Layouts/JumpLayout.cs +++ b/grapher/Layouts/JumpLayout.cs @@ -17,11 +17,11 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(true, Smooth); - OffsetLayout = new OptionLayout(true, Offset); + InputOffsetLayout = new OptionLayout(true, InputOffset); LimitLayout = new OptionLayout(false, Limit); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs index 5412294..88f8280 100644 --- a/grapher/Layouts/LUTLayout.cs +++ b/grapher/Layouts/LUTLayout.cs @@ -25,10 +25,10 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - OffsetLayout = new OptionLayout(false, Offset); + InputOffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, Exponent); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(true, string.Empty); diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index a283008..1dced61 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -9,12 +9,12 @@ namespace grapher.Layouts public const string DecayRate = "Decay Rate"; public const string Scale = "Scale"; public const string Exponent = "Exponent"; - public const string StartsFrom = "Start from"; + public const string OutputOffset = "Output Offset"; public const string PowerClassic = "Power"; public const string Limit = "Limit"; public const string Midpoint = "Midpoint"; public const string Motivity = "Motivity"; - public const string Offset = "Offset"; + public const string InputOffset = "Input Offset"; public const string CapType = "Cap Type"; public const string Weight = "Weight"; public const string Smooth = "Smooth"; @@ -27,11 +27,11 @@ namespace grapher.Layouts SmoothLayout = new OptionLayout(false, string.Empty); ClassicCapLayout = new OptionLayout(false, string.Empty); PowerCapLayout = new OptionLayout(false, string.Empty); - OffsetLayout = new OptionLayout(false, string.Empty); + InputOffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); @@ -59,7 +59,7 @@ namespace grapher.Layouts protected OptionLayout PowerCapLayout { get; set; } - protected OptionLayout OffsetLayout { get; set; } + protected OptionLayout InputOffsetLayout { get; set; } protected OptionLayout LimitLayout { get; set; } @@ -67,7 +67,7 @@ namespace grapher.Layouts protected OptionLayout ExponentLayout { get; set; } - protected OptionLayout PowerStartsFromLayout { get; set; } + protected OptionLayout OutputOffsetLayout { get; set; } protected OptionLayout MidpointLayout { get; set; } @@ -91,11 +91,11 @@ namespace grapher.Layouts IOption decayRateOption, IOption growthRateOption, IOption smoothOption, - IOption offsetOption, + IOption inputOffsetOption, IOption limitOption, IOption powerClassicOption, IOption expOption, - IOption startsFromOption, + IOption outputOffsetOption, IOption midpointOption, IOption lutTextOption, IOption lutPanelOption, @@ -112,11 +112,11 @@ namespace grapher.Layouts (DecayRateLayout, decayRateOption), (GrowthRateLayout, growthRateOption), (SmoothLayout, smoothOption), - (OffsetLayout, offsetOption), + (InputOffsetLayout, inputOffsetOption), (LimitLayout, limitOption), (PowerClassicLayout, powerClassicOption), (ExponentLayout, expOption), - (PowerStartsFromLayout, startsFromOption), + (OutputOffsetLayout, outputOffsetOption), (MidpointLayout, midpointOption), (LutTextLayout, lutTextOption), (LutPanelLayout, lutPanelOption), @@ -147,11 +147,11 @@ namespace grapher.Layouts IOption decayRateOption, IOption growthRateOption, IOption smoothOption, - IOption offsetOption, + IOption inputOffsetOption, IOption limitOption, IOption powerClassicOption, IOption expOption, - IOption startsFromOption, + IOption outputOffsetOption, IOption midpointOption, IOption lutTextOption, IOption lutPanelOption, @@ -163,11 +163,11 @@ namespace grapher.Layouts decayRateOption, growthRateOption, smoothOption, - offsetOption, + inputOffsetOption, limitOption, powerClassicOption, expOption, - startsFromOption, + outputOffsetOption, midpointOption, lutTextOption, lutPanelOption, diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index f6b3cc0..279f0a9 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -18,10 +18,10 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - OffsetLayout = new OptionLayout(true, Offset); + InputOffsetLayout = new OptionLayout(true, InputOffset); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/MotivityLayout.cs b/grapher/Layouts/MotivityLayout.cs index ebce103..15394d2 100644 --- a/grapher/Layouts/MotivityLayout.cs +++ b/grapher/Layouts/MotivityLayout.cs @@ -22,11 +22,11 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(true, GrowthRate); SmoothLayout = new OptionLayout(false, string.Empty); - OffsetLayout = new OptionLayout(false, string.Empty); + InputOffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(true, Motivity); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(true, Midpoint); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index ed5ade9..d182d6d 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -17,11 +17,11 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(true, DecayRate); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - OffsetLayout = new OptionLayout(true, Offset); + InputOffsetLayout = new OptionLayout(true, InputOffset); LimitLayout = new OptionLayout(true, Limit); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index 92333d9..630ea16 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -17,11 +17,11 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - OffsetLayout = new OptionLayout(false, string.Empty); + InputOffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index c25bbbb..e34e6a5 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -15,11 +15,11 @@ DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - OffsetLayout = new OptionLayout(false, string.Empty); + InputOffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(true, Exponent); - PowerStartsFromLayout = new OptionLayout(true, StartsFrom); + OutputOffsetLayout = new OptionLayout(true, OutputOffset); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Layouts/UnsupportedLayout.cs b/grapher/Layouts/UnsupportedLayout.cs index 3faf721..3aa88aa 100644 --- a/grapher/Layouts/UnsupportedLayout.cs +++ b/grapher/Layouts/UnsupportedLayout.cs @@ -22,11 +22,11 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(false, string.Empty); - OffsetLayout = new OptionLayout(false, Offset); + InputOffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, Exponent); - PowerStartsFromLayout = new OptionLayout(false, string.Empty); + OutputOffsetLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(true, LUTLayoutText); LutPanelLayout = new OptionLayout(false, string.Empty); diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index 89318e2..bb65541 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -54,8 +54,10 @@ namespace grapher.Models TextBox inCapBoxYPower, TextBox outCapBoxXPower, TextBox outCapBoxYPower, - TextBox offsetBoxX, - TextBox offsetBoxY, + TextBox inputOffsetBoxX, + TextBox inputOffsetBoxY, + TextBox outputOffsetBoxX, + TextBox outputOffsetBoxY, TextBox accelerationBoxX, TextBox accelerationBoxY, TextBox decayRateBoxX, @@ -86,10 +88,6 @@ namespace grapher.Models CheckBox byComponentCheckBox, CheckBox gainSwitchX, CheckBox gainSwitchY, - CheckBox powerStartsFromZeroBoxX, - CheckBox powerStartsFromOneBoxX, - CheckBox powerStartsFromZeroBoxY, - CheckBox powerStartsFromOneBoxY, RichTextBox xLutActiveValuesBox, RichTextBox yLutActiveValuesBox, RichTextBox xLutPointsBox, @@ -110,8 +108,10 @@ namespace grapher.Models Label outCapLabelYPower, Label capTypeLabelXPower, Label capTypeLabelYPower, - Label offsetLabelX, - Label offsetLabelY, + Label inputOffsetLabelX, + Label inputOffsetLabelY, + Label outputOffsetLabelX, + Label outputOffsetLabelY, Label constantOneLabelX, Label constantOneLabelY, Label decayRateLabelX, @@ -128,8 +128,6 @@ namespace grapher.Models Label powerClassicLabelY, Label expLabelX, Label expLabelY, - Label powerStartsFromLabelX, - Label powerStartsFromLabelY, Label lutTextLabelX, Label lutTextLabelY, Label constantThreeLabelX, @@ -151,8 +149,10 @@ namespace grapher.Models Label outCapActiveYLabelPower, Label capTypeActiveXLabelPower, Label capTypeActiveYLabelPower, - Label offsetActiveLabelX, - Label offsetActiveLabelY, + Label inputOffsetActiveLabelX, + Label inputOffsetActiveLabelY, + Label outputOffsetActiveLabelX, + Label outputOffsetActiveLabelY, Label accelerationActiveLabelX, Label accelerationActiveLabelY, Label decayRateActiveLabelX, @@ -169,8 +169,6 @@ namespace grapher.Models Label powerClassicActiveLabelY, Label expActiveLabelX, Label expActiveLabelY, - Label powerStartsFromActiveLabelX, - Label powerStartsFromActiveLabelY, Label midpointActiveLabelX, Label midpointActiveLabelY, Label accelTypeActiveLabelX, @@ -249,22 +247,40 @@ namespace grapher.Models var directionalityLeft = directionalityPanel.Left; - var offsetX = new Option( - offsetBoxX, + var inputOffsetX = new Option( + inputOffsetBoxX, form, 0, - offsetLabelX, + inputOffsetLabelX, 0, - new ActiveValueLabel(offsetActiveLabelX, activeValueTitleX), + new ActiveValueLabel(inputOffsetActiveLabelX, activeValueTitleX), "Offset"); - var offsetY = new Option( - offsetBoxY, + var inputOffsetY = new Option( + inputOffsetBoxY, form, 0, - offsetLabelY, + inputOffsetLabelY, optionSetYLeft, - new ActiveValueLabel(offsetActiveLabelY, activeValueTitleY), + new ActiveValueLabel(inputOffsetActiveLabelY, activeValueTitleY), + "Offset"); + + var outputOffsetX = new Option( + outputOffsetBoxX, + form, + 0, + outputOffsetLabelX, + 0, + new ActiveValueLabel(outputOffsetActiveLabelX, activeValueTitleX), + "Offset"); + + var outputOffsetY = new Option( + outputOffsetBoxY, + form, + 0, + outputOffsetLabelY, + optionSetYLeft, + new ActiveValueLabel(outputOffsetActiveLabelY, activeValueTitleY), "Offset"); var accelerationX = new Option( @@ -495,20 +511,6 @@ namespace grapher.Models outCapYPower, scaleY); - var powerStartsFromX = new SwitchOption( - powerStartsFromLabelX, - powerStartsFromZeroBoxX, - powerStartsFromOneBoxX, - new ActiveValueLabel(powerStartsFromActiveLabelX, activeValueTitleX), - 0); - - var powerStartsFromY = new SwitchOption( - powerStartsFromLabelY, - powerStartsFromZeroBoxY, - powerStartsFromOneBoxY, - new ActiveValueLabel(powerStartsFromActiveLabelY, activeValueTitleY), - optionSetYLeft); - var lpNorm = new Option( new Field(lpNormBox, form, 2), lpNormLabel, @@ -554,11 +556,11 @@ namespace grapher.Models gainSwitchOptionX, classicCapOptionsX, powerCapOptionsX, - powerStartsFromX, + outputOffsetX, decayRateX, growthRateX, smoothX, - offsetX, + inputOffsetX, limitX, powerClassicX, exponentX, @@ -577,11 +579,11 @@ namespace grapher.Models gainSwitchOptionY, classicCapOptionsY, powerCapOptionsY, - powerStartsFromY, + outputOffsetY, decayRateY, growthRateY, smoothY, - offsetY, + inputOffsetY, limitY, powerClassicY, exponentY, diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index b3153ed..d89f2d1 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -29,11 +29,11 @@ namespace grapher CheckBoxOption gainSwitch, CapOptions classicCap, CapOptions powerCap, - SwitchOption powerStartsFrom, + Option outputOffset, Option decayRate, Option growthRate, Option smooth, - Option offset, + Option inputOffset, Option limit, Option powerClassic, Option exponent, @@ -67,11 +67,11 @@ namespace grapher Smooth = smooth; ClassicCap = classicCap; PowerCap = powerCap; - Offset = offset; + InputOffset = inputOffset; Limit = limit; PowerClassic = powerClassic; Exponent = exponent; - PowerStartsFrom = powerStartsFrom; + OutputOffset = outputOffset; Midpoint = midpoint; WriteButton = writeButton; AccelTypeActiveValue = accelTypeActiveValue; @@ -114,9 +114,9 @@ namespace grapher public CapOptions PowerCap { get; } - public SwitchOption PowerStartsFrom { get; } + public Option InputOffset { get; } - public Option Offset { get; } + public Option OutputOffset { get; } public Option Limit { get; } @@ -227,8 +227,8 @@ namespace grapher Smooth.Hide(); ClassicCap.Hide(); PowerCap.Hide(); - PowerStartsFrom.Hide(); - Offset.Hide(); + OutputOffset.Hide(); + InputOffset.Hide(); Limit.Hide(); PowerClassic.Hide(); Exponent.Hide(); @@ -265,8 +265,8 @@ namespace grapher args.cap.x, args.cap.y, args.capMode); - PowerStartsFrom.SetActiveValue(!args.powerStartFromOne); - Offset.SetActiveValue(args.offset); + OutputOffset.SetActiveValue(args.outputOffset); + InputOffset.SetActiveValue(args.inputOffset); DecayRate.SetActiveValue(args.decayRate); GrowthRate.SetActiveValue(args.growthRate); Smooth.SetActiveValue(args.smooth); @@ -328,7 +328,6 @@ namespace grapher args.cap.y = PowerCap.Out.Field.Data; args.capMode = PowerCap.CapTypeOptions.GetSelectedCapMode(); } - if (PowerStartsFrom.Visible) args.powerStartFromOne = PowerStartsFrom.Second.Checked; if (Limit.Visible) { if (args.mode == AccelMode.motivity) @@ -342,7 +341,8 @@ namespace grapher } if (PowerClassic.Visible) args.exponentClassic = PowerClassic.Field.Data; if (Exponent.Visible) args.exponentPower = Exponent.Field.Data; - if (Offset.Visible) args.offset = Offset.Field.Data; + if (InputOffset.Visible) args.inputOffset = InputOffset.Field.Data; + if (OutputOffset.Visible) args.outputOffset = OutputOffset.Field.Data; if (Midpoint.Visible) args.midpoint = Midpoint.Field.Data; if (LutPanel.Visible) { @@ -369,8 +369,8 @@ namespace grapher Smooth.AlignActiveValues(); ClassicCap.AlignActiveValues(); PowerCap.AlignActiveValues(); - PowerStartsFrom.AlignActiveValues(); - Offset.AlignActiveValues(); + OutputOffset.AlignActiveValues(); + InputOffset.AlignActiveValues(); Limit.AlignActiveValues(); PowerClassic.AlignActiveValues(); Exponent.AlignActiveValues(); @@ -407,11 +407,11 @@ namespace grapher DecayRate, GrowthRate, Smooth, - Offset, + InputOffset, Limit, PowerClassic, Exponent, - PowerStartsFrom, + OutputOffset, Midpoint, LutText, LutPanel, -- cgit v1.2.3 From 915132d15ce4c1913d18adb917124acc727d4800 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Thu, 16 Sep 2021 19:52:48 -0400 Subject: fix - gui lut mode AccelArgs::gain was not set from LutApplyOptions --- grapher/Models/Options/AccelTypeOptions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index d89f2d1..f079542 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -275,7 +275,6 @@ namespace grapher Exponent.SetActiveValue(args.exponentPower); Midpoint.SetActiveValue(args.midpoint); LutPanel.SetActiveValues(args.data, args.length, args.mode); - // TODO - use GainSwitch only? LutApply.SetActiveValue(args.gain); } @@ -309,7 +308,9 @@ namespace grapher public void SetArgs(ref AccelArgs args) { args.mode = AccelerationType.Mode; - args.gain = GainSwitch.CheckBox.Checked; + args.gain = LutPanel.Visible ? + LutApply.ApplyType == LutApplyOptions.LutApplyType.Velocity : + GainSwitch.CheckBox.Checked; if (DecayRate.Visible) args.decayRate = DecayRate.Field.Data; if (GrowthRate.Visible) args.growthRate = GrowthRate.Field.Data; -- cgit v1.2.3 From 62d9e1da9cfb5b1b85f8d6d4a7efc8828bbb1e8b Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Thu, 16 Sep 2021 21:15:56 -0400 Subject: refactor SetActiveHandles method --- grapher/Models/Serialized/SettingsManager.cs | 30 +++++++++++----------------- 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs index 8c8bf15..cb42c4e 100644 --- a/grapher/Models/Serialized/SettingsManager.cs +++ b/grapher/Models/Serialized/SettingsManager.cs @@ -201,30 +201,24 @@ namespace grapher.Models.Serialized bool ActiveProfileIsFirst = ActiveProfile == ActiveConfig.profiles[0]; - foreach (var dev in SystemDevices) MaybeAdd(dev); - - void MaybeAdd(MultiHandleDevice dev) + foreach (var sysDev in SystemDevices) { - foreach (var settings in ActiveConfig.devices) + var settings = ActiveConfig.devices.Find(d => d.id == sysDev.id); + + if (settings is null) { - if (settings.id == dev.id) + if (ActiveProfileIsFirst && !ActiveConfig.defaultDeviceConfig.disable) { - if (!settings.config.disable && - ((ActiveProfileIsFirst && - (string.IsNullOrEmpty(settings.profile) || - !ActiveProfileNamesSet.Contains(settings.profile))) || - ActiveProfile.name == settings.profile)) - { - ActiveHandles.AddRange(dev.handles); - } - - return; + ActiveHandles.AddRange(sysDev.handles); } } - - if (ActiveProfileIsFirst && !ActiveConfig.defaultDeviceConfig.disable) + else if (!settings.config.disable && + ((ActiveProfileIsFirst && + (string.IsNullOrEmpty(settings.profile) || + !ActiveProfileNamesSet.Contains(settings.profile))) || + ActiveProfile.name == settings.profile)) { - ActiveHandles.AddRange(dev.handles); + ActiveHandles.AddRange(sysDev.handles); } } } -- cgit v1.2.3 From 94ce1542b03090b81a4250f7f799895c58ab286c Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Sat, 18 Sep 2021 05:34:59 -0400 Subject: rename directional multipliers changes profile layout --- grapher/Models/Mouse/MouseWatcher.cs | 6 +++++- grapher/Models/Serialized/SettingsManager.cs | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index c36ceb4..91eebb8 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -757,7 +757,11 @@ namespace grapher.Models.Mouse // strip negative directional multipliers, charts calculated from positive input - Vec2 dirMults = SettingsManager.ActiveProfile.directionalMultipliers; + Vec2 dirMults = new Vec2 + { + x = SettingsManager.ActiveProfile.lrSensRatio, + y = SettingsManager.ActiveProfile.udSensRatio + }; if (dirMults.x > 0 && x < 0) { diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs index cb42c4e..aac0f3e 100644 --- a/grapher/Models/Serialized/SettingsManager.cs +++ b/grapher/Models/Serialized/SettingsManager.cs @@ -179,7 +179,8 @@ namespace grapher.Models.Serialized settings.snap = UserProfile.snap; settings.maximumSpeed = UserProfile.maximumSpeed; settings.minimumSpeed = UserProfile.minimumSpeed; - settings.directionalMultipliers = UserProfile.directionalMultipliers; + settings.lrSensRatio = UserProfile.lrSensRatio; + settings.udSensRatio = UserProfile.udSensRatio; } public GUISettings MakeGUISettingsFromFields() -- cgit v1.2.3 From d270a967b606116596114744417a182b3f16218b Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Sat, 18 Sep 2021 05:39:08 -0400 Subject: rename classic_cap_mode --- grapher/Models/Options/Cap/CapOptions.cs | 2 +- grapher/Models/Options/Cap/CapTypeOptions.cs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/Options/Cap/CapOptions.cs b/grapher/Models/Options/Cap/CapOptions.cs index ac34abf..de0f597 100644 --- a/grapher/Models/Options/Cap/CapOptions.cs +++ b/grapher/Models/Options/Cap/CapOptions.cs @@ -131,7 +131,7 @@ namespace grapher.Models.Options.Cap double scale, double inCap, double outCap, - ClassicCapMode capMode) + CapMode capMode) { Slope.SetActiveValue(scale); In.SetActiveValue(inCap); diff --git a/grapher/Models/Options/Cap/CapTypeOptions.cs b/grapher/Models/Options/Cap/CapTypeOptions.cs index 1e7bd58..6447feb 100644 --- a/grapher/Models/Options/Cap/CapTypeOptions.cs +++ b/grapher/Models/Options/Cap/CapTypeOptions.cs @@ -107,14 +107,14 @@ namespace grapher.Models.Options.Cap private CapTypeOption Default { get; set; } - public ClassicCapMode GetSelectedCapMode() + public CapMode GetSelectedCapMode() { switch(SelectedCapType) { - case CapType.Output: return ClassicCapMode.output; - case CapType.Both: return ClassicCapMode.in_out; + case CapType.Output: return CapMode.output; + case CapType.Both: return CapMode.in_out; case CapType.Input: - default: return ClassicCapMode.input; + default: return CapMode.input; } } @@ -122,21 +122,21 @@ namespace grapher.Models.Options.Cap #region Methods - public static CapTypeOption CapTypeOptionFromSettings(ClassicCapMode capMode) + public static CapTypeOption CapTypeOptionFromSettings(CapMode capMode) { switch (capMode) { - case ClassicCapMode.output: + case CapMode.output: return OutCap; - case ClassicCapMode.in_out: + case CapMode.in_out: return BothCap; - case ClassicCapMode.input: + case CapMode.input: default: return InCap; } } - public void SetActiveValue(ClassicCapMode capMode) + public void SetActiveValue(CapMode capMode) { Default = CapTypeOptionFromSettings(capMode); SelectedCapOption = Default; -- cgit v1.2.3 From 4c4eabc0cb85cfef22900773649d96f610bb25dc Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Sun, 19 Sep 2021 02:08:06 -0400 Subject: fix jump fields --- grapher/Form1.Designer.cs | 139 +++++++++++++++++++++++++---- grapher/Form1.cs | 12 +++ grapher/Layouts/ClassicLayout.cs | 2 + grapher/Layouts/DefaultLayout.cs | 2 + grapher/Layouts/JumpLayout.cs | 4 +- grapher/Layouts/LUTLayout.cs | 2 + grapher/Layouts/LayoutBase.cs | 16 ++++ grapher/Layouts/LinearLayout.cs | 2 + grapher/Layouts/MotivityLayout.cs | 2 + grapher/Layouts/NaturalLayout.cs | 2 + grapher/Layouts/OffLayout.cs | 2 + grapher/Layouts/PowerLayout.cs | 2 + grapher/Layouts/UnsupportedLayout.cs | 2 + grapher/Models/AccelGUIFactory.cs | 52 +++++++++++ grapher/Models/Options/AccelTypeOptions.cs | 19 ++++ 15 files changed, 241 insertions(+), 19 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 4625bca..ac66650 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -182,6 +182,8 @@ namespace grapher this.OptionSetXTitle = new System.Windows.Forms.Label(); this.constantThreeLabelY = new System.Windows.Forms.Label(); this.limitLabelY = new System.Windows.Forms.Label(); + this.inputJumpLabelY = new System.Windows.Forms.Label(); + this.outputJumpLabelY = new System.Windows.Forms.Label(); this.inputOffsetLabelY = new System.Windows.Forms.Label(); this.outputOffsetLabelY = new System.Windows.Forms.Label(); this.inCapLabelYClassic = new System.Windows.Forms.Label(); @@ -189,17 +191,23 @@ namespace grapher this.ByComponentXYLock = new System.Windows.Forms.CheckBox(); this.MidpointActiveYLabel = new System.Windows.Forms.Label(); this.LimitActiveYLabel = new System.Windows.Forms.Label(); + this.InputJumpActiveYLabel = new System.Windows.Forms.Label(); + this.OutputJumpActiveYLabel = new System.Windows.Forms.Label(); this.InputOffsetActiveYLabel = new System.Windows.Forms.Label(); this.OutputOffsetActiveYLabel = new System.Windows.Forms.Label(); this.AccelerationActiveLabelY = new System.Windows.Forms.Label(); this.accelTypeDropY = new System.Windows.Forms.ComboBox(); this.midpointBoxY = new System.Windows.Forms.TextBox(); this.limitBoxY = new System.Windows.Forms.TextBox(); + this.inputJumpBoxY = new System.Windows.Forms.TextBox(); + this.outputJumpBoxY = new System.Windows.Forms.TextBox(); this.inputOffsetBoxY = new System.Windows.Forms.TextBox(); this.outputOffsetBoxY = new System.Windows.Forms.TextBox(); this.accelerationBoxY = new System.Windows.Forms.TextBox(); this.MidpointActiveXLabel = new System.Windows.Forms.Label(); this.LimitActiveXLabel = new System.Windows.Forms.Label(); + this.InputJumpActiveXLabel = new System.Windows.Forms.Label(); + this.OutputJumpActiveXLabel = new System.Windows.Forms.Label(); this.InputOffsetActiveXLabel = new System.Windows.Forms.Label(); this.OutputOffsetActiveXLabel = new System.Windows.Forms.Label(); this.InCapActiveYLabelClassic = new System.Windows.Forms.Label(); @@ -216,6 +224,10 @@ namespace grapher this.inCapBoxYClassic = new System.Windows.Forms.TextBox(); this.VertHorzRatioBox = new System.Windows.Forms.TextBox(); this.writeButton = new System.Windows.Forms.Button(); + this.inputJumpLabelX = new System.Windows.Forms.Label(); + this.outputJumpLabelX = new System.Windows.Forms.Label(); + this.inputJumpBoxX = new System.Windows.Forms.TextBox(); + this.outputJumpBoxX = new System.Windows.Forms.TextBox(); this.inputOffsetLabelX = new System.Windows.Forms.Label(); this.outputOffsetLabelX = new System.Windows.Forms.Label(); this.inputOffsetBoxX = new System.Windows.Forms.TextBox(); @@ -361,6 +373,8 @@ namespace grapher this.optionsPanel.Controls.Add(this.OptionSetXTitle); this.optionsPanel.Controls.Add(this.constantThreeLabelY); this.optionsPanel.Controls.Add(this.limitLabelY); + this.optionsPanel.Controls.Add(this.inputJumpLabelY); + this.optionsPanel.Controls.Add(this.outputJumpLabelY); this.optionsPanel.Controls.Add(this.inputOffsetLabelY); this.optionsPanel.Controls.Add(this.outputOffsetLabelY); this.optionsPanel.Controls.Add(this.inCapLabelYClassic); @@ -368,17 +382,23 @@ namespace grapher this.optionsPanel.Controls.Add(this.ByComponentXYLock); this.optionsPanel.Controls.Add(this.MidpointActiveYLabel); this.optionsPanel.Controls.Add(this.LimitActiveYLabel); + this.optionsPanel.Controls.Add(this.InputJumpActiveYLabel); + this.optionsPanel.Controls.Add(this.OutputJumpActiveYLabel); this.optionsPanel.Controls.Add(this.InputOffsetActiveYLabel); this.optionsPanel.Controls.Add(this.OutputOffsetActiveYLabel); this.optionsPanel.Controls.Add(this.AccelerationActiveLabelY); this.optionsPanel.Controls.Add(this.accelTypeDropY); this.optionsPanel.Controls.Add(this.midpointBoxY); this.optionsPanel.Controls.Add(this.limitBoxY); + this.optionsPanel.Controls.Add(this.inputJumpBoxY); + this.optionsPanel.Controls.Add(this.outputJumpBoxY); this.optionsPanel.Controls.Add(this.inputOffsetBoxY); this.optionsPanel.Controls.Add(this.outputOffsetBoxY); this.optionsPanel.Controls.Add(this.accelerationBoxY); this.optionsPanel.Controls.Add(this.MidpointActiveXLabel); this.optionsPanel.Controls.Add(this.LimitActiveXLabel); + this.optionsPanel.Controls.Add(this.InputJumpActiveXLabel); + this.optionsPanel.Controls.Add(this.OutputJumpActiveXLabel); this.optionsPanel.Controls.Add(this.InputOffsetActiveXLabel); this.optionsPanel.Controls.Add(this.OutputOffsetActiveXLabel); this.optionsPanel.Controls.Add(this.InCapActiveYLabelClassic); @@ -395,6 +415,10 @@ namespace grapher this.optionsPanel.Controls.Add(this.inCapBoxYClassic); this.optionsPanel.Controls.Add(this.VertHorzRatioBox); this.optionsPanel.Controls.Add(this.writeButton); + this.optionsPanel.Controls.Add(this.inputJumpLabelX); + this.optionsPanel.Controls.Add(this.outputJumpLabelX); + this.optionsPanel.Controls.Add(this.inputJumpBoxX); + this.optionsPanel.Controls.Add(this.outputJumpBoxX); this.optionsPanel.Controls.Add(this.inputOffsetLabelX); this.optionsPanel.Controls.Add(this.outputOffsetLabelX); this.optionsPanel.Controls.Add(this.inputOffsetBoxX); @@ -1393,9 +1417,22 @@ namespace grapher this.limitLabelY.Size = new System.Drawing.Size(28, 13); this.limitLabelY.TabIndex = 136; this.limitLabelY.Text = "Limit"; - // - // offsetLabelY - // + + this.inputJumpLabelY.AutoSize = true; + this.inputJumpLabelY.Location = new System.Drawing.Point(263, 248); + this.inputJumpLabelY.Name = "inputJumpLabelY"; + this.inputJumpLabelY.Size = new System.Drawing.Size(35, 13); + this.inputJumpLabelY.TabIndex = 135; + this.inputJumpLabelY.Text = "Input"; + + this.outputJumpLabelY.AutoSize = true; + this.outputJumpLabelY.Location = new System.Drawing.Point(263, 248); + this.outputJumpLabelY.Name = "outputJumpLabelY"; + this.outputJumpLabelY.Size = new System.Drawing.Size(35, 13); + this.outputJumpLabelY.TabIndex = 135; + this.outputJumpLabelY.Text = "Output"; + + this.inputOffsetLabelY.AutoSize = true; this.inputOffsetLabelY.Location = new System.Drawing.Point(263, 248); this.inputOffsetLabelY.Name = "inputOffsetLabelY"; @@ -1456,9 +1493,21 @@ namespace grapher this.LimitActiveYLabel.Size = new System.Drawing.Size(13, 13); this.LimitActiveYLabel.TabIndex = 130; this.LimitActiveYLabel.Text = "0"; - // - // OffsetActiveYLabel - // + + this.InputJumpActiveYLabel.AutoSize = true; + this.InputJumpActiveYLabel.Location = new System.Drawing.Point(414, 248); + this.InputJumpActiveYLabel.Name = "InputJumpActiveYLabel"; + this.InputJumpActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.InputJumpActiveYLabel.TabIndex = 129; + this.InputJumpActiveYLabel.Text = "0"; + + this.OutputJumpActiveYLabel.AutoSize = true; + this.OutputJumpActiveYLabel.Location = new System.Drawing.Point(414, 248); + this.OutputJumpActiveYLabel.Name = "OutputJumpActiveYLabel"; + this.OutputJumpActiveYLabel.Size = new System.Drawing.Size(13, 13); + this.OutputJumpActiveYLabel.TabIndex = 129; + this.OutputJumpActiveYLabel.Text = "0"; + this.InputOffsetActiveYLabel.AutoSize = true; this.InputOffsetActiveYLabel.Location = new System.Drawing.Point(414, 248); this.InputOffsetActiveYLabel.Name = "InputOffsetActiveYLabel"; @@ -1504,9 +1553,17 @@ namespace grapher this.limitBoxY.Name = "limitBoxY"; this.limitBoxY.Size = new System.Drawing.Size(76, 20); this.limitBoxY.TabIndex = 108; - // - // offsetBoxY - // + + this.inputJumpBoxY.Location = new System.Drawing.Point(332, 245); + this.inputJumpBoxY.Name = "inputJumpBoxY"; + this.inputJumpBoxY.Size = new System.Drawing.Size(76, 20); + this.inputJumpBoxY.TabIndex = 106; + + this.outputJumpBoxY.Location = new System.Drawing.Point(332, 245); + this.outputJumpBoxY.Name = "outputJumpBoxY"; + this.outputJumpBoxY.Size = new System.Drawing.Size(76, 20); + this.outputJumpBoxY.TabIndex = 106; + this.inputOffsetBoxY.Location = new System.Drawing.Point(332, 245); this.inputOffsetBoxY.Name = "inputOffsetBoxY"; this.inputOffsetBoxY.Size = new System.Drawing.Size(76, 20); @@ -1541,9 +1598,21 @@ namespace grapher this.LimitActiveXLabel.Size = new System.Drawing.Size(13, 13); this.LimitActiveXLabel.TabIndex = 126; this.LimitActiveXLabel.Text = "0"; - // - // OffsetActiveXLabel - // + + this.InputJumpActiveXLabel.AutoSize = true; + this.InputJumpActiveXLabel.Location = new System.Drawing.Point(197, 248); + this.InputJumpActiveXLabel.Name = "InputJumpActiveXLabel"; + this.InputJumpActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.InputJumpActiveXLabel.TabIndex = 125; + this.InputJumpActiveXLabel.Text = "0"; + + this.OutputJumpActiveXLabel.AutoSize = true; + this.OutputJumpActiveXLabel.Location = new System.Drawing.Point(197, 248); + this.OutputJumpActiveXLabel.Name = "OutputJumpActiveXLabel"; + this.OutputJumpActiveXLabel.Size = new System.Drawing.Size(13, 13); + this.OutputJumpActiveXLabel.TabIndex = 125; + this.OutputJumpActiveXLabel.Text = "0"; + this.InputOffsetActiveXLabel.AutoSize = true; this.InputOffsetActiveXLabel.Location = new System.Drawing.Point(197, 248); this.InputOffsetActiveXLabel.Name = "InputOffsetActiveXLabel"; @@ -1682,9 +1751,33 @@ namespace grapher this.writeButton.TabIndex = 111; this.writeButton.Text = "Apply"; this.writeButton.UseVisualStyleBackColor = true; - // - // offsetLabelX - // + + this.inputJumpLabelX.AutoSize = true; + this.inputJumpLabelX.Location = new System.Drawing.Point(37, 248); + this.inputJumpLabelX.Name = "inputJumpLabelX"; + this.inputJumpLabelX.Size = new System.Drawing.Size(35, 13); + this.inputJumpLabelX.TabIndex = 107; + this.inputJumpLabelX.Text = "Input Jump"; + this.inputJumpLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + + this.outputJumpLabelX.AutoSize = true; + this.outputJumpLabelX.Location = new System.Drawing.Point(37, 248); + this.outputJumpLabelX.Name = "outputJumpLabelX"; + this.outputJumpLabelX.Size = new System.Drawing.Size(35, 13); + this.outputJumpLabelX.TabIndex = 107; + this.outputJumpLabelX.Text = "Output Jump"; + this.outputJumpLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + + this.inputJumpBoxX.Location = new System.Drawing.Point(106, 245); + this.inputJumpBoxX.Name = "inputJumpBoxX"; + this.inputJumpBoxX.Size = new System.Drawing.Size(76, 20); + this.inputJumpBoxX.TabIndex = 92; + + this.outputJumpBoxX.Location = new System.Drawing.Point(106, 245); + this.outputJumpBoxX.Name = "outputJumpBoxX"; + this.outputJumpBoxX.Size = new System.Drawing.Size(76, 20); + this.outputJumpBoxX.TabIndex = 92; + this.inputOffsetLabelX.AutoSize = true; this.inputOffsetLabelX.Location = new System.Drawing.Point(37, 248); this.inputOffsetLabelX.Name = "inputOffsetLabelX"; @@ -1700,9 +1793,7 @@ namespace grapher this.outputOffsetLabelX.TabIndex = 107; this.outputOffsetLabelX.Text = "Output Offset"; this.outputOffsetLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // offsetBoxX - // + this.inputOffsetBoxX.Location = new System.Drawing.Point(106, 245); this.inputOffsetBoxX.Name = "inputOffsetBoxX"; this.inputOffsetBoxX.Size = new System.Drawing.Size(76, 20); @@ -2238,6 +2329,8 @@ namespace grapher private System.Windows.Forms.Label OptionSetXTitle; private System.Windows.Forms.Label constantThreeLabelY; private System.Windows.Forms.Label limitLabelY; + private System.Windows.Forms.Label inputJumpLabelY; + private System.Windows.Forms.Label outputJumpLabelY; private System.Windows.Forms.Label inputOffsetLabelY; private System.Windows.Forms.Label outputOffsetLabelY; private System.Windows.Forms.Label inCapLabelYClassic; @@ -2245,17 +2338,23 @@ namespace grapher private System.Windows.Forms.CheckBox ByComponentXYLock; private System.Windows.Forms.Label MidpointActiveYLabel; private System.Windows.Forms.Label LimitActiveYLabel; + private System.Windows.Forms.Label InputJumpActiveYLabel; + private System.Windows.Forms.Label OutputJumpActiveYLabel; private System.Windows.Forms.Label InputOffsetActiveYLabel; private System.Windows.Forms.Label OutputOffsetActiveYLabel; private System.Windows.Forms.Label AccelerationActiveLabelY; private System.Windows.Forms.ComboBox accelTypeDropY; private System.Windows.Forms.TextBox midpointBoxY; private System.Windows.Forms.TextBox limitBoxY; + private System.Windows.Forms.TextBox inputJumpBoxY; + private System.Windows.Forms.TextBox outputJumpBoxY; private System.Windows.Forms.TextBox inputOffsetBoxY; private System.Windows.Forms.TextBox outputOffsetBoxY; private System.Windows.Forms.TextBox accelerationBoxY; private System.Windows.Forms.Label MidpointActiveXLabel; private System.Windows.Forms.Label LimitActiveXLabel; + private System.Windows.Forms.Label InputJumpActiveXLabel; + private System.Windows.Forms.Label OutputJumpActiveXLabel; private System.Windows.Forms.Label InputOffsetActiveXLabel; private System.Windows.Forms.Label OutputOffsetActiveXLabel; private System.Windows.Forms.Label InCapActiveYLabelClassic; @@ -2276,6 +2375,10 @@ namespace grapher private System.Windows.Forms.Label outputOffsetLabelX; private System.Windows.Forms.TextBox inputOffsetBoxX; private System.Windows.Forms.TextBox outputOffsetBoxX; + private System.Windows.Forms.Label inputJumpLabelX; + private System.Windows.Forms.Label outputJumpLabelX; + private System.Windows.Forms.TextBox inputJumpBoxX; + private System.Windows.Forms.TextBox outputJumpBoxX; private System.Windows.Forms.Label constantThreeLabelX; private System.Windows.Forms.TextBox midpointBoxX; private System.Windows.Forms.Label limitLabelX; diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 00483d5..b36d511 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -82,6 +82,10 @@ namespace grapher inCapBoxYPower, outCapBoxXPower, outCapBoxYPower, + inputJumpBoxX, + inputJumpBoxY, + outputJumpBoxX, + outputJumpBoxY, inputOffsetBoxX, inputOffsetBoxY, outputOffsetBoxX, @@ -136,6 +140,10 @@ namespace grapher outCapLabelYPower, CapTypeLabelXPower, CapTypeLabelYPower, + inputJumpLabelX, + inputJumpLabelY, + outputJumpLabelX, + outputJumpLabelY, inputOffsetLabelX, inputOffsetLabelY, outputOffsetLabelX, @@ -177,6 +185,10 @@ namespace grapher OutCapActiveYLabelPower, CapTypeActiveXLabelPower, CapTypeActiveYLabelPower, + InputJumpActiveXLabel, + InputJumpActiveYLabel, + OutputJumpActiveXLabel, + OutputJumpActiveYLabel, InputOffsetActiveXLabel, InputOffsetActiveYLabel, OutputOffsetActiveXLabel, diff --git a/grapher/Layouts/ClassicLayout.cs b/grapher/Layouts/ClassicLayout.cs index 4f82e8a..cb09fba 100644 --- a/grapher/Layouts/ClassicLayout.cs +++ b/grapher/Layouts/ClassicLayout.cs @@ -25,6 +25,8 @@ namespace grapher.Layouts LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/DefaultLayout.cs b/grapher/Layouts/DefaultLayout.cs index f44de01..357c36f 100644 --- a/grapher/Layouts/DefaultLayout.cs +++ b/grapher/Layouts/DefaultLayout.cs @@ -26,6 +26,8 @@ namespace grapher.Layouts LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/JumpLayout.cs b/grapher/Layouts/JumpLayout.cs index 9554175..453a2c7 100644 --- a/grapher/Layouts/JumpLayout.cs +++ b/grapher/Layouts/JumpLayout.cs @@ -17,7 +17,7 @@ namespace grapher.Layouts DecayRateLayout = new OptionLayout(false, string.Empty); GrowthRateLayout = new OptionLayout(false, string.Empty); SmoothLayout = new OptionLayout(true, Smooth); - InputOffsetLayout = new OptionLayout(true, InputOffset); + InputOffsetLayout = new OptionLayout(false, InputOffset); LimitLayout = new OptionLayout(false, Limit); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); @@ -26,6 +26,8 @@ namespace grapher.Layouts LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(true, Input); + OutputJumpLayout = new OptionLayout(true, Output); } } } diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs index 88f8280..8aa0dd5 100644 --- a/grapher/Layouts/LUTLayout.cs +++ b/grapher/Layouts/LUTLayout.cs @@ -34,6 +34,8 @@ namespace grapher.Layouts LutTextLayout = new OptionLayout(true, string.Empty); LutPanelLayout = new OptionLayout(true, string.Empty); LutApplyOptionsLayout = new OptionLayout(true, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); } public override string ActiveName => LUTActiveName; diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 1dced61..e53b37e 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -19,6 +19,8 @@ namespace grapher.Layouts public const string Weight = "Weight"; public const string Smooth = "Smooth"; public const string Gain = "Gain"; + public const string Input = "Input"; + public const string Output = "Output"; public LayoutBase() { @@ -27,10 +29,12 @@ namespace grapher.Layouts SmoothLayout = new OptionLayout(false, string.Empty); ClassicCapLayout = new OptionLayout(false, string.Empty); PowerCapLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); InputOffsetLayout = new OptionLayout(false, string.Empty); LimitLayout = new OptionLayout(false, string.Empty); PowerClassicLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); OutputOffsetLayout = new OptionLayout(false, string.Empty); MidpointLayout = new OptionLayout(false, string.Empty); LutTextLayout = new OptionLayout(false, string.Empty); @@ -59,6 +63,8 @@ namespace grapher.Layouts protected OptionLayout PowerCapLayout { get; set; } + protected OptionLayout InputJumpLayout { get; set; } + protected OptionLayout InputOffsetLayout { get; set; } protected OptionLayout LimitLayout { get; set; } @@ -67,6 +73,8 @@ namespace grapher.Layouts protected OptionLayout ExponentLayout { get; set; } + protected OptionLayout OutputJumpLayout { get; set; } + protected OptionLayout OutputOffsetLayout { get; set; } protected OptionLayout MidpointLayout { get; set; } @@ -91,10 +99,12 @@ namespace grapher.Layouts IOption decayRateOption, IOption growthRateOption, IOption smoothOption, + IOption inputJumpOption, IOption inputOffsetOption, IOption limitOption, IOption powerClassicOption, IOption expOption, + IOption outputJumpOption, IOption outputOffsetOption, IOption midpointOption, IOption lutTextOption, @@ -112,10 +122,12 @@ namespace grapher.Layouts (DecayRateLayout, decayRateOption), (GrowthRateLayout, growthRateOption), (SmoothLayout, smoothOption), + (InputJumpLayout, inputJumpOption), (InputOffsetLayout, inputOffsetOption), (LimitLayout, limitOption), (PowerClassicLayout, powerClassicOption), (ExponentLayout, expOption), + (OutputJumpLayout, outputJumpOption), (OutputOffsetLayout, outputOffsetOption), (MidpointLayout, midpointOption), (LutTextLayout, lutTextOption), @@ -147,10 +159,12 @@ namespace grapher.Layouts IOption decayRateOption, IOption growthRateOption, IOption smoothOption, + IOption inputJumpOption, IOption inputOffsetOption, IOption limitOption, IOption powerClassicOption, IOption expOption, + IOption outputJumpOption, IOption outputOffsetOption, IOption midpointOption, IOption lutTextOption, @@ -163,10 +177,12 @@ namespace grapher.Layouts decayRateOption, growthRateOption, smoothOption, + inputJumpOption, inputOffsetOption, limitOption, powerClassicOption, expOption, + outputJumpOption, outputOffsetOption, midpointOption, lutTextOption, diff --git a/grapher/Layouts/LinearLayout.cs b/grapher/Layouts/LinearLayout.cs index 279f0a9..ebace66 100644 --- a/grapher/Layouts/LinearLayout.cs +++ b/grapher/Layouts/LinearLayout.cs @@ -27,6 +27,8 @@ namespace grapher.Layouts LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/MotivityLayout.cs b/grapher/Layouts/MotivityLayout.cs index 15394d2..d4fd99c 100644 --- a/grapher/Layouts/MotivityLayout.cs +++ b/grapher/Layouts/MotivityLayout.cs @@ -31,6 +31,8 @@ namespace grapher.Layouts LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/NaturalLayout.cs b/grapher/Layouts/NaturalLayout.cs index d182d6d..03f2f82 100644 --- a/grapher/Layouts/NaturalLayout.cs +++ b/grapher/Layouts/NaturalLayout.cs @@ -26,6 +26,8 @@ namespace grapher.Layouts LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/OffLayout.cs b/grapher/Layouts/OffLayout.cs index 630ea16..482f87a 100644 --- a/grapher/Layouts/OffLayout.cs +++ b/grapher/Layouts/OffLayout.cs @@ -26,6 +26,8 @@ namespace grapher.Layouts LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index e34e6a5..fb88ab0 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -24,6 +24,8 @@ LutTextLayout = new OptionLayout(false, string.Empty); LutPanelLayout = new OptionLayout(false, string.Empty); LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); } } } diff --git a/grapher/Layouts/UnsupportedLayout.cs b/grapher/Layouts/UnsupportedLayout.cs index 3aa88aa..a2d7ab5 100644 --- a/grapher/Layouts/UnsupportedLayout.cs +++ b/grapher/Layouts/UnsupportedLayout.cs @@ -31,6 +31,8 @@ namespace grapher.Layouts LutTextLayout = new OptionLayout(true, LUTLayoutText); LutPanelLayout = new OptionLayout(false, string.Empty); LutApplyOptionsLayout = new OptionLayout(false, string.Empty); + InputJumpLayout = new OptionLayout(false, string.Empty); + OutputJumpLayout = new OptionLayout(false, string.Empty); } } } \ No newline at end of file diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index bb65541..e7ae672 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -54,6 +54,10 @@ namespace grapher.Models TextBox inCapBoxYPower, TextBox outCapBoxXPower, TextBox outCapBoxYPower, + TextBox inputJumpBoxX, + TextBox inputJumpBoxY, + TextBox outputJumpBoxX, + TextBox outputJumpBoxY, TextBox inputOffsetBoxX, TextBox inputOffsetBoxY, TextBox outputOffsetBoxX, @@ -108,6 +112,10 @@ namespace grapher.Models Label outCapLabelYPower, Label capTypeLabelXPower, Label capTypeLabelYPower, + Label inputJumpLabelX, + Label inputJumpLabelY, + Label outputJumpLabelX, + Label outputJumpLabelY, Label inputOffsetLabelX, Label inputOffsetLabelY, Label outputOffsetLabelX, @@ -149,6 +157,10 @@ namespace grapher.Models Label outCapActiveYLabelPower, Label capTypeActiveXLabelPower, Label capTypeActiveYLabelPower, + Label inputJumpActiveLabelX, + Label inputJumpActiveLabelY, + Label outputJumpActiveLabelX, + Label outputJumpActiveLabelY, Label inputOffsetActiveLabelX, Label inputOffsetActiveLabelY, Label outputOffsetActiveLabelX, @@ -247,6 +259,42 @@ namespace grapher.Models var directionalityLeft = directionalityPanel.Left; + var inputJumpX = new Option( + inputJumpBoxX, + form, + 0, + inputJumpLabelX, + 0, + new ActiveValueLabel(inputJumpActiveLabelX, activeValueTitleX), + "Jump"); + + var inputJumpY = new Option( + inputJumpBoxY, + form, + 0, + inputJumpLabelY, + optionSetYLeft, + new ActiveValueLabel(inputJumpActiveLabelY, activeValueTitleY), + "Jump"); + + var outputJumpX = new Option( + outputJumpBoxX, + form, + 0, + outputJumpLabelX, + 0, + new ActiveValueLabel(outputJumpActiveLabelX, activeValueTitleX), + "Jump"); + + var outputJumpY = new Option( + outputJumpBoxY, + form, + 0, + outputJumpLabelY, + optionSetYLeft, + new ActiveValueLabel(outputJumpActiveLabelY, activeValueTitleY), + "Jump"); + var inputOffsetX = new Option( inputOffsetBoxX, form, @@ -556,10 +604,12 @@ namespace grapher.Models gainSwitchOptionX, classicCapOptionsX, powerCapOptionsX, + outputJumpX, outputOffsetX, decayRateX, growthRateX, smoothX, + inputJumpX, inputOffsetX, limitX, powerClassicX, @@ -579,10 +629,12 @@ namespace grapher.Models gainSwitchOptionY, classicCapOptionsY, powerCapOptionsY, + outputJumpY, outputOffsetY, decayRateY, growthRateY, smoothY, + inputJumpY, inputOffsetY, limitY, powerClassicY, diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index f079542..359b6b8 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -29,10 +29,12 @@ namespace grapher CheckBoxOption gainSwitch, CapOptions classicCap, CapOptions powerCap, + Option outputJump, Option outputOffset, Option decayRate, Option growthRate, Option smooth, + Option inputJump, Option inputOffset, Option limit, Option powerClassic, @@ -67,10 +69,12 @@ namespace grapher Smooth = smooth; ClassicCap = classicCap; PowerCap = powerCap; + InputJump = inputJump; InputOffset = inputOffset; Limit = limit; PowerClassic = powerClassic; Exponent = exponent; + OutputJump = outputJump; OutputOffset = outputOffset; Midpoint = midpoint; WriteButton = writeButton; @@ -114,6 +118,10 @@ namespace grapher public CapOptions PowerCap { get; } + public Option InputJump { get; } + + public Option OutputJump { get; } + public Option InputOffset { get; } public Option OutputOffset { get; } @@ -229,6 +237,8 @@ namespace grapher PowerCap.Hide(); OutputOffset.Hide(); InputOffset.Hide(); + InputJump.Hide(); + OutputJump.Hide(); Limit.Hide(); PowerClassic.Hide(); Exponent.Hide(); @@ -265,6 +275,8 @@ namespace grapher args.cap.x, args.cap.y, args.capMode); + InputJump.SetActiveValue(args.cap.x); + OutputJump.SetActiveValue(args.cap.y); OutputOffset.SetActiveValue(args.outputOffset); InputOffset.SetActiveValue(args.inputOffset); DecayRate.SetActiveValue(args.decayRate); @@ -329,6 +341,8 @@ namespace grapher args.cap.y = PowerCap.Out.Field.Data; args.capMode = PowerCap.CapTypeOptions.GetSelectedCapMode(); } + if (InputJump.Visible) args.cap.x = InputJump.Field.Data; + if (OutputJump.Visible) args.cap.y = OutputJump.Field.Data; if (Limit.Visible) { if (args.mode == AccelMode.motivity) @@ -344,6 +358,7 @@ namespace grapher if (Exponent.Visible) args.exponentPower = Exponent.Field.Data; if (InputOffset.Visible) args.inputOffset = InputOffset.Field.Data; if (OutputOffset.Visible) args.outputOffset = OutputOffset.Field.Data; + if (Midpoint.Visible) args.midpoint = Midpoint.Field.Data; if (LutPanel.Visible) { @@ -372,6 +387,8 @@ namespace grapher PowerCap.AlignActiveValues(); OutputOffset.AlignActiveValues(); InputOffset.AlignActiveValues(); + OutputJump.AlignActiveValues(); + InputJump.AlignActiveValues(); Limit.AlignActiveValues(); PowerClassic.AlignActiveValues(); Exponent.AlignActiveValues(); @@ -408,10 +425,12 @@ namespace grapher DecayRate, GrowthRate, Smooth, + InputJump, InputOffset, Limit, PowerClassic, Exponent, + OutputJump, OutputOffset, Midpoint, LutText, -- cgit v1.2.3 From c64cc5e1ec3fe60392cafd63b795e5146f6dd159 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 20 Sep 2021 23:08:30 -0700 Subject: Disable output offset when both cap type selected in power --- grapher/Models/AccelGUIFactory.cs | 28 +++++++++++++---------- grapher/Models/Options/Cap/CapOptions.cs | 39 +++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 13 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index e7ae672..5fc7b8b 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -547,18 +547,6 @@ namespace grapher.Models new ActiveValueLabel(capTypeActiveYLabelPower, activeValueTitleY), optionSetYLeft); - var powerCapOptionsX = new CapOptions( - capTypeXPower, - inCapXPower, - outCapXPower, - scaleX); - - var powerCapOptionsY = new CapOptions( - capTypeYPower, - inCapYPower, - outCapYPower, - scaleY); - var lpNorm = new Option( new Field(lpNormBox, form, 2), lpNormLabel, @@ -599,6 +587,22 @@ namespace grapher.Models gainSwitchY, new ActiveValueLabel(gainSwitchActiveLabelY, activeValueTitleY)); + var powerCapOptionsX = new CapOptions( + capTypeXPower, + inCapXPower, + outCapXPower, + scaleX, + outputOffsetX, + gainSwitchOptionX); + + var powerCapOptionsY = new CapOptions( + capTypeYPower, + inCapYPower, + outCapYPower, + scaleY, + outputOffsetY, + gainSwitchOptionY); + var accelerationOptionsX = new AccelTypeOptions( accelTypeDropX, gainSwitchOptionX, diff --git a/grapher/Models/Options/Cap/CapOptions.cs b/grapher/Models/Options/Cap/CapOptions.cs index de0f597..68326e5 100644 --- a/grapher/Models/Options/Cap/CapOptions.cs +++ b/grapher/Models/Options/Cap/CapOptions.cs @@ -25,18 +25,27 @@ namespace grapher.Models.Options.Cap CapTypeOptions capTypeOptions, Option capIn, Option capOut, - Option slope) + Option slope, + Option disableOptionInBoth = null, + CheckBoxOption disableInBoth = null) { CapTypeOptions = capTypeOptions; In = capIn; Out = capOut; Slope = slope; + DisableOptionInBoth = disableOptionInBoth; + DisableInBoth = disableInBoth; ShouldShow = true; _top = Slope.Top; BottomElement = In; CapTypeOptions.OptionsDropdown.SelectedIndexChanged += OnCapTypeDropdownSelectedItemChanged; CapTypeOptions.SelectedCapOption = InCap; + + if (DisableInBoth != null) + { + DisableInBoth.CheckBox.CheckedChanged += OnDisableInBothCheckedChange; + } } #endregion Constructors @@ -51,6 +60,10 @@ namespace grapher.Models.Options.Cap public Option Slope { get; } + private Option DisableOptionInBoth { get; } + + private CheckBoxOption DisableInBoth { get; } + public override int Left { get => In.Left; @@ -189,6 +202,25 @@ namespace grapher.Models.Options.Cap BottomElement = Out; break; } + + DisableBuggedOptionIfApplicable(); + } + + private void DisableBuggedOptionIfApplicable() + { + if (DisableOptionInBoth != null) + { + if (CapTypeOptions.SelectedCapType == CapType.Both && + DisableInBoth != null && + !DisableInBoth.CheckBox.Checked) + { + DisableOptionInBoth.Field.SetToUnavailable(); + } + else + { + DisableOptionInBoth.Field.SetToDefault(); + } + } } private void ShowInCap() @@ -207,6 +239,11 @@ namespace grapher.Models.Options.Cap CapTypeOptions.CheckIfDefault(); } + private void OnDisableInBothCheckedChange(object sender, EventArgs e) + { + DisableBuggedOptionIfApplicable(); + } + #endregion Methods } } -- cgit v1.2.3 From fdab3cf830e1bf87bc0bd3b72339be14265c7338 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 20 Sep 2021 23:41:36 -0700 Subject: Change disable button to reset, update doc text --- grapher/Constants/Constants.cs | 4 ++-- grapher/Models/AccelGUI.cs | 4 ++-- grapher/Models/Serialized/SettingsManager.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 179c45e..0b15ce6 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -104,10 +104,10 @@ namespace grapher /// Default text to be displayed on button delay. public const string ButtonDelayText = "Delay"; - + /// Default text to be displayed on button delay. public const string ResetButtonText = "Reset"; - + /// Title of sensitivity chart. public const string SensitivityChartTitle = "Sensitivity"; diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 51e31a6..23d5017 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -203,7 +203,7 @@ namespace grapher private void SetupButtons() { WriteButton.Top = Constants.SensitivityChartAloneHeight - Constants.ButtonVerticalOffset; - + ResetButton.Appearance = Appearance.Button; ResetButton.FlatStyle = FlatStyle.System; ResetButton.TextAlign = ContentAlignment.MiddleCenter; @@ -239,7 +239,7 @@ namespace grapher private void ResetDriverEventHandler(object sender, EventArgs e) { ButtonDelay(ResetButton); - Settings.DisableDriver(); + Settings.ResetDriver(); RefreshActive(); } diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs index aac0f3e..1c8608f 100644 --- a/grapher/Models/Serialized/SettingsManager.cs +++ b/grapher/Models/Serialized/SettingsManager.cs @@ -127,7 +127,7 @@ namespace grapher.Models.Serialized #region Methods - public void DisableDriver() + public void ResetDriver() { ActiveConfig = DriverConfig.GetDefault(); new Thread(() => DriverConfig.Deactivate()).Start(); -- cgit v1.2.3 From fc8b97efee3c9d9f80d40b7ee154c96e4e4db0c0 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 21 Sep 2021 00:06:55 -0700 Subject: Small tweaks --- grapher/Form1.Designer.cs | 121 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 84 insertions(+), 37 deletions(-) (limited to 'grapher') diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index ac66650..89eafda 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -443,7 +443,7 @@ namespace grapher this.optionsPanel.Name = "optionsPanel"; this.optionsPanel.Size = new System.Drawing.Size(483, 956); this.optionsPanel.TabIndex = 34; - // + // // OutCapActiveYLabelPower // this.OutCapActiveYLabelPower.AutoSize = true; @@ -1417,33 +1417,40 @@ namespace grapher this.limitLabelY.Size = new System.Drawing.Size(28, 13); this.limitLabelY.TabIndex = 136; this.limitLabelY.Text = "Limit"; - + // + // inputJumpLabelY + // this.inputJumpLabelY.AutoSize = true; this.inputJumpLabelY.Location = new System.Drawing.Point(263, 248); this.inputJumpLabelY.Name = "inputJumpLabelY"; - this.inputJumpLabelY.Size = new System.Drawing.Size(35, 13); + this.inputJumpLabelY.Size = new System.Drawing.Size(31, 13); this.inputJumpLabelY.TabIndex = 135; this.inputJumpLabelY.Text = "Input"; - + // + // outputJumpLabelY + // this.outputJumpLabelY.AutoSize = true; this.outputJumpLabelY.Location = new System.Drawing.Point(263, 248); this.outputJumpLabelY.Name = "outputJumpLabelY"; - this.outputJumpLabelY.Size = new System.Drawing.Size(35, 13); + this.outputJumpLabelY.Size = new System.Drawing.Size(39, 13); this.outputJumpLabelY.TabIndex = 135; this.outputJumpLabelY.Text = "Output"; - - + // + // inputOffsetLabelY + // this.inputOffsetLabelY.AutoSize = true; this.inputOffsetLabelY.Location = new System.Drawing.Point(263, 248); this.inputOffsetLabelY.Name = "inputOffsetLabelY"; - this.inputOffsetLabelY.Size = new System.Drawing.Size(35, 13); + this.inputOffsetLabelY.Size = new System.Drawing.Size(62, 13); this.inputOffsetLabelY.TabIndex = 135; this.inputOffsetLabelY.Text = "Input Offset"; - + // + // outputOffsetLabelY + // this.outputOffsetLabelY.AutoSize = true; this.outputOffsetLabelY.Location = new System.Drawing.Point(263, 248); this.outputOffsetLabelY.Name = "outputOffsetLabelY"; - this.outputOffsetLabelY.Size = new System.Drawing.Size(35, 13); + this.outputOffsetLabelY.Size = new System.Drawing.Size(70, 13); this.outputOffsetLabelY.TabIndex = 135; this.outputOffsetLabelY.Text = "Output Offset"; // @@ -1493,28 +1500,36 @@ namespace grapher this.LimitActiveYLabel.Size = new System.Drawing.Size(13, 13); this.LimitActiveYLabel.TabIndex = 130; this.LimitActiveYLabel.Text = "0"; - + // + // InputJumpActiveYLabel + // this.InputJumpActiveYLabel.AutoSize = true; this.InputJumpActiveYLabel.Location = new System.Drawing.Point(414, 248); this.InputJumpActiveYLabel.Name = "InputJumpActiveYLabel"; this.InputJumpActiveYLabel.Size = new System.Drawing.Size(13, 13); this.InputJumpActiveYLabel.TabIndex = 129; this.InputJumpActiveYLabel.Text = "0"; - + // + // OutputJumpActiveYLabel + // this.OutputJumpActiveYLabel.AutoSize = true; this.OutputJumpActiveYLabel.Location = new System.Drawing.Point(414, 248); this.OutputJumpActiveYLabel.Name = "OutputJumpActiveYLabel"; this.OutputJumpActiveYLabel.Size = new System.Drawing.Size(13, 13); this.OutputJumpActiveYLabel.TabIndex = 129; this.OutputJumpActiveYLabel.Text = "0"; - + // + // InputOffsetActiveYLabel + // this.InputOffsetActiveYLabel.AutoSize = true; this.InputOffsetActiveYLabel.Location = new System.Drawing.Point(414, 248); this.InputOffsetActiveYLabel.Name = "InputOffsetActiveYLabel"; this.InputOffsetActiveYLabel.Size = new System.Drawing.Size(13, 13); this.InputOffsetActiveYLabel.TabIndex = 129; this.InputOffsetActiveYLabel.Text = "0"; - + // + // OutputOffsetActiveYLabel + // this.OutputOffsetActiveYLabel.AutoSize = true; this.OutputOffsetActiveYLabel.Location = new System.Drawing.Point(414, 248); this.OutputOffsetActiveYLabel.Name = "OutputOffsetActiveYLabel"; @@ -1553,22 +1568,30 @@ namespace grapher this.limitBoxY.Name = "limitBoxY"; this.limitBoxY.Size = new System.Drawing.Size(76, 20); this.limitBoxY.TabIndex = 108; - + // + // inputJumpBoxY + // this.inputJumpBoxY.Location = new System.Drawing.Point(332, 245); this.inputJumpBoxY.Name = "inputJumpBoxY"; this.inputJumpBoxY.Size = new System.Drawing.Size(76, 20); this.inputJumpBoxY.TabIndex = 106; - + // + // outputJumpBoxY + // this.outputJumpBoxY.Location = new System.Drawing.Point(332, 245); this.outputJumpBoxY.Name = "outputJumpBoxY"; this.outputJumpBoxY.Size = new System.Drawing.Size(76, 20); this.outputJumpBoxY.TabIndex = 106; - + // + // inputOffsetBoxY + // this.inputOffsetBoxY.Location = new System.Drawing.Point(332, 245); this.inputOffsetBoxY.Name = "inputOffsetBoxY"; this.inputOffsetBoxY.Size = new System.Drawing.Size(76, 20); this.inputOffsetBoxY.TabIndex = 106; - + // + // outputOffsetBoxY + // this.outputOffsetBoxY.Location = new System.Drawing.Point(332, 245); this.outputOffsetBoxY.Name = "outputOffsetBoxY"; this.outputOffsetBoxY.Size = new System.Drawing.Size(76, 20); @@ -1598,28 +1621,36 @@ namespace grapher this.LimitActiveXLabel.Size = new System.Drawing.Size(13, 13); this.LimitActiveXLabel.TabIndex = 126; this.LimitActiveXLabel.Text = "0"; - + // + // InputJumpActiveXLabel + // this.InputJumpActiveXLabel.AutoSize = true; this.InputJumpActiveXLabel.Location = new System.Drawing.Point(197, 248); this.InputJumpActiveXLabel.Name = "InputJumpActiveXLabel"; this.InputJumpActiveXLabel.Size = new System.Drawing.Size(13, 13); this.InputJumpActiveXLabel.TabIndex = 125; this.InputJumpActiveXLabel.Text = "0"; - + // + // OutputJumpActiveXLabel + // this.OutputJumpActiveXLabel.AutoSize = true; this.OutputJumpActiveXLabel.Location = new System.Drawing.Point(197, 248); this.OutputJumpActiveXLabel.Name = "OutputJumpActiveXLabel"; this.OutputJumpActiveXLabel.Size = new System.Drawing.Size(13, 13); this.OutputJumpActiveXLabel.TabIndex = 125; this.OutputJumpActiveXLabel.Text = "0"; - + // + // InputOffsetActiveXLabel + // this.InputOffsetActiveXLabel.AutoSize = true; this.InputOffsetActiveXLabel.Location = new System.Drawing.Point(197, 248); this.InputOffsetActiveXLabel.Name = "InputOffsetActiveXLabel"; this.InputOffsetActiveXLabel.Size = new System.Drawing.Size(13, 13); this.InputOffsetActiveXLabel.TabIndex = 125; this.InputOffsetActiveXLabel.Text = "0"; - + // + // OutputOffsetActiveXLabel + // this.OutputOffsetActiveXLabel.AutoSize = true; this.OutputOffsetActiveXLabel.Location = new System.Drawing.Point(197, 248); this.OutputOffsetActiveXLabel.Name = "OutputOffsetActiveXLabel"; @@ -1751,54 +1782,70 @@ namespace grapher this.writeButton.TabIndex = 111; this.writeButton.Text = "Apply"; this.writeButton.UseVisualStyleBackColor = true; - + // + // inputJumpLabelX + // this.inputJumpLabelX.AutoSize = true; this.inputJumpLabelX.Location = new System.Drawing.Point(37, 248); this.inputJumpLabelX.Name = "inputJumpLabelX"; - this.inputJumpLabelX.Size = new System.Drawing.Size(35, 13); + this.inputJumpLabelX.Size = new System.Drawing.Size(59, 13); this.inputJumpLabelX.TabIndex = 107; this.inputJumpLabelX.Text = "Input Jump"; this.inputJumpLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - + // + // outputJumpLabelX + // this.outputJumpLabelX.AutoSize = true; this.outputJumpLabelX.Location = new System.Drawing.Point(37, 248); this.outputJumpLabelX.Name = "outputJumpLabelX"; - this.outputJumpLabelX.Size = new System.Drawing.Size(35, 13); + this.outputJumpLabelX.Size = new System.Drawing.Size(67, 13); this.outputJumpLabelX.TabIndex = 107; this.outputJumpLabelX.Text = "Output Jump"; this.outputJumpLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - + // + // inputJumpBoxX + // this.inputJumpBoxX.Location = new System.Drawing.Point(106, 245); this.inputJumpBoxX.Name = "inputJumpBoxX"; this.inputJumpBoxX.Size = new System.Drawing.Size(76, 20); this.inputJumpBoxX.TabIndex = 92; - + // + // outputJumpBoxX + // this.outputJumpBoxX.Location = new System.Drawing.Point(106, 245); this.outputJumpBoxX.Name = "outputJumpBoxX"; this.outputJumpBoxX.Size = new System.Drawing.Size(76, 20); this.outputJumpBoxX.TabIndex = 92; - + // + // inputOffsetLabelX + // this.inputOffsetLabelX.AutoSize = true; this.inputOffsetLabelX.Location = new System.Drawing.Point(37, 248); this.inputOffsetLabelX.Name = "inputOffsetLabelX"; - this.inputOffsetLabelX.Size = new System.Drawing.Size(35, 13); + this.inputOffsetLabelX.Size = new System.Drawing.Size(62, 13); this.inputOffsetLabelX.TabIndex = 107; this.inputOffsetLabelX.Text = "Input Offset"; this.inputOffsetLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - + // + // outputOffsetLabelX + // this.outputOffsetLabelX.AutoSize = true; this.outputOffsetLabelX.Location = new System.Drawing.Point(37, 248); this.outputOffsetLabelX.Name = "outputOffsetLabelX"; - this.outputOffsetLabelX.Size = new System.Drawing.Size(35, 13); + this.outputOffsetLabelX.Size = new System.Drawing.Size(70, 13); this.outputOffsetLabelX.TabIndex = 107; this.outputOffsetLabelX.Text = "Output Offset"; this.outputOffsetLabelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - + // + // inputOffsetBoxX + // this.inputOffsetBoxX.Location = new System.Drawing.Point(106, 245); this.inputOffsetBoxX.Name = "inputOffsetBoxX"; this.inputOffsetBoxX.Size = new System.Drawing.Size(76, 20); this.inputOffsetBoxX.TabIndex = 92; - + // + // outputOffsetBoxX + // this.outputOffsetBoxX.Location = new System.Drawing.Point(106, 245); this.outputOffsetBoxX.Name = "outputOffsetBoxX"; this.outputOffsetBoxX.Size = new System.Drawing.Size(76, 20); @@ -2019,13 +2066,13 @@ namespace grapher this.AutoWriteMenuItem.CheckOnClick = true; this.AutoWriteMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.AutoWriteMenuItem.Name = "AutoWriteMenuItem"; - this.AutoWriteMenuItem.Size = new System.Drawing.Size(210, 22); - this.AutoWriteMenuItem.Text = "Apply Settings On Startup"; + this.AutoWriteMenuItem.Size = new System.Drawing.Size(257, 22); + this.AutoWriteMenuItem.Text = "Apply Settings.json On GUI Startup"; // // DeviceMenuItem // this.DeviceMenuItem.Name = "DeviceMenuItem"; - this.DeviceMenuItem.Size = new System.Drawing.Size(210, 22); + this.DeviceMenuItem.Size = new System.Drawing.Size(257, 22); this.DeviceMenuItem.Text = "Device Menu"; // // chartsPanel -- cgit v1.2.3 From 79c6a885fc732a0fff0fe694a86ed6450b00794b Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Thu, 23 Sep 2021 00:21:57 -0400 Subject: add indicator to last move on normalized dev read --- grapher/Constants/Constants.cs | 10 ++++++++-- grapher/Models/Mouse/MouseWatcher.cs | 29 ++++++++++++++++++++++++++-- grapher/Models/Serialized/SettingsManager.cs | 15 +++++++++----- 3 files changed, 45 insertions(+), 9 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 0b15ce6..fa500de 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -128,12 +128,18 @@ namespace grapher public const string GuiConfigFileName = ".config"; - /// Text to direcitonality panel title when panel is closed. + /// Text to directionality panel title when panel is closed. public const string DirectionalityTitleClosed = "Anisotropy \u25BC"; - /// Text to direcitonality panel title when panel is open. + /// Text to directionality panel title when panel is open. public const string DirectionalityTitleOpen = "Anisotropy \u25B2"; + /// Default last mouse move label text format. + public const string MouseMoveDefaultFormat = "Last (x, y): ({0}, {1})"; + + /// Last mouse move label text format when last input was from a dpi normalized device. + public const string MouseMoveNormalizedFormat = MouseMoveDefaultFormat + "!"; + /// Style used by System.Double.Parse public const NumberStyles FloatStyle = NumberStyles.Float | NumberStyles.AllowThousands; diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index 91eebb8..723f97b 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -692,6 +692,9 @@ namespace grapher.Models.Mouse SettingsManager = setMngr; MouseData = new MouseData(); + LastMoveDisplayFormat = Constants.MouseMoveDefaultFormat; + LastMoveNormalized = false; + RAWINPUTDEVICE device = new RAWINPUTDEVICE(); device.WindowHandle = ContainingForm.Handle; device.UsagePage = HIDUsagePage.Generic; @@ -721,6 +724,10 @@ namespace grapher.Models.Mouse private Stopwatch Stopwatch { get; } + private string LastMoveDisplayFormat { get; set; } + + private bool LastMoveNormalized { get; set; } + private double PollTime { get => 1000 / SettingsManager.PollRateField.Data; @@ -733,7 +740,7 @@ namespace grapher.Models.Mouse public void UpdateLastMove() { MouseData.Get(out var x, out var y); - Display.Text = $"Last (x, y): ({x}, {y})"; + Display.Text = string.Format(LastMoveDisplayFormat, x, y); } public void ReadMouseMove(Message message) @@ -743,7 +750,25 @@ namespace grapher.Models.Mouse _ = GetRawInputData(message.LParam, RawInputCommand.Input, out rawInput, ref size, Marshal.SizeOf(typeof(RAWINPUTHEADER))); bool relative = !rawInput.Data.Mouse.Flags.HasFlag(RawMouseFlags.MoveAbsolute); - bool deviceMatch = SettingsManager.ActiveHandles.Contains(rawInput.Header.Device); + + bool deviceMatch = false; + foreach (var (handle, normalized) in SettingsManager.ActiveNormTaggedHandles) + { + if (handle == rawInput.Header.Device) + { + deviceMatch = true; + + if (normalized != LastMoveNormalized) + { + LastMoveDisplayFormat = normalized ? + Constants.MouseMoveNormalizedFormat : + Constants.MouseMoveDefaultFormat; + LastMoveNormalized = normalized; + } + + break; + } + } if (relative && deviceMatch && (rawInput.Data.Mouse.LastX != 0 || rawInput.Data.Mouse.LastY != 0)) { diff --git a/grapher/Models/Serialized/SettingsManager.cs b/grapher/Models/Serialized/SettingsManager.cs index 1c8608f..43550c5 100644 --- a/grapher/Models/Serialized/SettingsManager.cs +++ b/grapher/Models/Serialized/SettingsManager.cs @@ -31,7 +31,7 @@ namespace grapher.Models.Serialized StreamingModeMenuItem = streamingMode; SystemDevices = new List(); - ActiveHandles = new List(); + ActiveNormTaggedHandles = new List<(IntPtr, bool)>(); GuiSettings = GUISettings.MaybeLoad(); @@ -114,7 +114,7 @@ namespace grapher.Models.Serialized public IList SystemDevices { get; private set; } - public List ActiveHandles { get; } + public List<(IntPtr, bool)> ActiveNormTaggedHandles { get; } private ToolStripMenuItem AutoWriteMenuItem { get; set; } @@ -198,19 +198,24 @@ namespace grapher.Models.Serialized public void SetActiveHandles() { - ActiveHandles.Clear(); + ActiveNormTaggedHandles.Clear(); bool ActiveProfileIsFirst = ActiveProfile == ActiveConfig.profiles[0]; foreach (var sysDev in SystemDevices) { + void AddHandlesFromSysDev(bool normalized) + { + ActiveNormTaggedHandles.AddRange(sysDev.handles.Select(h => (h, normalized))); + } + var settings = ActiveConfig.devices.Find(d => d.id == sysDev.id); if (settings is null) { if (ActiveProfileIsFirst && !ActiveConfig.defaultDeviceConfig.disable) { - ActiveHandles.AddRange(sysDev.handles); + AddHandlesFromSysDev(ActiveConfig.defaultDeviceConfig.dpi > 0); } } else if (!settings.config.disable && @@ -219,7 +224,7 @@ namespace grapher.Models.Serialized !ActiveProfileNamesSet.Contains(settings.profile))) || ActiveProfile.name == settings.profile)) { - ActiveHandles.AddRange(sysDev.handles); + AddHandlesFromSysDev(settings.config.dpi > 0); } } } -- cgit v1.2.3 From f9323128aeffbfd2fe2931d6e5ad29acd394d878 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Thu, 23 Sep 2021 03:11:17 -0400 Subject: change MouseMoveNormalizedFormat --- grapher/Constants/Constants.cs | 19 +++++++++---------- grapher/Models/Mouse/MouseWatcher.cs | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'grapher') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index fa500de..af9db23 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -134,12 +134,6 @@ namespace grapher /// Text to directionality panel title when panel is open. public const string DirectionalityTitleOpen = "Anisotropy \u25B2"; - /// Default last mouse move label text format. - public const string MouseMoveDefaultFormat = "Last (x, y): ({0}, {1})"; - - /// Last mouse move label text format when last input was from a dpi normalized device. - public const string MouseMoveNormalizedFormat = MouseMoveDefaultFormat + "!"; - /// Style used by System.Double.Parse public const NumberStyles FloatStyle = NumberStyles.Float | NumberStyles.AllowThousands; @@ -151,6 +145,15 @@ namespace grapher /// Line Width For Series data on chart public const int ChartSeriesLineWidth = 3; + #endregion Constants + + #region ReadOnly + + /// Default last mouse move label text format. + public static readonly string MouseMoveDefaultFormat = "Last (x, y): ({0}, {1})"; + + /// Last mouse move label text format when last input was from a dpi normalized device. + public static readonly string MouseMoveNormalizedFormat = $"{MouseMoveDefaultFormat} (n)"; /// Marker size for last-mouse-move chart series. public const int DotMarkerSize = 7; @@ -167,10 +170,6 @@ namespace grapher /// Background Color When Streamer Mode Inactive public static readonly System.Drawing.Color bgNoStreamer = System.Drawing.Color.White; - #endregion Constants - - #region ReadOnly - /// Color of font in active value labels. public static readonly Color ActiveValueFontColor = Color.FromArgb(255, 65, 65, 65); diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index 723f97b..fb34dd6 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -761,8 +761,8 @@ namespace grapher.Models.Mouse if (normalized != LastMoveNormalized) { LastMoveDisplayFormat = normalized ? - Constants.MouseMoveNormalizedFormat : - Constants.MouseMoveDefaultFormat; + Constants.MouseMoveNormalizedFormat : + Constants.MouseMoveDefaultFormat; LastMoveNormalized = normalized; } -- cgit v1.2.3