public void populate() { listbar = new LoadBar2[Numpro]; prolist = new ProcessPQ[Numpro]; double mean = (double)(Max + Min) / (double)2; double stdDev = (double)(Max - Min) / (double)6; for (int i = 0; i < Numpro; i++) { prolist[i] = new ProcessPQ(); prolist[i].Num = i; if (ran == true) { prolist[i].Arrival = Normal(mean, stdDev, Max, Min); prolist[i].Burst = Normal(mean, stdDev, Max, Min); prolist[i].Prior = Normal(mean, stdDev, Max, Min); } else { prolist[i].Arrival = 0; prolist[i].Burst = 1; prolist[i].Prior = 1; } flowLayoutPanel1.Controls.Add(prolist[i]); } }
private void prostart(ProcessPQ p1) { ProcessPQ k = new ProcessPQ(); k = p1; listbar[p1.Num] = new LoadBarPQ(); listbar[p1.Num].Max = k.Burst; listbar[p1.Num].setMax(); Label k1 = new Label(); Label k2 = new Label(); k1.Text = "P" + p1.Num.ToString(); k2.Text = "Start Time " + p1.Start.ToString(); int i = tableLayoutPanel1.ColumnCount++; tableLayoutPanel1.Controls.Add(k1, i - 1, 0); tableLayoutPanel1.Controls.Add(listbar[p1.Num].b1, i - 1, 1); tableLayoutPanel1.Controls.Add(k2, i - 1, 2); k.proStart(); listbar[p1.Num].proStart(); }
private void proresume(ProcessPQ p1) { p1.proStart(); listbar[p1.Num].proStart(); }
private void prostop(ProcessPQ p1) { p1.proStop(); listbar[p1.Num].proStop(); }