void cmdToGUI(string cmdString) { string[] cmd = cmdString.Split(' '); PList.Items.Clear(); int sched = int.Parse(cmd[0]); int preempt = int.Parse(cmd[1]); float qTime = float.Parse(cmd[2]); int prcsNum = int.Parse(cmd[3]); List <string> arvT = new List <string>(); List <string> brstT = new List <string>(); List <string> prtT = new List <string>(); for (int i = 0; i < prcsNum; ++i) { arvT.Add(cmd[i + 4]); brstT.Add(cmd[i + 4 + prcsNum]); prtT.Add(cmd[i + 4 + 2 * prcsNum]); PList.Items.Add("Process " + (i + 1).ToString()); PList.Items[i].SubItems.Add(arvT[i]); PList.Items[i].SubItems.Add(brstT[i]); if (prtT[i] == "-1") { prtT[i] = ""; } PList.Items[i].SubItems.Add(prtT[i]); } SchedList.SelectedIndex = sched; if (preempt == 1) { PrEmpRB.Select(); } else { NPrEmpRB.Select(); } QTTB.Text = qTime.ToString(); }
private void SchedList_SelectedIndexChanged(object sender, EventArgs e) { if (SchedList.SelectedIndex == 4) { RRControls(true); NPrEmpRB.Enabled = false; PrEmpRB.Enabled = false; PrEmpRB.Select(); } else if (SchedList.SelectedIndex == 1) { RRControls(false); NPrEmpRB.Enabled = false; PrEmpRB.Enabled = false; NPrEmpRB.Select(); } else { NPrEmpRB.Enabled = true; PrEmpRB.Enabled = true; RRControls(false); } }