Implemented Tx spectrum display in main window for future use

pull/6/head
f4exb 2015-10-03 03:56:03 +02:00
rodzic cf9263f1ff
commit c46741bd72
3 zmienionych plików z 73 dodań i 49 usunięć

Wyświetl plik

@ -77,7 +77,8 @@ private:
MainSettings m_settings;
SpectrumVis* m_spectrumVis;
SpectrumVis* m_rxSpectrumVis;
SpectrumVis* m_txSpectrumVis;
FileSink *m_fileSink;
DSPEngine* m_dspEngine;

Wyświetl plik

@ -58,7 +58,6 @@ MainWindow::MainWindow(QWidget* parent) :
m_dspEngine->start();
ui->setupUi(this);
delete ui->mainToolBar;
createStatusBar();
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
@ -68,21 +67,21 @@ MainWindow::MainWindow(QWidget* parent) :
// work around broken Qt dock widget ordering
removeDockWidget(ui->inputDock);
removeDockWidget(ui->rxDisplayDock);
removeDockWidget(ui->spectraDisplayDock);
removeDockWidget(ui->presetDock);
removeDockWidget(ui->channelDock);
addDockWidget(Qt::LeftDockWidgetArea, ui->inputDock);
addDockWidget(Qt::LeftDockWidgetArea, ui->rxDisplayDock);
addDockWidget(Qt::LeftDockWidgetArea, ui->spectraDisplayDock);
addDockWidget(Qt::LeftDockWidgetArea, ui->presetDock);
addDockWidget(Qt::RightDockWidgetArea, ui->channelDock);
ui->inputDock->show();
ui->rxDisplayDock->show();
ui->spectraDisplayDock->show();
ui->presetDock->show();
ui->channelDock->show();
ui->menu_Window->addAction(ui->inputDock->toggleViewAction());
ui->menu_Window->addAction(ui->rxDisplayDock->toggleViewAction());
ui->menu_Window->addAction(ui->spectraDisplayDock->toggleViewAction());
ui->menu_Window->addAction(ui->presetDock->toggleViewAction());
ui->menu_Window->addAction(ui->channelDock->toggleViewAction());
@ -101,10 +100,19 @@ MainWindow::MainWindow(QWidget* parent) :
m_pluginManager->fillSampleSourceSelector(ui->sampleSource);
ui->sampleSource->blockSignals(sampleSourceSignalsBlocked);
m_spectrumVis = new SpectrumVis(ui->glSpectrum);
ui->glSpectrum->connectTimer(m_masterTimer);
ui->glSpectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
m_dspEngine->addSink(m_spectrumVis);
// Disable Tx spectrum by default. Enabled if source supports Tx.
ui->tabSpectra->setTabEnabled(1, false);
ui->tabSpectraGUI->setTabEnabled(1, false);
m_rxSpectrumVis = new SpectrumVis(ui->rxSpectrum);
ui->rxSpectrum->connectTimer(m_masterTimer);
ui->rxSpectrumGUI->setBuddies(m_rxSpectrumVis->getInputMessageQueue(), m_rxSpectrumVis, ui->rxSpectrum);
m_dspEngine->addSink(m_rxSpectrumVis);
m_txSpectrumVis = new SpectrumVis(ui->txSpectrum);
ui->txSpectrum->connectTimer(m_masterTimer);
ui->txSpectrumGUI->setBuddies(m_txSpectrumVis->getInputMessageQueue(), m_txSpectrumVis, ui->txSpectrum);
//m_dspEngine->addSink(m_rxSpectrumVis);
m_fileSink = new FileSink();
m_dspEngine->addSink(m_fileSink);
@ -149,9 +157,9 @@ MainWindow::~MainWindow()
m_pluginManager->freeAll();
m_dspEngine->removeSink(m_fileSink);
m_dspEngine->removeSink(m_spectrumVis);
m_dspEngine->removeSink(m_rxSpectrumVis);
delete m_fileSink;
delete m_spectrumVis;
delete m_rxSpectrumVis;
delete m_pluginManager;
m_dspEngine->stop();
@ -178,12 +186,12 @@ void MainWindow::addViewAction(QAction* action)
void MainWindow::addChannelMarker(ChannelMarker* channelMarker)
{
ui->glSpectrum->addChannelMarker(channelMarker);
ui->rxSpectrum->addChannelMarker(channelMarker);
}
void MainWindow::removeChannelMarker(ChannelMarker* channelMarker)
{
ui->glSpectrum->removeChannelMarker(channelMarker);
ui->rxSpectrum->removeChannelMarker(channelMarker);
}
void MainWindow::setInputGUI(QWidget* gui)
@ -213,7 +221,7 @@ void MainWindow::loadPresetSettings(const Preset* preset)
qPrintable(preset->getGroup()),
qPrintable(preset->getDescription()));
ui->glSpectrumGUI->deserialize(preset->getSpectrumConfig());
ui->rxSpectrumGUI->deserialize(preset->getSpectrumConfig());
m_pluginManager->loadSettings(preset);
// has to be last step
@ -234,7 +242,7 @@ void MainWindow::savePresetSettings(Preset* preset)
qPrintable(preset->getGroup()),
qPrintable(preset->getDescription()));
preset->setSpectrumConfig(ui->glSpectrumGUI->serialize());
preset->setSpectrumConfig(ui->rxSpectrumGUI->serialize());
preset->clearChannels();
m_pluginManager->saveSettings(preset);
@ -270,12 +278,12 @@ void MainWindow::closeEvent(QCloseEvent*)
void MainWindow::updateCenterFreqDisplay()
{
ui->glSpectrum->setCenterFrequency(m_centerFrequency);
ui->rxSpectrum->setCenterFrequency(m_centerFrequency);
}
void MainWindow::updateSampleRate()
{
ui->glSpectrum->setSampleRate(m_sampleRate);
ui->rxSpectrum->setSampleRate(m_sampleRate);
m_sampleRateWidget->setText(tr("Rate: %1 kHz").arg((float)m_sampleRate / 1000));
}

