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 | #ifndef CONNECTIONLAYOUT_H
|
---|
6 | #define CONNECTIONLAYOUT_H
|
---|
7 |
|
---|
8 | #include <QTimer>
|
---|
9 | #include "Layout.h"
|
---|
10 |
|
---|
11 | class UdtSocket;
|
---|
12 | class DataRemote;
|
---|
13 |
|
---|
14 | class ConnectionLayout : public Layout {
|
---|
15 | Q_OBJECT
|
---|
16 |
|
---|
17 | public:
|
---|
18 | ConnectionLayout(UdtSocket *socket, QString name);
|
---|
19 | ~ConnectionLayout();
|
---|
20 | void XmlToSend(QDomDocument doc);
|
---|
21 | void addDataRemote(DataRemote *data);
|
---|
22 | void removeDataRemote(DataRemote *data);
|
---|
23 | void LoadXml(QDomDocument to_parse);
|
---|
24 | QString getRemoteName();
|
---|
25 |
|
---|
26 | private:
|
---|
27 | static int uncompressBuffer(char *in, ssize_t in_size, char **out,
|
---|
28 | ssize_t *out_size);
|
---|
29 | void handleUncompressedFrame(char *buf, ssize_t size);
|
---|
30 | void drawDatas(char *buf, int buf_size, uint16_t period,
|
---|
31 | bool big_endian = false);
|
---|
32 | bool isRemoteNameDefined;
|
---|
33 | QString remoteName;
|
---|
34 | UdtSocket *socket;
|
---|
35 | QList<DataRemote *> dataremotes;
|
---|
36 | unsigned int total_received;
|
---|
37 | QTimer *receive_timer;
|
---|
38 |
|
---|
39 | private slots:
|
---|
40 | void receive(char *buf, int size);
|
---|
41 | void computeRxRate(void);
|
---|
42 |
|
---|
43 | signals:
|
---|
44 | void setRemoteName(QString name);
|
---|
45 | void computedRxRate(float rxRate);
|
---|
46 | };
|
---|
47 |
|
---|
48 | #endif // CONNECTIONLAYOUT_H
|
---|