Example #1
0
        public byte ServirBebida(Bebida miBebida)
        {
            Form2 form2 = new Form2();

            form2.Show();
            for (int i = 0; i < 2; i++)
            {
                switch (contadorBombas)
                {
                case 0:
                    int[] bomba1 = { 1, 1, miBebida.CantidadAlcohol };
                    for (int j = 0; j < 2; j++)
                    {
                        serialPort.Write(bomba1[i].ToString());
                    }
                    Thread.Sleep(1000);
                    break;

                case 1:
                    int[] bomba2 = { 1, 2, miBebida.CantidadRefresco };
                    for (int j = 0; j < 2; j++)
                    {
                        serialPort.Write(bomba2[i].ToString());
                    }
                    Thread.Sleep(1000);
                    break;

                case 2:
                    int[] bomba3 = { 1, 3, miBebida.CantidadAgua };
                    for (int j = 0; j < 2; j++)
                    {
                        serialPort.Write(bomba3[i].ToString());
                    }
                    Thread.Sleep(1000);
                    break;
                }
            }
            contadorBombas = 0;
            form2.Hide();
            return(1);
        }
Example #2
0
 private void cmbBebida_SelectedIndexChanged(object sender, EventArgs e)
 {
     nuevaBebida     = (Bebida)ListaDeBebidas[cmbBebida.SelectedIndex];
     gpbPorcion.Text = nuevaBebida.Alcohol;
     Ingredientes();
 }