[88] | 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/09/02
|
---|
| 6 | // filename: GuiInterface.h
|
---|
| 7 | //
|
---|
| 8 | // authors: Thomas Fuhrmann
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: Create the GUI and give an abstract interface to it
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 |
|
---|
| 18 | #ifndef MAVPLANNER_GUI_INTERFACE_H
|
---|
| 19 | #define MAVPLANNER_GUI_INTERFACE_H
|
---|
| 20 |
|
---|
| 21 | #include <string>
|
---|
| 22 | #include <Thread.h>
|
---|
| 23 |
|
---|
| 24 | namespace flair {
|
---|
| 25 | namespace core {
|
---|
| 26 | class FrameworkManager;
|
---|
| 27 | class Socket;
|
---|
| 28 | }
|
---|
| 29 | namespace gui {
|
---|
| 30 | class Tab;
|
---|
| 31 | class TabWidget;
|
---|
| 32 | class DoubleSpinBox;
|
---|
| 33 | class PushButton;
|
---|
| 34 | class ComboBox;
|
---|
| 35 | class GroupBox;
|
---|
| 36 | class ListWidget;
|
---|
| 37 | class Label;
|
---|
| 38 | }
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | class GuiInterface : public flair::core::Thread {
|
---|
| 42 | public:
|
---|
| 43 |
|
---|
| 44 | GuiInterface(const flair::core::FrameworkManager *parent, std::string name);
|
---|
| 45 | ~GuiInterface();
|
---|
| 46 |
|
---|
| 47 | protected:
|
---|
| 48 | // reimplement the run of the Thread class
|
---|
| 49 | void Run();
|
---|
| 50 |
|
---|
| 51 | // First tab callbacks
|
---|
| 52 | virtual void MissionStart() = 0;
|
---|
| 53 | virtual void MissionStop() = 0;
|
---|
| 54 | virtual void MissionPause() = 0;
|
---|
| 55 | virtual void MissionSend() = 0;
|
---|
| 56 |
|
---|
| 57 | std::string MissionCmdGet();
|
---|
| 58 |
|
---|
| 59 | // Main GUI
|
---|
| 60 | flair::gui::TabWidget* tabWidget;
|
---|
| 61 | flair::gui::Tab* mainTab;
|
---|
| 62 | flair::gui::Tab* settingsTab;
|
---|
| 63 |
|
---|
| 64 | // Controls groupbox
|
---|
| 65 | flair::gui::GroupBox* controlsGroupBox;
|
---|
| 66 | flair::gui::PushButton* btnStartMission;
|
---|
| 67 | flair::gui::PushButton* btnStopMission;
|
---|
| 68 | flair::gui::PushButton* btnPauseMission;
|
---|
| 69 |
|
---|
| 70 | // Add cmd groupbox
|
---|
| 71 | flair::gui::GroupBox* addCmdGroupBox;
|
---|
| 72 | // flair::gui::Label* commandLabel;
|
---|
| 73 | // flair::gui::Label* param1Label;
|
---|
| 74 | // flair::gui::Label* param2Label;
|
---|
| 75 | // flair::gui::Label* param3Label;
|
---|
| 76 | flair::gui::ComboBox* comboCmd;
|
---|
| 77 | flair::gui::DoubleSpinBox* param1Field;
|
---|
| 78 | flair::gui::DoubleSpinBox* param2Field;
|
---|
| 79 | flair::gui::DoubleSpinBox* param3Field;
|
---|
| 80 | flair::gui::DoubleSpinBox* latitudeField;
|
---|
| 81 | flair::gui::DoubleSpinBox* longitudeField;
|
---|
| 82 | flair::gui::DoubleSpinBox* altitudeField;
|
---|
| 83 | flair::gui::PushButton* btnAddMissionCmd;
|
---|
| 84 | flair::gui::PushButton* btnDelMissionCmd;
|
---|
| 85 | flair::gui::PushButton* btnSendMission;
|
---|
| 86 |
|
---|
| 87 | // Show wpt groupbox
|
---|
| 88 | flair::gui::GroupBox* showItemsGroupBox;
|
---|
| 89 | flair::gui::ListWidget* listMissionItems;
|
---|
| 90 | // flair::gui::ListWidget* listEntranceWpt;
|
---|
| 91 | // flair::gui::ListWidget* listExitWpt;
|
---|
| 92 | // flair::gui::PushButton* btnRemoveMissionWpt;
|
---|
| 93 | // flair::gui::PushButton* btnRemoveEntranceWpt;
|
---|
| 94 | // flair::gui::PushButton* btnRemoveExitWpt;
|
---|
| 95 |
|
---|
| 96 | // Action wpt groupbox
|
---|
| 97 | // flair::gui::GroupBox* actionWptGroupBox;
|
---|
| 98 | // flair::gui::PushButton* btnSendWpt;
|
---|
| 99 | // flair::gui::PushButton* btnClearWpt;
|
---|
| 100 | // flair::gui::PushButton* btnLoop;
|
---|
| 101 |
|
---|
| 102 | // Socket to send commands
|
---|
| 103 | flair::core::Socket* sendSocket;
|
---|
| 104 |
|
---|
| 105 | //TODO : think if useful to have private members
|
---|
| 106 |
|
---|
| 107 | private:
|
---|
| 108 | const std::vector<std::string> commandsAvailable = {"WAYPOINT", "TAKEOFF", "LAND", "RETURN", "JUMP"};
|
---|
| 109 | };
|
---|
| 110 |
|
---|
| 111 | #endif // MAVPLANNER_GUI_INTERFACE_H
|
---|