Merge pull request #406 from Ho-Ro/development-small-screen

smaller gui that fits completely on smaller screen, e.g.HD1280x720
pull/407/head
Holger Müller 2021-06-25 19:12:16 +02:00 zatwierdzone przez GitHub
commit 5d2de92709
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 39 dodań i 14 usunięć

Wyświetl plik

@ -32,13 +32,14 @@ class MarkerControl(QtWidgets.QGroupBox):
def __init__(self, app: QtWidgets.QWidget, title: str = "Markers"):
super().__init__()
self.app = app
self.setMaximumWidth(250)
self.setMaximumWidth(240)
self.setTitle(title)
self.layout = QtWidgets.QFormLayout(self)
marker_count = max(self.app.settings.value("MarkerCount", 3, int), 1)
for i in range(marker_count):
marker = Marker("", self.app.settings)
#marker.setFixedHeight(20)
marker.updated.connect(self.app.markerUpdated)
label, layout = marker.getRow()
self.layout.addRow(label, layout)
@ -51,6 +52,7 @@ class MarkerControl(QtWidgets.QGroupBox):
self.layout.addRow(self.check_delta)
self.showMarkerButton = QtWidgets.QPushButton()
self.showMarkerButton.setFixedHeight(20)
if self.app.marker_frame.isHidden():
self.showMarkerButton.setText("Show data")
else:

Wyświetl plik

@ -36,7 +36,7 @@ class SweepControl(QtWidgets.QGroupBox):
def __init__(self, app: QtWidgets.QWidget, title: str = "Sweep control"):
super().__init__()
self.app = app
self.setMaximumWidth(250)
self.setMaximumWidth(240)
self.setTitle(title)
control_layout = QtWidgets.QFormLayout(self)
@ -52,6 +52,7 @@ class SweepControl(QtWidgets.QGroupBox):
control_layout.addRow(input_layout)
self.input_start = FrequencyInputWidget()
self.input_start.setFixedHeight(20)
self.input_start.setMinimumWidth(60)
self.input_start.setAlignment(QtCore.Qt.AlignRight)
self.input_start.textEdited.connect(self.update_center_span)
@ -59,12 +60,14 @@ class SweepControl(QtWidgets.QGroupBox):
input_left_layout.addRow(QtWidgets.QLabel("Start"), self.input_start)
self.input_end = FrequencyInputWidget()
self.input_end.setFixedHeight(20)
self.input_end.setAlignment(QtCore.Qt.AlignRight)
self.input_end.textEdited.connect(self.update_center_span)
self.input_end.textChanged.connect(self.update_step_size)
input_left_layout.addRow(QtWidgets.QLabel("Stop"), self.input_end)
self.input_center = FrequencyInputWidget()
self.input_center.setFixedHeight(20)
self.input_center.setMinimumWidth(60)
self.input_center.setAlignment(QtCore.Qt.AlignRight)
self.input_center.textEdited.connect(self.update_start_end)
@ -72,6 +75,7 @@ class SweepControl(QtWidgets.QGroupBox):
input_right_layout.addRow(QtWidgets.QLabel("Center"), self.input_center)
self.input_span = FrequencyInputWidget()
self.input_span.setFixedHeight(20)
self.input_span.setAlignment(QtCore.Qt.AlignRight)
self.input_span.textEdited.connect(self.update_start_end)
@ -79,6 +83,7 @@ class SweepControl(QtWidgets.QGroupBox):
self.input_segments = QtWidgets.QLineEdit(self.app.settings.value("Segments", "1"))
self.input_segments.setAlignment(QtCore.Qt.AlignRight)
self.input_segments.setFixedHeight(20)
self.input_segments.setFixedWidth(60)
self.input_segments.textEdited.connect(self.update_step_size)
@ -91,6 +96,7 @@ class SweepControl(QtWidgets.QGroupBox):
control_layout.addRow(QtWidgets.QLabel("Segments"), segment_layout)
btn_settings_window = QtWidgets.QPushButton("Sweep settings ...")
btn_settings_window.setFixedHeight(20)
btn_settings_window.clicked.connect(
lambda: self.app.display_window("sweep_settings"))
@ -102,9 +108,11 @@ class SweepControl(QtWidgets.QGroupBox):
control_layout.addRow(self.progress_bar)
self.btn_start = QtWidgets.QPushButton("Sweep")
self.btn_start.setFixedHeight(20)
self.btn_start.clicked.connect(self.app.sweep_start)
self.btn_start.setShortcut(QtCore.Qt.Key_W | QtCore.Qt.CTRL)
self.btn_stop = QtWidgets.QPushButton("Stop")
self.btn_stop.setFixedHeight(20)
self.btn_stop.clicked.connect(self.app.sweep_stop)
self.btn_stop.setShortcut(QtCore.Qt.Key_Escape)
self.btn_stop.setDisabled(True)

Wyświetl plik

