Subversion Repositories Projects

Rev

Blame | Last modification | View Log | RSS feed

/***************************************************************************
 *   Copyright (C) 2009 by Manuel Schrape                                  *
 *   manuel.schrape@gmx.de                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License.        *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef DLG_MAIN_H
#define DLG_MAIN_H

#include <QtGui/QMainWindow>
#include <QFile>

#include "ui_dlg_Main.h"

#include "../Defines.h"
#include "../TypeDefs.h"

#include "../Classes/cSettings.h"

#include "../../Global/Class_QMapControl.h"

#include "../../Global/Class_HandlerKML/HandlerKML.h"

using namespace qmapcontrol;

class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
{
    Q_OBJECT

    public:
        dlg_Main();
        ~dlg_Main();
        void create_Map();

    private:

        // Info über die Hardware
        s_Hardware gs_Version;

        // Settings-Object
        cSettings *o_Settings;

        char c_Data[150];

        // Programm-Initialisirungen
        void init_GUI();
        void init_Connections();

        void init_Directorys();
        s_Directorys s_Dir;

        // QMK-Maps
        QFile *o_Record;

        QPen* Pen[6];

        MapControl  *o_Map;
        MapAdapter  *o_Adapter;

        Layer       *o_Layer;
        Layer       *o_Click;

        Layer       *o_Info;
        Layer       *o_RouteWP;
        Layer       *o_RouteFL;

        QList<Point*> p_RouteWP;
        LineString*   l_RouteWP;

        QList<Point*> p_RouteFL;
        LineString*   l_RouteFL;

        Point* LastPos;
        Point* LastClick;
        Point* ClickPoint;
        Point* Flag;
        Point* Home;
        Point* Target;

        QPointF MapCenter;

        QList<sWayPoint> l_WayPoints;
        QList<sWayPoint> l_Track;

        QList<sWayPoint> parse_WayPointKML(QString s_File);
        QList<sWayPoint> parse_WayPointMKW(QString s_File);

        void show_WayPoints(QList<sWayPoint> WayPoints);

        void save_WayPointsMKW(QString s_File);

        void add_Position(s_MK_NaviData t_NaviData);
//        void show_Data(s_MK_NaviData t_NaviData);
        void send_Target(Point *t_Target);
        void send_WayPoints(QList<sWayPoint> l_WayPoints, int t_Pos = 0);

    private slots:
        void slot_ac_About();
        void slot_ac_Toolbar();

        void slot_ConnectionStatus(int li_Status);
        void slot_MK_Version(s_Hardware ls_Version);
        void slot_MK_NaviData(s_MK_NaviData ps_MK_NaviData);
        void slot_MK_WayPoint(int pi_WayPointID);

        // QMK-Maps
        void slot_Zoom(int t_Zoom);
        void slot_ChangeMap(int);
        void slot_Click(const QMouseEvent*, const QPointF);

        void slot_btn_WPAdd();
        void slot_btn_WPFly();
        void slot_btn_WPDelete();
        void slot_ShowWayPoints(bool);

        void slot_ac_RouteDelete();

        void slot_ac_LoadMapPic();
        void slot_ac_Record();

        void slot_ac_LoadWayPoints();
        void slot_ac_SaveRoute();

    protected:
        virtual void wheelEvent(QWheelEvent *event);
        virtual void resizeEvent ( QResizeEvent * event );

};

#endif // DLG_MAIN_H