79a77d4e1d
Feature/LocalServer * Major refactor. Switching over to a local server hub style driver allowing multiple programs to control the telescope at one time without the need for the POTH Hub * Unified the setup dialog * Implemented shared serial port, Both Telescope and Driver can connect at the same time. * Ported the focuser implementation from the non server based version. * Ported the telescope driver code. * Fixed problem with # not being stripped from the returned string ends. Fixed issue with RA being returned as degress rather than hours. * Telescope passes validation * Added a lock around the focuser move. * Reimplemented CommandBlind and CommandString * Corrected version information * Removed the Altitude support as there's a bug in the Autostar and Audiostar firmware
67 lines
2.1 KiB
C#
67 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using ASCOM.Utilities;
|
|
using ASCOM.Meade.net;
|
|
|
|
namespace ASCOM.Meade.net
|
|
{
|
|
[ComVisible(false)] // Form not registered for COM!
|
|
public partial class SetupDialogForm : Form
|
|
{
|
|
public SetupDialogForm()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void cmdCancel_Click(object sender, EventArgs e) // Cancel button event handler
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void BrowseToAscom(object sender, EventArgs e) // Click on ASCOM logo event handler
|
|
{
|
|
try
|
|
{
|
|
System.Diagnostics.Process.Start("http://ascom-standards.org/");
|
|
}
|
|
catch (System.ComponentModel.Win32Exception noBrowser)
|
|
{
|
|
if (noBrowser.ErrorCode == -2147467259)
|
|
MessageBox.Show(noBrowser.Message);
|
|
}
|
|
catch (System.Exception other)
|
|
{
|
|
MessageBox.Show(other.Message);
|
|
}
|
|
}
|
|
|
|
public void SetProfile(ProfileProperties profileProperties)
|
|
{
|
|
chkTrace.Checked = profileProperties.TraceLogger;
|
|
// set the list of com ports to those that are currently available
|
|
comboBoxComPort.Items.Clear();
|
|
comboBoxComPort.Items.AddRange(System.IO.Ports.SerialPort.GetPortNames()); // use System.IO because it's static
|
|
// select the current port if possible
|
|
if (comboBoxComPort.Items.Contains(profileProperties.ComPort))
|
|
{
|
|
comboBoxComPort.SelectedItem = profileProperties.ComPort;
|
|
}
|
|
}
|
|
|
|
public ProfileProperties GetProfile()
|
|
{
|
|
var profileProperties = new ProfileProperties
|
|
{
|
|
TraceLogger = chkTrace.Checked,
|
|
ComPort = comboBoxComPort.SelectedItem.ToString()
|
|
};
|
|
|
|
return profileProperties;
|
|
}
|
|
}
|
|
} |