mirror of
https://github.com/miek/inspectrum.git
synced 2026-03-25 09:37:12 +01:00
Rename WaveformView -> PlotView
This commit is contained in:
@@ -34,10 +34,10 @@ list(APPEND inspectrum_sources
|
||||
inputsource.cpp
|
||||
memory_sink_impl.cc
|
||||
memory_source_impl.cc
|
||||
plotview.cpp
|
||||
samplebuffer.cpp
|
||||
spectrogram.cpp
|
||||
spectrogramcontrols.cpp
|
||||
waveformview.cpp
|
||||
util.cpp
|
||||
)
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ MainWindow::MainWindow()
|
||||
dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||
addDockWidget(Qt::LeftDockWidgetArea, dock);
|
||||
|
||||
wave = new WaveformView();
|
||||
addDockWidget(Qt::BottomDockWidgetArea, wave);
|
||||
connect(this, SIGNAL(viewChanged(off_t, off_t)), wave, SLOT(viewChanged(off_t, off_t)));
|
||||
plots = new PlotView();
|
||||
addDockWidget(Qt::BottomDockWidgetArea, plots);
|
||||
connect(this, SIGNAL(viewChanged(off_t, off_t)), plots, SLOT(viewChanged(off_t, off_t)));
|
||||
connect(this, SIGNAL(selectionChanged(std::pair<off_t, off_t>, std::pair<float, float>)),
|
||||
wave, SLOT(selectionChanged(std::pair<off_t, off_t>, std::pair<float, float>)));
|
||||
connect(this, SIGNAL(selectionCleared()), wave, SLOT(selectionCleared()));
|
||||
plots, SLOT(selectionChanged(std::pair<off_t, off_t>, std::pair<float, float>)));
|
||||
connect(this, SIGNAL(selectionCleared()), plots, SLOT(selectionCleared()));
|
||||
|
||||
connect(dock, SIGNAL(openFile(QString)), this, SLOT(openFile(QString)));
|
||||
connect(dock->sampleRate, SIGNAL(textChanged(QString)), this, SLOT(setSampleRate(QString)));
|
||||
@@ -180,6 +180,6 @@ void MainWindow::openFile(QString fileName)
|
||||
QString title="%1: %2";
|
||||
this->setWindowTitle(title.arg(QApplication::applicationName(),fileName.section('/',-1,-1)));
|
||||
spectrogram.openFile(fileName);
|
||||
wave->inputSourceChanged(spectrogram.inputSource);
|
||||
plots->inputSourceChanged(spectrogram.inputSource);
|
||||
emitViewChanged();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <QScrollArea>
|
||||
#include "spectrogram.h"
|
||||
#include "spectrogramcontrols.h"
|
||||
#include "waveformview.h"
|
||||
#include "plotview.h"
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
QScrollArea scrollArea;
|
||||
Spectrogram spectrogram;
|
||||
SpectrogramControls *dock;
|
||||
WaveformView *wave;
|
||||
PlotView *plots;
|
||||
std::pair<off_t, off_t> selectionTime;
|
||||
std::pair<float, float> selectionFreq;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2015, Mike Walters <mike@flomp.net>
|
||||
* Copyright (C) 2015-2016, Mike Walters <mike@flomp.net>
|
||||
*
|
||||
* This file is part of inspectrum.
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "waveformview.h"
|
||||
#include "plotview.h"
|
||||
#include <QDebug>
|
||||
#include <QPainter>
|
||||
#include <gnuradio/top_block.h>
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "memory_sink.h"
|
||||
#include "memory_source.h"
|
||||
|
||||
WaveformView::WaveformView()
|
||||
PlotView::PlotView()
|
||||
{
|
||||
for (int i = 0; i < 128; i++) {
|
||||
colormap[i] = qRgb(i/2, i*1.5, i*1.5);
|
||||
@@ -39,7 +39,7 @@ WaveformView::WaveformView()
|
||||
}
|
||||
}
|
||||
|
||||
void WaveformView::refreshSources()
|
||||
void PlotView::refreshSources()
|
||||
{
|
||||
sampleSources.clear();
|
||||
|
||||
@@ -73,7 +73,7 @@ void WaveformView::refreshSources()
|
||||
update();
|
||||
}
|
||||
|
||||
void WaveformView::inputSourceChanged(AbstractSampleSource *src)
|
||||
void PlotView::inputSourceChanged(AbstractSampleSource *src)
|
||||
{
|
||||
auto derived = dynamic_cast<SampleSource<std::complex<float>>*>(src);
|
||||
if (derived == nullptr)
|
||||
@@ -83,14 +83,14 @@ void WaveformView::inputSourceChanged(AbstractSampleSource *src)
|
||||
refreshSources();
|
||||
}
|
||||
|
||||
void WaveformView::viewChanged(off_t firstSample, off_t lastSample)
|
||||
void PlotView::viewChanged(off_t firstSample, off_t lastSample)
|
||||
{
|
||||
this->firstSample = firstSample;
|
||||
this->lastSample = lastSample;
|
||||
update();
|
||||
}
|
||||
|
||||
void WaveformView::selectionChanged(std::pair<off_t, off_t> selectionTime, std::pair<float, float> selectionFreq)
|
||||
void PlotView::selectionChanged(std::pair<off_t, off_t> selectionTime, std::pair<float, float> selectionFreq)
|
||||
{
|
||||
this->selectionTime = selectionTime;
|
||||
this->selectionFreq = selectionFreq;
|
||||
@@ -98,13 +98,13 @@ void WaveformView::selectionChanged(std::pair<off_t, off_t> selectionTime, std::
|
||||
refreshSources();
|
||||
}
|
||||
|
||||
void WaveformView::selectionCleared()
|
||||
void PlotView::selectionCleared()
|
||||
{
|
||||
selection = false;
|
||||
refreshSources();
|
||||
}
|
||||
|
||||
void WaveformView::paintEvent(QPaintEvent *event)
|
||||
void PlotView::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
if (lastSample - firstSample <= 0) return;
|
||||
|
||||
@@ -133,7 +133,7 @@ void WaveformView::paintEvent(QPaintEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void WaveformView::plot(QPainter *painter, QRect &rect, float *samples, off_t count, int step = 1)
|
||||
void PlotView::plot(QPainter *painter, QRect &rect, float *samples, off_t count, int step = 1)
|
||||
{
|
||||
int xprev = 0;
|
||||
int yprev = 0;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2015, Mike Walters <mike@flomp.net>
|
||||
* Copyright (C) 2015-2016, Mike Walters <mike@flomp.net>
|
||||
*
|
||||
* This file is part of inspectrum.
|
||||
*
|
||||
@@ -23,12 +23,12 @@
|
||||
#include <QPaintEvent>
|
||||
#include "inputsource.h"
|
||||
|
||||
class WaveformView : public QDockWidget
|
||||
class PlotView : public QDockWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WaveformView();
|
||||
PlotView();
|
||||
|
||||
public slots:
|
||||
void inputSourceChanged(AbstractSampleSource *input);
|
||||
Reference in New Issue
Block a user