WSF
WsfMilExtInterface.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFMILEXTINTERFACE_HPP
13#define WSFMILEXTINTERFACE_HPP
14
15#include "wsf_mil_export.h"
16
19class WsfMilExtension;
20class WsfWeapon;
21
22class WSF_MIL_EXPORT WsfMilExtInterface : public WsfExtInterfaceComponent
23{
24public:
25 static WsfMilExtInterface* Find(const WsfExtInterface& aExt);
26
28
29 WsfComponent* CloneComponent() const override;
30 WsfStringId GetComponentName() const override;
31 const int* GetComponentRoles() const override;
32 void* QueryInterface(int aRole) override;
34
35 typedef std::pair<WsfStringId, WsfStringId> WeaponTargetType;
36 typedef std::map<WeaponTargetType, double> PK_Table;
38 typedef std::map<WsfStringId, int> CategoryToWarheadMap;
39
40 WsfMilExtInterface(WsfMilExtension* aMilExtensionPtr);
41
42 void PrintEmitterTypes(WsfScenario& aScenario, std::ostream& aStream) override;
43
44 bool ProcessInput(UtInput& aInput) override;
45 bool CompleteLoad(WsfScenario& aScenario) override;
46
55 static WsfWeapon* GetWeapon(WsfPlatform* aPlatformPtr,
56 WsfStringId aSensorTypeId,
57 unsigned int aEmitterNameDIS,
58 unsigned int aEmitterIdNumberDIS);
59
68 WsfWeapon* GetWeapon(const WsfScenario& aScenario,
69 WsfStringId aSensorTypeId,
70 unsigned int aEmitterNameDIS,
71 unsigned int aEmitterIdNumberDIS);
72
73 // WsfWeapon* GetWeapon(WsfPlatform* aPlatformPtr,
74 // WsfStringId aSensorTypeId,
75 // unsigned int aEmitterNameDIS,
76 // unsigned int aEmitterIdNumberDIS);
77 // WsfWeapon* GetWeapon(WsfStringId aSensorTypeId,
78 // unsigned int aEmitterNameDIS,
79 // unsigned int aEmitterIdNumberDIS);
80 WsfWeapon* AddWeapon(double aSimTime,
81 WsfPlatform* aPlatformPtr,
82 WsfStringId aSensorTypeId,
83 unsigned int aEmitterNameDIS,
84 unsigned int aEmitterIdNumberDIS);
85
86 WsfStringId SelectWeaponType(WsfSimulation& aSimulation, const WsfExtEntityType& aEntityType);
87
88 int GetWarheadEnum(const WsfPlatformPart* aWarheadPtr);
89
90 int GetDebugWarfarePDU() { return mDebugWarfarePDU; }
91 void SetDebugWarfarePDU(int aDebugWarfarePDU) { mDebugWarfarePDU = aDebugWarfarePDU; }
92 std::string GetExternalWeaponEffectsType() { return mExternalWeaponEffectsType; }
93 double GetSimpleKillRange() { return mSimpleKillRange; }
94 bool GetUseSimpleDetonations() { return mUseSimpleDetonations; }
95 std::set<WsfStringId>& GetExcludedDetonationPlatformTypes() { return mExcludedDetonationPlatformTypes; }
96 std::set<WsfStringId>& GetExcludedDetonationWeaponEffects() { return mExcludedDetonationWeaponEffects; }
97 PK_Table& GetPK_Table() { return sPK_Table; }
98
99 void ProcessEW_TechniqueType(UtInput& aInput);
100 uint32_t GetJamModeSequence(WsfStringId aTechTypeId);
101 WsfStringId GetTechniqueTypeId(uint32_t aJamModeSequence);
102
103private:
104 int mDebugWarfarePDU = 0;
105
106 WsfMilExtension* mMilExtensionPtr = nullptr;
107 std::string mExternalWeaponEffectsType;
108 double mSimpleKillRange = 100.0;
109 bool mUseSimpleDetonations = true;
110 std::set<WsfStringId> mExcludedDetonationPlatformTypes;
111 std::set<WsfStringId> mExcludedDetonationWeaponEffects;
112 PK_Table sPK_Table;
113
115 CategoryToWarheadMap mCategoryToWarheadMap;
116
118 std::map<WsfStringId, uint32_t> sTechTypeToJamModeSeq;
119 std::map<uint32_t, WsfStringId> sJamModeSeqToTechType;
120};
121
123
124#endif
#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)
Definition WsfComponentRoles.hpp:44
@ cWSF_COMPONENT_MIL_EXT_INTERFACE
Definition WsfMilComponentRoles.hpp:24
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfComponent.hpp:39
virtual const int * GetComponentRoles() const =0
virtual WsfStringId GetComponentName() const =0
virtual bool ProcessInput(UtInput &aInput)
Definition WsfComponent.cpp:100
virtual WsfComponent * CloneComponent() const =0
virtual void * QueryInterface(int aRole)=0
Definition WsfExtEntityType.hpp:28
Definition WsfExtInterface.hpp:46
virtual bool CompleteLoad(WsfScenario &aScenario)
Definition WsfExtInterface.hpp:48
virtual void PrintEmitterTypes(WsfScenario &aScenario, std::ostream &aStream)
Definition WsfExtInterface.hpp:49
The WSF Ext is code which is shared between common external interfaces like DIS and HLA.
Definition WsfExtInterface.hpp:183
Definition WsfMilExtInterface.hpp:23
double GetSimpleKillRange()
Definition WsfMilExtInterface.hpp:93
std::map< WsfStringId, int > CategoryToWarheadMap
A map of category ids to enumerations for output of warhead info.
Definition WsfMilExtInterface.hpp:38
static WsfWeapon * GetWeapon(WsfPlatform *aPlatformPtr, WsfStringId aSensorTypeId, unsigned int aEmitterNameDIS, unsigned int aEmitterIdNumberDIS)
Definition WsfMilExtInterface.cpp:202
WsfStringId SelectWeaponType(WsfSimulation &aSimulation, const WsfExtEntityType &aEntityType)
Given an entity type, select the object type to be used.
Definition WsfMilExtInterface.cpp:340
int GetDebugWarfarePDU()
Definition WsfMilExtInterface.hpp:90
std::set< WsfStringId > & GetExcludedDetonationWeaponEffects()
Definition WsfMilExtInterface.hpp:96
WsfMilExtInterface(WsfMilExtension *aMilExtensionPtr)
Definition WsfMilExtInterface.cpp:30
WsfWeapon * AddWeapon(double aSimTime, WsfPlatform *aPlatformPtr, WsfStringId aSensorTypeId, unsigned int aEmitterNameDIS, unsigned int aEmitterIdNumberDIS)
Definition WsfMilExtInterface.cpp:282
int GetWarheadEnum(const WsfPlatformPart *aWarheadPtr)
Definition WsfMilExtInterface.cpp:400
std::map< WeaponTargetType, double > PK_Table
Definition WsfMilExtInterface.hpp:36
bool GetUseSimpleDetonations()
Definition WsfMilExtInterface.hpp:94
void SetDebugWarfarePDU(int aDebugWarfarePDU)
Definition WsfMilExtInterface.hpp:91
std::pair< WsfStringId, WsfStringId > WeaponTargetType
Definition WsfMilExtInterface.hpp:35
std::string GetExternalWeaponEffectsType()
Definition WsfMilExtInterface.hpp:92
static WsfMilExtInterface * Find(const WsfExtInterface &aExt)
Definition WsfMilExtInterface.cpp:171
PK_Table & GetPK_Table()
Definition WsfMilExtInterface.hpp:97
std::set< WsfStringId > & GetExcludedDetonationPlatformTypes()
Definition WsfMilExtInterface.hpp:95
Definition WsfMil.hpp:63
Definition WsfPlatformPart.hpp:61
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfWeapon.hpp:63
Copyrights Multiple, All Rights Reserved