-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathSenderController.h
68 lines (60 loc) · 1.95 KB
/
SenderController.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
/***************************************************************************
* *
* Copyright (C) 2017 by University of Illinois *
* *
* http://illinois.edu *
* *
***************************************************************************/
/**
* @file SenderController.h
*
* A Sender object reads Vicon data from a Station object, processes the data
* with Kalman filtering and computes a GPS MAVLink data pack, sends MAVLink
* messages to a robot via UDP.
*
* This is the Controller of the
* Model(Sender)-View(SenderWindow)-Controller(SenderController) pattern.
*
* @author Bo Liu <[email protected]>
*
*/
#ifndef SENDERCONTROLLER_H
#define SENDERCONTROLLER_H
#include <QObject>
#include <QTimer>
#include "Sender.h"
#include <memory>
class SenderController : public QObject
{
Q_OBJECT
public:
explicit SenderController(std::unique_ptr<Sender>& sender, QObject *parent = 0);
signals:
public slots:
QHostAddress getRemoteAddress() const;
quint16 getRemotePort() const;
uint8_t getSysID() const;
uint8_t getCompID() const;
bool getUseGps() const;
bool getUseLocPos() const;
bool getUseVicon() const;
uint8_t getRate() const;
void startSender();
void stopSender();
void setRate(uint8_t rate);
void setUseGps(bool use);
void setUseVicon(bool use);
void setUseLocPos(bool use);
void setSysID(uint8_t id);
void setCompID(uint8_t id);
void setRemoteAddress(const QString& ip);
void setRemotePort(quint16 port);
void timerHandler();
void updateMeasDisplay();
private:
std::unique_ptr<Sender>& sender;
void initialize();
void setupConnections();
QTimer timer;
};
#endif // SENDERCONTROLLER_H