2012-05-22 13:09:48 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// Some code in this file and accompanying files is based on work by
|
|
|
|
// Moe Wheatley, AE4Y, released under the "Simplified BSD License".
|
|
|
|
// For more details see the accompanying file LICENSE_WHEATLEY.TXT
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef PLOTTER_H
|
|
|
|
#define PLOTTER_H
|
|
|
|
|
|
|
|
#include <QtGui>
|
|
|
|
#include <QFrame>
|
|
|
|
#include <QImage>
|
|
|
|
#include <cstring>
|
|
|
|
#include "commons.h"
|
|
|
|
|
|
|
|
#define VERT_DIVS 7 //specify grid screen divisions
|
|
|
|
#define HORZ_DIVS 20
|
|
|
|
|
|
|
|
class CPlotter : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit CPlotter(QWidget *parent = 0);
|
|
|
|
~CPlotter();
|
|
|
|
|
|
|
|
QSize minimumSizeHint() const;
|
|
|
|
QSize sizeHint() const;
|
|
|
|
QColor m_ColorTbl[256];
|
2012-10-10 20:51:16 -04:00
|
|
|
bool m_bCurrent;
|
2012-10-15 13:43:49 -04:00
|
|
|
bool m_bCumulative;
|
|
|
|
bool m_bJT9Sync;
|
2012-05-22 13:09:48 -04:00
|
|
|
int m_plotZero;
|
|
|
|
int m_plotGain;
|
2012-09-24 19:36:38 -04:00
|
|
|
float m_fSpan;
|
|
|
|
qint32 m_nSpan;
|
|
|
|
qint32 m_binsPerPixel;
|
|
|
|
qint32 m_fQSO;
|
|
|
|
qint32 m_fCal;
|
2012-10-29 13:58:33 -04:00
|
|
|
qint32 m_w;
|
2012-05-22 13:09:48 -04:00
|
|
|
|
2012-10-15 13:43:49 -04:00
|
|
|
void draw(float sw[], float red[], int i0); //Update the waterfall
|
2012-05-22 13:09:48 -04:00
|
|
|
void SetRunningState(bool running);
|
|
|
|
void setPlotZero(int plotZero);
|
|
|
|
int getPlotZero();
|
|
|
|
void setPlotGain(int plotGain);
|
|
|
|
int getPlotGain();
|
2012-09-24 19:36:38 -04:00
|
|
|
void SetStartFreq(quint64 f);
|
|
|
|
qint64 startFreq();
|
2012-05-22 13:09:48 -04:00
|
|
|
int plotWidth();
|
2012-09-24 19:36:38 -04:00
|
|
|
void setNSpan(int n);
|
2012-05-22 13:09:48 -04:00
|
|
|
void UpdateOverlay();
|
|
|
|
void setDataFromDisk(bool b);
|
2013-04-03 12:44:31 -04:00
|
|
|
void setRxRange(int fMin, int fMax);
|
2012-09-24 19:36:38 -04:00
|
|
|
void setBinsPerPixel(int n);
|
|
|
|
int binsPerPixel();
|
|
|
|
void setFQSO(int n, bool bf);
|
|
|
|
void setFcal(int n);
|
2012-05-22 13:09:48 -04:00
|
|
|
void DrawOverlay();
|
2012-09-24 19:36:38 -04:00
|
|
|
int fQSO();
|
2012-05-22 13:09:48 -04:00
|
|
|
void setPalette(QString palette);
|
2012-09-24 19:36:38 -04:00
|
|
|
void setFsample(int n);
|
2012-11-14 10:30:21 -05:00
|
|
|
void setNsps(int ntrperiod, int nsps);
|
2012-11-23 11:05:50 -05:00
|
|
|
void setTxFreq(int n);
|
2012-09-24 19:36:38 -04:00
|
|
|
double fGreen();
|
2012-09-29 21:03:18 -04:00
|
|
|
void SetPercent2DScreen(int percent){m_Percent2DScreen=percent;}
|
|
|
|
|
2012-05-22 13:09:48 -04:00
|
|
|
signals:
|
|
|
|
void freezeDecode0(int n);
|
|
|
|
void freezeDecode1(int n);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
//re-implemented widget event handlers
|
|
|
|
void paintEvent(QPaintEvent *event);
|
|
|
|
void resizeEvent(QResizeEvent* event);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2012-09-24 19:36:38 -04:00
|
|
|
void MakeFrequencyStrs();
|
|
|
|
void UTCstr();
|
|
|
|
int XfromFreq(float f);
|
|
|
|
float FreqfromX(int x);
|
2012-05-22 13:09:48 -04:00
|
|
|
qint64 RoundFreq(qint64 freq, int resolution);
|
|
|
|
|
|
|
|
QPixmap m_WaterfallPixmap;
|
|
|
|
QPixmap m_2DPixmap;
|
|
|
|
QPixmap m_ScalePixmap;
|
2012-09-29 21:03:18 -04:00
|
|
|
QPixmap m_OverlayPixmap;
|
|
|
|
// QPixmap m_LowerScalePixmap;
|
2012-05-22 13:09:48 -04:00
|
|
|
QSize m_Size;
|
|
|
|
QString m_Str;
|
|
|
|
QString m_HDivText[483];
|
|
|
|
bool m_Running;
|
|
|
|
bool m_paintEventBusy;
|
2012-09-24 19:36:38 -04:00
|
|
|
double m_fGreen;
|
2012-09-29 13:52:35 -04:00
|
|
|
double m_fftBinWidth;
|
2012-09-24 19:36:38 -04:00
|
|
|
qint64 m_StartFreq;
|
2012-05-22 13:09:48 -04:00
|
|
|
qint32 m_dBStepSize;
|
|
|
|
qint32 m_FreqUnits;
|
|
|
|
qint32 m_hdivs;
|
|
|
|
bool m_dataFromDisk;
|
2013-03-22 15:57:32 -04:00
|
|
|
char m_sutc[6];
|
2012-05-22 13:09:48 -04:00
|
|
|
qint32 m_line;
|
|
|
|
qint32 m_fSample;
|
|
|
|
qint32 m_i0;
|
|
|
|
qint32 m_xClick;
|
2012-09-29 13:09:05 -04:00
|
|
|
qint32 m_freqPerDiv;
|
|
|
|
qint32 m_nsps;
|
2012-09-29 21:03:18 -04:00
|
|
|
qint32 m_Percent2DScreen;
|
|
|
|
qint32 m_h;
|
|
|
|
qint32 m_h1;
|
|
|
|
qint32 m_h2;
|
2012-11-14 10:30:21 -05:00
|
|
|
qint32 m_TRperiod;
|
2012-11-23 11:05:50 -05:00
|
|
|
qint32 m_txFreq;
|
2013-04-03 12:44:31 -04:00
|
|
|
qint32 m_fMin;
|
|
|
|
qint32 m_fMax;
|
2012-05-22 13:09:48 -04:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void mousePressEvent(QMouseEvent *event);
|
|
|
|
void mouseDoubleClickEvent(QMouseEvent *event);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PLOTTER_H
|