diff --git a/Meade.net/SetupDialogForm.cs b/Meade.net/SetupDialogForm.cs index d56b963..42e7be1 100644 --- a/Meade.net/SetupDialogForm.cs +++ b/Meade.net/SetupDialogForm.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Globalization; @@ -7,6 +8,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Windows.Forms; using ASCOM.Meade.net.Properties; +using ASCOM.Utilities; namespace ASCOM.Meade.net { @@ -20,6 +22,31 @@ namespace ASCOM.Meade.net var assemblyInfo = new AssemblyInfo(); Text = string.Format(Resources.SetupDialogForm_SetupDialogForm__0__Settings___1__, assemblyInfo.Product, assemblyInfo.AssemblyVersion); + + SetItemsFromEnum(cboStopBits.Items, typeof(SerialStopBits)); + SetItemsFromEnum(cboParity.Items, typeof(SerialParity)); + SetItemsFromEnumValues(cboSpeed.Items, typeof(SerialSpeed)); + SetItemsFromEnum(cboHandShake.Items, typeof(SerialHandshake)); + } + + private void SetItemsFromEnum(IList items, Type enumItems) + { + items.Clear(); + + foreach (var item in Enum.GetNames(enumItems)) + { + items.Add(item); + } + } + + private void SetItemsFromEnumValues(IList items, Type enumItems) + { + items.Clear(); + + foreach (int item in Enum.GetValues(enumItems)) + { + items.Add(item); + } } public sealed override string Text diff --git a/Meade.net/SetupDialogForm.designer.cs b/Meade.net/SetupDialogForm.designer.cs index d0858bd..e049e87 100644 --- a/Meade.net/SetupDialogForm.designer.cs +++ b/Meade.net/SetupDialogForm.designer.cs @@ -64,8 +64,20 @@ namespace ASCOM.Meade.net this.label14 = new System.Windows.Forms.Label(); this.nudSettleTime = new System.Windows.Forms.NumericUpDown(); this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.cboStopBits = new System.Windows.Forms.ComboBox(); + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + this.cboParity = new System.Windows.Forms.ComboBox(); + this.cboSpeed = new System.Windows.Forms.ComboBox(); + this.cboHandShake = new System.Windows.Forms.ComboBox(); + this.label17 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.label21 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.SuspendLayout(); // // cmdOK @@ -255,10 +267,85 @@ namespace ASCOM.Meade.net resources.ApplyResources(this.label15, "label15"); this.label15.Name = "label15"; // + // label16 + // + resources.ApplyResources(this.label16, "label16"); + this.label16.Name = "label16"; + // + // cboStopBits + // + this.cboStopBits.FormattingEnabled = true; + resources.ApplyResources(this.cboStopBits, "cboStopBits"); + this.cboStopBits.Name = "cboStopBits"; + // + // numericUpDown1 + // + resources.ApplyResources(this.numericUpDown1, "numericUpDown1"); + this.numericUpDown1.Maximum = new decimal(new int[] { + 32767, + 0, + 0, + 0}); + this.numericUpDown1.Name = "numericUpDown1"; + // + // cboParity + // + this.cboParity.FormattingEnabled = true; + resources.ApplyResources(this.cboParity, "cboParity"); + this.cboParity.Name = "cboParity"; + // + // cboSpeed + // + this.cboSpeed.FormattingEnabled = true; + resources.ApplyResources(this.cboSpeed, "cboSpeed"); + this.cboSpeed.Name = "cboSpeed"; + // + // cboHandShake + // + this.cboHandShake.FormattingEnabled = true; + resources.ApplyResources(this.cboHandShake, "cboHandShake"); + this.cboHandShake.Name = "cboHandShake"; + // + // label17 + // + resources.ApplyResources(this.label17, "label17"); + this.label17.Name = "label17"; + // + // label18 + // + resources.ApplyResources(this.label18, "label18"); + this.label18.Name = "label18"; + // + // label19 + // + resources.ApplyResources(this.label19, "label19"); + this.label19.Name = "label19"; + // + // label20 + // + resources.ApplyResources(this.label20, "label20"); + this.label20.Name = "label20"; + // + // label21 + // + resources.ApplyResources(this.label21, "label21"); + this.label21.Name = "label21"; + // // SetupDialogForm // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label21); + this.Controls.Add(this.label20); + this.Controls.Add(this.label19); + this.Controls.Add(this.label18); + this.Controls.Add(this.label17); + this.Controls.Add(this.cboHandShake); + this.Controls.Add(this.cboSpeed); + this.Controls.Add(this.cboParity); + this.Controls.Add(this.numericUpDown1); + this.Controls.Add(this.cboStopBits); + this.Controls.Add(this.label16); this.Controls.Add(this.label15); this.Controls.Add(this.nudSettleTime); this.Controls.Add(this.label14); @@ -298,6 +385,7 @@ namespace ASCOM.Meade.net this.Shown += new System.EventHandler(this.SetupDialogForm_Shown); ((System.ComponentModel.ISupportInitialize)(this.picASCOM)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -336,5 +424,16 @@ namespace ASCOM.Meade.net private Label label14; private NumericUpDown nudSettleTime; private Label label15; + private Label label16; + private ComboBox cboStopBits; + private NumericUpDown numericUpDown1; + private ComboBox cboParity; + private ComboBox cboSpeed; + private ComboBox cboHandShake; + private Label label17; + private Label label18; + private Label label19; + private Label label20; + private Label label21; } } \ No newline at end of file diff --git a/Meade.net/SetupDialogForm.resx b/Meade.net/SetupDialogForm.resx index 73de650..7500694 100644 --- a/Meade.net/SetupDialogForm.resx +++ b/Meade.net/SetupDialogForm.resx @@ -123,7 +123,7 @@ - 281, 457 + 557, 391 59, 24 @@ -145,13 +145,13 @@ $this - 29 + 40 Bottom, Right - 281, 487 + 557, 421 59, 25 @@ -172,7 +172,7 @@ $this - 28 + 39 12, 9 @@ -196,13 +196,13 @@ $this - 27 + 38 Top, Right - 292, 9 + 568, 9 48, 56 @@ -223,7 +223,7 @@ $this - 26 + 37 True @@ -250,22 +250,22 @@ $this - 25 + 36 True - 97, 137 + 97, 305 - 69, 17 + 90, 17 2 - Trace on + Trace Log on chkTrace @@ -277,7 +277,7 @@ $this - 24 + 35 97, 87 @@ -298,13 +298,13 @@ $this - 23 + 34 True - 12, 278 + 290, 169 61, 13 @@ -325,10 +325,10 @@ $this - 22 + 33 - 97, 275 + 375, 166 46, 20 @@ -349,13 +349,13 @@ $this - 21 + 32 True - 149, 278 + 427, 169 122, 13 @@ -376,13 +376,13 @@ $this - 20 + 31 True - 149, 291 + 427, 182 105, 13 @@ -403,13 +403,13 @@ $this - 19 + 30 True - 12, 310 + 290, 201 50, 13 @@ -430,7 +430,7 @@ $this - 18 + 29 Unchanged @@ -442,7 +442,7 @@ High - 97, 307 + 375, 198 90, 21 @@ -460,7 +460,7 @@ $this - 17 + 28 True @@ -469,7 +469,7 @@ NoControl - 12, 337 + 290, 228 67, 13 @@ -490,7 +490,7 @@ $this - 16 + 27 Auto @@ -502,7 +502,7 @@ Pulse guiding - 97, 334 + 375, 225 90, 21 @@ -520,7 +520,7 @@ $this - 15 + 26 True @@ -529,7 +529,7 @@ Microsoft Sans Serif, 8.25pt, style=Bold - 12, 176 + 290, 67 66, 13 @@ -550,7 +550,7 @@ $this - 14 + 25 True @@ -562,7 +562,7 @@ NoControl - 12, 393 + 290, 284 52, 13 @@ -583,10 +583,10 @@ $this - 13 + 24 - 97, 411 + 375, 302 46, 20 @@ -607,7 +607,7 @@ $this - 11 + 22 True @@ -616,7 +616,7 @@ NoControl - 12, 414 + 290, 305 79, 13 @@ -637,7 +637,7 @@ $this - 12 + 23 True @@ -646,7 +646,7 @@ NoControl - 149, 414 + 427, 305 20, 13 @@ -667,7 +667,7 @@ $this - 10 + 21 True @@ -700,13 +700,13 @@ $this - 9 + 20 True - 97, 437 + 375, 328 109, 17 @@ -727,13 +727,13 @@ $this - 8 + 19 True - 97, 460 + 375, 351 112, 17 @@ -754,7 +754,7 @@ $this - 7 + 18 17, 17 @@ -790,7 +790,7 @@ $this - 6 + 17 17, 17 @@ -799,7 +799,7 @@ True - 12, 205 + 290, 96 72, 13 @@ -820,10 +820,10 @@ $this - 5 + 16 - 97, 202 + 375, 93 100, 20 @@ -841,13 +841,13 @@ $this - 4 + 15 True - 203, 205 + 481, 96 38, 13 @@ -868,13 +868,13 @@ $this - 3 + 14 True - 12, 236 + 290, 127 56, 13 @@ -895,10 +895,10 @@ $this - 2 + 13 - 97, 234 + 375, 125 120, 20 @@ -916,13 +916,13 @@ $this - 1 + 12 True - 223, 236 + 501, 127 47, 13 @@ -943,16 +943,295 @@ $this + 11 + + + True + + + 15, 139 + + + 49, 13 + + + 29 + + + Data bits + + + label16 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 10 + + + 97, 163 + + + 119, 21 + + + 30 + + + cboStopBits + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + 97, 137 + + + 120, 20 + + + 31 + + + numericUpDown1 + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + 97, 190 + + + 119, 21 + + + 32 + + + cboParity + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + 97, 217 + + + 119, 21 + + + 33 + + + cboSpeed + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + 97, 244 + + + 121, 21 + + + 34 + + + cboHandShake + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + True + + + 15, 166 + + + 49, 13 + + + 35 + + + Stop Bits + + + label17 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + True + + + 15, 193 + + + 33, 13 + + + 36 + + + Parity + + + label18 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + True + + + 15, 220 + + + 38, 13 + + + 37 + + + Speed + + + label19 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + True + + + 15, 247 + + + 62, 13 + + + 38 + + + Handshake + + + label20 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 15, 284 + + + 73, 13 + + + 39 + + + Diagnostics + + + label21 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 True + + 25 + 6, 13 - 350, 520 + 626, 454 + + + NoControl CenterScreen