Subversion Repositories Projects

Rev

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