2018-09-05 02:44:14 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2018 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 00:39:30 -04:00
|
|
|
// (at your option) any later version. //
|
2018-09-05 02:44:14 -04: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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2019-04-25 09:48:47 -04:00
|
|
|
#include <QLocale>
|
2022-04-24 06:28:56 -04:00
|
|
|
#include <QResizeEvent>
|
2019-01-22 17:39:12 -05:00
|
|
|
|
2018-09-05 02:44:14 -04:00
|
|
|
#include "device/deviceuiset.h"
|
|
|
|
#include "gui/basicchannelsettingsdialog.h"
|
2019-09-22 19:25:17 -04:00
|
|
|
#include "gui/devicestreamselectiondialog.h"
|
2019-04-25 09:48:47 -04:00
|
|
|
#include "dsp/hbfilterchainconverter.h"
|
2019-12-10 21:03:36 -05:00
|
|
|
#include "dsp/dspcommands.h"
|
2018-09-05 02:44:14 -04:00
|
|
|
#include "mainwindow.h"
|
|
|
|
|
2019-04-25 09:48:47 -04:00
|
|
|
#include "remotesinkgui.h"
|
2019-01-22 17:39:12 -05:00
|
|
|
#include "remotesink.h"
|
|
|
|
#include "ui_remotesinkgui.h"
|
2018-09-05 02:44:14 -04:00
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
RemoteSinkGUI* RemoteSinkGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *channelRx)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
2019-01-22 17:39:12 -05:00
|
|
|
RemoteSinkGUI* gui = new RemoteSinkGUI(pluginAPI, deviceUISet, channelRx);
|
2018-09-05 02:44:14 -04:00
|
|
|
return gui;
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::destroy()
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::resetToDefaults()
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
m_settings.resetToDefaults();
|
|
|
|
displaySettings();
|
|
|
|
applySettings(true);
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
QByteArray RemoteSinkGUI::serialize() const
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
return m_settings.serialize();
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
bool RemoteSinkGUI::deserialize(const QByteArray& data)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
if(m_settings.deserialize(data)) {
|
|
|
|
displaySettings();
|
|
|
|
applySettings(true);
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
resetToDefaults();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-24 06:28:56 -04:00
|
|
|
void RemoteSinkGUI::resizeEvent(QResizeEvent* size)
|
|
|
|
{
|
|
|
|
int maxWidth = getRollupContents()->maximumWidth();
|
|
|
|
int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
|
|
|
|
resize(width() < maxWidth ? width() : maxWidth, minHeight);
|
|
|
|
size->accept();
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
bool RemoteSinkGUI::handleMessage(const Message& message)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
2019-12-10 21:03:36 -05:00
|
|
|
if (RemoteSink::MsgConfigureRemoteSink::match(message))
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
2019-01-22 17:39:12 -05:00
|
|
|
const RemoteSink::MsgConfigureRemoteSink& cfg = (RemoteSink::MsgConfigureRemoteSink&) message;
|
2018-09-05 02:44:14 -04:00
|
|
|
m_settings = cfg.getSettings();
|
|
|
|
blockApplySettings(true);
|
2021-12-02 17:54:39 -05:00
|
|
|
m_channelMarker.updateSettings(static_cast<const ChannelMarker*>(m_settings.m_channelMarker));
|
2018-09-05 02:44:14 -04:00
|
|
|
displaySettings();
|
|
|
|
blockApplySettings(false);
|
2019-12-10 21:03:36 -05:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if (DSPSignalNotification::match(message))
|
|
|
|
{
|
|
|
|
DSPSignalNotification& cfg = (DSPSignalNotification&) message;
|
2022-04-13 05:08:21 -04:00
|
|
|
m_deviceCenterFrequency = cfg.getCenterFrequency();
|
2019-12-10 21:03:36 -05:00
|
|
|
m_basebandSampleRate = cfg.getSampleRate();
|
|
|
|
qDebug("RemoteSinkGUI::handleMessage: DSPSignalNotification: m_basebandSampleRate: %d", m_basebandSampleRate);
|
|
|
|
displayRateAndShift();
|
|
|
|
|
2018-09-05 02:44:14 -04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
RemoteSinkGUI::RemoteSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *channelrx, QWidget* parent) :
|
2020-10-04 00:16:15 -04:00
|
|
|
ChannelGUI(parent),
|
2019-01-22 17:39:12 -05:00
|
|
|
ui(new Ui::RemoteSinkGUI),
|
2018-09-05 02:44:14 -04:00
|
|
|
m_pluginAPI(pluginAPI),
|
|
|
|
m_deviceUISet(deviceUISet),
|
2019-12-10 21:03:36 -05:00
|
|
|
m_basebandSampleRate(0),
|
2022-04-13 05:08:21 -04:00
|
|
|
m_deviceCenterFrequency(0),
|
2018-09-05 02:44:14 -04:00
|
|
|
m_tickCount(0)
|
|
|
|
{
|
|
|
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
2022-04-24 06:28:56 -04:00
|
|
|
m_helpURL = "plugins/channelrx/remotesink/readme.md";
|
|
|
|
RollupContents *rollupContents = getRollupContents();
|
|
|
|
ui->setupUi(rollupContents);
|
|
|
|
setSizePolicy(rollupContents->sizePolicy());
|
|
|
|
rollupContents->arrangeRollups();
|
|
|
|
connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
2018-12-21 11:39:04 -05:00
|
|
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
2018-09-05 02:44:14 -04:00
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
m_remoteSink = (RemoteSink*) channelrx;
|
|
|
|
m_remoteSink->setMessageQueueToGUI(getInputMessageQueue());
|
2019-12-12 17:49:19 -05:00
|
|
|
m_basebandSampleRate = m_remoteSink->getBasebandSampleRate();
|
2018-09-05 02:44:14 -04:00
|
|
|
|
|
|
|
m_channelMarker.blockSignals(true);
|
|
|
|
m_channelMarker.setColor(m_settings.m_rgbColor);
|
|
|
|
m_channelMarker.setCenterFrequency(0);
|
2019-01-22 17:39:12 -05:00
|
|
|
m_channelMarker.setTitle("Remote source");
|
2018-09-05 02:44:14 -04:00
|
|
|
m_channelMarker.blockSignals(false);
|
|
|
|
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
|
|
|
|
|
|
|
m_settings.setChannelMarker(&m_channelMarker);
|
2022-01-08 23:27:12 -05:00
|
|
|
m_settings.setRollupState(&m_rollupState);
|
2018-09-05 02:44:14 -04:00
|
|
|
|
|
|
|
m_deviceUISet->addChannelMarker(&m_channelMarker);
|
|
|
|
|
|
|
|
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
|
|
|
|
|
|
|
displaySettings();
|
2022-04-12 10:20:45 -04:00
|
|
|
makeUIConnections();
|
2018-09-05 02:44:14 -04:00
|
|
|
applySettings(true);
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
RemoteSinkGUI::~RemoteSinkGUI()
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::blockApplySettings(bool block)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
m_doApplySettings = !block;
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::applySettings(bool force)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
if (m_doApplySettings)
|
|
|
|
{
|
|
|
|
setTitleColor(m_channelMarker.getColor());
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
RemoteSink::MsgConfigureRemoteSink* message = RemoteSink::MsgConfigureRemoteSink::create(m_settings, force);
|
|
|
|
m_remoteSink->getInputMessageQueue()->push(message);
|
2018-09-05 02:44:14 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::displaySettings()
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
m_channelMarker.blockSignals(true);
|
|
|
|
m_channelMarker.setCenterFrequency(0);
|
|
|
|
m_channelMarker.setTitle(m_settings.m_title);
|
2019-12-10 21:03:36 -05:00
|
|
|
m_channelMarker.setBandwidth(m_basebandSampleRate); // TODO
|
2019-04-25 09:48:47 -04:00
|
|
|
m_channelMarker.setMovable(false); // do not let user move the center arbitrarily
|
2018-09-05 02:44:14 -04:00
|
|
|
m_channelMarker.blockSignals(false);
|
|
|
|
m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
|
|
|
|
|
|
|
|
setTitleColor(m_settings.m_rgbColor);
|
|
|
|
setWindowTitle(m_channelMarker.getTitle());
|
2022-04-12 10:20:45 -04:00
|
|
|
setTitle(m_channelMarker.getTitle());
|
2018-09-05 02:44:14 -04:00
|
|
|
|
|
|
|
blockApplySettings(true);
|
2019-04-25 09:48:47 -04:00
|
|
|
ui->decimationFactor->setCurrentIndex(m_settings.m_log2Decim);
|
2018-09-05 02:44:14 -04:00
|
|
|
ui->dataAddress->setText(m_settings.m_dataAddress);
|
|
|
|
ui->dataPort->setText(tr("%1").arg(m_settings.m_dataPort));
|
2018-09-05 12:25:58 -04:00
|
|
|
QString s = QString::number(128 + m_settings.m_nbFECBlocks, 'f', 0);
|
|
|
|
QString s1 = QString::number(m_settings.m_nbFECBlocks, 'f', 0);
|
|
|
|
ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s).arg(s1));
|
2021-12-19 07:15:17 -05:00
|
|
|
ui->nbTxBytes->setCurrentIndex(log2(m_settings.m_nbTxBytes));
|
2019-04-25 09:48:47 -04:00
|
|
|
applyDecimation();
|
2022-04-17 19:42:03 -04:00
|
|
|
updateIndexLabel();
|
2022-04-12 10:20:45 -04:00
|
|
|
getRollupContents()->restoreState(m_rollupState);
|
2022-04-13 05:08:21 -04:00
|
|
|
updateAbsoluteCenterFrequency();
|
2018-09-05 02:44:14 -04:00
|
|
|
blockApplySettings(false);
|
|
|
|
}
|
|
|
|
|
2019-04-25 09:48:47 -04:00
|
|
|
void RemoteSinkGUI::displayRateAndShift()
|
|
|
|
{
|
2019-12-10 21:03:36 -05:00
|
|
|
int shift = m_shiftFrequencyFactor * m_basebandSampleRate;
|
|
|
|
double channelSampleRate = ((double) m_basebandSampleRate) / (1<<m_settings.m_log2Decim);
|
2019-04-25 09:48:47 -04:00
|
|
|
QLocale loc;
|
|
|
|
ui->offsetFrequencyText->setText(tr("%1 Hz").arg(loc.toString(shift)));
|
|
|
|
ui->channelRateText->setText(tr("%1k").arg(QString::number(channelSampleRate / 1000.0, 'g', 5)));
|
|
|
|
m_channelMarker.setCenterFrequency(shift);
|
|
|
|
m_channelMarker.setBandwidth(channelSampleRate);
|
|
|
|
}
|
|
|
|
|
2022-04-22 13:21:24 -04:00
|
|
|
void RemoteSinkGUI::leaveEvent(QEvent* event)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
m_channelMarker.setHighlighted(false);
|
2022-04-22 13:21:24 -04:00
|
|
|
ChannelGUI::leaveEvent(event);
|
2018-09-05 02:44:14 -04:00
|
|
|
}
|
|
|
|
|
2022-04-22 13:21:24 -04:00
|
|
|
void RemoteSinkGUI::enterEvent(QEvent* event)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
m_channelMarker.setHighlighted(true);
|
2022-04-22 13:21:24 -04:00
|
|
|
ChannelGUI::enterEvent(event);
|
2018-09-05 02:44:14 -04:00
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::handleSourceMessages()
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
Message* message;
|
|
|
|
|
|
|
|
while ((message = getInputMessageQueue()->pop()) != 0)
|
|
|
|
{
|
|
|
|
if (handleMessage(*message))
|
|
|
|
{
|
|
|
|
delete message;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
2018-11-12 18:45:03 -05:00
|
|
|
(void) widget;
|
|
|
|
(void) rollDown;
|
2021-11-24 04:50:42 -05:00
|
|
|
|
2022-04-12 10:20:45 -04:00
|
|
|
getRollupContents()->saveState(m_rollupState);
|
2021-11-24 04:50:42 -05:00
|
|
|
applySettings();
|
2018-09-05 02:44:14 -04:00
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::onMenuDialogCalled(const QPoint &p)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
2019-05-09 15:07:05 -04:00
|
|
|
if (m_contextMenuType == ContextMenuChannelSettings)
|
|
|
|
{
|
|
|
|
BasicChannelSettingsDialog dialog(&m_channelMarker, 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);
|
|
|
|
dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
|
2022-04-17 19:42:03 -04:00
|
|
|
dialog.setDefaultTitle(m_displayedName);
|
|
|
|
|
|
|
|
if (m_deviceUISet->m_deviceMIMOEngine)
|
|
|
|
{
|
|
|
|
dialog.setNumberOfStreams(m_remoteSink->getNumberOfDeviceStreams());
|
|
|
|
dialog.setStreamIndex(m_settings.m_streamIndex);
|
|
|
|
}
|
2019-05-09 15:07:05 -04:00
|
|
|
|
|
|
|
dialog.move(p);
|
|
|
|
dialog.exec();
|
|
|
|
|
|
|
|
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
|
|
|
|
m_settings.m_title = m_channelMarker.getTitle();
|
|
|
|
m_settings.m_useReverseAPI = dialog.useReverseAPI();
|
|
|
|
m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
|
|
|
|
m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
|
|
|
|
m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
|
|
|
|
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
|
|
|
|
|
|
|
|
setWindowTitle(m_settings.m_title);
|
2022-04-12 10:20:45 -04:00
|
|
|
setTitle(m_channelMarker.getTitle());
|
2019-05-09 15:07:05 -04:00
|
|
|
setTitleColor(m_settings.m_rgbColor);
|
|
|
|
|
2022-04-17 19:42:03 -04:00
|
|
|
if (m_deviceUISet->m_deviceMIMOEngine)
|
|
|
|
{
|
|
|
|
m_settings.m_streamIndex = dialog.getSelectedStreamIndex();
|
|
|
|
m_channelMarker.clearStreamIndexes();
|
|
|
|
m_channelMarker.addStreamIndex(m_settings.m_streamIndex);
|
|
|
|
updateIndexLabel();
|
|
|
|
}
|
2019-09-22 19:25:17 -04:00
|
|
|
|
|
|
|
applySettings();
|
|
|
|
}
|
2018-09-05 02:44:14 -04:00
|
|
|
|
2019-05-09 15:07:05 -04:00
|
|
|
resetContextMenuType();
|
2018-09-05 02:44:14 -04:00
|
|
|
}
|
|
|
|
|
2019-04-25 09:48:47 -04:00
|
|
|
void RemoteSinkGUI::on_decimationFactor_currentIndexChanged(int index)
|
|
|
|
{
|
|
|
|
m_settings.m_log2Decim = index;
|
|
|
|
applyDecimation();
|
|
|
|
}
|
|
|
|
|
|
|
|
void RemoteSinkGUI::on_position_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_settings.m_filterChainHash = value;
|
|
|
|
applyPosition();
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::on_dataAddress_returnPressed()
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
m_settings.m_dataAddress = ui->dataAddress->text();
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::on_dataPort_returnPressed()
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
bool dataOk;
|
|
|
|
int dataPort = ui->dataPort->text().toInt(&dataOk);
|
|
|
|
|
|
|
|
if((!dataOk) || (dataPort < 1024) || (dataPort > 65535))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_settings.m_dataPort = dataPort;
|
|
|
|
}
|
|
|
|
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::on_dataApplyButton_clicked(bool checked)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
2018-11-12 18:45:03 -05:00
|
|
|
(void) checked;
|
2018-09-05 02:44:14 -04:00
|
|
|
m_settings.m_dataAddress = ui->dataAddress->text();
|
|
|
|
|
|
|
|
bool dataOk;
|
|
|
|
int udpDataPort = ui->dataPort->text().toInt(&dataOk);
|
|
|
|
|
|
|
|
if((dataOk) && (udpDataPort >= 1024) && (udpDataPort < 65535))
|
|
|
|
{
|
|
|
|
m_settings.m_dataPort = udpDataPort;
|
|
|
|
}
|
|
|
|
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::on_nbFECBlocks_valueChanged(int value)
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
m_settings.m_nbFECBlocks = value;
|
|
|
|
int nbOriginalBlocks = 128;
|
|
|
|
int nbFECBlocks = value;
|
|
|
|
QString s = QString::number(nbOriginalBlocks + nbFECBlocks, 'f', 0);
|
|
|
|
QString s1 = QString::number(nbFECBlocks, 'f', 0);
|
|
|
|
ui->nominalNbBlocksText->setText(tr("%1/%2").arg(s).arg(s1));
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2021-12-19 07:15:17 -05:00
|
|
|
void RemoteSinkGUI::on_nbTxBytes_currentIndexChanged(int index)
|
|
|
|
{
|
|
|
|
m_settings.m_nbTxBytes = 1 << index;
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-04-25 09:48:47 -04:00
|
|
|
void RemoteSinkGUI::applyDecimation()
|
|
|
|
{
|
|
|
|
uint32_t maxHash = 1;
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < m_settings.m_log2Decim; i++) {
|
|
|
|
maxHash *= 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
ui->position->setMaximum(maxHash-1);
|
2019-04-26 13:36:23 -04:00
|
|
|
ui->position->setValue(m_settings.m_filterChainHash);
|
2019-04-25 09:48:47 -04:00
|
|
|
m_settings.m_filterChainHash = ui->position->value();
|
|
|
|
applyPosition();
|
|
|
|
}
|
|
|
|
|
|
|
|
void RemoteSinkGUI::applyPosition()
|
|
|
|
{
|
|
|
|
ui->filterChainIndex->setText(tr("%1").arg(m_settings.m_filterChainHash));
|
|
|
|
QString s;
|
|
|
|
m_shiftFrequencyFactor = HBFilterChainConverter::convertToString(m_settings.m_log2Decim, m_settings.m_filterChainHash, s);
|
|
|
|
ui->filterChainText->setText(s);
|
|
|
|
|
2022-04-13 05:08:21 -04:00
|
|
|
updateAbsoluteCenterFrequency();
|
2019-04-25 09:48:47 -04:00
|
|
|
displayRateAndShift();
|
2019-12-10 02:26:53 -05:00
|
|
|
applySettings();
|
2019-04-25 09:48:47 -04:00
|
|
|
}
|
|
|
|
|
2019-01-22 17:39:12 -05:00
|
|
|
void RemoteSinkGUI::tick()
|
2018-09-05 02:44:14 -04:00
|
|
|
{
|
|
|
|
if (++m_tickCount == 20) { // once per second
|
|
|
|
m_tickCount = 0;
|
|
|
|
}
|
|
|
|
}
|
2022-04-12 10:20:45 -04:00
|
|
|
|
|
|
|
void RemoteSinkGUI::makeUIConnections()
|
|
|
|
{
|
|
|
|
QObject::connect(ui->decimationFactor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &RemoteSinkGUI::on_decimationFactor_currentIndexChanged);
|
|
|
|
QObject::connect(ui->position, &QSlider::valueChanged, this, &RemoteSinkGUI::on_position_valueChanged);
|
|
|
|
QObject::connect(ui->dataAddress, &QLineEdit::returnPressed, this, &RemoteSinkGUI::on_dataAddress_returnPressed);
|
|
|
|
QObject::connect(ui->dataPort, &QLineEdit::returnPressed, this, &RemoteSinkGUI::on_dataPort_returnPressed);
|
|
|
|
QObject::connect(ui->dataApplyButton, &QPushButton::clicked, this, &RemoteSinkGUI::on_dataApplyButton_clicked);
|
|
|
|
QObject::connect(ui->nbFECBlocks, &QDial::valueChanged, this, &RemoteSinkGUI::on_nbFECBlocks_valueChanged);
|
|
|
|
QObject::connect(ui->nbTxBytes, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &RemoteSinkGUI::on_nbTxBytes_currentIndexChanged);
|
|
|
|
}
|
2022-04-13 05:08:21 -04:00
|
|
|
|
|
|
|
void RemoteSinkGUI::updateAbsoluteCenterFrequency()
|
|
|
|
{
|
|
|
|
int shift = m_shiftFrequencyFactor * m_basebandSampleRate;
|
|
|
|
setStatusFrequency(m_deviceCenterFrequency + shift);
|
|
|
|
}
|