private void ObjectFromCoordinatesForm_Load(object sender, EventArgs e)
        {
            Location = new Point(0, 0);

            if (nightMode_)
            {
                ClientCommonAPI.EnterNightMode(this);
            }

            ra_hour_ = settings_.ra_hour_;
            dec_     = settings_.dec_;
            epoch_   = settings_.epoch_;

            textBoxRADegWidth_       = textBoxRADeg.Width;
            radioButtonRAHMS.Checked = true;
            SetRAFormat(RADecFormat.HMS, true);

            textBoxDecDegWidth_       = textBoxDecDeg.Width;
            radioButtonDecDMS.Checked = true;
            SetDecFormat(RADecFormat.DMS, true);

            checkBoxJ2000.Checked = (epoch_ == Epoch.J2000);

            timer1.Enabled = true;

            init_ = true;
            ObjectChanged();
        }
Пример #2
0
        private void ConnectionForm_Load(object sender, EventArgs e)
        {
            if (nightMode_)
            {
                ClientCommonAPI.EnterNightMode(this);
            }

            int i;

            string[] ports = AAB.UtilityLibrary.SerialConnection.MakeCorrectPortNames(SerialPort.GetPortNames());
            comboBoxSerialPort.Items.Add("Select Port");
            comboBoxSerialPort.Items.AddRange(ports);
            comboBoxSerialPort.Items.Add("Disconnect All");
            if (portName_ != null)
            {
                i = comboBoxSerialPort.Items.IndexOf(portName_);
                comboBoxSerialPort.SelectedIndex = i >= 0 ? i : 0;
            }
            else
            {
                comboBoxSerialPort.SelectedIndex = 0;
            }

            comboBoxBaudRate.Items.AddRange(new object[] { 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200 });
            i = comboBoxBaudRate.Items.IndexOf(baudRate_);
            if (i < 0)
            {
                i = comboBoxBaudRate.Items.IndexOf(9600);
            }
            comboBoxBaudRate.SelectedIndex = i >= 0 ? i : 0;

            checkBoxSwapAzmAlt.Checked = swapAzmAltEncoders_;

            init_ = true;
        }
Пример #3
0
 private void buttonNightMode_Click(object sender, EventArgs e)
 {
     if (nightMode_)
     {
         ClientCommonAPI.ExitNightMode(this);
         buttonNightMode.Text = "Night &Mode";
         nightMode_           = false;
     }
     else
     {
         ClientCommonAPI.EnterNightMode(this);
         buttonNightMode.Text = "Day &Mode";
         nightMode_           = true;
     }
 }
Пример #4
0
        private void SkyObjectForm_Load(object sender, EventArgs e)
        {
            if (nightMode_)
            {
                ClientCommonAPI.EnterNightMode(this);
            }

            buttonLastObj.Enabled = (lastObjects_.Length != 0 && lastObjects_[0] != null);
            if (stellariumConnection_ == null)
            {
                buttonStellarium.Enabled = false;
            }
            else
            {
                buttonStellarium.Enabled             = stellariumConnection_.IsConnected;
                stellariumConnection_.StatusChanged += StellariumStatusChangedHandlerAsync;
            }

            init_ = true;
            CalcAndOutputResults();
        }
Пример #5
0
        private void AlignmentForm_Load(object sender, EventArgs e)
        {
            if (nightMode_)
            {
                ClientCommonAPI.EnterNightMode(this);
            }

            comboBoxType.Items.AddRange(new object[]
            {
                "Solar System Object",
                "Star"
            });
            if (Settings.objTypeIdx_ >= 0 && Settings.objTypeIdx_ < comboBoxType.Items.Count)
            {
                comboBoxType.SelectedIndex = Settings.objTypeIdx_;
            }
            else
            {
                comboBoxType.SelectedIndex = 0;
            }

            FillObjectComboBox();
            if (Settings.objIdx_ >= 0 && Settings.objIdx_ < listBoxObj.Items.Count)
            {
                listBoxObj.SelectedIndex = Settings.objIdx_;
            }
            else
            {
                listBoxObj.SelectedIndex = 0;
            }

            timer1.Enabled = true;

            buttonOK.Enabled            = false;
            buttonSaveAlignment.Enabled = alignment_.IsAligned;

            init_ = true;
            CalcAndOutputResults();
        }
        private void ObjectLastSelectionForm_Load(object sender, EventArgs e)
        {
            if (nightMode_)
            {
                ClientCommonAPI.EnterNightMode(this);
            }

            if (lastObjects_.Length == 0)
            {
                buttonOK.Enabled = false;
            }
            else
            {
                foreach (var obj in lastObjects_)
                {
                    if (obj != null)
                    {
                        listBoxLastObjs.Items.Add(obj.Name);
                    }
                }

                if (listBoxLastObjs.Items.Count <= 0)
                {
                    buttonOK.Enabled = false;
                }
                else
                {
                    listBoxLastObjs.SelectedIndex = 0;
                    object_          = lastObjects_[0];
                    buttonOK.Enabled = true;
                }
            }

            timer1.Enabled = true;

            init_ = true;
            ObjectChanged();
        }
