78 lines
1.9 KiB
C++
Executable File
78 lines
1.9 KiB
C++
Executable File
/**
|
|
* Manages the uav interface instances (for TMS-IF) per uav participant
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*
|
|
* Created by Mike Wille, ESZS, 2025-05-22
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "uav_ia.h"
|
|
|
|
#include <TrainingAreaBase/training_area_telegrams.h>
|
|
#include <TrainingAreaBase/dds_handler.h>
|
|
#include <ParticipantManagement/ppm_ftc.h>
|
|
|
|
#include <QObject>
|
|
#include <QMap>
|
|
#include <memory>
|
|
|
|
|
|
namespace ParticipantManagement
|
|
{
|
|
class UAS;
|
|
class MissionPlan;
|
|
namespace Interface { class Dtc; }
|
|
}
|
|
|
|
namespace TrainingAreaBase { class RecvFromTab; }
|
|
|
|
namespace NGL
|
|
{
|
|
class INGLLogger;
|
|
}
|
|
|
|
namespace UAS
|
|
{
|
|
class TmsIfAdapter;
|
|
|
|
using ParticipantId = int;
|
|
|
|
|
|
class UAVInterfaceAdapterManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
UAVInterfaceAdapterManager(const std::shared_ptr<TrainingAreaBase::DdsHandler> &ddsHandler,
|
|
const std::shared_ptr<TrainingAreaBase::RecvFromTab> &sendToDds,
|
|
TmsIfAdapter &tmsIfAdapter, int exerciseId, QObject *parent);
|
|
|
|
void init();
|
|
bool kill(int participantId);
|
|
bool waypoint(int participantId, TrainingAreaBase::TetraIcd::AbsolutePosition absPos, const QString &missionName = {});
|
|
bool tryChangeModeToAuto(int participantId);
|
|
|
|
private:
|
|
void removed(const ParticipantManagement::UAS &uas);
|
|
void modified(const ParticipantManagement::UAS &uas);
|
|
void added(const ParticipantManagement::UAS &uas);
|
|
|
|
void start(const ParticipantManagement::UAS &uas, UAVInterfaceAdapterConfig config);
|
|
void stop(const ParticipantManagement::UAS &uas);
|
|
|
|
void setMissionActionFulfilled(int equipmentNumber);
|
|
|
|
static const int s_domainId;
|
|
int m_exerciseId;
|
|
std::map<UasId, UAVInterfaceAdapter *> m_uavs;
|
|
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtcPpm;
|
|
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftcPpm;
|
|
TmsIfAdapter &m_tmsIfAdapter;
|
|
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_sendToDds;
|
|
NGL::INGLLogger &m_logger;
|
|
};
|
|
} // namespace UAS
|