コード例 #1
0
        public FormTR(string codigoPaciente, Color color_target, Color color_target1, int estimulos, int visualizacion, int reaccion, int tecla_reaccion, int tecla_reaccion1, TiempoReaccion.Figura figura)
        {
            random               = new Random(Environment.TickCount);
            this.g               = this.CreateGraphics();
            this.back            = this.BackColor;
            this.tecla_reaccion  = tecla_reaccion;
            this.tecla_reaccion1 = tecla_reaccion1;
            this.figura          = figura;
            this.codigoPaciente  = codigoPaciente;

            InitializeComponent();
            //Dimensiones de la pantalla
            Rectangle rect = Screen.PrimaryScreen.Bounds;

            //Poniendo las dimensiones de la ventana
            //del tamaño de la pantalla
            this.Height           = rect.Height;
            this.Width            = rect.Width;
            this.panel1.Width     = this.Width / 2;
            this.panel1.Height    = this.Width / 2;
            this.panel1.Location  = new Point((Screen.PrimaryScreen.Bounds.Width - this.panel1.Width) / 2, (Screen.PrimaryScreen.Bounds.Height - this.panel1.Height) / 2);
            this.panel1.BackColor = this.BackColor;

            ass = new TiempoReaccion(null, color_target, color_target1, estimulos, visualizacion, reaccion);
            timer_muestra.Interval = visualizacion;
            p    = new Point[3];
            p[0] = new Point(0, this.panel1.Height);
            p[1] = new Point(this.panel1.Height, this.panel1.Width);
            p[2] = new Point(this.panel1.Width / 2, 0);
            timer_muestra.Start();
        }
コード例 #2
0
        private void Predeterminados_Click(object sender, EventArgs e)
        {
            this.fig_aux   = TiempoReaccionSimple.PFigura;
            this.color_aux = TiempoReaccionSimple.PColor1;
            this.numericUpDownCantEstimulos.Value = new decimal(TiempoReaccionSimple.PMaxEstimulos);
            this.numericUpDownVisualizacion.Value = new decimal(TiempoReaccionSimple.PTiempoVisualizacion);
            this.numericUpDownReaccion.Value      = new decimal(TiempoReaccionSimple.PTiempoReaccion);
            this.comboBoxTecla1.Text = TiempoReaccionSimple.PTecla1;

            this.panelColor.BackColor = color_aux;

            this.pictureBox1.Refresh();

            if (AfterPresets != null)
            {
                AfterPresets(sender, e);
            }
        }
コード例 #3
0
        private void comboBoxFigura_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (this.comboBoxFigura1.Text)
            {
            case "Círculo":
                fig_aux = TiempoReaccion.Figura.Circulo;
                break;

            case "Cuadrado":
                fig_aux = TiempoReaccion.Figura.Cuadrado;
                break;

            case "Triángulo":
                fig_aux = TiempoReaccion.Figura.Triangulo;
                break;

            default:
                break;
            }
            this.pictureBox1.Refresh();
        }