Use main window master timer for SSB demod spectrum and Channel Analyzer spectrum and scope

pull/6/head
f4exb 2015-08-01 04:07:09 +02:00
rodzic e6caa94593
commit 07f16bb176
6 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -71,6 +71,7 @@ public:
void setSampleRate(int sampleRate);
int getSampleRate() const { return m_sampleRate; }
Mode getDataMode() const { return m_mode; }
void connectTimer(const QTimer& timer);
signals:
void traceSizeChanged(int);

Wyświetl plik

@ -47,6 +47,9 @@ public:
// Sample Source stuff
void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
// R/O access to main window
const MainWindow* getMainWindow() const { return m_mainWindow; }
protected:
PluginManager* m_pluginManager;
MainWindow* m_mainWindow;

Wyświetl plik

@ -11,6 +11,7 @@
#include "plugin/pluginapi.h"
#include "util/simpleserializer.h"
#include "gui/basicchannelsettingswidget.h"
#include "mainwindow.h"
#include <iostream>
#include "chanalyzer.h"
@ -277,6 +278,9 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, QWidget* parent) :
ui->glSpectrum->setDisplayWaterfall(true);
ui->glSpectrum->setDisplayMaxHold(true);
ui->glSpectrum->setSsbSpectrum(true);
ui->glSpectrum->connectTimer(m_pluginAPI->getMainWindow()->getMasterTimer());
ui->glScope->connectTimer(m_pluginAPI->getMainWindow()->getMasterTimer());
m_channelMarker = new ChannelMarker(this);
m_channelMarker->setColor(Qt::gray);

Wyświetl plik

@ -12,6 +12,7 @@
#include "plugin/pluginapi.h"
#include "util/simpleserializer.h"
#include "gui/basicchannelsettingswidget.h"
#include "mainwindow.h"
#include <iostream>
@ -238,6 +239,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
ui->glSpectrum->setDisplayWaterfall(true);
ui->glSpectrum->setDisplayMaxHold(true);
ui->glSpectrum->setSsbSpectrum(true);
ui->glSpectrum->connectTimer(m_pluginAPI->getMainWindow()->getMasterTimer());
m_channelMarker = new ChannelMarker(this);
m_channelMarker->setColor(Qt::green);

Wyświetl plik

@ -1435,3 +1435,11 @@ void GLScope::setTriggerPre(Real triggerPre)
{
m_triggerPre = triggerPre;
}
void GLScope::connectTimer(const QTimer& timer)
{
std::cerr << "GLScope::connectTimer" << std::endl;
disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
connect(&timer, SIGNAL(timeout()), this, SLOT(tick()));
m_timer.stop();
}

Wyświetl plik

@ -1546,6 +1546,8 @@ void GLSpectrum::setWaterfallShare(Real waterfallShare)
void GLSpectrum::connectTimer(const QTimer& timer)
{
std::cerr << "GLSpectrum::connectTimer" << std::endl;
disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
connect(&timer, SIGNAL(timeout()), this, SLOT(tick()));
m_timer.stop();
}