1 | #ifndef EDD_H_SEEN |
---|
2 | #define EDD_H_SEEN |
---|
3 | |
---|
4 | #include <QtGui> |
---|
5 | |
---|
6 | #include <qwt_plot.h> |
---|
7 | #include <qwt_plot_curve.h> |
---|
8 | #include <qwt_plot_grid.h> |
---|
9 | #include <qwt_plot_zoomer.h> |
---|
10 | #include <qwt_plot_panner.h> |
---|
11 | #include <qwt_scale_engine.h> |
---|
12 | #include <qwt_analog_clock.h> |
---|
13 | #include <qwt_scale_widget.h> |
---|
14 | #include <qwt_plot_layout.h> |
---|
15 | #include <qwt_legend.h> |
---|
16 | #include <qwt_legend_item.h> |
---|
17 | |
---|
18 | #include <limits.h> |
---|
19 | #include <float.h> |
---|
20 | |
---|
21 | #include "dic.hxx" |
---|
22 | #include "Evidence.h" |
---|
23 | |
---|
24 | #define NO_LINK "__&DIM&NOLINK&__" // for checking if DIMserver is alive |
---|
25 | #define SVN_REVISION "$Revision: 139 $" |
---|
26 | |
---|
27 | // General indicator for DIM service |
---|
28 | class Edd_Indicator: public QLineEdit, public DimClient, public DimBrowser { |
---|
29 | Q_OBJECT |
---|
30 | |
---|
31 | char *ServiceName; |
---|
32 | DimStampedInfo *Data; |
---|
33 | |
---|
34 | QMenu *Menu; |
---|
35 | QPoint dragStart; |
---|
36 | QwtPlot *LastPlot; |
---|
37 | |
---|
38 | void infoHandler(); |
---|
39 | void mousePressEvent(QMouseEvent *); |
---|
40 | void mouseReleaseEvent(QMouseEvent *); |
---|
41 | void mouseMoveEvent(QMouseEvent *); |
---|
42 | |
---|
43 | public: |
---|
44 | Edd_Indicator(QString, QWidget * = NULL); |
---|
45 | ~Edd_Indicator(); |
---|
46 | |
---|
47 | private slots: |
---|
48 | void contextMenuEvent(QContextMenuEvent *); |
---|
49 | void MenuCopyService(); |
---|
50 | |
---|
51 | signals: |
---|
52 | void YEP(QString); |
---|
53 | }; |
---|
54 | |
---|
55 | // Graph class for history display |
---|
56 | class Edd_Plot: public QwtPlot, public DimClient { |
---|
57 | Q_OBJECT |
---|
58 | |
---|
59 | struct PlotItem { |
---|
60 | DimInfo *Data; |
---|
61 | DimInfo *LiveData; |
---|
62 | QwtPlotCurve *Signal; |
---|
63 | int *x; |
---|
64 | double *y; |
---|
65 | int Count; |
---|
66 | double Smallest; |
---|
67 | double Largest; |
---|
68 | QList<struct EvidenceHistoryItem> Live; |
---|
69 | }; |
---|
70 | |
---|
71 | QList<struct PlotItem> Items; |
---|
72 | QMutex Mutex; |
---|
73 | |
---|
74 | QMenu *Menu; |
---|
75 | QAction *YLogAction; |
---|
76 | QAction *NormAction; |
---|
77 | QAction *StyleAction; |
---|
78 | |
---|
79 | QwtPlotPanner *Panner; |
---|
80 | QwtPlotGrid *Grid; |
---|
81 | QwtPlotZoomer *Zoomer; |
---|
82 | QwtLegend *Legend; |
---|
83 | |
---|
84 | void infoHandler(); |
---|
85 | void dragEnterEvent(QDragEnterEvent *); |
---|
86 | void dropEvent(QDropEvent *); |
---|
87 | |
---|
88 | public: |
---|
89 | Edd_Plot(QString = QString(), QWidget * = NULL); |
---|
90 | ~Edd_Plot(); |
---|
91 | void AddService(QString); |
---|
92 | |
---|
93 | private slots: |
---|
94 | void UpdatePlot(); |
---|
95 | void HandleZoom(const QwtDoubleRect &); |
---|
96 | void contextMenuEvent(QContextMenuEvent *); |
---|
97 | void MenuZoomOut(); |
---|
98 | void MenuSingleTrace(); |
---|
99 | void MenuSaveASCII(); |
---|
100 | void MenuSave(); |
---|
101 | void MenuPrint(); |
---|
102 | void MenuPasteService(); |
---|
103 | |
---|
104 | signals: |
---|
105 | void YEP(); |
---|
106 | |
---|
107 | }; |
---|
108 | |
---|
109 | // Main window class |
---|
110 | class GUI: public QMainWindow, public DimBrowser { |
---|
111 | Q_OBJECT |
---|
112 | |
---|
113 | QwtAnalogClock *Clock; |
---|
114 | |
---|
115 | QWidget *Central, *MainWidget, *BiasWidget, *EnvironmentWidget; |
---|
116 | QGridLayout *MainLayout, *BiasLayout, *EnvironmentLayout; |
---|
117 | |
---|
118 | QTabWidget *TabWidget; |
---|
119 | |
---|
120 | void closeEvent(QCloseEvent *); |
---|
121 | |
---|
122 | public: |
---|
123 | GUI(); |
---|
124 | ~GUI(); |
---|
125 | |
---|
126 | private slots: |
---|
127 | void MenuAbout(); |
---|
128 | void MenuNewHistory(); |
---|
129 | }; |
---|
130 | |
---|
131 | #endif |
---|