plotter: clear waterfall using Delete key

The waterfall is not automatically cleared after changes to the many
settings that could cause it to be distorted or invalid. An explicit
clear allows users who do not want to see outdated data to get rid of
it.

Signed-off-by: Jeff Long <willcode4@gmail.com>
This commit is contained in:
Jeff Long 2023-10-03 09:04:50 -04:00
parent 919a90aaec
commit c481bbeff2
4 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,7 @@ Main window actions:
F11 Toggle full screen mode
F Set focus to the frequency controller
Z Zero frequency offset
Delete Clear waterfall
Ctrl+Q Quit the program
Receiver modes:

View File

@ -172,6 +172,9 @@ MainWindow::MainWindow(const QString& cfgfile, bool edit_conf, QWidget *parent)
// toggle markers on/off
auto *toggle_markers_shortcut = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_K), this);
QObject::connect(toggle_markers_shortcut, &QShortcut::activated, this, &MainWindow::toggleMarkers);
// clear waterfall
auto *clear_waterfall_shortcut = new QShortcut(Qt::Key_Delete, this);
QObject::connect(clear_waterfall_shortcut, SIGNAL(activated()), ui->plotter, SLOT(clearWaterfall()));
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);

View File

@ -2455,6 +2455,13 @@ void CPlotter::setMarkers(qint64 a, qint64 b)
updateOverlay();
}
void CPlotter::clearWaterfall()
{
if (!m_WaterfallPixmap.isNull()) {
m_WaterfallPixmap.fill(Qt::black);
}
}
void CPlotter::calcDivSize (qint64 low, qint64 high, int divswanted, qint64 &adjlow, qint64 &step, int& divs)
{
qCDebug(plotter) << "low:" << low;

View File

@ -181,6 +181,7 @@ public slots:
void enableBandPlan(bool enable);
void enableMarkers(bool enabled);
void setMarkers(qint64 a, qint64 b);
void clearWaterfall();
void updateOverlay();
void setPercent2DScreen(int percent)