Subversion Repositories Projects

Rev

Rev 674 | 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 <QTcpServer>
-
 
24
//#include <QTcpSocket>
-
 
25
#include <QFile>
23
#include <QFile>
26
 
24
 
27
#include "ui_dlg_Main.h"
25
#include "ui_dlg_Main.h"
28
 
26
 
29
#include "../Defines.h"
27
#include "../Defines.h"
30
#include "../TypeDefs.h"
28
#include "../TypeDefs.h"
31
 
29
 
32
#include "../Classes/cSettings.h"
30
#include "../Classes/cSettings.h"
33
 
-
 
34
#include "../../Global/Kopter.h"
-
 
35
#include "../../Global/MK_Datatypes.h"
-
 
36
 
31
 
37
#include "../../Global/Class_QMapControl.h"
-
 
38
 
-
 
39
#include "../../Global/Class_Input/Input.h"
-
 
40
#include "../../Global/Class_Input/Input_TCP.h"
-
 
41
#include "../../Global/Class_Input/Input_TTY.h"
-
 
42
#include "../../Global/Class_HandlerIP/HandlerIP.h"
32
#include "../../Global/Class_QMapControl.h"
43
#include "../../Global/Class_HandlerMK/HandlerMK.h"
33
 
44
#include "../../Global/Class_HandlerKML/HandlerKML.h"
34
#include "../../Global/Class_HandlerKML/HandlerKML.h"
45
 
35
 
46
using namespace qmapcontrol;
36
using namespace qmapcontrol;
47
 
37
 
48
class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
38
class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
49
{
39
{
50
    Q_OBJECT
40
    Q_OBJECT
51
 
41
 
52
    public:
42
    public:
53
        dlg_Main();
43
        dlg_Main();
54
        ~dlg_Main();
44
        ~dlg_Main();
55
        void create_Map();
45
        void create_Map();
56
 
46
 
57
    private:
47
    private:
58
        // Input Device.
-
 
59
        Input *o_Input;
-
 
60
 
48
 
61
        // Info über die Hardware
49
        // Info über die Hardware
62
        s_Hardware VersionInfo;
50
        s_Hardware gs_Version;
63
 
51
 
64
        // Settings-Object
52
        // Settings-Object
65
        cSettings *o_Settings;
53
        cSettings *o_Settings;
66
 
54
 
67
        char c_Data[150];
55
        char c_Data[150];
68
 
56
 
69
        // Programm-Initialisirungen
57
        // Programm-Initialisirungen
70
        void init_GUI();
58
        void init_GUI();
71
        void init_Connections();
59
        void init_Connections();
72
 
60
 
73
        void init_Directorys();
61
        void init_Directorys();
74
        s_Directorys s_Dir;
62
        s_Directorys s_Dir;
75
 
-
 
76
        // Einkommende Datenpackete zerlegen.
-
 
77
        void parse_MK_Data(QString t_Data);
-
 
78
        void parse_IP_Data(QString t_Data);
-
 
79
 
63
 
80
        // QMK-Maps
64
        // QMK-Maps
81
        QFile *o_Record;
65
        QFile *o_Record;
82
 
66
 
83
        QPen* Pen[6];
67
        QPen* Pen[6];
84
 
68
 
85
        MapControl  *o_Map;
69
        MapControl  *o_Map;
86
        MapAdapter  *o_Adapter;
70
        MapAdapter  *o_Adapter;
87
 
71
 
88
        Layer       *o_Layer;
72
        Layer       *o_Layer;
89
        Layer       *o_Click;
73
        Layer       *o_Click;
90
 
74
 
91
        Layer       *o_Info;
75
        Layer       *o_Info;
92
        Layer       *o_RouteWP;
76
        Layer       *o_RouteWP;
93
        Layer       *o_RouteFL;
77
        Layer       *o_RouteFL;
94
 
78
 
95
        QList<Point*> p_RouteWP;
79
        QList<Point*> p_RouteWP;
96
        LineString*   l_RouteWP;
80
        LineString*   l_RouteWP;
97
 
81
 
98
        QList<Point*> p_RouteFL;
82
        QList<Point*> p_RouteFL;
99
        LineString*   l_RouteFL;
83
        LineString*   l_RouteFL;
100
 
84
 
101
        Point* LastPos;
85
        Point* LastPos;
102
        Point* LastClick;
86
        Point* LastClick;
103
        Point* ClickPoint;
87
        Point* ClickPoint;
104
        Point* Flag;
88
        Point* Flag;
105
        Point* Home;
89
        Point* Home;
106
        Point* Target;
90
        Point* Target;
107
 
91
 
108
        QPointF MapCenter;
92
        QPointF MapCenter;
109
 
93
 
110
        QList<sWayPoint> l_WayPoints;
94
        QList<sWayPoint> l_WayPoints;
111
        QList<sWayPoint> l_Track;
95
        QList<sWayPoint> l_Track;
112
 
96
 
113
        QList<sWayPoint> parse_WayPointKML(QString s_File);
97
        QList<sWayPoint> parse_WayPointKML(QString s_File);
114
        QList<sWayPoint> parse_WayPointMKW(QString s_File);
98
        QList<sWayPoint> parse_WayPointMKW(QString s_File);
115
 
99
 
116
        void show_WayPoints(QList<sWayPoint> WayPoints);
100
        void show_WayPoints(QList<sWayPoint> WayPoints);
117
 
101
 
118
        void save_WayPointsMKW(QString s_File);
102
        void save_WayPointsMKW(QString s_File);
119
 
103
 
120
        void add_Position(s_MK_NaviData t_NaviData);
104
        void add_Position(s_MK_NaviData t_NaviData);
121
        void show_Data(s_MK_NaviData t_NaviData);
105
//        void show_Data(s_MK_NaviData t_NaviData);
122
        void send_Target(Point *t_Target);
106
        void send_Target(Point *t_Target);
123
        void send_WayPoints(QList<sWayPoint> l_WayPoints, int t_Pos = 0);
107
        void send_WayPoints(QList<sWayPoint> l_WayPoints, int t_Pos = 0);
124
 
108
 
125
    private slots:
109
    private slots:
126
        void slot_ac_About();
110
        void slot_ac_About();
127
        void slot_ac_Toolbar();
111
        void slot_ac_Toolbar();
128
 
112
 
129
        void slot_ac_Connect();
113
        void slot_ConnectionStatus(int li_Status);
130
        void slot_sb_Intervall(int t_Intervall);
-
 
131
 
-
 
132
        // Einkommende Datenpackete.
114
        void slot_MK_Version(s_Hardware ls_Version);
133
        void slot_Input_Data(QString t_Data);
115
        void slot_MK_NaviData(s_MK_NaviData ps_MK_NaviData);
134
        void slot_Input_Disconnected(int Error);
-
 
135
        void slot_Input_Connected();
116
        void slot_MK_WayPoint(int pi_WayPointID);
136
 
117
 
137
        // QMK-Maps
118
        // QMK-Maps
138
        void slot_Zoom(int t_Zoom);
119
        void slot_Zoom(int t_Zoom);
139
        void slot_ChangeMap(int);
120
        void slot_ChangeMap(int);
140
        void slot_Click(const QMouseEvent*, const QPointF);
121
        void slot_Click(const QMouseEvent*, const QPointF);
141
 
122
 
142
        void slot_btn_WPAdd();
123
        void slot_btn_WPAdd();
143
        void slot_btn_WPFly();
124
        void slot_btn_WPFly();
144
        void slot_btn_WPDelete();
125
        void slot_btn_WPDelete();
145
        void slot_ShowWayPoints(bool);
126
        void slot_ShowWayPoints(bool);
146
 
127
 
147
        void slot_ac_RouteDelete();
128
        void slot_ac_RouteDelete();
148
 
129
 
149
        void slot_ac_LoadMapPic();
130
        void slot_ac_LoadMapPic();
150
        void slot_ac_Record();
131
        void slot_ac_Record();
151
 
-
 
152
//    void slot_GotoTarget();
-
 
153
//    void slot_Close();
-
 
154
 
132
 
155
        void slot_ac_LoadWayPoints();
133
        void slot_ac_LoadWayPoints();
156
        void slot_ac_SaveRoute();
134
        void slot_ac_SaveRoute();
157
 
135
 
158
    protected:
136
    protected:
159
        virtual void wheelEvent(QWheelEvent *event);
137
        virtual void wheelEvent(QWheelEvent *event);
160
        virtual void resizeEvent ( QResizeEvent * event );
138
        virtual void resizeEvent ( QResizeEvent * event );
161
 
139
 
162
};
140
};
163
 
141
 
164
#endif // DLG_MAIN_H
142
#endif // DLG_MAIN_H
165
 
143