Пример #7
0
        private void ObjectFromListForm_Load(object sender, EventArgs e)
        {
            if (nightMode_)
            {
                ClientCommonAPI.EnterNightMode(this);
            }

            foreach (var entry in database_)
            {
                comboBoxType.Items.Add(entry.name_);
            }

            if (settings_.objTypeIdx_ >= 0 && settings_.objTypeIdx_ < comboBoxType.Items.Count)
            {
                comboBoxType.SelectedIndex = settings_.objTypeIdx_;
            }
            else
            {
                comboBoxType.SelectedIndex = 0;
            }

            FillObjectListBox();
            if (settings_.objIdx_ >= 0 && settings_.objIdx_ < listBoxObj.Items.Count)
            {
                listBoxObj.SelectedIndex = settings_.objIdx_;
            }
            else
            {
                listBoxObj.SelectedIndex = 0;
            }

            timer1.Enabled = true;

            init_ = true;
            CalcAndOutputResults();
        }
Пример #8
0
        private void OptionsForm_Load(object sender, EventArgs e)
        {
            Location = new Point(0, 0);

            if (nightMode_)
            {
                ClientCommonAPI.EnterNightMode(this);
            }

            textBoxLatDegWidth_ = textBoxLatDeg.Width;
            textBoxLonDegWidth_ = textBoxLonDeg.Width;

            comboBoxLocation.Items.Add("Enter Coordinates");
            int idx = 0;

            for (int i = 0; i < locations_.Count; ++i)
            {
                //comboBoxLocation.Items.Add(locations_[i].name_ + " (" + locations_[i].latitude_ + "," + locations_[i].longitude_ + ")");
                comboBoxLocation.Items.Add(locations_[i].name_ + " (" + ClientCommonAPI.PrintAngle(locations_[i].latitude_) + ", " + ClientCommonAPI.PrintAngle(locations_[i].longitude_) + ")");
                if (idx == 0 && Latitude == locations_[i].latitude_ && Longitude == locations_[i].longitude_)
                {
                    idx = i + 1;
                }
            }
            comboBoxLocation.SelectedIndex = idx;
            EnableLocationCtrls(idx == 0);

            radioButtonDMS.Checked = (locFmt_ == LocFormat.DMS);
            SetLocationText();

            checkBoxShowNearestAzmRotation.Checked   = ShowNearestAzmRotation;
            checkBoxConnectToStellarium.Checked      = ConnectToStellarium;
            labelStellariumTcpPort.Enabled           = ConnectToStellarium;
            textBoxStellariumTCPPort.Enabled         = ConnectToStellarium;
            textBoxStellariumTCPPort.Text            = StellariumTcpPort.ToString();
            checkBoxOppHorzPositionDirection.Checked = OppositeHorzPositioningDir;

            switch (AutoTrack)
            {
            default:
            case ClientCommonAPI.AutoTrack.DISABLED:
                checkBoxAutoTrack.Visible = checkBoxAutoTrack.Enabled = false;
                break;

            case ClientCommonAPI.AutoTrack.ON:
                checkBoxAutoTrack.Checked = true;
                break;

            case ClientCommonAPI.AutoTrack.OFF:
                checkBoxAutoTrack.Checked = false;
                break;
            }

#if LOGGING_ON
            comboBoxLoggingType0.Items.Add("M POS");
            comboBoxLoggingType0.Items.Add("M LOG");
            comboBoxLoggingType0.Items.Add("M SPD");
            comboBoxLoggingType0.Items.Add("M ERR");
            comboBoxLoggingType0.Items.Add("A POS");
            comboBoxLoggingType0.Items.Add("A LOG");
            comboBoxLoggingType0.Items.Add("A SPD");
            comboBoxLoggingType0.Items.Add("A ERR");

            comboBoxLoggingType1.Items.Add("M POS");
            comboBoxLoggingType1.Items.Add("M LOG");
            comboBoxLoggingType1.Items.Add("M SPD");
            comboBoxLoggingType1.Items.Add("M ERR");
            comboBoxLoggingType1.Items.Add("A POS");
            comboBoxLoggingType1.Items.Add("A LOG");
            comboBoxLoggingType1.Items.Add("A SPD");
            comboBoxLoggingType1.Items.Add("A ERR");
            switch (LoggingState)
            {
            case ClientCommonAPI.LoggingState.OFF:
                checkBoxLogging.Checked            = false;
                checkBoxLoggingAZM.Checked         = LoggingChannel == ClientCommonAPI.LoggingChannel.AZM;
                comboBoxLoggingType0.SelectedIndex = (int)LoggingType0;
                comboBoxLoggingType1.SelectedIndex = (int)LoggingType1;
                break;

            case ClientCommonAPI.LoggingState.ON:
                checkBoxLogging.Checked            = true;
                checkBoxLoggingAZM.Checked         = LoggingChannel == ClientCommonAPI.LoggingChannel.AZM;
                comboBoxLoggingType0.SelectedIndex = (int)LoggingType0;
                comboBoxLoggingType1.SelectedIndex = (int)LoggingType1;
                break;

            default:
                checkBoxLogging.Visible      = false;
                buttonSaveLog.Visible        = false;
                checkBoxLoggingAZM.Visible   = false;
                comboBoxLoggingType0.Visible = false;
                comboBoxLoggingType1.Visible = false;
                break;
            }
#else
            checkBoxLogging.Visible      = false;
            buttonSaveLog.Visible        = false;
            checkBoxLoggingAZM.Visible   = false;
            comboBoxLoggingType0.Visible = false;
            comboBoxLoggingType1.Visible = false;
#endif

            string hostConfigurationName = host_.GetConfigurationName;
            if (hostConfigurationName == null)
            {
                buttonHostConfig.Enabled = false;
                buttonHostConfig.Visible = false;
            }
            else
            {
                buttonHostConfig.Text = hostConfigurationName;
            }
            init_ = true;
        }