示例#1
0
        //ResetConfiguration loads values of the current target plan, but saves default values to
        //  the plan if not already saved
        public void ResetConfiguration()
        {
            //Populate entries with stored entries, if any
            SessionControl openSession = new SessionControl();
            TargetPlan     tPlan       = new TargetPlan(openSession.CurrentTargetName);

            if (tPlan.TargetPlanPath != null)
            {
                FocusFilterBox.Text = tPlan.FocusFilter.ToString();
                if (tPlan.HasValue(TargetPlan.FocusExposureXName))
                {
                    tPlan.FocusExposure = (double)FocusExposureBox.Value;
                }
            }
        }
示例#2
0
        public void ResetConfiguration()
        {
            SessionControl openSession = new SessionControl();
            TargetPlan     tPlan       = new TargetPlan(openSession.CurrentTargetName);

            if (tPlan.HasValue(TargetPlan.GuideExposureTimeXName))
            {
                GuideExposureTimeBox.Value = (decimal)tPlan.GuideExposure;
            }
            else
            {
                tPlan.GuideExposure = (double)GuideExposureTimeBox.Value;
            }

            if (tPlan.HasValue(TargetPlan.MaxGuideExposureTimeXName))
            {
                MaximumGuideExposureTimeBox.Value = (decimal)tPlan.MaximumGuiderExposure;
            }
            else
            {
                tPlan.MaximumGuiderExposure = (double)MaximumGuideExposureTimeBox.Value;
            }

            if (tPlan.HasValue(TargetPlan.MinGuideExposureTimeXName))
            {
                MinimumGuideExposureTimeBox.Value = (decimal)tPlan.MinimumGuiderExposure;
            }
            else
            {
                tPlan.MinimumGuiderExposure = (double)MinimumGuideExposureTimeBox.Value;
            }

            if (tPlan.HasValue(TargetPlan.GuideStarADUXName))
            {
                GuideStarADUNum.Value = (decimal)tPlan.GuideStarADU;
            }
            else
            {
                tPlan.GuideStarADU = (int)GuideStarADUNum.Value;
            }

            if (tPlan.HasValue(TargetPlan.AOCheckedXName))
            {
                AOCheckBox.Checked = tPlan.AOEnabled;
            }
            else
            {
                tPlan.AOEnabled = AOCheckBox.Checked;
            }

            if (tPlan.HasValue(TargetPlan.GuiderSubframeEnabledXName))
            {
                SubframeCheckBox.Checked = tPlan.GuiderSubframeEnabled;
            }
            else
            {
                tPlan.GuiderSubframeEnabled = SubframeCheckBox.Checked;
            }

            if (tPlan.HasValue(TargetPlan.XAxisMoveTimeXName))
            {
                XAxisMoveTime.Value = (decimal)tPlan.XAxisMoveTime;
            }
            else
            {
                tPlan.XAxisMoveTime = (double)XAxisMoveTime.Value;
            }

            if (tPlan.HasValue(TargetPlan.YAxisMoveTimeXName))
            {
                YAxisMoveTime.Value = (decimal)tPlan.YAxisMoveTime;
            }
            else
            {
                tPlan.YAxisMoveTime = (double)YAxisMoveTime.Value;
            }

            if (tPlan.HasValue(TargetPlan.GuideStarXXName))
            {
                GuideStarXBox.Text = tPlan.GuideStarX.ToString("0.0");
            }
            else
            {
                tPlan.GuideStarX = Convert.ToDouble(GuideStarXBox.Text);
            }

            if (tPlan.HasValue(TargetPlan.GuideStarYXName))
            {
                GuideStarYBox.Text = tPlan.GuideStarY.ToString("0.0");
            }
            else
            {
                tPlan.GuideStarY = Convert.ToDouble(GuideStarYBox.Text);
            }

            if (tPlan.HasValue(TargetPlan.GuideCycleTimeXName))
            {
                GuiderCycleTimeNum.Value = (decimal)tPlan.GuiderCycleTime;
            }
            else
            {
                tPlan.GuiderCycleTime = (double)GuiderCycleTimeNum.Value;
            }

            if (tPlan.HasValue(TargetPlan.GuiderBinningXName))
            {
                if (tPlan.GuiderBinning == 2)
                {
                    Binning2x2RadioButton.Checked = true;
                }
                else
                {
                    Binning1x1RadioButton.Checked = true;
                    tPlan.GuiderBinning           = 1;
                }
            }
            else if (Binning1x1RadioButton.Checked)
            {
                tPlan.GuiderBinning = 1;
            }
            else
            {
                tPlan.GuiderBinning = 2;
            }
        }