WaypointEditableView.h 3.07 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.
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.
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/>.
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
#ifndef WAYPOINTEDITABLEVIEW_H
#define WAYPOINTEDITABLEVIEW_H
pixhawk's avatar
pixhawk committed
35 36 37

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

40 41 42 43 44
enum QGC_WAYPOINTEDITABLEVIEW_MODE {
    QGC_WAYPOINTEDITABLEVIEW_MODE_NAV,
    QGC_WAYPOINTEDITABLEVIEW_MODE_CONDITION,
    QGC_WAYPOINTEDITABLEVIEW_MODE_DO,
    QGC_WAYPOINTEDITABLEVIEW_MODE_DIRECT_EDITING
45 46
};

47 48
namespace Ui
{
49
class WaypointEditableView;
pixhawk's avatar
pixhawk committed
50
}
pixhawk's avatar
pixhawk committed
51 52 53 54 55
//class Ui_QGCCustomWaypointAction;
//class Ui_QGCMissionDoWidget;
class QGCMissionDoWidget;
class QGCMissionConditionWidget;
class QGCMissionOther;
56
class WaypointEditableView : public QWidget
57
{
pixhawk's avatar
pixhawk committed
58
    Q_OBJECT
59
    Q_DISABLE_COPY(WaypointEditableView)
pixhawk's avatar
pixhawk committed
60
public:
61 62
    explicit WaypointEditableView(Waypoint* wp, QWidget* parent);
    virtual ~WaypointEditableView();
63

pixhawk's avatar
pixhawk committed
64
public:
pixhawk's avatar
pixhawk committed
65
    void setCurrent(bool state);
66

pixhawk's avatar
pixhawk committed
67 68 69 70
public slots:
    void moveUp();
    void moveDown();
    void remove();
pixhawk's avatar
pixhawk committed
71 72
    /** @brief Waypoint matching this widget has been deleted */
    void deleted(QObject* waypoint);
pixhawk's avatar
pixhawk committed
73
    void changedAutoContinue(int);
74
    void updateFrameView(int frame);
75
    void changedFrame(int state);
76
    void updateActionView(int action);
77
    void changedAction(int state);
pixhawk's avatar
pixhawk committed
78
    void changedCurrent(int);
79
    void updateValues(void);
80

81
protected slots:
82
    void changeViewMode(QGC_WAYPOINTEDITABLEVIEW_MODE mode);
83

pixhawk's avatar
pixhawk committed
84 85 86
protected:
    virtual void changeEvent(QEvent *e);
    Waypoint* wp;
87 88
    // Special widgets extendending the
    // waypoint view to mission capabilities
pixhawk's avatar
pixhawk committed
89 90 91
    QGCMissionDoWidget* MissionDoJumpWidget;
    QGCMissionConditionWidget* MissionConditionDelayWidget;
    QGCMissionOther* MissionOtherWidget;
92
    QGC_WAYPOINTEDITABLEVIEW_MODE viewMode;
93

pixhawk's avatar
pixhawk committed
94
private:
95
    Ui::WaypointEditableView *m_ui;
96

pixhawk's avatar
pixhawk committed
97 98 99 100
signals:
    void moveUpWaypoint(Waypoint*);
    void moveDownWaypoint(Waypoint*);
    void removeWaypoint(Waypoint*);
101
    //void currentWaypointChanged(quint16); //unused
102
    void changeCurrentWaypoint(quint16);
pixhawk's avatar
pixhawk committed
103
    void setYaw(double);
pixhawk's avatar
pixhawk committed
104 105
};

106
#endif // WAYPOINTEDITABLEVIEW_H