2018-02-22 16:52:49 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2018 F4HKW //
|
|
|
|
// for F4EXB / SDRAngel //
|
|
|
|
// using LeanSDR Framework (C) 2016 F4DAV //
|
|
|
|
// //
|
|
|
|
// 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-02-22 16:52:49 -05: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 <QDockWidget>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QMediaMetaData>
|
|
|
|
|
|
|
|
#include "device/deviceuiset.h"
|
2019-12-03 18:08:05 -05:00
|
|
|
#include "dsp/dspengine.h"
|
2022-04-13 05:08:21 -04:00
|
|
|
#include "dsp/dspcommands.h"
|
2018-02-22 16:52:49 -05:00
|
|
|
#include "plugin/pluginapi.h"
|
|
|
|
#include "util/simpleserializer.h"
|
|
|
|
#include "util/db.h"
|
2019-03-19 18:12:54 -04:00
|
|
|
#include "gui/crightclickenabler.h"
|
|
|
|
#include "gui/audioselectdialog.h"
|
2020-09-21 14:10:17 -04:00
|
|
|
#include "gui/basicchannelsettingsdialog.h"
|
|
|
|
#include "gui/devicestreamselectiondialog.h"
|
2022-12-20 05:31:15 -05:00
|
|
|
#include "gui/dialpopup.h"
|
|
|
|
#include "gui/dialogpositioner.h"
|
2018-02-22 16:52:49 -05:00
|
|
|
#include "mainwindow.h"
|
|
|
|
|
2022-04-13 05:08:21 -04:00
|
|
|
#include "ui_datvdemodgui.h"
|
2019-12-03 18:08:05 -05:00
|
|
|
#include "datvdemodreport.h"
|
2021-03-06 18:29:01 -05:00
|
|
|
#include "datvdvbs2ldpcdialog.h"
|
2019-12-03 18:08:05 -05:00
|
|
|
#include "datvdemodgui.h"
|
|
|
|
|
2020-11-21 14:24:18 -05:00
|
|
|
const char* const DATVDemodGUI::m_strChannelID = "sdrangel.channel.demoddatv";
|
2022-10-16 16:59:52 -04:00
|
|
|
const QList<int> DATVDemodGUI::m_symbolRates = {
|
|
|
|
25000,
|
|
|
|
33000,
|
|
|
|
66000,
|
|
|
|
125000,
|
|
|
|
250000,
|
|
|
|
333000,
|
|
|
|
500000,
|
|
|
|
1000000,
|
|
|
|
1500000,
|
|
|
|
2000000
|
|
|
|
};
|
2018-02-22 16:52:49 -05:00
|
|
|
|
|
|
|
DATVDemodGUI* DATVDemodGUI::create(PluginAPI* objPluginAPI,
|
|
|
|
DeviceUISet *deviceUISet,
|
|
|
|
BasebandSampleSink *rxChannel)
|
|
|
|
{
|
|
|
|
DATVDemodGUI* gui = new DATVDemodGUI(objPluginAPI, deviceUISet, rxChannel);
|
|
|
|
return gui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::destroy()
|
2018-02-24 18:07:08 -05:00
|
|
|
{
|
2018-02-22 16:52:49 -05:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::resetToDefaults()
|
|
|
|
{
|
2019-03-17 21:26:03 -04:00
|
|
|
m_settings.resetToDefaults();
|
|
|
|
displaySettings();
|
|
|
|
applySettings(true);
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray DATVDemodGUI::serialize() const
|
|
|
|
{
|
2019-03-17 21:26:03 -04:00
|
|
|
return m_settings.serialize();
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bool DATVDemodGUI::deserialize(const QByteArray& arrData)
|
|
|
|
{
|
2019-03-17 21:26:03 -04:00
|
|
|
if (m_settings.deserialize(arrData))
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2019-03-17 21:26:03 -04:00
|
|
|
displaySettings();
|
|
|
|
applySettings(true);
|
2018-02-22 16:52:49 -05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
resetToDefaults();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-16 20:51:46 -04:00
|
|
|
bool DATVDemodGUI::handleMessage(const Message& message)
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2019-12-03 18:08:05 -05:00
|
|
|
if (DATVDemodReport::MsgReportModcodCstlnChange::match(message))
|
2019-07-16 20:51:46 -04:00
|
|
|
{
|
2019-12-03 18:08:05 -05:00
|
|
|
DATVDemodReport::MsgReportModcodCstlnChange& notif = (DATVDemodReport::MsgReportModcodCstlnChange&) message;
|
2019-07-16 20:51:46 -04:00
|
|
|
m_settings.m_fec = notif.getCodeRate();
|
|
|
|
m_settings.m_modulation = notif.getModulation();
|
|
|
|
m_settings.validateSystemConfiguration();
|
2021-03-08 02:35:30 -05:00
|
|
|
qDebug("DATVDemodReport::MsgReportModcodCstlnChange: m_modulation: %d m_fec: %d",
|
|
|
|
m_settings.m_modulation, m_settings.m_fec);
|
2019-07-16 20:51:46 -04:00
|
|
|
displaySystemConfiguration();
|
2019-07-17 07:57:50 -04:00
|
|
|
return true;
|
2019-07-16 20:51:46 -04:00
|
|
|
}
|
2021-04-02 03:48:37 -04:00
|
|
|
else if (DATVDemod::MsgConfigureDATVDemod::match(message))
|
|
|
|
{
|
|
|
|
DATVDemod::MsgConfigureDATVDemod& cfg = (DATVDemod::MsgConfigureDATVDemod&) message;
|
|
|
|
m_settings = cfg.getSettings();
|
2022-04-16 10:45:53 -04:00
|
|
|
m_channelMarker.updateSettings(static_cast<const ChannelMarker*>(m_settings.m_channelMarker));
|
2021-04-02 03:48:37 -04:00
|
|
|
displaySettings();
|
|
|
|
return true;
|
|
|
|
}
|
2022-04-13 05:08:21 -04:00
|
|
|
else if (DSPSignalNotification::match(message))
|
|
|
|
{
|
|
|
|
DSPSignalNotification& notif = (DSPSignalNotification&) message;
|
|
|
|
m_deviceCenterFrequency = notif.getCenterFrequency();
|
|
|
|
m_basebandSampleRate = notif.getSampleRate();
|
|
|
|
ui->deltaFrequency->setValueRange(false, 8, -m_basebandSampleRate/2, m_basebandSampleRate/2);
|
|
|
|
ui->deltaFrequencyLabel->setToolTip(tr("Range %1 %L2 Hz").arg(QChar(0xB1)).arg(m_basebandSampleRate/2));
|
|
|
|
updateAbsoluteCenterFrequency();
|
|
|
|
return true;
|
|
|
|
}
|
2019-07-16 20:51:46 -04:00
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::handleInputMessages()
|
|
|
|
{
|
|
|
|
Message* message;
|
|
|
|
|
|
|
|
while ((message = getInputMessageQueue()->pop()) != 0)
|
|
|
|
{
|
|
|
|
if (handleMessage(*message))
|
|
|
|
{
|
|
|
|
delete message;
|
|
|
|
}
|
|
|
|
}
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::channelMarkerChangedByCursor()
|
|
|
|
{
|
2022-04-16 10:45:53 -04:00
|
|
|
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
|
|
|
|
m_settings.m_centerFrequency = m_channelMarker.getCenterFrequency();
|
2020-09-21 13:45:14 -04:00
|
|
|
applySettings();
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::channelMarkerHighlightedByCursor()
|
|
|
|
{
|
2022-04-25 18:42:26 -04:00
|
|
|
setHighlighted(m_channelMarker.getHighlighted());
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-11-12 18:45:03 -05:00
|
|
|
void DATVDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
2018-02-22 16:52:49 -05: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-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2020-09-21 14:10:17 -04:00
|
|
|
void DATVDemodGUI::onMenuDialogCalled(const QPoint &p)
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2020-09-21 14:10:17 -04:00
|
|
|
if (m_contextMenuType == ContextMenuChannelSettings)
|
|
|
|
{
|
2022-04-16 10:45:53 -04:00
|
|
|
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
2020-09-21 14:10:17 -04:00
|
|
|
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_datvDemod->getNumberOfDeviceStreams());
|
|
|
|
dialog.setStreamIndex(m_settings.m_streamIndex);
|
|
|
|
}
|
|
|
|
|
2020-09-21 14:10:17 -04:00
|
|
|
dialog.move(p);
|
2022-12-20 05:31:15 -05:00
|
|
|
new DialogPositioner(&dialog, false);
|
2020-09-21 14:10:17 -04:00
|
|
|
dialog.exec();
|
|
|
|
|
2022-04-16 10:45:53 -04:00
|
|
|
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
|
|
|
|
m_settings.m_title = m_channelMarker.getTitle();
|
2020-09-21 14:10:17 -04: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();
|
|
|
|
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
|
|
|
|
|
|
|
|
setWindowTitle(m_settings.m_title);
|
2022-04-16 10:45:53 -04:00
|
|
|
setTitle(m_channelMarker.getTitle());
|
2020-09-21 14:10:17 -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();
|
|
|
|
}
|
2020-09-21 14:10:17 -04:00
|
|
|
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
resetContextMenuType();
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* objParent) :
|
2022-04-13 05:08:21 -04:00
|
|
|
ChannelGUI(objParent),
|
|
|
|
ui(new Ui::DATVDemodGUI),
|
|
|
|
m_objPluginAPI(objPluginAPI),
|
|
|
|
m_deviceUISet(deviceUISet),
|
2022-04-16 10:45:53 -04:00
|
|
|
m_channelMarker(this),
|
2022-04-13 05:08:21 -04:00
|
|
|
m_deviceCenterFrequency(0),
|
|
|
|
m_basebandSampleRate(1),
|
|
|
|
m_blnBasicSettingsShown(false),
|
|
|
|
m_blnDoApplySettings(true),
|
|
|
|
m_modcodModulationIndex(-1),
|
|
|
|
m_modcodCodeRateIndex(-1),
|
|
|
|
m_cstlnSetByModcod(false)
|
2018-02-24 18:07:08 -05:00
|
|
|
{
|
2022-04-24 06:28:56 -04:00
|
|
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
2021-11-24 06:31:51 -05:00
|
|
|
m_helpURL = "plugins/channelrx/demoddatv/readme.md";
|
2022-04-24 06:28:56 -04:00
|
|
|
RollupContents *rollupContents = getRollupContents();
|
|
|
|
ui->setupUi(rollupContents);
|
|
|
|
setSizePolicy(rollupContents->sizePolicy());
|
|
|
|
rollupContents->arrangeRollups();
|
|
|
|
connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
|
|
|
|
2018-03-11 14:43:40 -04:00
|
|
|
ui->screenTV->setColor(true);
|
2021-10-30 06:35:02 -04:00
|
|
|
ui->screenTV->resizeTVScreen(256,256);
|
2022-04-24 06:28:56 -04:00
|
|
|
|
2020-09-21 14:10:17 -04:00
|
|
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
2019-07-16 20:51:46 -04:00
|
|
|
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2021-02-22 19:06:25 -05:00
|
|
|
ui->merMeter->setColorTheme(LevelMeterSignalDB::ColorCyanAndBlue);
|
|
|
|
ui->merMeter->setRange(0, 30);
|
2021-04-06 22:33:09 -04:00
|
|
|
ui->merMeter->setAverageSmoothing(32);
|
2021-02-22 19:06:25 -05:00
|
|
|
|
|
|
|
ui->cnrMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
|
|
|
|
ui->cnrMeter->setRange(0, 30);
|
|
|
|
ui->cnrMeter->setAverageSmoothing(2);
|
|
|
|
|
2021-10-30 06:35:02 -04:00
|
|
|
m_datvDemod = (DATVDemod*) rxChannel;
|
|
|
|
m_datvDemod->setMessageQueueToGUI(getInputMessageQueue());
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2021-10-30 06:35:02 -04:00
|
|
|
m_datvDemod->SetTVScreen(ui->screenTV);
|
|
|
|
m_datvDemod->SetVideoRender(ui->screenTV_2);
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2021-04-11 17:52:16 -04:00
|
|
|
if (m_settings.m_playerEnable) {
|
2021-10-30 06:35:02 -04:00
|
|
|
connect(m_datvDemod->getVideoStream(), &DATVideostream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
2021-04-11 17:52:16 -04:00
|
|
|
} else {
|
2021-10-30 06:35:02 -04:00
|
|
|
connect(m_datvDemod->getUDPStream(), &DATVUDPStream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
2021-04-11 17:52:16 -04:00
|
|
|
}
|
|
|
|
|
2022-04-16 10:45:53 -04:00
|
|
|
m_settings.setChannelMarker(&m_channelMarker);
|
2022-01-08 23:27:12 -05:00
|
|
|
m_settings.setRollupState(&m_rollupState);
|
2021-12-02 17:54:39 -05:00
|
|
|
|
2019-03-19 18:12:54 -04:00
|
|
|
connect(ui->screenTV_2, &DATVideoRender::onMetaDataChanged, this, &DATVDemodGUI::on_StreamMetaDataChanged);
|
2018-02-22 16:52:49 -05:00
|
|
|
|
|
|
|
m_intPreviousDecodedData=0;
|
|
|
|
m_intLastDecodedData=0;
|
|
|
|
m_intLastSpeed=0;
|
|
|
|
m_intReadyDecodedData=0;
|
|
|
|
m_objTimer.setInterval(1000);
|
|
|
|
connect(&m_objTimer, SIGNAL(timeout()), this, SLOT(tick()));
|
2021-10-28 16:50:40 -04:00
|
|
|
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tickMeter())); // 50 ms
|
2018-02-22 16:52:49 -05:00
|
|
|
m_objTimer.start();
|
|
|
|
|
2019-03-23 20:37:34 -04:00
|
|
|
ui->fullScreen->setVisible(false);
|
2019-03-23 18:37:26 -04:00
|
|
|
|
2018-03-10 04:43:22 -05:00
|
|
|
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
|
|
|
|
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
2020-07-01 07:14:48 -04:00
|
|
|
ui->deltaFrequency->setValueRange(false, 8, -99999999, 99999999);
|
2018-03-10 04:43:22 -05:00
|
|
|
|
|
|
|
ui->rfBandwidth->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
|
2022-02-10 06:40:05 -05:00
|
|
|
ui->rfBandwidth->setValueRange(true, 8, 0, 50000000);
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2022-04-16 10:45:53 -04:00
|
|
|
m_channelMarker.blockSignals(true);
|
|
|
|
m_channelMarker.setColor(Qt::magenta);
|
|
|
|
m_channelMarker.setBandwidth(6000000);
|
|
|
|
m_channelMarker.setCenterFrequency(0);
|
|
|
|
m_channelMarker.setTitle("DATV Demodulator");
|
|
|
|
m_channelMarker.blockSignals(false);
|
|
|
|
m_channelMarker.setVisible(true);
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2022-04-16 10:45:53 -04:00
|
|
|
connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
|
|
|
|
connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2022-04-16 10:45:53 -04:00
|
|
|
m_deviceUISet->addChannelMarker(&m_channelMarker);
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2019-03-23 01:06:42 -04:00
|
|
|
// QPixmap pixmapTarget = QPixmap(":/film.png");
|
|
|
|
// pixmapTarget = pixmapTarget.scaled(16, 16, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
|
|
// ui->videoPlay->setAlignment(Qt::AlignCenter);
|
|
|
|
// ui->videoPlay->setPixmap(pixmapTarget);
|
2019-03-19 18:12:54 -04:00
|
|
|
|
|
|
|
CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute);
|
2022-12-28 14:33:28 -05:00
|
|
|
connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect(const QPoint &)));
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2021-03-06 18:29:01 -05:00
|
|
|
CRightClickEnabler *ldpcToolRightClickEnabler = new CRightClickEnabler(ui->softLDPC);
|
2022-12-28 14:33:28 -05:00
|
|
|
connect(ldpcToolRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(ldpcToolSelect(const QPoint &)));
|
2021-03-06 18:29:01 -05:00
|
|
|
|
2021-03-28 12:40:43 -04:00
|
|
|
ui->playerIndicator->setStyleSheet("QLabel { background-color: gray; border-radius: 8px; }");
|
2021-04-11 17:52:16 -04:00
|
|
|
ui->udpIndicator->setStyleSheet("QLabel { background-color: gray; border-radius: 8px; }");
|
2018-02-22 16:52:49 -05:00
|
|
|
resetToDefaults(); // does applySettings()
|
2022-04-12 10:20:45 -04:00
|
|
|
makeUIConnections();
|
2022-12-20 05:31:15 -05:00
|
|
|
DialPopup::addPopupsToChildDials(this);
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
DATVDemodGUI::~DATVDemodGUI()
|
|
|
|
{
|
2022-07-19 22:56:40 -04:00
|
|
|
ui->screenTV->setParent(nullptr); // Prefer memory leak to core dump... ~TVScreen() is buggy
|
|
|
|
ui->screenTV_2->setParent(nullptr); // Prefer memory leak to core dump... ~DATVideoRender() is buggy
|
2018-02-22 16:52:49 -05:00
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::blockApplySettings(bool blnBlock)
|
|
|
|
{
|
|
|
|
m_blnDoApplySettings = !blnBlock;
|
|
|
|
}
|
|
|
|
|
2019-03-17 21:26:03 -04:00
|
|
|
void DATVDemodGUI::displaySettings()
|
|
|
|
{
|
2022-04-16 10:45:53 -04:00
|
|
|
m_channelMarker.blockSignals(true);
|
|
|
|
m_channelMarker.setCenterFrequency(m_settings.m_centerFrequency);
|
|
|
|
m_channelMarker.setColor(m_settings.m_rgbColor);
|
|
|
|
m_channelMarker.setTitle(m_settings.m_title);
|
|
|
|
m_channelMarker.blockSignals(false);
|
|
|
|
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
|
2021-04-02 14:48:10 -04:00
|
|
|
|
|
|
|
blockApplySettings(true);
|
2019-07-16 20:51:46 -04:00
|
|
|
|
2020-09-21 14:10:17 -04:00
|
|
|
setTitleColor(m_settings.m_rgbColor);
|
2022-04-16 10:45:53 -04:00
|
|
|
setWindowTitle(m_channelMarker.getTitle());
|
|
|
|
setTitle(m_channelMarker.getTitle());
|
2020-09-21 14:10:17 -04:00
|
|
|
|
|
|
|
ui->deltaFrequency->setValue(m_settings.m_centerFrequency);
|
2019-03-17 21:26:03 -04:00
|
|
|
ui->chkAllowDrift->setChecked(m_settings.m_allowDrift);
|
2019-07-16 20:51:46 -04:00
|
|
|
ui->chkHardMetric->setChecked(m_settings.m_hardMetric);
|
2019-03-17 21:26:03 -04:00
|
|
|
ui->chkFastlock->setChecked(m_settings.m_fastLock);
|
2019-07-16 20:51:46 -04:00
|
|
|
ui->chkViterbi->setChecked(m_settings.m_viterbi);
|
2021-02-27 06:51:32 -05:00
|
|
|
ui->softLDPC->setChecked(m_settings.m_softLDPC);
|
|
|
|
ui->maxBitflips->setValue(m_settings.m_maxBitflips);
|
2022-10-16 16:59:52 -04:00
|
|
|
ui->datvStdSR->setValue(indexFromSymbolRate(m_settings.m_symbolRate));
|
2019-07-16 20:51:46 -04:00
|
|
|
|
2019-07-17 09:43:20 -04:00
|
|
|
if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S)
|
|
|
|
{
|
|
|
|
ui->chkAllowDrift->setEnabled(true);
|
|
|
|
ui->chkHardMetric->setEnabled(true);
|
|
|
|
ui->chkFastlock->setEnabled(true);
|
|
|
|
ui->chkViterbi->setEnabled(true);
|
2021-02-27 06:51:32 -05:00
|
|
|
ui->maxBitflips->setEnabled(false);
|
2019-07-17 09:43:20 -04:00
|
|
|
ui->chkAllowDrift->setStyleSheet("QCheckBox { color: white }");
|
|
|
|
ui->chkHardMetric->setStyleSheet("QCheckBox { color: white }");
|
|
|
|
ui->chkFastlock->setStyleSheet("QCheckBox { color: white }");
|
|
|
|
ui->chkViterbi->setStyleSheet("QCheckBox { color: white }");
|
2021-02-27 06:51:32 -05:00
|
|
|
ui->maxBitflips->setStyleSheet("QSpinBox { color: gray }");
|
|
|
|
ui->maxBitflipsLabel->setStyleSheet("QLabel { color: gray }");
|
2019-07-17 09:43:20 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ui->chkAllowDrift->setEnabled(false);
|
|
|
|
ui->chkHardMetric->setEnabled(false);
|
|
|
|
ui->chkFastlock->setEnabled(false);
|
|
|
|
ui->chkViterbi->setEnabled(false);
|
2021-02-27 06:51:32 -05:00
|
|
|
ui->maxBitflips->setEnabled(true);
|
2019-07-17 09:43:20 -04:00
|
|
|
ui->chkAllowDrift->setStyleSheet("QCheckBox { color: gray }");
|
|
|
|
ui->chkHardMetric->setStyleSheet("QCheckBox { color: gray }");
|
|
|
|
ui->chkFastlock->setStyleSheet("QCheckBox { color: gray }");
|
|
|
|
ui->chkViterbi->setStyleSheet("QCheckBox { color: gray }");
|
2021-02-27 06:51:32 -05:00
|
|
|
ui->maxBitflips->setStyleSheet("QSpinBox { color: white }");
|
|
|
|
ui->maxBitflipsLabel->setStyleSheet("QLabel { color: white }");
|
2019-07-17 09:43:20 -04:00
|
|
|
}
|
2019-03-17 21:26:03 -04:00
|
|
|
|
2021-03-07 01:41:19 -05:00
|
|
|
if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S)
|
|
|
|
{
|
|
|
|
ui->softLDPC->setEnabled(false);
|
|
|
|
ui->softLDPC->setStyleSheet("QCheckBox { color: gray }");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ui->softLDPC->setEnabled(true);
|
|
|
|
ui->softLDPC->setStyleSheet("QCheckBox { color: white }");
|
|
|
|
}
|
|
|
|
|
2021-03-30 23:03:10 -04:00
|
|
|
if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S)
|
|
|
|
{
|
2019-07-16 20:51:46 -04:00
|
|
|
ui->statusText->clear();
|
2021-03-30 23:03:10 -04:00
|
|
|
ui->statusText->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
2019-07-16 20:51:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
ui->cmbFilter->setCurrentIndex((int) m_settings.m_filter);
|
2019-03-17 21:26:03 -04:00
|
|
|
displayRRCParameters(((int) m_settings.m_filter == 2));
|
|
|
|
|
2021-03-14 01:57:55 -05:00
|
|
|
ui->spiRollOff->setValue((int) roundf(m_settings.m_rollOff * 100.0f));
|
2019-03-19 18:12:54 -04:00
|
|
|
ui->audioMute->setChecked(m_settings.m_audioMute);
|
2019-07-16 20:51:46 -04:00
|
|
|
displaySystemConfiguration();
|
2019-03-17 21:26:03 -04:00
|
|
|
ui->cmbStandard->setCurrentIndex((int) m_settings.m_standard);
|
|
|
|
ui->spiNotchFilters->setValue(m_settings.m_notchFilters);
|
|
|
|
ui->rfBandwidth->setValue(m_settings.m_rfBandwidth);
|
|
|
|
ui->spiSymbolRate->setValue(m_settings.m_symbolRate);
|
|
|
|
ui->spiExcursion->setValue(m_settings.m_excursion);
|
2019-03-22 03:05:01 -04:00
|
|
|
ui->audioVolume->setValue(m_settings.m_audioVolume);
|
|
|
|
ui->audioVolumeText->setText(tr("%1").arg(m_settings.m_audioVolume));
|
2019-03-23 01:06:42 -04:00
|
|
|
ui->videoMute->setChecked(m_settings.m_videoMute);
|
2019-07-28 04:54:04 -04:00
|
|
|
ui->udpTS->setChecked(m_settings.m_udpTS);
|
|
|
|
ui->udpTSAddress->setText(m_settings.m_udpTSAddress);
|
|
|
|
ui->udpTSPort->setText(tr("%1").arg(m_settings.m_udpTSPort));
|
2021-04-11 17:52:16 -04:00
|
|
|
ui->playerEnable->setChecked(m_settings.m_playerEnable);
|
|
|
|
|
|
|
|
if (m_settings.m_playerEnable)
|
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
disconnect(m_datvDemod->getUDPStream(), &DATVUDPStream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
|
|
|
connect(m_datvDemod->getVideoStream(), &DATVideostream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
2021-04-11 17:52:16 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
disconnect(m_datvDemod->getVideoStream(), &DATVideostream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
|
|
|
connect(m_datvDemod->getUDPStream(), &DATVUDPStream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
2021-04-11 17:52:16 -04:00
|
|
|
}
|
2019-03-17 21:26:03 -04:00
|
|
|
|
2022-04-12 10:20:45 -04:00
|
|
|
getRollupContents()->restoreState(m_rollupState);
|
2022-04-13 05:08:21 -04:00
|
|
|
updateAbsoluteCenterFrequency();
|
2022-04-17 19:42:03 -04:00
|
|
|
updateIndexLabel();
|
2019-03-17 21:26:03 -04:00
|
|
|
blockApplySettings(false);
|
|
|
|
}
|
|
|
|
|
2019-07-16 20:51:46 -04:00
|
|
|
void DATVDemodGUI::displaySystemConfiguration()
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2019-07-16 20:51:46 -04:00
|
|
|
ui->cmbModulation->blockSignals(true);
|
|
|
|
ui->cmbFEC->blockSignals(true);
|
|
|
|
|
|
|
|
std::vector<DATVDemodSettings::DATVModulation> modulations;
|
|
|
|
DATVDemodSettings::getAvailableModulations(m_settings.m_standard, modulations);
|
|
|
|
std::vector<DATVDemodSettings::DATVCodeRate> codeRates;
|
|
|
|
DATVDemodSettings::getAvailableCodeRates(m_settings.m_standard, m_settings.m_modulation, codeRates);
|
|
|
|
|
|
|
|
ui->cmbModulation->clear();
|
|
|
|
int modulationIndex = 0;
|
|
|
|
int i;
|
|
|
|
std::vector<DATVDemodSettings::DATVModulation>::const_iterator mIt = modulations.begin();
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2019-07-16 20:51:46 -04:00
|
|
|
for (i = 0; mIt != modulations.end(); ++mIt, i++)
|
|
|
|
{
|
|
|
|
ui->cmbModulation->addItem(DATVDemodSettings::getStrFromModulation(*mIt));
|
|
|
|
|
|
|
|
if (m_settings.m_modulation == *mIt) {
|
|
|
|
modulationIndex = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ui->cmbFEC->clear();
|
|
|
|
int rateIndex = 0;
|
|
|
|
std::vector<DATVDemodSettings::DATVCodeRate>::const_iterator rIt = codeRates.begin();
|
|
|
|
|
|
|
|
for (i = 0; rIt != codeRates.end(); ++rIt, i++)
|
|
|
|
{
|
|
|
|
ui->cmbFEC->addItem(DATVDemodSettings::getStrFromCodeRate(*rIt));
|
|
|
|
|
|
|
|
if (m_settings.m_fec == *rIt) {
|
|
|
|
rateIndex = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ui->cmbModulation->setCurrentIndex(modulationIndex);
|
|
|
|
ui->cmbFEC->setCurrentIndex(rateIndex);
|
|
|
|
|
|
|
|
ui->cmbModulation->blockSignals(false);
|
|
|
|
ui->cmbFEC->blockSignals(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::applySettings(bool force)
|
|
|
|
{
|
2018-02-22 16:52:49 -05:00
|
|
|
if (m_blnDoApplySettings)
|
|
|
|
{
|
2019-07-14 09:35:45 -04:00
|
|
|
qDebug("DATVDemodGUI::applySettings");
|
|
|
|
|
2022-04-16 10:45:53 -04:00
|
|
|
setTitleColor(m_channelMarker.getColor());
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2019-07-28 04:54:04 -04:00
|
|
|
QString msg = tr("DATVDemodGUI::applySettings: force: %1").arg(force ? "true" : "false");
|
2019-03-17 21:26:03 -04:00
|
|
|
m_settings.debug(msg);
|
|
|
|
|
|
|
|
DATVDemod::MsgConfigureDATVDemod* message = DATVDemod::MsgConfigureDATVDemod::create(m_settings, force);
|
2021-10-30 06:35:02 -04:00
|
|
|
m_datvDemod->getInputMessageQueue()->push(message);
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-22 13:21:24 -04:00
|
|
|
void DATVDemodGUI::leaveEvent(QEvent* event)
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
|
|
|
blockApplySettings(true);
|
2022-04-16 10:45:53 -04:00
|
|
|
m_channelMarker.setHighlighted(false);
|
2018-02-22 16:52:49 -05:00
|
|
|
blockApplySettings(false);
|
2022-04-22 13:21:24 -04:00
|
|
|
ChannelGUI::leaveEvent(event);
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2022-11-17 09:36:12 -05:00
|
|
|
void DATVDemodGUI::enterEvent(EnterEventType* event)
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
|
|
|
blockApplySettings(true);
|
2022-04-16 10:45:53 -04:00
|
|
|
m_channelMarker.setHighlighted(true);
|
2018-02-22 16:52:49 -05:00
|
|
|
blockApplySettings(false);
|
2022-04-22 13:21:24 -04:00
|
|
|
ChannelGUI::enterEvent(event);
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2022-12-28 14:33:28 -05:00
|
|
|
void DATVDemodGUI::audioSelect(const QPoint& p)
|
2019-03-19 18:12:54 -04:00
|
|
|
{
|
2021-03-06 18:29:01 -05:00
|
|
|
qDebug("DATVDemodGUI::audioSelect");
|
2019-03-19 18:12:54 -04:00
|
|
|
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
|
2022-12-28 14:33:28 -05:00
|
|
|
audioSelect.move(p);
|
2019-03-19 18:12:54 -04:00
|
|
|
audioSelect.exec();
|
|
|
|
|
|
|
|
if (audioSelect.m_selected)
|
|
|
|
{
|
|
|
|
m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-28 14:33:28 -05:00
|
|
|
void DATVDemodGUI::ldpcToolSelect(const QPoint& p)
|
2021-03-06 18:29:01 -05:00
|
|
|
{
|
|
|
|
qDebug("DATVDemodGUI::ldpcToolSelect");
|
|
|
|
DatvDvbS2LdpcDialog ldpcDialog;
|
|
|
|
ldpcDialog.setFileName(m_settings.m_softLDPCToolPath);
|
|
|
|
ldpcDialog.setMaxTrials(m_settings.m_softLDPCMaxTrials);
|
2022-12-28 14:33:28 -05:00
|
|
|
ldpcDialog.move(p);
|
2021-03-06 18:29:01 -05:00
|
|
|
|
|
|
|
if (ldpcDialog.exec() == QDialog::Accepted)
|
|
|
|
{
|
|
|
|
m_settings.m_softLDPCMaxTrials = ldpcDialog.getMaxTrials();
|
|
|
|
m_settings.m_softLDPCToolPath = ldpcDialog.getFileName();
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-22 16:52:49 -05:00
|
|
|
void DATVDemodGUI::tick()
|
2018-02-24 18:07:08 -05:00
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
if (m_datvDemod)
|
2018-03-10 17:01:03 -05:00
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
m_objMagSqAverage(m_datvDemod->getMagSq());
|
2018-03-10 17:01:03 -05:00
|
|
|
double magSqDB = CalcDb::dbPower(m_objMagSqAverage / (SDR_RX_SCALED*SDR_RX_SCALED));
|
|
|
|
ui->channePowerText->setText(tr("%1 dB").arg(magSqDB, 0, 'f', 1));
|
2019-07-16 20:51:46 -04:00
|
|
|
|
2021-10-30 06:35:02 -04:00
|
|
|
if ((m_modcodModulationIndex != m_datvDemod->getModcodModulation()) || (m_modcodCodeRateIndex != m_datvDemod->getModcodCodeRate()))
|
2019-07-16 20:51:46 -04:00
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
m_modcodModulationIndex = m_datvDemod->getModcodModulation();
|
|
|
|
m_modcodCodeRateIndex = m_datvDemod->getModcodCodeRate();
|
2019-12-03 18:08:05 -05:00
|
|
|
DATVDemodSettings::DATVModulation modulation = DATVDemodSettings::getModulationFromLeanDVBCode(m_modcodModulationIndex);
|
|
|
|
DATVDemodSettings::DATVCodeRate rate = DATVDemodSettings::getCodeRateFromLeanDVBCode(m_modcodCodeRateIndex);
|
2019-07-16 20:51:46 -04:00
|
|
|
QString modcodModulationStr = DATVDemodSettings::getStrFromModulation(modulation);
|
|
|
|
QString modcodCodeRateStr = DATVDemodSettings::getStrFromCodeRate(rate);
|
|
|
|
ui->statusText->setText(tr("MCOD %1 %2").arg(modcodModulationStr).arg(modcodCodeRateStr));
|
|
|
|
}
|
|
|
|
|
2021-10-30 06:35:02 -04:00
|
|
|
if (m_cstlnSetByModcod != m_datvDemod->isCstlnSetByModcod())
|
2019-07-16 20:51:46 -04:00
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
m_cstlnSetByModcod = m_datvDemod->isCstlnSetByModcod();
|
2019-07-16 20:51:46 -04:00
|
|
|
|
|
|
|
if (m_cstlnSetByModcod) {
|
|
|
|
ui->statusText->setStyleSheet("QLabel { background-color : green; }");
|
|
|
|
} else {
|
|
|
|
ui->statusText->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
|
|
|
}
|
|
|
|
}
|
2018-03-10 17:01:03 -05:00
|
|
|
}
|
|
|
|
|
2018-02-22 16:52:49 -05:00
|
|
|
if((m_intLastDecodedData-m_intPreviousDecodedData)>=0)
|
2018-02-24 18:07:08 -05:00
|
|
|
{
|
2018-02-22 16:52:49 -05:00
|
|
|
m_intLastSpeed = 8*(m_intLastDecodedData-m_intPreviousDecodedData);
|
|
|
|
ui->lblRate->setText(QString("Speed: %1b/s").arg(formatBytes(m_intLastSpeed)));
|
|
|
|
}
|
|
|
|
|
2021-10-30 06:35:02 -04:00
|
|
|
if (m_datvDemod->audioActive())
|
2019-03-23 04:38:29 -04:00
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
if (m_datvDemod->audioDecodeOK()) {
|
2019-03-23 04:38:29 -04:00
|
|
|
ui->audioMute->setStyleSheet("QToolButton { background-color : green; }");
|
|
|
|
} else {
|
|
|
|
ui->audioMute->setStyleSheet("QToolButton { background-color : red; }");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-03-19 18:12:54 -04:00
|
|
|
ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
|
|
|
}
|
|
|
|
|
2021-10-30 06:35:02 -04:00
|
|
|
if (m_datvDemod->videoActive())
|
2019-03-23 04:38:29 -04:00
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
if (m_datvDemod->videoDecodeOK()) {
|
2019-03-23 04:38:29 -04:00
|
|
|
ui->videoMute->setStyleSheet("QToolButton { background-color : green; }");
|
|
|
|
} else {
|
|
|
|
ui->videoMute->setStyleSheet("QToolButton { background-color : red; }");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ui->videoMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
|
|
|
}
|
|
|
|
|
2018-02-22 16:52:49 -05:00
|
|
|
m_intPreviousDecodedData = m_intLastDecodedData;
|
|
|
|
|
|
|
|
//Try to start video rendering
|
2021-10-30 06:35:02 -04:00
|
|
|
bool success = m_datvDemod->playVideo();
|
2021-03-28 12:40:43 -04:00
|
|
|
|
|
|
|
if (success) {
|
|
|
|
ui->playerIndicator->setStyleSheet("QLabel { background-color: rgb(85, 232, 85); border-radius: 8px; }"); // green
|
|
|
|
} else {
|
|
|
|
ui->playerIndicator->setStyleSheet("QLabel { background-color: gray; border-radius: 8px; }");
|
|
|
|
}
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2021-10-30 06:35:02 -04:00
|
|
|
if (m_datvDemod->udpRunning()) {
|
2021-04-11 17:52:16 -04:00
|
|
|
ui->udpIndicator->setStyleSheet("QLabel { background-color: rgb(85, 232, 85); border-radius: 8px; }"); // green
|
|
|
|
} else {
|
|
|
|
ui->udpIndicator->setStyleSheet("QLabel { background-color: gray; border-radius: 8px; }");
|
|
|
|
}
|
2021-10-28 16:50:40 -04:00
|
|
|
}
|
2021-04-11 17:52:16 -04:00
|
|
|
|
2021-10-28 16:50:40 -04:00
|
|
|
void DATVDemodGUI::tickMeter()
|
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
ui->merMeter->levelChanged(m_datvDemod->getMERRMS(), m_datvDemod->getMERPeak(), m_datvDemod->getMERNbAvg());
|
|
|
|
ui->cnrMeter->levelChanged(m_datvDemod->getCNRRMS(), m_datvDemod->getCNRPeak(), m_datvDemod->getCNRNbAvg());
|
|
|
|
ui->merText->setText(QString("%1").arg(m_datvDemod->getMERAvg(), 0, 'f', 1));
|
|
|
|
ui->cnrText->setText(QString("%1").arg(m_datvDemod->getCNRAvg(), 0, 'f', 1));
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2019-07-16 20:51:46 -04:00
|
|
|
void DATVDemodGUI::on_cmbStandard_currentIndexChanged(int index)
|
2018-02-24 18:07:08 -05:00
|
|
|
{
|
2019-07-16 20:51:46 -04:00
|
|
|
m_settings.m_standard = (DATVDemodSettings::dvb_version) index;
|
2019-07-14 09:35:45 -04:00
|
|
|
|
2019-07-17 09:43:20 -04:00
|
|
|
if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S)
|
|
|
|
{
|
|
|
|
ui->chkAllowDrift->setEnabled(true);
|
|
|
|
ui->chkHardMetric->setEnabled(true);
|
|
|
|
ui->chkFastlock->setEnabled(true);
|
|
|
|
ui->chkViterbi->setEnabled(true);
|
2021-02-27 06:51:32 -05:00
|
|
|
ui->maxBitflips->setEnabled(false);
|
2019-07-17 09:43:20 -04:00
|
|
|
ui->chkAllowDrift->setStyleSheet("QCheckBox { color: white }");
|
|
|
|
ui->chkHardMetric->setStyleSheet("QCheckBox { color: white }");
|
|
|
|
ui->chkFastlock->setStyleSheet("QCheckBox { color: white }");
|
|
|
|
ui->chkViterbi->setStyleSheet("QCheckBox { color: white }");
|
2021-02-27 06:51:32 -05:00
|
|
|
ui->maxBitflips->setStyleSheet("QSpinBox { color: gray }");
|
|
|
|
ui->maxBitflipsLabel->setStyleSheet("QLabel { color: gray }");
|
2019-07-17 09:43:20 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ui->chkAllowDrift->setEnabled(false);
|
|
|
|
ui->chkHardMetric->setEnabled(false);
|
|
|
|
ui->chkFastlock->setEnabled(false);
|
|
|
|
ui->chkViterbi->setEnabled(false);
|
2021-02-27 06:51:32 -05:00
|
|
|
ui->maxBitflips->setEnabled(true);
|
2019-07-17 09:43:20 -04:00
|
|
|
ui->chkAllowDrift->setStyleSheet("QCheckBox { color: gray }");
|
|
|
|
ui->chkHardMetric->setStyleSheet("QCheckBox { color: gray }");
|
|
|
|
ui->chkFastlock->setStyleSheet("QCheckBox { color: gray }");
|
|
|
|
ui->chkViterbi->setStyleSheet("QCheckBox { color: gray }");
|
2021-02-27 06:51:32 -05:00
|
|
|
ui->maxBitflips->setStyleSheet("QSpinBox { color: white }");
|
|
|
|
ui->maxBitflipsLabel->setStyleSheet("QLabel { color: white }");
|
2019-07-17 09:43:20 -04:00
|
|
|
}
|
2019-07-14 09:35:45 -04:00
|
|
|
|
2021-03-07 01:41:19 -05:00
|
|
|
if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S)
|
|
|
|
{
|
|
|
|
ui->softLDPC->setEnabled(false);
|
|
|
|
ui->softLDPC->setStyleSheet("QCheckBox { color: gray }");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ui->softLDPC->setEnabled(true);
|
|
|
|
ui->softLDPC->setStyleSheet("QCheckBox { color: white }");
|
|
|
|
}
|
|
|
|
|
2021-03-30 23:03:10 -04:00
|
|
|
if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S)
|
|
|
|
{
|
2019-07-16 20:51:46 -04:00
|
|
|
ui->statusText->clear();
|
2021-03-30 23:03:10 -04:00
|
|
|
ui->statusText->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
2019-07-14 09:35:45 -04:00
|
|
|
}
|
|
|
|
|
2019-07-16 20:51:46 -04:00
|
|
|
m_settings.validateSystemConfiguration();
|
|
|
|
displaySystemConfiguration();
|
2018-02-22 16:52:49 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2022-04-12 10:20:45 -04:00
|
|
|
void DATVDemodGUI::on_cmbModulation_currentIndexChanged(int arg1)
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2018-11-12 18:45:03 -05:00
|
|
|
(void) arg1;
|
2019-07-16 20:51:46 -04:00
|
|
|
QString strModulation = ui->cmbModulation->currentText();
|
|
|
|
m_settings.m_modulation = DATVDemodSettings::getModulationFromStr(strModulation);
|
|
|
|
m_settings.validateSystemConfiguration();
|
|
|
|
displaySystemConfiguration();
|
|
|
|
|
|
|
|
//Viterbi only for BPSK and QPSK
|
|
|
|
if ((m_settings.m_modulation != DATVDemodSettings::BPSK)
|
|
|
|
&& (m_settings.m_modulation != DATVDemodSettings::QPSK))
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2019-07-16 20:51:46 -04:00
|
|
|
ui->chkViterbi->setChecked(false);
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2019-07-16 20:51:46 -04:00
|
|
|
applySettings();
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2022-04-12 10:20:45 -04:00
|
|
|
void DATVDemodGUI::on_cmbFEC_currentIndexChanged(int arg1)
|
2018-02-24 18:07:08 -05:00
|
|
|
{
|
2018-11-12 18:45:03 -05:00
|
|
|
(void) arg1;
|
2019-07-16 20:51:46 -04:00
|
|
|
QString strFEC = ui->cmbFEC->currentText();
|
|
|
|
m_settings.m_fec = DATVDemodSettings::getCodeRateFromStr(strFEC);
|
|
|
|
applySettings();
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2021-02-27 06:51:32 -05:00
|
|
|
void DATVDemodGUI::on_softLDPC_clicked()
|
|
|
|
{
|
|
|
|
m_settings.m_softLDPC = ui->softLDPC->isChecked();
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::on_maxBitflips_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_settings.m_maxBitflips = value;
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2018-02-22 16:52:49 -05:00
|
|
|
void DATVDemodGUI::on_chkViterbi_clicked()
|
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_viterbi = ui->chkViterbi->isChecked();
|
2018-02-22 16:52:49 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::on_chkHardMetric_clicked()
|
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_hardMetric = ui->chkHardMetric->isChecked();
|
2018-02-22 16:52:49 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-03-23 05:51:01 -04:00
|
|
|
void DATVDemodGUI::on_resetDefaults_clicked()
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
|
|
|
resetToDefaults();
|
|
|
|
}
|
|
|
|
|
2019-07-28 04:54:04 -04:00
|
|
|
void DATVDemodGUI::on_spiSymbolRate_valueChanged(int value)
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_symbolRate = value;
|
2022-10-16 16:59:52 -04:00
|
|
|
ui->datvStdSR->blockSignals(true);
|
|
|
|
ui->datvStdSR->setValue(indexFromSymbolRate(value));
|
|
|
|
ui->datvStdSR->blockSignals(false);
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::on_datvStdSR_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_settings.m_symbolRate = symbolRateFromIndex(value);
|
2023-04-06 12:53:35 -04:00
|
|
|
m_settings.m_rfBandwidth = (m_settings.m_symbolRate * 3) / 2;
|
2022-10-16 16:59:52 -04:00
|
|
|
ui->spiSymbolRate->blockSignals(true);
|
2023-04-06 12:53:35 -04:00
|
|
|
ui->rfBandwidth->blockSignals(true);
|
2022-10-16 16:59:52 -04:00
|
|
|
ui->spiSymbolRate->setValue(m_settings.m_symbolRate);
|
2023-04-06 12:53:35 -04:00
|
|
|
ui->rfBandwidth->setValue(m_settings.m_rfBandwidth);
|
|
|
|
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
|
|
|
|
ui->rfBandwidth->blockSignals(false);
|
2022-10-16 16:59:52 -04:00
|
|
|
ui->spiSymbolRate->blockSignals(false);
|
2018-02-22 16:52:49 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-07-28 04:54:04 -04:00
|
|
|
void DATVDemodGUI::on_spiNotchFilters_valueChanged(int value)
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_notchFilters = value;
|
2018-02-22 16:52:49 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::on_chkAllowDrift_clicked()
|
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_allowDrift = ui->chkAllowDrift->isChecked();
|
|
|
|
applySettings();
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2019-03-23 05:51:01 -04:00
|
|
|
void DATVDemodGUI::on_fullScreen_clicked()
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2021-04-05 07:13:57 -04:00
|
|
|
ui->screenTV_2->setFullScreen(true);
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2018-11-12 18:45:03 -05:00
|
|
|
void DATVDemodGUI::on_mouseEvent(QMouseEvent* obj)
|
2018-02-24 18:07:08 -05:00
|
|
|
{
|
2018-11-12 18:45:03 -05:00
|
|
|
(void) obj;
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
QString DATVDemodGUI::formatBytes(qint64 intBytes)
|
|
|
|
{
|
2019-03-16 20:36:44 -04:00
|
|
|
if(intBytes<1024) {
|
2018-02-22 16:52:49 -05:00
|
|
|
return QString("%1").arg(intBytes);
|
2019-03-16 20:36:44 -04:00
|
|
|
} else if(intBytes<1024*1024) {
|
2018-02-22 16:52:49 -05:00
|
|
|
return QString("%1 K").arg((float)(10*intBytes/1024)/10.0f);
|
2019-03-16 20:36:44 -04:00
|
|
|
} else if(intBytes<1024*1024*1024) {
|
2018-02-22 16:52:49 -05:00
|
|
|
return QString("%1 M").arg((float)(10*intBytes/(1024*1024))/10.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
return QString("%1 G").arg((float)(10*intBytes/(1024*1024*1024))/10.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-04-11 18:31:47 -04:00
|
|
|
void DATVDemodGUI::on_StreamDataAvailable(int intBytes, int intPercent, qint64 intTotalReceived)
|
2018-02-22 16:52:49 -05:00
|
|
|
{
|
2021-04-11 18:31:47 -04:00
|
|
|
ui->lblStatus->setText(QString("Data: %1B").arg(formatBytes(intTotalReceived)));
|
|
|
|
m_intLastDecodedData = intTotalReceived;
|
2018-02-22 16:52:49 -05:00
|
|
|
|
2021-04-11 18:31:47 -04:00
|
|
|
if ((intPercent)<100) {
|
|
|
|
ui->prgSynchro->setValue(intPercent);
|
2019-03-16 20:36:44 -04:00
|
|
|
} else {
|
|
|
|
ui->prgSynchro->setValue(100);
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2021-04-11 18:31:47 -04:00
|
|
|
m_intReadyDecodedData = intBytes;
|
2018-02-22 16:52:49 -05:00
|
|
|
}
|
|
|
|
|
2018-11-12 18:45:03 -05:00
|
|
|
void DATVDemodGUI::on_deltaFrequency_changed(qint64 value)
|
2018-03-10 13:30:55 -05:00
|
|
|
{
|
2022-04-16 10:45:53 -04:00
|
|
|
m_channelMarker.setCenterFrequency(value);
|
|
|
|
m_settings.m_centerFrequency = m_channelMarker.getCenterFrequency();
|
2022-04-13 05:08:21 -04:00
|
|
|
updateAbsoluteCenterFrequency();
|
2018-03-10 13:30:55 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2018-11-12 18:45:03 -05:00
|
|
|
void DATVDemodGUI::on_rfBandwidth_changed(qint64 value)
|
2018-03-10 13:30:55 -05:00
|
|
|
{
|
2022-04-16 10:45:53 -04:00
|
|
|
m_channelMarker.setBandwidth(value);
|
|
|
|
m_settings.m_rfBandwidth = m_channelMarker.getBandwidth();
|
2018-03-10 13:30:55 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
2018-02-22 16:52:49 -05:00
|
|
|
|
|
|
|
void DATVDemodGUI::on_chkFastlock_clicked()
|
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_fastLock = ui->chkFastlock->isChecked();
|
2018-02-22 16:52:49 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
2018-02-25 19:04:45 -05:00
|
|
|
|
2019-03-22 03:05:01 -04:00
|
|
|
void DATVDemodGUI::on_audioMute_toggled(bool checked)
|
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_audioMute = checked;
|
2019-03-22 03:05:01 -04:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-03-23 01:06:42 -04:00
|
|
|
void DATVDemodGUI::on_videoMute_toggled(bool checked)
|
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_videoMute = checked;
|
2019-03-23 01:06:42 -04:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-03-22 03:05:01 -04:00
|
|
|
void DATVDemodGUI::on_audioVolume_valueChanged(int value)
|
|
|
|
{
|
|
|
|
ui->audioVolumeText->setText(tr("%1").arg(value));
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_audioVolume = value;
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::on_udpTS_clicked(bool checked)
|
|
|
|
{
|
|
|
|
m_settings.m_udpTS = checked;
|
2019-03-22 03:05:01 -04:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2018-02-25 19:04:45 -05:00
|
|
|
void DATVDemodGUI::on_StreamMetaDataChanged(DataTSMetaData2 *objMetaData)
|
|
|
|
{
|
|
|
|
|
2021-03-21 22:12:58 -04:00
|
|
|
if (objMetaData)
|
2018-02-25 19:04:45 -05:00
|
|
|
{
|
2020-11-04 02:59:16 -05:00
|
|
|
QString strMetaData = "";
|
|
|
|
|
2019-03-16 20:36:44 -04:00
|
|
|
if (objMetaData->OK_TransportStream == true)
|
2018-02-25 19:04:45 -05:00
|
|
|
{
|
2020-11-04 02:59:16 -05:00
|
|
|
strMetaData = tr("PID: %1 - Width: %2 - Height: %3\r\n%4%5\r\nCodec: %6\r\n")
|
|
|
|
.arg(objMetaData->PID)
|
|
|
|
.arg(objMetaData->Width)
|
|
|
|
.arg(objMetaData->Height)
|
|
|
|
.arg(objMetaData->Program)
|
|
|
|
.arg(objMetaData->Stream)
|
|
|
|
.arg(objMetaData->CodecDescription);
|
2018-02-25 19:04:45 -05:00
|
|
|
}
|
|
|
|
|
2019-07-28 04:54:04 -04:00
|
|
|
ui->streamInfo->setText(strMetaData);
|
2018-02-25 19:04:45 -05:00
|
|
|
ui->chkData->setChecked(objMetaData->OK_Data);
|
|
|
|
ui->chkTS->setChecked(objMetaData->OK_TransportStream);
|
|
|
|
ui->chkVS->setChecked(objMetaData->OK_VideoStream);
|
|
|
|
ui->chkDecoding->setChecked(objMetaData->OK_Decoding);
|
|
|
|
|
2019-03-16 20:36:44 -04:00
|
|
|
if (objMetaData->Height > 0) {
|
2018-02-25 19:04:45 -05:00
|
|
|
ui->screenTV_2->setFixedWidth((int)objMetaData->Width*(270.0f/(float)objMetaData->Height));
|
|
|
|
}
|
2021-03-21 22:12:58 -04:00
|
|
|
|
|
|
|
delete objMetaData;
|
2018-02-25 19:04:45 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 17:52:16 -04:00
|
|
|
void DATVDemodGUI::on_playerEnable_clicked()
|
|
|
|
{
|
|
|
|
m_settings.m_playerEnable = ui->playerEnable->isChecked();
|
|
|
|
|
|
|
|
if (m_settings.m_playerEnable)
|
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
disconnect(m_datvDemod->getUDPStream(), &DATVUDPStream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
|
|
|
connect(m_datvDemod->getVideoStream(), &DATVideostream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
2021-04-11 17:52:16 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-30 06:35:02 -04:00
|
|
|
disconnect(m_datvDemod->getVideoStream(), &DATVideostream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
|
|
|
connect(m_datvDemod->getUDPStream(), &DATVUDPStream::fifoData, this, &DATVDemodGUI::on_StreamDataAvailable);
|
2021-04-11 17:52:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2018-02-25 19:04:45 -05:00
|
|
|
void DATVDemodGUI::displayRRCParameters(bool blnVisible)
|
|
|
|
{
|
|
|
|
ui->spiRollOff->setVisible(blnVisible);
|
|
|
|
ui->spiExcursion->setVisible(blnVisible);
|
2019-03-23 05:51:01 -04:00
|
|
|
ui->rollOffLabel->setVisible(blnVisible);
|
|
|
|
ui->excursionLabel->setVisible(blnVisible);
|
2018-02-25 19:04:45 -05:00
|
|
|
}
|
|
|
|
|
2018-11-12 18:45:03 -05:00
|
|
|
void DATVDemodGUI::on_cmbFilter_currentIndexChanged(int index)
|
2018-02-25 19:04:45 -05:00
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
if (index == 0) {
|
|
|
|
m_settings.m_filter = DATVDemodSettings::SAMP_LINEAR;
|
|
|
|
} else if (index == 1) {
|
|
|
|
m_settings.m_filter = DATVDemodSettings::SAMP_NEAREST;
|
|
|
|
} else {
|
|
|
|
m_settings.m_filter = DATVDemodSettings::SAMP_RRC;
|
|
|
|
}
|
|
|
|
|
|
|
|
displayRRCParameters(index == 2);
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DATVDemodGUI::on_spiRollOff_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_settings.m_rollOff = ((float) value) / 100.0f;
|
2018-02-25 19:04:45 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-07-28 04:54:04 -04:00
|
|
|
void DATVDemodGUI::on_spiExcursion_valueChanged(int value)
|
2018-02-25 19:04:45 -05:00
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_excursion = value;
|
2018-02-25 19:04:45 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2019-07-28 04:54:04 -04:00
|
|
|
void DATVDemodGUI::on_udpTSAddress_editingFinished()
|
2018-02-25 19:04:45 -05:00
|
|
|
{
|
2019-07-28 04:54:04 -04:00
|
|
|
m_settings.m_udpTSAddress = ui->udpTSAddress->text();
|
2018-02-25 19:04:45 -05:00
|
|
|
applySettings();
|
|
|
|
}
|
2019-07-28 04:54:04 -04:00
|
|
|
|
|
|
|
void DATVDemodGUI::on_udpTSPort_editingFinished()
|
|
|
|
{
|
|
|
|
bool ok;
|
|
|
|
quint16 udpPort = ui->udpTSPort->text().toInt(&ok);
|
|
|
|
|
|
|
|
if((!ok) || (udpPort < 1024)) {
|
|
|
|
udpPort = 8882;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_settings.m_udpTSPort = udpPort;
|
|
|
|
ui->udpTSPort->setText(tr("%1").arg(udpPort));
|
|
|
|
applySettings();
|
2020-09-21 13:45:14 -04:00
|
|
|
}
|
2022-04-12 10:20:45 -04:00
|
|
|
|
|
|
|
void DATVDemodGUI::makeUIConnections()
|
|
|
|
{
|
|
|
|
QObject::connect(ui->cmbStandard, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DATVDemodGUI::on_cmbStandard_currentIndexChanged);
|
|
|
|
QObject::connect(ui->cmbModulation, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DATVDemodGUI::on_cmbModulation_currentIndexChanged);
|
|
|
|
QObject::connect(ui->cmbFEC, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DATVDemodGUI::on_cmbFEC_currentIndexChanged);
|
|
|
|
QObject::connect(ui->softLDPC, &QCheckBox::clicked, this, &DATVDemodGUI::on_softLDPC_clicked);
|
|
|
|
QObject::connect(ui->maxBitflips, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_maxBitflips_valueChanged);
|
|
|
|
QObject::connect(ui->chkViterbi, &QCheckBox::clicked, this, &DATVDemodGUI::on_chkViterbi_clicked);
|
|
|
|
QObject::connect(ui->chkHardMetric, &QCheckBox::clicked, this, &DATVDemodGUI::on_chkHardMetric_clicked);
|
|
|
|
QObject::connect(ui->resetDefaults, &QPushButton::clicked, this, &DATVDemodGUI::on_resetDefaults_clicked);
|
|
|
|
QObject::connect(ui->spiSymbolRate, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_spiSymbolRate_valueChanged);
|
2022-10-16 16:59:52 -04:00
|
|
|
QObject::connect(ui->datvStdSR, &QDial::valueChanged, this, &DATVDemodGUI::on_datvStdSR_valueChanged);
|
2022-04-12 10:20:45 -04:00
|
|
|
QObject::connect(ui->spiNotchFilters, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_spiNotchFilters_valueChanged);
|
|
|
|
QObject::connect(ui->chkAllowDrift, &QCheckBox::clicked, this, &DATVDemodGUI::on_chkAllowDrift_clicked);
|
|
|
|
QObject::connect(ui->fullScreen, &QPushButton::clicked, this, &DATVDemodGUI::on_fullScreen_clicked);
|
|
|
|
QObject::connect(ui->chkFastlock, &QCheckBox::clicked, this, &DATVDemodGUI::on_chkFastlock_clicked);
|
|
|
|
QObject::connect(ui->cmbFilter, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DATVDemodGUI::on_cmbFilter_currentIndexChanged);
|
|
|
|
QObject::connect(ui->spiRollOff, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_spiRollOff_valueChanged);
|
|
|
|
QObject::connect(ui->spiExcursion, QOverload<int>::of(&QSpinBox::valueChanged), this, &DATVDemodGUI::on_spiExcursion_valueChanged);
|
|
|
|
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &DATVDemodGUI::on_deltaFrequency_changed);
|
|
|
|
QObject::connect(ui->rfBandwidth, &ValueDialZ::changed, this, &DATVDemodGUI::on_rfBandwidth_changed);
|
|
|
|
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &DATVDemodGUI::on_audioMute_toggled);
|
|
|
|
QObject::connect(ui->audioVolume, &QSlider::valueChanged, this, &DATVDemodGUI::on_audioVolume_valueChanged);
|
|
|
|
QObject::connect(ui->videoMute, &QToolButton::toggled, this, &DATVDemodGUI::on_videoMute_toggled);
|
|
|
|
QObject::connect(ui->udpTS, &ButtonSwitch::clicked, this, &DATVDemodGUI::on_udpTS_clicked);
|
|
|
|
QObject::connect(ui->udpTSAddress, &QLineEdit::editingFinished, this, &DATVDemodGUI::on_udpTSAddress_editingFinished);
|
|
|
|
QObject::connect(ui->udpTSPort, &QLineEdit::editingFinished, this, &DATVDemodGUI::on_udpTSPort_editingFinished);
|
|
|
|
QObject::connect(ui->playerEnable, &QCheckBox::clicked, this, &DATVDemodGUI::on_playerEnable_clicked);
|
|
|
|
}
|
2022-04-13 05:08:21 -04:00
|
|
|
|
|
|
|
void DATVDemodGUI::updateAbsoluteCenterFrequency()
|
|
|
|
{
|
|
|
|
setStatusFrequency(m_deviceCenterFrequency + m_settings.m_centerFrequency);
|
|
|
|
}
|
2022-10-16 16:59:52 -04:00
|
|
|
|
|
|
|
int DATVDemodGUI::indexFromSymbolRate(int sampleRate)
|
|
|
|
{
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
if (sampleRate < m_symbolRates[1]) {
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (auto definedRate : m_symbolRates)
|
|
|
|
{
|
|
|
|
if (sampleRate <= definedRate) {
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
|
|
|
|
index++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
|
|
|
|
int DATVDemodGUI::symbolRateFromIndex(int index)
|
|
|
|
{
|
|
|
|
return m_symbolRates.at(index);
|
|
|
|
}
|