00001 00002 #include <qwidget.h> 00003 #include <qwt_plot.h> 00004 #include <qwt_math.h> 00005 #include <stdlib.h> 00006 00007 #define PLOT_SPECTRUM_SIZE 1000 00008 00009 class QPushButton; 00010 00011 class InputFrame : public QFrame 00012 { 00013 Q_OBJECT 00014 public: 00015 InputFrame(QWidget *p = 0, const char *name = 0); 00016 ~InputFrame() {} 00017 00018 signals: 00019 void zoomClicked(); 00020 void pointsClicked(); 00021 void printClicked(); 00022 00023 00024 private: 00025 QPushButton *btnZoom, *btnIndex, *btnPrint; 00026 00027 private slots: 00028 void zoom(); 00029 void points(); 00030 void print(); 00031 00032 }; 00033 00034 00035 class plotSpectrum : public QWidget 00036 { 00037 Q_OBJECT 00038 00039 public: 00040 plotSpectrum(QWidget *parent, const char *name); 00041 ~plotSpectrum() { delete plot; } 00042 00043 void resizeEvent(QResizeEvent *e); 00044 void setAxisFrequency(double max); 00045 void setScaleLog(bool scaleLog); 00046 00047 private: 00048 QwtPlot *plot; 00049 InputFrame *frmInp; 00050 int d_zoom,d_points,d_zoomActive; 00051 QPoint p1; 00052 long curva,cur; 00053 00054 long Curve; 00055 double lastSetFrequency; 00056 double x[PLOT_SPECTRUM_SIZE], y[PLOT_SPECTRUM_SIZE]; 00057 int tid; 00058 00059 protected: 00060 void timerEvent(QTimerEvent *e); 00061 00062 private slots: 00063 void plotMouseMoved(const QMouseEvent &e); 00064 void plotMouseReleased(const QMouseEvent &e); 00065 void plotMousePressed(const QMouseEvent &e); 00066 void zoom(); 00067 void points(); 00068 void print(); 00069 }; 00070