vna/mode/app/sa: refactor plot update colors
This commit is contained in:
parent
794f55f1fb
commit
423585845e
@ -73,12 +73,6 @@ SpectrumAnalyzer::SpectrumAnalyzer(AppWindow *window, QString name)
|
||||
traceXY->setYAxis(0, YAxis::Type::Magnitude, false, false, -120,0,10);
|
||||
traceXY->setYAxis(1, YAxis::Type::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
|
||||
@ -1127,11 +1121,6 @@ void SpectrumAnalyzer::StoreSweepSettings()
|
||||
s.setValue("SASignalID", static_cast<bool>(settings.SignalID));
|
||||
}
|
||||
|
||||
void SpectrumAnalyzer::updateGraphColors()
|
||||
{
|
||||
emit graphColorsChanged();
|
||||
}
|
||||
|
||||
void SpectrumAnalyzer::setAveragingMode(Averaging::Mode mode)
|
||||
{
|
||||
average.setMode(mode);
|
||||
|
@ -134,7 +134,6 @@ signals:
|
||||
void NormalizationLevelChanged(double level);
|
||||
|
||||
void averagingChanged(unsigned int averages);
|
||||
void graphColorsChanged();
|
||||
};
|
||||
|
||||
#endif // VNA_H
|
||||
|
@ -95,12 +95,6 @@ VNA::VNA(AppWindow *window, QString name)
|
||||
auto traceXY2 = new TraceXYPlot(traceModel);
|
||||
traceXY2->enableTrace(tS21, true);
|
||||
|
||||
connect(this, &VNA::graphColorsChanged, [=](){
|
||||
for (auto p : TracePlot::getPlots()) {
|
||||
p->updateGraphColors();
|
||||
}
|
||||
});
|
||||
|
||||
connect(&traceModel, &TraceModel::requiredExcitation, this, &VNA::ExcitationRequired);
|
||||
|
||||
central->splitVertically();
|
||||
@ -1644,11 +1638,6 @@ void VNA::EnableDeembedding(bool enable)
|
||||
enableDeembeddingAction->blockSignals(false);
|
||||
}
|
||||
|
||||
void VNA::updateGraphColors()
|
||||
{
|
||||
emit graphColorsChanged();
|
||||
}
|
||||
|
||||
void VNA::setAveragingMode(Averaging::Mode mode)
|
||||
{
|
||||
average.setMode(mode);
|
||||
|
@ -110,7 +110,6 @@ private slots:
|
||||
|
||||
signals:
|
||||
void CalibrationMeasurementsComplete(std::set<Calibration::Measurement> m);
|
||||
void graphColorsChanged();
|
||||
|
||||
private:
|
||||
bool CalibrationMeasurementActive() { return calWaitFirst || calMeasuring; }
|
||||
|
@ -184,14 +184,9 @@ AppWindow::AppWindow(QWidget *parent)
|
||||
StartTCPServer(p.SCPIServer.port);
|
||||
}
|
||||
}
|
||||
auto active = Mode::getActiveMode();
|
||||
|
||||
if(active == spectrumAnalyzer) {
|
||||
spectrumAnalyzer->updateGraphColors();
|
||||
}
|
||||
else if (active == vna) {
|
||||
vna->updateGraphColors();
|
||||
}
|
||||
auto active = Mode::getActiveMode();
|
||||
active->updateGraphColors();
|
||||
|
||||
// averaging mode may have changed, update for all relevant modes
|
||||
if(p.Acquisition.useMedianAveraging) {
|
||||
|
@ -338,3 +338,11 @@ void Mode::setName(const QString &value)
|
||||
tabbar->setTabText(findTabIndex(), name);
|
||||
}
|
||||
|
||||
void Mode::updateGraphColors()
|
||||
{
|
||||
if ((getType() == Type::SA) || getType() == Type::VNA) {
|
||||
for (auto p : TracePlot::getPlots()) {
|
||||
p->updateGraphColors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
virtual void shutdown(){}; // called when the application is about to exit
|
||||
QString getName() const;
|
||||
void setName(const QString &value);
|
||||
void updateGraphColors();
|
||||
static Mode *getActiveMode();
|
||||
static QString TypeToName(Type t);
|
||||
static Type TypeFromName(QString s);
|
||||
|
Loading…
Reference in New Issue
Block a user