/** * @RDE_HEADER@ * ModuleTest * $Id$ * $HeadURL$ * $Author$ */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace AreaEffectSimulation; // JUST FOR LOGGER_T class CmdLineParser : public LtsCommandLineParser::LtsCommandLineParser { public: CmdLineParser() : LtsCommandLineParser(ProvideCommandLineParameterOptions(DomainId|ExerciseId|NoVersion)) { } }; class ModuleTestExplosionCluster : public QObject , protected ParticipantManagement::Interface::Ftc::SetSimulatedPositionReplyHandler , protected ParticipantManagement::Interface::Ftc::SetSimulatedParticipantFormationReplyHandler , protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterModifyReplyHandler , protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterOcModifyReplyHandler , protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterSingleEffectOnlyModifyReplyHandler , protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterPauseResumeReplyHandler , protected AreaEffectSimulation::Interface::Ftc::TargetPositionsModifyReplyHandler , protected Buildings::Interface::Ftc::SetBuildingStatesReplyHandler { Q_OBJECT public: ModuleTestExplosionCluster(int domainId, int exerciseId); protected: void onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) override; void onSetSimulatedParticipantFormationReply(const Core::FunctionReplyObject &replyObject) override; void onExplosionClusterModifyReply(const Core::FunctionReplyObject &replyObject) override; void onExplosionClusterSingleEffectOnlyModifyReply(const Core::FunctionReplyObject &replyObject) override; void onExplosionClusterOcModifyReply(const Core::FunctionReplyObject &replyObject) override; void onExplosionClusterPauseResumeReply(const Core::FunctionReplyObject &replyObject) override; void onTargetPositionsModifyReply(const Core::FunctionReplyObject &replyObject) override; void onSetBuildingStatesReply(const Core::FunctionReplyObject &replyObject) override; void onExplosionClusterChanged(const AreaEffectSimulation::ExplosionCluster &data, DataModification modType); void onBuildingStateChanged(const Buildings::BuildingState &bldgState, DataModification modType); void onAesItemViewChanged(const AreaEffectSimulation::AesItemView &aesItemView, DataModification modType); void onEffectsChanged(const AreaEffectSimulation::Effects &effects, DataModification modType); void onTrajectoryTimeAwareChanged(const AreaEffectSimulation::TrajectoryTimeAware &data, DataModification modType); // pre-condition void setupParticipants(); bool checkParticipant_5(); bool checkParticipant_6(); bool checkParticipant_89(); bool checkParticipant_99(); void resetBldgs(); int getBldgId(const QString &bldgName) const; // helper bool waitForData(const std::function &func, int retryCount = 10); ExplosionCluster getEcForTneVerification(const QString &eaName = QStringLiteral("ModuleTest_TneVerification__"), double rotation = 0); ExplosionCluster getEcFor1104(const QString &eaName = QStringLiteral("ModuleTest_ec__")); ExplosionCluster getEcFor1106(const QString &eaName = QStringLiteral("ModuleTest_ec__")); ExplosionCluster getEcForUBAHN(const QString &eaName = QStringLiteral("ModuleTest_ec__")); ExplosionCluster getEcFor3101(const QString &eaName = QStringLiteral("ModuleTest_ec__")); int doExplosionClusterModifyRequest(const ExplosionCluster &eaData); int doExplosionClusterSingleEffectOnlyModifyRequest(const ExplosionClusterSingleEffectOnlyRequest &request); int doExplosionClusterOcModifyRequest(const ExplosionClusterOcModifyRequest &request); int doExplosionClusterTargetPositionsModify(const TargetPositionsModifyRequest &request); void waitForEffectStates(int lineNumber, int durPrep = 5, int durAct = 60, int durExp = 30); private Q_SLOTS: // // TestCases // // void initTestCase_data(); // will be called to create a global test data table. void initTestCase(); // will be called before the first test function is executed. void init(); // will be called before each test function is executed. // void cleanup(); // will be called after each test function is executed. void dumpCnt(); void dumpBldgStates(); bool setFilterForBldgState(const QString &bldgName); bool checkSingleEffects(uint idx, const LtsCoordTrans::LtsCoordinate &coord, const AreaEffectSimulation::AesZPlacement zPlace , const QString &context, double maxDist3D = 1); bool checkBldgStates(const QVector &damagePercent, const QString &context); bool isKanaeleAssigned(); void test_justSetupParticipants(); void test_TneVerificationBremen_00(); void test_TneVerificationBremen_01(); void test_TneVerificationBremen_02(); // !!! assume ONE elevationMap: Altmark_dt1.tif !!! // !!! assume ONE elevationMap: Altmark_dt1.tif !!! // !!! assume ONE elevationMap: Altmark_dt1.tif !!! void test_bldg_1104_Proximity(); void test_bldg_1104_Impact(); void test_bldg_1104_Delay(); void test_bldg_1106_Proximity(); void test_bldg_1106_Impact(); void test_bldg_1106_Delay(); void test_bldg_UBAHN_Proximity(); void test_bldg_UBAHN_Impact(); void test_bldg_UBAHN_Delay(); void test_bldg_3101_Proximity(); void test_bldg_3101_Impact(); void test_bldg_3101_Delay(); void test_remove_effect_start(); void test_create_bulk(); // has to be call explicitly called by user void test_point_geometry_bldg_1104(); void test_point_geometry_bldg_1104_SMArt_Proximity(); // NT, Jan 2025: since SMArt seems to be 'not implememented yet', test case fails // ExplosionCluster 'OC' / 'ABT' void test_bldg_1104_OC(); // ExplosionCluster 'Light' (without trajectory) void test_point_geometry_bldg_1104_light(); void test_point_geometry_bldg_1104_single_effect_only(); // Von HLA void test_bldg_1104_effects_only(); // Von ABT // VULCANO void test_vulcano_bldg_1104(); void test_vulcano_bldg_1104_withTargetModify(); void test_vulcano_bldg_1104_withTargetModify2(); // will be called after the last test function was executed: void cleanupTestCase(); // will be called after the last test function was executed. public: static bool m_enable_create_bulk; private: int m_domainId{-1}; int m_exerciseId{-1}; int m_traingAreaId{-1}; std::shared_ptr m_ddsConnector; std::shared_ptr m_aesFtc; std::shared_ptr m_aesDtc; std::shared_ptr m_pdmDtc; std::shared_ptr m_bldFtc; std::shared_ptr m_bldDtc; // std::shared_ptr m_ismFtc; std::shared_ptr m_ismDtc; std::shared_ptr m_ppmDtc; std::shared_ptr m_ppmFtc; std::shared_ptr m_exmDtc; ExplosionCluster m_data; Effects m_effects; long m_objectRequestedTimePointMsec{-1}; AesItemView m_aesItemViewSingleExplosions; bool m_replyError{false}; QMap m_bldgIdToName; int m_bldgIdToFilter{-1}; std::vector m_buildingStateVec; struct counterDds { // ExplosionCluster int cntExplosionCluster{0}; // AesItemView int cntAtExplosionCluster{0}; int cntAtExplosionClusterGunToTargetLine{0}; // Effects int cntExplosionClusterEffects{0}; // Trajectory int cntTrajectory{0}; void reset() { cntExplosionCluster = 0; cntAtExplosionCluster = 0; cntAtExplosionClusterGunToTargetLine = 0; cntExplosionClusterEffects = 0; cntTrajectory = 0; } } m_counterDds; LOGGER_T m_logger; };