Ejemplo n.º 1
0
        private void AutoGuideOnButton_Click(object sender, EventArgs e)
        {
            //Execute TSX_AutoGuide class
            //  Open and connect to autoguider
            //  if (not calibrated,) { abort
            //  Find guidestar
            //  Turn on Autoguide
            SessionControl openSession = new SessionControl();
            TargetPlan     tPlan       = new TargetPlan(openSession.CurrentTargetName);

            if (NHUtil.IsButtonRed(AutoGuideOnButton))
            {
                AutoGuide.AutoGuideStop();
                AutoGuideOnButton.Text = "Start\r\nAutoguiding";
                NHUtil.ButtonGreen(AutoGuideOnButton);
            }
            else
            {
                //First, save the guider cycle time and anything else in the future that might be hanging around
                tPlan.GuiderCycleTime = (double)GuiderCycleTimeNum.Value;
                if (tPlan.DitherEnabled)
                {
                    AutoGuide.DitherAndStart();
                }
                else
                {
                    AutoGuide.AutoGuideStart();
                }
                AutoGuideOnButton.Text = "Stop\r\nAutoguiding";
                NHUtil.ButtonRed(AutoGuideOnButton);
            }
        }