@ -87,6 +87,7 @@ class Marker(QtCore.QObject, Value):
self.name = f"Marker {Marker._instances}"
self.frequencyInput = FrequencyInput()
self.frequencyInput.setFixedHeight(20)
self.frequencyInput.setAlignment(QtCore.Qt.AlignRight)
self.frequencyInput.editingFinished.connect(
lambda: self.setFrequency(
@ -107,6 +108,7 @@ class Marker(QtCore.QObject, Value):
###############################################################
self.btnColorPicker = QtWidgets.QPushButton("")
self.btnColorPicker.setFixedHeight(20)
self.btnColorPicker.setFixedWidth(20)
self.btnColorPicker.clicked.connect(
lambda: self.setColor(QtWidgets.QColorDialog.getColor(

Wyświetl plik

@ -297,6 +297,7 @@ class NanoVNASaver(QtWidgets.QWidget):
self.windows["analysis"] = AnalysisWindow(self)
btn_show_analysis = QtWidgets.QPushButton("Analysis ...")
btn_show_analysis.setFixedHeight(20)
btn_show_analysis.clicked.connect(
lambda: self.display_window("analysis"))
self.marker_column.addWidget(btn_show_analysis)
@ -314,14 +315,16 @@ class NanoVNASaver(QtWidgets.QWidget):
tdr_control_box.setTitle("TDR")
tdr_control_layout = QtWidgets.QFormLayout()
tdr_control_box.setLayout(tdr_control_layout)
tdr_control_box.setMaximumWidth(250)
tdr_control_box.setMaximumWidth(240)
self.tdr_result_label = QtWidgets.QLabel()
self.tdr_result_label.setFixedHeight(20)
tdr_control_layout.addRow(
"Estimated cable length:", self.tdr_result_label)
self.tdr_button = QtWidgets.QPushButton(
"Time Domain Reflectometry ...")
self.tdr_button.setFixedHeight(20)
self.tdr_button.clicked.connect(lambda: self.display_window("tdr"))
tdr_control_layout.addRow(self.tdr_button)
@ -341,13 +344,15 @@ class NanoVNASaver(QtWidgets.QWidget):
###############################################################
reference_control_box = QtWidgets.QGroupBox()
reference_control_box.setMaximumWidth(250)
reference_control_box.setMaximumWidth(240)
reference_control_box.setTitle("Reference sweep")
reference_control_layout = QtWidgets.QFormLayout(reference_control_box)
btn_set_reference = QtWidgets.QPushButton("Set current as reference")
btn_set_reference.setFixedHeight(20)
btn_set_reference.clicked.connect(self.setReference)
self.btnResetReference = QtWidgets.QPushButton("Reset reference")
self.btnResetReference.setFixedHeight(20)
self.btnResetReference.clicked.connect(self.resetReference)
self.btnResetReference.setDisabled(True)
@ -361,29 +366,33 @@ class NanoVNASaver(QtWidgets.QWidget):
###############################################################
serial_control_box = QtWidgets.QGroupBox()
serial_control_box.setMaximumWidth(250)
serial_control_box.setMaximumWidth(240)
serial_control_box.setTitle("Serial port control")
serial_control_layout = QtWidgets.QFormLayout(serial_control_box)
self.serialPortInput = QtWidgets.QComboBox()
self.serialPortInput.setFixedHeight(20)
self.rescanSerialPort()
self.serialPortInput.setEditable(True)
btn_rescan_serial_port = QtWidgets.QPushButton("Rescan")
btn_rescan_serial_port.setFixedWidth(65)
btn_rescan_serial_port.setFixedHeight(20)
btn_rescan_serial_port.setFixedWidth(60)
btn_rescan_serial_port.clicked.connect(self.rescanSerialPort)
serial_port_input_layout = QtWidgets.QHBoxLayout()
serial_port_input_layout.addWidget(self.serialPortInput)
serial_port_input_layout.addWidget(btn_rescan_serial_port)
serial_control_layout.addRow(
QtWidgets.QLabel("Serial port"), serial_port_input_layout)
serial_port_input_layout.addWidget(QtWidgets.QLabel("Port"), stretch=0)
serial_port_input_layout.addWidget(self.serialPortInput, stretch=1)
serial_port_input_layout.addWidget(btn_rescan_serial_port, stretch=0)
serial_control_layout.addRow(serial_port_input_layout)
serial_button_layout = QtWidgets.QHBoxLayout()
self.btnSerialToggle = QtWidgets.QPushButton("Connect to device")
self.btnSerialToggle.setFixedHeight(20)
self.btnSerialToggle.clicked.connect(self.serialButtonClick)
serial_button_layout.addWidget(self.btnSerialToggle, stretch=1)
self.btnDeviceSettings = QtWidgets.QPushButton("Manage")
self.btnDeviceSettings.setFixedWidth(65)
self.btnDeviceSettings.setFixedHeight(20)
self.btnDeviceSettings.setFixedWidth(60)
self.btnDeviceSettings.clicked.connect(
lambda: self.display_window("device_settings"))
serial_button_layout.addWidget(self.btnDeviceSettings, stretch=0)
@ -395,6 +404,7 @@ class NanoVNASaver(QtWidgets.QWidget):
###############################################################
btnOpenCalibrationWindow = QtWidgets.QPushButton("Calibration ...")
btnOpenCalibrationWindow.setFixedHeight(20)
self.calibrationWindow = CalibrationWindow(self)
btnOpenCalibrationWindow.clicked.connect(
lambda: self.display_window("calibration"))
@ -404,19 +414,22 @@ class NanoVNASaver(QtWidgets.QWidget):
###############################################################
btn_display_setup = QtWidgets.QPushButton("Display setup ...")
btn_display_setup.setMaximumWidth(250)
btn_display_setup.setFixedHeight(20)
btn_display_setup.setMaximumWidth(240)
btn_display_setup.clicked.connect(
lambda: self.display_window("setup"))
btn_about = QtWidgets.QPushButton("About ...")
btn_about.setMaximumWidth(250)
btn_about.setFixedHeight(20)
btn_about.setMaximumWidth(240)
btn_about.clicked.connect(
lambda: self.display_window("about"))
btn_open_file_window = QtWidgets.QPushButton("Files")
btn_open_file_window.setMaximumWidth(250)
btn_open_file_window.setFixedHeight(20)
btn_open_file_window.setMaximumWidth(240)
btn_open_file_window.clicked.connect(
lambda: self.display_window("file"))