Rev 674 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 674 | Rev 750 | ||
---|---|---|---|
1 | /*************************************************************************** |
1 | /*************************************************************************** |
2 | * Copyright (C) 2009 by Manuel Schrape * |
2 | * Copyright (C) 2009 by Manuel Schrape * |
3 | * manuel.schrape@gmx.de * |
3 | * manuel.schrape@gmx.de * |
4 | * * |
4 | * * |
5 | * This program is free software; you can redistribute it and/or modify * |
5 | * This program is free software; you can redistribute it and/or modify * |
6 | * it under the terms of the GNU General Public License as published by * |
6 | * it under the terms of the GNU General Public License as published by * |
7 | * the Free Software Foundation; either version 2 of the License. * |
7 | * the Free Software Foundation; either version 2 of the License. * |
8 | * * |
8 | * * |
9 | * This program is distributed in the hope that it will be useful, * |
9 | * This program is distributed in the hope that it will be useful, * |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
12 | * GNU General Public License for more details. * |
12 | * GNU General Public License for more details. * |
13 | * * |
13 | * * |
14 | * You should have received a copy of the GNU General Public License * |
14 | * You should have received a copy of the GNU General Public License * |
15 | * along with this program; if not, write to the * |
15 | * along with this program; if not, write to the * |
16 | * Free Software Foundation, Inc., * |
16 | * Free Software Foundation, Inc., * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
18 | ***************************************************************************/ |
18 | ***************************************************************************/ |
19 | #ifndef DLG_MAIN_H |
19 | #ifndef DLG_MAIN_H |
20 | #define DLG_MAIN_H |
20 | #define DLG_MAIN_H |
21 | 21 | ||
22 | #include <QtGui/QMainWindow> |
22 | #include <QtGui/QMainWindow> |
23 | #include <QtGui/QLineEdit> |
23 | #include <QtGui/QLineEdit> |
24 | #include <QtGui/QCheckBox> |
24 | #include <QtGui/QCheckBox> |
25 | #include <QtGui/QLabel> |
25 | #include <QtGui/QLabel> |
26 | #include <QtGui/QFont> |
26 | #include <QtGui/QFont> |
27 | 27 | ||
28 | #include <QTcpServer> |
28 | #include <QTcpServer> |
29 | #include <QTcpSocket> |
29 | #include <QTcpSocket> |
30 | - | ||
31 | 30 | ||
32 | #include <qwt_plot_curve.h> |
31 | #include <qwt_plot_curve.h> |
33 | #include <qwt_plot_grid.h> |
32 | #include <qwt_plot_grid.h> |
34 | #include <qwt_legend.h> |
33 | #include <qwt_legend.h> |
35 | #include <qwt_plot.h> |
34 | #include <qwt_plot.h> |
36 | 35 | ||
37 | #include "ui_dlg_Main.h" |
36 | #include "ui_dlg_Main.h" |
38 | 37 | ||
39 | #include "../Defines.h" |
38 | #include "../Defines.h" |
40 | #include "../TypeDefs.h" |
39 | #include "../TypeDefs.h" |
41 | 40 | ||
42 | #include "../Classes/cSettings.h" |
41 | #include "../Classes/cSettings.h" |
43 | - | ||
44 | #include "../../Global/Kopter.h" |
- | |
45 | #include "../../Global/Class_Input/Input.h" |
- | |
46 | #include "../../Global/Class_Input/Input_TCP.h" |
- | |
47 | #include "../../Global/Class_Input/Input_TTY.h" |
- | |
48 | #include "../../Global/Class_HandlerIP/HandlerIP.h" |
- | |
49 | #include "../../Global/Class_HandlerMK/HandlerMK.h" |
- | |
50 | 42 | ||
51 | class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI |
43 | class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI |
52 | { |
44 | { |
53 | Q_OBJECT |
45 | Q_OBJECT |
54 | 46 | ||
55 | public: |
47 | public: |
56 | dlg_Main(); |
48 | dlg_Main(); |
57 | ~dlg_Main(); |
49 | ~dlg_Main(); |
58 | 50 | ||
59 | private: |
51 | private: |
60 | // Input Device. |
- | |
61 | Input *o_Input; |
- | |
62 | - | ||
63 | // Settings-Object |
52 | // Settings-Object |
64 | cSettings *o_Settings; |
53 | cSettings *o_Settings; |
65 | 54 | ||
66 | QLabel *lb_Debug[MAX_DebugData]; |
55 | QLabel *lb_Debug[MAX_DebugData]; |
67 | QLineEdit *le_Debug[MAX_DebugData]; |
56 | QLineEdit *le_Debug[MAX_DebugData]; |
68 | QCheckBox *cb_Debug[MAX_DebugData]; |
57 | QCheckBox *cb_Debug[MAX_DebugData]; |
69 | QFont Font_1; |
58 | QFont Font_1; |
70 | 59 | ||
71 | // Info über die Hardware |
60 | // Info über die Hardware |
72 | s_Hardware VersionInfo; |
61 | s_Hardware gs_Version; |
73 | 62 | ||
74 | // Datenspeicher zum Senden. |
63 | // Datenspeicher zum Senden. |
75 | char c_Data[150]; |
64 | char c_Data[150]; |
76 | 65 | ||
77 | bool get_Analoglabels; |
66 | s_MK_Debug gs_Debug; |
78 | 67 | ||
79 | int Debug_Data[MAX_DebugData]; |
68 | int Debug_Data[MAX_DebugData]; |
80 | 69 | ||
81 | // Plots für die Analogwerte |
70 | // Plots für die Analogwerte |
82 | QwtPlotCurve *Plot[MAX_DebugData]; |
71 | QwtPlotCurve *Plot[MAX_DebugData]; |
83 | 72 | ||
84 | // Datenspeicher für die Plots |
73 | // Datenspeicher für die Plots |
85 | double pl_Data[MAX_DebugData][50000]; |
74 | double pl_Data[MAX_DebugData][50000]; |
86 | double pl_ID[50000]; |
75 | double pl_ID[50000]; |
87 | int NextPlot; |
76 | int NextPlot; |
88 | 77 | ||
89 | // Programm-Initialisirungen |
78 | // Programm-Initialisirungen |
90 | void init_GUI(); |
79 | void init_GUI(); |
91 | void init_Connections(); |
80 | void init_Connections(); |
92 | void init_Plotter(); |
81 | void init_Plotter(); |
93 | 82 | ||
94 | void update_Plotter(); |
83 | void update_Plotter(); |
95 | void config_Plotter(); |
84 | void config_Plotter(); |
96 | - | ||
97 | // Einkommende Datenpackete zerlegen. |
- | |
98 | void parse_MK_Data(QString t_Data); |
- | |
99 | void parse_IP_Data(QString t_Data); |
- | |
100 | 85 | ||
101 | private slots: |
86 | private slots: |
102 | void slot_ac_About(); |
87 | void slot_ac_About(); |
103 | 88 | ||
- | 89 | void slot_ConnectionStatus(int li_Status); |
|
- | 90 | void slot_MK_Version(s_Hardware ls_Version); |
|
- | 91 | void slot_MK_Debug(s_MK_Debug ls_Debug); |
|
104 | void slot_ac_Connect(); |
92 | void slot_MK_DebugLabels(s_MK_DebugLabels MK_DebugLabels); |
105 | 93 | ||
106 | void slot_ac_Plotter(); |
94 | void slot_ac_Plotter(); |
107 | void slot_ac_Debug(); |
95 | void slot_ac_Debug(); |
108 | void slot_ac_Chose(); |
96 | void slot_ac_Chose(); |
109 | 97 | ||
110 | void slot_ac_ReadLabels(); |
98 | void slot_ac_ReadLabels(); |
111 | 99 | ||
112 | void slot_btn_ChoseOK(); |
100 | void slot_btn_ChoseOK(); |
113 | - | ||
114 | void slot_rb_Hardware(); |
- | |
115 | 101 | ||
116 | void slot_Plotter_Start(); |
102 | void slot_Plotter_Start(); |
117 | void slot_Plotter_Scroll(int Position); |
- | |
118 | - | ||
119 | void slot_sb_Intervall(int t_Intervall); |
- | |
120 | - | ||
121 | // Einkommende Datenpackete. |
- | |
122 | void slot_Input_Data(QString t_Data); |
- | |
123 | - | ||
124 | void slot_Input_Disconnected(int Error); |
- | |
125 | void slot_Input_Connected(); |
103 | void slot_Plotter_Scroll(int Position); |
126 | }; |
104 | }; |
127 | 105 | ||
128 | #endif // DLG_MAIN_H |
106 | #endif // DLG_MAIN_H |
129 | 107 |