| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							| 
									
										
										
										
											2023-11-18 10:07:41 +01:00
										 |  |  | // Copyright (C) 2016-2020, 2022 Edouard Griffiths, F4EXB <f4exb06@gmail.com>    //
 | 
					
						
							|  |  |  | // Copyright (C) 2022-2023 Jon Beniston, M7RCE <jon@beniston.com>                //
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is free software; you can redistribute it and/or modify          //
 | 
					
						
							|  |  |  | // it under the terms of the GNU General Public License as published by          //
 | 
					
						
							|  |  |  | // the Free Software Foundation as version 3 of the License, or                  //
 | 
					
						
							| 
									
										
										
										
											2019-04-11 06:57:41 +02:00
										 |  |  | // (at your option) any later version.                                           //
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful,               //
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of                //
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                  //
 | 
					
						
							|  |  |  | // GNU General Public License V3 for more details.                               //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU General Public License             //
 | 
					
						
							|  |  |  | // along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QDebug>
 | 
					
						
							|  |  |  | #include <QMessageBox>
 | 
					
						
							| 
									
										
										
										
											2020-04-01 23:17:26 +02:00
										 |  |  | #include <QFileDialog>
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "sdrplaygui.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  | #include "device/deviceapi.h"
 | 
					
						
							| 
									
										
										
										
											2017-10-30 00:02:28 +01:00
										 |  |  | #include "device/deviceuiset.h"
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "ui_sdrplaygui.h"
 | 
					
						
							|  |  |  | #include "gui/colormapper.h"
 | 
					
						
							|  |  |  | #include "gui/glspectrum.h"
 | 
					
						
							| 
									
										
										
										
											2018-12-26 17:35:55 +01:00
										 |  |  | #include "gui/basicdevicesettingsdialog.h"
 | 
					
						
							| 
									
										
										
										
											2022-12-20 10:31:15 +00:00
										 |  |  | #include "gui/dialpopup.h"
 | 
					
						
							|  |  |  | #include "gui/dialogpositioner.h"
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | #include "dsp/dspengine.h"
 | 
					
						
							|  |  |  | #include "dsp/dspcommands.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-30 00:45:23 +01:00
										 |  |  | SDRPlayGui::SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent) : | 
					
						
							| 
									
										
										
										
											2020-10-05 19:23:13 +02:00
										 |  |  |     DeviceGUI(parent), | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     ui(new Ui::SDRPlayGui), | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |     m_doApplySettings(true), | 
					
						
							| 
									
										
										
										
											2017-10-14 07:02:21 +02:00
										 |  |  |     m_forceSettings(true) | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2022-05-13 22:24:48 +02:00
										 |  |  |     m_deviceUISet = deviceUISet; | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     setAttribute(Qt::WA_DeleteOnClose, true); | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |     m_sampleSource = (SDRPlayInput*) m_deviceUISet->m_deviceAPI->getSampleSource(); | 
					
						
							| 
									
										
										
										
											2017-04-14 02:22:37 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     ui->setupUi(getContents()); | 
					
						
							| 
									
										
										
										
											2022-11-09 15:53:44 +00:00
										 |  |  |     sizeToContents(); | 
					
						
							| 
									
										
										
										
											2022-04-24 02:13:18 +02:00
										 |  |  |     getContents()->setStyleSheet("#SDRPlayGui { background-color: rgb(64, 64, 64); }"); | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     m_helpURL = "plugins/samplesource/sdrplay/readme.md"; | 
					
						
							| 
									
										
										
										
											2017-05-16 18:27:36 +02:00
										 |  |  |     ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); | 
					
						
							| 
									
										
										
										
											2022-10-15 03:04:29 +02:00
										 |  |  |     ui->centerFrequency->setValueRange(9, 10U, 999999999U); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ui->fBand->clear(); | 
					
						
							| 
									
										
										
										
											2017-05-25 20:13:34 +02:00
										 |  |  |     for (unsigned int i = 0; i < SDRPlayBands::getNbBands(); i++) | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     { | 
					
						
							|  |  |  |         ui->fBand->addItem(SDRPlayBands::getBandName(i)); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->ifFrequency->clear(); | 
					
						
							| 
									
										
										
										
											2017-05-25 20:13:34 +02:00
										 |  |  |     for (unsigned int i = 0; i < SDRPlayIF::getNbIFs(); i++) | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |         ui->ifFrequency->addItem(QString::number(SDRPlayIF::getIF(i)/1000)); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->samplerate->clear(); | 
					
						
							| 
									
										
										
										
											2017-05-25 20:13:34 +02:00
										 |  |  |     for (unsigned int i = 0; i < SDRPlaySampleRates::getNbRates(); i++) | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |         ui->samplerate->addItem(QString::number(SDRPlaySampleRates::getRate(i)/1000)); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->bandwidth->clear(); | 
					
						
							| 
									
										
										
										
											2017-05-25 20:13:34 +02:00
										 |  |  |     for (unsigned int i = 0; i < SDRPlayBandwidths::getNbBandwidths(); i++) | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |         ui->bandwidth->addItem(QString::number(SDRPlayBandwidths::getBandwidth(i)/1000)); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); | 
					
						
							|  |  |  |     connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); | 
					
						
							|  |  |  |     m_statusTimer.start(500); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-17 01:31:50 +02:00
										 |  |  |     connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:35:55 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     displaySettings(); | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     makeUIConnections(); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-17 01:23:54 +02:00
										 |  |  |     connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); | 
					
						
							| 
									
										
										
										
											2018-05-25 19:28:57 +02:00
										 |  |  |     m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue); | 
					
						
							| 
									
										
										
										
											2022-12-20 10:31:15 +00:00
										 |  |  |     DialPopup::addPopupsToChildDials(this); | 
					
						
							| 
									
										
										
										
											2023-11-13 20:51:03 +00:00
										 |  |  |     m_resizer.enableChildMouseTracking(); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SDRPlayGui::~SDRPlayGui() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2022-10-05 15:40:09 +01:00
										 |  |  |     m_statusTimer.stop(); | 
					
						
							|  |  |  |     m_updateTimer.stop(); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     delete ui; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::destroy() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     delete this; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::resetToDefaults() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_settings.resetToDefaults(); | 
					
						
							|  |  |  |     displaySettings(); | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_forceSettings = true; | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | QByteArray SDRPlayGui::serialize() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return m_settings.serialize(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bool SDRPlayGui::deserialize(const QByteArray& data) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if(m_settings.deserialize(data)) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         displaySettings(); | 
					
						
							| 
									
										
										
										
											2017-10-14 07:02:21 +02:00
										 |  |  |         m_forceSettings = true; | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |         sendSettings(); | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         resetToDefaults(); | 
					
						
							|  |  |  |         return false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bool SDRPlayGui::handleMessage(const Message& message) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-28 03:21:48 +01:00
										 |  |  |     if (SDRPlayInput::MsgConfigureSDRPlay::match(message)) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         const SDRPlayInput::MsgConfigureSDRPlay& cfg = (SDRPlayInput::MsgConfigureSDRPlay&) message; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if (cfg.getForce()) { | 
					
						
							|  |  |  |             m_settings = cfg.getSettings(); | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             m_settings.applySettings(cfg.getSettingsKeys(), cfg.getSettings()); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-28 03:21:48 +01:00
										 |  |  |         blockApplySettings(true); | 
					
						
							|  |  |  |         displaySettings(); | 
					
						
							|  |  |  |         blockApplySettings(false); | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else if (SDRPlayInput::MsgReportSDRPlayGains::match(message)) | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  |     	qDebug() << "SDRPlayGui::handleMessage: MsgReportSDRPlayGains"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     	SDRPlayInput::MsgReportSDRPlayGains msg = (SDRPlayInput::MsgReportSDRPlayGains&) message; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     	if (m_settings.m_tunerGainMode) | 
					
						
							|  |  |  |     	{ | 
					
						
							|  |  |  |             ui->gainLNA->setChecked(msg.getLNAGain() != 0); | 
					
						
							|  |  |  |             ui->gainMixer->setChecked(msg.getMixerGain() != 0); | 
					
						
							|  |  |  |             ui->gainBaseband->setValue(msg.getBasebandGain()); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-04 08:59:16 +01:00
										 |  |  |             QString gainText = QStringLiteral("%1").arg(msg.getBasebandGain(), 2, 10, QLatin1Char('0')); | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  |             ui->gainBasebandText->setText(gainText); | 
					
						
							|  |  |  |     	} | 
					
						
							|  |  |  |     	else | 
					
						
							|  |  |  |     	{ | 
					
						
							|  |  |  |     	    ui->gainTuner->setValue(msg.getTunerGain()); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-04 08:59:16 +01:00
										 |  |  |             QString gainText = QStringLiteral("%1").arg(msg.getTunerGain(), 3, 10, QLatin1Char('0')); | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  |             ui->gainTunerText->setText(gainText); | 
					
						
							|  |  |  |     	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |     else if (SDRPlayInput::MsgStartStop::match(message)) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         SDRPlayInput::MsgStartStop& notif = (SDRPlayInput::MsgStartStop&) message; | 
					
						
							|  |  |  |         blockApplySettings(true); | 
					
						
							|  |  |  |         ui->startStop->setChecked(notif.getStartStop()); | 
					
						
							|  |  |  |         blockApplySettings(false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     else | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-17 00:06:09 +02:00
										 |  |  | void SDRPlayGui::handleInputMessages() | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     Message* message; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-17 00:06:09 +02:00
										 |  |  |     while ((message = m_inputMessageQueue.pop()) != 0) | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2017-09-17 00:06:09 +02:00
										 |  |  |         qDebug("SDRPlayGui::handleInputMessages: message: %s", message->getIdentifier()); | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if (DSPSignalNotification::match(*message)) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             DSPSignalNotification* notif = (DSPSignalNotification*) message; | 
					
						
							|  |  |  |             m_sampleRate = notif->getSampleRate(); | 
					
						
							|  |  |  |             m_deviceCenterFrequency = notif->getCenterFrequency(); | 
					
						
							| 
									
										
										
										
											2017-09-17 00:06:09 +02:00
										 |  |  |             qDebug("SDRPlayGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency()); | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |             updateSampleRateAndFrequency(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             delete message; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2017-09-17 00:06:09 +02:00
										 |  |  |         else | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |             if (handleMessage(*message)) { | 
					
						
							| 
									
										
										
										
											2017-09-17 00:06:09 +02:00
										 |  |  |                 delete message; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::updateSampleRateAndFrequency() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-10-30 00:02:28 +01:00
										 |  |  |     m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate); | 
					
						
							|  |  |  |     m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |     ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | void SDRPlayGui::displaySettings() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |     ui->ppm->setValue(m_settings.m_LOppmTenths); | 
					
						
							|  |  |  |     ui->ppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1))); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ui->samplerate->setCurrentIndex(m_settings.m_devSampleRateIndex); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->dcOffset->setChecked(m_settings.m_dcBlock); | 
					
						
							|  |  |  |     ui->iqImbalance->setChecked(m_settings.m_iqCorrection); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->fBand->setCurrentIndex(m_settings.m_frequencyBandIndex); | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |     ui->bandwidth->setCurrentIndex(m_settings.m_bandwidthIndex); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     ui->ifFrequency->setCurrentIndex(m_settings.m_ifFrequencyIndex); | 
					
						
							|  |  |  |     ui->samplerate->setCurrentIndex(m_settings.m_devSampleRateIndex); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->decim->setCurrentIndex(m_settings.m_log2Decim); | 
					
						
							|  |  |  |     ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-18 03:01:47 +01:00
										 |  |  |     ui->gainTunerOn->setChecked(m_settings.m_tunerGainMode); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (m_settings.m_tunerGainMode) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ui->gainTuner->setEnabled(true); | 
					
						
							|  |  |  |         ui->gainLNA->setEnabled(false); | 
					
						
							|  |  |  |         ui->gainMixer->setEnabled(false); | 
					
						
							|  |  |  |         ui->gainBaseband->setEnabled(false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         int gain = m_settings.m_tunerGain; | 
					
						
							|  |  |  |         ui->gainTuner->setValue(gain); | 
					
						
							| 
									
										
										
										
											2020-11-04 08:59:16 +01:00
										 |  |  |         QString gainText = QStringLiteral("%1").arg(gain, 3, 10, QLatin1Char('0')); | 
					
						
							| 
									
										
										
										
											2016-11-18 03:01:47 +01:00
										 |  |  |         ui->gainTunerText->setText(gainText); | 
					
						
							|  |  |  |         m_settings.m_tunerGain = gain; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ui->gainTuner->setEnabled(false); | 
					
						
							|  |  |  |         ui->gainLNA->setEnabled(true); | 
					
						
							|  |  |  |         ui->gainMixer->setEnabled(true); | 
					
						
							|  |  |  |         ui->gainBaseband->setEnabled(true); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ui->gainLNA->setChecked(m_settings.m_lnaOn != 0); | 
					
						
							|  |  |  |         ui->gainMixer->setChecked(m_settings.m_mixerAmpOn != 0); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         int gain = m_settings.m_basebandGain; | 
					
						
							|  |  |  |         ui->gainBaseband->setValue(gain); | 
					
						
							| 
									
										
										
										
											2020-11-04 08:59:16 +01:00
										 |  |  |         QString gainText = QStringLiteral("%1").arg(gain, 2, 10, QLatin1Char('0')); | 
					
						
							| 
									
										
										
										
											2016-11-18 03:01:47 +01:00
										 |  |  |         ui->gainBasebandText->setText(gainText); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::sendSettings() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     if (!m_updateTimer.isActive()) { | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |         m_updateTimer.start(100); | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::updateHardware() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     qDebug() << "SDRPlayGui::updateHardware"; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     SDRPlayInput::MsgConfigureSDRPlay* message = SDRPlayInput::MsgConfigureSDRPlay::create( m_settings, m_settingsKeys, m_forceSettings); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     m_sampleSource->getInputMessageQueue()->push(message); | 
					
						
							| 
									
										
										
										
											2017-10-14 07:02:21 +02:00
										 |  |  |     m_forceSettings = false; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.clear(); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     m_updateTimer.stop(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  | void SDRPlayGui::updateStatus() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |     int state = m_deviceUISet->m_deviceAPI->state(); | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     if(m_lastEngineState != state) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         switch(state) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |             case DeviceAPI::StNotStarted: | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |                 ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); | 
					
						
							|  |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |             case DeviceAPI::StIdle: | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |                 ui->startStop->setStyleSheet("QToolButton { background-color : blue; }"); | 
					
						
							|  |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |             case DeviceAPI::StRunning: | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |                 ui->startStop->setStyleSheet("QToolButton { background-color : green; }"); | 
					
						
							|  |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |             case DeviceAPI::StError: | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |                 ui->startStop->setStyleSheet("QToolButton { background-color : red; }"); | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |                 QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage()); | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |                 break; | 
					
						
							|  |  |  |             default: | 
					
						
							|  |  |  |                 break; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         m_lastEngineState = state; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | void SDRPlayGui::on_centerFrequency_changed(quint64 value) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |     m_settings.m_centerFrequency = value * 1000; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("centerFrequency"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_ppm_valueChanged(int value) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |     m_settings.m_LOppmTenths = value; | 
					
						
							|  |  |  |     ui->ppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1))); | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("LOppmTenths"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_dcOffset_toggled(bool checked) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |     qDebug("SDRPlayGui::on_dcOffset_toggled: %s", checked ? "on" : "off"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     m_settings.m_dcBlock = checked; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("dcBlock"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_iqImbalance_toggled(bool checked) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_settings.m_iqCorrection = checked; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("iqCorrection"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  | void SDRPlayGui::on_fBand_currentIndexChanged(int index) | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     ui->centerFrequency->setValueRange( | 
					
						
							| 
									
										
										
										
											2022-10-15 03:04:29 +02:00
										 |  |  |             9, | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |             SDRPlayBands::getBandLow(index), | 
					
						
							|  |  |  |             SDRPlayBands::getBandHigh(index)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->centerFrequency->setValue((SDRPlayBands::getBandLow(index)+SDRPlayBands::getBandHigh(index)) / 2); | 
					
						
							| 
									
										
										
										
											2016-11-14 00:38:43 +01:00
										 |  |  |     m_settings.m_centerFrequency = (SDRPlayBands::getBandLow(index)+SDRPlayBands::getBandHigh(index)) * 500; | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     m_settings.m_frequencyBandIndex = index; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("centerFrequency"); | 
					
						
							|  |  |  |     m_settingsKeys.append("frequencyBandIndex"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_bandwidth_currentIndexChanged(int index) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_settings.m_bandwidthIndex = index; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("bandwidthIndex"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_samplerate_currentIndexChanged(int index) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_settings.m_devSampleRateIndex = index; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("devSampleRateIndex"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  | void SDRPlayGui::on_ifFrequency_currentIndexChanged(int index) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_settings.m_ifFrequencyIndex = index; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("ifFrequencyIndex"); | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | void SDRPlayGui::on_decim_currentIndexChanged(int index) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_settings.m_log2Decim = index; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("log2Decim"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_fcPos_currentIndexChanged(int index) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_settings.m_fcPos = (SDRPlaySettings::fcPos_t) index; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("fcPos"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-17 18:35:17 +01:00
										 |  |  | void SDRPlayGui::on_gainTunerOn_toggled(bool checked) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  |     qDebug("SDRPlayGui::on_gainTunerOn_toggled: %s", checked ? "on" : "off"); | 
					
						
							|  |  |  |     m_settings.m_tunerGainMode = true; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("tunerGainMode"); | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  |     ui->gainTuner->setEnabled(true); | 
					
						
							|  |  |  |     ui->gainLNA->setEnabled(false); | 
					
						
							|  |  |  |     ui->gainMixer->setEnabled(false); | 
					
						
							|  |  |  |     ui->gainBaseband->setEnabled(false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-11-17 18:35:17 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_gainTuner_valueChanged(int value) | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  |     int gain = value; | 
					
						
							| 
									
										
										
										
											2020-11-04 08:59:16 +01:00
										 |  |  |     QString gainText = QStringLiteral("%1").arg(gain, 3, 10, QLatin1Char('0')); | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     ui->gainTunerText->setText(gainText); | 
					
						
							| 
									
										
										
										
											2016-11-17 18:35:17 +01:00
										 |  |  |     m_settings.m_tunerGain = gain; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("tunerGain"); | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-16 02:38:21 +01:00
										 |  |  |     sendSettings(); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2016-11-13 02:59:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-17 18:35:17 +01:00
										 |  |  | void SDRPlayGui::on_gainManualOn_toggled(bool checked) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  |     qDebug("SDRPlayGui::on_gainManualOn_toggled: %s", checked ? "on" : "off"); | 
					
						
							|  |  |  |     m_settings.m_tunerGainMode = false; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("tunerGainMode"); | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  |     ui->gainTuner->setEnabled(false); | 
					
						
							|  |  |  |     ui->gainLNA->setEnabled(true); | 
					
						
							|  |  |  |     ui->gainMixer->setEnabled(true); | 
					
						
							|  |  |  |     ui->gainBaseband->setEnabled(true); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-11-17 18:35:17 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_gainLNA_toggled(bool checked) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  | 	m_settings.m_lnaOn = checked ? 1 : 0; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("lnaOn"); | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  | 	sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-11-17 18:35:17 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_gainMixer_toggled(bool checked) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  | 	m_settings.m_mixerAmpOn = checked ? 1 : 0; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("mixerAmpOn"); | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  | 	sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-11-17 18:35:17 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::on_gainBaseband_valueChanged(int value) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  | 	m_settings.m_basebandGain = value; | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |     m_settingsKeys.append("basebandGain"); | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-04 08:59:16 +01:00
										 |  |  |     QString gainText = QStringLiteral("%1").arg(value, 2, 10, QLatin1Char('0')); | 
					
						
							| 
									
										
										
										
											2016-11-18 02:46:35 +01:00
										 |  |  |     ui->gainBasebandText->setText(gainText); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-11-17 18:35:17 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-14 02:24:44 +01:00
										 |  |  | void SDRPlayGui::on_startStop_toggled(bool checked) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |     if (m_doApplySettings) | 
					
						
							| 
									
										
										
										
											2016-11-14 02:24:44 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |         SDRPlayInput::MsgStartStop *message = SDRPlayInput::MsgStartStop::create(checked); | 
					
						
							|  |  |  |         m_sampleSource->getInputMessageQueue()->push(message); | 
					
						
							| 
									
										
										
										
											2016-11-14 02:24:44 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-26 17:35:55 +01:00
										 |  |  | void SDRPlayGui::openDeviceSettingsDialog(const QPoint& p) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2022-04-17 01:31:50 +02:00
										 |  |  |     if (m_contextMenuType == ContextMenuDeviceSettings) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         BasicDeviceSettingsDialog dialog(this); | 
					
						
							|  |  |  |         dialog.setUseReverseAPI(m_settings.m_useReverseAPI); | 
					
						
							|  |  |  |         dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress); | 
					
						
							|  |  |  |         dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); | 
					
						
							|  |  |  |         dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:35:55 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-17 01:31:50 +02:00
										 |  |  |         dialog.move(p); | 
					
						
							| 
									
										
										
										
											2022-12-20 10:31:15 +00:00
										 |  |  |         new DialogPositioner(&dialog, false); | 
					
						
							| 
									
										
										
										
											2022-04-17 01:31:50 +02:00
										 |  |  |         dialog.exec(); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:35:55 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-17 01:31:50 +02:00
										 |  |  |         m_settings.m_useReverseAPI = dialog.useReverseAPI(); | 
					
						
							|  |  |  |         m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress(); | 
					
						
							|  |  |  |         m_settings.m_reverseAPIPort = dialog.getReverseAPIPort(); | 
					
						
							|  |  |  |         m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex(); | 
					
						
							| 
									
										
										
										
											2022-10-27 22:22:36 +02:00
										 |  |  |         m_settingsKeys.append("useReverseAPI"); | 
					
						
							|  |  |  |         m_settingsKeys.append("reverseAPIAddress"); | 
					
						
							|  |  |  |         m_settingsKeys.append("reverseAPIPort"); | 
					
						
							|  |  |  |         m_settingsKeys.append("reverseAPIDeviceIndex"); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:35:55 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-17 01:31:50 +02:00
										 |  |  |         sendSettings(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     resetContextMenuType(); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:35:55 +01:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | void SDRPlayGui::makeUIConnections() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &SDRPlayGui::on_centerFrequency_changed); | 
					
						
							|  |  |  |     QObject::connect(ui->ppm, &QSlider::valueChanged, this, &SDRPlayGui::on_ppm_valueChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->dcOffset, &ButtonSwitch::toggled, this, &SDRPlayGui::on_dcOffset_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->iqImbalance, &ButtonSwitch::toggled, this, &SDRPlayGui::on_iqImbalance_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->fBand, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_fBand_currentIndexChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->bandwidth, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_bandwidth_currentIndexChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->samplerate, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_samplerate_currentIndexChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->ifFrequency, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_ifFrequency_currentIndexChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->decim, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_decim_currentIndexChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->fcPos, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SDRPlayGui::on_fcPos_currentIndexChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->gainTunerOn, &QRadioButton::toggled, this, &SDRPlayGui::on_gainTunerOn_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->gainTuner, &QDial::valueChanged, this, &SDRPlayGui::on_gainTuner_valueChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->gainManualOn, &QRadioButton::toggled, this, &SDRPlayGui::on_gainManualOn_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->gainLNA, &ButtonSwitch::toggled, this, &SDRPlayGui::on_gainLNA_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->gainMixer, &ButtonSwitch::toggled, this, &SDRPlayGui::on_gainMixer_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->gainBaseband, &QDial::valueChanged, this, &SDRPlayGui::on_gainBaseband_valueChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &SDRPlayGui::on_startStop_toggled); | 
					
						
							|  |  |  | } |