Merge branch 'main' into calibration

This commit is contained in:
wendtalexander 2024-09-30 10:13:48 +02:00
commit c33e4cc32f
9 changed files with 7 additions and 20 deletions

View File

@ -10,6 +10,7 @@ import resources
log = config_logging()
from . import resources # best created with pyside6-rcc resources.qrc -o resources.py (rcc produces an error...)
def main():
app = QApplication(sys.argv)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -5,5 +5,6 @@
<file>icons/disconnect.png</file>
<file>icons/record.png</file>
<file>icons/stop.png</file>
<file>icons/relacstuxheader.png</file>
</qresource>
</RCC>

View File

@ -1,5 +1,3 @@
import pathlib
from PyQt6.QtGui import QPixmap
from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QLabel, QVBoxLayout, QWidget
from PyQt6.QtCore import Qt
@ -40,8 +38,7 @@ class About(QWidget):
rtd_link.setAlignment(Qt.AlignmentFlag.AlignCenter)
iconlabel = QLabel()
_root = pathlib.Path(__file__).parent.parent
pixmap = QPixmap(str(pathlib.Path.joinpath(_root, "icons/relacstuxheader.png")))
pixmap = QPixmap(":/icons/relacstuxheader.png")
s = pixmap.size()
new_height = int(s.height() * 300/s.width())
pixmap = pixmap.scaled(300, new_height, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.FastTransformation)

View File

@ -70,9 +70,7 @@ class PyRelacs(QMainWindow):
self.nix_file = nix.File.open(str(filename), nix.FileMode.ReadWrite)
def create_actions(self):
self._rlx_exitaction = QAction(
QIcon(str(path.joinpath(_root, "icons/exit.png"))), "Exit", self
)
self._rlx_exitaction = QAction(QIcon(":/icons/exit.png"), "Exit", self)
self._rlx_exitaction.setStatusTip("Close relacs")
self._rlx_exitaction.setShortcut(QKeySequence("Alt+q"))
self._rlx_exitaction.triggered.connect(self.on_exit)
@ -82,27 +80,17 @@ class PyRelacs(QMainWindow):
self._rlx_aboutaction.setEnabled(True)
self._rlx_aboutaction.triggered.connect(self.on_about)
self._daq_connectaction = QAction(
QIcon(str(path.joinpath(_root, "icons/connect.png"))), "Connect DAQ", self
)
self._daq_connectaction = QAction(QIcon(":icons/connect.png"), "Connect DAQ", self)
self._daq_connectaction.setStatusTip("Connect to daq device")
# self._daq_connectaction.setShortcut(QKeySequence("Alt+d"))
self._daq_connectaction.triggered.connect(self.connect_dac)
self._daq_disconnectaction = QAction(
QIcon(str(path.joinpath(_root, "icons/disconnect.png"))),
"Disconnect DAQ",
self,
)
self._daq_disconnectaction = QAction(QIcon(":/icons/disconnect.png"), "Disconnect DAQ", self)
self._daq_disconnectaction.setStatusTip("Disconnect the DAQ device")
# self._daq_connectaction.setShortcut(QKeySequence("Alt+d"))
self._daq_disconnectaction.triggered.connect(self.disconnect_dac)
self._daq_calibaction = QAction(
QIcon(str(path.joinpath(_root, "icons/calibration.png"))),
"Plot calibration",
self,
)
self._daq_calibaction = QAction(QIcon(":/icons/calibration.png"), "Plot calibration", self)
self._daq_calibaction.setStatusTip("Calibrate the attenuator device")
# self._daq_calibaction.setShortcut(QKeySequence("Alt+d"))
self._daq_calibaction.triggered.connect(self.plot_calibration)