示例#1
0
        private void CruModel_CheckedChanged(object sender, EventArgs e)
        {
            if (CruModel.Checked)
            {
                ModelChk.Items.Add("HistoricData");
                ScenarioChk.Items.Add("HistoricData");
                for (int i = 0; i < ModelChk.Items.Count - 1; i++)
                {
                    ModelChk.SetItemChecked(i, false);
                }
                for (int i = 0; i < ScenarioChk.Items.Count - 1; i++)
                {
                    ScenarioChk.SetItemChecked(i, false);
                }

                ModelChk.SetItemChecked(ModelChk.Items.Count - 1, true);
                ModelChk.Enabled = false;
                ScenarioChk.SetItemChecked(ScenarioChk.Items.Count - 1, true);
                ScenarioChk.Enabled = false;
            }
            else
            {
                ModelChk.Items.Remove("HistoricData");
                ScenarioChk.Items.Remove("HistoricData");
                ModelChk.SetItemChecked(ModelChk.Items.Count - 1, false);
                ModelChk.Enabled = true;
                ScenarioChk.SetItemChecked(ScenarioChk.Items.Count - 1, false);
                ScenarioChk.Enabled = true;
            }
        }
        private void ObserveModel_CheckedChanged(object sender, EventArgs e)
        {
            if (ObserveModel.Checked)
            {
                CruModel.Checked = false;
                //ModelChk.Items.Add("ObservedData");
                //ScenarioChk.Items.Add("ObservedUser");
                for (int i = 0; i < ModelChk.Items.Count; i++)
                {
                    ModelChk.SetItemChecked(i, false);
                }
                for (int i = 0; i < ScenarioChk.Items.Count; i++)
                {
                    ScenarioChk.SetItemChecked(i, false);
                }

                //ModelChk.SetItemChecked(ModelChk.Items.Count - 1, true);
                ModelChk.Enabled = false;
                //ScenarioChk.SetItemChecked(ScenarioChk.Items.Count - 1, true);
                ScenarioChk.Enabled = false;
            }
            else
            {
                ModelChk.Items.Remove("ObservedData");
                ScenarioChk.Items.Remove("ObservedUser");
                ModelChk.SetItemChecked(ModelChk.Items.Count - 1, false);
                ModelChk.Enabled = true;
                ScenarioChk.SetItemChecked(ScenarioChk.Items.Count - 1, false);
                ScenarioChk.Enabled = true;
            }
        }
        private void ObserveModel_CheckedChanged(object sender, EventArgs e)
        {
            CruModel.Enabled = !ObserveModel.Checked;
            if (ObserveModel.Checked)
            {
                var msg = @"You probably should do bias correction for GCMs not Observed!
Are you atill want to do bias correction for ObservedUser?";

                if (MessageBox.Show(msg, "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) ==
                    DialogResult.OK)
                {
                    CruModel.Checked = false;
                    //ModelChk.Items.Add("ObservedData");
                    //ScenarioChk.Items.Add("ObservedUser");
                    for (int i = 0; i < ModelChk.Items.Count; i++)
                    {
                        ModelChk.SetItemChecked(i, false);
                    }
                    for (int i = 0; i < ScenarioChk.Items.Count; i++)
                    {
                        ScenarioChk.SetItemChecked(i, false);
                    }

                    //ModelChk.SetItemChecked(ModelChk.Items.Count - 1, true);
                    ModelChk.Enabled = false;
                    //ScenarioChk.SetItemChecked(ScenarioChk.Items.Count - 1, true);
                    ScenarioChk.Enabled = false;
                }
                else
                {
                    ObserveModel.Checked = false;
                }
            }
            else
            {
                ModelChk.Items.Remove("ObservedData");
                ScenarioChk.Items.Remove("ObservedUser");
                ModelChk.SetItemChecked(ModelChk.Items.Count - 1, false);
                ModelChk.Enabled = true;
                ScenarioChk.SetItemChecked(ScenarioChk.Items.Count - 1, false);
                ScenarioChk.Enabled = true;
            }
        }
示例#4
0
        private void ObserveModel_CheckedChanged(object sender, EventArgs e)
        {
            CruModel.Enabled = !ObserveModel.Checked;
            if (ObserveModel.Checked)
            {
                MessageBox.Show(@"Three steps for downscaling of GCMs while having ObservedUser in the project:
1- Click Run button for ObservedUser, 
2- Click Run button for GCMs, 
3- Click downscaling button for GCMs (RCPs and Historical).", "Tip", MessageBoxButtons.OK);

                CruModel.Checked = false;

                //ModelChk.Items.Add("ObservedData");
                //ScenarioChk.Items.Add("ObservedUser");
                for (int i = 0; i < ModelChk.Items.Count; i++)
                {
                    ModelChk.SetItemChecked(i, false);
                }
                for (int i = 0; i < ScenarioChk.Items.Count; i++)
                {
                    ScenarioChk.SetItemChecked(i, false);
                }

                //ModelChk.SetItemChecked(ModelChk.Items.Count - 1, true);
                ModelChk.Enabled = false;
                //ScenarioChk.SetItemChecked(ScenarioChk.Items.Count - 1, true);
                ScenarioChk.Enabled = false;
            }
            else
            {
                ModelChk.Items.Remove("ObservedData");
                ScenarioChk.Items.Remove("ObservedUser");
                ModelChk.SetItemChecked(ModelChk.Items.Count - 1, false);
                ModelChk.Enabled = true;
                ScenarioChk.SetItemChecked(ScenarioChk.Items.Count - 1, false);
                ScenarioChk.Enabled = true;
            }
        }