mainguiwindow.h 2.34 KB
Newer Older
1
2
3
#ifndef MAINGUIWINDOW_H
#define MAINGUIWINDOW_H

4
// The #define CATKIN_MAKE comes from cmake file
5
6
7
8
9
#include <QMainWindow>
#include <QTimer>
#include <QGridLayout>
#include <QGraphicsRectItem>

10

11
#ifdef CATKIN_MAKE
12
#include "rosNodeThread.h"
roangel's avatar
roangel committed
13
14
#include "d_fall_pps/UnlabeledMarker.h"
#include "d_fall_pps/UnlabeledMarkersArray.h"
15
#endif
16

17
18
#include "ui_mainguiwindow.h"
#include "myGraphicsScene.h"
19
20
21
#include "globalDefinitions.h"

#include "marker.h"             // temporal, just to check
22
#include "crazyFly.h"
23
24
25
26
27
28

namespace Ui {
class MainGUIWindow;
}


29
#ifdef CATKIN_MAKE
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
struct setpoint
{
    double x;
    double y;
    double z;
    double yaw;
};

class CSetpointQueue
{
public:
    CSetpointQueue();
    void insert(setpoint newElem);
    setpoint getNext();
    void print();

private:
    struct QueueElem
    {
        QueueElem(setpoint newElem) {elem.x=newElem.x; elem.y=newElem.y; elem.z=newElem.z; elem.yaw=newElem.yaw; next=NULL;}
        setpoint elem;
        QueueElem* next;
    };

    QueueElem* startElem;
    QueueElem* currElem;
    QueueElem* lastElem;
};
#endif

class MainGUIWindow : public QMainWindow
{
    Q_OBJECT

public:
65
66
    explicit MainGUIWindow(int argc, char **argv, QWidget *parent = 0);

67
68
69
    ~MainGUIWindow();

public slots:
70

71
private slots:
72
    #ifdef CATKIN_MAKE
73
    #endif
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

    void set_tabs(int n);
    void transitionToMode(int mode);
    void on_removeTable_clicked();

    void on_radioButton_table_mode_toggled(bool checked);

    void on_radioButton_crazyfly_zones_mode_toggled(bool checked);
    void handleTablePiecesNumChanged(int newNum);

    void on_radioButton_lock_mode_toggled(bool checked);

    void on_checkBox_grid_toggled(bool checked);

    void on_checkBox_table_toggled(bool checked);

    void on_checkBox_crazyfly_zones_toggled(bool checked);

    void on_tabWidget_currentChanged(int index);

    void centerViewIndex(int index);

    void on_pushButton_fitAll_clicked();

98
99
100
101
    void on_checkBox_vicon_markers_toggled(bool checked);

    void on_checkBox_vicon_highlight_markers_toggled(bool checked);

roangel's avatar
roangel committed
102
    #ifdef CATKIN_MAKE
103
    void setPosMarkers(const ptrToMessage& p_msg);
roangel's avatar
roangel committed
104
    #endif
105
106
107
108
109
110
private:

    Ui::MainGUIWindow *ui;
    myGraphicsScene* scene;
    void _init();

111
    std::vector<Marker*> markers_vector;
112
113

    crazyFly* crazyFly_1;
114

115
    #ifdef CATKIN_MAKE
116
    rosNodeThread* _rosNodeThread;
117
118
119
120
121
122
    #endif
};



#endif // MAINGUIWINDOW_H