From 8d64ca20687c4f191f62636f043f0cebd7f49779 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 1 Apr 2018 22:14:11 +0200 Subject: [PATCH] DSD demod: new dialog to show status text log --- plugins/channelrx/demoddsd/CMakeLists.txt | 3 + plugins/channelrx/demoddsd/dsddemodgui.cpp | 13 +- plugins/channelrx/demoddsd/dsddemodgui.h | 4 + plugins/channelrx/demoddsd/dsddemodgui.ui | 75 ++++++- .../demoddsd/dsdstatustextdialog.cpp | 55 +++++ .../channelrx/demoddsd/dsdstatustextdialog.h | 45 +++++ .../channelrx/demoddsd/dsdstatustextdialog.ui | 178 +++++++++++++++++ sdrgui/resources/pin_last.png | Bin 0 -> 341 bytes sdrgui/resources/res.qrc | 188 +++++++++--------- sdrgui/resources/sweep.png | Bin 0 -> 371 bytes 10 files changed, 456 insertions(+), 105 deletions(-) create mode 100644 plugins/channelrx/demoddsd/dsdstatustextdialog.cpp create mode 100644 plugins/channelrx/demoddsd/dsdstatustextdialog.h create mode 100644 plugins/channelrx/demoddsd/dsdstatustextdialog.ui create mode 100644 sdrgui/resources/pin_last.png create mode 100644 sdrgui/resources/sweep.png diff --git a/plugins/channelrx/demoddsd/CMakeLists.txt b/plugins/channelrx/demoddsd/CMakeLists.txt index 87ea94025..c4c35e25a 100644 --- a/plugins/channelrx/demoddsd/CMakeLists.txt +++ b/plugins/channelrx/demoddsd/CMakeLists.txt @@ -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) diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index d8e8e8edf..ccd4e2937 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -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 { diff --git a/plugins/channelrx/demoddsd/dsddemodgui.h b/plugins/channelrx/demoddsd/dsddemodgui.h index 77edd0f09..728fdf446 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.h +++ b/plugins/channelrx/demoddsd/dsddemodgui.h @@ -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(); }; diff --git a/plugins/channelrx/demoddsd/dsddemodgui.ui b/plugins/channelrx/demoddsd/dsddemodgui.ui index 8d1ed6a0c..e110fc2e4 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.ui +++ b/plugins/channelrx/demoddsd/dsddemodgui.ui @@ -6,7 +6,7 @@ 0 0 - 610 + 613 392 @@ -254,6 +254,62 @@ + + + + Activate status text log + + + + + + + + + + + 24 + 0 + + + + + 24 + 16777215 + + + + View status text log + + + + + + + :/listing.png:/listing.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + @@ -309,22 +365,16 @@ - + - Qt::Horizontal + Qt::Vertical - - - 40 - 20 - - - + - Sq + Sq @@ -487,6 +537,9 @@ 9 + + Status text + QFrame::Box diff --git a/plugins/channelrx/demoddsd/dsdstatustextdialog.cpp b/plugins/channelrx/demoddsd/dsdstatustextdialog.cpp new file mode 100644 index 000000000..47a843e8c --- /dev/null +++ b/plugins/channelrx/demoddsd/dsdstatustextdialog.cpp @@ -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 . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "dsdstatustextdialog.h" +#include "ui_dsdstatustextdialog.h" + +#include +#include + +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(); +} diff --git a/plugins/channelrx/demoddsd/dsdstatustextdialog.h b/plugins/channelrx/demoddsd/dsdstatustextdialog.h new file mode 100644 index 000000000..f5d5a0718 --- /dev/null +++ b/plugins/channelrx/demoddsd/dsdstatustextdialog.h @@ -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 . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef PLUGINS_CHANNELRX_DEMODDSD_DSDSTATUSTEXTDIALOG_H_ +#define PLUGINS_CHANNELRX_DEMODDSD_DSDSTATUSTEXTDIALOG_H_ + +#include + +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_ */ diff --git a/plugins/channelrx/demoddsd/dsdstatustextdialog.ui b/plugins/channelrx/demoddsd/dsdstatustextdialog.ui new file mode 100644 index 000000000..675e41047 --- /dev/null +++ b/plugins/channelrx/demoddsd/dsdstatustextdialog.ui @@ -0,0 +1,178 @@ + + + DSDStatusTextDialog + + + + 0 + 0 + 740 + 380 + + + + + Sans Serif + 9 + + + + Status text log + + + + :/sdrangel_icon.png:/sdrangel_icon.png + + + + + + + + + 24 + 24 + + + + Clear log + + + + + + + :/sweep.png:/sweep.png + + + false + + + + + + + Pin to last line + + + + + + + :/pin_last.png:/pin_last.png + + + + + + + + 24 + 24 + + + + Save log to file + + + + + + + :/save.png:/save.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + true + + + + Monospace + + + + Log + + + true + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
+
+ + buttonBox + + + + + + + buttonBox + accepted() + DSDStatusTextDialog + accept() + + + 257 + 194 + + + 157 + 203 + + + + + buttonBox + rejected() + DSDStatusTextDialog + reject() + + + 314 + 194 + + + 286 + 203 + + + + +
diff --git a/sdrgui/resources/pin_last.png b/sdrgui/resources/pin_last.png new file mode 100644 index 0000000000000000000000000000000000000000..165a0f0b7140e4d14eab5a0c8bfa3f4588bbdbef GIT binary patch literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAH3s;ExB}__|NpzYyGuz)&6_vR z%gf8n%}rEPR6syLLPBEh+_}@HOx~;X`uh4F zJ$h7DRl*!&%@FSFdh=h=q|$N&Tw#azUVwucwP+h{pNk1O*|3M^h4xXddkFmYL0? zEb>6eeR^Wbktr7$j5e-HKe9|JwoSgB)#ixR)JC4d4wY{U4nIp@v$0Wog=>K;UtVF! d0S7q-23bvpcl!cW4g(El@O1TaS?83{1OOZ@c)tJu literal 0 HcmV?d00001 diff --git a/sdrgui/resources/res.qrc b/sdrgui/resources/res.qrc index 245206864..9f6b124e8 100644 --- a/sdrgui/resources/res.qrc +++ b/sdrgui/resources/res.qrc @@ -1,95 +1,97 @@ - - minusrx.png - plusrx.png - microphone.png - checkmark.png - questionmark.png - export.png - import.png - compressed.png - locked.png - appicon.png - unlocked.png - histogram.png - waterfall.png - preset-load.png - preset-save.png - preset-update.png - preset-delete.png - horizontal.png - vertical.png - maxhold.png - grid.png - invertspectrum.png - preset-last.png - display1.png - display2.png - slopen_icon.png - slopep_icon.png - display1_w.png - display2_w.png - horizontal_w.png - vertical_w.png - current.png - slopeb_icon.png - clear.png - playloop.png - play.png - pause.png - stop.png - sdrangel_logo.png - sdrangel_icon.png - minus.png - plus.png - record_off.png - record_on.png - mem.png - minusw.png - plusw.png - mono.png - stereo.png - sound_off.png - sound_on.png - dsb.png - usb.png - flip_lr.png - flip_rl.png - carrier.png - rds.png - recycle.png - lsb.png - constellation.png - slot1_off.png - slot1_on.png - slot2_off.png - slot2_on.png - iambickey.png - morsekey.png - txoff.png - txon.png - arrow_down.png - arrow_up.png - film_reel.png - film.png - picture.png - camera.png - filter_bandpass.png - stream.png - antenna.png - link.png - choose.png - clocksource.png - flip_sidebands.png - filter_highpass.png - edit.png - listing.png - create.png - duplicate.png - bin.png - save.png - load.png - keyboard.png - kill.png - + + pin_last.png + sweep.png + minusrx.png + plusrx.png + microphone.png + checkmark.png + questionmark.png + export.png + import.png + compressed.png + locked.png + appicon.png + unlocked.png + histogram.png + waterfall.png + preset-load.png + preset-save.png + preset-update.png + preset-delete.png + horizontal.png + vertical.png + maxhold.png + grid.png + invertspectrum.png + preset-last.png + display1.png + display2.png + slopen_icon.png + slopep_icon.png + display1_w.png + display2_w.png + horizontal_w.png + vertical_w.png + current.png + slopeb_icon.png + clear.png + playloop.png + play.png + pause.png + stop.png + sdrangel_logo.png + sdrangel_icon.png + minus.png + plus.png + record_off.png + record_on.png + mem.png + minusw.png + plusw.png + mono.png + stereo.png + sound_off.png + sound_on.png + dsb.png + usb.png + flip_lr.png + flip_rl.png + carrier.png + rds.png + recycle.png + lsb.png + constellation.png + slot1_off.png + slot1_on.png + slot2_off.png + slot2_on.png + iambickey.png + morsekey.png + txoff.png + txon.png + arrow_down.png + arrow_up.png + film_reel.png + film.png + picture.png + camera.png + filter_bandpass.png + stream.png + antenna.png + link.png + choose.png + clocksource.png + flip_sidebands.png + filter_highpass.png + edit.png + listing.png + create.png + duplicate.png + bin.png + save.png + load.png + keyboard.png + kill.png + diff --git a/sdrgui/resources/sweep.png b/sdrgui/resources/sweep.png new file mode 100644 index 0000000000000000000000000000000000000000..4fa3db92c7e39b51bbecdac246567640566ec06e GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaA)dl#3xB}__|Nk>HGn<>6A3S)F zpPzrhf(5f@&pvkSn1zLffPjFBiOHEWXXehG`{Kn59v+@^=gvh%MZJCdHaIvqGc&WY zvU16iB?<}(SFT*q)z#g%Z{PRt-=95urm3m9a^=d@)YRLzZ%ax_c6D`mdwVxFHcpx} zsjRGQPPM!)$rAI}NrjN7+LVz;yK_1sK`_6a#0 zq5kvQOgBXy@-xs;WBIUr=HzWE%O|_n-9At)c=AE1qQjH=%dAz88Rrx%zc>+SGlQqA KpUXO@geCxG9gdg) literal 0 HcmV?d00001