Skip to content
Snippets Groups Projects
Commit 27e1643c authored by Simon Bjurek's avatar Simon Bjurek
Browse files

Merge branch 'finalize-earliest-deadline-first' of gitlab.liu.se:da/B-ASIC into add-fft-generator

parents 973c6ec3 127a5687
No related branches found
No related tags found
No related merge requests found
Pipeline #155354 passed
......@@ -36,51 +36,45 @@ before_script:
path: cov.xml
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
run-test-3.10-pyside2:
run-test-3.10-pyqt6:
variables:
QT_API: pyside2
QT_API: pyqt6
image: python:3.10
extends: ".run-test"
run-test-3.10-pyqt5:
run-test-3.10-pyside6:
variables:
QT_API: pyqt5
QT_API: pyside6
image: python:3.10
extends: ".run-test"
run-test-3.10-pyqt6:
run-test-3.11-pyqt6:
variables:
QT_API: pyqt6
image: python:3.10
extends: ".run-test"
run-test-3.11-pyqt5:
variables:
QT_API: pyqt5
image: python:3.11
extends: ".run-test"
run-test-3.11-pyqt6:
run-test-3.11-pyside6:
variables:
QT_API: pyqt6
QT_API: pyside6
image: python:3.11
extends: ".run-test"
run-test-3.12-pyqt5:
run-test-3.12-pyqt6:
variables:
QT_API: pyqt5
QT_API: pyqt6
image: python:3.12
extends: ".run-test"
run-test-3.12-pyqt6:
run-test-3.12-pyside6:
variables:
QT_API: pyqt6
QT_API: pyside6
image: python:3.12
extends: ".run-test"
run-vhdl-tests:
variables:
QT_API: pyqt5
QT_API: pyqt6
image: python:3.10
stage: test
script:
......@@ -92,7 +86,7 @@ run-vhdl-tests:
run-doc-test:
variables:
QT_API: pyside2
QT_API: pyside6
image: python:3.10
stage: test
script:
......@@ -111,7 +105,7 @@ run-doc-test:
pages:
variables:
QT_API: pyqt5
QT_API: pyqt6
stage: deploy
image: python:3.10
script:
......
......@@ -14,7 +14,7 @@ How to build and debug the library during development.
The following packages are required in order to build the library:
- [Python](https://python.org/) 3.8+
- [Python](https://python.org/) 3.10+
- Python dependencies (install with `pip install -r requirements.txt` or they will be installed as part of the
installation process):
- [Graphviz](https://graphviz.org/)
......
......@@ -2,7 +2,7 @@
"""
B-ASIC Scheduler-gui Resource and Form Compiler Module.
Compile Qt5 resource and form files. Requires PySide2 or PyQt5 to be installed.
Compile Qt6 resource and form files. Requires PySide6 or PyQt6 to be installed.
If no arguments is given, the compiler search for and compiles all form (.ui)
files.
"""
......@@ -160,45 +160,13 @@ def compile_ui(*filenames: str) -> None:
directory = directory if directory else "."
outfile = f"{directory}/ui_{file}.py"
if uic.PYSIDE2:
uic_ = shutil.which("pyside2-uic")
arguments = f"-g python -o {outfile} {filename}"
if uic_ is None:
uic_ = shutil.which("uic")
if uic_ is None:
uic_ = shutil.which("pyuic5")
arguments = f"-o {outfile} {filename}"
assert uic_, (
"Qt User Interface Compiler failed, cannot find pyside2-uic,"
" uic, or pyuic5"
)
os_ = sys.platform
if os_.startswith("linux"): # Linux
cmd = f"{uic_} {arguments}"
subprocess.call(cmd.split())
elif os_.startswith("win32"): # Windows
# TODO: implement
log.error("Windows UI compiler not implemented")
raise NotImplementedError
elif os_.startswith("darwin"): # macOS
# TODO: implement
log.error("macOS UI compiler not implemented")
raise NotImplementedError
else: # other OS
log.error(f"{os_} UI compiler not supported")
raise NotImplementedError
elif uic.PYQT5 or uic.PYQT6:
if uic.PYQT6:
from qtpy.uic import compileUi
with open(outfile, "w") as ofile:
compileUi(filename, ofile)
elif uic.PYQT6:
elif uic.PYSIDE6:
uic_ = shutil.which("pyside6-uic")
arguments = f"-g python -o {outfile} {filename}"
......@@ -218,9 +186,8 @@ def compile_ui(*filenames: str) -> None:
subprocess.call(cmd.split())
elif os_.startswith("win32"): # Windows
# TODO: implement
log.error("Windows UI compiler not implemented")
raise NotImplementedError
cmd = f"{uic_} {arguments}"
subprocess.call(cmd.split())
elif os_.startswith("darwin"): # macOS
# TODO: implement
......
......@@ -98,9 +98,9 @@ if __debug__:
log.debug(f"Qt version (compile time): {QtCore.__version__}")
log.debug(f"QT_API: {QT_API}")
if QT_API.lower().startswith("pyside"):
import PySide2
import PySide6
log.debug(f"PySide version: {PySide2.__version__}")
log.debug(f"PySide version: {PySide6.__version__}")
if QT_API.lower().startswith("pyqt"):
from qtpy.QtCore import PYQT_VERSION_STR
......@@ -1689,17 +1689,19 @@ def start_scheduler(schedule: Optional[Schedule] = None) -> Optional[Schedule]:
"""
if not QApplication.instance():
app = QApplication(sys.argv)
# Enforce a light palette regardless of laptop theme
palette = QPalette()
palette.setColor(QPalette.ColorRole.Window, QtCore.Qt.white)
palette.setColor(QPalette.ColorRole.WindowText, QtCore.Qt.black)
palette.setColor(QPalette.ColorRole.ButtonText, QtCore.Qt.black)
palette.setColor(QPalette.ColorRole.Base, QtCore.Qt.white)
palette.setColor(QPalette.ColorRole.AlternateBase, QtCore.Qt.lightGray)
palette.setColor(QPalette.ColorRole.Text, QtCore.Qt.black)
app.setPalette(palette)
else:
app = QApplication.instance()
# Enforce a light palette regardless of laptop theme
palette = QPalette()
palette.setColor(QPalette.ColorRole.Window, QtCore.Qt.white)
palette.setColor(QPalette.ColorRole.WindowText, QtCore.Qt.black)
palette.setColor(QPalette.ColorRole.ButtonText, QtCore.Qt.black)
palette.setColor(QPalette.ColorRole.Base, QtCore.Qt.white)
palette.setColor(QPalette.ColorRole.AlternateBase, QtCore.Qt.lightGray)
palette.setColor(QPalette.ColorRole.Text, QtCore.Qt.black)
app.setPalette(palette)
window = ScheduleMainWindow()
if schedule:
window.open(schedule)
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment