1 | #ifndef EDD_H_SEEN
|
---|
2 | #define EDD_H_SEEN
|
---|
3 |
|
---|
4 | #include <string>
|
---|
5 |
|
---|
6 | #include <QtGui>
|
---|
7 | #include <QtNetwork/QTcpSocket>
|
---|
8 | #include <QtNetwork/QAbstractSocket>
|
---|
9 |
|
---|
10 | #include <qwt_plot.h>
|
---|
11 | #include <qwt_plot_curve.h>
|
---|
12 | #include <qwt_plot_grid.h>
|
---|
13 | #include <qwt_plot_zoomer.h>
|
---|
14 | #include <qwt_plot_magnifier.h>
|
---|
15 | #include <qwt_plot_panner.h>
|
---|
16 | #include <qwt_raster_data.h>
|
---|
17 | #include <qwt_scale_widget.h>
|
---|
18 | #include <qwt_plot_layout.h>
|
---|
19 | #include <qwt_legend.h>
|
---|
20 |
|
---|
21 | #define SOCKET_TIMEOUT 10000 // Milliseconds to wait for socket connection
|
---|
22 | #define MAX_OUTPUT_LINES 200 // Maximum number of lines in socket output window
|
---|
23 | #define MAX_COM_SIZE 30000
|
---|
24 | #define INITIAL_DIRECTORY ""
|
---|
25 |
|
---|
26 | #define NUM_SOCKETS 8
|
---|
27 | #define NUM_CHANNELS 36
|
---|
28 |
|
---|
29 | // Main window class
|
---|
30 | class fad : public QMainWindow {
|
---|
31 | Q_OBJECT
|
---|
32 |
|
---|
33 | QPushButton *Connect;
|
---|
34 | QLineEdit *IPAddress, *Command;
|
---|
35 | QSpinBox *Port , *Channel;
|
---|
36 | QPlainTextEdit *SocketOutput;
|
---|
37 | QTcpSocket *Socket[NUM_SOCKETS];
|
---|
38 | QWidget *SocketWindow, *Central;
|
---|
39 | QAction *ConnectAction;
|
---|
40 |
|
---|
41 | QGroupBox *DRSgroupBox;
|
---|
42 | QCheckBox *DRS[4];
|
---|
43 | QHBoxLayout *DRSBoxLayout;
|
---|
44 |
|
---|
45 | QGroupBox *ChannelgroupBox ;
|
---|
46 | QCheckBox *ChannelCheckBox[9] ;
|
---|
47 | QHBoxLayout *ChannelBoxLayout;
|
---|
48 |
|
---|
49 | QGridLayout *SocketLayout, *MainLayout;
|
---|
50 | QFormLayout *CommandLayout, *PortLayout, *AddressLayout , *ChannelLayout;
|
---|
51 |
|
---|
52 | QwtPlot *Graph;
|
---|
53 | QwtPlotZoomer *Zoomer;
|
---|
54 | QwtPlotMagnifier *Magnifier;
|
---|
55 | QwtPlotCurve *Signal[NUM_CHANNELS];
|
---|
56 | QwtPlotPanner *Panner;
|
---|
57 | QwtPlotGrid *Grid;
|
---|
58 |
|
---|
59 | void closeEvent(QCloseEvent *);
|
---|
60 |
|
---|
61 | QByteArray Data[NUM_SOCKETS];
|
---|
62 | bool ManualDisconnect;
|
---|
63 |
|
---|
64 | public:
|
---|
65 | fad();
|
---|
66 | ~fad();
|
---|
67 |
|
---|
68 | private slots:
|
---|
69 | void MakeConnection();
|
---|
70 | void SendToSocket();
|
---|
71 | void ReadFromSocket();
|
---|
72 | void GotDisconnected();
|
---|
73 | void HandleZoom(const QwtDoubleRect &);
|
---|
74 | void MenuSave();
|
---|
75 | void MenuPrint();
|
---|
76 | void MenuSaveASCII();
|
---|
77 | // converts AD9238 adc code to double
|
---|
78 | double ad9238ToDouble(unsigned short code);
|
---|
79 | double ad9238ToDouble(short code);
|
---|
80 | int ad9238ToInt(short code);
|
---|
81 | };
|
---|
82 |
|
---|
83 | #endif
|
---|