|
|
#ifndef TMECHOBRIDGE_H
|
|
|
#define TMECHOBRIDGE_H
|
|
|
|
|
|
#include <QWidget>
|
|
|
#include <QTcpServer>
|
|
|
#include <QTcpSocket>
|
|
|
#include <QLabel>
|
|
|
#include <QSpinBox>
|
|
|
#include <QPushButton>
|
|
|
#include <QGroupBox>
|
|
|
#include <QGridLayout>
|
|
|
#include <QTextEdit>
|
|
|
#include <QXmlStreamWriter>
|
|
|
#include <QTime>
|
|
|
#include "tmpackettoread.h"
|
|
|
|
|
|
class TMEchoBridge : public QWidget
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
public:
|
|
|
explicit TMEchoBridge(QWidget *parent = 0);
|
|
|
|
|
|
signals:
|
|
|
|
|
|
public slots:
|
|
|
void listenOnTMEchoBridgePort();
|
|
|
void testTMEchoBridgePort();
|
|
|
void newConnectionOnTMEchoBridgeServer();
|
|
|
int getTMPort();
|
|
|
void displayOnConsole(QString message);
|
|
|
void initSocketStatesList();
|
|
|
void newConnectionOnTCServer();
|
|
|
void sendXML_GSE_HK();
|
|
|
void sendTMPacket(TMPacketToRead *tmPacketToRead);
|
|
|
void clearConsole();
|
|
|
void resetTMStatistics();
|
|
|
|
|
|
private:
|
|
|
QList<QString> socketStates;
|
|
|
|
|
|
unsigned int totalOfBytes;
|
|
|
unsigned int totalOfPackets;
|
|
|
unsigned int totalOfPacketsDropped;
|
|
|
|
|
|
QTcpServer *tmEchoBridgeServer;
|
|
|
QTcpSocket *tmEchoBridgeSocket;
|
|
|
|
|
|
QXmlStreamWriter *xmlWriter;
|
|
|
|
|
|
QTextEdit *console;
|
|
|
|
|
|
QLabel *label_TMServerPort;
|
|
|
QLabel *label_totalOfBytes;
|
|
|
QLabel *label_totalOfPackets;
|
|
|
QLabel *label_totalOfPacketsDropped;
|
|
|
|
|
|
QSpinBox *spinbox_TMServerPort;
|
|
|
|
|
|
QPushButton *button_openServerTCTM;
|
|
|
QPushButton *button_testServerTCTM;
|
|
|
QPushButton *button_sendTestPacket;
|
|
|
QPushButton *button_clearConsole;
|
|
|
QPushButton *button_resetTMStatistics;
|
|
|
|
|
|
QGroupBox *groupbox_ports;
|
|
|
|
|
|
QGridLayout *layout_ports;
|
|
|
QGridLayout *mainLayout;
|
|
|
|
|
|
};
|
|
|
|
|
|
#endif // TMECHOBRIDGE_H
|
|
|
|