diff options
| -rw-r--r-- | grapher/Form1.cs | 12 | ||||
| -rw-r--r-- | grapher/Models/AccelGUI.cs | 8 | ||||
| -rw-r--r-- | grapher/Models/Charts/AccelCharts.cs | 10 | ||||
| -rw-r--r-- | grapher/Models/Fields/FieldXY.cs | 7 | ||||
| -rw-r--r-- | grapher/Models/Options/ApplyOptions.cs | 2 | ||||
| -rw-r--r-- | grapher/Models/Options/OptionXY.cs | 7 |
6 files changed, 16 insertions, 30 deletions
diff --git a/grapher/Form1.cs b/grapher/Form1.cs index f46c960..f496293 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -41,8 +41,7 @@ namespace grapher new ChartXY(AccelerationChart, AccelerationChartY), new ChartXY(VelocityChart, VelocityChartY), new ChartXY(GainChart, GainChartY), - showVelocityGainToolStripMenuItem, - new CheckBox[] { sensXYLock, weightXYLock, capXYLock }); + showVelocityGainToolStripMenuItem); ActiveValueTitle.AutoSize = false; ActiveValueTitle.Left = LockXYLabel.Left + LockXYLabel.Width; @@ -61,8 +60,7 @@ namespace grapher new ActiveValueLabelXY( new ActiveValueLabel(SensitivityActiveXLabel, ActiveValueTitle), new ActiveValueLabel(SensitivityActiveYLabel, ActiveValueTitle)), - "Sensitivity", - accelCharts); + "Sensitivity"); var rotation = new Option( rotationBox, @@ -82,8 +80,7 @@ namespace grapher new ActiveValueLabelXY( new ActiveValueLabel(WeightActiveXLabel, ActiveValueTitle), new ActiveValueLabel(WeightActiveYLabel, ActiveValueTitle)), - "Weight", - accelCharts); + "Weight"); var cap = new OptionXY( capBoxX, @@ -95,8 +92,7 @@ namespace grapher new ActiveValueLabelXY( new ActiveValueLabel(CapActiveXLabel, ActiveValueTitle), new ActiveValueLabel(CapActiveYLabel, ActiveValueTitle)), - "Cap", - accelCharts); + "Cap"); var offset = new Option( offsetBox, diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index 7789337..a26f13d 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -149,10 +149,10 @@ namespace grapher Settings.ActiveAccel, Settings.RawAccelSettings.AccelerationSettings); AccelCharts.Bind(); - UpdateActiveValueLabels(); + UpdateShownActiveValues(); } - public void UpdateActiveValueLabels() + public void UpdateShownActiveValues() { var settings = Settings.RawAccelSettings.AccelerationSettings; @@ -165,7 +165,9 @@ namespace grapher LimitOrExponent.SetActiveValue(settings.args.x.limit); //exp, powerexp Midpoint.SetActiveValue(settings.args.x.midpoint); ApplyOptions.SetActive(settings.combineMagnitudes); - //Cap.SetActiveValues(Settings.ActiveAccel.GainCap, Settings.ActiveAccel.CapX, Settings.ActiveAccel.CapY, Settings.ActiveAccel.GainCapEnabled); + Cap.SetActiveValues(settings.args.x.gainCap, settings.args.x.scaleCap, settings.args.y.scaleCap, settings.args.x.gainCap > 0); + + AccelCharts.RefreshXY(settings.combineMagnitudes); } private void OnScaleMenuItemClick(object sender, EventArgs e) diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 1aa3909..0136ced 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -24,8 +24,7 @@ namespace grapher ChartXY sensitivityChart, ChartXY velocityChart, ChartXY gainChart, - ToolStripMenuItem enableVelocityAndGain, - ICollection<CheckBox> checkBoxesXY) + ToolStripMenuItem enableVelocityAndGain) { Estimated = new EstimatedPoints(); EstimatedX = new EstimatedPoints(); @@ -37,7 +36,6 @@ namespace grapher VelocityChart = velocityChart; GainChart = gainChart; EnableVelocityAndGain = enableVelocityAndGain; - CheckBoxesXY = checkBoxesXY; SensitivityChart.SetPointBinds(Estimated.Sensitivity, EstimatedX.Sensitivity, EstimatedY.Sensitivity); VelocityChart.SetPointBinds(Estimated.Velocity, EstimatedX.Velocity, EstimatedY.Velocity); @@ -78,8 +76,6 @@ namespace grapher private EstimatedPoints EstimatedY { get; } - private ICollection<CheckBox> CheckBoxesXY { get; } - private bool Combined { get; set; } private int FormBorderHeight { get; } @@ -119,9 +115,9 @@ namespace grapher } } - public void RefreshXY() + public void RefreshXY(bool isWhole) { - if (CheckBoxesXY.All(box => box.Checked)) + if (isWhole) { ShowCombined(); } diff --git a/grapher/Models/Fields/FieldXY.cs b/grapher/Models/Fields/FieldXY.cs index 609af9d..87e0b9c 100644 --- a/grapher/Models/Fields/FieldXY.cs +++ b/grapher/Models/Fields/FieldXY.cs @@ -13,14 +13,13 @@ namespace grapher public const string ShortenedFormatString = "0.###"; - public FieldXY(TextBox xBox, TextBox yBox, CheckBox lockCheckBox, Form containingForm, double defaultData, AccelCharts accelCharts) + public FieldXY(TextBox xBox, TextBox yBox, CheckBox lockCheckBox, Form containingForm, double defaultData) { XField = new Field(xBox, containingForm, defaultData); YField = new Field(yBox, containingForm, defaultData); YField.FormatString = ShortenedFormatString; LockCheckBox = lockCheckBox; LockCheckBox.CheckedChanged += new System.EventHandler(CheckChanged); - AccelCharts = accelCharts; XField.Box.Width = (YField.Box.Left + YField.Box.Width - XField.Box.Left - DefaultSeparation) / 2; YField.Box.Width = XField.Box.Width; @@ -59,8 +58,6 @@ namespace grapher public Field YField { get; } - private AccelCharts AccelCharts { get; } - private bool Combined { get; set; } private int DefaultWidthX { get; } @@ -79,8 +76,6 @@ namespace grapher { SetSeparate(); } - - AccelCharts.RefreshXY(); } public void SetCombined() diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index 389bf62..0c9fd6a 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -68,7 +68,7 @@ namespace grapher.Models.Options { if (ByComponentVectorMenuItem.Checked) { - EnableWholeApplication(); + EnableByComponentApplication(); } } diff --git a/grapher/Models/Options/OptionXY.cs b/grapher/Models/Options/OptionXY.cs index 8e22617..b026c8a 100644 --- a/grapher/Models/Options/OptionXY.cs +++ b/grapher/Models/Options/OptionXY.cs @@ -24,9 +24,8 @@ namespace grapher Form containingForm, double defaultData, Label label, - AccelCharts accelCharts, ActiveValueLabelXY activeValueLabels) - : this(new FieldXY(xBox, yBox, lockCheckBox, containingForm, defaultData, accelCharts), label, activeValueLabels) + : this(new FieldXY(xBox, yBox, lockCheckBox, containingForm, defaultData), label, activeValueLabels) { } @@ -38,8 +37,7 @@ namespace grapher double defaultData, Label label, ActiveValueLabelXY activeValueLabels, - string startingName, - AccelCharts accelCharts): + string startingName): this( xBox, yBox, @@ -47,7 +45,6 @@ namespace grapher containingForm, defaultData, label, - accelCharts, activeValueLabels) { SetName(startingName); |