示例#1
0
        private void restorDefaultsInSettingsBox()
        {
            SettingsRichTextBox.Clear();
            int selected = schedulerComboBox.SelectedIndex;

            // selected = 0: EFT:
            // selected = 1: Greedy;
            // selected = 2: Genetic;
            // selected = 3: HillClimber
            switch (selected)
            {
            case 0:
                break;

            case 1:
                break;

            case 2:
                SettingsRichTextBox.Text = geneticDefault;
                break;

            case 3:
                SettingsRichTextBox.Text = hillclimberDefault;
                break;
            }
            validateRichTextBox();
        }
示例#2
0
        private void runsListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = runsListBox.SelectedIndex;

            if (index >= 0)
            {
                startDatePicker.Value = runList[index].getStartTime().toDateTime();
                startTimePicker.Value = runList[index].getStartTime().toDateTime();
                stopDatePicker.Value  = runList[index].getStopTime().toDateTime();
                stopTimePicker.Value  = runList[index].getStopTime().toDateTime();
                for (int i = 0; i < schedulerComboBox.Items.Count; i++)
                {
                    if (schedulerComboBox.Items[i].ToString() == runList[index].getNameOfScheduler())
                    {
                        schedulerComboBox.SelectedIndex = i;
                        break;
                    }
                }

                comboScenarioBox.SelectedIndex = runList[index].getScenario();
                SettingsRichTextBox.Clear();
                SettingsRichTextBox.Text = runList[index].getHumanReadableSettings();
                validateRichTextBox();
                foreach (int i in checkedSatellites.CheckedIndices)
                {
                    checkedSatellites.SetItemCheckState(i, CheckState.Unchecked);
                }
                for (int i = 0; i < checkedSatellites.Items.Count; i++)
                {
                    for (int k = 0; k < runList[index].getSatellites().Count; k++)
                    {
                        if (checkedSatellites.Items[i].ToString() == runList[index].getSatellites()[k])
                        {
                            checkedSatellites.SetItemCheckState(i, CheckState.Checked);
                        }
                    }
                }
                foreach (int i in checkedStations.CheckedIndices)
                {
                    checkedStations.SetItemCheckState(i, CheckState.Unchecked);
                }
                for (int i = 0; i < checkedStations.Items.Count; i++)
                {
                    for (int k = 0; k < runList[index].getStation().Count; k++)
                    {
                        if (checkedStations.Items[i].ToString() == runList[index].getStation()[k])
                        {
                            checkedStations.SetItemCheckState(i, CheckState.Checked);
                        }
                    }
                }
            }
        }