mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-04 14:07:30 +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
|
|
@ -17,6 +17,7 @@
|
|||
#include "Device/firmwareupdatedialog.h"
|
||||
#include "preferences.h"
|
||||
#include "Generator/signalgenwidget.h"
|
||||
#include "modehandler.h"
|
||||
|
||||
#include <QDockWidget>
|
||||
#include <QDesktopWidget>
|
||||
|
|
@ -433,7 +434,7 @@ using namespace std;
|
|||
|
||||
void SpectrumAnalyzer::NewDatapoint(Protocol::SpectrumAnalyzerResult d)
|
||||
{
|
||||
if(Mode::getActiveMode() != this) {
|
||||
if(window->getModeHandler()->getActiveMode() != this) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -570,7 +571,7 @@ void SpectrumAnalyzer::SettingsChanged()
|
|||
}
|
||||
}
|
||||
|
||||
if(window->getDevice() && Mode::getActiveMode() == this) {
|
||||
if(window->getDevice() && window->getModeHandler()->getActiveMode() == this) {
|
||||
window->getDevice()->Configure(settings, [=](Device::TransmissionResult res){
|
||||
// device received command
|
||||
changingSettings = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue