WSF
WsfDisInput.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// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFDISINPUT_HPP
16#define WSFDISINPUT_HPP
17
18#include <map>
19#include <set>
20#include <string>
21#include <vector>
22
23class DisBeam;
24class DisSystem;
25#include "DisEntityId.hpp"
26#include "DisEntityType.hpp"
27class UtInput;
28#include "WsfComponentList.hpp"
30#include "WsfDisDevice.hpp"
31class WsfDisEmission;
32class WsfEM_Xmtr;
34class WsfExtInterface;
35#include "WsfExtension.hpp"
36class WsfScenario;
37#include "WsfStringId.hpp"
38
39class WsfDisInput;
40
41class WSF_EXPORT WsfDisComponent : public WsfComponentT<WsfDisInput>
42{
43public:
44 virtual void PrepareComponent(double aSimTime) {}
45 virtual void AddedToDisInterface(WsfDisInterface* aDisInterfacePtr) {}
46 virtual bool TransferPlatformToInternalControl(double aSimTime,
47 WsfPlatform* aPlatformPtr,
48 DisEntityId& aEntityId,
49 DisEntityType& aEntityType)
50 {
51 return false;
52 }
53 virtual bool TransferPlatformToExternalControl(double aSimTime, WsfPlatform* aPlatformPtr) { return false; }
54 virtual void PlatformCreated(WsfDisPlatform* aPlatformPtr) {}
55
56 virtual bool UpdateEmissionSystem(WsfPlatform* aPlatformPtr, WsfDisEmission* aEmissionPtr, DisSystem* aSystemPtr)
57 {
58 return false;
59 }
60
61 virtual bool AddEmissionSystem(WsfPlatform* aPlatformPtr, WsfDisEmission* aEmissionPtr, DisSystem* aSystemPtr)
62 {
63 return false;
64 }
65
66 virtual bool UpdateXmtrFromBeam(WsfDisEmission* aEmissionPtr, DisBeam* aBeamPtr, WsfEM_Xmtr* aXmtrPtr, bool& aBeamOn)
67 {
68 return false;
69 }
70};
71
75{
76public:
79
86
87 using ArticulationVec = std::vector<Articulation>;
88 using ArticulationMap = std::map<WsfStringId, ArticulationVec>;
90 {
92 : mDeviceType(WsfDisDevice::cDEVICE_NONE)
93 , mRecvPort(0)
94 , mSendPort(0)
95 {
96 }
97
98 bool IsComplete();
99
104
109
111
113
115 std::string mAddress;
116 std::string mInterfaceAddress;
119 std::vector<WsfDisFilterAllowance*> mFilterAllowances;
120 };
121 WsfDisInput();
122
123 bool ProcessInput(WsfScenario& aScenario, UtInput& aInput);
124 bool ProcessBlockInput(WsfScenario& aScenario, UtInput& aInput);
125 static bool ValidSignatureTypeName(std::string& aType);
126
128 std::vector<DeviceConfiguration>& GetDeviceConfigurations() { return mDeviceConfigurations; }
129 bool ProcessDeviceInput(WsfScenario& aScenario, UtInput& aInput, DeviceConfiguration& aConfiguration);
130 bool ProcessFilterAllowance(UtInput& aInput, WsfDisFilterAllowance& aAllowance);
131
133 std::set<std::pair<unsigned short, unsigned short>>& GetIgnoredSiteAndApps() { return mIgnoredSiteAndApps; }
134 bool GetIgnoredSiteAndApplicationPair(unsigned int aIndex, std::pair<unsigned short, unsigned short>& aSiteAndAppPair);
135 bool IgnoreSiteAndApplication(unsigned short aSite, unsigned short aApp);
136
139 bool IsTerseMode() const { return mTerseMode; }
140
144
147
148 bool MultiThreaded() const { return mMultiThreaded; }
149
150 bool DebugEnabled() const { return mDebugEnabled; }
151
152 void SuppressNonStandardData(bool aDoSupress);
159 int GetTimeToLive() const { return mMulticastTimeToLive; }
161
162 void AddComponent(Component* aComponentPtr) { mComponents.AddComponent(aComponentPtr); }
163 const ComponentList& GetComponents() const { return mComponents; }
164
165protected:
166 bool ProcessArticulatedPart(UtInput& aInput);
167
168 using RangeFilteredPlatforms = std::vector<std::tuple<WsfStringId, size_t, double>>; // Name, Id, range
169 using NameTypeToStateIdPair = std::pair<WsfStringId, int>;
170 using StringToStateIdPair = std::pair<std::string, WsfStringId>;
171 using StringToStateIdVec = std::vector<StringToStateIdPair>;
172 using IdIdToStringIDMap = std::map<NameTypeToStateIdPair, StringToStateIdVec>;
173 using IdIdToStringIDMapIter = std::map<NameTypeToStateIdPair, StringToStateIdVec>::iterator;
174
175public:
176 union
177 {
178 struct
179 {
182 bool mShadowAll : 1;
188 bool mUsePduTime : 1;
189 bool mAutostart : 1;
193 bool mTerseMode : 1;
202 bool mDebugThread : 1;
209
211
224 };
225 unsigned int mFlags;
226 };
230
231protected:
232 std::set<WsfStringId> mShadowTypeId;
233 std::set<WsfStringId> mShadowNameId;
234 std::vector<DeviceConfiguration> mDeviceConfigurations;
236 std::set<WsfExtEntityType> mIgnoredTypes;
237 std::set<DisEnum8> mIgnoredPduTypes;
238 std::set<std::pair<unsigned short, unsigned short>> mIgnoredSiteAndApps;
239 std::set<std::pair<unsigned short, unsigned short>> mIgnoredKindAndDomain;
246
250
253
255
258
260};
261
262#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
A component list that stores only components of a specified type.
Definition WsfComponentList.hpp:343
WsfComponentT()
Definition WsfComponent.hpp:124
virtual bool ProcessInput(UtInput &aInput)
Definition WsfComponent.cpp:100
std::vector< ArticulationP > ArticulationList
Definition WsfDisArticulatedPart.hpp:51
Definition WsfDisInput.hpp:42
virtual void PrepareComponent(double aSimTime)
Definition WsfDisInput.hpp:44
virtual void AddedToDisInterface(WsfDisInterface *aDisInterfacePtr)
Definition WsfDisInput.hpp:45
virtual bool AddEmissionSystem(WsfPlatform *aPlatformPtr, WsfDisEmission *aEmissionPtr, DisSystem *aSystemPtr)
Definition WsfDisInput.hpp:61
virtual bool TransferPlatformToExternalControl(double aSimTime, WsfPlatform *aPlatformPtr)
Definition WsfDisInput.hpp:53
virtual bool UpdateXmtrFromBeam(WsfDisEmission *aEmissionPtr, DisBeam *aBeamPtr, WsfEM_Xmtr *aXmtrPtr, bool &aBeamOn)
Definition WsfDisInput.hpp:66
virtual bool TransferPlatformToInternalControl(double aSimTime, WsfPlatform *aPlatformPtr, DisEntityId &aEntityId, DisEntityType &aEntityType)
Definition WsfDisInput.hpp:46
virtual void PlatformCreated(WsfDisPlatform *aPlatformPtr)
Definition WsfDisInput.hpp:54
virtual bool UpdateEmissionSystem(WsfPlatform *aPlatformPtr, WsfDisEmission *aEmissionPtr, DisSystem *aSystemPtr)
Definition WsfDisInput.hpp:56
A base class for a DIS I/O device (file, network, etc).
Definition WsfDisDevice.hpp:33
DeviceType
Definition WsfDisDevice.hpp:36
@ cDEVICE_NONE
Definition WsfDisDevice.hpp:37
@ cDEVICE_PLAYBACK
Definition WsfDisDevice.hpp:39
@ cDEVICE_RECORD
Definition WsfDisDevice.hpp:38
@ cDEVICE_MULTICAST
Definition WsfDisDevice.hpp:40
Definition WsfDisEmission.hpp:37
Definition WsfDisFilterAllowance.hpp:33
Definition WsfDisInput.hpp:75
bool SuppressNonStandardData() const
Returns 'true' if the DIS interface is only sending standard DIS data.
Definition WsfDisInput.hpp:146
unsigned mMaxBadPDU_Count
Definition WsfDisInput.hpp:227
bool mSendPeriodicsWhilePaused
Definition WsfDisInput.hpp:186
WsfDisComponent Component
Definition WsfDisInput.hpp:77
IdIdToStringIDMap mConfigIdByName
Definition WsfDisInput.hpp:251
ComponentList mComponents
Definition WsfDisInput.hpp:259
std::set< std::pair< unsigned short, unsigned short > > mIgnoredSiteAndApps
Definition WsfDisInput.hpp:238
bool mUseTrackJamForTrackingRequests
Definition WsfDisInput.hpp:200
std::vector< std::tuple< WsfStringId, size_t, double > > RangeFilteredPlatforms
Definition WsfDisInput.hpp:168
bool mJoinExercise
Join an exercise for non-realtime simulation.
Definition WsfDisInput.hpp:197
unsigned int mFlags
Definition WsfDisInput.hpp:225
std::set< WsfStringId > mShadowTypeId
Definition WsfDisInput.hpp:232
const ComponentList & GetComponents() const
Definition WsfDisInput.hpp:163
bool mLogCreatedEntities
Definition WsfDisInput.hpp:183
static bool ValidSignatureTypeName(std::string &aType)
Definition WsfDisInput.cpp:935
bool mShadowAll
Definition WsfDisInput.hpp:182
std::vector< StringToStateIdPair > StringToStateIdVec
Definition WsfDisInput.hpp:171
bool SuppressCME_DetectBeam() const
Definition WsfDisInput.hpp:157
bool mUsePduTime
Definition WsfDisInput.hpp:188
bool MultiThreaded() const
Definition WsfDisInput.hpp:148
double GetSensorUpdateInterval() const
Definition WsfDisInput.hpp:158
std::vector< DeviceConfiguration > mDeviceConfigurations
Definition WsfDisInput.hpp:234
IdIdToStringIDMap mAfterBurnerByName
Definition WsfDisInput.hpp:244
std::set< WsfExtEntityType > mIgnoredTypes
Definition WsfDisInput.hpp:236
bool SuppressCME_EntityData() const
Definition WsfDisInput.hpp:156
IdIdToStringIDMap mAfterBurnerByType
Definition WsfDisInput.hpp:245
bool mSuppressCME_EntityData
'true' if the non-standard 'other' PDU used for CME entity data should NOT be sent.
Definition WsfDisInput.hpp:215
bool mUseSimpleAccelerations
Definition WsfDisInput.hpp:192
bool mTerseMode
Definition WsfDisInput.hpp:193
bool mUseSimpleOrientRates
Use the calculated simple orientation rates.
Definition WsfDisInput.hpp:195
int GetTimeToLive() const
Definition WsfDisInput.hpp:159
std::set< std::pair< unsigned short, unsigned short > > & GetIgnoredSiteAndApps()
Returns the list of ignored sites and applications.
Definition WsfDisInput.hpp:133
bool mDebugEnabled
Definition WsfDisInput.hpp:181
std::map< WsfStringId, ArticulationVec > ArticulationMap
Definition WsfDisInput.hpp:88
std::pair< std::string, WsfStringId > StringToStateIdPair
Definition WsfDisInput.hpp:170
bool mSuppressCME_DetectBeam
Deprecated commands.
Definition WsfDisInput.hpp:213
bool IsTerseMode() const
Definition WsfDisInput.hpp:139
bool mSuppressCME_PassiveSensor
'true' if the non-standard practice of sending emissions PDUs for passive sensors should NOT take pla...
Definition WsfDisInput.hpp:219
WsfDisInput()
Definition WsfDisInput.cpp:34
std::vector< DeviceConfiguration > & GetDeviceConfigurations()
Return whether device configurations for evaluation.
Definition WsfDisInput.hpp:128
ArticulationMap mArticulationByType
Definition WsfDisInput.hpp:249
bool mIgnoreStopFreezePDU
Ignore the Stop/Freeze PDU; can be used by simulations running asynchronously.
Definition WsfDisInput.hpp:208
std::set< int > sExcludedPlatformTypes
Definition WsfDisInput.hpp:257
double mThreadSleepTime
Definition WsfDisInput.hpp:229
std::set< DisEnum8 > mIgnoredPduTypes
Definition WsfDisInput.hpp:237
bool mSuppressCME_DrawData
'true' if the non-standard practice of sending WsfDraw PDUs across the network should NOT take place
Definition WsfDisInput.hpp:217
bool UseTrackJamForTrackingRequests()
Is the sensor track-jam list being used to indicate a tracking request.
Definition WsfDisInput.hpp:154
std::map< NameTypeToStateIdPair, StringToStateIdVec > IdIdToStringIDMap
Definition WsfDisInput.hpp:172
WsfDisArticulatedPart::ArticulationList mArticulationList
Definition WsfDisInput.hpp:254
std::vector< Articulation > ArticulationVec
Definition WsfDisInput.hpp:87
std::pair< WsfStringId, int > NameTypeToStateIdPair
Definition WsfDisInput.hpp:169
std::map< NameTypeToStateIdPair, StringToStateIdVec >::iterator IdIdToStringIDMapIter
Definition WsfDisInput.hpp:173
bool mDebugAppearanceUpdates
Definition WsfDisInput.hpp:187
bool ProcessBlockInput(WsfScenario &aScenario, UtInput &aInput)
Definition WsfDisInput.cpp:77
double mInputHeartbeatMultiplier
Definition WsfDisInput.hpp:240
RangeFilteredPlatforms mRangeFilteredPlatforms
Definition WsfDisInput.hpp:235
WsfComponentListT< WsfDisComponent > ComponentList
Definition WsfDisInput.hpp:78
bool mSuppressCommData
Definition WsfDisInput.hpp:184
bool mUseWorldToBodyAngularVelocities
Force the world (Euler) angular velocities to body axis angular velocities.
Definition WsfDisInput.hpp:204
const WsfDisArticulatedPart::ArticulationList & GetArticulationList() const
Definition WsfDisInput.hpp:160
std::set< WsfStringId > mShadowNameId
Definition WsfDisInput.hpp:233
bool DebugEnabled() const
Definition WsfDisInput.hpp:150
ArticulationMap mArticulationByName
Map for changing appearance (signatures, etc.) via articulated parts.
Definition WsfDisInput.hpp:248
bool mSuppressNonStandardData
'true' if WSF will only output standard DIS data.
Definition WsfDisInput.hpp:223
bool mAutostart
Definition WsfDisInput.hpp:189
bool mDebugThread
Definition WsfDisInput.hpp:202
bool UseSimpleAccelerations() const
Definition WsfDisInput.hpp:143
IdIdToStringIDMap mConfigIdByType
Definition WsfDisInput.hpp:252
bool SuppressCME_PassiveSensor() const
Definition WsfDisInput.hpp:155
bool mSuppressEmissionsData
Definition WsfDisInput.hpp:185
int mMulticastTimeToLive
Definition WsfDisInput.hpp:228
double mSensorUpdateInterval
Definition WsfDisInput.hpp:241
std::set< std::pair< unsigned short, unsigned short > > mIgnoredKindAndDomain
Definition WsfDisInput.hpp:239
void AddComponent(Component *aComponentPtr)
Definition WsfDisInput.hpp:162
bool mUseDeprecatedCME_DrawData
'true' if the WsfDraw DIS 'Other' PDUs containing draw commands will be sent using the deprecated for...
Definition WsfDisInput.hpp:221
bool sDebugEnabled
Definition WsfDisInput.hpp:256
bool mSimpleMissReporting
Definition WsfDisInput.hpp:201
bool mMultiThreaded
Definition WsfDisInput.hpp:180
bool mZeroBodyAngularVelocities
Zero out the world (Euler) angular velocities to body axis angular velocities.
Definition WsfDisInput.hpp:206
Definition WsfDisInterface.hpp:83
An internal class used by WsfDisInterface to maintain information about a platform.
Definition WsfDisPlatform.hpp:67
Definition WsfEM_Xmtr.hpp:55
The WSF Ext is code which is shared between common external interfaces like DIS and HLA.
Definition WsfExtInterface.hpp:183
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
Definition WsfDisInput.hpp:81
WsfStringId mScriptId
Definition WsfDisInput.hpp:84
WsfStringId mVariableId
Definition WsfDisInput.hpp:83
int mPartNumber
Definition WsfDisInput.hpp:82
bool IsDefined() const
Definition WsfDisInput.hpp:112
bool IsExternalDevice() const
Definition WsfDisInput.hpp:110
std::string mAddress
Definition WsfDisInput.hpp:115
WsfDisDevice::DeviceType mDeviceType
Definition WsfDisInput.hpp:114
int mSendPort
Definition WsfDisInput.hpp:118
std::vector< WsfDisFilterAllowance * > mFilterAllowances
Definition WsfDisInput.hpp:119
std::string mInterfaceAddress
Definition WsfDisInput.hpp:116
bool IsInputDevice() const
Definition WsfDisInput.hpp:100
int mRecvPort
Definition WsfDisInput.hpp:117
bool IsOutputDevice() const
Definition WsfDisInput.hpp:105
DeviceConfiguration()
Definition WsfDisInput.hpp:91
Copyrights Multiple, All Rights Reserved