예제 #1
0
 private void button1_Click(object sender, EventArgs e) //Add process
 {
     if ((radioButton1.Checked == true) || (radioButton2.Checked == true) || (radioButton3.Checked == true) || (radioButton6.Checked == true))
     {
         Priority_box.Text = "0";
     }
     if ((radioButton1.Checked == true) || (radioButton2.Checked == true) || (radioButton3.Checked == true) || (radioButton4.Checked == true) || (radioButton5.Checked == true))
     {
         Quantum_box.Text = "0";
     }
     if ((ProcID.Text == "") || (Arrival_time_box.Text == "") || (Burst_time_box.Text == "") || (Priority_box.Text == "") || (Quantum_box.Text == ""))
     {
         MessageBox.Show("Add process info.");
     }
     else
     {
         Process p = new Process(ProcID.Text, int.Parse(Arrival_time_box.Text), int.Parse(Burst_time_box.Text), int.Parse(Priority_box.Text));
         processes.Add(p);
         Quantum = int.Parse(Quantum_box.Text);
         ProcID.Clear(); ProcID.Focus();
         Arrival_time_box.Clear(); Arrival_time_box.Focus();
         Burst_time_box.Clear(); Burst_time_box.Focus();
         Priority_box.Clear(); Priority_box.Focus();
         Quantum_box.Clear(); Quantum_box.Focus();
     }
 }
예제 #2
0
 private void button3_Click(object sender, EventArgs e) //RESET
 {
     processes.Clear();
     Gantt.GraphPane.CurveList.Clear();
     Gantt.GraphPane.GraphObjList.Clear();
     Gantt.Invalidate();
     button1.Enabled          = true;
     ProcID.Enabled           = true;
     Arrival_time_box.Enabled = true;
     Burst_time_box.Enabled   = true;
     Priority_box.Enabled     = true;           Priority_box.Clear();
     Quantum_box.Enabled      = true;           Quantum_box.Clear();
     radioButton1.Enabled     = true;
     radioButton2.Enabled     = true;
     radioButton3.Enabled     = true;
     radioButton4.Enabled     = true;
     radioButton5.Enabled     = true;
     radioButton6.Enabled     = true;
 }