Example #1
0
            /// <summary>
            /// Select an ASCOM driver
            /// </summary>
            /// <param name="sender">sender of the event</param>
            /// <param name="e">arguments associated with the event</param>
            private void btnSelectDriver_Click(object sender, EventArgs e)
            {
                try
                {
                    string ProgId = Telescope.Choose("");
                    if (ProgId != "")
                    {
                        if (iDriver != null)
                        {
                            iDriver.Dispose();
                        }

                        iDriver          = new AscomDriver(ProgId);
                        iServer.Driver   = iDriver;
                        btnSetup.Enabled = true;

                        txtSelectedDriver.Text = iDriver.Name;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
Example #2
0
            /// <summary>
            /// Select an ASCOM driver
            /// </summary>
            /// <param name="sender">sender of the event</param>
            /// <param name="e">arguments associated with the event</param>
            private void btnSelectDriver_Click(object sender, EventArgs e)
            {
                try
                {
                    string ProgId = Telescope.Choose("");
                    if (ProgId != "")
                    {
                        if (iDriver != null)
                        {
                            iDriver.Dispose();
                        }

                        iDriver = new AscomDriver(ProgId);
                        iServer.Driver = iDriver;
                        btnSetup.Enabled = true;

                        txtSelectedDriver.Text = iDriver.Name;
                    }
                }
                catch(Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
Example #3
0
        protected void SetIsolatedDevice(AscomDriver device, string progId)
        {
            m_Device = device;
            ProgId = progId;
            UniqueId = Guid.NewGuid();

            Trace.WriteLine(string.Format("OccuRec: ASCOMServer::new('{0}'). InterfaceVersion={1}", progId, m_Device.InterfaceVersion));

            if (m_Device.Connected)
                // If we are instantiating a connected device, we disconnect first (make this optional?)
                m_Device.Connected = false;
        }