Subversion Repositories Projects

Rev

Rev 750 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
674 KeyOz 1
/***************************************************************************
2
 *   Copyright (C) 2009 by Manuel Schrape                                  *
3
 *   manuel.schrape@gmx.de                                                 *
4
 *                                                                         *
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  *
7
 *   the Free Software Foundation; either version 2 of the License.        *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
19
#ifndef DLG_MAIN_H
20
#define DLG_MAIN_H
21
 
22
#include <QtGui/QMainWindow>
23
#include <QtGui/QLineEdit>
24
#include <QtGui/QCheckBox>
25
#include <QtGui/QLabel>
26
#include <QtGui/QFont>
27
 
28
#include <QTcpServer>
29
#include <QTcpSocket>
30
 
31
 
32
#include <qwt_plot_curve.h>
33
#include <qwt_plot_grid.h>
34
#include <qwt_legend.h>
35
#include <qwt_plot.h>
36
 
37
#include "ui_dlg_Main.h"
38
 
39
#include "../Defines.h"
40
#include "../TypeDefs.h"
41
 
42
#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
 
51
class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
52
{
53
    Q_OBJECT
54
 
55
    public:
56
        dlg_Main();
57
        ~dlg_Main();
58
 
59
    private:
60
        // Input Device.
61
        Input *o_Input;
62
 
63
        // Settings-Object
64
        cSettings *o_Settings;
65
 
66
        QLabel    *lb_Debug[MAX_DebugData];
67
        QLineEdit *le_Debug[MAX_DebugData];
68
        QCheckBox *cb_Debug[MAX_DebugData];
69
        QFont      Font_1;
70
 
71
        // Info über die Hardware
72
        s_Hardware VersionInfo;
73
 
74
        // Datenspeicher zum Senden.
75
        char c_Data[150];
76
 
77
        bool get_Analoglabels;
78
 
79
        int Debug_Data[MAX_DebugData];
80
 
81
        // Plots für die Analogwerte
82
        QwtPlotCurve *Plot[MAX_DebugData];
83
 
84
        // Datenspeicher für die Plots
85
        double pl_Data[MAX_DebugData][50000];
86
        double pl_ID[50000];
87
        int NextPlot;
88
 
89
        // Programm-Initialisirungen
90
        void init_GUI();
91
        void init_Connections();
92
        void init_Plotter();
93
 
94
        void update_Plotter();
95
        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
 
101
    private slots:
102
        void slot_ac_About();
103
 
104
        void slot_ac_Connect();
105
 
106
        void slot_ac_Plotter();
107
        void slot_ac_Debug();
108
        void slot_ac_Chose();
109
 
110
        void slot_ac_ReadLabels();
111
 
112
        void slot_btn_ChoseOK();
113
 
114
        void slot_rb_Hardware();
115
 
116
        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();
126
};
127
 
128
#endif // DLG_MAIN_H