- Merged 292 changed files from dlbo snapshot - Fixed IDL enum collisions (PortType, PdmEventType) - Fixed Grantlee template for C++11 scoped enums - Fixed CMake VERSION_GREATER syntax - Added missing directories (THP, LtsRestClient, etc.) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
67 lines
1.6 KiB
C++
Executable File
67 lines
1.6 KiB
C++
Executable File
/**
|
|
* Send / Receive telegrams to/from PrtCnv
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QWebSocketServer>
|
|
#include <QWebSocket>
|
|
#include <QTimer>
|
|
#include <QUdpSocket>
|
|
#include <TrainingAreaBase/tab_plugin_interface.h>
|
|
#include <nglsettings/nglsettings_settings.h>
|
|
#include <DDS/Core/function_reply_object.h> // tr_lts
|
|
#include "logger.h"
|
|
|
|
namespace Nmea
|
|
{
|
|
class NmeaHandlerRx;
|
|
class NmeaHandlerTx;
|
|
class NmeaDispatcher final : public TrainingAreaBase::Plugin::Interface
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit NmeaDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
|
|
const std::shared_ptr<TrainingAreaBase::RecvFromTab> &recvFromTabCb, NGL::Settings *settings);
|
|
|
|
public slots:
|
|
bool init() override;
|
|
|
|
public:
|
|
std::shared_ptr<TrainingAreaBase::SendToTab> sendToTab() override;
|
|
bool isDebugInterface() const override { return false; }
|
|
bool canSendData() const override;
|
|
void exerciseChanged() override;
|
|
const char *name() const override { return tr_lts("dds", "TETRA"); }
|
|
|
|
|
|
private slots:
|
|
void connected();
|
|
void disconnected();
|
|
void bytesWritten(qint64 bytes);
|
|
void readyRead();
|
|
void reconnectTimerSlot();
|
|
private:
|
|
void reconnect();
|
|
QString getNmeaHost();
|
|
int getNmeaPort();
|
|
private:
|
|
std::shared_ptr<NmeaHandlerRx> m_rxHandler;
|
|
std::shared_ptr<NmeaHandlerTx> m_txHandler;
|
|
TrainingAreaBase::Plugin::DataProvider *m_dataProvider;
|
|
|
|
int m_nmeaPort;
|
|
QString m_nmeaHost;
|
|
QUdpSocket *m_socket;
|
|
QTimer *m_reconnectTimer;
|
|
NGL::INGLLogger &m_logger;
|
|
NGL::Settings *m_settings;
|
|
};
|
|
|
|
} // namespace WlsTetra
|