Exemple #1
0
        public void UnPark()
        {
            //Log enter
            Logging.AddLog(MethodBase.GetCurrentMethod().Name + " enter", LogLevel.Trace);


            //if device present at all and its ID is set
            if (Enabled && DRIVER_NAME != "" && objTelescope != null)
            {
                try
                {
                    objTelescope.Unpark();
                }
                catch (Exception ex)
                {
                    Logging.AddLog("Couldn't move to UnPark status", LogLevel.Important, Highlight.Error);
                    Logging.AddLog(MethodBase.GetCurrentMethod().Name + " error! [" + ex.ToString() + "]", LogLevel.Debug, Highlight.Error);
                }
            }
            else
            {
                //Print if somebody try to connect if device isn't presetn. Mostly for debug
                Logging.AddLog("Telescope is not set. Couldn't set UnPark status", LogLevel.Debug, Highlight.Error);
            }

            Logging.AddLog(System.Reflection.MethodBase.GetCurrentMethod().Name + ": " + "void", LogLevel.Trace);
        }
        static void Main(string[] args)
        {
            // Uncomment the code that's required
#if UseChooser
            // choose the device
            string id = ASCOM.DriverAccess.Telescope.Choose("");
            if (string.IsNullOrEmpty(id))
            {
                return;
            }
            // create this device
            ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope(id);
#else
            // this can be replaced by this code, it avoids the chooser and creates the driver class directly.
            ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope("ASCOM.PushToGo.Telescope");
#endif
            // 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.Connected = true;

            Console.WriteLine("CurrentPos: " + device.RightAscension + " " + device.Declination);
            Console.WriteLine("CurrentAltAzPos: " + device.Altitude + " " + device.Azimuth);

            Console.WriteLine("PierSide: " + device.SideOfPier.ToString());

            if (device.AtPark)
            {
                device.Unpark();
            }

            device.Tracking = true;

            Console.WriteLine("Test slewing");
            device.SlewToAltAz(15, 50);

            Console.WriteLine("CurrentAltAzPos: " + device.Altitude + " " + device.Azimuth);

            device.GuideRateDeclination = 0.00208903731;

            Console.WriteLine("GuideRate: >" + device.CommandString("speed guide", false) + "<");
            Console.WriteLine("GuideRate: >" + device.CommandString("speed guide", false) + "<");
            Console.WriteLine("GuideRate: >" + device.CommandString("speed guide", false) + "<");
            Console.WriteLine("GuideRate: >" + device.CommandString("speed guide", false) + "<");
            Console.WriteLine("GuideRate: " + device.GuideRateDeclination);

            //Thread.Sleep(500);
            //device.SetupDialog(); // show setup

            //Console.WriteLine("Test homing");
            //device.Park();

            device.Connected = false;
            Console.WriteLine("Press Enter to finish");
            Console.ReadLine();
        }
Exemple #3
0
 public void Unpark()
 {
     CheckConnected();
     if (Platform.IsTracking)
     {
         throw new InvalidOperationException("cannot Unpark when platform is tracking");
     }
     m_mount.Unpark();
 }
        private void unparkBtn_Click(object sender, EventArgs e)
        {
            try
            {
                driver.Unpark();
                parkBtn.Enabled       = true;
                unparkBtn.Enabled     = false;
                setParkBtn.Enabled    = true;
                startTrackBtn.Enabled = true;

                moveEastButton.Enabled  = true;
                moveWestButton.Enabled  = true;
                moveNorthButton.Enabled = true;
                moveSouthButton.Enabled = true;
                moveStopButton.Enabled  = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }