[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[9] | 5 | #ifndef CONNECTIONLAYOUT_H
|
---|
| 6 | #define CONNECTIONLAYOUT_H
|
---|
| 7 |
|
---|
[30] | 8 | #include <QTimer>
|
---|
[9] | 9 | #include "Layout.h"
|
---|
| 10 |
|
---|
| 11 | class UdtSocket;
|
---|
| 12 | class DataRemote;
|
---|
| 13 |
|
---|
[15] | 14 | class ConnectionLayout : public Layout {
|
---|
| 15 | Q_OBJECT
|
---|
[9] | 16 |
|
---|
[15] | 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();
|
---|
[9] | 25 |
|
---|
[15] | 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;
|
---|
[30] | 36 | unsigned int total_received;
|
---|
| 37 | QTimer *receive_timer;
|
---|
[9] | 38 |
|
---|
[15] | 39 | private slots:
|
---|
| 40 | void receive(char *buf, int size);
|
---|
[30] | 41 | void computeRxRate(void);
|
---|
[9] | 42 |
|
---|
[15] | 43 | signals:
|
---|
| 44 | void setRemoteName(QString name);
|
---|
[30] | 45 | void computedRxRate(float rxRate);
|
---|
[9] | 46 | };
|
---|
| 47 |
|
---|
| 48 | #endif // CONNECTIONLAYOUT_H
|
---|