Subversion Repositories Projects

Rev

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