Fix segmented sweep
This commit is contained in:
parent
5a78091f2b
commit
59f3057dd9
@ -76,7 +76,7 @@ VNA::VNA(AppWindow *window, QString name)
|
|||||||
|
|
||||||
configurationTimer.setSingleShot(true);
|
configurationTimer.setSingleShot(true);
|
||||||
connect(&configurationTimer, &QTimer::timeout, this, [=](){
|
connect(&configurationTimer, &QTimer::timeout, this, [=](){
|
||||||
ConfigureDevice();
|
ConfigureDevice(configurationTimerResetTraces);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create default traces
|
// Create default traces
|
||||||
@ -725,7 +725,7 @@ void VNA::initializeDevice()
|
|||||||
}
|
}
|
||||||
// Configure initial state of device
|
// Configure initial state of device
|
||||||
ConstrainAndUpdateFrequencies();
|
ConstrainAndUpdateFrequencies();
|
||||||
SettingsChanged();
|
SettingsChanged(true);
|
||||||
emit deviceInitialized();
|
emit deviceInitialized();
|
||||||
if(window->getDevice() && !cal.validForDevice(window->getDevice()->getSerial())) {
|
if(window->getDevice() && !cal.validForDevice(window->getDevice()->getSerial())) {
|
||||||
InformationBox::ShowMessage("Invalid calibration", "The current calibration was created for a different device. You can still use it but the resulting "
|
InformationBox::ShowMessage("Invalid calibration", "The current calibration was created for a different device. You can still use it but the resulting "
|
||||||
@ -940,13 +940,12 @@ void VNA::NewDatapoint(DeviceDriver::VNAMeasurement m)
|
|||||||
lastPoint = m_avg.pointNum;
|
lastPoint = m_avg.pointNum;
|
||||||
|
|
||||||
if (needsSegmentUpdate) {
|
if (needsSegmentUpdate) {
|
||||||
changingSettings = true;
|
|
||||||
if( settings.activeSegment < settings.segments - 1) {
|
if( settings.activeSegment < settings.segments - 1) {
|
||||||
settings.activeSegment++;
|
settings.activeSegment++;
|
||||||
} else {
|
} else {
|
||||||
settings.activeSegment = 0;
|
settings.activeSegment = 0;
|
||||||
}
|
}
|
||||||
SettingsChanged();
|
SettingsChanged(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -955,11 +954,14 @@ void VNA::UpdateAverageCount()
|
|||||||
lAverages->setText(QString::number(average.getLevel()) + "/");
|
lAverages->setText(QString::number(average.getLevel()) + "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
void VNA::SettingsChanged()
|
void VNA::SettingsChanged(bool resetTraces)
|
||||||
{
|
{
|
||||||
configurationTimer.start(100);
|
configurationTimer.start(100);
|
||||||
changingSettings = true;
|
changingSettings = true;
|
||||||
ResetLiveTraces();
|
configurationTimerResetTraces = resetTraces;
|
||||||
|
if(resetTraces) {
|
||||||
|
ResetLiveTraces();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VNA::StartImpedanceMatching()
|
void VNA::StartImpedanceMatching()
|
||||||
|
@ -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();
|
void SettingsChanged(bool resetTraces = true);
|
||||||
void ConstrainAndUpdateFrequencies();
|
void ConstrainAndUpdateFrequencies();
|
||||||
void LoadSweepSettings();
|
void LoadSweepSettings();
|
||||||
void StoreSweepSettings();
|
void StoreSweepSettings();
|
||||||
@ -143,6 +143,7 @@ private:
|
|||||||
bool singleSweep;
|
bool singleSweep;
|
||||||
bool running;
|
bool running;
|
||||||
QTimer configurationTimer;
|
QTimer configurationTimer;
|
||||||
|
bool configurationTimerResetTraces;
|
||||||
|
|
||||||
// Calibration
|
// Calibration
|
||||||
Calibration cal;
|
Calibration cal;
|
||||||
|
Loading…
Reference in New Issue
Block a user