From d0c829f14172d36460bcef1abf99c569de9524d6 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 29 May 2019 23:53:33 +0200 Subject: [PATCH] Test MI: added option to lock stream selection to spectrum display --- plugins/samplemimo/testmi/testmigui.cpp | 26 +++++++++++++++++++++++++ plugins/samplemimo/testmi/testmigui.h | 1 + plugins/samplemimo/testmi/testmigui.ui | 18 +++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/plugins/samplemimo/testmi/testmigui.cpp b/plugins/samplemimo/testmi/testmigui.cpp index 01c12b763..745369ee5 100644 --- a/plugins/samplemimo/testmi/testmigui.cpp +++ b/plugins/samplemimo/testmi/testmigui.cpp @@ -150,6 +150,15 @@ void TestMIGui::on_startStop_toggled(bool checked) void TestMIGui::on_streamIndex_currentIndexChanged(int index) { + if (ui->streamLock->isChecked()) + { + m_spectrumStreamIndex = index; + m_deviceUISet->m_deviceAPI->setSpectrumSinkInput(true, m_spectrumStreamIndex); + ui->spectrumSource->blockSignals(true); + ui->spectrumSource->setCurrentIndex(index); + ui->spectrumSource->blockSignals(false); + } + m_streamIndex = index; updateFileRecordStatus(); updateSampleRateAndFrequency(); @@ -161,6 +170,23 @@ void TestMIGui::on_spectrumSource_currentIndexChanged(int index) m_spectrumStreamIndex = index; m_deviceUISet->m_deviceAPI->setSpectrumSinkInput(true, m_spectrumStreamIndex); updateSampleRateAndFrequency(); + + if (ui->streamLock->isChecked()) + { + ui->streamIndex->blockSignals(true); + ui->streamIndex->setCurrentIndex(index); + ui->streamIndex->blockSignals(false); + m_streamIndex = index; + updateFileRecordStatus(); + displaySettings(); + } +} + +void TestMIGui::on_streamLock_toggled(bool checked) +{ + if (checked && (ui->streamIndex->currentIndex() != ui->spectrumSource->currentIndex())) { + ui->spectrumSource->setCurrentIndex(ui->streamIndex->currentIndex()); + } } void TestMIGui::on_centerFrequency_changed(quint64 value) diff --git a/plugins/samplemimo/testmi/testmigui.h b/plugins/samplemimo/testmi/testmigui.h index 0585f2674..eaff0fb03 100644 --- a/plugins/samplemimo/testmi/testmigui.h +++ b/plugins/samplemimo/testmi/testmigui.h @@ -85,6 +85,7 @@ private slots: void on_startStop_toggled(bool checked); void on_streamIndex_currentIndexChanged(int index); void on_spectrumSource_currentIndexChanged(int index); + void on_streamLock_toggled(bool checked); void on_centerFrequency_changed(quint64 value); void on_autoCorr_currentIndexChanged(int index); void on_frequencyShift_changed(qint64 value); diff --git a/plugins/samplemimo/testmi/testmigui.ui b/plugins/samplemimo/testmi/testmigui.ui index ed074e225..e21fe1946 100644 --- a/plugins/samplemimo/testmi/testmigui.ui +++ b/plugins/samplemimo/testmi/testmigui.ui @@ -102,6 +102,24 @@ + + + + Lock spectrum display to stream selection + + + + + + + :/unlocked.png + :/locked.png:/unlocked.png + + + true + + +