public void EliminateProcess(bool Ekey) { int count = wp.LoteEjec.RowCount; int count2 = wp.Bloqueado.RowCount; if (count == 1) { if (count2 == 0) { if (Ekey == true) { controlP--; } SendToFinal(sh1, false); t.Stop(); ls[lotIND].RemoveAt(sh1); wp.LoteEjec.DataSource = null; wp.LoteEjec.Rows.Clear(); wp.LoteEjec.Refresh(); wp.LoteEjec.DataSource = ls[lotIND]; setGridProperties_LoteEjec(); TT = 0; TR = 0; wp.textBox7.Text = "0"; MessageBox.Show("El proceso termino"); //int count = ls5.Count(); AllProcessStats alp = new AllProcessStats(ls5); alp.Show(); } } else { if (Ekey == true) { controlP--; } ls[lotIND].RemoveAt(sh1); wp.LoteEjec.DataSource = null; wp.LoteEjec.Rows.Clear(); wp.LoteEjec.Refresh(); wp.LoteEjec.DataSource = ls[lotIND]; setGridProperties_LoteEjec(); TT = 0; TR = 0; } }
public void incTT() { if (TT <= num) { wp.textBox5.Text = TT.ToString(); wp.textBox6.Text = TR.ToString(); wp.textBox7.Text = controlP.ToString(); wp.textBox8.Text = reloj.ToString(); ReturnBloqProcess(); reloj++; TT++; TR = h - TT; } else if (TT >= num) { controlP--; if (controlP == 0) { SendToFinal(sh1, false); t.Stop(); wp.textBox7.Text = "0"; MessageBox.Show("El proceso termino"); int count = ls5.Count(); AllProcessStats alp = new AllProcessStats(ls5); alp.Show(); } else if (controlP > 0) { SendToFinal(sh1, false); EliminateProcess(false); ReturnBloqProcess(); AddNewProcess(); //globalCantProcss2--; //sh1++; TT = 0; TR = 0; } } }