1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05: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
dsddemodsettings.cpp
dsddecoder.cpp
dsdstatustextdialog.cpp
)
set(dsddemod_HEADERS
@ -18,10 +19,12 @@ set(dsddemod_HEADERS
dsddemodbaudrates.h
dsddemodsettings.h
dsddecoder.h
dsdstatustextdialog.h
)
set(dsddemod_FORMS
dsddemodgui.ui
dsdstatustextdialog.ui
)
if (BUILD_DEBIAN)

View File

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

View File

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

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>610</width>
<width>613</width>
<height>392</height>
</rect>
</property>
@ -254,6 +254,62 @@
</item>
<item>
<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>
<widget class="QLabel" name="volumeLabel">
<property name="text">
@ -309,22 +365,16 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</widget>
</item>
<item>
<widget class="QLabel" name="squelchLabel">
<property name="text">
<string>Sq</string>
<string> Sq</string>
</property>
</widget>
</item>
@ -487,6 +537,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="toolTip">
<string>Status text</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</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,95 +1,97 @@
<RCC>
<qresource prefix="/">
<file>minusrx.png</file>
<file>plusrx.png</file>
<file>microphone.png</file>
<file>checkmark.png</file>
<file>questionmark.png</file>
<file>export.png</file>
<file>import.png</file>
<file>compressed.png</file>
<file>locked.png</file>
<file>appicon.png</file>
<file>unlocked.png</file>
<file>histogram.png</file>
<file>waterfall.png</file>
<file>preset-load.png</file>
<file>preset-save.png</file>
<file>preset-update.png</file>
<file>preset-delete.png</file>
<file>horizontal.png</file>
<file>vertical.png</file>
<file>maxhold.png</file>
<file>grid.png</file>
<file>invertspectrum.png</file>
<file>preset-last.png</file>
<file>display1.png</file>
<file>display2.png</file>
<file>slopen_icon.png</file>
<file>slopep_icon.png</file>
<file>display1_w.png</file>
<file>display2_w.png</file>
<file>horizontal_w.png</file>
<file>vertical_w.png</file>
<file>current.png</file>
<file>slopeb_icon.png</file>
<file>clear.png</file>
<file>playloop.png</file>
<file>play.png</file>
<file>pause.png</file>
<file>stop.png</file>
<file>sdrangel_logo.png</file>
<file>sdrangel_icon.png</file>
<file>minus.png</file>
<file>plus.png</file>
<file>record_off.png</file>
<file>record_on.png</file>
<file>mem.png</file>
<file>minusw.png</file>
<file>plusw.png</file>
<file>mono.png</file>
<file>stereo.png</file>
<file>sound_off.png</file>
<file>sound_on.png</file>
<file>dsb.png</file>
<file>usb.png</file>
<file>flip_lr.png</file>
<file>flip_rl.png</file>
<file>carrier.png</file>
<file>rds.png</file>
<file>recycle.png</file>
<file>lsb.png</file>
<file>constellation.png</file>
<file>slot1_off.png</file>
<file>slot1_on.png</file>
<file>slot2_off.png</file>
<file>slot2_on.png</file>
<file>iambickey.png</file>
<file>morsekey.png</file>
<file>txoff.png</file>
<file>txon.png</file>
<file>arrow_down.png</file>
<file>arrow_up.png</file>
<file>film_reel.png</file>
<file>film.png</file>
<file>picture.png</file>
<file>camera.png</file>
<file>filter_bandpass.png</file>
<file>stream.png</file>
<file>antenna.png</file>
<file>link.png</file>
<file>choose.png</file>
<file>clocksource.png</file>
<file>flip_sidebands.png</file>
<file>filter_highpass.png</file>
<file>edit.png</file>
<file>listing.png</file>
<file>create.png</file>
<file>duplicate.png</file>
<file>bin.png</file>
<file>save.png</file>
<file>load.png</file>
<file>keyboard.png</file>
<file>kill.png</file>
</qresource>
<qresource prefix="/">
<file>pin_last.png</file>
<file>sweep.png</file>
<file>minusrx.png</file>
<file>plusrx.png</file>
<file>microphone.png</file>
<file>checkmark.png</file>
<file>questionmark.png</file>
<file>export.png</file>
<file>import.png</file>
<file>compressed.png</file>
<file>locked.png</file>
<file>appicon.png</file>
<file>unlocked.png</file>
<file>histogram.png</file>
<file>waterfall.png</file>
<file>preset-load.png</file>
<file>preset-save.png</file>
<file>preset-update.png</file>
<file>preset-delete.png</file>
<file>horizontal.png</file>
<file>vertical.png</file>
<file>maxhold.png</file>
<file>grid.png</file>
<file>invertspectrum.png</file>
<file>preset-last.png</file>
<file>display1.png</file>
<file>display2.png</file>
<file>slopen_icon.png</file>
<file>slopep_icon.png</file>
<file>display1_w.png</file>
<file>display2_w.png</file>
<file>horizontal_w.png</file>
<file>vertical_w.png</file>
<file>current.png</file>
<file>slopeb_icon.png</file>
<file>clear.png</file>
<file>playloop.png</file>
<file>play.png</file>
<file>pause.png</file>
<file>stop.png</file>
<file>sdrangel_logo.png</file>
<file>sdrangel_icon.png</file>
<file>minus.png</file>
<file>plus.png</file>
<file>record_off.png</file>
<file>record_on.png</file>
<file>mem.png</file>
<file>minusw.png</file>
<file>plusw.png</file>
<file>mono.png</file>
<file>stereo.png</file>
<file>sound_off.png</file>
<file>sound_on.png</file>
<file>dsb.png</file>
<file>usb.png</file>
<file>flip_lr.png</file>
<file>flip_rl.png</file>
<file>carrier.png</file>
<file>rds.png</file>
<file>recycle.png</file>
<file>lsb.png</file>
<file>constellation.png</file>
<file>slot1_off.png</file>
<file>slot1_on.png</file>
<file>slot2_off.png</file>
<file>slot2_on.png</file>
<file>iambickey.png</file>
<file>morsekey.png</file>
<file>txoff.png</file>
<file>txon.png</file>
<file>arrow_down.png</file>
<file>arrow_up.png</file>
<file>film_reel.png</file>
<file>film.png</file>
<file>picture.png</file>
<file>camera.png</file>
<file>filter_bandpass.png</file>
<file>stream.png</file>
<file>antenna.png</file>
<file>link.png</file>
<file>choose.png</file>
<file>clocksource.png</file>
<file>flip_sidebands.png</file>
<file>filter_highpass.png</file>
<file>edit.png</file>
<file>listing.png</file>
<file>create.png</file>
<file>duplicate.png</file>
<file>bin.png</file>
<file>save.png</file>
<file>load.png</file>
<file>keyboard.png</file>
<file>kill.png</file>
</qresource>
</RCC>

BIN
sdrgui/resources/sweep.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B