diff --git a/Meade.net/ProfileProperties.cs b/Meade.net/ProfileProperties.cs index fe57a13..520b05f 100644 --- a/Meade.net/ProfileProperties.cs +++ b/Meade.net/ProfileProperties.cs @@ -11,5 +11,6 @@ namespace ASCOM.Meade.net public int BacklashCompensation { get; set; } public bool ReverseFocusDirection { get; set; } public bool DynamicBreaking { get; set; } + public bool RtsDtrEnabled { get; set; } } } \ No newline at end of file diff --git a/Meade.net/SetupDialogForm.cs b/Meade.net/SetupDialogForm.cs index fa705c2..1f4f699 100644 --- a/Meade.net/SetupDialogForm.cs +++ b/Meade.net/SetupDialogForm.cs @@ -62,6 +62,8 @@ namespace ASCOM.Meade.net comboBoxComPort.SelectedItem = profileProperties.ComPort; } + cbxRtsDtr.Checked = profileProperties.RtsDtrEnabled; + txtGuideRate.Text = profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.CurrentCulture); try { @@ -93,13 +95,14 @@ namespace ASCOM.Meade.net { TraceLogger = chkTrace.Checked, ComPort = comboBoxComPort.SelectedItem.ToString(), + RtsDtrEnabled = cbxRtsDtr.Checked, GuideRateArcSecondsPerSecond = double.Parse(txtGuideRate.Text.Trim()), Precision = cboPrecision.SelectedItem.ToString(), GuidingStyle = cboGuidingStyle.SelectedItem.ToString(), BacklashCompensation = int.Parse(txtBacklashSteps.Text), ReverseFocusDirection = cbxReverseDirection.Checked, DynamicBreaking = cbxDynamicBreaking.Checked - }; + }; return profileProperties; } diff --git a/Meade.net/SetupDialogForm.designer.cs b/Meade.net/SetupDialogForm.designer.cs index b4c618a..c970e28 100644 --- a/Meade.net/SetupDialogForm.designer.cs +++ b/Meade.net/SetupDialogForm.designer.cs @@ -31,6 +31,7 @@ namespace ASCOM.Meade.net /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetupDialogForm)); this.cmdOK = new System.Windows.Forms.Button(); this.cmdCancel = new System.Windows.Forms.Button(); @@ -55,6 +56,8 @@ namespace ASCOM.Meade.net this.label11 = new System.Windows.Forms.Label(); this.cbxReverseDirection = new System.Windows.Forms.CheckBox(); this.cbxDynamicBreaking = new System.Windows.Forms.CheckBox(); + this.cbxRtsDtr = new System.Windows.Forms.CheckBox(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); ((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit(); this.SuspendLayout(); // @@ -201,10 +204,18 @@ namespace ASCOM.Meade.net this.cbxDynamicBreaking.Name = "cbxDynamicBreaking"; this.cbxDynamicBreaking.UseVisualStyleBackColor = true; // + // cbxRtsDtr + // + resources.ApplyResources(this.cbxRtsDtr, "cbxRtsDtr"); + this.cbxRtsDtr.Name = "cbxRtsDtr"; + this.toolTip1.SetToolTip(this.cbxRtsDtr, resources.GetString("cbxRtsDtr.ToolTip")); + this.cbxRtsDtr.UseVisualStyleBackColor = true; + // // SetupDialogForm // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.cbxRtsDtr); this.Controls.Add(this.cbxDynamicBreaking); this.Controls.Add(this.cbxReverseDirection); this.Controls.Add(this.label11); @@ -266,5 +277,7 @@ namespace ASCOM.Meade.net private Label label11; private CheckBox cbxReverseDirection; private CheckBox cbxDynamicBreaking; + private CheckBox cbxRtsDtr; + private ToolTip toolTip1; } } \ No newline at end of file diff --git a/Meade.net/SetupDialogForm.resx b/Meade.net/SetupDialogForm.resx index 3366ceb..ca12791 100644 --- a/Meade.net/SetupDialogForm.resx +++ b/Meade.net/SetupDialogForm.resx @@ -145,7 +145,7 @@ $this - 22 + 23 Bottom, Right @@ -172,7 +172,7 @@ $this - 21 + 22 12, 9 @@ -196,7 +196,7 @@ $this - 20 + 21 Top, Right @@ -223,7 +223,7 @@ $this - 19 + 20 True @@ -250,19 +250,19 @@ $this - 18 + 19 True - 97, 114 + 97, 137 69, 17 - 6 + 2 Trace on @@ -277,7 +277,7 @@ $this - 17 + 18 97, 87 @@ -286,7 +286,7 @@ 90, 21 - 7 + 0 comboBoxComPort @@ -298,7 +298,7 @@ $this - 16 + 17 True @@ -325,7 +325,7 @@ $this - 15 + 16 97, 199 @@ -334,7 +334,7 @@ 46, 20 - 9 + 3 10.0 @@ -349,7 +349,7 @@ $this - 14 + 15 True @@ -376,7 +376,7 @@ $this - 13 + 14 True @@ -403,7 +403,7 @@ $this - 12 + 13 True @@ -430,7 +430,7 @@ $this - 11 + 12 Unchanged @@ -448,7 +448,7 @@ 90, 21 - 13 + 4 cboPrecision @@ -460,7 +460,7 @@ $this - 10 + 11 True @@ -490,7 +490,7 @@ $this - 9 + 10 Auto @@ -508,7 +508,7 @@ 90, 21 - 15 + 5 cboGuidingStyle @@ -520,7 +520,7 @@ $this - 8 + 9 True @@ -550,7 +550,7 @@ $this - 7 + 8 True @@ -583,7 +583,7 @@ $this - 6 + 7 97, 335 @@ -592,7 +592,7 @@ 46, 20 - 19 + 6 3000 @@ -607,7 +607,7 @@ $this - 4 + 5 True @@ -637,7 +637,7 @@ $this - 5 + 6 True @@ -667,7 +667,7 @@ $this - 3 + 4 True @@ -700,7 +700,7 @@ $this - 2 + 3 True @@ -712,7 +712,7 @@ 109, 17 - 22 + 7 Reverse direction @@ -727,7 +727,7 @@ $this - 1 + 2 True @@ -739,7 +739,7 @@ 112, 17 - 23 + 8 Dynamic Breaking @@ -754,6 +754,42 @@ $this + 1 + + + True + + + NoControl + + + 97, 114 + + + 112, 17 + + + 1 + + + Enable RTS/DTR + + + 17, 17 + + + Useful for Meade LS scopes + + + cbxRtsDtr + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 @@ -771,6 +807,12 @@ Meade.net Setup + + toolTip1 + + + System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + SetupDialogForm diff --git a/Meade.net/SharedResources.cs b/Meade.net/SharedResources.cs index b7b5e4a..df7fcae 100644 --- a/Meade.net/SharedResources.cs +++ b/Meade.net/SharedResources.cs @@ -137,6 +137,7 @@ namespace ASCOM.Meade.net // Constants used for Profile persistence private const string ComPortProfileName = "COM Port"; + private const string RtsDtrProfileName = "Rts / Dtr"; private const string TraceStateProfileName = "Trace Level"; private const string GuideRateProfileName = "Guide Rate Arc Seconds Per Second"; private const string PrecisionProfileName = "Precision"; @@ -154,6 +155,7 @@ namespace ASCOM.Meade.net driverProfile.DeviceType = "Telescope"; driverProfile.WriteValue(DriverId, TraceStateProfileName, profileProperties.TraceLogger.ToString()); driverProfile.WriteValue(DriverId, ComPortProfileName, profileProperties.ComPort); + driverProfile.WriteValue(DriverId, RtsDtrProfileName, profileProperties.RtsDtrEnabled.ToString()); driverProfile.WriteValue(DriverId, GuideRateProfileName, profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.InvariantCulture)); driverProfile.WriteValue(DriverId, PrecisionProfileName, profileProperties.Precision); driverProfile.WriteValue(DriverId, GuidingStyleProfileName, profileProperties.GuidingStyle); @@ -165,6 +167,7 @@ namespace ASCOM.Meade.net } private const string ComPortDefault = "COM1"; + private const string RtsDtrDefault = "false"; private const string TraceStateDefault = "false"; private const string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate private const string PrecisionDefault = "Unchanged"; @@ -182,6 +185,7 @@ namespace ASCOM.Meade.net { driverProfile.DeviceType = "Telescope"; profileProperties.ComPort = driverProfile.GetValue(DriverId, ComPortProfileName, string.Empty, ComPortDefault); + 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); profileProperties.Precision = driverProfile.GetValue(DriverId, PrecisionProfileName, string.Empty, PrecisionDefault); @@ -272,8 +276,8 @@ namespace ASCOM.Meade.net { var profileProperties = ReadProfile(); SharedSerial.PortName = profileProperties.ComPort; - SharedSerial.DTREnable = false; - SharedSerial.RTSEnable = false; + SharedSerial.DTREnable = profileProperties.RtsDtrEnabled; + SharedSerial.RTSEnable = profileProperties.RtsDtrEnabled; SharedSerial.DataBits = 8; SharedSerial.StopBits = SerialStopBits.One; SharedSerial.Parity = SerialParity.None;