diff --git a/Meade.net/ProfileProperties.cs b/Meade.net/ProfileProperties.cs index 6a3833d..48b6ade 100644 --- a/Meade.net/ProfileProperties.cs +++ b/Meade.net/ProfileProperties.cs @@ -26,5 +26,6 @@ namespace ASCOM.Meade.net public double FocalLength { get; set; } public double ApertureArea { get; set; } public double ApertureDiameter { get; set; } + public int TimeoutMs { get; set; } } } \ No newline at end of file diff --git a/Meade.net/SetupDialogForm.cs b/Meade.net/SetupDialogForm.cs index cee869f..f06d4bc 100644 --- a/Meade.net/SetupDialogForm.cs +++ b/Meade.net/SetupDialogForm.cs @@ -232,6 +232,15 @@ namespace ASCOM.Meade.net txtApertureDiameter.Text = "203"; } + try + { + txtTimeout.Text = profileProperties.TimeoutMs.ToString(CultureInfo.CurrentCulture); + } + catch (Exception) + { + txtTimeout.Text = "5000"; + } + UpdateParkedItemsEnabled(); } @@ -241,6 +250,7 @@ namespace ASCOM.Meade.net { TraceLogger = chkTrace.Checked, ComPort = comboBoxComPort.SelectedItem.ToString(), + TimeoutMs = Convert.ToInt32(txtTimeout.Text), RtsDtrEnabled = cbxRtsDtr.Checked, DataBits = Convert.ToInt32(numDatabits.Value), StopBits = cboStopBits.SelectedItem.ToString(), diff --git a/Meade.net/SetupDialogForm.designer.cs b/Meade.net/SetupDialogForm.designer.cs index b41ea01..8cb72ce 100644 --- a/Meade.net/SetupDialogForm.designer.cs +++ b/Meade.net/SetupDialogForm.designer.cs @@ -92,6 +92,9 @@ namespace ASCOM.Meade.net this.txtApertureArea = new System.Windows.Forms.TextBox(); this.label30 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); + this.txtTimeout = new System.Windows.Forms.TextBox(); + this.label31 = new System.Windows.Forms.Label(); + this.label32 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numDatabits)).BeginInit(); @@ -453,10 +456,28 @@ namespace ASCOM.Meade.net this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // + // txtTimeout + // + resources.ApplyResources(this.txtTimeout, "txtTimeout"); + this.txtTimeout.Name = "txtTimeout"; + // + // label31 + // + resources.ApplyResources(this.label31, "label31"); + this.label31.Name = "label31"; + // + // label32 + // + resources.ApplyResources(this.label32, "label32"); + this.label32.Name = "label32"; + // // SetupDialogForm // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label32); + this.Controls.Add(this.label31); + this.Controls.Add(this.txtTimeout); this.Controls.Add(this.button1); this.Controls.Add(this.label29); this.Controls.Add(this.txtApertureArea); @@ -591,5 +612,8 @@ namespace ASCOM.Meade.net private TextBox txtApertureArea; private Label label30; private Button button1; + private TextBox txtTimeout; + private Label label31; + private Label label32; } } \ No newline at end of file diff --git a/Meade.net/SetupDialogForm.resx b/Meade.net/SetupDialogForm.resx index d432837..7de4d69 100644 --- a/Meade.net/SetupDialogForm.resx +++ b/Meade.net/SetupDialogForm.resx @@ -123,10 +123,13 @@ - 765, 391 + 1148, 602 + + + 4, 5, 4, 5 - 59, 24 + 88, 37 @@ -145,16 +148,19 @@ $this - 57 + 60 Bottom, Right - 765, 421 + 1148, 648 + + + 4, 5, 4, 5 - 59, 25 + 88, 38 1 @@ -172,13 +178,16 @@ $this - 56 + 59 - 12, 9 + 18, 14 + + + 4, 0, 4, 0 - 274, 31 + 411, 48 2 @@ -196,13 +205,16 @@ $this - 55 + 58 Top, Right - 776, 9 + 1164, 14 + + + 4, 5, 4, 5 48, 56 @@ -223,16 +235,19 @@ $this - 54 + 57 True - 12, 90 + 18, 138 + + + 4, 0, 4, 0 - 58, 13 + 88, 20 5 @@ -250,16 +265,19 @@ $this - 53 + 56 True - 97, 380 + 146, 585 + + + 4, 5, 4, 5 - 90, 17 + 128, 24 2 @@ -277,13 +295,16 @@ $this - 52 + 55 - 97, 87 + 146, 134 + + + 4, 5, 4, 5 - 90, 21 + 133, 28 0 @@ -298,16 +319,19 @@ $this - 51 + 54 True - 290, 262 + 435, 403 + + + 4, 0, 4, 0 - 61, 13 + 91, 20 8 @@ -325,16 +349,16 @@ $this - 50 + 53 - - 17, 17 - - 388, 259 + 582, 398 + + + 4, 5, 4, 5 - 46, 20 + 67, 26 3 @@ -342,6 +366,9 @@ 10.0 + + 17, 17 + LX-200GPS only @@ -355,16 +382,19 @@ $this - 49 + 52 True - 440, 262 + 660, 403 + + + 4, 0, 4, 0 - 122, 13 + 180, 20 10 @@ -382,16 +412,19 @@ $this - 48 + 51 True - 440, 275 + 660, 423 + + + 4, 0, 4, 0 - 105, 13 + 160, 20 11 @@ -409,16 +442,19 @@ $this - 47 + 50 True - 290, 294 + 435, 452 + + + 4, 0, 4, 0 - 50, 13 + 73, 20 12 @@ -436,7 +472,7 @@ $this - 46 + 49 Unchanged @@ -448,10 +484,13 @@ High - 388, 291 + 582, 448 + + + 4, 5, 4, 5 - 90, 21 + 133, 28 4 @@ -466,7 +505,7 @@ $this - 45 + 48 True @@ -475,10 +514,13 @@ NoControl - 290, 321 + 435, 494 + + + 4, 0, 4, 0 - 67, 13 + 100, 20 14 @@ -496,7 +538,7 @@ $this - 44 + 47 Auto @@ -508,10 +550,13 @@ Pulse guiding - 388, 318 + 582, 489 + + + 4, 5, 4, 5 - 90, 21 + 133, 28 5 @@ -526,7 +571,7 @@ $this - 43 + 46 True @@ -535,10 +580,13 @@ Microsoft Sans Serif, 8.25pt, style=Bold - 290, 67 + 435, 103 + + + 4, 0, 4, 0 - 66, 13 + 95, 20 16 @@ -556,7 +604,7 @@ $this - 42 + 45 True @@ -568,10 +616,13 @@ NoControl - 290, 359 + 435, 552 + + + 4, 0, 4, 0 - 52, 13 + 77, 20 17 @@ -589,13 +640,16 @@ $this - 41 + 44 - 388, 377 + 582, 580 + + + 4, 5, 4, 5 - 46, 20 + 67, 26 6 @@ -613,7 +667,7 @@ $this - 39 + 42 True @@ -622,10 +676,13 @@ NoControl - 290, 380 + 435, 585 + + + 4, 0, 4, 0 - 79, 13 + 117, 20 18 @@ -643,7 +700,7 @@ $this - 40 + 43 True @@ -652,10 +709,13 @@ NoControl - 440, 380 + 660, 585 + + + 4, 0, 4, 0 - 20, 13 + 30, 20 20 @@ -673,7 +733,7 @@ $this - 38 + 41 True @@ -685,10 +745,13 @@ NoControl - 12, 67 + 18, 103 + + + 4, 0, 4, 0 - 71, 13 + 103, 20 21 @@ -706,16 +769,19 @@ $this - 37 + 40 True - 388, 403 + 582, 620 + + + 4, 5, 4, 5 - 109, 17 + 158, 24 7 @@ -733,16 +799,19 @@ $this - 36 + 39 True - 388, 426 + 582, 655 + + + 4, 5, 4, 5 - 112, 17 + 163, 24 8 @@ -760,7 +829,7 @@ $this - 35 + 38 True @@ -769,10 +838,13 @@ NoControl - 97, 114 + 146, 175 + + + 4, 5, 4, 5 - 112, 17 + 158, 24 1 @@ -793,11 +865,8 @@ $this - 34 + 37 - - 17, 17 - True @@ -805,10 +874,13 @@ NoControl - 671, 96 + 1006, 148 + + + 4, 5, 4, 5 - 145, 17 + 215, 24 41 @@ -829,16 +901,19 @@ $this - 16 + 19 True - 290, 189 + 435, 291 + + + 4, 0, 4, 0 - 72, 13 + 106, 20 22 @@ -856,13 +931,16 @@ $this - 33 + 36 - 388, 186 + 582, 286 + + + 4, 5, 4, 5 - 100, 20 + 148, 26 23 @@ -877,16 +955,19 @@ $this - 32 + 35 True - 494, 189 + 741, 291 + + + 4, 0, 4, 0 - 38, 13 + 58, 20 24 @@ -904,16 +985,19 @@ $this - 31 + 34 True - 290, 220 + 435, 338 + + + 4, 0, 4, 0 - 56, 13 + 85, 20 25 @@ -931,13 +1015,16 @@ $this - 30 + 33 - 388, 218 + 582, 335 + + + 4, 5, 4, 5 - 120, 20 + 180, 26 26 @@ -952,16 +1039,19 @@ $this - 29 + 32 True - 514, 220 + 771, 338 + + + 4, 0, 4, 0 - 47, 13 + 69, 20 27 @@ -979,16 +1069,19 @@ $this - 28 + 31 True - 15, 139 + 22, 214 + + + 4, 0, 4, 0 - 49, 13 + 73, 20 29 @@ -1006,13 +1099,16 @@ $this - 27 + 30 - 97, 163 + 146, 251 + + + 4, 5, 4, 5 - 119, 21 + 176, 28 30 @@ -1027,13 +1123,16 @@ $this - 26 + 29 - 97, 137 + 146, 211 + + + 4, 5, 4, 5 - 120, 20 + 180, 26 31 @@ -1048,13 +1147,16 @@ $this - 25 + 28 - 97, 190 + 146, 292 + + + 4, 5, 4, 5 - 119, 21 + 176, 28 32 @@ -1069,13 +1171,16 @@ $this - 24 + 27 - 97, 217 + 146, 334 + + + 4, 5, 4, 5 - 119, 21 + 176, 28 33 @@ -1090,13 +1195,16 @@ $this - 23 + 26 - 97, 244 + 146, 375 + + + 4, 5, 4, 5 - 121, 21 + 180, 28 34 @@ -1111,16 +1219,19 @@ $this - 22 + 25 True - 15, 166 + 22, 255 + + + 4, 0, 4, 0 - 49, 13 + 74, 20 35 @@ -1138,16 +1249,19 @@ $this - 21 + 24 True - 15, 193 + 22, 297 + + + 4, 0, 4, 0 - 33, 13 + 48, 20 36 @@ -1165,16 +1279,19 @@ $this - 20 + 23 True - 15, 220 + 22, 338 + + + 4, 0, 4, 0 - 38, 13 + 56, 20 37 @@ -1192,16 +1309,19 @@ $this - 19 + 22 True - 15, 247 + 22, 380 + + + 4, 0, 4, 0 - 62, 13 + 91, 20 38 @@ -1219,7 +1339,7 @@ $this - 18 + 21 True @@ -1231,10 +1351,13 @@ NoControl - 15, 359 + 22, 552 + + + 4, 0, 4, 0 - 73, 13 + 109, 20 39 @@ -1252,7 +1375,7 @@ $this - 17 + 20 No Coordinates @@ -1264,10 +1387,13 @@ Report coordinates as - 671, 124 + 1006, 191 + + + 4, 5, 4, 5 - 126, 21 + 187, 28 42 @@ -1282,16 +1408,19 @@ $this - 15 + 18 True - 574, 127 + 861, 195 + + + 4, 0, 4, 0 - 91, 13 + 132, 20 43 @@ -1309,16 +1438,19 @@ $this - 14 + 17 True - 668, 154 + 1002, 237 + + + 4, 0, 4, 0 - 19, 13 + 28, 20 44 @@ -1336,16 +1468,19 @@ $this - 13 + 16 True - 668, 180 + 1002, 277 + + + 4, 0, 4, 0 - 19, 13 + 28, 20 45 @@ -1363,13 +1498,16 @@ $this - 12 + 15 - 697, 151 + 1046, 232 + + + 4, 5, 4, 5 - 100, 20 + 148, 26 46 @@ -1384,13 +1522,16 @@ $this - 11 + 14 - 697, 177 + 1046, 272 + + + 4, 5, 4, 5 - 100, 20 + 148, 26 47 @@ -1405,7 +1546,7 @@ $this - 10 + 13 True @@ -1414,10 +1555,13 @@ NoControl - 290, 90 + 435, 138 + + + 4, 0, 4, 0 - 69, 13 + 102, 20 48 @@ -1435,13 +1579,16 @@ $this - 9 + 12 - 388, 87 + 582, 134 + + + 4, 5, 4, 5 - 100, 20 + 148, 26 49 @@ -1456,7 +1603,7 @@ $this - 8 + 11 True @@ -1465,10 +1612,13 @@ NoControl - 494, 90 + 741, 138 + + + 4, 0, 4, 0 - 23, 13 + 35, 20 50 @@ -1486,7 +1636,7 @@ $this - 7 + 10 True @@ -1495,10 +1645,13 @@ NoControl - 494, 114 + 741, 175 + + + 4, 0, 4, 0 - 23, 13 + 35, 20 53 @@ -1516,13 +1669,16 @@ $this - 4 + 7 - 388, 111 + 582, 171 + + + 4, 5, 4, 5 - 100, 20 + 148, 26 52 @@ -1537,7 +1693,7 @@ $this - 5 + 8 True @@ -1546,10 +1702,13 @@ NoControl - 290, 114 + 435, 175 + + + 4, 0, 4, 0 - 92, 13 + 140, 20 51 @@ -1567,7 +1726,7 @@ $this - 6 + 9 True @@ -1576,10 +1735,13 @@ NoControl - 494, 139 + 741, 214 + + + 4, 0, 4, 0 - 26, 13 + 40, 20 56 @@ -1597,13 +1759,16 @@ $this - 1 + 4 - 388, 136 + 582, 209 + + + 4, 5, 4, 5 - 100, 20 + 148, 26 55 @@ -1618,7 +1783,7 @@ $this - 2 + 5 True @@ -1627,10 +1792,13 @@ NoControl - 290, 139 + 435, 214 + + + 4, 0, 4, 0 - 72, 13 + 109, 20 54 @@ -1648,13 +1816,16 @@ $this - 3 + 6 - 112, 399 + 168, 614 + + + 4, 5, 4, 5 - 75, 23 + 112, 35 57 @@ -1672,6 +1843,96 @@ $this + 3 + + + 146, 423 + + + 4, 5, 4, 5 + + + 148, 26 + + + 35 + + + txtTimeout + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + True + + + NoControl + + + 22, 423 + + + 4, 0, 4, 0 + + + 110, 20 + + + 58 + + + Serial Timeout + + + label31 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + + NoControl + + + 302, 426 + + + 4, 0, 4, 0 + + + 30, 20 + + + 59 + + + ms + + + label32 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 @@ -1681,10 +1942,13 @@ 232 - 6, 13 + 9, 20 - 834, 454 + 1251, 698 + + + 4, 5, 4, 5 CenterScreen diff --git a/Meade.net/SharedResources.cs b/Meade.net/SharedResources.cs index 38467a9..6a403e1 100644 --- a/Meade.net/SharedResources.cs +++ b/Meade.net/SharedResources.cs @@ -189,6 +189,7 @@ namespace ASCOM.Meade.net // Constants used for Profile persistence private const string ComPortProfileName = "COM Port"; + private const string TimeoutMsName = "Serial Timeout (MS)"; private const string RtsDtrProfileName = "Rts / Dtr"; private const string TraceStateProfileName = "Trace Level"; private const string GuideRateProfileName = "Guide Rate Arc Seconds Per Second"; @@ -222,6 +223,7 @@ namespace ASCOM.Meade.net driverProfile.DeviceType = "Telescope"; driverProfile.WriteValue(DriverId, TraceStateProfileName, profileProperties.TraceLogger.ToString()); driverProfile.WriteValue(DriverId, ComPortProfileName, profileProperties.ComPort); + driverProfile.WriteValue(DriverId, TimeoutMsName, profileProperties.TimeoutMs.ToString()); driverProfile.WriteValue(DriverId, RtsDtrProfileName, profileProperties.RtsDtrEnabled.ToString()); driverProfile.WriteValue(DriverId, SpeedName, profileProperties.Speed.ToString(CultureInfo.InvariantCulture)); driverProfile.WriteValue(DriverId, DataBitsName, profileProperties.DataBits.ToString(CultureInfo.InvariantCulture)); @@ -248,6 +250,7 @@ namespace ASCOM.Meade.net } private const string ComPortDefault = "COM1"; + private const string TimeoutMsDefault = "5000"; private const string RtsDtrDefault = "false"; private const string TraceStateDefault = "false"; private const string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate @@ -280,6 +283,7 @@ namespace ASCOM.Meade.net { driverProfile.DeviceType = "Telescope"; profileProperties.ComPort = driverProfile.GetValue(DriverId, ComPortProfileName, string.Empty, ComPortDefault); + profileProperties.TimeoutMs = Convert.ToInt32(driverProfile.GetValue(DriverId, TimeoutMsName, string.Empty, TimeoutMsDefault)); profileProperties.RtsDtrEnabled = Convert.ToBoolean(driverProfile.GetValue(DriverId, RtsDtrProfileName, string.Empty, RtsDtrDefault)); profileProperties.TraceLogger = Convert.ToBoolean(driverProfile.GetValue(DriverId, TraceStateProfileName, string.Empty, TraceStateDefault)); profileProperties.GuideRateArcSecondsPerSecond = double.Parse(driverProfile.GetValue(DriverId, GuideRateProfileName, string.Empty, GuideRateProfileNameDefault), NumberFormatInfo.InvariantInfo); @@ -401,7 +405,7 @@ namespace ASCOM.Meade.net SharedSerial.StopBits = (SerialStopBits)Enum.Parse(typeof(SerialStopBits), profileProperties.StopBits); SharedSerial.Parity = (SerialParity)Enum.Parse(typeof(SerialParity), profileProperties.Parity); SharedSerial.Handshake = (SerialHandshake)Enum.Parse(typeof(SerialHandshake), profileProperties.Handshake); - SharedSerial.ReceiveTimeout = 30; //30 second timeout; + SharedSerial.ReceiveTimeoutMs = profileProperties.TimeoutMs; SharedSerial.Speed = SerialSpeed.ps9600; var wantedSpeed = (SerialSpeed)profileProperties.Speed;