diff --git a/requirements.txt b/requirements.txt index 117598135e..1d189ba477 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ pyserial PyQt5 PyQtWebEngine pyqtgraph +PyOpenGL unidecode matplotlib distro diff --git a/sw/supervision/python/Readme.md b/sw/supervision/python/Readme.md index 6ec617f025..9cbd19788b 100644 --- a/sw/supervision/python/Readme.md +++ b/sw/supervision/python/Readme.md @@ -8,3 +8,7 @@ Install the package `pyqt5-dev-tools` and run `make` to generate python ui files Install python dependencies: `python3 -m pip install -r requirements.txt` + + +Install `qttools5-dev-tools` to edit the UI files with Qt5 Designer. + diff --git a/sw/supervision/python/generated/ui_conf_header.py b/sw/supervision/python/generated/ui_conf_header.py index f4ce236aa8..cab1156edf 100644 --- a/sw/supervision/python/generated/ui_conf_header.py +++ b/sw/supervision/python/generated/ui_conf_header.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'ui/ui_conf_header.ui' # -# Created by: PyQt5 UI code generator 5.15.6 +# Created by: PyQt5 UI code generator 5.15.10 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. @@ -33,6 +33,7 @@ class Ui_ConfHeader(object): sizePolicy.setHeightForWidth(self.ac_combo.sizePolicy().hasHeightForWidth()) self.ac_combo.setSizePolicy(sizePolicy) self.ac_combo.setEditable(False) + self.ac_combo.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents) self.ac_combo.setObjectName("ac_combo") self.horizontalLayout.addWidget(self.ac_combo) self.menu_button = QtWidgets.QToolButton(ConfHeader) @@ -61,6 +62,7 @@ class Ui_ConfHeader(object): self.label_4.setObjectName("label_4") self.horizontalLayout.addWidget(self.label_4) self.set_combo = QtWidgets.QComboBox(ConfHeader) + self.set_combo.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents) self.set_combo.setObjectName("set_combo") self.horizontalLayout.addWidget(self.set_combo) self.new_ac_action = QtWidgets.QAction(ConfHeader) diff --git a/sw/supervision/python/mag_viewer.py b/sw/supervision/python/mag_viewer.py index 9dbf374dc9..5173b07922 100644 --- a/sw/supervision/python/mag_viewer.py +++ b/sw/supervision/python/mag_viewer.py @@ -16,7 +16,7 @@ try: from pprzlink.message import PprzMessage from pprz_connect import PprzConnect, PprzConfig - import calibration_utils + class MagViewer(QtWidgets.QWidget): @@ -169,6 +169,7 @@ try: self.gl_widget.setCameraPosition(distance=self.mean_norm*5) def calibrate(self): + import calibration_utils calib_text = "" try: p0 = calibration_utils.get_min_max_guess(self.mag_data, 1.) diff --git a/sw/supervision/python/paparazzicenter.py b/sw/supervision/python/paparazzicenter.py index 120271af72..6a814f8d16 100755 --- a/sw/supervision/python/paparazzicenter.py +++ b/sw/supervision/python/paparazzicenter.py @@ -69,7 +69,7 @@ class PprzCenter(QMainWindow, Ui_SupervisionWindow): self.resize(window_size) self.configuration_panel.init() self.operation_panel.session.init() - self.header.update_sets() + QtCore.QTimer.singleShot(100, self.header.update_sets) def programs_state_changed(self, state: TabProgramsState, tab_index): self.tabwidget.setTabIcon(tab_index, TAB_ICONS[state]) diff --git a/sw/supervision/python/ui/ui_conf_header.ui b/sw/supervision/python/ui/ui_conf_header.ui index 41b5ce2eb4..d061911a74 100644 --- a/sw/supervision/python/ui/ui_conf_header.ui +++ b/sw/supervision/python/ui/ui_conf_header.ui @@ -42,6 +42,9 @@ false + + QComboBox::AdjustToContents + @@ -113,7 +116,11 @@ - + + + QComboBox::AdjustToContents + +