private void btnOK_Click(object sender, EventArgs e)
        {
            // Edits the coordinates of selected turbine and calls background worker to perform turbine calcs (if they were done before)

            string name = txtName.Text;
            double UTMX = Convert.ToDouble(txtUTMX.Text);
            double UTMY = Convert.ToDouble(txtUTMY.Text);

            if (name == "" || UTMX == 0 || UTMY == 0)
            {
                MessageBox.Show("Need valid entries for all fields", "Continuum 3");
                return;
            }

            Check_class Check        = new Check_class();
            bool        inputTurbine = Check.NewTurbOrMet(thisInst.topo, name, UTMX, UTMY, true);

            if (inputTurbine == true)
            {
                thisInst.turbineList.EditTurbine(name, UTMX, UTMY);
            }

            Update updateThe = new Update();

            updateThe.AllTABs(thisInst);

            Close();
        }
示例#2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            // Reads in entered name, UTMX, UTMY, and string number. if ( valid, adds to turbine list and calls background worker to perform turbine calcs (if done before)
            string name      = "";
            double UTMX      = 0;
            double UTMY      = 0;
            int    stringNum = 0;

            bool        inputTurbine = false;
            Check_class check        = new Check_class();

            try
            {
                name = txtName.Text;
            }
            catch
            {
                MessageBox.Show("Invalid entry for turbine name", "Continuum 3");
                return;
            }

            try
            {
                UTMX = Convert.ToSingle(txtUTMX.Text);
            }
            catch
            {
                MessageBox.Show("Invalid entry for easting", "Continuum 3");
                return;
            }

            try
            {
                UTMY = Convert.ToSingle(txtUTMY.Text);
            }
            catch
            {
                MessageBox.Show("Invalid entry for northing", "Continuum 3");
                return;
            }

            try
            {
                stringNum = Convert.ToInt16(txtStrNum.Text);
            }
            catch
            {
                stringNum = 0;
            }

            if (name == "" || UTMX == 0 || UTMY == 0)
            {
                MessageBox.Show("Need valid entries for all fields", "Continuum 3");
                return;
            }
            else
            {
                inputTurbine = check.NewTurbOrMet(thisInst.topo, name, UTMX, UTMY, true);
                if (inputTurbine == true)
                {
                    thisInst.turbineList.AddTurbine(name, UTMX, UTMY, stringNum);
                }

                thisInst.updateThe.AllTABs(thisInst);
                thisInst.ChangesMade();

                Close();
            }
        }