source: flair-src/branches/mavlink/tools/Controller/Mavlink/src/Mavlink_test.h@ 48

Last change on this file since 48 was 47, checked in by Thomas Fuhrmann, 8 years ago

GUI is working with ListWidget (display only)

File size: 3.2 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5// created: 2016/07/05
6// filename: Mavlink.h
7//
8// authors: Thomas Fuhrmann
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Mavlink controller in client side.
14//
15//
16/*********************************************************************/
17
18#ifndef MAVLINK_TEST_H
19#define MAVLINK_TEST_H
20
21#include <stdint.h>
22#include <Thread.h>
23
24namespace flair {
25namespace core {
26 class FrameworkManager;
27 class Socket;
28}
29namespace gui {
30 class SpinBox;
31 class Label;
32 class CheckBox;
33 class Tab;
34 class TabWidget;
35 class DoubleSpinBox;
36 class PushButton;
37 class Label;
38 class ComboBox;
39 class GroupBox;
40 class ListWidget;
41}
42}
43
44namespace flair {
45namespace sensor {
46
47class Mavlink : public core::Thread {
48public:
49
50 Mavlink(const core::FrameworkManager *parent, std::string name,
51 std::string receiverAddress, int receiverPort);
52 ~Mavlink();
53
54private:
55 gui::SpinBox *deadZone;
56 gui::CheckBox *enabled;
57 gui::Label *batteryChargeLevel;
58 core::Time now;
59 gui::TabWidget *tabWidget;
60 gui::Tab *tab;
61 gui::Tab *settingsTab;
62
63 // Controls groupbox
64 gui::GroupBox* controlsGroupBox;
65 gui::PushButton* btn_initialize;
66 gui::PushButton* btn_start_mission;
67 gui::PushButton* btn_stop_mission;
68 gui::PushButton* btn_kill;
69
70 // Add wpt groupbox
71 gui::GroupBox* add_wptGroupBox;
72 gui::DoubleSpinBox* latField;
73 gui::DoubleSpinBox* lonField;
74 gui::PushButton* btn_add_mission_wpt;
75 gui::PushButton* btn_add_entrance_wpt;
76 gui::PushButton* btn_add_exit_wpt;
77
78 // Show wpt groupbox
79 gui::GroupBox* show_wptGroupBox;
80 gui::ListWidget* list_mission_wpt;
81 gui::ListWidget* list_entrance_wpt;
82 gui::ListWidget* list_exit_wpt;
83 gui::PushButton* btn_remove_mission_wpt;
84 gui::PushButton* btn_remove_entrance_wpt;
85 gui::PushButton* btn_remove_exit_wpt;
86 // gui::Label* label_mission_wpt;
87 // gui::Label* label_mission_wpt_list;
88 // gui::Label* label_entrance_wpt;
89 // gui::Label* label_entrance_wpt_list;
90 // gui::Label* label_exit_wpt;
91 // gui::Label* label_exit_wpt_list;
92
93 // Remove wpt groupbox
94 // gui::GroupBox* show_wptGroupBox;
95 // gui::ComboBox* cmb_box_mission_wpt;
96 // gui::ComboBox* cmb_box_mission_wpt;
97 // gui::ComboBox* cmb_box_mission_wpt;
98
99 // Action wpt groupbox
100 gui::GroupBox* action_wptGroupBox;
101 gui::PushButton* btn_send_wpt;
102 gui::PushButton* btn_clear_wpt;
103 gui::PushButton* btn_loop;
104
105 core::Socket* mavlinkSocket;
106 core::Socket* recvSocket;
107
108 // reimplement the run of the Thread class
109 void Run();
110
111 // First tab callbacks
112 void MissionInitialize();
113 void MissionStart();
114 void MissionStop();
115 void MissionKill();
116
117 // Second tab callbacks
118 void MissionWptAdd();
119 void EntranceWptAdd();
120 void ExitWptAdd();
121 void WptSend();
122 void WptClear();
123 void WptLoopSend();
124
125 void SendWptMessage(gui::DoubleSpinBox* latField, gui::DoubleSpinBox* lonField);
126 void SendHeartbeat();
127
128 void SendAllWptMessage();
129
130 void DecodeWptMessage(std::string wpt_to_decode);
131
132 std::string U8toString(const uint8_t* chars, const uint16_t chars_size);
133};
134
135}
136}
137
138#endif // MAVLINK_H
Note: See TracBrowser for help on using the repository browser.