2016-04-08 16:14:50 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2016-04-22 01:53:16 +00:00
|
|
|
// Copyright (C) 2016 F4EXB //
|
2016-04-08 16:14:50 +00:00
|
|
|
// written by Edouard Griffiths //
|
|
|
|
// //
|
|
|
|
// 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 //
|
|
|
|
// //
|
|
|
|
// 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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-05-07 08:23:37 +00:00
|
|
|
#include "dsddemodgui.h"
|
2016-10-02 11:18:07 +00:00
|
|
|
|
2016-10-10 23:17:55 +00:00
|
|
|
#include <device/devicesourceapi.h>
|
2017-10-31 07:24:05 +00:00
|
|
|
#include "device/deviceuiset.h"
|
2016-10-02 19:52:39 +00:00
|
|
|
#include <dsp/downchannelizer.h>
|
2016-10-03 13:55:16 +00:00
|
|
|
|
2017-05-07 08:23:37 +00:00
|
|
|
#include "dsp/threadedbasebandsamplesink.h"
|
2016-04-07 11:05:53 +00:00
|
|
|
#include "ui_dsddemodgui.h"
|
|
|
|
#include "dsp/scopevis.h"
|
2018-03-12 04:07:51 +00:00
|
|
|
#include "dsp/scopevisxy.h"
|
2016-04-07 17:54:26 +00:00
|
|
|
#include "gui/glscope.h"
|
2016-04-07 11:05:53 +00:00
|
|
|
#include "plugin/pluginapi.h"
|
|
|
|
#include "util/simpleserializer.h"
|
|
|
|
#include "util/db.h"
|
2017-08-24 00:05:48 +00:00
|
|
|
#include "gui/basicchannelsettingsdialog.h"
|
2018-03-28 06:00:27 +00:00
|
|
|
#include "gui/crightclickenabler.h"
|
|
|
|
#include "gui/audioselectdialog.h"
|
2016-04-07 11:05:53 +00:00
|
|
|
#include "dsp/dspengine.h"
|
|
|
|
#include "mainwindow.h"
|
|
|
|
|
2017-10-02 11:56:40 +00:00
|
|
|
#include "dsddemodbaudrates.h"
|
2017-05-07 08:23:37 +00:00
|
|
|
#include "dsddemod.h"
|
2016-04-07 17:54:26 +00:00
|
|
|
|
2018-03-12 04:07:51 +00:00
|
|
|
#include <QDockWidget>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
#include <complex>
|
|
|
|
|
2017-11-09 00:03:05 +00:00
|
|
|
DSDDemodGUI* DSDDemodGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
2017-11-09 00:03:05 +00:00
|
|
|
DSDDemodGUI* gui = new DSDDemodGUI(pluginAPI, deviceUISet, rxChannel);
|
2016-04-07 11:05:53 +00:00
|
|
|
return gui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::destroy()
|
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::setName(const QString& name)
|
|
|
|
{
|
|
|
|
setObjectName(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
QString DSDDemodGUI::getName() const
|
|
|
|
{
|
|
|
|
return objectName();
|
|
|
|
}
|
|
|
|
|
|
|
|
qint64 DSDDemodGUI::getCenterFrequency() const
|
|
|
|
{
|
|
|
|
return m_channelMarker.getCenterFrequency();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::setCenterFrequency(qint64 centerFrequency)
|
|
|
|
{
|
|
|
|
m_channelMarker.setCenterFrequency(centerFrequency);
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::resetToDefaults()
|
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.resetToDefaults();
|
2016-04-07 11:05:53 +00:00
|
|
|
blockApplySettings(true);
|
2017-10-03 21:42:56 +00:00
|
|
|
displaySettings();
|
2016-04-07 11:05:53 +00:00
|
|
|
blockApplySettings(false);
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray DSDDemodGUI::serialize() const
|
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
return m_settings.serialize();
|
2016-04-07 11:05:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool DSDDemodGUI::deserialize(const QByteArray& data)
|
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
if (m_settings.deserialize(data))
|
|
|
|
{
|
|
|
|
displaySettings();
|
|
|
|
applySettings(true);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
resetToDefaults();
|
|
|
|
return false;
|
|
|
|
}
|
2016-04-07 11:05:53 +00:00
|
|
|
}
|
|
|
|
|
2017-05-25 18:13:34 +00:00
|
|
|
bool DSDDemodGUI::handleMessage(const Message& message __attribute__((unused)))
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-05-17 21:22:17 +00:00
|
|
|
void DSDDemodGUI::on_deltaFrequency_changed(qint64 value)
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
2017-05-17 21:34:14 +00:00
|
|
|
m_channelMarker.setCenterFrequency(value);
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
|
|
|
applySettings();
|
2016-04-07 11:05:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::on_rfBW_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_channelMarker.setBandwidth(value * 100);
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_rfBandwidth = value * 100.0;
|
|
|
|
ui->rfBWText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1));
|
2016-04-07 11:05:53 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2017-10-03 21:42:56 +00:00
|
|
|
void DSDDemodGUI::on_demodGain_valueChanged(int value)
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_demodGain = value / 100.0;
|
|
|
|
ui->demodGainText->setText(QString("%1").arg(value / 100.0, 0, 'f', 2));
|
2016-04-07 11:05:53 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2017-10-03 21:42:56 +00:00
|
|
|
void DSDDemodGUI::on_fmDeviation_valueChanged(int value)
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_fmDeviation = value * 100.0;
|
2018-04-01 07:33:08 +00:00
|
|
|
ui->fmDeviationText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1));
|
2016-04-07 11:05:53 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2017-10-03 21:42:56 +00:00
|
|
|
void DSDDemodGUI::on_volume_valueChanged(int value)
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_volume= value / 10.0;
|
|
|
|
ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
|
2016-04-07 11:05:53 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2017-10-03 21:42:56 +00:00
|
|
|
void DSDDemodGUI::on_baudRate_currentIndexChanged(int index)
|
2016-08-06 09:03:05 +00:00
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_baudRate = DSDDemodBaudRates::getRate(index);
|
2016-08-06 09:03:05 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
2016-04-07 11:05:53 +00:00
|
|
|
|
2016-08-18 17:38:39 +00:00
|
|
|
void DSDDemodGUI::on_enableCosineFiltering_toggled(bool enable)
|
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_enableCosineFiltering = enable;
|
2016-08-18 17:38:39 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2016-08-24 23:06:42 +00:00
|
|
|
void DSDDemodGUI::on_syncOrConstellation_toggled(bool checked)
|
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_syncOrConstellation = checked;
|
2016-08-24 23:06:42 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2018-03-12 19:39:16 +00:00
|
|
|
void DSDDemodGUI::on_traceLength_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_settings.m_traceLengthMutliplier = value;
|
|
|
|
ui->traceLengthText->setText(QString("%1").arg(m_settings.m_traceLengthMutliplier*50));
|
|
|
|
m_scopeVisXY->setPixelsPerFrame(m_settings.m_traceLengthMutliplier*960); // 48000 / 50. Chunks of 50 ms.
|
|
|
|
}
|
|
|
|
|
2018-03-13 00:39:43 +00:00
|
|
|
void DSDDemodGUI::on_traceStroke_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_settings.m_traceStroke = value;
|
|
|
|
ui->traceStrokeText->setText(QString("%1").arg(m_settings.m_traceStroke));
|
|
|
|
m_scopeVisXY->setStroke(m_settings.m_traceStroke);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::on_traceDecay_valueChanged(int value)
|
|
|
|
{
|
|
|
|
m_settings.m_traceDecay = value;
|
|
|
|
ui->traceDecayText->setText(QString("%1").arg(m_settings.m_traceDecay));
|
|
|
|
m_scopeVisXY->setDecay(m_settings.m_traceDecay);
|
|
|
|
}
|
|
|
|
|
2016-08-30 23:18:32 +00:00
|
|
|
void DSDDemodGUI::on_slot1On_toggled(bool checked)
|
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_slot1On = checked;
|
2016-08-30 23:18:32 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::on_slot2On_toggled(bool checked)
|
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_slot2On = checked;
|
2016-08-30 23:18:32 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2016-09-06 22:16:08 +00:00
|
|
|
void DSDDemodGUI::on_tdmaStereoSplit_toggled(bool checked)
|
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_tdmaStereo = checked;
|
2016-09-06 22:16:08 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2017-10-03 21:42:56 +00:00
|
|
|
void DSDDemodGUI::on_squelchGate_valueChanged(int value)
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_squelchGate = value;
|
|
|
|
ui->squelchGateText->setText(QString("%1").arg(value * 10.0, 0, 'f', 0));
|
2016-04-07 11:05:53 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::on_squelch_valueChanged(int value)
|
|
|
|
{
|
|
|
|
ui->squelchText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_squelch = value / 10.0;
|
2016-04-07 11:05:53 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::on_audioMute_toggled(bool checked)
|
|
|
|
{
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_audioMute = checked;
|
2016-04-07 11:05:53 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2017-12-26 19:29:23 +00:00
|
|
|
void DSDDemodGUI::on_highPassFilter_toggled(bool checked)
|
|
|
|
{
|
|
|
|
m_settings.m_highPassFilter = checked;
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2017-05-07 08:23:37 +00:00
|
|
|
void DSDDemodGUI::on_symbolPLLLock_toggled(bool checked)
|
|
|
|
{
|
|
|
|
if (checked) {
|
|
|
|
ui->symbolPLLLock->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
|
|
|
} else {
|
|
|
|
ui->symbolPLLLock->setStyleSheet("QToolButton { background:rgb(53,53,53); }");
|
|
|
|
}
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.m_pllLock = checked;
|
2017-05-07 08:23:37 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2017-05-25 18:13:34 +00:00
|
|
|
void DSDDemodGUI::onWidgetRolled(QWidget* widget __attribute__((unused)), bool rollDown __attribute__((unused)))
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
if((widget == ui->spectrumContainer) && (DSDDemodGUI != NULL))
|
|
|
|
m_dsdDemod->setSpectrum(m_threadedSampleSink->getMessageQueue(), rollDown);
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2017-08-24 00:05:48 +00:00
|
|
|
void DSDDemodGUI::onMenuDialogCalled(const QPoint &p)
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
2017-08-24 00:05:48 +00:00
|
|
|
//qDebug("DSDDemodGUI::onMenuDialogCalled: x: %d y: %d", p.x(), p.y());
|
|
|
|
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
|
|
|
dialog.move(p);
|
|
|
|
dialog.exec();
|
2017-11-14 00:34:51 +00:00
|
|
|
|
|
|
|
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
|
|
|
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
|
2017-11-19 10:36:20 +00:00
|
|
|
m_settings.m_title = m_channelMarker.getTitle();
|
2017-11-14 00:34:51 +00:00
|
|
|
|
2017-11-19 10:36:20 +00:00
|
|
|
setWindowTitle(m_settings.m_title);
|
2017-11-14 00:34:51 +00:00
|
|
|
setTitleColor(m_settings.m_rgbColor);
|
|
|
|
|
|
|
|
applySettings();
|
2016-04-07 11:05:53 +00:00
|
|
|
}
|
|
|
|
|
2018-04-01 20:14:11 +00:00
|
|
|
void DSDDemodGUI::on_viewStatusLog_clicked()
|
|
|
|
{
|
|
|
|
qDebug("DSDDemodGUI::on_viewStatusLog_clicked");
|
|
|
|
m_dsdStatusTextDialog.exec();
|
|
|
|
}
|
|
|
|
|
2017-11-09 00:03:05 +00:00
|
|
|
DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
|
2016-04-07 11:05:53 +00:00
|
|
|
RollupWidget(parent),
|
|
|
|
ui(new Ui::DSDDemodGUI),
|
|
|
|
m_pluginAPI(pluginAPI),
|
2017-10-31 07:24:05 +00:00
|
|
|
m_deviceUISet(deviceUISet),
|
2016-04-07 11:05:53 +00:00
|
|
|
m_channelMarker(this),
|
|
|
|
m_doApplySettings(true),
|
2016-04-23 04:27:28 +00:00
|
|
|
m_signalFormat(signalFormatNone),
|
2016-08-18 17:38:39 +00:00
|
|
|
m_enableCosineFiltering(false),
|
2016-08-24 23:06:42 +00:00
|
|
|
m_syncOrConstellation(false),
|
2016-08-30 23:18:32 +00:00
|
|
|
m_slot1On(false),
|
|
|
|
m_slot2On(false),
|
2016-09-06 22:16:08 +00:00
|
|
|
m_tdmaStereo(false),
|
2016-04-07 11:05:53 +00:00
|
|
|
m_squelchOpen(false),
|
2018-04-01 20:14:11 +00:00
|
|
|
m_tickCount(0),
|
|
|
|
m_dsdStatusTextDialog(0)
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2018-03-12 04:07:51 +00:00
|
|
|
ui->screenTV->setColor(true);
|
|
|
|
ui->screenTV->resizeTVScreen(200,200);
|
2016-04-07 11:05:53 +00:00
|
|
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
|
|
|
|
|
|
|
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
2017-08-24 00:05:48 +00:00
|
|
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
2016-04-07 11:05:53 +00:00
|
|
|
|
2018-03-28 06:00:27 +00:00
|
|
|
CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute);
|
|
|
|
connect(audioMuteRightClickEnabler, SIGNAL(rightClick()), this, SLOT(audioSelect()));
|
|
|
|
|
2018-03-12 04:07:51 +00:00
|
|
|
m_scopeVisXY = new ScopeVisXY(ui->screenTV);
|
|
|
|
m_scopeVisXY->setScale(2.0);
|
|
|
|
m_scopeVisXY->setPixelsPerFrame(4001);
|
|
|
|
m_scopeVisXY->setPlotRGB(qRgb(0, 220, 250));
|
|
|
|
m_scopeVisXY->setGridRGB(qRgb(255, 255, 128));
|
|
|
|
|
|
|
|
for (float x = -0.84; x < 1.0; x += 0.56)
|
|
|
|
{
|
|
|
|
for (float y = -0.84; y < 1.0; y += 0.56)
|
|
|
|
{
|
|
|
|
m_scopeVisXY->addGraticulePoint(std::complex<float>(x, y));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-14 23:16:50 +00:00
|
|
|
m_scopeVisXY->calculateGraticule(200,200);
|
|
|
|
|
2017-11-09 00:03:05 +00:00
|
|
|
m_dsdDemod = (DSDDemod*) rxChannel; //new DSDDemod(m_deviceUISet->m_deviceSourceAPI);
|
2018-03-12 04:07:51 +00:00
|
|
|
m_dsdDemod->setScopeXYSink(m_scopeVisXY);
|
2017-10-02 11:56:40 +00:00
|
|
|
m_dsdDemod->setMessageQueueToGUI(getInputMessageQueue());
|
2016-04-07 11:05:53 +00:00
|
|
|
|
2017-10-24 11:45:10 +00:00
|
|
|
connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
|
2016-04-07 11:05:53 +00:00
|
|
|
|
2017-01-16 23:49:52 +00:00
|
|
|
ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
|
|
|
|
2017-05-17 21:22:17 +00:00
|
|
|
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
|
2017-05-16 15:48:12 +00:00
|
|
|
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
2017-05-17 21:22:17 +00:00
|
|
|
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
|
2016-12-06 18:06:38 +00:00
|
|
|
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
|
2016-04-07 11:05:53 +00:00
|
|
|
|
2017-11-14 00:34:51 +00:00
|
|
|
m_channelMarker.blockSignals(true);
|
2016-04-07 11:05:53 +00:00
|
|
|
m_channelMarker.setColor(Qt::cyan);
|
|
|
|
m_channelMarker.setBandwidth(10000);
|
|
|
|
m_channelMarker.setCenterFrequency(0);
|
2017-11-14 00:34:51 +00:00
|
|
|
m_channelMarker.setTitle("DSD Demodulator");
|
|
|
|
m_channelMarker.blockSignals(false);
|
|
|
|
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
2016-04-07 11:05:53 +00:00
|
|
|
|
2017-11-23 00:19:32 +00:00
|
|
|
m_deviceUISet->registerRxChannelInstance(DSDDemod::m_channelIdURI, this);
|
2017-10-31 07:24:05 +00:00
|
|
|
m_deviceUISet->addChannelMarker(&m_channelMarker);
|
|
|
|
m_deviceUISet->addRollupWidget(this);
|
2016-04-07 11:05:53 +00:00
|
|
|
|
2017-11-14 00:34:51 +00:00
|
|
|
connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
|
2017-11-14 21:58:35 +00:00
|
|
|
connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
|
2017-11-14 00:34:51 +00:00
|
|
|
|
2017-10-03 21:42:56 +00:00
|
|
|
m_settings.setChannelMarker(&m_channelMarker);
|
|
|
|
|
2016-09-28 15:58:29 +00:00
|
|
|
updateMyPosition();
|
2017-10-03 21:42:56 +00:00
|
|
|
displaySettings();
|
2017-08-24 06:46:14 +00:00
|
|
|
applySettings(true);
|
2016-04-07 11:05:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DSDDemodGUI::~DSDDemodGUI()
|
|
|
|
{
|
2017-10-31 21:37:57 +00:00
|
|
|
m_deviceUISet->removeRxChannelInstance(this);
|
2017-11-09 00:03:05 +00:00
|
|
|
delete m_dsdDemod; // TODO: check this: when the GUI closes it has to delete the demodulator
|
2018-03-12 04:07:51 +00:00
|
|
|
delete m_scopeVisXY;
|
2016-04-07 11:05:53 +00:00
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2016-09-28 15:58:29 +00:00
|
|
|
void DSDDemodGUI::updateMyPosition()
|
|
|
|
{
|
2017-10-24 11:45:10 +00:00
|
|
|
float latitude = MainWindow::getInstance()->getMainSettings().getLatitude();
|
|
|
|
float longitude = MainWindow::getInstance()->getMainSettings().getLongitude();
|
2016-09-28 15:58:29 +00:00
|
|
|
|
|
|
|
if ((m_myLatitude != latitude) || (m_myLongitude != longitude))
|
|
|
|
{
|
|
|
|
m_dsdDemod->configureMyPosition(m_dsdDemod->getInputMessageQueue(), latitude, longitude);
|
|
|
|
m_myLatitude = latitude;
|
|
|
|
m_myLongitude = longitude;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-03 21:42:56 +00:00
|
|
|
void DSDDemodGUI::displaySettings()
|
|
|
|
{
|
|
|
|
m_channelMarker.blockSignals(true);
|
|
|
|
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
|
|
|
|
m_channelMarker.setColor(m_settings.m_rgbColor);
|
2017-11-19 10:36:20 +00:00
|
|
|
m_channelMarker.setTitle(m_settings.m_title);
|
2017-10-03 21:42:56 +00:00
|
|
|
m_channelMarker.blockSignals(false);
|
2017-11-14 00:34:51 +00:00
|
|
|
setTitleColor(m_settings.m_rgbColor); // activate signal on the last setting only
|
2017-10-03 21:42:56 +00:00
|
|
|
|
2017-11-14 00:34:51 +00:00
|
|
|
setTitleColor(m_settings.m_rgbColor);
|
2017-10-11 23:21:30 +00:00
|
|
|
setWindowTitle(m_channelMarker.getTitle());
|
|
|
|
|
|
|
|
blockApplySettings(true);
|
|
|
|
|
2017-10-03 21:42:56 +00:00
|
|
|
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
|
|
|
|
|
|
|
|
ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0);
|
|
|
|
ui->rfBWText->setText(QString("%1k").arg(ui->rfBW->value() / 10.0, 0, 'f', 1));
|
|
|
|
|
|
|
|
ui->fmDeviation->setValue(m_settings.m_fmDeviation / 100.0);
|
2018-04-01 07:33:08 +00:00
|
|
|
ui->fmDeviationText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(ui->fmDeviation->value() / 10.0, 0, 'f', 1));
|
2017-10-03 21:42:56 +00:00
|
|
|
|
|
|
|
ui->squelch->setValue(m_settings.m_squelch * 10.0);
|
|
|
|
ui->squelchText->setText(QString("%1").arg(ui->squelch->value() / 10.0, 0, 'f', 1));
|
|
|
|
|
|
|
|
ui->squelchGate->setValue(m_settings.m_squelchGate);
|
|
|
|
ui->squelchGateText->setText(QString("%1").arg(ui->squelchGate->value() * 10.0, 0, 'f', 0));
|
|
|
|
|
|
|
|
ui->demodGain->setValue(m_settings.m_demodGain * 100.0);
|
|
|
|
ui->demodGainText->setText(QString("%1").arg(ui->demodGain->value() / 100.0, 0, 'f', 2));
|
|
|
|
|
|
|
|
ui->volume->setValue(m_settings.m_volume * 10.0);
|
|
|
|
ui->volumeText->setText(QString("%1").arg(ui->volume->value() / 10.0, 0, 'f', 1));
|
|
|
|
|
|
|
|
ui->enableCosineFiltering->setChecked(m_settings.m_enableCosineFiltering);
|
|
|
|
ui->syncOrConstellation->setChecked(m_settings.m_syncOrConstellation);
|
|
|
|
ui->slot1On->setChecked(m_settings.m_slot1On);
|
|
|
|
ui->slot2On->setChecked(m_settings.m_slot2On);
|
|
|
|
ui->tdmaStereoSplit->setChecked(m_settings.m_tdmaStereo);
|
|
|
|
ui->audioMute->setChecked(m_settings.m_audioMute);
|
|
|
|
ui->symbolPLLLock->setChecked(m_settings.m_pllLock);
|
|
|
|
|
|
|
|
ui->baudRate->setCurrentIndex(DSDDemodBaudRates::getRateIndex(m_settings.m_baudRate));
|
2018-03-13 00:39:43 +00:00
|
|
|
|
2018-03-12 19:39:16 +00:00
|
|
|
ui->traceLength->setValue(m_settings.m_traceLengthMutliplier);
|
|
|
|
ui->traceLengthText->setText(QString("%1").arg(m_settings.m_traceLengthMutliplier*50));
|
|
|
|
m_scopeVisXY->setPixelsPerFrame(m_settings.m_traceLengthMutliplier*960); // 48000 / 50. Chunks of 50 ms.
|
2017-10-03 21:42:56 +00:00
|
|
|
|
2018-03-13 00:39:43 +00:00
|
|
|
ui->traceStroke->setValue(m_settings.m_traceStroke);
|
|
|
|
ui->traceStrokeText->setText(QString("%1").arg(m_settings.m_traceStroke));
|
|
|
|
m_scopeVisXY->setStroke(m_settings.m_traceStroke);
|
|
|
|
|
|
|
|
ui->traceDecay->setValue(m_settings.m_traceDecay);
|
|
|
|
ui->traceDecayText->setText(QString("%1").arg(m_settings.m_traceDecay));
|
|
|
|
m_scopeVisXY->setDecay(m_settings.m_traceDecay);
|
|
|
|
|
2017-10-03 21:42:56 +00:00
|
|
|
blockApplySettings(false);
|
|
|
|
}
|
|
|
|
|
2017-08-24 06:46:14 +00:00
|
|
|
void DSDDemodGUI::applySettings(bool force)
|
2016-04-07 11:05:53 +00:00
|
|
|
{
|
|
|
|
if (m_doApplySettings)
|
|
|
|
{
|
|
|
|
qDebug() << "DSDDemodGUI::applySettings";
|
|
|
|
|
2017-10-02 11:56:40 +00:00
|
|
|
DSDDemod::MsgConfigureChannelizer* channelConfigMsg = DSDDemod::MsgConfigureChannelizer::create(
|
|
|
|
48000, m_channelMarker.getCenterFrequency());
|
|
|
|
m_dsdDemod->getInputMessageQueue()->push(channelConfigMsg);
|
2016-04-07 11:05:53 +00:00
|
|
|
|
2017-10-03 22:02:59 +00:00
|
|
|
DSDDemod::MsgConfigureDSDDemod* message = DSDDemod::MsgConfigureDSDDemod::create( m_settings, force);
|
|
|
|
m_dsdDemod->getInputMessageQueue()->push(message);
|
2016-04-07 11:05:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::leaveEvent(QEvent*)
|
|
|
|
{
|
|
|
|
m_channelMarker.setHighlighted(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::enterEvent(QEvent*)
|
|
|
|
{
|
|
|
|
m_channelMarker.setHighlighted(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DSDDemodGUI::blockApplySettings(bool block)
|
|
|
|
{
|
|
|
|
m_doApplySettings = !block;
|
|
|
|
}
|
|
|
|
|
2016-04-23 04:27:28 +00:00
|
|
|
void DSDDemodGUI::formatStatusText()
|
|
|
|
{
|
|
|
|
switch (m_dsdDemod->getDecoder().getSyncType())
|
|
|
|
{
|
2016-09-09 00:19:50 +00:00
|
|
|
case DSDcc::DSDDecoder::DSDSyncDMRDataMS:
|
2016-04-23 04:27:28 +00:00
|
|
|
case DSDcc::DSDDecoder::DSDSyncDMRDataP:
|
2016-09-09 00:19:50 +00:00
|
|
|
case DSDcc::DSDDecoder::DSDSyncDMRVoiceMS:
|
2016-04-23 04:27:28 +00:00
|
|
|
case DSDcc::DSDDecoder::DSDSyncDMRVoiceP:
|
|
|
|
if (m_signalFormat != signalFormatDMR)
|
|
|
|
{
|
2016-09-06 21:35:41 +00:00
|
|
|
strcpy(m_formatStatusText, "Sta: __ S1: __________________________ S2: __________________________");
|
2016-04-23 04:27:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (m_dsdDemod->getDecoder().getStationType())
|
|
|
|
{
|
|
|
|
case DSDcc::DSDDecoder::DSDBaseStation:
|
2016-08-28 21:53:39 +00:00
|
|
|
memcpy(&m_formatStatusText[5], "BS ", 3);
|
2016-04-23 04:27:28 +00:00
|
|
|
break;
|
|
|
|
case DSDcc::DSDDecoder::DSDMobileStation:
|
2016-08-28 21:53:39 +00:00
|
|
|
memcpy(&m_formatStatusText[5], "MS ", 3);
|
2016-04-23 04:27:28 +00:00
|
|
|
break;
|
|
|
|
default:
|
2016-08-28 21:53:39 +00:00
|
|
|
memcpy(&m_formatStatusText[5], "NA ", 3);
|
2016-04-23 04:27:28 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-01-13 01:16:28 +00:00
|
|
|
memcpy(&m_formatStatusText[12], m_dsdDemod->getDecoder().getDMRDecoder().getSlot0Text(), 26);
|
|
|
|
memcpy(&m_formatStatusText[43], m_dsdDemod->getDecoder().getDMRDecoder().getSlot1Text(), 26);
|
2016-04-23 04:27:28 +00:00
|
|
|
m_signalFormat = signalFormatDMR;
|
|
|
|
break;
|
|
|
|
case DSDcc::DSDDecoder::DSDSyncDStarHeaderN:
|
|
|
|
case DSDcc::DSDDecoder::DSDSyncDStarHeaderP:
|
|
|
|
case DSDcc::DSDDecoder::DSDSyncDStarN:
|
|
|
|
case DSDcc::DSDDecoder::DSDSyncDStarP:
|
|
|
|
if (m_signalFormat != signalFormatDStar)
|
|
|
|
{
|
2016-09-27 15:57:06 +00:00
|
|
|
// 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8
|
2016-09-27 17:56:42 +00:00
|
|
|
// 0....5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0..
|
2016-09-28 00:05:39 +00:00
|
|
|
strcpy(m_formatStatusText, "________/____>________|________>________|____________________|______:___/_____._");
|
2016-09-27 17:56:42 +00:00
|
|
|
// MY UR RPT1 RPT2 Info Loc Target
|
2016-04-23 04:27:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const std::string& rpt1 = m_dsdDemod->getDecoder().getDStarDecoder().getRpt1();
|
|
|
|
const std::string& rpt2 = m_dsdDemod->getDecoder().getDStarDecoder().getRpt2();
|
|
|
|
const std::string& mySign = m_dsdDemod->getDecoder().getDStarDecoder().getMySign();
|
|
|
|
const std::string& yrSign = m_dsdDemod->getDecoder().getDStarDecoder().getYourSign();
|
|
|
|
|
|
|
|
if (rpt1.length() > 0) { // 0 or 8
|
2016-09-27 15:57:06 +00:00
|
|
|
memcpy(&m_formatStatusText[23], rpt1.c_str(), 8);
|
2016-04-23 04:27:28 +00:00
|
|
|
}
|
|
|
|
if (rpt2.length() > 0) { // 0 or 8
|
2016-09-27 15:57:06 +00:00
|
|
|
memcpy(&m_formatStatusText[32], rpt2.c_str(), 8);
|
2016-04-23 04:27:28 +00:00
|
|
|
}
|
|
|
|
if (yrSign.length() > 0) { // 0 or 8
|
2016-09-27 15:57:06 +00:00
|
|
|
memcpy(&m_formatStatusText[14], yrSign.c_str(), 8);
|
2016-04-23 04:27:28 +00:00
|
|
|
}
|
|
|
|
if (mySign.length() > 0) { // 0 or 13
|
2016-09-27 15:57:06 +00:00
|
|
|
memcpy(&m_formatStatusText[0], mySign.c_str(), 13);
|
2016-04-23 04:27:28 +00:00
|
|
|
}
|
2016-09-27 15:57:06 +00:00
|
|
|
memcpy(&m_formatStatusText[41], m_dsdDemod->getDecoder().getDStarDecoder().getInfoText(), 20);
|
2016-09-28 00:05:39 +00:00
|
|
|
memcpy(&m_formatStatusText[62], m_dsdDemod->getDecoder().getDStarDecoder().getLocator(), 6);
|
2017-05-06 10:24:57 +00:00
|
|
|
snprintf(&m_formatStatusText[69], 82-69, "%03d/%07.1f",
|
2016-09-28 11:39:17 +00:00
|
|
|
m_dsdDemod->getDecoder().getDStarDecoder().getBearing(),
|
|
|
|
m_dsdDemod->getDecoder().getDStarDecoder().getDistance());
|
2016-04-23 04:27:28 +00:00
|
|
|
}
|
|
|
|
|
2016-09-27 17:56:42 +00:00
|
|
|
m_formatStatusText[82] = '\0';
|
2016-04-23 04:27:28 +00:00
|
|
|
m_signalFormat = signalFormatDStar;
|
|
|
|
break;
|
2016-08-07 23:04:56 +00:00
|
|
|
case DSDcc::DSDDecoder::DSDSyncDPMR:
|
2017-05-06 10:24:57 +00:00
|
|
|
snprintf(m_formatStatusText, 82, "%s CC: %04d OI: %08d CI: %08d",
|
2017-01-13 01:16:28 +00:00
|
|
|
DSDcc::DSDdPMR::dpmrFrameTypes[(int) m_dsdDemod->getDecoder().getDPMRDecoder().getFrameType()],
|
2016-08-15 08:36:32 +00:00
|
|
|
m_dsdDemod->getDecoder().getDPMRDecoder().getColorCode(),
|
|
|
|
m_dsdDemod->getDecoder().getDPMRDecoder().getOwnId(),
|
|
|
|
m_dsdDemod->getDecoder().getDPMRDecoder().getCalledId());
|
2016-08-07 23:04:56 +00:00
|
|
|
m_signalFormat = signalFormatDPMR;
|
|
|
|
break;
|
2016-09-20 17:35:51 +00:00
|
|
|
case DSDcc::DSDDecoder::DSDSyncYSF:
|
2016-09-27 15:57:06 +00:00
|
|
|
// 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8
|
2016-09-27 17:56:42 +00:00
|
|
|
// 0....5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0..
|
2016-09-27 15:57:06 +00:00
|
|
|
// C V2 RI 0:7 WL000|ssssssssss>dddddddddd |UUUUUUUUUU>DDDDDDDDDD|44444
|
2016-09-20 17:35:51 +00:00
|
|
|
if (m_dsdDemod->getDecoder().getYSFDecoder().getFICHError() == DSDcc::DSDYSF::FICHNoError)
|
|
|
|
{
|
2017-01-29 13:55:54 +00:00
|
|
|
snprintf(m_formatStatusText, 82, "%s ", DSDcc::DSDYSF::ysfChannelTypeText[(int) m_dsdDemod->getDecoder().getYSFDecoder().getFICH().getFrameInformation()]);
|
2016-09-20 17:35:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-01-29 13:55:54 +00:00
|
|
|
snprintf(m_formatStatusText, 82, "%d ", (int) m_dsdDemod->getDecoder().getYSFDecoder().getFICHError());
|
2016-09-20 17:35:51 +00:00
|
|
|
}
|
2016-09-21 20:12:02 +00:00
|
|
|
|
2017-02-04 19:02:07 +00:00
|
|
|
snprintf(&m_formatStatusText[2], 80, "%s %s %d:%d %c%c",
|
2017-01-13 01:16:28 +00:00
|
|
|
DSDcc::DSDYSF::ysfDataTypeText[(int) m_dsdDemod->getDecoder().getYSFDecoder().getFICH().getDataType()],
|
|
|
|
DSDcc::DSDYSF::ysfCallModeText[(int) m_dsdDemod->getDecoder().getYSFDecoder().getFICH().getCallMode()],
|
2016-09-20 17:35:51 +00:00
|
|
|
m_dsdDemod->getDecoder().getYSFDecoder().getFICH().getBlockTotal(),
|
|
|
|
m_dsdDemod->getDecoder().getYSFDecoder().getFICH().getFrameTotal(),
|
|
|
|
(m_dsdDemod->getDecoder().getYSFDecoder().getFICH().isNarrowMode() ? 'N' : 'W'),
|
|
|
|
(m_dsdDemod->getDecoder().getYSFDecoder().getFICH().isInternetPath() ? 'I' : 'L'));
|
2016-09-21 20:12:02 +00:00
|
|
|
|
|
|
|
if (m_dsdDemod->getDecoder().getYSFDecoder().getFICH().isSquelchCodeEnabled())
|
2016-09-20 17:35:51 +00:00
|
|
|
{
|
2017-01-29 13:55:54 +00:00
|
|
|
snprintf(&m_formatStatusText[14], 82-14, "%03d", m_dsdDemod->getDecoder().getYSFDecoder().getFICH().getSquelchCode());
|
2016-09-20 17:35:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-01-29 13:55:54 +00:00
|
|
|
strncpy(&m_formatStatusText[14], "---", 82-14);
|
2016-09-20 17:35:51 +00:00
|
|
|
}
|
2016-09-21 20:12:02 +00:00
|
|
|
|
2017-12-31 02:34:38 +00:00
|
|
|
char dest[13];
|
2016-09-21 20:12:02 +00:00
|
|
|
|
|
|
|
if ( m_dsdDemod->getDecoder().getYSFDecoder().radioIdMode())
|
|
|
|
{
|
2017-12-31 02:34:38 +00:00
|
|
|
snprintf(dest, 12, "%-5s:%-5s",
|
2016-09-21 20:12:02 +00:00
|
|
|
m_dsdDemod->getDecoder().getYSFDecoder().getDestId(),
|
|
|
|
m_dsdDemod->getDecoder().getYSFDecoder().getSrcId());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-12-31 02:34:38 +00:00
|
|
|
snprintf(dest, 11, "%-10s", m_dsdDemod->getDecoder().getYSFDecoder().getDest());
|
2016-09-21 20:12:02 +00:00
|
|
|
}
|
|
|
|
|
2017-01-29 13:55:54 +00:00
|
|
|
snprintf(&m_formatStatusText[17], 82-17, "|%-10s>%s|%-10s>%-10s|%-5s",
|
2016-09-21 17:45:22 +00:00
|
|
|
m_dsdDemod->getDecoder().getYSFDecoder().getSrc(),
|
2016-09-21 20:12:02 +00:00
|
|
|
dest,
|
2016-09-21 17:45:22 +00:00
|
|
|
m_dsdDemod->getDecoder().getYSFDecoder().getUplink(),
|
|
|
|
m_dsdDemod->getDecoder().getYSFDecoder().getDownlink(),
|
|
|
|
m_dsdDemod->getDecoder().getYSFDecoder().getRem4());
|
2016-09-21 20:12:02 +00:00
|
|
|
|
|
|
|
m_signalFormat = signalFormatYSF;
|
2016-09-20 17:35:51 +00:00
|
|
|
break;
|
2016-04-23 04:27:28 +00:00
|
|
|
default:
|
|
|
|
m_signalFormat = signalFormatNone;
|
|
|
|
m_formatStatusText[0] = '\0';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-09-27 17:56:42 +00:00
|
|
|
m_formatStatusText[82] = '\0'; // guard
|
2016-04-23 04:27:28 +00:00
|
|
|
}
|
|
|
|
|
2017-11-14 00:34:51 +00:00
|
|
|
void DSDDemodGUI::channelMarkerChangedByCursor()
|
2017-08-23 21:44:12 +00:00
|
|
|
{
|
2017-11-14 00:34:51 +00:00
|
|
|
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
|
|
|
|
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
2017-08-23 21:44:12 +00:00
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
|
2017-11-14 21:58:35 +00:00
|
|
|
void DSDDemodGUI::channelMarkerHighlightedByCursor()
|
|
|
|
{
|
|
|
|
setHighlighted(m_channelMarker.getHighlighted());
|
|
|
|
}
|
2017-08-23 21:44:12 +00:00
|
|
|
|
2018-03-28 06:00:27 +00:00
|
|
|
void DSDDemodGUI::audioSelect()
|
|
|
|
{
|
|
|
|
qDebug("DSDDemodGUI::audioSelect");
|
|
|
|
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
|
|
|
|
audioSelect.exec();
|
|
|
|
|
|
|
|
if (audioSelect.m_selected)
|
|
|
|
{
|
|
|
|
m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
|
|
|
|
applySettings();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-07 11:05:53 +00:00
|
|
|
void DSDDemodGUI::tick()
|
|
|
|
{
|
2017-05-16 21:39:49 +00:00
|
|
|
double magsqAvg, magsqPeak;
|
2016-12-06 18:06:38 +00:00
|
|
|
int nbMagsqSamples;
|
|
|
|
m_dsdDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
|
2017-05-16 21:39:49 +00:00
|
|
|
double powDbAvg = CalcDb::dbPower(magsqAvg);
|
|
|
|
double powDbPeak = CalcDb::dbPower(magsqPeak);
|
2016-12-06 18:06:38 +00:00
|
|
|
|
|
|
|
ui->channelPowerMeter->levelChanged(
|
|
|
|
(100.0f + powDbAvg) / 100.0f,
|
|
|
|
(100.0f + powDbPeak) / 100.0f,
|
|
|
|
nbMagsqSamples);
|
|
|
|
|
2017-08-17 15:48:47 +00:00
|
|
|
if (m_tickCount % 4 == 0) {
|
|
|
|
ui->channelPower->setText(tr("%1 dB").arg(powDbAvg, 0, 'f', 1));
|
|
|
|
}
|
2016-08-26 00:02:10 +00:00
|
|
|
|
2016-04-07 11:05:53 +00:00
|
|
|
bool squelchOpen = m_dsdDemod->getSquelchOpen();
|
|
|
|
|
|
|
|
if (squelchOpen != m_squelchOpen)
|
|
|
|
{
|
2017-01-16 23:49:52 +00:00
|
|
|
if (squelchOpen) {
|
2016-04-07 11:05:53 +00:00
|
|
|
ui->audioMute->setStyleSheet("QToolButton { background-color : green; }");
|
|
|
|
} else {
|
|
|
|
ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
|
|
|
}
|
2017-01-16 23:49:52 +00:00
|
|
|
|
|
|
|
m_squelchOpen = squelchOpen;
|
2016-04-07 11:05:53 +00:00
|
|
|
}
|
2016-04-22 01:53:16 +00:00
|
|
|
|
|
|
|
// "slow" updates
|
|
|
|
|
2017-08-17 15:48:47 +00:00
|
|
|
if (m_tickCount % 10 == 0)
|
2016-04-22 01:53:16 +00:00
|
|
|
{
|
|
|
|
ui->inLevelText->setText(QString::number(m_dsdDemod->getDecoder().getInLevel()));
|
2016-08-18 00:47:49 +00:00
|
|
|
ui->inCarrierPosText->setText(QString::number(m_dsdDemod->getDecoder().getCarrierPos()));
|
|
|
|
ui->zcPosText->setText(QString::number(m_dsdDemod->getDecoder().getZeroCrossingPos()));
|
2016-08-18 11:35:11 +00:00
|
|
|
ui->symbolSyncQualityText->setText(QString::number(m_dsdDemod->getDecoder().getSymbolSyncQuality()));
|
2016-08-25 11:58:52 +00:00
|
|
|
|
2016-09-04 00:10:52 +00:00
|
|
|
if (m_dsdDemod->getDecoder().getVoice1On()) {
|
|
|
|
ui->slot1On->setStyleSheet("QToolButton { background-color : green; }");
|
|
|
|
} else {
|
|
|
|
ui->slot1On->setStyleSheet("QToolButton { background-color : rgb(79,79,79); }");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_dsdDemod->getDecoder().getVoice2On()) {
|
|
|
|
ui->slot2On->setStyleSheet("QToolButton { background-color : green; }");
|
|
|
|
} else {
|
|
|
|
ui->slot2On->setStyleSheet("QToolButton { background-color : rgb(79,79,79); }");
|
|
|
|
}
|
|
|
|
|
2016-08-25 11:58:52 +00:00
|
|
|
const char *frameTypeText = m_dsdDemod->getDecoder().getFrameTypeText();
|
|
|
|
|
|
|
|
if (frameTypeText[0] == '\0') {
|
|
|
|
ui->syncText->setStyleSheet("QLabel { background:rgb(53,53,53); }"); // turn off background
|
|
|
|
} else {
|
|
|
|
ui->syncText->setStyleSheet("QLabel { background:rgb(37,53,39); }"); // turn on background
|
|
|
|
}
|
|
|
|
|
|
|
|
ui->syncText->setText(QString(frameTypeText));
|
2016-04-23 04:27:28 +00:00
|
|
|
|
|
|
|
formatStatusText();
|
|
|
|
ui->formatStatusText->setText(QString(m_formatStatusText));
|
|
|
|
|
2018-04-01 20:14:11 +00:00
|
|
|
if (ui->activateStatusLog->isChecked()) {
|
|
|
|
m_dsdStatusTextDialog.addLine(QString(m_formatStatusText));
|
|
|
|
}
|
|
|
|
|
2016-04-23 09:31:40 +00:00
|
|
|
if (m_formatStatusText[0] == '\0') {
|
|
|
|
ui->formatStatusText->setStyleSheet("QLabel { background:rgb(53,53,53); }"); // turn off background
|
|
|
|
} else {
|
|
|
|
ui->formatStatusText->setStyleSheet("QLabel { background:rgb(37,53,39); }"); // turn on background
|
|
|
|
}
|
|
|
|
|
2017-05-07 08:23:37 +00:00
|
|
|
if (m_squelchOpen && ui->symbolPLLLock->isChecked() && m_dsdDemod->getDecoder().getSymbolPLLLocked()) {
|
2017-05-05 22:29:58 +00:00
|
|
|
ui->symbolPLLLock->setStyleSheet("QToolButton { background-color : green; }");
|
|
|
|
} else {
|
2017-05-07 08:23:37 +00:00
|
|
|
ui->symbolPLLLock->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
2017-05-05 22:29:58 +00:00
|
|
|
}
|
2016-04-22 01:53:16 +00:00
|
|
|
}
|
2017-08-17 15:48:47 +00:00
|
|
|
|
|
|
|
m_tickCount++;
|
2016-04-07 11:05:53 +00:00
|
|
|
}
|