Пример #1
0
        //Metodos del proceso de pintura
        private void timer1_Tick(object sender, EventArgs e)
        {
            EntraronPinturaNUD.Value = EntraronPintura.Count;

            SegundosPin++;

            Cuadros c = new Cuadros();


            if (SegundosPin == 60)
            {
                SegundosPin = 0;
                minutosPin++;

                Cuadros item = EsperaPintura.First();
                item.TiempoPintura--;
                if (item.TiempoPintura == 0)
                {
                    SalieronPintura.Add(item);
                    ContadorMaquina++;
                    EsperaInspeccion.Add(item);
                    EntraronInspeccion.Add(item);
                    EsperaPintura.Remove(item);
                    Inspeccion.Start();
                }
            }
            if (minutosPin == 5)
            {
                horasPin++;
                minutosPin = 0;
            }

            TerminadosPinNUD.Value = SalieronPintura.Count;

            if (ContadorMaquina == 20)
            {
                ContadorMaquina = 0;
                MaquinaPintura.Start();
                int d = MaquinaDamage.Next(1, 4);
                if (d == 1)
                {
                    MinutosMaquinaDañada = 30;
                }
                if (d == 2)
                {
                    MinutosMaquinaDañada = 45;
                }
                if (d == 3)
                {
                    MinutosMaquinaDañada = 60;
                }
            }
        }
Пример #2
0
        private void MaquinaPintura_Tick(object sender, EventArgs e)
        {
            SegundosMac++;
            string S = SegundosMac.ToString();
            string H = HorasMaq.ToString();
            string M = MinutosMaq.ToString();

            if (SegundosMac < 10)
            {
                S = "0" + SegundosMac;
            }
            if (HorasMaq < 10)
            {
                H = "0" + HorasMaq;
            }
            if (MinutosMaq < 10)
            {
                M = "0" + MinutosMaq;
            }

            TMDTb.Text = H + " : " + M + " : " + S;

            if (MinutosMaquinaDañada != 0)
            {
                Estado = "Dañada";
                Pintura.Stop();
            }

            else
            {
                Estado      = "En produccion";
                HorasMaq    = 0;
                SegundosMac = 0;
                MinutosMaq  = 0;
                TMDTb.Text  = string.Empty;
                Pintura.Start();
                MaquinaPintura.Stop();
            }

            if (SegundosMac == 60)
            {
                SegundosMac = 0;
                MinutosMaquinaDañada--;
                MinutosMaq++;
            }
            if (MinutosMaq == 5)
            {
                MinutosMaq = 0;
                HorasMaq++;
            }
        }
Пример #3
0
 private void button2_Click(object sender, EventArgs e)
 {
     TiempoGeneral.Stop();
     LlegadaPaquete.Stop();
     Carpintero1.Stop();
     Carpintero2.Stop();
     Carpintero3.Stop();
     Carpintero4.Stop();
     Carpintero5.Stop();
     Pintura.Stop();
     Almacen.Stop();
     Inspeccion.Stop();
     Empaquetar.Stop();
     MaquinaPintura.Stop();
 }