-
Notifications
You must be signed in to change notification settings - Fork 15
/
SenderWindow.h
70 lines (59 loc) · 1.82 KB
/
SenderWindow.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
/***************************************************************************
* *
* Copyright (C) 2017 by University of Illinois *
* *
* http://illinois.edu *
* *
***************************************************************************/
/**
* @file SenderWindow.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 View of the
* Model(Sender)-View(SenderWindow)-Controller(SenderController) pattern.
*
* @author Bo Liu <[email protected]>
*
*/
#ifndef SENDERWINDOW_H
#define SENDERWINDOW_H
#include <QWidget>
#include <QCloseEvent>
#include "SenderController.h"
#include <QLabel>
namespace Ui {
class SenderWindow;
}
class SenderWindow : public QWidget
{
Q_OBJECT
public:
explicit SenderWindow(const QString& name,
std::unique_ptr<SenderController>& controller,
QWidget *parent = 0);
void closeEvent(QCloseEvent * event) override;
~SenderWindow();
void setStandBy();
void setActive();
signals:
void closeSelf(const QString& name);
void senderStarted();
void senderStopped();
void rateChanged();
public slots:
void updateRateLabel();
void startSenderHandler();
void stopSenderHandler();
private:
Ui::SenderWindow *ui;
QString name;
std::unique_ptr<SenderController>& controller;
void initialize();
void setupConnections();
// helpers
void setLabelColor(QLabel * label, QColor color);
};
#endif // SENDERWINDOW_H