private void timer_muestra_Tick(object sender, EventArgs e) { if (ass.count == this.bloques * 100 && ass.hide) { if (ass.miliseg != 0) { ass.omisiones[(ass.count - 1) / 100]++; } if (!ensayo) { ass.Calcula_estadistica(); Resultado = new Resultado_ASS(this.codigo_paciente, ass.omisiones, ass.equivocaciones, ass.aciertos, ass.aciertos_ext, ass.medias_tr, ass.desviaciones_tr, ass.tiempos, DateTime.Now, true, this.tipo_estimulo); } this.Dispose(); } else { if (ass.hide == false) { panel.BackgroundImage = null; ass.hide = true; timer_muestra.Interval = ocultamiento; } else { bool omision = false; if (ass.miliseg > 0) { omision = true; ass.omisiones[(ass.count - 1) / 100]++; ass.miliseg = 0; if (ensayo) { Feedback.Show(); Feedback.Text = "Estimulo no reconocido"; } } this.panel.BackgroundImage = imagen[ass.secuencia_imagen[ass.count]]; ass.count++; ass.hide = false; ass.activo = true; if (ass.secuencia[ass.count - 1]) { ass.miliseg = DateTime.Now.Millisecond + DateTime.Now.Second * 1000 + DateTime.Now.Minute * 60000 + DateTime.Now.Hour * 3600000; } timer_muestra.Interval = visualizacion; if (ensayo && !omision) { Feedback.Hide(); } } } }
private void FormASSL_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == this.tecla_reaccion) { KeyHasBeenPressed(); if (ass.miliseg > 0) { int x = DateTime.Now.Millisecond + DateTime.Now.Second * 1000 + DateTime.Now.Minute * 60000 + DateTime.Now.Hour * 3600000; ass.click(x, 0); if (ensayo) { Feedback.Show(); Feedback.Text = @"Acierto"; } } else if (ass.activo) { ass.click(0, 0); if (ensayo) { Feedback.Show(); Feedback.Text = @"Error"; } } } if (e.KeyValue == 27 && ass.count > 0) { if (!ensayo) { ass.Calcula_estadistica(); Resultado = new Resultado_ASS(this.codigo_paciente, ass.omisiones, ass.equivocaciones, ass.aciertos, ass.aciertos_ext, ass.medias_tr, ass.desviaciones_tr, ass.tiempos, DateTime.Now, false, TypeOf_AS_Test.H_Letras); } this.Dispose(); } }