Ejemplo n.º 1
0
        private void St()
        {
            ronda = -1;
            int i = 0;

            while (true)
            {
                actual = tests[i];
                estado = Estado_PVA.Par;
                for (int k = 0; k < 6; k++)
                {
                    ronda++;
                    this.Paint(null, null);
                    Thread.Sleep(presentacion);
                }
                ronda  = -1;
                estado = Estado_PVA.Seis;
                for (int k = 0; k < 6; k++)
                {
                    ronda++;
                    Paint(null, null);
                    Thread.Sleep(muestra);
                }
                estado = Estado_PVA.Descanso;
                Thread.Sleep(descanso);
                ronda = -1;
                i++;
                if (i >= 3)
                {
                    i = 0;
                }
            }
        }
Ejemplo n.º 2
0
        private void St()
        {
            this.EnCurso = true;
            ronda        = -1;
            int      W   = this.control.Width;
            int      H   = this.control.Height;
            int      a_f = W / 4;
            int      a_c = 3 * W / 16;
            int      b_f = H / 5;
            Graphics g   = control.CreateGraphics();

            for (int i = 0; i < 3; i++)
            {
                if (i != 0)
                {
                    Thread.Sleep(descanso);
                }
                actual = tests[i];
                estado = Estado_PVA.Par;
                for (int k = 0; k < 6; k++)
                {
                    g.DrawImage(actual.matriz[actual.orden_mostrar[k]], W / 8, 2 * H / 5, a_f, b_f);
                    g.FillRectangle(new SolidBrush(actual.color[actual.orden_mostrar[k]]), 5 * W / 8, 2 * H / 5, W / 4, H / 5);
                    Thread.Sleep(presentacion);
                    g.Clear(Color.DimGray);
                }

                estado = Estado_PVA.Seis;
                for (int k = 0; k < 6; k++)
                {
                    ronda++;
                    g.DrawImage(actual.matriz[k], W / 8, 2 * H / 5, a_f, b_f);
                    g.FillRectangle(new SolidBrush(Colores[0]), W / 2, H / 10, a_c, H / 5);
                    g.FillRectangle(new SolidBrush(Colores[1]), 3 * W / 4, H / 10, a_c, H / 5);
                    g.FillRectangle(new SolidBrush(Colores[2]), W / 2, 4 * H / 10, a_c, H / 5);
                    g.FillRectangle(new SolidBrush(Colores[3]), 3 * W / 4, 4 * H / 10, a_c, H / 5);
                    g.FillRectangle(new SolidBrush(Colores[4]), W / 2, 7 * H / 10, a_c, H / 5);
                    g.FillRectangle(new SolidBrush(Colores[5]), 3 * W / 4, 7 * H / 10, a_c, H / 5);
                    Thread.Sleep(muestra);
                    g.Clear(Color.DimGray);
                }
                estado = Estado_PVA.Descanso;
                ronda  = -1;
            }
            this.EnCurso = false;
            int A = 0;

            for (int i = 0; i < tests.Length; i++)
            {
                A += tests[i].Aciertos;
            }
            Resultado = new Resultado_PVA(PVA_Type.PVA_1, this.codigoPaciente, A, DateTime.Now, true);
            var   f     = new Font(FontFamily.GenericSansSerif, 25, FontStyle.Bold);
            Brush brush = new SolidBrush(Color.LightYellow);

            g.DrawString("Ha terminado la prueba", f, brush, 40, 30);
        }
        private void cargar_imagenes(ImageSet listaPVA)
        {
            var img = new Image[6];

            for (int j = 0; j < 6; j++)
            {
                img[j] = listaPVA[j];
            }
            tests[0] = new Test_PVA(img, new[] { 2, 4, 1, 5, 0, 3 }, Colores);
            tests[1] = new Test_PVA(img, new[] { 0, 1, 5, 3, 2, 4 }, Colores);
            tests[2] = new Test_PVA(img, new[] { 4, 5, 3, 2, 0, 1 }, Colores);
        }