Wyświetl plik

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1012</width>
<height>600</height>
<height>605</height>
</rect>
</property>
<property name="windowTitle">
@ -35,19 +35,34 @@
<number>0</number>
</property>
<item>
<widget class="GLSpectrum" name="glSpectrum" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QTabWidget" name="tabSpectra">
<property name="font">
<font>
<family>Monospace</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="tabPosition">
<enum>QTabWidget::East</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
</property>
<widget class="GLSpectrum" name="rxSpectrum">
<attribute name="title">
<string>Rx</string>
</attribute>
</widget>
<widget class="GLSpectrum" name="txSpectrum">
<attribute name="title">
<string>Tx</string>
</attribute>
</widget>
</widget>
</item>
</layout>
@ -110,14 +125,6 @@
<addaction name="menu_Window"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<widget class="QDockWidget" name="presetDock">
<property name="windowTitle">
@ -289,9 +296,9 @@
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="rxDisplayDock">
<widget class="QDockWidget" name="spectraDisplayDock">
<property name="windowTitle">
<string>Rx Display</string>
<string>Spectrum Display</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
@ -320,7 +327,26 @@
<number>2</number>
</property>
<item>
<widget class="GLSpectrumGUI" name="glSpectrumGUI" native="true"/>
<widget class="QTabWidget" name="tabSpectraGUI">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="GLSpectrumGUI" name="rxSpectrumGUI">
<attribute name="title">
<string>Rx</string>
</attribute>
</widget>
<widget class="GLSpectrumGUI" name="txSpectrumGUI">
<attribute name="title">
<string>Tx</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
@ -392,17 +418,6 @@
</layout>
</widget>
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<action name="action_Exit">
<property name="text">
<string>E&amp;xit</string>