135 lines
4.0 KiB
C++
Executable File
135 lines
4.0 KiB
C++
Executable File
/**
|
|
* ModuleTests for Msg
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AreaEffectSimulation/aes_dtc.h>
|
|
#include <AreaEffectSimulation/aes_ftc.h>
|
|
#include <AreaEffectSimulation/aes_dts.h>
|
|
#include <CentralEffectSimulation/logger.h>
|
|
|
|
#include <InfrastructureManagement/ism_dts.h>
|
|
#include <ProjectDataManagement/pdm_dts.h>
|
|
#include <CentralEffectSimulation/ces_dtc.h>
|
|
|
|
#include <ParticipantManagement/ppm_dts.h>
|
|
#include <Buildings/bld_dts.h>
|
|
#include <Buildings/bld_fts.h>
|
|
|
|
#include <TrainingAreaBase/tab_fts.h>
|
|
|
|
#include <DDS/DDSConnector/dds_connector.h>
|
|
#include <LtsCoordTrans/lts_coord_trans.h>
|
|
#include <QHash>
|
|
#include <QPointF>
|
|
|
|
namespace CentralEffectSimulation
|
|
{
|
|
class CesTests : public QObject
|
|
, protected Buildings::Interface::Fts::SendCesHitOnBuildingRequestHandler
|
|
, protected TrainingAreaBase::Interface::Fts::SendCesHitRequestHandler
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit CesTests(QObject *parent = nullptr);
|
|
|
|
bool init(int domainId, int exerciseId, int testId, int roomId);
|
|
|
|
bool testsSuccessful() const
|
|
{
|
|
return m_bTestsSuccessful;
|
|
}
|
|
|
|
public Q_SLOTS:
|
|
void startTest();
|
|
protected Q_SLOTS:
|
|
void tryCreateTriggeredExplosion();
|
|
void tryCreateExplosionArea();
|
|
void tryCreateExplosionSinglePrepared();
|
|
void tryCreateExplosionSingle();
|
|
void tryCreateAesItemView();
|
|
void tryCreateAesItemViewSingleExplosions();
|
|
void tryCreateMainStructureElement();
|
|
void tryCreateMainFootprint();
|
|
void tryCreateChargeType();
|
|
void tryCreateAesItemViewBC(AreaEffectSimulation::AesEffectState desiredState = AreaEffectSimulation::AesEffectState_def::EsActivated);
|
|
void tryCreateAesItemViewSM();
|
|
void tryCreateAesItemViewMA();
|
|
// ////////////////////////
|
|
// Participants
|
|
// ////////////////////////
|
|
void tryCreateParticipantPosition();
|
|
void tryCreateBuildingState();
|
|
void tryCreateParticipant();
|
|
void tryCreateDynamicParticipantData();
|
|
|
|
// ////////////////////////
|
|
// Borderline
|
|
// ////////////////////////
|
|
void tryCreateBorderline();
|
|
|
|
void failExit(const char *reason);
|
|
inline void failExit(const QString &reason) { failExit(qPrintable(reason)); }
|
|
void testTimeout() { failExit("Test timeout"); }
|
|
void ExitSuccess();
|
|
private:
|
|
void onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &cookie,
|
|
const Buildings::SendCesHitOnBuildingRequest &request) override;
|
|
void onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
|
|
const TrainingAreaBase::SendCesHitRequest &request) override;
|
|
|
|
void checkParticipantEvent();
|
|
|
|
private: // structs
|
|
struct Participant
|
|
{
|
|
int participantId;
|
|
int equipmentNumber;
|
|
int relX;
|
|
int relY;
|
|
};
|
|
|
|
private:
|
|
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
|
|
|
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector42;
|
|
std::shared_ptr<AreaEffectSimulation::Interface::Dts> m_aesDts;
|
|
std::shared_ptr<InfrastructureManagement::Interface::Dts> m_ismDts;
|
|
std::shared_ptr<ProjectDataManagement::Interface::Dts> m_pdmDts;
|
|
std::shared_ptr<ParticipantManagement::Interface::Dts> m_ppmDts;
|
|
std::shared_ptr<Buildings::Interface::Dts> m_bldDts;
|
|
std::shared_ptr<Buildings::Interface::Fts> m_bldFts;
|
|
std::shared_ptr<TrainingAreaBase::Interface::Fts> m_tabFts;
|
|
std::shared_ptr<CentralEffectSimulation::Interface::Dtc> m_cesDtc;
|
|
|
|
bool m_bTestsSuccessful;
|
|
|
|
|
|
LtsCoordTrans::UtmCoordinate m_housePos;
|
|
NGL::INGLLogger &m_logger;
|
|
int m_testId;
|
|
|
|
int m_buildingId;
|
|
int m_roomId;
|
|
int m_moutObjectId;
|
|
int m_chargeTypeId;
|
|
int m_participantIndex;
|
|
QVector<Participant> m_participants;
|
|
int m_originatorParticipantId;
|
|
int m_countHitOnBuildingReply;
|
|
int m_aesItemId;
|
|
AreaEffectSimulation::AesType m_aesType;
|
|
InfrastructureManagement::MainStructureElement m_mse;
|
|
AreaEffectSimulation::AesItemView m_aiv;
|
|
AreaEffectSimulation::ExplosionSingle m_es;
|
|
QHash<int, Core::GeoPosition2D> m_expectedPosition;
|
|
QPointF m_explosionSingle;
|
|
int m_replyEnterFunctionalArea;
|
|
};
|
|
|
|
} // namespace CentralEffectSimulation
|