1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-10-31 15:07:12 -04:00

DSD demod: new dialog to show status text log

This commit is contained in:
f4exb 2018-04-01 22:14:11 +02:00
parent a447193bd7
commit 8d64ca2068
10 changed files with 456 additions and 105 deletions

View File

@ -9,6 +9,7 @@ set(dsddemod_SOURCES
dsddemodbaudrates.cpp dsddemodbaudrates.cpp
dsddemodsettings.cpp dsddemodsettings.cpp
dsddecoder.cpp dsddecoder.cpp
dsdstatustextdialog.cpp
) )
set(dsddemod_HEADERS set(dsddemod_HEADERS
@ -18,10 +19,12 @@ set(dsddemod_HEADERS
dsddemodbaudrates.h dsddemodbaudrates.h
dsddemodsettings.h dsddemodsettings.h
dsddecoder.h dsddecoder.h
dsdstatustextdialog.h
) )
set(dsddemod_FORMS set(dsddemod_FORMS
dsddemodgui.ui dsddemodgui.ui
dsdstatustextdialog.ui
) )
if (BUILD_DEBIAN) if (BUILD_DEBIAN)

View File

@ -265,6 +265,12 @@ void DSDDemodGUI::onMenuDialogCalled(const QPoint &p)
applySettings(); applySettings();
} }
void DSDDemodGUI::on_viewStatusLog_clicked()
{
qDebug("DSDDemodGUI::on_viewStatusLog_clicked");
m_dsdStatusTextDialog.exec();
}
DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) : DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
RollupWidget(parent), RollupWidget(parent),
ui(new Ui::DSDDemodGUI), ui(new Ui::DSDDemodGUI),
@ -279,7 +285,8 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_slot2On(false), m_slot2On(false),
m_tdmaStereo(false), m_tdmaStereo(false),
m_squelchOpen(false), m_squelchOpen(false),
m_tickCount(0) m_tickCount(0),
m_dsdStatusTextDialog(0)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->screenTV->setColor(true); ui->screenTV->setColor(true);
@ -681,6 +688,10 @@ void DSDDemodGUI::tick()
formatStatusText(); formatStatusText();
ui->formatStatusText->setText(QString(m_formatStatusText)); ui->formatStatusText->setText(QString(m_formatStatusText));
if (ui->activateStatusLog->isChecked()) {
m_dsdStatusTextDialog.addLine(QString(m_formatStatusText));
}
if (m_formatStatusText[0] == '\0') { if (m_formatStatusText[0] == '\0') {
ui->formatStatusText->setStyleSheet("QLabel { background:rgb(53,53,53); }"); // turn off background ui->formatStatusText->setStyleSheet("QLabel { background:rgb(53,53,53); }"); // turn off background
} else { } else {

View File

@ -28,6 +28,7 @@
#include "util/messagequeue.h" #include "util/messagequeue.h"
#include "dsddemodsettings.h" #include "dsddemodsettings.h"
#include "dsdstatustextdialog.h"
class PluginAPI; class PluginAPI;
class DeviceUISet; class DeviceUISet;
@ -98,6 +99,8 @@ private:
MessageQueue m_inputMessageQueue; MessageQueue m_inputMessageQueue;
DSDStatusTextDialog m_dsdStatusTextDialog;
explicit DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); explicit DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
virtual ~DSDDemodGUI(); virtual ~DSDDemodGUI();
@ -132,6 +135,7 @@ private slots:
void on_symbolPLLLock_toggled(bool checked); void on_symbolPLLLock_toggled(bool checked);
void onWidgetRolled(QWidget* widget, bool rollDown); void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p); void onMenuDialogCalled(const QPoint& p);
void on_viewStatusLog_clicked();
void audioSelect(); void audioSelect();
void tick(); void tick();
}; };

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>610</width> <width>613</width>
<height>392</height> <height>392</height>
</rect> </rect>
</property> </property>
@ -254,6 +254,62 @@
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="squelchLayout"> <layout class="QHBoxLayout" name="squelchLayout">
<item>
<widget class="QCheckBox" name="activateStatusLog">
<property name="toolTip">
<string>Activate status text log</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="viewStatusLog">
<property name="minimumSize">
<size>
<width>24</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>View status text log</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/listing.png</normaloff>:/listing.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="volumeLabel"> <widget class="QLabel" name="volumeLabel">
<property name="text"> <property name="text">
@ -309,17 +365,11 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_2"> <widget class="Line" name="line_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> </widget>
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="squelchLabel"> <widget class="QLabel" name="squelchLabel">
@ -487,6 +537,9 @@
<pointsize>9</pointsize> <pointsize>9</pointsize>
</font> </font>
</property> </property>
<property name="toolTip">
<string>Status text</string>
</property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::Box</enum> <enum>QFrame::Box</enum>
</property> </property>

