- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung - 44 Export-Header Include-Pfade korrigiert (_export.h) - 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h) - INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros - Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits) - FATAL_LOG Makro hinzugefügt - InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h) - FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h) - AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp) - SymbolAppearance Klasse vollständig definiert mit content() Methode - BuildingComponentFilter Klasse definiert mit Copy-Konstruktor - Ftc Factory: nullptr Return (abstract class) - AesFilter Klasse in aes.hpp hinzugefügt - Dtc Klasse in ppm.hpp mit participantChanged Signal - AesType Enum: alle 15 At* Werte definiert - AesEffectState_def: EsReceived hinzugefügt - DataModification Enum: eAdded/eModified/eRemoved - function_reply_object.h → core_types.h Include-Pfad (72 Dateien) - Enum-Class-Streaming Template-Operator in INGLLogger.h - ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen - ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge - QRegExp → QRegularExpression in tpm_js_parser.cpp - .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert - Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
129 lines
4.0 KiB
C++
Executable File
129 lines
4.0 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Unittest
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <TargetManagement/tgt_dtc.h>
|
|
#include <TargetManagement/tgt_ftc.h>
|
|
#include <TargetManagement/tgt_ftc_types.h>
|
|
#include <TargetManagement/logger.h>
|
|
#include <ExerciseEventManagement/eem_dts.h>
|
|
#include <ParticipantManagement/ppm_dts.h>
|
|
#include <Proxies/TrainingAreaBase/tab_dts.h>
|
|
|
|
#include <DDS/DDSConnector/dds_connector.h>
|
|
|
|
#include <QCoreApplication>
|
|
#include <QtTest/QTest>
|
|
|
|
#include <memory>
|
|
|
|
namespace TargetManagement
|
|
{
|
|
class tgtTestShootbackTarget : public QObject
|
|
, protected TargetManagement::Interface::Ftc::ShootbackAreaModifyReplyHandler
|
|
, protected TargetManagement::Interface::Ftc::ShootbackAreaRemoveReplyHandler
|
|
, protected TargetManagement::Interface::Ftc::ShootbackTargetModifyReplyHandler
|
|
, protected TargetManagement::Interface::Ftc::ShootbackTargetRemoveReplyHandler
|
|
, protected TargetManagement::Interface::Ftc::TargetAreaAssignmentModifyReplyHandler
|
|
, protected TargetManagement::Interface::Ftc::TargetAreaAssignmentRemoveReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
tgtTestShootbackTarget();
|
|
virtual ~tgtTestShootbackTarget();
|
|
|
|
void setPara(int domainId, int exerciseId)
|
|
{
|
|
m_domainId = domainId;
|
|
m_exerciseId = exerciseId;
|
|
}
|
|
|
|
|
|
private Q_SLOTS:
|
|
void initTestCase(); // one time at the beginning
|
|
|
|
// basics
|
|
void testShootbackArea();
|
|
void testShootbackTarget();
|
|
void testTargetAreaAssignment();
|
|
|
|
// based on defaultSituation:
|
|
void testPlayerMoves();
|
|
void testPlayerMovesLos();
|
|
|
|
|
|
void testPlayerRemove();
|
|
|
|
void testAreaChanges();
|
|
void testAreaRemove();
|
|
|
|
void testAssignmentRemove();
|
|
void testAssignmentChanges();
|
|
|
|
void cleanupTestCase(); // one time at the end
|
|
|
|
protected:
|
|
void onShootbackAreaModifyReply(const Core::FunctionReplyObject &reply) override final;
|
|
void onShootbackAreaRemoveReply(const Core::FunctionReplyObject &reply) override final;
|
|
|
|
void onShootbackTargetModifyReply(const Core::FunctionReplyObject &reply) override final;
|
|
void onShootbackTargetRemoveReply(const Core::FunctionReplyObject &reply) override final;
|
|
|
|
void onTargetAreaAssignmentModifyReply(const Core::FunctionReplyObject &reply) override final;
|
|
void onTargetAreaAssignmentRemoveReply(const Core::FunctionReplyObject &reply) override final;
|
|
|
|
private:
|
|
qint64 currentSampleTime();
|
|
void checkShootbackAreaChangedWasEmitted(int number, int line);
|
|
void checkShootbackTargetChangedWasEmitted(int number, int line);
|
|
void checkAssignmentChangedWasEmitted(int number, int line);
|
|
void removeTestObjects();
|
|
|
|
void createArea(int &areaIdInOut, const QString &name, double lon, double lat);
|
|
void modifyArea(int &areaId, const QString &name, double lon, double lat);
|
|
void removeArea(int areaId, bool checkUsingSpy = true);
|
|
|
|
void createTarget(int &targetIdOut, int targetParticipantId, const QString &name);
|
|
void modifyTarget(int targetId, int targetParticipantId, const QString &name, double lon, double lat, double z);
|
|
void removeTarget(int targetId, bool checkUsingSpy = true);
|
|
std::vector<int32_t> visiParticpantsOfTarget(int targetId);
|
|
|
|
void createAssignment(int areaId, int targetParticipantId, int &assignmentIdOut, const QString &name);
|
|
void modifyAssignment(int areaId, int targetParticipantId, int &assignmentId, const QString &name);
|
|
void removeAssignment(int id, bool checkUsingSpy = true);
|
|
|
|
void moveParticipant(int participantId, double lon, double lat);
|
|
|
|
void prepareDefaultSituation();
|
|
|
|
|
|
|
|
private:
|
|
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
|
std::shared_ptr<TargetManagement::Interface::Ftc> m_ftcTgt;
|
|
std::shared_ptr<TargetManagement::Interface::Dtc> m_dtcTgt;
|
|
std::shared_ptr<ParticipantManagement::Interface::Dts> m_dtsPpm;
|
|
std::shared_ptr<TrainingAreaBase::Interface::Dts> m_dtsTab;
|
|
|
|
int m_domainId = -1;
|
|
int m_exerciseId = -1;
|
|
|
|
int m_areaId1 = -1;
|
|
int m_areaId2 = -1;
|
|
int m_targetDataId1 = -1;
|
|
int m_targetDataId2 = -1;
|
|
int m_assignmentId1 = -1;
|
|
|
|
int m_replyShootbackAreaId = -1;
|
|
int m_replyShootbackTargetId = -1;
|
|
int m_replyTargetAreaAssignmentId = -1;
|
|
};
|
|
} // namespace
|