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();
        }
Example #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            // if the LC key was changed and calcs have been done already then clears UWDW + Round Robin models, turbine WS/AEP ests gross/net, and all
            // maps and recalculates SR/DH at Mets, Turbines, Nodes in DB
            Update updateThe = new Update();

            if (Orig_and_New_LC_Same() == false)
            {
                DialogResult Good_to_go = DialogResult.Yes;

                if (thisInst.modelList.ModelCount > 1 || thisInst.mapList.ThisCount > 0)
                {
                    Good_to_go = MessageBox.Show("Changing the Land Cover key will reset the analysis file and delete all generated estimates and maps. Do you want to continue?",
                                                 "Continuum 3", MessageBoxButtons.YesNo);
                }

                if (Good_to_go == DialogResult.Yes)
                {
                    thisInst.modelList.ClearAllExceptImported();
                    thisInst.mapList.ClearAllMaps();
                    thisInst.turbineList.ClearAllWSEsts();
                    thisInst.turbineList.ClearAllGrossEsts();
                    thisInst.turbineList.ClearAllNetEsts();
                    thisInst.turbineList.turbineCalcsDone = false;

                    thisInst.metPairList.ClearAll();
                    thisInst.metPairList.ClearRoundRobin();

                    thisInst.topo.LC_Key = LC_Key_New;
                    thisInst.topo.GetElevsAndSRDH_ForCalcs(thisInst, null, false);

                    if (thisInst.topo.gotSR == true)
                    {
                        thisInst.metList.ReCalcSRDH(thisInst.topo, thisInst.radiiList);
                        thisInst.turbineList.ReCalcTurbine_SRDH(thisInst);

                        // Call Background worker to recalculate node SR/DH
                        thisInst.BW_worker = new BackgroundWork();
                        thisInst.BW_worker.Call_BW_Node_Recalc(thisInst);
                    }
                }

                else
                {
                    thisInst.topo.LC_Key = LC_Key_Orig;
                }
            }

            updateThe.AllTABs(thisInst);

            Close();
        }