66 lines
1015 B
C++
Executable File
66 lines
1015 B
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
namespace NGL
|
|
{
|
|
class INGLLogger;
|
|
}
|
|
|
|
namespace UAS
|
|
{
|
|
class UAVCommander;
|
|
|
|
using UasId = int;
|
|
|
|
|
|
struct UAVInterfaceAdapterConfig
|
|
{
|
|
public:
|
|
UAVInterfaceAdapterConfig(const QString &ip, int port, UasId uasId, bool useTcp)
|
|
: m_ip(ip)
|
|
, m_port(port)
|
|
, m_uasId(uasId)
|
|
, m_useTcp(useTcp)
|
|
{}
|
|
|
|
bool operator==(const UAVInterfaceAdapterConfig &o) const
|
|
{
|
|
return (o.m_ip == m_ip
|
|
&& o.m_port == m_port
|
|
&& o.m_uasId == m_uasId
|
|
&& o.m_useTcp == m_useTcp);
|
|
}
|
|
|
|
QString m_ip;
|
|
int m_port;
|
|
UasId m_uasId;
|
|
bool m_useTcp;
|
|
};
|
|
|
|
|
|
|
|
class UAVInterfaceAdapter : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
UAVInterfaceAdapter(UAVInterfaceAdapterConfig uavConfig, UAVCommander *commander);
|
|
~UAVInterfaceAdapter();
|
|
|
|
UAVInterfaceAdapterConfig config() const { return m_config; }
|
|
UAVCommander &commander() { return *m_commander; }
|
|
|
|
private:
|
|
|
|
NGL::INGLLogger &m_logger;
|
|
UAVInterfaceAdapterConfig m_config;
|
|
UAVCommander *m_commander;
|
|
};
|
|
}
|