Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
test_gonogo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Laura Rodríguez
test_gonogo
Commits
582be682
Commit
582be682
authored
Jun 20, 2025
by
Laura Rodríguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20 jun
parent
d5edbda4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
13 deletions
+51
-13
test_final.py
+51
-13
No files found.
test_final.py
View file @
582be682
...
@@ -274,7 +274,7 @@ def run_pro_nogo_test(self):
...
@@ -274,7 +274,7 @@ def run_pro_nogo_test(self):
print
(
"Test interrumpido por el usuario con la tecla 'E'."
)
print
(
"Test interrumpido por el usuario con la tecla 'E'."
)
finally
:
finally
:
log
.
close
()
log
.
close
()
self
.
tracker
.
close
()
self
.
disp
.
close
()
self
.
disp
.
close
()
print
(
"Test Go/NoGo finalizado."
)
print
(
"Test Go/NoGo finalizado."
)
...
@@ -448,7 +448,7 @@ def run_pr_as_test(self):
...
@@ -448,7 +448,7 @@ def run_pr_as_test(self):
print
(
"Test interrumpido por el usuario con la tecla 'E'."
)
print
(
"Test interrumpido por el usuario con la tecla 'E'."
)
finally
:
finally
:
log
.
close
()
log
.
close
()
self
.
tracker
.
close
()
self
.
disp
.
close
()
self
.
disp
.
close
()
print
(
"Test Pro/AS finalizado."
)
print
(
"Test Pro/AS finalizado."
)
...
@@ -778,7 +778,7 @@ def run_bateria_test(self):
...
@@ -778,7 +778,7 @@ def run_bateria_test(self):
arrow_pos
=
CENTER
arrow_pos
=
CENTER
arrow_pos_above
=
(
arrow_pos
[
0
],
arrow_pos
[
1
]
-
arrow_offset
)
arrow_pos_above
=
(
arrow_pos
[
0
],
arrow_pos
[
1
]
-
arrow_offset
)
arrow_screen
.
draw_text
(
text
=
'
<------->
'
,
fontsize
=
60
,
pos
=
arrow_pos_above
,
colour
=
arrow_color
,
center
=
True
)
arrow_screen
.
draw_text
(
text
=
'
Mire aquí
'
,
fontsize
=
60
,
pos
=
arrow_pos_above
,
colour
=
arrow_color
,
center
=
True
)
self
.
disp
.
fill
(
arrow_screen
)
self
.
disp
.
fill
(
arrow_screen
)
self
.
disp
.
show
()
self
.
disp
.
show
()
...
@@ -849,7 +849,7 @@ def run_bateria_test(self):
...
@@ -849,7 +849,7 @@ def run_bateria_test(self):
print
(
"Test interrumpido por el usuario con la tecla 'E'."
)
print
(
"Test interrumpido por el usuario con la tecla 'E'."
)
finally
:
finally
:
log
.
close
()
log
.
close
()
self
.
tracker
.
close
()
self
.
disp
.
close
()
self
.
disp
.
close
()
print
(
"Test Go/NoGo finalizado."
)
print
(
"Test Go/NoGo finalizado."
)
...
@@ -893,6 +893,25 @@ class EyeTrackingApp(QWidget):
...
@@ -893,6 +893,25 @@ class EyeTrackingApp(QWidget):
padding-bottom: 9px;
padding-bottom: 9px;
}
}
"""
"""
violet_button_style
=
"""
QPushButton {
background-color: #8a2be2; /* color violeta */
color: white;
padding: 10px;
border-radius: 5px;
font-weight: bold;
}
QPushButton:hover {
background-color: #6a1abf;
color: #e6d7ff;
}
QPushButton:pressed {
background-color: #4a1090;
color: #ccbbff;
padding-top: 11px;
padding-bottom: 9px;
}
"""
green_button_style
=
"""
green_button_style
=
"""
QPushButton {
QPushButton {
...
@@ -1075,20 +1094,17 @@ class EyeTrackingApp(QWidget):
...
@@ -1075,20 +1094,17 @@ class EyeTrackingApp(QWidget):
"""
"""
main_layout
=
QVBoxLayout
()
main_layout
=
QVBoxLayout
()
main_layout
.
setContentsMargins
(
20
,
20
,
20
,
20
)
# margen alrededor del layout principal
main_layout
.
setContentsMargins
(
20
,
20
,
20
,
20
)
# Título centrado
title
=
QLabel
(
"EYETRACKING"
)
title
=
QLabel
(
"EYETRACKING"
)
title
.
setFont
(
QFont
(
"Arial"
,
44
,
QFont
.
Weight
.
Bold
))
title
.
setFont
(
QFont
(
"Arial"
,
44
,
QFont
.
Weight
.
Bold
))
title
.
setAlignment
(
Qt
.
AlignmentFlag
.
AlignCenter
)
title
.
setAlignment
(
Qt
.
AlignmentFlag
.
AlignCenter
)
main_layout
.
addWidget
(
title
)
main_layout
.
addWidget
(
title
)
# Grid layout para botones (2 columnas)
grid
=
QGridLayout
()
grid
=
QGridLayout
()
grid
.
setHorizontalSpacing
(
30
)
# espacio horizontas entre botones
grid
.
setHorizontalSpacing
(
30
)
grid
.
setVerticalSpacing
(
20
)
# espacio vertical entre botones
grid
.
setVerticalSpacing
(
20
)
# Crear botones
btn_linea
=
QPushButton
(
"Línea de calibración"
)
btn_linea
=
QPushButton
(
"Línea de calibración"
)
btn_linea
.
setFont
(
QFont
(
"Arial"
,
14
))
btn_linea
.
setFont
(
QFont
(
"Arial"
,
14
))
btn_linea
.
setStyleSheet
(
green_button_style
)
btn_linea
.
setStyleSheet
(
green_button_style
)
...
@@ -1104,7 +1120,6 @@ class EyeTrackingApp(QWidget):
...
@@ -1104,7 +1120,6 @@ class EyeTrackingApp(QWidget):
btn_battery
.
setStyleSheet
(
blue_button_style
)
btn_battery
.
setStyleSheet
(
blue_button_style
)
btn_battery
.
clicked
.
connect
(
self
.
start_test0
)
btn_battery
.
clicked
.
connect
(
self
.
start_test0
)
btn_pronogo
=
QPushButton
(
"Test Go/NoGo"
)
btn_pronogo
=
QPushButton
(
"Test Go/NoGo"
)
btn_pronogo
.
setFont
(
QFont
(
"Arial"
,
14
))
btn_pronogo
.
setFont
(
QFont
(
"Arial"
,
14
))
btn_pronogo
.
setStyleSheet
(
green_yellow_button_style
)
btn_pronogo
.
setStyleSheet
(
green_yellow_button_style
)
...
@@ -1122,16 +1137,33 @@ class EyeTrackingApp(QWidget):
...
@@ -1122,16 +1137,33 @@ class EyeTrackingApp(QWidget):
btn_results
=
QPushButton
(
"Consultar resultados"
)
btn_results
=
QPushButton
(
"Consultar resultados"
)
btn_results
.
setFont
(
QFont
(
"Arial"
,
14
))
btn_results
.
setFont
(
QFont
(
"Arial"
,
14
))
btn_results
.
setStyleSheet
(
dark_yellow_button_style
)
btn_results
.
setStyleSheet
(
dark_yellow_button_style
)
btn_results
.
clicked
.
connect
(
self
.
view_results
)
btn_results
.
clicked
.
connect
(
self
.
view_results
)
btn_cerrar
=
QPushButton
(
"Cerrar todo"
)
btn_cerrar
.
setFont
(
QFont
(
"Arial"
,
14
))
btn_cerrar
.
setStyleSheet
(
violet_button_style
)
btn_cerrar
.
clicked
.
connect
(
self
.
cerrar_todo
)
# Botones para la cuadrícula excepto "Cerrar todo"
botones
=
[
btn_linea
,
btn_calibrate
,
btn_battery
,
btn_pronogo
,
btn_proas
,
btn_cs_task
,
btn_results
]
botones
=
[
btn_linea
,
btn_calibrate
,
btn_battery
,
btn_pronogo
,
btn_proas
,
btn_cs_task
,
btn_results
]
# Añadimos los botones (2 columnas)
for
i
,
boton
in
enumerate
(
botones
):
for
i
,
boton
in
enumerate
(
botones
):
row
=
i
//
2
# 2 columnas
row
=
i
//
2
col
=
i
%
2
col
=
i
%
2
grid
.
addWidget
(
boton
,
row
,
col
)
grid
.
addWidget
(
boton
,
row
,
col
)
# Ahora colocamos el botón "Cerrar todo" en la última fila, columna 1 (derecha)
last_button_index
=
len
(
botones
)
-
1
last_row
=
last_button_index
//
2
last_col
=
last_button_index
%
2
grid
.
addWidget
(
btn_cerrar
,
last_row
,
last_col
+
1
)
main_layout
.
addLayout
(
grid
)
self
.
setLayout
(
main_layout
)
main_layout
.
addLayout
(
grid
)
main_layout
.
addLayout
(
grid
)
self
.
setLayout
(
main_layout
)
self
.
setLayout
(
main_layout
)
...
@@ -1195,6 +1227,12 @@ class EyeTrackingApp(QWidget):
...
@@ -1195,6 +1227,12 @@ class EyeTrackingApp(QWidget):
else
:
else
:
QMessageBox
.
warning
(
self
,
"Archivo no encontrado"
,
"El archivo de resultados no existe."
)
QMessageBox
.
warning
(
self
,
"Archivo no encontrado"
,
"El archivo de resultados no existe."
)
def
cerrar_todo
(
self
):
# Aquí puedes hacer limpieza antes de cerrar si fuera necesario
print
(
"Cerrando todo y saliendo..."
)
self
.
close
()
# Cierra la ventana principal
QApplication
.
quit
()
# Termina la aplicación
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
app
=
QApplication
(
sys
.
argv
)
app
=
QApplication
(
sys
.
argv
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment