diff --git a/Software/Integrationtests/tests/TestBase.py b/Software/Integrationtests/tests/TestBase.py index 81b7362..21edf90 100644 --- a/Software/Integrationtests/tests/TestBase.py +++ b/Software/Integrationtests/tests/TestBase.py @@ -8,7 +8,7 @@ from signal import SIGINT class TestBase(unittest.TestCase): def setUp(self): - self.gui = subprocess.Popen([defs.GUI_PATH, '-p', '19544'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + self.gui = subprocess.Popen([defs.GUI_PATH, '-p', '19544', '--reset-preferences'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # wait for the SCPI server to become available timeout = time.time() + 3; @@ -40,4 +40,4 @@ class TestBase(unittest.TestCase): except subprocess.TimeoutExpired: self.gui.kill() - \ No newline at end of file + diff --git a/Software/Integrationtests/tests/TestSASweep.py b/Software/Integrationtests/tests/TestSASweep.py index 730e8f9..c3620a0 100644 --- a/Software/Integrationtests/tests/TestSASweep.py +++ b/Software/Integrationtests/tests/TestSASweep.py @@ -52,10 +52,10 @@ class TestSASweep(TestBase): port2 = self.vna.parse_SA_trace_data(self.vna.query(":SA:TRACE:DATA? PORT2")) self.assertEqual(port1[0][0], 0.0) - self.assertGreater(port1[-1][0], 4.5) + self.assertGreater(port1[-1][0], 4) self.assertLess(port1[-1][0], 5) self.assertEqual(port2[0][0], 0.0) - self.assertGreater(port2[-1][0], 4.5) + self.assertGreater(port2[-1][0], 4) self.assertLess(port2[-1][0], 5) # No signal present, signal level should be very low @@ -95,4 +95,4 @@ class TestSASweep(TestBase): # Reported level on port1 should match normalization very closely now port1 = self.vna.parse_SA_trace_data(self.vna.query(":SA:TRACE:DATA? PORT1")) self.assertTrace_dB(port1, -10, 1) - \ No newline at end of file + diff --git a/Software/Integrationtests/tests/TestVNASweep.py b/Software/Integrationtests/tests/TestVNASweep.py index b8f6fca..bae3143 100644 --- a/Software/Integrationtests/tests/TestVNASweep.py +++ b/Software/Integrationtests/tests/TestVNASweep.py @@ -70,4 +70,18 @@ class TestVNASweep(TestBase): for i in range(10): # Change something irrelevant (to force reconfiguration of device) self.vna.cmd(":VNA:FREQuency:START "+str(1000000+i)) - self.waitSweepTimeout(2) \ No newline at end of file + self.waitSweepTimeout(2) + + def test_segmented_sweep(self): + self.vna.cmd(":DEV:MODE VNA") + self.vna.cmd(":VNA:SWEEP FREQUENCY") + self.vna.cmd(":VNA:STIM:LVL -10") + self.vna.cmd(":VNA:ACQ:IFBW 50000") + self.vna.cmd(":VNA:ACQ:AVG 1") + self.vna.cmd(":VNA:ACQ:POINTS 10000") + self.vna.cmd(":VNA:FREQuency:START 1000000") + self.vna.cmd(":VNA:FREQuency:STOP 6000000000") + self.waitSweepTimeout(10) + + S11 = self.vna.parse_VNA_trace_data(self.vna.query(":VNA:TRACE:DATA? S11")) + self.assertEqual(len(S11), 10000) diff --git a/Software/PC_Application/LibreVNA-GUI/Traces/traceplot.cpp b/Software/PC_Application/LibreVNA-GUI/Traces/traceplot.cpp index 3aec5cc..70e3d6f 100644 --- a/Software/PC_Application/LibreVNA-GUI/Traces/traceplot.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Traces/traceplot.cpp @@ -114,6 +114,7 @@ QString TracePlot::TypeToString(Type t) case Type::SmithChart: return "Smith Chart"; case Type::Waterfall: return "Waterfall"; case Type::XYPlot: return "XY Plot"; + default: return "Invalid"; } } diff --git a/Software/PC_Application/LibreVNA-GUI/Traces/tracexyplot.cpp b/Software/PC_Application/LibreVNA-GUI/Traces/tracexyplot.cpp index 19e75b1..e2874c3 100644 --- a/Software/PC_Application/LibreVNA-GUI/Traces/tracexyplot.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Traces/tracexyplot.cpp @@ -1161,6 +1161,7 @@ bool TraceXYPlot::markerVisible(double x) void TraceXYPlot::traceDropped(Trace *t, QPoint position) { + Q_UNUSED(position) if(!supported(t)) { // needs to switch to a different domain for the graph if(!InformationBox::AskQuestion("X Axis Domain Change", "You dropped a trace that is not supported with the currently selected X axis domain." diff --git a/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp b/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp index 0d3afad..17f6bbd 100644 --- a/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp +++ b/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp @@ -945,7 +945,7 @@ void VNA::NewDatapoint(DeviceDriver::VNAMeasurement m) } else { settings.activeSegment = 0; } - SettingsChanged(false); + SettingsChanged(false, 0); } } @@ -954,9 +954,9 @@ void VNA::UpdateAverageCount() lAverages->setText(QString::number(average.getLevel()) + "/"); } -void VNA::SettingsChanged(bool resetTraces) +void VNA::SettingsChanged(bool resetTraces, int delay) { - configurationTimer.start(100); + configurationTimer.start(delay); changingSettings = true; configurationTimerResetTraces = resetTraces; if(resetTraces) { diff --git a/Software/PC_Application/LibreVNA-GUI/VNA/vna.h b/Software/PC_Application/LibreVNA-GUI/VNA/vna.h index 653146c..d0e7701 100644 --- a/Software/PC_Application/LibreVNA-GUI/VNA/vna.h +++ b/Software/PC_Application/LibreVNA-GUI/VNA/vna.h @@ -118,7 +118,7 @@ private: bool CalibrationMeasurementActive() { return calWaitFirst || calMeasuring; } void SetupSCPI(); void UpdateAverageCount(); - void SettingsChanged(bool resetTraces = true); + void SettingsChanged(bool resetTraces = true, int delay = 100); void ConstrainAndUpdateFrequencies(); void LoadSweepSettings(); void StoreSweepSettings(); diff --git a/Software/PC_Application/LibreVNA-GUI/preferences.h b/Software/PC_Application/LibreVNA-GUI/preferences.h index 8bfe66d..d6d2660 100644 --- a/Software/PC_Application/LibreVNA-GUI/preferences.h +++ b/Software/PC_Application/LibreVNA-GUI/preferences.h @@ -202,7 +202,7 @@ private: {&Startup.SA.detector, "Startup.SA.detector", 0}, {&Startup.SA.averaging, "Startup.SA.averaging", 1}, {&Acquisition.alwaysExciteAllPorts, "Acquisition.alwaysExciteBothPorts", true}, - {&Acquisition.allowSegmentedSweep, "Acquisition.allowSegmentedSweep", false}, + {&Acquisition.allowSegmentedSweep, "Acquisition.allowSegmentedSweep", true}, {&Acquisition.useMedianAveraging, "Acquisition.useMedianAveraging", false}, {&Acquisition.fullSpanManual, "Acquisition.fullSpanManual", false}, {&Acquisition.fullSpanStart, "Acquisition.fullSpanStart", 0.0},