private void btn_run_Click(object sender, EventArgs e) { if (rb_fcfs.Checked) { running_algorithm = new fcfs((int)(txt_n_map.Value) + 1); log("------ first come first served algorithm started at " + DateTime.Now.ToString("h:mm:ss tt") + " with " + txt_n_map.Value + " process:"); log("[overal time]\t[process]\t\t[status]\t\t[remaining time]"); } else if (rb_sjf.Checked) { running_algorithm = new sjf((int)(txt_n_map.Value) + 1); log("------ short job first algorithm started at " + DateTime.Now.ToString("h:mm:ss tt") + " with " + txt_n_map.Value + " process:"); log("[overal time]\t[process]\t\t[status]\t\t[remaining time]"); } else if (rb_priority.Checked) { running_algorithm = new priority((int)(txt_n_map.Value) + 1); log("------ priority algorithm started at " + DateTime.Now.ToString("h:mm:ss tt") + " with " + txt_n_map.Value + " process:"); log("[overal time]\t[process]\t\t[status]\t\t[remaining time]\t\t[priority]"); } else if (rb_rr.Checked) { running_algorithm = new rr((int)(txt_n_map.Value) + 1); log("------ round robin algorithm started at " + DateTime.Now.ToString("h:mm:ss tt") + " with " + txt_n_map.Value + " process:"); log("[overal time]\t[process]\t\t[status]\t\t[remaining time]"); } btn_run.Enabled = false; progress_bar.Style = ProgressBarStyle.Continuous; general_timer.Enabled = true; btn_determine.Enabled = true; }
private void stop_timer() { general_timer.Enabled = false; btn_run.Enabled = true; btn_determine.Enabled = false; log("all requested processes performed.................. [" + DateTime.Now.ToString("h:mm:ss tt") + "]\r\n"); progress_bar.Style = ProgressBarStyle.Marquee; running_algorithm = null; }