mainwindow.h 3.71 KB
Newer Older
beuchatp's avatar
beuchatp committed
1
//    Copyright (C) 2019, ETH Zurich, D-ITET, Paul Beuchat
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
//    This file is part of D-FaLL-System.
//
//    D-FaLL-System 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 3 of the License, or
//    (at your option) any later version.
//
//    D-FaLL-System 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 D-FaLL-System.  If not, see <http://www.gnu.org/licenses/>.
//
//
//    ----------------------------------------------------------------------------------
//    DDDD        FFFFF        L     L           SSSS  Y   Y   SSSS  TTTTT  EEEEE  M   M
//    D   D       F      aaa   L     L          S       Y Y   S        T    E      MM MM
//    D   D  ---  FFFF  a   a  L     L     ---   SSS     Y     SSS     T    EEE    M M M
//    D   D       F     a  aa  L     L              S    Y        S    T    E      M   M
//    DDDD        F      aa a  LLLL  LLLL       SSSS     Y    SSSS     T    EEEEE  M   M
//
//
//    DESCRIPTION:
beuchatp's avatar
beuchatp committed
28
//    The Flying Agent GUI main window.
29
30
31
32
//
//    ----------------------------------------------------------------------------------


beuchatp's avatar
beuchatp committed
33
34
35



36
37
#ifndef MAINWINDOW_FLYINGAGENTGUI_H
#define MAINWINDOW_FLYINGAGENTGUI_H
38
39
40

#include <QMainWindow>
#include <QShortcut>
41
42
43
#include <QMutex>

#include <QTextStream>
44
45

#ifdef CATKIN_MAKE
46
47
48
49
#include <ros/ros.h>
#include <ros/network.h>
#include <ros/package.h>
#include "rosNodeThread_for_flyingAgentGUI.h"
50
51
52
53
54
55
56

// Include the standard message types
#include "std_msgs/Int32.h"
//#include "std_msgs/Float32.h"
//#include <std_msgs/String.h>

// Include the DFALL message types
57
#include "dfall_pkg/StringWithHeader.h"
58
59
60
61

#include "nodes/Constants.h"

// Namespacing the package
62
using namespace dfall_pkg;
63
64
//using namespace std;

65
66
67
68
#else
// Include the shared definitions
#include "include/Constants_for_Qt_compile.h"

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#endif


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(int argc, char **argv, QWidget *parent = 0);
    ~MainWindow();

84

85
86
87
88
89
90

private:
    Ui::MainWindow *ui;

    QShortcut* m_close_GUI_shortcut;

91
92
93
    // > For the type of this node,
    //   i.e., an agent or a coordinator
    int m_type = 0;
94

95
96
    // > For the ID of this node
    int m_ID = 0;
97

98
99
100
101
102
103
    // For coordinating multiple agents
    std::vector<int> m_vector_of_agentIDs_toCoordinate;
    bool m_shouldCoordinateAll = true;
    QMutex m_agentIDs_toCoordinate_mutex;
    

104
105
#ifdef CATKIN_MAKE
    rosNodeThread* m_rosNodeThread;
106
107
108
109
110

	// The namespace into which this parameter service loads yaml parameters
	std::string m_parameter_service_namespace;

	ros::Publisher m_requestLoadYamlFilenamePublisher;
111
112
#endif

113
114
115
116
117
118
119
120
121
122
123
124
125
126

    // --------------------------------------------------- //
    // PRIVATE FUNCTIONS
#ifdef CATKIN_MAKE
    bool getTypeAndIDParameters();
#endif




private slots:
    // PRIVATE METHODS FOR MENU ITEM CALLBACKS
    void on_actionShowHide_Coordinator_triggered();
    void on_action_LoadYAML_BatteryMonitor_triggered();
127
    void on_action_LoadYAML_FlyingAgentClientConfig_triggered();
128

129
130
131
132
    // FOR THE CONTROLLERS MENU
    void on_action_showHideController_default_changed();
    void on_action_showHideController_student_changed();
    void on_action_showHideController_picker_changed();
133
    void on_action_showHideController_tuning_changed();
134
    void on_action_showHideController_template_changed();
135

beuchatp's avatar
beuchatp committed
136
137
    void on_action_testMotors_changed();

138
139
140
};

#endif // MAINWINDOW_H