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: 152 $"
|
---|
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, QString, QByteArray, QString);
|
---|
49 | void contextMenuEvent(QContextMenuEvent *);
|
---|
50 | void MenuOpenHistory();
|
---|
51 | void MenuCopyService();
|
---|
52 | };
|
---|
53 |
|
---|
54 | // Graph class for history display
|
---|
55 | class Edd_Plot: public QwtPlot, public DimClient {
|
---|
56 | Q_OBJECT
|
---|
57 |
|
---|
58 | struct PlotItem {
|
---|
59 | DimInfo *Data;
|
---|
60 | DimInfo *LiveData;
|
---|
61 | QwtPlotCurve *Signal;
|
---|
62 | int *x;
|
---|
63 | double *y;
|
---|
64 | int Count;
|
---|
65 | double Smallest;
|
---|
66 | double Largest;
|
---|
67 | QList<struct EvidenceHistoryItem> Live;
|
---|
68 | };
|
---|
69 |
|
---|
70 | QList<struct PlotItem> Items;
|
---|
71 | QMutex Mutex;
|
---|
72 |
|
---|
73 | QString StatusTip;
|
---|
74 |
|
---|
75 | QMenu *Menu;
|
---|
76 | QAction *YLogAction;
|
---|
77 | QAction *NormAction;
|
---|
78 | QAction *StyleAction;
|
---|
79 |
|
---|
80 | QwtPlotPanner *Panner;
|
---|
81 | QwtPlotGrid *Grid;
|
---|
82 | QwtPlotZoomer *Zoomer;
|
---|
83 | QwtLegend *Legend;
|
---|
84 |
|
---|
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 Update(DimInfo* Info, int, QString, QByteArray, QString);
|
---|
96 |
|
---|
97 | void HandleZoom(const QwtDoubleRect &);
|
---|
98 | void contextMenuEvent(QContextMenuEvent *);
|
---|
99 | void LegendClicked(QwtPlotItem *);
|
---|
100 | void MenuZoomOut();
|
---|
101 | void MenuSingleTrace();
|
---|
102 | void MenuSaveASCII();
|
---|
103 | void MenuSave();
|
---|
104 | void MenuPrint();
|
---|
105 | void MenuPasteService();
|
---|
106 | };
|
---|
107 |
|
---|
108 | // Textout indicator for DIM service
|
---|
109 | class Edd_Textout: public QTextEdit, public DimClient {
|
---|
110 | Q_OBJECT
|
---|
111 |
|
---|
112 | DimStampedInfo *Data;
|
---|
113 |
|
---|
114 | public:
|
---|
115 | Edd_Textout(QString, QWidget * = NULL);
|
---|
116 | ~Edd_Textout();
|
---|
117 |
|
---|
118 | bool Accumulate;
|
---|
119 |
|
---|
120 | private slots:
|
---|
121 | void Update(DimInfo* Info, int, QString, QByteArray, QString);
|
---|
122 | };
|
---|
123 |
|
---|
124 | // Main window class
|
---|
125 | class GUI: public QMainWindow, public DimBrowser, public DimInfo {
|
---|
126 | Q_OBJECT
|
---|
127 |
|
---|
128 | QwtAnalogClock *Clock;
|
---|
129 |
|
---|
130 | QWidget *Central, *MainWidget, *BiasWidget, *EnvironmentWidget;
|
---|
131 | QGridLayout *MainLayout, *BiasLayout, *EnvironmentLayout;
|
---|
132 |
|
---|
133 | QTabWidget *TabWidget;
|
---|
134 |
|
---|
135 | void closeEvent(QCloseEvent *);
|
---|
136 | void infoHandler();
|
---|
137 |
|
---|
138 | public:
|
---|
139 | GUI();
|
---|
140 | ~GUI();
|
---|
141 |
|
---|
142 | private slots:
|
---|
143 | void MenuAbout();
|
---|
144 | void MenuNewHistory();
|
---|
145 |
|
---|
146 | signals:
|
---|
147 | void YEP(DimInfo *, int, QString = QString(), QByteArray = QByteArray(), QString = QString());
|
---|
148 | };
|
---|
149 |
|
---|
150 | #endif
|
---|