307 lines
8.8 KiB
C++
Executable File
307 lines
8.8 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Interface
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// Own
|
|
#include "unified_map_object_data.h"
|
|
#include "plugin_provider.h"
|
|
#include "map_object_type.h"
|
|
#include "resource_manager_mode.h"
|
|
#include <Map/situation_map_types.h>
|
|
#include <Common/situation_map_logging.h>
|
|
|
|
#include <Common/ref_pointer.h>
|
|
|
|
// Plugins
|
|
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
|
|
|
|
// Qt
|
|
#include <QObject>
|
|
#include <QPointer>
|
|
|
|
|
|
namespace SituationMap
|
|
{
|
|
|
|
// forward:
|
|
class AbstractMapObject;
|
|
class AirSupportImpact2SituationMap;
|
|
//class AlarmToMap;
|
|
class Building2SituationMap;
|
|
class BuildingHitlineInfo2SituationMap;
|
|
class BuildingOutline;
|
|
class GeoImage;
|
|
class BuildingContamination;
|
|
class BuildingOwnership;
|
|
class GuezIed2SituationMap;
|
|
class GuezNasat9Liner2SituationMap;
|
|
class HitlineInfo2SituationMap;
|
|
class Map;
|
|
class TrainingAreaToSituationMap;
|
|
class SpecialAreaToSituationMap;
|
|
class MountingPointToMap;
|
|
class SoundAreaToMap;
|
|
class MSEPointToMap;
|
|
class MSEBridgeToMap;
|
|
class MovementTrackManager;
|
|
class Participant;
|
|
class Participant2SituationMap;
|
|
class PdmHandler;
|
|
class Sim2SituationMapBase;
|
|
class ShootbackAreaToSituationMap;
|
|
class Polygon;
|
|
class EmergencyCallToMap;
|
|
class ChargeEffectToMap;
|
|
class SingleFire;
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
class AdapterDds : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/*! \name Construction, Destruction */
|
|
//@{
|
|
explicit AdapterDds(QObject *parent = nullptr);
|
|
virtual ~AdapterDds();
|
|
//@}
|
|
|
|
/*! \name Initialization */
|
|
//@{
|
|
bool init(Map *map, PluginProvider *pluginProvider, QPointer<SituationMap::MovementTrackManager> &movementTrackMgr, bool resourceMode);
|
|
|
|
bool initRenderer3D_AesExtrusion();
|
|
bool initRenderer3D_AesCentral_Booby(const QString &layernameAesCentral, const QVector<int> &aesTypesForReRunIfPartyColorChanges);
|
|
|
|
// For boobyTraps
|
|
bool assignUniqueValueRendererAesCentral(const QString &layername);
|
|
|
|
// For Areas (AreaEffect)
|
|
bool assignUniqueValueRendererAesCentral3DExtrusion(const QString &layername);
|
|
|
|
bool run();
|
|
bool isRunning() const;
|
|
bool stop();
|
|
|
|
void clearObjects();
|
|
//@}
|
|
|
|
/*! \name ResourceManagerMode (PlanView|ComponentMonitor) ... */
|
|
//@{
|
|
ResourceManagerMode resourceManagerMode() const;
|
|
bool setResourceManagerMode(ResourceManagerMode rmm);
|
|
//@}
|
|
|
|
/*! \name EmergencyCalls ... */
|
|
//@{
|
|
bool showExpiredEmergencyCalls(bool bShowExpired);
|
|
//@}
|
|
|
|
|
|
/*! \name uniqueMapId... */
|
|
//@{
|
|
bool uniqueMapId2SimId(UniqueMapId uniqueMapIdIn, int32_t &simIdOut);
|
|
|
|
// unifiedMapObjectData
|
|
bool unifiedMapObjectData(UniqueMapId uniqueMapIdIn, UnifiedMapObjectData &umodOut) const;
|
|
//@}
|
|
|
|
|
|
/*! \name simId... */
|
|
//@{
|
|
// Participant:
|
|
UniqueMapId simId2UniqueMapIdParticipant(int32_t simId) const;
|
|
RefPointer<Participant> simId2Participant(int32_t simId);
|
|
|
|
QPointer<MovementTrackManager> movementTrackManager() const { return m_movementTrackManager; }
|
|
|
|
// Aes
|
|
UniqueMapId simId2UniqueMapIdAes(int32_t simId) const;
|
|
RefPointer<AbstractMapObject> simId2Aes(int32_t simId);
|
|
|
|
// Building
|
|
UniqueMapId simId2UniqueMapIdBuilding(int32_t simId) const;
|
|
RefPointer<BuildingOutline> simId2Building(int32_t simId);
|
|
|
|
// Bridge
|
|
UniqueMapId simId2UniqueMapIdBridge(int32_t simId) const;
|
|
RefPointer<BuildingOutline> simId2Bridge(int32_t simId);
|
|
|
|
// MountingPoint
|
|
UniqueMapId simId2UniqueMapIdMountingPoint(int32_t simId) const;
|
|
RefPointer<GeoImage> simId2MountingPoint(int32_t simId);
|
|
|
|
// GuezIEDs
|
|
UniqueMapId simId2UniqueMapIdGuezIed(int32_t simId) const;
|
|
RefPointer<Participant> simId2GuezIed(int32_t simId);
|
|
|
|
// Charge Effect
|
|
UniqueMapId simId2UniqueMapIdChargeEffect(int32_t simId) const;
|
|
RefPointer<SingleFire> simId2ChargeEffect(int32_t simId);
|
|
|
|
|
|
// TrainingAreas
|
|
UniqueMapId simId2UniqueMapIdTrainingArea(int32_t simId) const;
|
|
RefPointer<SituationMap::Polygon> simId2TrainingArea(int32_t simId);
|
|
|
|
// SpecialAreas
|
|
UniqueMapId simId2UniqueMapIdSpecialArea(int32_t simId) const;
|
|
RefPointer<SituationMap::Polygon> simId2SpecialArea(int32_t simId);
|
|
|
|
// ShootbackAreas
|
|
UniqueMapId simId2UniqueMapIdShootbackArea(int32_t simId) const;
|
|
RefPointer<SituationMap::Polygon> simId2ShootbackArea(int32_t simId);
|
|
|
|
// more general approach:
|
|
UniqueMapId simId2UniqueMapId(MapObjectType mot, int32_t simId) const;
|
|
QVector<UniqueMapId> simIds2UniqueMapIds(MapObjectType mot, QVector<int32_t> simIds) const;
|
|
RefPointer<AbstractMapObject> simId2MapObject(MapObjectType mot, int32_t simId);
|
|
//@}
|
|
|
|
|
|
/*! \name Object Selection */
|
|
//@{
|
|
Sim2SituationMapBase *situationMapBase(MapObjectType mot) const;
|
|
bool setMapObjectSelected(MapObjectType mot, const QVector<int> &entityIds, bool selection = true);
|
|
bool clearMapObjectSelection(MapObjectType mot = MapObjectType::MOT_Undefined);
|
|
//@}
|
|
|
|
|
|
/*! \name BuildingOwnership */
|
|
//@{
|
|
bool isBuildingOwnershipSupported() const;
|
|
bool isBuildingOwnershipVisible() const;
|
|
bool setBuildingOwnershipVisible(bool visible);
|
|
//@}
|
|
|
|
/*! \name BuildingContamination */
|
|
//@{
|
|
bool isBuildingContaminationSupported() const;
|
|
bool isBuildingContaminationVisible() const;
|
|
bool setBuildingContaminationVisible(bool visible);
|
|
//@}
|
|
|
|
/*! \name Participants */
|
|
//@{
|
|
bool enableFireEventFlashing(bool enable);
|
|
bool isFireEventFlashingEnabled() const;
|
|
//@}
|
|
|
|
/*! \name Nmea own Position!*/
|
|
bool setOwnPositionVisible(bool enable);
|
|
bool isOwnPositionVisible() const;
|
|
|
|
|
|
Q_SIGNALS:
|
|
void mapObjectChanged(UniqueMapId uniqueMapId); // to refresh MapObjectSelectionWidget for example
|
|
void mapObjectRemoved(UniqueMapId uniqueMapId); // to refresh MapObjectSelectionWidget for example
|
|
|
|
void participantPositionChanged(const int32_t participantId, const Point3D &newPos); // to update OC situation range for example
|
|
void resourceManagerModeChanged(ResourceManagerMode newMode);
|
|
|
|
|
|
public Q_SLOTS:
|
|
void restart() { stop(); run(); }
|
|
void restartIfRunning()
|
|
{
|
|
if (!this->isRunning())
|
|
return;
|
|
restart();
|
|
}
|
|
|
|
|
|
/*! \name SymbolDictionary */
|
|
//@{
|
|
void onSymbolDictionaryChanged();
|
|
//@}
|
|
|
|
/*! \name Click events */
|
|
//@{
|
|
bool onMapObjectClicked(const RefPointer<AbstractMapObject> &mapObject);
|
|
bool onMapObjectClicked(UniqueMapId uniqueMapId);
|
|
bool onMapObjectsClicked(const QVector<UniqueMapId> &uniqueMapIds);
|
|
//@}
|
|
|
|
/*! \name Changed events for ordering */
|
|
//@{
|
|
void onMapObjectChangedUpdateDrawOrder(UniqueMapId uniqueMapId);
|
|
void onMapObjectRemoved(UniqueMapId uniqueMapId);
|
|
//@}
|
|
|
|
private slots:
|
|
|
|
void onParticipantOwnPositionChanged(const Point3D &newPos, int64_t sampleTime);
|
|
|
|
private:
|
|
void startChangedDelayTimer();
|
|
void startOwnPositionOutdatedTimer();
|
|
QList<Sim2SituationMapBase *> listOfSim2Map() const;
|
|
QList<Sim2SituationMapBase *> listOfAes2Map() const;
|
|
|
|
private:
|
|
bool m_isShowOwnPosition{true};
|
|
bool m_isRunning{false};
|
|
QTimer *m_changedDelayTimer{nullptr};
|
|
QTimer *m_ownPositionOutdatedTimer{nullptr};
|
|
|
|
|
|
QPointer<Map> m_map;
|
|
PdmHandler *m_pdmHandler{nullptr};
|
|
PluginProvider *m_pluginProvider{nullptr};
|
|
|
|
// Participants:
|
|
QSharedPointer<Participant2SituationMap> m_particpants;
|
|
QMap<int32_t, long> m_participantId2uniqueMapId;
|
|
QPointer<SituationMap::MovementTrackManager> m_movementTrackManager;
|
|
QSharedPointer<HitlineInfo2SituationMap> m_hitlineInfo2SituationMap;
|
|
QSharedPointer<BuildingHitlineInfo2SituationMap> m_bldHitlineInfo2SituationMap;
|
|
|
|
|
|
// AES:
|
|
QMap<int, Sim2SituationMapBase *> m_aes2MapCont;
|
|
QMap<UniqueMapId, qint64> m_startTimeMap; // contains the effectStartTime of (aes) objects to order them by time
|
|
|
|
QSharedPointer<ChargeEffectToMap> m_chargeEffects;
|
|
|
|
// ALM:
|
|
QSharedPointer<EmergencyCallToMap> m_emergencyCalls;
|
|
|
|
|
|
// Asm
|
|
QSharedPointer<TrainingAreaToSituationMap> m_trainingAreas;
|
|
|
|
// CES: CentralEffectSimulation
|
|
QSharedPointer<BuildingOwnership> m_buildingOwnership;
|
|
QSharedPointer<BuildingContamination> m_buildingContamination;
|
|
|
|
// ISM:
|
|
QSharedPointer<MountingPointToMap> m_mountingPoints;
|
|
QSharedPointer<SoundAreaToMap> m_soundAreas;
|
|
QSharedPointer<Building2SituationMap> m_buildings;
|
|
QSharedPointer<MSEPointToMap> m_msePoints; // mses == MainStructureElement
|
|
QSharedPointer<MSEBridgeToMap> m_mseBridges; // mses == MainStructureElement
|
|
QSharedPointer<SpecialAreaToSituationMap> m_specialAreas;
|
|
|
|
// GIM
|
|
QSharedPointer<GuezIed2SituationMap> m_guezIeds;
|
|
|
|
// GNA
|
|
QSharedPointer<GuezNasat9Liner2SituationMap> m_guezNasat9Liner;
|
|
|
|
// TGT
|
|
QSharedPointer<ShootbackAreaToSituationMap> m_shootbackAreas;
|
|
|
|
LOGGER_T m_logger;
|
|
};
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
} // namespace
|