Esempio n. 1
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);
        }
 public override void Stop()
 {
     if (EnCurso)
     {
         int A = 0;
         for (int i = 0; i < tests.Length; i++)
         {
             A += tests[i].Aciertos;
         }
         Resultado = new Resultado_PVA(PVA_Type.PVA_2, this.codigoPaciente, A, DateTime.Now, false);
     }
     this.EnCurso = false;
     this.th.Abort();
 }
Esempio n. 3
0
        public override void Stop()
        {
            Graphics g = this.control.CreateGraphics();

            g.Clear(Color.DimGray);
            if (EnCurso)
            {
                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, false);
            }
            this.EnCurso = false;
            this.th.Abort();
            estado = Estado_PVA.Nulo;
        }