| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2016 Edouard Griffiths, F4EXB                                   //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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-06-19 09:56:49 +02: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 <stdint.h>
 | 
					
						
							|  |  |  | #include <sstream>
 | 
					
						
							|  |  |  | #include <iostream>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QDebug>
 | 
					
						
							|  |  |  | #include <QMessageBox>
 | 
					
						
							| 
									
										
										
										
											2020-04-01 23:17:26 +02:00
										 |  |  | #include <QFileDialog>
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | #include <QTime>
 | 
					
						
							|  |  |  | #include <QDateTime>
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							| 
									
										
										
										
											2022-04-21 07:53:36 +02:00
										 |  |  | #include <QResizeEvent>
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | #include "ui_remoteinputgui.h"
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | #include "gui/colormapper.h"
 | 
					
						
							|  |  |  | #include "gui/glspectrum.h"
 | 
					
						
							| 
									
										
										
										
											2018-12-26 17:08:21 +01:00
										 |  |  | #include "gui/basicdevicesettingsdialog.h"
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | #include "dsp/dspengine.h"
 | 
					
						
							|  |  |  | #include "dsp/dspcommands.h"
 | 
					
						
							| 
									
										
										
										
											2021-12-24 21:06:15 +01:00
										 |  |  | #include "dsp/hbfilterchainconverter.h"
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | #include "mainwindow.h"
 | 
					
						
							|  |  |  | #include "util/simpleserializer.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"
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | #include "remoteinputgui.h"
 | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | RemoteInputGui::RemoteInputGui(DeviceUISet *deviceUISet, QWidget* parent) : | 
					
						
							| 
									
										
										
										
											2020-10-05 19:23:13 +02:00
										 |  |  | 	DeviceGUI(parent), | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | 	ui(new Ui::RemoteInputGui), | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 	m_settings(), | 
					
						
							|  |  |  | 	m_sampleSource(0), | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	m_acquisition(false), | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 	m_streamSampleRate(0), | 
					
						
							|  |  |  | 	m_streamCenterFrequency(0), | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  | 	m_lastEngineState(DeviceAPI::StNotStarted), | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  | 	m_framesDecodingStatus(0), | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	m_bufferLengthInSecs(0.0), | 
					
						
							|  |  |  |     m_bufferGauge(-50), | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  | 	m_nbOriginalBlocks(128), | 
					
						
							| 
									
										
										
										
											2017-05-25 20:13:34 +02:00
										 |  |  |     m_nbFECBlocks(0), | 
					
						
							| 
									
										
										
										
											2018-09-10 02:52:36 +02:00
										 |  |  |     m_sampleBits(16), // assume 16 bits to start with
 | 
					
						
							| 
									
										
										
										
											2018-09-09 21:26:47 +02:00
										 |  |  |     m_sampleBytes(2), | 
					
						
							| 
									
										
										
										
											2017-05-25 20:13:34 +02:00
										 |  |  |     m_samplesCount(0), | 
					
						
							|  |  |  |     m_tickCount(0), | 
					
						
							|  |  |  |     m_addressEdited(false), | 
					
						
							|  |  |  |     m_dataPortEdited(false), | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  | 	m_countUnrecoverable(0), | 
					
						
							|  |  |  | 	m_countRecovered(0), | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     m_doApplySettings(true), | 
					
						
							| 
									
										
										
										
											2021-12-07 08:17:55 +01:00
										 |  |  |     m_forceSettings(true) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02: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); | 
					
						
							| 
									
										
										
										
											2016-07-28 05:57:59 +02:00
										 |  |  |     m_paletteGreenText.setColor(QPalette::WindowText, Qt::green); | 
					
						
							|  |  |  |     m_paletteWhiteText.setColor(QPalette::WindowText, Qt::white); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-13 13:45:55 +01:00
										 |  |  | 	m_startingTimeStampms = 0; | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     ui->setupUi(getContents()); | 
					
						
							| 
									
										
										
										
											2022-04-21 07:53:36 +02:00
										 |  |  |     setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 
					
						
							| 
									
										
										
										
											2022-04-24 02:13:18 +02:00
										 |  |  |     getContents()->setStyleSheet("#RemoteInputGui { background-color: rgb(64, 64, 64); }"); | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     m_helpURL = "plugins/samplesource/remoteinput/readme.md"; | 
					
						
							| 
									
										
										
										
											2017-06-09 00:43:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-24 21:06:15 +01:00
										 |  |  |     ui->remoteDeviceFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); | 
					
						
							|  |  |  |     ui->remoteDeviceFrequency->setValueRange(8, 0, 99999999); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-17 01:31:50 +02:00
										 |  |  |     connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:08:21 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 	displaySettings(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); | 
					
						
							|  |  |  | 	m_statusTimer.start(500); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); | 
					
						
							| 
									
										
										
										
											2021-12-26 11:56:37 +01:00
										 |  |  |     connect(&m_remoteUpdateTimer, SIGNAL(timeout()), this, SLOT(updateRemote())); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |     m_sampleSource = (RemoteInput*) m_deviceUISet->m_deviceAPI->getSampleSource(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02: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); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  |     m_eventsTime.start(); | 
					
						
							|  |  |  |     displayEventCounts(); | 
					
						
							|  |  |  |     displayEventTimer(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     m_forceSettings = true; | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     sendSettings(); | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     makeUIConnections(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | RemoteInputGui::~RemoteInputGui() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							|  |  |  | 	delete ui; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::blockApplySettings(bool block) | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     m_doApplySettings = !block; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::destroy() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							|  |  |  | 	delete this; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::resetToDefaults() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     m_settings.resetToDefaults(); | 
					
						
							|  |  |  |     displaySettings(); | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     m_forceSettings = true; | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | QByteArray RemoteInputGui::serialize() const | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     return m_settings.serialize(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | bool RemoteInputGui::deserialize(const QByteArray& data) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |     qDebug("RemoteInputGui::deserialize"); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     if (m_settings.deserialize(data)) | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |         displaySettings(); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |         m_forceSettings = true; | 
					
						
							|  |  |  |         sendSettings(); | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return false; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-21 07:53:36 +02:00
										 |  |  | void RemoteInputGui::resizeEvent(QResizeEvent* size) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     adjustSize(); | 
					
						
							|  |  |  |     size->accept(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | bool RemoteInputGui::handleMessage(const Message& message) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |     if (RemoteInput::MsgConfigureRemoteInput::match(message)) | 
					
						
							| 
									
										
										
										
											2017-12-28 03:21:48 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |         const RemoteInput::MsgConfigureRemoteInput& cfg = (RemoteInput::MsgConfigureRemoteInput&) message; | 
					
						
							| 
									
										
										
										
											2017-12-28 03:21:48 +01:00
										 |  |  |         m_settings = cfg.getSettings(); | 
					
						
							|  |  |  |         blockApplySettings(true); | 
					
						
							|  |  |  |         displaySettings(); | 
					
						
							|  |  |  |         blockApplySettings(false); | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-12-24 21:06:15 +01:00
										 |  |  |     else if (RemoteInput::MsgConfigureRemoteChannel::match(message)) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         qDebug("RemoteInputGui::handleMessage: RemoteInput::MsgConfigureRemoteChannel"); | 
					
						
							|  |  |  |         const RemoteInput::MsgConfigureRemoteChannel& cfg = (RemoteInput::MsgConfigureRemoteChannel&) message; | 
					
						
							|  |  |  |         m_remoteChannelSettings = cfg.getSettings(); | 
					
						
							|  |  |  |         blockApplySettings(true); | 
					
						
							|  |  |  |         displayRemoteSettings(); | 
					
						
							|  |  |  |         blockApplySettings(false); | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |     else if (RemoteInput::MsgReportRemoteInputAcquisition::match(message)) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | 		m_acquisition = ((RemoteInput::MsgReportRemoteInputAcquisition&)message).getAcquisition(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 		updateWithAcquisition(); | 
					
						
							|  |  |  | 		return true; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | 	else if (RemoteInput::MsgReportRemoteInputStreamData::match(message)) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |         m_startingTimeStampms = ((RemoteInput::MsgReportRemoteInputStreamData&)message).get_tv_msec(); | 
					
						
							| 
									
										
										
										
											2017-06-08 23:35:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |         qDebug() << "RemoteInputGui::handleMessage: RemoteInput::MsgReportRemoteInputStreamData: " | 
					
						
							| 
									
										
										
										
											2018-11-13 13:45:55 +01:00
										 |  |  |                 << " : " << m_startingTimeStampms << " ms"; | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         updateWithStreamTime(); | 
					
						
							| 
									
										
										
										
											2017-06-08 23:35:52 +02:00
										 |  |  |         return true; | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | 	else if (RemoteInput::MsgReportRemoteInputStreamTiming::match(message)) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | 		m_startingTimeStampms = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).get_tv_msec(); | 
					
						
							|  |  |  | 		m_framesDecodingStatus = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getFramesDecodingStatus(); | 
					
						
							|  |  |  | 		m_allBlocksReceived = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).allBlocksReceived(); | 
					
						
							|  |  |  | 		m_bufferLengthInSecs = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getBufferLengthInSecs(); | 
					
						
							|  |  |  |         m_bufferGauge = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getBufferGauge(); | 
					
						
							|  |  |  |         m_minNbBlocks = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getMinNbBlocks(); | 
					
						
							|  |  |  |         m_minNbOriginalBlocks = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getMinNbOriginalBlocks(); | 
					
						
							|  |  |  |         m_maxNbRecovery = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getMaxNbRecovery(); | 
					
						
							|  |  |  |         m_avgNbBlocks = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getAvgNbBlocks(); | 
					
						
							|  |  |  |         m_avgNbOriginalBlocks = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getAvgNbOriginalBlocks(); | 
					
						
							|  |  |  |         m_avgNbRecovery = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getAvgNbRecovery(); | 
					
						
							|  |  |  |         m_nbOriginalBlocks = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getNbOriginalBlocksPerFrame(); | 
					
						
							|  |  |  |         m_sampleBits = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getSampleBits(); | 
					
						
							|  |  |  |         m_sampleBytes = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getSampleBytes(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         int nbFECBlocks = ((RemoteInput::MsgReportRemoteInputStreamTiming&)message).getNbFECBlocksPerFrame(); | 
					
						
							| 
									
										
										
										
											2017-06-08 23:35:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |         if (m_nbFECBlocks != nbFECBlocks) { | 
					
						
							| 
									
										
										
										
											2017-06-08 23:35:52 +02:00
										 |  |  |             m_nbFECBlocks = nbFECBlocks; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		updateWithStreamTime(); | 
					
						
							|  |  |  | 		return true; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | 	else if (RemoteInput::MsgStartStop::match(message)) | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | 	    RemoteInput::MsgStartStop& notif = (RemoteInput::MsgStartStop&) message; | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |         blockApplySettings(true); | 
					
						
							|  |  |  |         ui->startStop->setChecked(notif.getStartStop()); | 
					
						
							|  |  |  |         blockApplySettings(false); | 
					
						
							| 
									
										
										
										
											2021-12-25 12:54:33 +01:00
										 |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else if (RemoteInput::MsgReportRemoteFixedData::match(message)) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ui->apiAddressLabel->setStyleSheet("QLabel { background-color : green; }"); | 
					
						
							|  |  |  |         const RemoteInput::MsgReportRemoteFixedData& report = (const RemoteInput::MsgReportRemoteFixedData&) message; | 
					
						
							|  |  |  |         displayRemoteFixedData(report.getData()); | 
					
						
							| 
									
										
										
										
											2021-12-27 19:03:55 +01:00
										 |  |  |         ui->statusText->setText("OK"); | 
					
						
							| 
									
										
										
										
											2021-12-25 12:54:33 +01:00
										 |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else if (RemoteInput::MsgReportRemoteAPIError::match(message)) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); | 
					
						
							|  |  |  |         const RemoteInput::MsgReportRemoteAPIError& report = (const RemoteInput::MsgReportRemoteAPIError&) message; | 
					
						
							|  |  |  |         ui->statusText->setText(QString(report.getMessage())); | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	else | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		return false; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::handleInputMessages() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     Message* message; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-17 01:23:54 +02:00
										 |  |  |     while ((message = m_inputMessageQueue.pop()) != 0) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |         //qDebug("RemoteInputGui::handleInputMessages: message: %s", message->getIdentifier());
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if (DSPSignalNotification::match(*message)) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             DSPSignalNotification* notif = (DSPSignalNotification*) message; | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |             if (notif->getSampleRate() != m_streamSampleRate) { | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |                 m_streamSampleRate = notif->getSampleRate(); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             m_streamCenterFrequency = notif->getCenterFrequency(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |             qDebug("RemoteInputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency()); | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |             updateSampleRateAndFrequency(); | 
					
						
							| 
									
										
										
										
											2017-09-05 00:31:45 +02:00
										 |  |  |             DSPSignalNotification *fwd = new DSPSignalNotification(*notif); | 
					
						
							|  |  |  |             m_sampleSource->getInputMessageQueue()->push(fwd); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |             delete message; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2017-09-17 01:23:54 +02:00
										 |  |  |         else | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             if (handleMessage(*message)) | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |                 delete message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::updateSampleRateAndFrequency() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     m_deviceUISet->getSpectrum()->setSampleRate(m_streamSampleRate); | 
					
						
							|  |  |  |     m_deviceUISet->getSpectrum()->setCenterFrequency(m_streamCenterFrequency); | 
					
						
							|  |  |  |     ui->deviceRateText->setText(tr("%1k").arg((float)m_streamSampleRate / 1000)); | 
					
						
							|  |  |  |     blockApplySettings(true); | 
					
						
							| 
									
										
										
										
											2021-12-16 00:18:11 +01:00
										 |  |  |     ui->centerFrequency->setText(tr("%L1").arg(m_streamCenterFrequency)); | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     blockApplySettings(false); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::displaySettings() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     blockApplySettings(true); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-16 00:18:11 +01:00
										 |  |  |     ui->centerFrequency->setText(tr("%L1").arg(m_streamCenterFrequency)); | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     ui->deviceRateText->setText(tr("%1k").arg(m_streamSampleRate / 1000.0)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     ui->apiAddress->setText(m_settings.m_apiAddress); | 
					
						
							|  |  |  |     ui->apiPort->setText(tr("%1").arg(m_settings.m_apiPort)); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     ui->dataPort->setText(tr("%1").arg(m_settings.m_dataPort)); | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     ui->dataAddress->setText(m_settings.m_dataAddress); | 
					
						
							| 
									
										
										
										
											2020-08-26 18:52:36 +02:00
										 |  |  |     ui->multicastAddress->setText(m_settings.m_multicastAddress); | 
					
						
							|  |  |  |     ui->multicastJoin->setChecked(m_settings.m_multicastJoin); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->dataApplyButton->setEnabled(false); | 
					
						
							|  |  |  |     ui->dataApplyButton->setStyleSheet("QPushButton { background:rgb(79,79,79); }"); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | 	ui->dcOffset->setChecked(m_settings.m_dcBlock); | 
					
						
							|  |  |  | 	ui->iqImbalance->setChecked(m_settings.m_iqCorrection); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 	blockApplySettings(false); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-24 21:06:15 +01:00
										 |  |  | void RemoteInputGui::displayRemoteSettings() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     blockApplySettings(true); | 
					
						
							|  |  |  |     ui->remoteDeviceFrequency->setValue(m_remoteChannelSettings.m_deviceCenterFrequency/1000); | 
					
						
							|  |  |  |     ui->decimationFactor->setCurrentIndex(m_remoteChannelSettings.m_log2Decim); | 
					
						
							|  |  |  |     applyDecimation(); | 
					
						
							|  |  |  |     blockApplySettings(false); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RemoteInputGui::displayRemoteShift() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     int basebandSampleRate = m_streamSampleRate * (1<<m_remoteChannelSettings.m_log2Decim); | 
					
						
							|  |  |  |     int shift = m_remoteShiftFrequencyFactor * basebandSampleRate; | 
					
						
							|  |  |  |     QLocale loc; | 
					
						
							|  |  |  |     ui->offsetFrequencyText->setText(tr("%1 Hz").arg(loc.toString(shift))); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RemoteInputGui::applyDecimation() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     uint32_t maxHash = 1; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     for (uint32_t i = 0; i < m_remoteChannelSettings.m_log2Decim; i++) { | 
					
						
							|  |  |  |         maxHash *= 3; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->position->setMaximum(maxHash-1); | 
					
						
							|  |  |  |     ui->position->setValue(m_remoteChannelSettings.m_filterChainHash); | 
					
						
							|  |  |  |     m_remoteChannelSettings.m_filterChainHash = ui->position->value(); | 
					
						
							|  |  |  |     applyPosition(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RemoteInputGui::applyPosition() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ui->filterChainIndex->setText(tr("%1").arg(m_remoteChannelSettings.m_filterChainHash)); | 
					
						
							|  |  |  |     QString s; | 
					
						
							|  |  |  |     m_remoteShiftFrequencyFactor = HBFilterChainConverter::convertToString( | 
					
						
							|  |  |  |         m_remoteChannelSettings.m_log2Decim, | 
					
						
							|  |  |  |         m_remoteChannelSettings.m_filterChainHash, s) | 
					
						
							|  |  |  |     ; | 
					
						
							|  |  |  |     ui->filterChainText->setText(s); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     displayRemoteShift(); | 
					
						
							|  |  |  |     applyRemoteSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RemoteInputGui::applyRemoteSettings() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2021-12-26 11:56:37 +01:00
										 |  |  |     if (!m_remoteUpdateTimer.isActive()) { | 
					
						
							|  |  |  |         m_remoteUpdateTimer.start(100); | 
					
						
							| 
									
										
										
										
											2021-12-24 21:06:15 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::sendSettings() | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2021-12-26 11:56:37 +01:00
										 |  |  |     if (!m_updateTimer.isActive()) { | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |         m_updateTimer.start(100); | 
					
						
							| 
									
										
										
										
											2021-12-26 11:56:37 +01:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-24 21:06:15 +01:00
										 |  |  | void RemoteInputGui::on_remoteDeviceFrequency_changed(quint64 value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_remoteChannelSettings.m_deviceCenterFrequency = value * 1000; | 
					
						
							|  |  |  |     applyRemoteSettings(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RemoteInputGui::on_decimationFactor_currentIndexChanged(int index) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_remoteChannelSettings.m_log2Decim = index; | 
					
						
							|  |  |  |     applyDecimation(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RemoteInputGui::on_position_valueChanged(int value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_remoteChannelSettings.m_filterChainHash = value; | 
					
						
							|  |  |  |     applyPosition(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::on_apiApplyButton_clicked(bool checked) | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-11-13 08:51:14 +01:00
										 |  |  |     (void) checked; | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     m_settings.m_apiAddress = ui->apiAddress->text(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     bool ctlOk; | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     int udpApiPort = ui->apiPort->text().toInt(&ctlOk); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     if((ctlOk) && (udpApiPort >= 1024) && (udpApiPort < 65535)) { | 
					
						
							|  |  |  |         m_settings.m_apiPort = udpApiPort; | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     sendSettings(); | 
					
						
							| 
									
										
										
										
											2018-09-15 10:32:40 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-25 12:54:33 +01:00
										 |  |  |     ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); | 
					
						
							|  |  |  |     RemoteInput::MsgRequestFixedData *msg = RemoteInput::MsgRequestFixedData::create(); | 
					
						
							|  |  |  |     m_sampleSource->getInputMessageQueue()->push(msg); | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::on_dataApplyButton_clicked(bool checked) | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-11-13 08:51:14 +01:00
										 |  |  |     (void) checked; | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-26 18:52:36 +02:00
										 |  |  |     ui->dataApplyButton->setEnabled(false); | 
					
						
							|  |  |  |     ui->dataApplyButton->setStyleSheet("QPushButton { background:rgb(79,79,79); }"); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     sendSettings(); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-02 11:20:30 +00:00
										 |  |  | void RemoteInputGui::on_apiAddress_editingFinished() | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     m_settings.m_apiAddress = ui->apiAddress->text(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-25 12:54:33 +01:00
										 |  |  |     ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); | 
					
						
							|  |  |  |     RemoteInput::MsgRequestFixedData *msg = RemoteInput::MsgRequestFixedData::create(); | 
					
						
							|  |  |  |     m_sampleSource->getInputMessageQueue()->push(msg); | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-02 11:20:30 +00:00
										 |  |  | void RemoteInputGui::on_dataAddress_editingFinished() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     m_settings.m_dataAddress = ui->dataAddress->text(); | 
					
						
							| 
									
										
										
										
											2020-08-26 18:52:36 +02:00
										 |  |  |     ui->dataApplyButton->setEnabled(true); | 
					
						
							|  |  |  |     ui->dataApplyButton->setStyleSheet("QPushButton { background-color : green; }"); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-02 11:20:30 +00:00
										 |  |  | void RemoteInputGui::on_dataPort_editingFinished() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2020-08-26 18:52:36 +02:00
										 |  |  |     bool ok; | 
					
						
							|  |  |  |     quint16 udpPort = ui->dataPort->text().toInt(&ok); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-26 18:52:36 +02:00
										 |  |  |     if ((!ok) || (udpPort < 1024)) { | 
					
						
							|  |  |  |         udpPort = 9998; | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-08-26 18:52:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     m_settings.m_dataPort = udpPort; | 
					
						
							|  |  |  |     ui->dataPort->setText(tr("%1").arg(m_settings.m_dataPort)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->dataApplyButton->setEnabled(true); | 
					
						
							|  |  |  |     ui->dataApplyButton->setStyleSheet("QPushButton { background-color : green; }"); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-02 11:20:30 +00:00
										 |  |  | void RemoteInputGui::on_multicastAddress_editingFinished() | 
					
						
							| 
									
										
										
										
											2020-08-26 18:52:36 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     m_settings.m_multicastAddress = ui->multicastAddress->text(); | 
					
						
							|  |  |  |     ui->dataApplyButton->setEnabled(true); | 
					
						
							|  |  |  |     ui->dataApplyButton->setStyleSheet("QPushButton { background-color : green; }"); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RemoteInputGui::on_multicastJoin_toggled(bool checked) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_settings.m_multicastJoin = checked; | 
					
						
							|  |  |  |     ui->dataApplyButton->setEnabled(true); | 
					
						
							|  |  |  |     ui->dataApplyButton->setStyleSheet("QPushButton { background-color : green; }"); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-02 11:20:30 +00:00
										 |  |  | void RemoteInputGui::on_apiPort_editingFinished() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     bool ctlOk; | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     int udpApiPort = ui->apiPort->text().toInt(&ctlOk); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |     if((!ctlOk) || (udpApiPort < 1024) || (udpApiPort > 65535)) | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     { | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  |         m_settings.m_apiPort = udpApiPort; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-25 12:54:33 +01:00
										 |  |  |         ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); | 
					
						
							|  |  |  |         RemoteInput::MsgRequestFixedData *msg = RemoteInput::MsgRequestFixedData::create(); | 
					
						
							|  |  |  |         m_sampleSource->getInputMessageQueue()->push(msg); | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |         sendSettings(); | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::on_dcOffset_toggled(bool checked) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     m_settings.m_dcBlock = checked; | 
					
						
							|  |  |  |     sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::on_iqImbalance_toggled(bool checked) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     m_settings.m_iqCorrection = checked; | 
					
						
							|  |  |  |     sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::on_startStop_toggled(bool checked) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |     if (m_doApplySettings) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |         RemoteInput::MsgStartStop *message = RemoteInput::MsgStartStop::create(checked); | 
					
						
							| 
									
										
										
										
											2017-12-14 00:19:59 +01:00
										 |  |  |         m_sampleSource->getInputMessageQueue()->push(message); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::on_eventCountsReset_clicked(bool checked) | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-11-13 08:51:14 +01:00
										 |  |  |     (void) checked; | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  |     m_countUnrecoverable = 0; | 
					
						
							|  |  |  |     m_countRecovered = 0; | 
					
						
							|  |  |  |     m_eventsTime.start(); | 
					
						
							|  |  |  |     displayEventCounts(); | 
					
						
							|  |  |  |     displayEventTimer(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::displayEventCounts() | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     QString nstr = QString("%1").arg(m_countUnrecoverable, 3, 10, QChar('0')); | 
					
						
							|  |  |  |     ui->eventUnrecText->setText(nstr); | 
					
						
							|  |  |  |     nstr = QString("%1").arg(m_countRecovered, 3, 10, QChar('0')); | 
					
						
							|  |  |  |     ui->eventRecText->setText(nstr); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::displayEventTimer() | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     int elapsedTimeMillis = m_eventsTime.elapsed(); | 
					
						
							|  |  |  |     QTime recordLength(0, 0, 0, 0); | 
					
						
							|  |  |  |     recordLength = recordLength.addSecs(elapsedTimeMillis/1000); | 
					
						
							| 
									
										
										
										
											2018-05-11 11:00:08 +02:00
										 |  |  |     QString s_time = recordLength.toString("HH:mm:ss"); | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  |     ui->eventCountsTimeText->setText(s_time); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-25 12:54:33 +01:00
										 |  |  | void RemoteInputGui::displayRemoteFixedData(const RemoteInput::MsgReportRemoteFixedData::RemoteData& remoteData) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     QString infoLine; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infoLine = remoteData.m_version; | 
					
						
							|  |  |  |     infoLine += " Qt" + remoteData.m_qtVersion; | 
					
						
							|  |  |  |     infoLine += " " + remoteData.m_architecture; | 
					
						
							|  |  |  |     infoLine += " " + remoteData.m_os; | 
					
						
							|  |  |  |     infoLine +=  QString(" %1/%2b").arg(remoteData.m_rxBits).arg(remoteData.m_txBits); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (infoLine.size() > 0) { | 
					
						
							|  |  |  |         ui->infoText->setText(infoLine); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::updateWithAcquisition() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::updateWithStreamTime() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  | 	bool updateEventCounts = false; | 
					
						
							| 
									
										
										
										
											2018-11-13 13:45:55 +01:00
										 |  |  |     QDateTime dt = QDateTime::fromMSecsSinceEpoch(m_startingTimeStampms); | 
					
						
							| 
									
										
										
										
											2018-05-11 11:00:08 +02:00
										 |  |  |     QString s_date = dt.toString("yyyy-MM-dd  HH:mm:ss.zzz"); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	ui->absTimeText->setText(s_date); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  | 	if (m_framesDecodingStatus == 2) | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2016-07-18 00:39:35 +02:00
										 |  |  | 		ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : green; }"); | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	else if (m_framesDecodingStatus == 1) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  |         if (m_countRecovered < 999) m_countRecovered++; | 
					
						
							|  |  |  |         updateEventCounts = true; | 
					
						
							| 
									
										
										
										
											2016-07-25 08:40:10 +02:00
										 |  |  |         ui->allFramesDecoded->setStyleSheet("QToolButton { background:rgb(56,56,56); }"); | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	else | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  |         if (m_countUnrecoverable < 999) m_countUnrecoverable++; | 
					
						
							|  |  |  |         updateEventCounts = true; | 
					
						
							| 
									
										
										
										
											2017-06-08 08:40:21 +02:00
										 |  |  |         ui->allFramesDecoded->setStyleSheet("QToolButton { background-color : red; }"); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-20 01:18:21 +02:00
										 |  |  | 	QString s = QString::number(m_bufferLengthInSecs, 'f', 1); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	ui->bufferLenSecsText->setText(tr("%1").arg(s)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 01:10:58 +02:00
										 |  |  |     s = QString::number(m_bufferGauge, 'f', 0); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | 	ui->bufferRWBalanceText->setText(tr("%1").arg(s)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 01:10:58 +02:00
										 |  |  |     ui->bufferGaugeNegative->setValue((m_bufferGauge < 0 ? -m_bufferGauge : 0)); | 
					
						
							|  |  |  |     ui->bufferGaugePositive->setValue((m_bufferGauge < 0 ? 0 : m_bufferGauge)); | 
					
						
							| 
									
										
										
										
											2016-06-20 01:18:21 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-18 00:39:35 +02:00
										 |  |  |     s = QString::number(m_minNbBlocks, 'f', 0); | 
					
						
							|  |  |  |     ui->minNbBlocksText->setText(tr("%1").arg(s)); | 
					
						
							| 
									
										
										
										
											2016-06-20 01:18:21 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-09 00:21:05 +02:00
										 |  |  |     s = QString("%1").arg(m_maxNbRecovery, 2, 10, QChar('0')); | 
					
						
							| 
									
										
										
										
											2016-07-27 18:49:17 +02:00
										 |  |  |     ui->maxNbRecoveryText->setText(tr("%1").arg(s)); | 
					
						
							| 
									
										
										
										
											2016-06-20 01:18:21 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |     s = QString::number(m_nbOriginalBlocks + m_nbFECBlocks, 'f', 0); | 
					
						
							| 
									
										
										
										
											2017-06-09 00:21:05 +02:00
										 |  |  |     QString s1 = QString("%1").arg(m_nbFECBlocks, 2, 10, QChar('0')); | 
					
						
							| 
									
										
										
										
											2016-07-24 11:09:11 +02:00
										 |  |  |     ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s).arg(s1)); | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-09 17:39:36 +02:00
										 |  |  |     ui->sampleBitsText->setText(tr("%1b").arg(m_sampleBits)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-08 15:31:24 +02:00
										 |  |  |     if (updateEventCounts) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         displayEventCounts(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     displayEventTimer(); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::updateHardware() | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     if (m_doApplySettings) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  |         qDebug() << "RemoteInputGui::updateHardware"; | 
					
						
							|  |  |  |         RemoteInput::MsgConfigureRemoteInput* message = | 
					
						
							|  |  |  |                 RemoteInput::MsgConfigureRemoteInput::create(m_settings, m_forceSettings); | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |         m_sampleSource->getInputMessageQueue()->push(message); | 
					
						
							|  |  |  |         m_forceSettings = false; | 
					
						
							|  |  |  |         m_updateTimer.stop(); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-12-26 11:56:37 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void RemoteInputGui::updateRemote() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (m_doApplySettings) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         qDebug() << "RemoteInputGui::updateRemote"; | 
					
						
							|  |  |  |         RemoteInput::MsgConfigureRemoteChannel* message = | 
					
						
							|  |  |  |                 RemoteInput::MsgConfigureRemoteChannel::create(m_remoteChannelSettings); | 
					
						
							|  |  |  |         m_sampleSource->getInputMessageQueue()->push(message); | 
					
						
							|  |  |  |         m_remoteUpdateTimer.stop(); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2017-06-08 02:06:36 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::updateStatus() | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |     if (m_sampleSource->isStreaming()) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |         int state = m_deviceUISet->m_deviceAPI->state(); | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if (m_lastEngineState != state) | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |             switch(state) | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |                 case DeviceAPI::StNotStarted: | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |                     ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); | 
					
						
							|  |  |  |                     break; | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |                 case DeviceAPI::StIdle: | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |                     ui->startStop->setStyleSheet("QToolButton { background-color : blue; }"); | 
					
						
							|  |  |  |                     break; | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |                 case DeviceAPI::StRunning: | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |                     ui->startStop->setStyleSheet("QToolButton { background-color : green; }"); | 
					
						
							|  |  |  |                     break; | 
					
						
							| 
									
										
										
										
											2019-05-08 22:11:53 +02:00
										 |  |  |                 case DeviceAPI::StError: | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +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()); | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |                     break; | 
					
						
							|  |  |  |                 default: | 
					
						
							|  |  |  |                     break; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             m_lastEngineState = state; | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-26 02:18:30 +01:00
										 |  |  |         ui->startStop->setEnabled(true); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); | 
					
						
							|  |  |  |         ui->startStop->setChecked(false); | 
					
						
							|  |  |  |         ui->startStop->setEnabled(false); | 
					
						
							| 
									
										
										
										
											2016-06-19 09:56:49 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2018-09-08 23:30:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:26:26 +01:00
										 |  |  | void RemoteInputGui::openDeviceSettingsDialog(const QPoint& p) | 
					
						
							| 
									
										
										
										
											2018-12-26 17:08:21 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											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:08:21 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-17 01:31:50 +02:00
										 |  |  |         dialog.move(p); | 
					
						
							|  |  |  |         dialog.exec(); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:08:21 +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(); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:08:21 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-17 01:31:50 +02:00
										 |  |  |         sendSettings(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     resetContextMenuType(); | 
					
						
							| 
									
										
										
										
											2018-12-26 17:08:21 +01:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | void RemoteInputGui::makeUIConnections() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     QObject::connect(ui->remoteDeviceFrequency, &ValueDial::changed, this, &RemoteInputGui::on_remoteDeviceFrequency_changed); | 
					
						
							|  |  |  |     QObject::connect(ui->decimationFactor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &RemoteInputGui::on_decimationFactor_currentIndexChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->position, &QSlider::valueChanged, this, &RemoteInputGui::on_position_valueChanged); | 
					
						
							|  |  |  |     QObject::connect(ui->apiApplyButton, &QPushButton::clicked, this, &RemoteInputGui::on_apiApplyButton_clicked); | 
					
						
							|  |  |  |     QObject::connect(ui->dataApplyButton, &QPushButton::clicked, this, &RemoteInputGui::on_dataApplyButton_clicked); | 
					
						
							|  |  |  |     QObject::connect(ui->dcOffset, &ButtonSwitch::toggled, this, &RemoteInputGui::on_dcOffset_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->iqImbalance, &ButtonSwitch::toggled, this, &RemoteInputGui::on_iqImbalance_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->apiAddress, &QLineEdit::editingFinished, this, &RemoteInputGui::on_apiAddress_editingFinished); | 
					
						
							|  |  |  |     QObject::connect(ui->apiPort, &QLineEdit::editingFinished, this, &RemoteInputGui::on_apiPort_editingFinished); | 
					
						
							|  |  |  |     QObject::connect(ui->dataAddress, &QLineEdit::editingFinished, this, &RemoteInputGui::on_dataAddress_editingFinished); | 
					
						
							|  |  |  |     QObject::connect(ui->dataPort, &QLineEdit::editingFinished, this, &RemoteInputGui::on_dataPort_editingFinished); | 
					
						
							|  |  |  |     QObject::connect(ui->multicastAddress, &QLineEdit::editingFinished, this, &RemoteInputGui::on_multicastAddress_editingFinished); | 
					
						
							|  |  |  |     QObject::connect(ui->multicastJoin, &ButtonSwitch::toggled, this, &RemoteInputGui::on_multicastJoin_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &RemoteInputGui::on_startStop_toggled); | 
					
						
							|  |  |  |     QObject::connect(ui->eventCountsReset, &QPushButton::clicked, this, &RemoteInputGui::on_eventCountsReset_clicked); | 
					
						
							|  |  |  | } |