View File

@ -0,0 +1,55 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 F4EXB //
// 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/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "dsdstatustextdialog.h"
#include "ui_dsdstatustextdialog.h"
#include <QDateTime>
#include <QScrollBar>
DSDStatusTextDialog::DSDStatusTextDialog(QWidget* parent) :
QDialog(parent),
ui(new Ui::DSDStatusTextDialog)
{
ui->setupUi(this);
}
DSDStatusTextDialog::~DSDStatusTextDialog()
{
delete ui;
}
void DSDStatusTextDialog::addLine(const QString& line)
{
if ((line.size() > 0) && (line != m_lastLine))
{
QDateTime dt = QDateTime::currentDateTime();
QString dateStr = dt.toString("hh:mm:ss");
QTextCursor cursor = ui->logEdit->textCursor();
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
cursor.insertText(tr("%1 %2\n").arg(dateStr).arg(line));
if (ui->pinToLastLine->isChecked()) {
ui->logEdit->verticalScrollBar()->setValue(ui->logEdit->verticalScrollBar()->maximum());
}
m_lastLine = line;
}
}
void DSDStatusTextDialog::on_clear_clicked()
{
ui->logEdit->clear();
}

View File

@ -0,0 +1,45 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 F4EXB //
// 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/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef PLUGINS_CHANNELRX_DEMODDSD_DSDSTATUSTEXTDIALOG_H_
#define PLUGINS_CHANNELRX_DEMODDSD_DSDSTATUSTEXTDIALOG_H_
#include <QDialog>
namespace Ui {
class DSDStatusTextDialog;
}
class DSDStatusTextDialog : public QDialog {
Q_OBJECT
public:
explicit DSDStatusTextDialog(QWidget* parent = 0);
~DSDStatusTextDialog();
void addLine(const QString& line);
private:
Ui::DSDStatusTextDialog* ui;
QString m_lastLine;
private slots:
void on_clear_clicked();
};
#endif /* PLUGINS_CHANNELRX_DEMODDSD_DSDSTATUSTEXTDIALOG_H_ */

View File

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DSDStatusTextDialog</class>
<widget class="QDialog" name="DSDStatusTextDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>740</width>
<height>380</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Status text log</string>
</property>
<property name="windowIcon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/sdrangel_icon.png</normaloff>:/sdrangel_icon.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="processLayout">
<item>
<widget class="QPushButton" name="clear">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Clear log</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/sweep.png</normaloff>:/sweep.png</iconset>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="pinToLastLine">
<property name="toolTip">
<string>Pin to last line</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/pin_last.png</normaloff>:/pin_last.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Save log to file</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/save.png</normaloff>:/save.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QPlainTextEdit" name="logEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<family>Monospace</family>
</font>
</property>
<property name="toolTip">
<string>Log</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DSDStatusTextDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>257</x>
<y>194</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>203</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DSDStatusTextDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>314</x>
<y>194</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>203</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

View File

@ -1,5 +1,7 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>pin_last.png</file>
<file>sweep.png</file>
<file>minusrx.png</file> <file>minusrx.png</file>
<file>plusrx.png</file> <file>plusrx.png</file>
<file>microphone.png</file> <file>microphone.png</file>

BIN
sdrgui/resources/sweep.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B