LibreVNA/Software/PC_Application/Traces/traceplot.h
Jan Käberich fc3ce7a828 Improved spectrum analyzer mode
- Faster sweeps by changing 2.LO only when necessary and using 400kHz I2C frequency
- Added FPGA settings for selectable ADC samplerate
- Additional measurement with different ADC samplerate when signal ID is on to remove ADC images
2020-09-17 19:54:03 +02:00

55 lines
1.4 KiB
C++

#ifndef TRACEPLOT_H
#define TRACEPLOT_H
#include <QWidget>
#include "tracemodel.h"
#include <QMenu>
#include <QContextMenuEvent>
#include <QTime>
class TracePlot : public QWidget
{
Q_OBJECT
public:
TracePlot( QWidget *parent = nullptr);
~TracePlot();
virtual void enableTrace(Trace *t, bool enabled);
void mouseDoubleClickEvent(QMouseEvent *event) override;
virtual void setXAxis(double min, double max){Q_UNUSED(min);Q_UNUSED(max)};
static std::set<TracePlot *> getPlots();
signals:
void doubleClicked(QWidget *w);
void deleted(TracePlot*);
protected:
static const QColor Background;// = QColor(0,0,0);
static const QColor Border;// = QColor(255,255,255);
static const QColor Divisions;// = QColor(255,255,255);
static constexpr int MinUpdateInterval = 100;
// need to be called in derived class constructor
void initializeTraceInfo(TraceModel &model);
void contextMenuEvent(QContextMenuEvent *event) override;
virtual void updateContextMenu();
virtual bool supported(Trace *t) = 0;
virtual void replot(){};
std::map<Trace*, bool> traces;
QMenu *contextmenu;
QTime lastUpdate;
bool markedForDeletion;
static std::set<TracePlot*> plots;
protected slots:
void newTraceAvailable(Trace *t);
void traceDeleted(Trace *t);
void triggerReplot();
virtual void markerAdded(TraceMarker *m);
virtual void markerRemoved(TraceMarker *m);
};
#endif // TRACEPLOT_H