Esempio n. 1
0
        static void Main(string[] args)
        {
            // Uncomment the code that's required
            string id = string.Empty;

            // choose the device
            using (ASCOM.Utilities.Chooser chooser = new Utilities.Chooser())
            {
                chooser.DeviceType = "Telescope";
                id = chooser.Choose(string.Empty);
            }

            if (string.IsNullOrEmpty(id))
            {
                return;
            }
            // create this device
            ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope(id);

            // now run some tests, adding code to your driver so that the tests will pass.
            // these first tests are common to all drivers.
            Console.WriteLine("name " + device.Name);
            Console.WriteLine("description " + device.Description);
            Console.WriteLine("DriverInfo " + device.DriverInfo);
            Console.WriteLine("driverVersion " + device.DriverVersion);

            device.SetupDialog();
            // TODO add more code to test the driver.
            device.Connected = true;

            device.Connected = false;
            Console.WriteLine("Press Enter to finish");
            Console.ReadLine();
        }
Esempio n. 2
0
        public string ChooseVideo()
        {
            var chooser = new ASCOMUtilities.Chooser();
            chooser.DeviceType = VIDEO_DEVICE_TYPE;
            string progId = chooser.Choose(null);

            return progId;
        }
Esempio n. 3
0
        public string ChooseTelescope()
        {
            var chooser = new ASCOMUtilities.Chooser();
            chooser.DeviceType = TELESCOPE_DEVICE_TYPE;
            string progId = chooser.Choose(null);

            return progId;
        }
Esempio n. 4
0
        public string ChooseFocuser()
        {
            var chooser = new ASCOMUtilities.Chooser();
            chooser.DeviceType = FOCUSER_DEVICE_TYPE;
            string progId = chooser.Choose(null);

            return progId;
        }
Esempio n. 5
0
        public void btnSelectTelescope_Click(object sender, EventArgs e)
        {
            /// This button opens the ASCOM Chooser and allows you to choose a telescope (mount)

            string teleID;
            var    objChooser = new ASCOM.Utilities.Chooser();

            objChooser.DeviceType = "Telescope";
            teleID = objChooser.Choose();
            Properties.Settings.Default.Telescope = teleID;
        }
Esempio n. 6
0
 private void button1_Click(object sender, EventArgs e)
 {
     ASCOM.Utilities.Chooser chooser = new ASCOM.Utilities.Chooser();
     chooser.DeviceType         = "Focuser";
     myFocuser                  = new Focuser(chooser.Choose());
     myFocuser.Connected        = true;
     focuser_choose.BackColor   = Color.GreenYellow;
     focuser_step_value         = myFocuser.Position;
     current_focuser_value.Text = focuser_step_value.ToString();
     focuser_temp_worker.RunWorkerAsync();
     Disconnect_focuser.Enabled = true;
 }
        private void SetupDome_Click(object sender, EventArgs e)
        {
            try {
                ASCOM.Utilities.Chooser Ch = default(ASCOM.Utilities.Chooser);
                string SelectedDevice      = null;

                Ch            = new ASCOM.Utilities.Chooser();
                Ch.DeviceType = "Dome";

                SelectedDevice = Ch.Choose();
                Ch.Dispose();
                Ch = null;
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 8
0
 private void camera_choose_Click(object sender, EventArgs e)
 {
     try
     {
         ASCOM.Utilities.Chooser chooser = new ASCOM.Utilities.Chooser();
         chooser.DeviceType        = "Camera";
         myCamera                  = new Camera(chooser.Choose());
         myCamera.Connected        = true;
         camera_choose.BackColor   = Color.GreenYellow;
         ccd_temp.Text             = myCamera.CCDTemperature.ToString() + "°C";
         myCamera.BinX             = _binx;
         myCamera.BinY             = _biny;
         disconnect_camera.Enabled = true;
         Cooling_assistant.Enabled = true;
         capture.Enabled           = true;
     }
     catch (ASCOM.Utilities.Exceptions.HelperException)
     {
     }
 }
Esempio n. 9
0
        private void filter_wheel_choose_Click(object sender, EventArgs e)
        {
            try
            {
                ASCOM.Utilities.Chooser chooser = new ASCOM.Utilities.Chooser();
                chooser.DeviceType      = "Filterwheel";
                myFilterWheel           = new FilterWheel(chooser.Choose());
                myFilterWheel.Connected = true;
                current_filter          = myFilterWheel.Position;
                current_position.Text   = current_filter.ToString();

                /*camera_choose.BackColor = Color.GreenYellow;
                 * ccd_temp.Text = myCamera.CCDTemperature.ToString() + "°C";
                 * myCamera.BinX = _binx;
                 * myCamera.BinY = _biny;
                 * disconnect_camera.Enabled = true;
                 * Cooling_assistant.Enabled = true;
                 * capture.Enabled = true;*/
            }
            catch (ASCOM.Utilities.Exceptions.HelperException)
            {
            }
        }