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):
|
||||
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()
|
||||
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
@ -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)
|
||||
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::Waterfall: return "Waterfall";
|
||||
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)
|
||||
{
|
||||
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."
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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},
|
||||
|
Loading…
Reference in New Issue
Block a user