Correctly load window/detector type on startup
This commit is contained in:
parent
71699d1bd7
commit
f1ca961d0e
@ -266,9 +266,9 @@ SpectrumAnalyzer::SpectrumAnalyzer(AppWindow *window)
|
|||||||
SetRBW(pref.Startup.SA.RBW);
|
SetRBW(pref.Startup.SA.RBW);
|
||||||
SetAveraging(pref.Startup.SA.averaging);
|
SetAveraging(pref.Startup.SA.averaging);
|
||||||
settings.pointNum = 1001;
|
settings.pointNum = 1001;
|
||||||
cbWindowType->setCurrentIndex(pref.Startup.SA.window);
|
SetWindow((Window) pref.Startup.SA.window);
|
||||||
cbDetector->setCurrentIndex(pref.Startup.SA.detector);
|
SetDetector((Detector) pref.Startup.SA.detector);
|
||||||
cbSignalID->setChecked(pref.Startup.SA.signalID);
|
SetSignalID(pref.Startup.SA.signalID);
|
||||||
}
|
}
|
||||||
|
|
||||||
finalize(central);
|
finalize(central);
|
||||||
@ -412,7 +412,7 @@ void SpectrumAnalyzer::SettingsChanged()
|
|||||||
}
|
}
|
||||||
average.reset(settings.pointNum);
|
average.reset(settings.pointNum);
|
||||||
UpdateAverageCount();
|
UpdateAverageCount();
|
||||||
traceModel.clearVNAData();
|
traceModel.clearLiveData();
|
||||||
emit traceModel.SpanChanged(settings.f_start, settings.f_stop);
|
emit traceModel.SpanChanged(settings.f_start, settings.f_stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -937,10 +937,10 @@ void SpectrumAnalyzer::LoadSweepSettings()
|
|||||||
ConstrainAndUpdateFrequencies();
|
ConstrainAndUpdateFrequencies();
|
||||||
SetRBW(s.value("SARBW", pref.Startup.SA.RBW).toUInt());
|
SetRBW(s.value("SARBW", pref.Startup.SA.RBW).toUInt());
|
||||||
settings.pointNum = 1001;
|
settings.pointNum = 1001;
|
||||||
cbWindowType->setCurrentIndex(s.value("SAWindow", pref.Startup.SA.window).toInt());
|
SetWindow((Window) s.value("SAWindow", pref.Startup.SA.window).toInt());
|
||||||
cbDetector->setCurrentIndex(s.value("SADetector", pref.Startup.SA.detector).toInt());
|
SetDetector((Detector) s.value("SADetector", pref.Startup.SA.detector).toInt());
|
||||||
|
SetSignalID(s.value("SASignalID", pref.Startup.SA.signalID).toBool());
|
||||||
SetAveraging(s.value("SAAveraging", pref.Startup.SA.averaging).toInt());
|
SetAveraging(s.value("SAAveraging", pref.Startup.SA.averaging).toInt());
|
||||||
cbSignalID->setChecked(s.value("SASignalID", pref.Startup.SA.signalID).toBool());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpectrumAnalyzer::StoreSweepSettings()
|
void SpectrumAnalyzer::StoreSweepSettings()
|
||||||
|
@ -195,7 +195,7 @@ void TraceModel::fromJSON(nlohmann::json j)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TraceModel::clearVNAData()
|
void TraceModel::clearLiveData()
|
||||||
{
|
{
|
||||||
for(auto t : traces) {
|
for(auto t : traces) {
|
||||||
if (t->isLive()) {
|
if (t->isLive()) {
|
||||||
|
@ -53,7 +53,7 @@ signals:
|
|||||||
void traceNameChanged(Trace *t);
|
void traceNameChanged(Trace *t);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clearVNAData();
|
void clearLiveData();
|
||||||
void addVNAData(const Protocol::Datapoint& d, const Protocol::SweepSettings& settings);
|
void addVNAData(const Protocol::Datapoint& d, const Protocol::SweepSettings& settings);
|
||||||
void addSAData(const Protocol::SpectrumAnalyzerResult& d, const Protocol::SpectrumAnalyzerSettings& settings);
|
void addSAData(const Protocol::SpectrumAnalyzerResult& d, const Protocol::SpectrumAnalyzerSettings& settings);
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ void VNA::SettingsChanged(std::function<void (Device::TransmissionResult)> cb)
|
|||||||
window->getDevice()->Configure(settings, [=](Device::TransmissionResult res){
|
window->getDevice()->Configure(settings, [=](Device::TransmissionResult res){
|
||||||
// device received command, reset traces now
|
// device received command, reset traces now
|
||||||
average.reset(settings.points);
|
average.reset(settings.points);
|
||||||
traceModel.clearVNAData();
|
traceModel.clearLiveData();
|
||||||
UpdateAverageCount();
|
UpdateAverageCount();
|
||||||
UpdateCalWidget();
|
UpdateCalWidget();
|
||||||
if(cb) {
|
if(cb) {
|
||||||
|
Loading…
Reference in New Issue
Block a user