Пример #1
0
 private void ConnectButton_Click(object sender, EventArgs e)
 {
     if (NHUtil.IsButtonGreen(ConnectButton))
     {
         NHUtil.ButtonRed(ConnectButton);
         Operations.InitializeSystem();
         NHUtil.ButtonGreen(ConnectButton);
     }
 }
Пример #2
0
        private void MosaicButton_Click(object sender, EventArgs e)
        {
            //Reads and constructs mosaic entry as a set of target plans after a mosaic has
            //  been constructed and copied to the clipboard in TSX
            //
            // Button will be held red until the user has prepared mosaic in TSX and
            //  copied to clipboard
            SessionControl openSession = new SessionControl();

            if (NHUtil.IsButtonGreen(MosaicButton))
            {
                //Verify that a target has been loaded, if not, post error and return
                //  otherwise, set the button color to read, change the text and zero the FOVI
                //  in anticipation of loading a mosaic target set
                TargetPlan tPlan = new TargetPlan(openSession.CurrentTargetName);
                if (TSXLink.StarChart.IsValidTarget(tPlan))
                {
                    NHUtil.ButtonRed(MosaicButton);
                    MosaicButton.Text = "Clipboard Ready";
                    TSXLink.FOVI.SetFOVPA(0);
                }
            }
            else
            {
                Mosaic nhms = new Mosaic();
                List <Mosaic.MosaicTarget> nhmtgts = nhms.ReadTSXMosaic();
                //Just return if no targets are found
                if (nhmtgts != null)
                {
                    //Save the mosaic entries as versions of the current configuration file
                    // For each of the entries in the mosaic,
                    //  Load the values into the configuration file
                    //  Save the configuration file with a prefix tName-Set-Frame
                    string tName = openSession.CurrentTargetName;
                    foreach (Mosaic.MosaicTarget mt in nhmtgts)
                    {
                        string     prefixName = tName + "-" + mt.Set + "-" + mt.Frame;
                        TargetPlan tPlan      = new TargetPlan(prefixName)
                        {
                            TargetName          = prefixName,
                            TargetRA            = mt.RA,
                            TargetDec           = mt.Dec,
                            TargetPA            = mt.PositionAngle,
                            TargetAdjustEnabled = true
                        };
                    }
                }
                LoadTargetPlanList();
                MosaicButton.Text = "Build Mosaic";
                NHUtil.ButtonGreen(MosaicButton);
            }
        }
Пример #3
0
        private void FlatManOnButton_Click(object sender, EventArgs e)
        {
            SessionControl openSession = new SessionControl();
            SessionControl tplan       = openSession;

            if (NHUtil.IsButtonGreen(FlatManOnButton))
            {
                FlatMan flmn = new FlatMan();
                NHUtil.ButtonRed(FlatManOnButton);
                FlatManOnButton.Text = "Turn Off";
                flmn.Light           = true;
            }
            else
            {
                NHUtil.ButtonGreen(FlatManOnButton);
                FlatManOnButton.Text = "Turn On";
                FlatMan flmn = new FlatMan();
                flmn.Light = false;
            }
        }
Пример #4
0
        private void AdjustButton_Click(object sender, EventArgs e)
        {
            //Adjust button depends on prior state:
            //  if button green, then an adjustment of RA/Dec/PA is to be run
            //      Reset the tPlan name to the orginal name,
            //          and save tPlan RA/Dec/PA with those StarChart values (via TSXFind)
            //      wait until button is pushed again, essentially
            //  if button red, then an adjustment has been completed.
            //      Get the current StarChart values from TSX
            //          and saves tPlan RA/Dec/PA with those StarChart values.
            SessionControl openSession = new SessionControl();

            if (NHUtil.IsButtonGreen(AdjustButton))
            {
                NHUtil.ButtonRed(AdjustButton);
                this.AdjustButton.Text = "Save Adjustment";
                TargetPlan     tPlan   = new TargetPlan(openSession.CurrentTargetName);
                TSXLink.Target tgt     = TSXLink.StarChart.FindTarget(tPlan.TargetName);
                double         totalPA = AstroMath.Transform.NormalizeDegreeRange(Rotator.RealRotatorPA + TSXLink.FOVI.GetFOVPA);
                tPlan.TargetRA            = tgt.RA;
                tPlan.TargetDec           = tgt.Dec;
                tPlan.TargetPA            = totalPA;
                tPlan.TargetAdjustEnabled = false;
                TSXLink.StarChart.SetFOV(2.0);
            }
            else
            {
                TSXLink    tLink   = new TSXLink();
                TargetPlan tPlan   = new TargetPlan(openSession.CurrentTargetName);
                double     totalPA = AstroMath.Transform.NormalizeDegreeRange(Rotator.RealRotatorPA + TSXLink.FOVI.GetFOVPA);
                tPlan.TargetRA            = TSXLink.StarChart.ChartRA;
                tPlan.TargetDec           = TSXLink.StarChart.ChartDec;
                tPlan.TargetPA            = totalPA;
                tPlan.TargetAdjustEnabled = true;
                UpdateHumasonSequencer();
                NHUtil.ButtonGreen(AdjustButton);
                this.AdjustButton.Text = "Adjust Target";
            }
        }