mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-07 23:43:42 +00:00
mode: move responsabilities from mode to modehandler
- Pass the following responsabilities from mode to mode handler: - active / deactive target mode - get active mode - create new modes - Move back setting averaging mode when settings are updated using getModes() method instead of handling logic in mode handler.
This commit is contained in:
parent
f56e32488e
commit
2fbe6e84be
17 changed files with 142 additions and 126 deletions
|
|
@ -22,6 +22,7 @@
|
|||
#include "Calibration/manualcalibrationdialog.h"
|
||||
#include "Util/util.h"
|
||||
#include "Tools/parameters.h"
|
||||
#include "modehandler.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QVBoxLayout>
|
||||
|
|
@ -801,7 +802,7 @@ using namespace std;
|
|||
|
||||
void VNA::NewDatapoint(Protocol::Datapoint d)
|
||||
{
|
||||
if(Mode::getActiveMode() != this) {
|
||||
if(window->getModeHandler()->getActiveMode() != this) {
|
||||
// ignore
|
||||
return;
|
||||
}
|
||||
|
|
@ -972,7 +973,7 @@ void VNA::SettingsChanged(bool resetTraces, std::function<void (Device::Transmis
|
|||
s.cdbm_excitation_stop = stop * 100;
|
||||
s.logSweep = false;
|
||||
}
|
||||
if(window->getDevice() && Mode::getActiveMode() == this) {
|
||||
if(window->getDevice() && window->getModeHandler()->getActiveMode() == this) {
|
||||
if(s.excitePort1 == 0 && s.excitePort2 == 0) {
|
||||
// no signal at either port, just set the device to idle
|
||||
window->getDevice()->SetIdle();
|
||||
|
|
@ -1486,7 +1487,7 @@ void VNA::SetupSCPI()
|
|||
return ret;
|
||||
}));
|
||||
scpi_cal->add(new SCPICommand("MEASure", [=](QStringList params) -> QString {
|
||||
if(params.size() != 1 || CalibrationMeasurementActive() || !window->getDevice() || Mode::getActiveMode() != this) {
|
||||
if(params.size() != 1 || CalibrationMeasurementActive() || !window->getDevice() || window->getModeHandler()->getActiveMode() != this) {
|
||||
// no measurement specified, still busy or invalid mode
|
||||
return SCPI::getResultName(SCPI::Result::Error);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue