@@ -686,19 +686,26 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
default:
|
||||
{
|
||||
var i = 10;
|
||||
while (i > 0)
|
||||
try
|
||||
{
|
||||
var displayText = Action("Handbox", "readdisplay");
|
||||
if (displayText.Contains("Align:"))
|
||||
var i = 10;
|
||||
while (i > 0)
|
||||
{
|
||||
i = 0;
|
||||
continue;
|
||||
}
|
||||
var displayText = Action("Handbox", "readdisplay");
|
||||
if (displayText.Contains("Align:"))
|
||||
{
|
||||
i = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
Action("Handbox", "mode");
|
||||
_utilities.WaitForMilliseconds(500);
|
||||
i--;
|
||||
Action("Handbox", "mode");
|
||||
_utilities.WaitForMilliseconds(500);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
catch (TimeoutException e)
|
||||
{
|
||||
LogMessage("ApplySkipAutoStarPrompts","Timed out bypassing the date time prompts. Skipping.");
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -4043,7 +4050,9 @@ namespace ASCOM.Meade.net
|
||||
/// This technique should mean that it is never necessary to manually register a driver with ASCOM.
|
||||
/// </remarks>
|
||||
[ComRegisterFunction]
|
||||
#pragma warning disable IDE0060 // Remove unused parameter
|
||||
public static void RegisterAscom(Type t)
|
||||
#pragma warning restore IDE0060 // Remove unused parameter
|
||||
{
|
||||
RegUnregAscom(true);
|
||||
}
|
||||
@@ -4066,7 +4075,9 @@ namespace ASCOM.Meade.net
|
||||
/// This technique should mean that it is never necessary to manually unregister a driver from ASCOM.
|
||||
/// </remarks>
|
||||
[ComUnregisterFunction]
|
||||
#pragma warning disable IDE0060 // Remove unused parameter
|
||||
public static void UnregisterAscom(Type t)
|
||||
#pragma warning restore IDE0060 // Remove unused parameter
|
||||
{
|
||||
RegUnregAscom(false);
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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(),
|
||||
|
||||
Generated
+24
@@ -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;
|
||||
}
|
||||
}
|
||||
+444
-180
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
//
|
||||
// NOTES:
|
||||
//
|
||||
// * ALL DECLARATIONS MUST BE STATIC HERE!! INSTANCES OF THIS CLASS MUST NEVER BE CREATED!
|
||||
// * ALL DECLARATIONS MUST BE STATIC HERE!! INSTANCES OF THIS CLASS MUST NEVER BE CREATEDReceiveTimeout
|
||||
//
|
||||
// Written by: Bob Denny 29-May-2007
|
||||
// Modified by Chris Rowland and Peter Simpson to hamdle multiple hardware devices March 2011
|
||||
@@ -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 = 5; //5 second timeout;
|
||||
SharedSerial.ReceiveTimeoutMs = profileProperties.TimeoutMs;
|
||||
SharedSerial.Speed = SerialSpeed.ps9600;
|
||||
|
||||
var wantedSpeed = (SerialSpeed)profileProperties.Speed;
|
||||
|
||||
Reference in New Issue
Block a user