public void NewSimulationFile()
 {
     SimulationTask newTask = new SimulationTask("", 0, 86400, -1, false, false, false, false);
     Simulator.TaskManager.SetCurrentTask(newTask);
     SetSimulationTask(newTask);
 }
        public void SetSimulationTask(SimulationTask simulationTask) //set auto simulation config  
        {
            if (!simulationTask.simulationFilePath.Equals(""))
                Simulator.UI.AddMessage("System", "Load new simulation task , Simulation name : " + simulationTask.simulationName);

            this.currentTask = simulationTask;
            this.currentTask.TaskStart();
            SimulationInitialize();
        }
        public void OpenSimulationFile()
        { 
            OpenFileDialog openFileDialog_sim = new OpenFileDialog();
            openFileDialog_sim.Filter = "Simulation Files|*.xml";
            openFileDialog_sim.Title = "Select a Simulation File";

            if (openFileDialog_sim.ShowDialog() == DialogResult.OK)
            {
                SimulationTask newTask = new SimulationTask(openFileDialog_sim.FileName, 0, 86400, -1, false, false,false,false);
                Simulator.TaskManager.SetCurrentTask(newTask);
                SetSimulationTask(newTask);
            }
        }
        private void button_addNewAutoSimulationTask_Click(object sender, EventArgs e)
        {
            if (!this.textBox_simulationFilePath.Text.Equals(""))
            {
                string filePath = this.textBox_simulationFilePath.Text;
                int autoSimulationStartTime = (int)this.numericUpDown_startHour.Value * 3600 + (int)this.numericUpDown_startMinute.Value * 60;
                int autoSimulationStopTime = (int)this.numericUpDown_stopHour.Value * 3600 + (int)this.numericUpDown_stopMinute.Value * 60;
                int repeatTimes = (int)this.numericUpDown_repeatTimes.Value;
                Boolean saveTrafficRecoed;
                Boolean saveOptimizationRecord;
                Boolean saveIntersectionState;
                Boolean saveVehicleData;

                if (this.checkBox_autoSave.Checked)
                {
                    saveTrafficRecoed = this.checkBox_saveTrafficRecord.Checked;
                    saveOptimizationRecord = this.checkBox_saveOptimizationRecord.Checked;
                    saveIntersectionState = this.checkBox_saveIntersectionState.Checked;
                    saveVehicleData = this.checkBox_saveVehicleData.Checked;
                }
                else
                {
                    saveTrafficRecoed = false;
                    saveOptimizationRecord = false;
                    saveIntersectionState = false;
                    saveVehicleData = false;
                }

                SimulationTask newAutoSimulationTask = new SimulationTask(filePath, autoSimulationStartTime, autoSimulationStopTime, repeatTimes, saveTrafficRecoed, saveOptimizationRecord, saveIntersectionState,saveVehicleData);

                Simulator.TaskManager.AddSimulationTask(newAutoSimulationTask);

                this.textBox_simulationFilePath.Text = "";

                LoadAutoSimulationTaskList();
            }
        }