Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
801 - 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 <QTcpServer>
24
#include <QTcpSocket>
25
#include <QProcess>
26
#include <QDir>
27
 
28
#include "ui_dlg_Main.h"
29
 
30
#include "dlg_Preferences.h"
31
#include "dlg_Terminal.h"
32
 
33
#include "../Defines.h"
34
#include "../TypeDefs.h"
35
 
36
#include "../Classes/cSettings.h"
37
 
38
#include "../../Global/Kopter.h"
39
#include "../../Global/Class_Input/Input.h"
40
#include "../../Global/Class_Input/Input_TTY.h"
41
#include "../../Global/Class_HandlerMK/HandlerMK.h"
42
#include "../../Global/Class_HandlerIP/HandlerIP.h"
43
#include "../../Global/Class_SerialPort/ManageSerialPort.h"
44
 
45
class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
46
{
47
    Q_OBJECT
48
 
49
    public:
50
        dlg_Main();
51
        ~dlg_Main();
52
        void set_ARGV(char *Programm);
53
 
54
    private:
55
        QString QMK_Dir;
56
 
57
        // Input Device.
58
        Input *o_Input;
59
        set_Input s_Input;
60
 
61
        // Settings-Object
62
        cSettings *o_Settings;
63
 
64
        dlg_Terminal *f_Terminal;
65
 
66
        QProcess *o_cScope;
67
        QProcess *o_cSettings;
68
        QProcess *o_cMaps;
69
        QProcess *o_cVoice;
70
        QProcess *o_cLogger;
71
 
72
        // TCP Server und Socket.
73
        QTcpServer *TCP_Server;
74
        QTcpSocket *o_TCP[DEV_IP_MAX];
75
 
76
        //Liste alle IP-Verbindungen und deren Parameter.
77
        int Connect_Count;
78
        sConnection Connection[DEV_IP_MAX];
79
 
80
        QListWidgetItem *Item[DEV_IP_MAX][2];
81
 
82
        s_Hardware VersionInfo;
83
 
84
        char c_Data[150];
85
 
86
        // Programm-Initialisirungen
87
        void init_GUI();
88
        void init_Connections();
89
 
90
        // IP-Ports initialisieren
91
        bool init_TCP();
92
 
93
        // Einkommende Datenpackete zerlegen.
94
        void parse_Input_Data(QString t_Data);
95
 
96
        // Einkommende Datenpackete weiterleiten
97
        void route_Input_Data(QString t_Data);
98
 
99
        void parse_TCP_Data(QString t_Data, int t_ID);
100
 
101
        // Freies IP-Socket ermitteln
102
        int get_FreeSocket();
103
 
104
        // Daten aufs IP-Interface senden.
105
        void send_TCP(QTcpSocket *Socket, QString Data);
106
 
107
        void show_Terminal(int t_Typ, QString t_Data);
108
 
109
    private slots:
110
        void slot_ac_About();
111
        void slot_ac_Server();
112
 
113
        // Connect-Button
114
        void slot_btn_Connect();
115
 
116
        void slot_btn_cScope();
117
        void slot_btn_cSettings();
118
        void slot_btn_cMaps();
119
        void slot_btn_cVoice();
120
        void slot_btn_cLogger();
121
 
122
        void slot_btn_Terminal();
123
 
124
        // Einkommende Datenpackete.
125
        void slot_Input_Data(QString t_Data);
126
 
127
        void slot_TCP_NewConnection();
128
        void slot_TCP_Disconnect();
129
        void slot_TCP_Read();
130
};
131
 
132
#endif // DLG_MAIN_H