diff --git a/NanoVNASaver/Calibration.py b/NanoVNASaver/Calibration.py index 6b54eac..1a5795d 100644 --- a/NanoVNASaver/Calibration.py +++ b/NanoVNASaver/Calibration.py @@ -64,11 +64,11 @@ class CalibrationWindow(QtWidgets.QWidget): btn_cal_short = QtWidgets.QPushButton("Short") btn_cal_short.clicked.connect(self.saveShort) self.cal_short_label = QtWidgets.QLabel("Uncalibrated") - + btn_cal_open = QtWidgets.QPushButton("Open") btn_cal_open.clicked.connect(self.saveOpen) self.cal_open_label = QtWidgets.QLabel("Uncalibrated") - + btn_cal_load = QtWidgets.QPushButton("Load") btn_cal_load.clicked.connect(self.saveLoad) self.cal_load_label = QtWidgets.QLabel("Uncalibrated") @@ -176,7 +176,7 @@ class CalibrationWindow(QtWidgets.QWidget): self.cal_through_box.setDisabled(True) self.through_length = QtWidgets.QLineEdit("0") cal_through_form.addRow("Offset Delay (ps)", self.through_length) - + cal_standard_layout.addWidget(self.cal_short_box) cal_standard_layout.addWidget(self.cal_open_box) cal_standard_layout.addWidget(self.cal_load_box) @@ -308,9 +308,9 @@ class CalibrationWindow(QtWidgets.QWidget): self.load_length.setText(str(self.app.settings.value("LoadDelay", 0))) self.through_length.setText(str(self.app.settings.value("ThroughDelay", 0))) - + self.app.settings.endArray() - + def deleteCalibrationStandard(self): if self.cal_standard_save_selector.currentData() == -1: return @@ -382,7 +382,7 @@ class CalibrationWindow(QtWidgets.QWidget): for i in range(len(names)): self.app.settings.setArrayIndex(i) self.app.settings.setValue("Name", names[i]) - + self.app.settings.setValue("ShortL0", shortL0[i]) self.app.settings.setValue("ShortL1", shortL1[i]) self.app.settings.setValue("ShortL2", shortL2[i]) @@ -394,7 +394,7 @@ class CalibrationWindow(QtWidgets.QWidget): self.app.settings.setValue("OpenC2", openC2[i]) self.app.settings.setValue("OpenC3", openC3[i]) self.app.settings.setValue("OpenDelay", openDelay[i]) - + self.app.settings.setValue("LoadR", loadR[i]) self.app.settings.setValue("LoadL", loadL[i]) self.app.settings.setValue("LoadC", loadC[i]) diff --git a/NanoVNASaver/Marker.py b/NanoVNASaver/Marker.py index 4d3dd2b..0a078c0 100644 --- a/NanoVNASaver/Marker.py +++ b/NanoVNASaver/Marker.py @@ -168,7 +168,7 @@ class Marker(QtCore.QObject): def getGroupBox(self): return self.group_box - + def resetLabels(self): self.frequency_label.setText("") self.impedance_label.setText("") diff --git a/NanoVNASaver/NanoVNASaver.py b/NanoVNASaver/NanoVNASaver.py index cf8829c..f9a1998 100644 --- a/NanoVNASaver/NanoVNASaver.py +++ b/NanoVNASaver/NanoVNASaver.py @@ -187,7 +187,7 @@ class NanoVNASaver(QtWidgets.QWidget): self.sweepCenterInput.textEdited.connect(self.updateStartEnd) sweep_input_right_layout.addRow(QtWidgets.QLabel("Center"), self.sweepCenterInput) - + self.sweepSpanInput = QtWidgets.QLineEdit("") self.sweepSpanInput.setAlignment(QtCore.Qt.AlignRight) self.sweepSpanInput.textEdited.connect(self.updateStartEnd) @@ -1188,7 +1188,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget): self.btn_foreground_picker.clicked.connect(lambda: self.setColor("foreground", QtWidgets.QColorDialog.getColor(self.foregroundColor, options=QtWidgets.QColorDialog.ShowAlphaChannel))) color_options_layout.addRow("Chart foreground", self.btn_foreground_picker) - + self.btn_text_picker = QtWidgets.QPushButton("█") self.btn_text_picker.setFixedWidth(20) self.btn_text_picker.clicked.connect(lambda: self.setColor("text", QtWidgets.QColorDialog.getColor(self.textColor, options=QtWidgets.QColorDialog.ShowAlphaChannel))) @@ -1265,7 +1265,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget): chart01_selection.setCurrentIndex(selections.index(self.app.settings.value("Chart01", "S11 Return Loss"))) chart01_selection.currentTextChanged.connect(lambda: self.changeChart(0, 1, chart01_selection.currentText())) charts_layout.addWidget(chart01_selection, 0, 1) - + chart02_selection = QtWidgets.QComboBox() chart02_selection.addItems(selections) chart02_selection.setCurrentIndex(selections.index(self.app.settings.value("Chart02", "None"))) diff --git a/NanoVNASaver/SweepWorker.py b/NanoVNASaver/SweepWorker.py index a3d1dc8..3eaf0b8 100644 --- a/NanoVNASaver/SweepWorker.py +++ b/NanoVNASaver/SweepWorker.py @@ -271,7 +271,9 @@ class SweepWorker(QtCore.QRunnable): def readSegment(self, start, stop): logger.debug("Setting sweep range to %d to %d", start, stop) self.app.setSweep(start, stop) - sleep(1) # TODO This long delay seems to fix the weird data transitions we were seeing by getting partial + + sleep(0.3) # TODO This is fixed in 0.2.3 firmware + #sleep(1) # TODO This long delay seems to fix the weird data transitions we were seeing by getting partial # sweeps. Clearly something needs to be done, maybe at firmware level, to address this fully. # Let's check the frequencies first: diff --git a/NanoVNASaver/dark-colored.css b/NanoVNASaver/dark-colored.css new file mode 100644 index 0000000..bc1a0dc --- /dev/null +++ b/NanoVNASaver/dark-colored.css @@ -0,0 +1,207 @@ +/* +background foncer 343334 + +background 545254 +background shadow 464446 + +graph background b5b4b5 +graph background bevel c6c4c6 + +Light Blue 53d1ea +Light Green 00d074 +Light Yellow eae7ac +Light Red e1442az +Light Gray c6c3c5 + +https://www.atlassian.com/git/tutorials/saving-changes/git-stash +to install right version of qtmodern librairy pip3 install git+https://github.com/gmarull/qtmodern.git +*/ +QLineEdit { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; +} +QGroupBox { + color: #eae7ac; + font-weight: bold; +} +[cssClass="dialog"] { + border-radius: 12px; + border-style: solid; + border-color: red; + border-width: 4px 4px 4px 4px; + +} + +[cssClass="mainWindow"] { + color: #53d1ea; +} + + +[cssClass="Marker-1"] { + color: #e1442a; + font-weight: bold; +} + +[cssClass="Marker-2"] { + color: #53d1ea; + font-weight: bold; +} + +[cssClass="Marker-3"] { + color: #00d074; + font-weight: bold; +} + +[cssClass="frequency_label"] { + background-color: #c6c3c5; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="marker_label"] { + background-color: #c6c3c5; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="impedance_label"] { + background-color: #53d1ea; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="parallel_r_label"] { + background-color: #53d1ea; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="parallel_x_label"] { + background-color: #53d1ea; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="returnloss_label"] { + background-color: #eae7ac; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="vswr_label"] { + background-color: #eae7ac; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="inductance_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="capacitance_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="gain_label"] { + background-color: #00d074; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s11_phase_label"] { + background-color: #00d074; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s21_phase_label"] { + background-color: #00d074; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="quality_factor_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s11_min_swr_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s11_min_rl_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s21_min_gain_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s21_max_gain_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s11_control_box"] { + color: #eae7ac; + font-weight: bold; +} + +[cssClass="s21_control_box"] { + color: #eae7ac; + font-weight: bold; +} + + +[cssClass="tdr_result_label"] { + color: #00d074; + font-weight: bold; +} diff --git a/NanoVNASaver/demo.png b/NanoVNASaver/demo.png new file mode 100644 index 0000000..f056d42 Binary files /dev/null and b/NanoVNASaver/demo.png differ diff --git a/NanoVNASaver/light-colored.css b/NanoVNASaver/light-colored.css new file mode 100644 index 0000000..706cde6 --- /dev/null +++ b/NanoVNASaver/light-colored.css @@ -0,0 +1,215 @@ +/* # NanoVNASaver - a python program to view and export Touchstone data from a NanoVNA +# Copyright (C) 2019. Rune B. Broberg +# Author Carl Tremblay -Cinosh07 AKA VA2SAJ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . */ +/* + +Light Blue 53d1ea +Light Green 00d074 +Light Yellow eae7ac +Light Red e1442a +Light Gray c6c3c5 + +https://www.atlassian.com/git/tutorials/saving-changes/git-stash +to install right version of qtmodern librairy pip3 install git+https://github.com/gmarull/qtmodern.git +*/ + +QLineEdit { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; +} +QGroupBox { + color: #000000; + font-weight: bold; +} +[cssClass="dialog"] { + border-radius: 12px; + border-style: solid; + border-color: red; + border-width: 4px 4px 4px 4px; +} + +[cssClass="mainWindow"] { + color: #53d1ea; +} + + +[cssClass="Marker-1"] { + color: #e1442a; + font-weight: bold; +} + +[cssClass="Marker-2"] { + color: #53d1ea; + font-weight: bold; +} + +[cssClass="Marker-3"] { + color: #00d074; + font-weight: bold; +} + +[cssClass="frequency_label"] { + background-color: #c6c3c5; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="marker_label"] { + background-color: #c6c3c5; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="impedance_label"] { + background-color: #53d1ea; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="parallel_r_label"] { + background-color: #53d1ea; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="parallel_x_label"] { + background-color: #53d1ea; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="returnloss_label"] { + background-color: #eae7ac; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="vswr_label"] { + background-color: #eae7ac; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="inductance_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="capacitance_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="gain_label"] { + background-color: #00d074; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s11_phase_label"] { + background-color: #00d074; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s21_phase_label"] { + background-color: #00d074; + color: #000000; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="quality_factor_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s11_min_swr_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s11_min_rl_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s21_min_gain_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s21_max_gain_label"] { + background-color: #000000; + color: #e1442a; + border: 2px groove #232223; + margin: 2px; + font-weight: bold; +} + +[cssClass="s11_control_box"] { + color: #000000; + font-weight: bold; +} + +[cssClass="s21_control_box"] { + color: #000000; + font-weight: bold; +} + + +[cssClass="tdr_result_label"] { + color: #000000; + font-weight: bold; +} diff --git a/NanoVNASaver/template.png b/NanoVNASaver/template.png new file mode 100644 index 0000000..b27a4c4 Binary files /dev/null and b/NanoVNASaver/template.png differ diff --git a/Pipfile b/Pipfile index 426cdd0..553e60c 100644 --- a/Pipfile +++ b/Pipfile @@ -9,6 +9,7 @@ verify_ssl = true pyserial = "*" pyqt5 = "*" numpy = "*" +qtmodern = { git = 'https://github.com/gmarull/qtmodern.git', ref = '0.1.4', editable = false } [requires] python_version = "3.7"