diff --git a/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp b/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp index 7a1283a..d31a4d9 100644 --- a/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp +++ b/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp @@ -46,9 +46,12 @@ SpectrumAnalyzer::SpectrumAnalyzer(AppWindow *window, QString name) : Mode(window, name, "SA"), - central(new TileWidget(traceModel, window)), + central(new QScrollArea), + tiles(new TileWidget(traceModel, window)), firstPointTime(0) { + central->setWidget(tiles); + central->setWidgetResizable(true); changingSettings = false; averages = 1; singleSweep = false; @@ -385,7 +388,7 @@ nlohmann::json SpectrumAnalyzer::toJSON() j["sweep"] = sweep; j["traces"] = traceModel.toJSON(); - j["tiles"] = central->toJSON(); + j["tiles"] = tiles->toJSON(); j["markers"] = markerModel->toJSON(); return j; } @@ -399,7 +402,7 @@ void SpectrumAnalyzer::fromJSON(nlohmann::json j) traceModel.fromJSON(j["traces"]); } if(j.contains("tiles")) { - central->fromJSON(j["tiles"]); + tiles->fromJSON(j["tiles"]); } if(j.contains("markers")) { markerModel->fromJSON(j["markers"]); @@ -1059,7 +1062,7 @@ void SpectrumAnalyzer::SetupSCPI() return average.getLevel() == averages ? "TRUE" : "FALSE"; })); scpi_acq->add(new SCPICommand("LIMit", nullptr, [=](QStringList) -> QString { - return central->allLimitsPassing() ? "PASS" : "FAIL"; + return tiles->allLimitsPassing() ? "PASS" : "FAIL"; })); scpi_acq->add(new SCPICommand("SIGid", [=](QStringList params) -> QString { if (params.size() != 1) { @@ -1257,13 +1260,13 @@ void SpectrumAnalyzer::StoreSweepSettings() void SpectrumAnalyzer::createDefaultTracesAndGraphs(int ports) { - central->clear(); + tiles->clear(); auto traceXY = new TraceXYPlot(traceModel); traceXY->setYAxis(0, YAxis::Type::Magnitude, false, false, -120,0,10); traceXY->setYAxis(1, YAxis::Type::Disabled, false, true, 0,0,1); traceXY->updateSpan(settings.freqStart, settings.freqStop); - central->setPlot(traceXY); + tiles->setPlot(traceXY); QColor defaultColors[] = {Qt::yellow, Qt::blue, Qt::red, Qt::green, Qt::gray, Qt::cyan, Qt::magenta, Qt::white}; diff --git a/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.h b/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.h index 42dd25e..fa86c83 100644 --- a/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.h +++ b/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.h @@ -12,6 +12,7 @@ #include #include #include +#include class SpectrumAnalyzer : public Mode { @@ -99,7 +100,8 @@ private: MarkerModel *markerModel; Averaging average; - TileWidget *central; + QScrollArea *central; + TileWidget *tiles; QCheckBox *cbSignalID; QComboBox *cbWindowType, *cbDetector; QComboBox *cbTrackGenPort; diff --git a/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp b/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp index c597722..42b609b 100644 --- a/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp +++ b/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp @@ -52,13 +52,17 @@ #include #include #include +#include VNA::VNA(AppWindow *window, QString name) : Mode(window, name, "VNA"), deembedding(traceModel), deembedding_active(false), - central(new TileWidget(traceModel)) + central(new QScrollArea), + tiles(new TileWidget(traceModel)) { + central->setWidget(tiles); + central->setWidgetResizable(true); averages = 1; singleSweep = false; calMeasuring = false; @@ -734,7 +738,7 @@ nlohmann::json VNA::toJSON() j["sweep"] = sweep; j["traces"] = traceModel.toJSON(); - j["tiles"] = central->toJSON(); + j["tiles"] = tiles->toJSON(); j["markers"] = markerModel->toJSON(); j["de-embedding"] = deembedding.toJSON(); j["de-embedding_enabled"] = deembedding_active; @@ -750,7 +754,7 @@ void VNA::fromJSON(nlohmann::json j) traceModel.fromJSON(j["traces"]); } if(j.contains("tiles")) { - central->fromJSON(j["tiles"]); + tiles->fromJSON(j["tiles"]); } if(j.contains("markers")) { markerModel->fromJSON(j["markers"]); @@ -1359,7 +1363,7 @@ void VNA::SetupSCPI() return average.getLevel() == averages ? SCPI::getResultName(SCPI::Result::True) : SCPI::getResultName(SCPI::Result::False); })); scpi_acq->add(new SCPICommand("LIMit", nullptr, [=](QStringList) -> QString { - return central->allLimitsPassing() ? "PASS" : "FAIL"; + return tiles->allLimitsPassing() ? "PASS" : "FAIL"; })); scpi_acq->add(new SCPICommand("SINGLE", [=](QStringList params) -> QString { bool single; @@ -1531,8 +1535,8 @@ void VNA::createDefaultTracesAndGraphs(int ports) } } // Add created graphs to tiles - central->clear(); - TileWidget *tile = central; + tiles->clear(); + TileWidget *tile = tiles; for(int i=0;i= 3) { // default split at the middle does not result in all plots being the same size, adjust - tile = central; + tile = tiles; for(int i=0;i #include +#include #include class VNA : public Mode @@ -168,7 +169,8 @@ private: QLabel *lAverages; QLabel *calLabel; - TileWidget *central; + TileWidget *tiles; + QScrollArea *central; signals: void deviceInitialized(); diff --git a/Software/PC_Application/LibreVNA-GUI/appwindow.cpp b/Software/PC_Application/LibreVNA-GUI/appwindow.cpp index e25c353..ae9b236 100644 --- a/Software/PC_Application/LibreVNA-GUI/appwindow.cpp +++ b/Software/PC_Application/LibreVNA-GUI/appwindow.cpp @@ -1,4 +1,4 @@ -#include "appwindow.h" +#include "appwindow.h" #include "unit.h" #include "CustomWidgets/toggleswitch.h" @@ -58,6 +58,7 @@ #include #include #include +#include using namespace std;