public IntersectionConfig(int intersectionID)
        {
            InitializeComponent();
            for (int id = 0; id < Simulator.IntersectionManager.GetNumberOfIntersections(); id++)
            {
                this.comboBox_Intersections.Items.Add(id);
            }
            roadLabel[0] = this.label1;
            roadLabel[1] = this.label2;
            roadLabel[2] = this.label3;
            roadLabel[3] = this.label4;
            roadLabel[4] = this.label5;
            roadLabel[5] = this.label6;
            roadLabel[6] = this.label7;
            roadLabel[7] = this.label8;

            roadOrder[0] = this.comboBox1;
            roadOrder[1] = this.comboBox2;
            roadOrder[2] = this.comboBox3;
            roadOrder[3] = this.comboBox4;
            roadOrder[4] = this.comboBox5;
            roadOrder[5] = this.comboBox6;
            roadOrder[6] = this.comboBox7;
            roadOrder[7] = this.comboBox8;

            this.comboBox_Intersections.SelectedIndex = intersectionID;
            selectedIntersection = Simulator.IntersectionManager.GetIntersectionByID(intersectionID);

            LoadIntersectionConfig();
        }
        public TrafficSignalConfig(int intersectionID)
        {
            InitializeComponent();

            Green.Add(this.numericUpDown_order_1_green);
            Green.Add(this.numericUpDown_order_2_green);
            Green.Add(this.numericUpDown_order_3_green);
            Green.Add(this.numericUpDown_order_4_green);

            Yellow.Add(this.numericUpDown_order_1_yellow);
            Yellow.Add(this.numericUpDown_order_2_yellow);
            Yellow.Add(this.numericUpDown_order_3_yellow);
            Yellow.Add(this.numericUpDown_order_4_yellow);

            Delete.Add(this.button_order_1_delete);
            Delete.Add(this.button_order_2_delete);
            Delete.Add(this.button_order_3_delete);
            Delete.Add(this.button_order_4_delete);

            ConfigNumber.Add(this.label_config1);
            ConfigNumber.Add(this.label_config2);
            ConfigNumber.Add(this.label_config3);
            ConfigNumber.Add(this.label_config4);

            for (int i = 0; i < Simulator.IntersectionManager.GetNumberOfIntersections(); i++)
            {
                this.comboBox_Intersections.Items.Add(i);
            }
            this.comboBox_Intersections.SelectedIndex = intersectionID;
            selectedIntersection = Simulator.IntersectionManager.GetIntersectionByID(intersectionID);
            LoadSignalSetting();
        }
 public void AddNewIntersection(int IntersectionID)
 {
     Intersection newIntersection = new Intersection(IntersectionID);
     if (IntersectionID == -1)
         virtualIntersection = newIntersection;
     else
         intersectionList.Add(newIntersection);
 }
        public TrafficDataDisplay()
        {
            InitializeComponent();

            for (int id = 0; id < Simulator.IntersectionManager.GetNumberOfIntersections(); id++)
            {
                    this.comboBox_Intersections.Items.Add(id);
            }

            this.comboBox_Intersections.SelectedIndex = 0;
            selectedIntersection = Simulator.IntersectionManager.GetIntersectionByID(System.Convert.ToInt16(this.comboBox_Intersections.Text));

            this.timer_refresh.Interval = 1000 * 60;
            this.timer_refresh.Tick += new EventHandler(RefreshTask);
            //this.timer_refresh.Start();
        }
 private void comboBox_Insections_SelectedIndexChanged(object sender, EventArgs e)
 {
     selectedIntersection = Simulator.IntersectionManager.GetIntersectionByID(this.comboBox_Intersections.SelectedIndex);
     LoadIntersectionConfig();
 }
 private void comboBox_Intersections_SelectedIndexChanged(object sender, EventArgs e)
 {
     selectedIntersection = Simulator.IntersectionManager.GetIntersectionByID(System.Convert.ToInt16(this.comboBox_Intersections.Text));
     LoadIntersectionTrafficData();
 }