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 | #include <qwt_symbol.h>
|
---|
18 |
|
---|
19 | #include <limits.h>
|
---|
20 | #include <float.h>
|
---|
21 |
|
---|
22 | #include "dic.hxx"
|
---|
23 | #include "Evidence.h"
|
---|
24 |
|
---|
25 | #define SVN_REVISION "$Revision: 159 $"
|
---|
26 |
|
---|
27 | // General indicator for DIM service
|
---|
28 | class Edd_Indicator: public QLineEdit, public DimClient {
|
---|
29 | Q_OBJECT
|
---|
30 |
|
---|
31 | QMenu *Menu;
|
---|
32 | QPoint dragStart;
|
---|
33 | QwtPlot *LastPlot;
|
---|
34 |
|
---|
35 | DimStampedInfo *Data;
|
---|
36 |
|
---|
37 | void mousePressEvent(QMouseEvent *);
|
---|
38 | void mouseReleaseEvent(QMouseEvent *);
|
---|
39 | void mouseMoveEvent(QMouseEvent *);
|
---|
40 |
|
---|
41 | public:
|
---|
42 | Edd_Indicator(QString, QWidget * = NULL);
|
---|
43 | ~Edd_Indicator();
|
---|
44 |
|
---|
45 | bool ShowAsTime;
|
---|
46 |
|
---|
47 | private slots:
|
---|
48 | void Update(DimInfo *, int, QByteArray, QString);
|
---|
49 | void contextMenuEvent(QContextMenuEvent *);
|
---|
50 | void MenuOpenHistory();
|
---|
51 | void MenuCopyService();
|
---|
52 | void MenuCopyData();
|
---|
53 | };
|
---|
54 |
|
---|
55 | // Graph class for history display
|
---|
56 | class Edd_Plot: public QwtPlot, public EvidenceHistory {
|
---|
57 | Q_OBJECT
|
---|
58 |
|
---|
59 | struct PlotItem {
|
---|
60 | DimInfo *LiveData;
|
---|
61 | QwtPlotCurve *Signal;
|
---|
62 | double Smallest;
|
---|
63 | double Largest;
|
---|
64 | int SizeLimit;
|
---|
65 | QVector<double> x;
|
---|
66 | QVector<double> y;
|
---|
67 | };
|
---|
68 |
|
---|
69 | QList<struct PlotItem> Items;
|
---|
70 | QMutex Mutex;
|
---|
71 |
|
---|
72 | QString StatusTip;
|
---|
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 dragEnterEvent(QDragEnterEvent *);
|
---|
85 | void dropEvent(QDropEvent *);
|
---|
86 |
|
---|
87 | public:
|
---|
88 | Edd_Plot(QString = QString(), QWidget * = NULL);
|
---|
89 | ~Edd_Plot();
|
---|
90 | void AddService(QString);
|
---|
91 |
|
---|
92 | private slots:
|
---|
93 | void UpdatePlot();
|
---|
94 | void Update(DimInfo* Info, int, QByteArray, QString);
|
---|
95 |
|
---|
96 | void HandleZoom(const QwtDoubleRect &);
|
---|
97 | void contextMenuEvent(QContextMenuEvent *);
|
---|
98 | void LegendClicked(QwtPlotItem *);
|
---|
99 | void MenuZoomOut();
|
---|
100 | void MenuSingleTrace();
|
---|
101 | void MenuSaveASCII();
|
---|
102 | void MenuSave();
|
---|
103 | void MenuPrint();
|
---|
104 | void MenuPasteService();
|
---|
105 | };
|
---|
106 |
|
---|
107 | // Text history class
|
---|
108 | class Edd_TextHist: public QTextEdit, public EvidenceHistory {
|
---|
109 | Q_OBJECT
|
---|
110 |
|
---|
111 | QString StatusTip;
|
---|
112 | DimStampedInfo *Service;
|
---|
113 |
|
---|
114 | public:
|
---|
115 | Edd_TextHist(QString, QWidget * = NULL);
|
---|
116 | ~Edd_TextHist();
|
---|
117 |
|
---|
118 | private slots:
|
---|
119 | void Update(DimInfo* Info, int, QByteArray, QString);
|
---|
120 | };
|
---|
121 |
|
---|
122 | // Textout indicator for DIM service
|
---|
123 | class Edd_Textout: public QTextEdit, public EvidenceHistory {
|
---|
124 | Q_OBJECT
|
---|
125 |
|
---|
126 | DimStampedInfo *Data;
|
---|
127 |
|
---|
128 | public:
|
---|
129 | Edd_Textout(QString, QWidget * = NULL);
|
---|
130 | ~Edd_Textout();
|
---|
131 |
|
---|
132 | bool Accumulate;
|
---|
133 |
|
---|
134 | private slots:
|
---|
135 | void Update(DimInfo* Info, int, QByteArray, QString);
|
---|
136 | };
|
---|
137 |
|
---|
138 | // Main window class
|
---|
139 | class GUI: public QMainWindow, public DimBrowser, public DimInfo {
|
---|
140 | Q_OBJECT
|
---|
141 |
|
---|
142 | QwtAnalogClock *Clock;
|
---|
143 |
|
---|
144 | QWidget *Central, *MainWidget, *BiasWidget, *EnvironmentWidget;
|
---|
145 | QGridLayout *MainLayout, *BiasLayout, *EnvironmentLayout;
|
---|
146 |
|
---|
147 | QTabWidget *TabWidget;
|
---|
148 |
|
---|
149 | void closeEvent(QCloseEvent *);
|
---|
150 | void infoHandler();
|
---|
151 |
|
---|
152 | public:
|
---|
153 | GUI();
|
---|
154 | ~GUI();
|
---|
155 |
|
---|
156 | private slots:
|
---|
157 | void MenuAbout();
|
---|
158 | void MenuNewHistory();
|
---|
159 | void StartDIMBrowser();
|
---|
160 |
|
---|
161 | signals:
|
---|
162 | void YEP(DimInfo *, int, QByteArray = QByteArray(), QString = QString());
|
---|
163 | };
|
---|
164 |
|
---|
165 | #endif
|
---|