gui: replot active mode when settings plot are updated

This commit is contained in:
Kiara Navarro 2021-06-28 23:47:02 -03:00
parent b7a7626e3d
commit d6cecf2603
No known key found for this signature in database
GPG key ID: CDEFDCA3F6E04955
8 changed files with 50 additions and 2 deletions

View file

@ -69,6 +69,12 @@ SpectrumAnalyzer::SpectrumAnalyzer(AppWindow *window)
traceXY->setYAxis(0, TraceXYPlot::YAxisType::Magnitude, false, false, -120,0,10);
traceXY->setYAxis(1, TraceXYPlot::YAxisType::Disabled, false, true, 0,0,1);
connect(this, &SpectrumAnalyzer::graphColorsChanged, [=](){
for (auto p : TracePlot::getPlots()) {
p->updateGraphColors();
}
});
central->setPlot(traceXY);
// Create menu entries and connections
@ -960,3 +966,8 @@ void SpectrumAnalyzer::StoreSweepSettings()
s.setValue("SAAveraging", averages);
s.setValue("SASignalID", static_cast<bool>(settings.SignalID));
}
void SpectrumAnalyzer::updateGraphColors()
{
emit graphColorsChanged();
}

View file

@ -24,6 +24,9 @@ public:
virtual nlohmann::json toJSON() override;
virtual void fromJSON(nlohmann::json j) override;
void updateGraphColors();
private:
enum class Window {
None = 0,
@ -117,6 +120,7 @@ signals:
void NormalizationLevelChanged(double level);
void averagingChanged(unsigned int averages);
void graphColorsChanged();
};
#endif // VNA_H