From 975c4bc773bad2b36e82067f4f321640867ee315 Mon Sep 17 00:00:00 2001 From: Thomas de Lellis <24543390+t52ta6ek@users.noreply.github.com> Date: Sat, 22 Jul 2023 00:57:03 +0200 Subject: [PATCH] With current firmware, these JNCRadio_VNA_3G, SV4401A, SV6301A devices allow 1001 datapoints. Updated datapoints dropdown to show their respective minimums, the 'typical' 101, device default 501 and maximum 1001 points. Users may choose any other values between min and max not seen in the dropdown list using the custom datapoints option. These devices now use the factory default 501 datapoints as their initial datapoints value. --- src/NanoVNASaver/Hardware/JNCRadio_VNA_3G.py | 6 ++++-- src/NanoVNASaver/Hardware/SV4401A.py | 6 +++--- src/NanoVNASaver/Hardware/SV6301A.py | 6 +++--- src/NanoVNASaver/Windows/DeviceSettings.py | 1 + 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/NanoVNASaver/Hardware/JNCRadio_VNA_3G.py b/src/NanoVNASaver/Hardware/JNCRadio_VNA_3G.py index ce87ef4..106126c 100644 --- a/src/NanoVNASaver/Hardware/JNCRadio_VNA_3G.py +++ b/src/NanoVNASaver/Hardware/JNCRadio_VNA_3G.py @@ -31,8 +31,9 @@ class JNCRadio_VNA_3G(NanoVNA): name = "JNCRadio_VNA_3G" screenwidth = 800 screenheight = 480 - valid_datapoints = (101, 201, 301, 401, 501) - sweep_points_max = 501 + valid_datapoints = (501, 11, 101, 1001) + sweep_points_max = 11 + sweep_points_max = 1001 def __init__(self, iface: Interface): super().__init__(iface) @@ -40,6 +41,7 @@ class JNCRadio_VNA_3G(NanoVNA): def getScreenshot(self) -> QPixmap: logger.debug("Capturing screenshot...") + self.serial.timeout=8 if not self.connected(): return QPixmap() try: diff --git a/src/NanoVNASaver/Hardware/SV4401A.py b/src/NanoVNASaver/Hardware/SV4401A.py index a281ce2..ca5f279 100644 --- a/src/NanoVNASaver/Hardware/SV4401A.py +++ b/src/NanoVNASaver/Hardware/SV4401A.py @@ -31,9 +31,9 @@ class SV4401A(NanoVNA): name = "SV4401A" screenwidth = 1024 screenheight = 600 - valid_datapoints = (101, 301, 501) - sweep_points_max = 101 - sweep_points_max = 501 + valid_datapoints = (501, 101, 1001) + sweep_points_min = 101 + sweep_points_max = 1001 def __init__(self, iface: Interface): super().__init__(iface) diff --git a/src/NanoVNASaver/Hardware/SV6301A.py b/src/NanoVNASaver/Hardware/SV6301A.py index d0bb831..93a1e6b 100644 --- a/src/NanoVNASaver/Hardware/SV6301A.py +++ b/src/NanoVNASaver/Hardware/SV6301A.py @@ -31,9 +31,9 @@ class SV6301A(NanoVNA): name = "SV6301A" screenwidth = 1024 screenheight = 600 - valid_datapoints = (101, 301, 501) - sweep_points_max = 101 - sweep_points_max = 501 + valid_datapoints = (501, 101, 1001) + sweep_points_min = 101 + sweep_points_max = 1001 def __init__(self, iface: Interface): super().__init__(iface) diff --git a/src/NanoVNASaver/Windows/DeviceSettings.py b/src/NanoVNASaver/Windows/DeviceSettings.py index acffcad..1080d83 100644 --- a/src/NanoVNASaver/Windows/DeviceSettings.py +++ b/src/NanoVNASaver/Windows/DeviceSettings.py @@ -152,6 +152,7 @@ class DeviceSettingsWindow(QtWidgets.QWidget): if "Customizable data points" in features: self.datapoints.clear() + self.custom_points_Eidt.setValidator(QIntValidator(self.app.vna.sweep_points_min,self.app.vna.sweep_points_max)) cur_dps = self.app.vna.datapoints for d in sorted(self.app.vna.valid_datapoints): self.datapoints.addItem(str(d))