forked from DEIS-Tools/DistributedExercisesAAU
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise_runner_overlay.py
More file actions
37 lines (30 loc) · 1.18 KB
/
exercise_runner_overlay.py
File metadata and controls
37 lines (30 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from exercise_runner import run_exercise
from PyQt6.QtWidgets import QApplication, QWidget, QLineEdit, QVBoxLayout, QPushButton, QHBoxLayout, QLabel
from PyQt6.QtGui import QIcon
from sys import argv
app = QApplication(argv)
windows = list()
window = QWidget()
window.setWindowIcon(QIcon('icon.ico'))
window.setWindowTitle("Distributed Exercises AAU")
main = QVBoxLayout()
window.setFixedSize(600, 100)
start_button = QPushButton("start")
main.addWidget(start_button)
input_area_labels = QHBoxLayout()
input_area_areas = QHBoxLayout()
actions = {'Lecture':[print, 0], 'Algorithm': [print, 'PingPong'], 'Type': [print, 'stepping'], 'Devices': [print, 3]}
for action in actions.items():
input_area_labels.addWidget(QLabel(action[0]))
field = QLineEdit()
input_area_areas.addWidget(field)
field.setText(str(action[1][1]))
actions[action[0]][0] = field.text
main.addLayout(input_area_labels)
main.addLayout(input_area_areas)
def start_exercise():
windows.append(run_exercise(int(actions['Lecture'][0]()), actions['Algorithm'][0](), actions['Type'][0](), int(actions['Devices'][0]())))
start_button.clicked.connect(start_exercise)
window.setLayout(main)
window.show()
app.exec()