Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
750 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 WGT_CONNECTION_H
20
#define WGT_CONNECTION_H
21
 
22
#include <QWidget>
23
#include <QTimer>
24
 
25
#include "ui_wgt_Connection.h"
26
 
27
#include "../../Global/Kopter.h"
28
#include "../../Global/Class_HandlerIP/HandlerIP.h"
29
#include "../../Global/Class_HandlerMK/HandlerMK.h"
30
#include "../../Global/Class_Input/Input.h"
31
#include "../../Global/Class_Input/Input_TCP.h"
32
#include "../../Global/Class_Input/Input_TTY.h"
33
 
34
struct set_SERVER
35
{
36
    int IP_MAX;
37
    int IP_ID;
38
    int Intervall;
39
    QString IP[10];
40
    QString Password;
41
};
42
 
43
class wgt_Connection : public QWidget, public Ui::wgt_Connection_ui
44
{
45
    Q_OBJECT
46
 
47
    public:
48
        wgt_Connection(QWidget *parent = 0);
49
        ~wgt_Connection();
50
 
51
        void send_Data(QString ps_Data, int pi_ID = 0);
52
 
53
        void set_Client(int li_ID, QString ls_Client, QString ls_Fields);
54
        void set_ButtonVisible(bool pi_Visible);
55
        void set_SelectVisible(bool pi_Visible);
56
        void set_IntervalVisible(bool pi_Visible);
57
        Input *o_Input;
58
 
59
    private:
60
 
61
        QTimer *o_AboTimer;
62
 
63
        // Verbindungs-Objekt
64
        char c_Data[200];
65
 
66
        bool gi_Interval[2];
67
 
68
        // Info ├╝ber die Hardware
69
        s_Hardware VersionInfo;
70
 
71
 
72
        QString gs_Client;
73
        QString gs_Fields;
74
//        char gs_Interval;
75
        int gi_ID;
76
 
77
        set_SERVER    SERVER;
78
 
79
        void read_Settings();
80
        void write_Settings();
81
 
82
        void parse_IP_Data(QString t_Data);
83
        void parse_MK_Data(QString t_Data);
84
 
85
    public slots:
86
        void slot_btn_Connect();
87
        void slot_send_Data(QString ps_Data, int pi_ID = 0);
88
 
89
    private slots:
90
        void slot_sb_Intervall(int t_Intervall);
91
 
92
        void slot_Input_Data(QString t_Data);
93
        void slot_Input_Connected();
94
        void slot_Input_Disconnected(int Error);
95
 
96
        void slot_TimeOut_AboTimer();
97
 
98
    signals:
99
        void sig_Status(int);
100
        void sig_RawData(QString);
101
        void sig_MK_Version(s_Hardware);
102
        void sig_MK_Debug(s_MK_Debug);
103
        void sig_MK_DebugLabels(s_MK_DebugLabels);
104
        void sig_MK_NaviData(s_MK_NaviData);
105
        void sig_MK_WayPoint(int);
106
        void sig_MK_ReadSettings(s_MK_Settings);
107
        void sig_MK_WriteSettings(int);
108
        void sig_MK_ReadMotorMixer(s_MK_Mixer);
109
        void sig_MK_WriteMotorMixer(int);
110
        void sig_MK_PPMData(s_MK_PPM_Data);
111
 
112
};
113
 
114
#endif // WGT_CONNECTION_H