예제 #1
0
        public static void StartAutomatedRun(AutomatedRun run)
        {
            var go   = new GameObject("StartAutomatedQAFromEditor");
            var init = go.AddComponent <StartAutomatedQAFromEditor>();

            init.runConfig                        = run.config;
            init.AutomatorName                    = run.ToString().Replace("(Unity.AutomatedQA.AutomatedRun)", string.Empty).Trim();
            EditorApplication.isPlaying           = true;
            RecordingInputModule.isWorkInProgress = true;
        }
예제 #2
0
        private void addRunButton_Click(object sender, EventArgs e)
        {
            if (checkedStations.CheckedItems.Count > 0 && checkedSatellites.CheckedItems.Count > 0)
            {
                if (validateRichTextBox())
                {
                    EpochTime startTime = new EpochTime(startTimePicker.Value.Hour, startTimePicker.Value.Minute,
                                                        startTimePicker.Value.Second, startDatePicker.Value.Year, startDatePicker.Value.Month, startDatePicker.Value.Day);
                    EpochTime stopTime = new EpochTime(stopTimePicker.Value.Hour, stopTimePicker.Value.Minute,
                                                       stopTimePicker.Value.Second, stopDatePicker.Value.Year, stopDatePicker.Value.Month, stopDatePicker.Value.Day);
                    List <string> sats = new List <string>();
                    for (int i = 0; i < checkedSatellites.Items.Count; i++)
                    {
                        if (checkedSatellites.GetItemChecked(i))
                        {
                            sats.Add(checkedSatellites.Items[i].ToString());
                        }
                    }
                    List <string> sta = new List <string>();
                    for (int i = 0; i < checkedStations.Items.Count; i++)
                    {
                        if (checkedStations.GetItemChecked(i))
                        {
                            sta.Add(checkedStations.Items[i].ToString());
                        }
                    }

                    string sett = "";

                    for (int i = 0; i < SettingsRichTextBox.Lines.Count(); i++)
                    {
                        string ln = SettingsRichTextBox.Lines[i];
                        if (ln[0] != '#')
                        {
                            int pos = ln.IndexOf('=');
                            sett += ln.Substring(pos + 1);
                        }
                    }

                    AutomatedRun run = new AutomatedRun(schedulerComboBox.Items[schedulerComboBox.SelectedIndex].ToString(), startTime,
                                                        stopTime, sats, sta, comboScenarioBox.SelectedIndex, objectiveComboBox.Items[objectiveComboBox.SelectedIndex].ToString(),
                                                        sett, SettingsRichTextBox.Text);
                    runList.Add(run);
                    runsListBox.Items.Add(run.ToString());
                }
            }
            else
            {
                MessageBox.Show("No Stations or Satellites have been selected", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #3
0
        private void loadRunsFromFile(string filepath)
        {
            progressBar1.Value = 0;
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(filepath);
            XmlNodeList dataNodes = xmlDoc.SelectNodes("//AutomatedRun/Run");

            progressBar1.Maximum = dataNodes.Count;
            foreach (XmlNode node in dataNodes)
            {
                /*
                 *      <Scheduler>EFT-Greedy</Scheduler>
                 *      <StartYear>2017</StartYear>
                 *      <StartEpoch>82.5712962962963</StartEpoch>
                 *      <StopYear>2017</StopYear>
                 *      <StopYear>83.5712962962963</StopYear>
                 *      <Scenario>0</Scenario>
                 *      <Settings />
                 *      <SettinsFull />
                 *      <Scheduler>EFT-Greedy</Scheduler>
                 *      <Objective>All</Objective>
                 */
                string schedulerName = node.SelectSingleNode("Scheduler").InnerText;
                string startYear     = node.SelectSingleNode("StartYear").InnerText;
                string startEpoch    = node.SelectSingleNode("StartEpoch").InnerText;
                string stopYear      = node.SelectSingleNode("StopYear").InnerText;
                string stopEpoch     = node.SelectSingleNode("StopEpoch").InnerText;
                string scenario      = node.SelectSingleNode("Scenario").InnerText;
                string settings      = node.SelectSingleNode("Settings").InnerText;
                string settingsFull  = node.SelectSingleNode("SettinsFull").InnerText;
                string scheduler     = node.SelectSingleNode("Scheduler").InnerText;
                string objective     = node.SelectSingleNode("Objective").InnerText;

                List <string> satellites = new List <string>();
                XmlNodeList   satChild   = node.SelectNodes("Satellites/SatName");
                foreach (XmlNode childNode in satChild)
                {
                    satellites.Add(childNode.InnerText);
                }

                List <string> stations = new List <string>();
                XmlNodeList   staChild = node.SelectNodes("Stations/StaName");
                foreach (XmlNode childNode in staChild)
                {
                    stations.Add(childNode.InnerText);
                }

                EpochTime startTime = new EpochTime(Convert.ToInt32(startYear), Convert.ToDouble(startEpoch));
                EpochTime stopTime  = new EpochTime(Convert.ToInt32(stopYear), Convert.ToDouble(stopEpoch));

                AutomatedRun run = new AutomatedRun(schedulerName, startTime,
                                                    stopTime, satellites, stations, Convert.ToInt32(scenario), objective,
                                                    settings, settingsFull);
                runList.Add(run);
                runsListBox.Items.Add(run.ToString());
                progressBar1.Value = progressBar1.Value + 1;
                System.Windows.Forms.Application.DoEvents();
            }
            progressBar1.Value = 0;
        }