From 3ee661910cafb8a4d89fc29d4aea92b5a4d0d3b9 Mon Sep 17 00:00:00 2001 From: Tatsuya Yamaguchi Date: Wed, 4 Oct 2023 10:27:41 +0900 Subject: [PATCH] Controls: add Max/Min Alt for PropagationSettings --- Controls/PropagationSettings.cs | 98 +++++++++++++ Controls/PropagationSettings.resx | 225 +++++++++++++++++++++++++----- 2 files changed, 287 insertions(+), 36 deletions(-) diff --git a/Controls/PropagationSettings.cs b/Controls/PropagationSettings.cs index d4d88969fd..9a482c86bc 100644 --- a/Controls/PropagationSettings.cs +++ b/Controls/PropagationSettings.cs @@ -28,6 +28,12 @@ public class PropagationSettings : Form private NumericUpDown NUM_height; private Label label114; private NumericUpDown Tolerance; + private NumericUpDown NUM_max; + private Label label2; + private NumericUpDown NUM_min; + private Label label1; + private CheckBox chk_setalt; + private Label label3; private CheckBox chk_ele; public PropagationSettings() @@ -43,12 +49,15 @@ public PropagationSettings() NUM_range.Value = (decimal)Settings.Instance.GetFloat("Propagation_Range", 2.0f); NUM_height.Value = (decimal)Settings.Instance.GetFloat("Propagation_Height", 2.0f); Tolerance.Value = (decimal)Settings.Instance.GetFloat("Propagation_Tolerance", 0.8f); + NUM_min.Value = (decimal)Settings.Instance.GetFloat("Propagation_Minalt", 100.0f); + NUM_max.Value = (decimal)Settings.Instance.GetFloat("Propagation_Maxalt", 400.0f); chk_ele.Checked = Maps.Propagation.ele_run; chk_terrain.Checked = Maps.Propagation.ter_run; chk_rf.Checked = Maps.Propagation.rf_run; chk_homedist.Checked = Maps.Propagation.home_kmleft; chk_dronedist.Checked = Maps.Propagation.drone_kmleft; + chk_setalt.Checked = Maps.Propagation.set_alt_min_max; } private void InitializeComponent() @@ -60,6 +69,10 @@ private void InitializeComponent() this.chk_dronedist = new System.Windows.Forms.CheckBox(); this.chk_homedist = new System.Windows.Forms.CheckBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.NUM_max = new System.Windows.Forms.NumericUpDown(); + this.label2 = new System.Windows.Forms.Label(); + this.NUM_min = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); this.label91 = new System.Windows.Forms.Label(); this.label89 = new System.Windows.Forms.Label(); this.Clearance = new System.Windows.Forms.NumericUpDown(); @@ -77,7 +90,11 @@ private void InitializeComponent() this.NUM_height = new System.Windows.Forms.NumericUpDown(); this.label114 = new System.Windows.Forms.Label(); this.Tolerance = new System.Windows.Forms.NumericUpDown(); + this.chk_setalt = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.NUM_max)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.NUM_min)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.Clearance)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUM_range)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUM_height)).BeginInit(); @@ -131,11 +148,16 @@ private void InitializeComponent() // // groupBox1 // + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.NUM_max); this.groupBox1.Controls.Add(this.label91); + this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label89); this.groupBox1.Controls.Add(this.Clearance); + this.groupBox1.Controls.Add(this.NUM_min); this.groupBox1.Controls.Add(this.label100); this.groupBox1.Controls.Add(this.label113); + this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.label109); this.groupBox1.Controls.Add(this.CMB_Rotational); this.groupBox1.Controls.Add(this.label90); @@ -152,6 +174,50 @@ private void InitializeComponent() this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; // + // NUM_max + // + this.NUM_max.DecimalPlaces = 1; + this.NUM_max.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.NUM_max, "NUM_max"); + this.NUM_max.Maximum = new decimal(new int[] { + 2000, + 0, + 0, + 0}); + this.NUM_max.Name = "NUM_max"; + this.NUM_max.ValueChanged += new System.EventHandler(this.NUM_max_ValueChanged); + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // NUM_min + // + this.NUM_min.DecimalPlaces = 1; + this.NUM_min.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.NUM_min, "NUM_min"); + this.NUM_min.Maximum = new decimal(new int[] { + 2000, + 0, + 0, + 0}); + this.NUM_min.Name = "NUM_min"; + this.NUM_min.ValueChanged += new System.EventHandler(this.NUM_min_ValueChanged); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // // label91 // resources.ApplyResources(this.label91, "label91"); @@ -312,9 +378,24 @@ private void InitializeComponent() this.Tolerance.Name = "Tolerance"; this.Tolerance.ValueChanged += new System.EventHandler(this.Tolerance_ValueChanged); // + // chk_setalt + // + resources.ApplyResources(this.chk_setalt, "chk_setalt"); + this.chk_setalt.Checked = true; + this.chk_setalt.CheckState = System.Windows.Forms.CheckState.Indeterminate; + this.chk_setalt.Name = "chk_setalt"; + this.chk_setalt.UseVisualStyleBackColor = true; + this.chk_setalt.CheckedChanged += new System.EventHandler(this.chk_setalt_CheckedChanged); + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // // PropagationSettings // resources.ApplyResources(this, "$this"); + this.Controls.Add(this.chk_setalt); this.Controls.Add(this.groupBox1); this.Controls.Add(this.chk_homedist); this.Controls.Add(this.chk_dronedist); @@ -324,6 +405,8 @@ private void InitializeComponent() this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "PropagationSettings"; this.groupBox1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.NUM_max)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.NUM_min)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.Clearance)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUM_range)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUM_height)).EndInit(); @@ -392,5 +475,20 @@ private void Tolerance_ValueChanged(object sender, EventArgs e) { Settings.Instance["Propagation_Tolerance"] = Tolerance.Value.ToString(); } + + private void NUM_min_ValueChanged(object sender, EventArgs e) + { + Settings.Instance["Propagation_Minalt"] = NUM_min.Value.ToString(); + } + + private void NUM_max_ValueChanged(object sender, EventArgs e) + { + Settings.Instance["Propagation_Maxalt"] = NUM_max.Value.ToString(); + } + + private void chk_setalt_CheckedChanged(object sender, EventArgs e) + { + Maps.Propagation.set_alt_min_max = chk_setalt.Checked; + } } } \ No newline at end of file diff --git a/Controls/PropagationSettings.resx b/Controls/PropagationSettings.resx index 18aae38687..d5bcabf01d 100644 --- a/Controls/PropagationSettings.resx +++ b/Controls/PropagationSettings.resx @@ -126,7 +126,7 @@ 13, 13 - 70, 17 + 71, 16 0 @@ -144,7 +144,7 @@ $this - 5 + 6 True @@ -153,7 +153,7 @@ 13, 36 - 59, 17 + 60, 16 1 @@ -171,7 +171,7 @@ $this - 4 + 5 True @@ -180,7 +180,7 @@ 13, 59 - 64, 17 + 64, 16 2 @@ -198,7 +198,7 @@ $this - 3 + 4 True @@ -207,7 +207,7 @@ 107, 36 - 97, 17 + 103, 16 3 @@ -225,7 +225,7 @@ $this - 2 + 3 True @@ -234,7 +234,7 @@ 107, 13 - 96, 17 + 102, 16 4 @@ -252,9 +252,57 @@ $this - 1 + 2 + + NoControl + + + 16, 126 + + + 82, 23 + + + 133 + + + Altitude Filter + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + 317, 124 + + + 56, 19 + + + 132 + + + NUM_max + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 1 + NoControl @@ -280,7 +328,34 @@ groupBox1 - 0 + 2 + + + NoControl + + + 236, 126 + + + 63, 17 + + + 131 + + + Max Alt + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 3 NoControl @@ -307,13 +382,13 @@ groupBox1 - 1 + 4 174, 19 - 56, 20 + 56, 19 120 @@ -328,7 +403,28 @@ groupBox1 - 2 + 5 + + + 174, 124 + + + 56, 19 + + + 130 + + + NUM_min + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 6 NoControl @@ -355,7 +451,7 @@ groupBox1 - 3 + 7 NoControl @@ -382,7 +478,34 @@ groupBox1 - 4 + 8 + + + NoControl + + + 97, 126 + + + 63, 17 + + + 129 + + + Min Alt + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 9 NoControl @@ -409,7 +532,7 @@ groupBox1 - 5 + 10 0.5 @@ -430,7 +553,7 @@ 174, 72 - 40, 21 + 40, 20 119 @@ -445,7 +568,7 @@ groupBox1 - 6 + 11 NoControl @@ -472,7 +595,7 @@ groupBox1 - 7 + 12 2 @@ -493,7 +616,7 @@ 174, 45 - 40, 21 + 40, 20 118 @@ -508,7 +631,7 @@ groupBox1 - 8 + 13 NoControl @@ -535,7 +658,7 @@ groupBox1 - 9 + 14 0 @@ -556,7 +679,7 @@ 317, 72 - 40, 21 + 40, 20 0 @@ -571,7 +694,7 @@ groupBox1 - 10 + 15 NoControl @@ -598,13 +721,13 @@ groupBox1 - 11 + 16 442, 73 - 56, 20 + 56, 19 121 @@ -619,7 +742,7 @@ groupBox1 - 12 + 17 NoControl @@ -646,13 +769,13 @@ groupBox1 - 13 + 18 601, 73 - 46, 20 + 46, 19 122 @@ -667,7 +790,7 @@ groupBox1 - 14 + 19 NoControl @@ -694,13 +817,13 @@ groupBox1 - 15 + 20 174, 99 - 56, 20 + 56, 19 123 @@ -715,13 +838,13 @@ groupBox1 - 16 + 21 13, 82 - 674, 141 + 674, 152 130 @@ -739,13 +862,43 @@ $this + 1 + + + True + + + NoControl + + + 107, 60 + + + 95, 16 + + + 131 + + + Altitude Filter + + + chk_setalt + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 True - 694, 230 + 694, 237 Propagation Settings