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: GuiGcs.h
|
---|
7 | //
|
---|
8 | // authors: Thomas Fuhrmann
|
---|
9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
10 | //
|
---|
11 | // version: $Id: $
|
---|
12 | //
|
---|
13 | // purpose: Implementation of GuiInterface, using sockets
|
---|
14 | //
|
---|
15 | //
|
---|
16 | /*********************************************************************/
|
---|
17 |
|
---|
18 | #include "GuiGcs.h"
|
---|
19 | #include "GuiInterface.h"
|
---|
20 |
|
---|
21 | #include <Socket.h>
|
---|
22 | #include <FrameworkManager.h>
|
---|
23 |
|
---|
24 | //todo remove for tests
|
---|
25 | #include <iostream>
|
---|
26 |
|
---|
27 | using namespace std;
|
---|
28 | using namespace flair::core;
|
---|
29 | using namespace flair::gui;
|
---|
30 |
|
---|
31 | GuiGcs::GuiGcs(const FrameworkManager *parent, string name,
|
---|
32 | std::string &outputAddress, int outputPort):
|
---|
33 | GuiInterface(parent, name) {
|
---|
34 | cout << "MavPlanner GuiGcs constructor" << endl;
|
---|
35 | outputSocket = new Socket((Thread *)this, "output socket", outputAddress + ":" + to_string(outputPort));
|
---|
36 | }
|
---|
37 |
|
---|
38 | GuiGcs::~GuiGcs() {
|
---|
39 |
|
---|
40 | }
|
---|
41 |
|
---|
42 | void GuiGcs::MissionStart() {
|
---|
43 | cout << "MavPlanner GuiGcs MissionStart" << endl;
|
---|
44 | outputSocket->SendMessage("MavPlanner GuiGcs MissionStart");
|
---|
45 | }
|
---|
46 |
|
---|
47 | void GuiGcs::MissionStop() {
|
---|
48 | cout << "MavPlanner GuiGcs MissionStop" << endl;
|
---|
49 | outputSocket->SendMessage("MavPlanner GuiGcs MissionStop");
|
---|
50 | }
|
---|
51 |
|
---|
52 | void GuiGcs::MissionResume() {
|
---|
53 | cout << "MavPlanner GuiGcs MissionResume" << endl;
|
---|
54 | outputSocket->SendMessage("MavPlanner GuiGcs MissionResume");
|
---|
55 | }
|
---|
56 |
|
---|
57 | void GuiGcs::MissionSend() {
|
---|
58 | cout << "MavPlanner GuiGcs MissionSend" << endl;
|
---|
59 | }
|
---|