reduce inter-segment delay, add integration test for segmented sweep
This commit is contained in:
parent
ccb71f9650
commit
503d689d51
@ -8,7 +8,7 @@ from signal import SIGINT
|
|||||||
|
|
||||||
class TestBase(unittest.TestCase):
|
class TestBase(unittest.TestCase):
|
||||||
def setUp(self):
|
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
|
# wait for the SCPI server to become available
|
||||||
timeout = time.time() + 3;
|
timeout = time.time() + 3;
|
||||||
@ -40,4 +40,4 @@ class TestBase(unittest.TestCase):
|
|||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
self.gui.kill()
|
self.gui.kill()
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,10 +52,10 @@ class TestSASweep(TestBase):
|
|||||||
port2 = self.vna.parse_SA_trace_data(self.vna.query(":SA:TRACE:DATA? PORT2"))
|
port2 = self.vna.parse_SA_trace_data(self.vna.query(":SA:TRACE:DATA? PORT2"))
|
||||||
|
|
||||||
self.assertEqual(port1[0][0], 0.0)
|
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.assertLess(port1[-1][0], 5)
|
||||||
self.assertEqual(port2[0][0], 0.0)
|
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)
|
self.assertLess(port2[-1][0], 5)
|
||||||
|
|
||||||
# No signal present, signal level should be very low
|
# 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
|
# Reported level on port1 should match normalization very closely now
|
||||||
port1 = self.vna.parse_SA_trace_data(self.vna.query(":SA:TRACE:DATA? PORT1"))
|
port1 = self.vna.parse_SA_trace_data(self.vna.query(":SA:TRACE:DATA? PORT1"))
|
||||||
self.assertTrace_dB(port1, -10, 1)
|
self.assertTrace_dB(port1, -10, 1)
|
||||||
|
|
||||||
|
@ -70,4 +70,18 @@ class TestVNASweep(TestBase):
|
|||||||
for i in range(10):
|
for i in range(10):
|
||||||
# Change something irrelevant (to force reconfiguration of device)
|
# Change something irrelevant (to force reconfiguration of device)
|
||||||
self.vna.cmd(":VNA:FREQuency:START "+str(1000000+i))
|
self.vna.cmd(":VNA:FREQuency:START "+str(1000000+i))
|
||||||
self.waitSweepTimeout(2)
|
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)
|
||||||
|
@ -114,6 +114,7 @@ QString TracePlot::TypeToString(Type t)
|
|||||||
case Type::SmithChart: return "Smith Chart";
|
case Type::SmithChart: return "Smith Chart";
|
||||||
case Type::Waterfall: return "Waterfall";
|
case Type::Waterfall: return "Waterfall";
|
||||||
case Type::XYPlot: return "XY Plot";
|
case Type::XYPlot: return "XY Plot";
|
||||||
|
default: return "Invalid";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1161,6 +1161,7 @@ bool TraceXYPlot::markerVisible(double x)
|
|||||||
|
|
||||||
void TraceXYPlot::traceDropped(Trace *t, QPoint position)
|
void TraceXYPlot::traceDropped(Trace *t, QPoint position)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(position)
|
||||||
if(!supported(t)) {
|
if(!supported(t)) {
|
||||||
// needs to switch to a different domain for the graph
|
// 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."
|
if(!InformationBox::AskQuestion("X Axis Domain Change", "You dropped a trace that is not supported with the currently selected X axis domain."
|
||||||
|
@ -945,7 +945,7 @@ void VNA::NewDatapoint(DeviceDriver::VNAMeasurement m)
|
|||||||
} else {
|
} else {
|
||||||
settings.activeSegment = 0;
|
settings.activeSegment = 0;
|
||||||
}
|
}
|
||||||
SettingsChanged(false);
|
SettingsChanged(false, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -954,9 +954,9 @@ void VNA::UpdateAverageCount()
|
|||||||
lAverages->setText(QString::number(average.getLevel()) + "/");
|
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;
|
changingSettings = true;
|
||||||
configurationTimerResetTraces = resetTraces;
|
configurationTimerResetTraces = resetTraces;
|
||||||
if(resetTraces) {
|
if(resetTraces) {
|
||||||
|
@ -118,7 +118,7 @@ private:
|
|||||||
bool CalibrationMeasurementActive() { return calWaitFirst || calMeasuring; }
|
bool CalibrationMeasurementActive() { return calWaitFirst || calMeasuring; }
|
||||||
void SetupSCPI();
|
void SetupSCPI();
|
||||||
void UpdateAverageCount();
|
void UpdateAverageCount();
|
||||||
void SettingsChanged(bool resetTraces = true);
|
void SettingsChanged(bool resetTraces = true, int delay = 100);
|
||||||
void ConstrainAndUpdateFrequencies();
|
void ConstrainAndUpdateFrequencies();
|
||||||
void LoadSweepSettings();
|
void LoadSweepSettings();
|
||||||
void StoreSweepSettings();
|
void StoreSweepSettings();
|
||||||
|
@ -202,7 +202,7 @@ private:
|
|||||||
{&Startup.SA.detector, "Startup.SA.detector", 0},
|
{&Startup.SA.detector, "Startup.SA.detector", 0},
|
||||||
{&Startup.SA.averaging, "Startup.SA.averaging", 1},
|
{&Startup.SA.averaging, "Startup.SA.averaging", 1},
|
||||||
{&Acquisition.alwaysExciteAllPorts, "Acquisition.alwaysExciteBothPorts", true},
|
{&Acquisition.alwaysExciteAllPorts, "Acquisition.alwaysExciteBothPorts", true},
|
||||||
{&Acquisition.allowSegmentedSweep, "Acquisition.allowSegmentedSweep", false},
|
{&Acquisition.allowSegmentedSweep, "Acquisition.allowSegmentedSweep", true},
|
||||||
{&Acquisition.useMedianAveraging, "Acquisition.useMedianAveraging", false},
|
{&Acquisition.useMedianAveraging, "Acquisition.useMedianAveraging", false},
|
||||||
{&Acquisition.fullSpanManual, "Acquisition.fullSpanManual", false},
|
{&Acquisition.fullSpanManual, "Acquisition.fullSpanManual", false},
|
||||||
{&Acquisition.fullSpanStart, "Acquisition.fullSpanStart", 0.0},
|
{&Acquisition.fullSpanStart, "Acquisition.fullSpanStart", 0.0},
|
||||||
|
Loading…
Reference in New Issue
Block a user