WaypointView.h 2.83 KB
Newer Older
pixhawk's avatar
pixhawk committed
1
/*===================================================================
2
QGroundControl Open Source Ground Control Station
pixhawk's avatar
pixhawk committed
3

4
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
pixhawk's avatar
pixhawk committed
5

6
This file is part of the QGROUNDCONTROL project
pixhawk's avatar
pixhawk committed
7

8
    QGROUNDCONTROL is free software: you can redistribute it and/or modify
pixhawk's avatar
pixhawk committed
9 10 11
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
pixhawk's avatar
pixhawk committed
12
    
13
    QGROUNDCONTROL is distributed in the hope that it will be useful,
pixhawk's avatar
pixhawk committed
14 15 16
    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.
pixhawk's avatar
pixhawk committed
17
    
pixhawk's avatar
pixhawk committed
18
    You should have received a copy of the GNU General Public License
19
    along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
pixhawk's avatar
pixhawk committed
20
    
pixhawk's avatar
pixhawk committed
21 22 23 24 25 26 27 28
======================================================================*/

/**
 * @file
 *   @brief Displays one waypoint
 *
 *   @author Lorenz Meier <mavteam@student.ethz.ch>
 *   @author Benjamin Knecht <mavteam@student.ethz.ch>
29
 *   @author Petri Tanskanen <mavteam@student.ethz.ch>
pixhawk's avatar
pixhawk committed
30 31 32 33 34 35 36 37
 *
 */

#ifndef WAYPOINTVIEW_H
#define WAYPOINTVIEW_H

#include <QtGui/QWidget>
#include "Waypoint.h"
38
#include <iostream>
pixhawk's avatar
pixhawk committed
39

40 41 42 43 44 45 46
enum QGC_WAYPOINTVIEW_MODE {
    QGC_WAYPOINTVIEW_MODE_NAV,
    QGC_WAYPOINTVIEW_MODE_CONDITION,
    QGC_WAYPOINTVIEW_MODE_DO,
    QGC_WAYPOINTVIEW_MODE_DIRECT_EDITING
};

pixhawk's avatar
pixhawk committed
47 48 49
namespace Ui {
    class WaypointView;
}
50
class Ui_QGCCustomWaypointAction;
pixhawk's avatar
pixhawk committed
51 52 53 54

class WaypointView : public QWidget {
    Q_OBJECT
    Q_DISABLE_COPY(WaypointView)
pixhawk's avatar
pixhawk committed
55 56
public:
    explicit WaypointView(Waypoint* wp, QWidget* parent);
pixhawk's avatar
pixhawk committed
57
    virtual ~WaypointView();
pixhawk's avatar
pixhawk committed
58
    
pixhawk's avatar
pixhawk committed
59
public:
pixhawk's avatar
pixhawk committed
60
    void setCurrent(bool state);
pixhawk's avatar
pixhawk committed
61
    
pixhawk's avatar
pixhawk committed
62 63 64 65
public slots:
    void moveUp();
    void moveDown();
    void remove();
pixhawk's avatar
pixhawk committed
66 67
    /** @brief Waypoint matching this widget has been deleted */
    void deleted(QObject* waypoint);
pixhawk's avatar
pixhawk committed
68
    void changedAutoContinue(int);
69
    void updateFrameView(int frame);
70
    void changedFrame(int state);
71
    void updateActionView(int action);
72
    void changedAction(int state);
pixhawk's avatar
pixhawk committed
73
    void changedCurrent(int);
74
    void updateValues(void);
pixhawk's avatar
pixhawk committed
75
    
pixhawk's avatar
pixhawk committed
76
    void setYaw(int);   //hidden degree to radian conversion
pixhawk's avatar
pixhawk committed
77
    
78 79 80
protected slots:
    void changeViewMode(QGC_WAYPOINTVIEW_MODE mode);

pixhawk's avatar
pixhawk committed
81 82 83
protected:
    virtual void changeEvent(QEvent *e);
    Waypoint* wp;
84 85 86
    // Special widgets extendending the
    // waypoint view to mission capabilities
    Ui_QGCCustomWaypointAction* customCommand;
87
    QGC_WAYPOINTVIEW_MODE viewMode;
pixhawk's avatar
pixhawk committed
88
    
pixhawk's avatar
pixhawk committed
89 90
private:
    Ui::WaypointView *m_ui;
pixhawk's avatar
pixhawk committed
91
    
pixhawk's avatar
pixhawk committed
92 93 94 95
signals:
    void moveUpWaypoint(Waypoint*);
    void moveDownWaypoint(Waypoint*);
    void removeWaypoint(Waypoint*);
pixhawk's avatar
pixhawk committed
96
    void currentWaypointChanged(quint16);
97
    void changeCurrentWaypoint(quint16);
pixhawk's avatar
pixhawk committed
98
    void setYaw(double);
pixhawk's avatar
pixhawk committed
99 100 101
};

#endif // WAYPOINTVIEW_H