-
Notifications
You must be signed in to change notification settings - Fork 15
/
StationController.h
74 lines (65 loc) · 2.12 KB
/
StationController.h
1
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
28
29
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
65
66
67
68
69
70
71
72
73
74
/***************************************************************************
* *
* Copyright (C) 2017 by University of Illinois *
* *
* http://illinois.edu *
* *
***************************************************************************/
/**
* @file StationController.h
*
* A Station object organizes drones and senders, communicates with Vicon and
* updates measurements for drones using a separate thread.
*
* A StationWindow is the main GUI.
*
* This is the Controller of the
* Model(Station)-View(StationWindow)-Controller(StationController) pattern.
*
* @author Bo Liu <[email protected]>
*
*/
#ifndef STATIONCONTROLLER_H
#define STATIONCONTROLLER_H
#include <QObject>
#include <Station.h>
#include <memory>
#include <vector>
#include <QTimer>
class StationController : public QObject
{
Q_OBJECT
public:
explicit StationController(std::unique_ptr<Station>& station, QObject *parent = 0);
void connectVicon();
void disconnectVicon();
QHostAddress getHostAddress();
quint16 getHostPort();
std::vector<QString> getTrackingObjectNames();
QString getOriginGPS();
double getFrameRate();
double getdt();
std::unique_ptr<Station> &getStation();
void setHostAddress(QString ip);
void setHostPort(quint16 hport);
void setOriginGPS(const QString &q_gps);
void setNorth(const QString& axis);
signals:
void droneNameAdded(QString name);
void droneNameRemoved(QString name);
void viconConnected();
void viconDisconnected();
void dtUpdated(double dt);
public slots:
void addDrone(QString name);
void removeDrone(QString name);
void viconConnectedHandler();
void viconDisconnectedHandler();
void dtUpdatedHandler();
private:
std::unique_ptr<Station>& station;
void initialize();
void setupConnections();
QTimer dtUpdateTimer;
};
#endif // STATIONCONTROLLER_H