WSF
SurveillancePart.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI//REL TO USA ONLY
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#ifndef L16_SURVEILLANCEPART_HPP
12#define L16_SURVEILLANCEPART_HPP
13
14#include <set>
15
16#include "ComputerPart.hpp"
17#include "InputEnumeration.hpp"
18#include "UtScriptData.hpp"
19class WsfLocalTrack;
20class WsfTrack;
21#include "WsfTrackId.hpp"
22class WsfTrackManager;
23#include "wsf_l16_export.h"
24
25#include "WsfTypes.hpp"
26
27namespace WsfL16
28{
29class Interface;
30
32class WSF_L16_EXPORT SurveillancePart : public ComputerPart
33{
34public:
35 SurveillancePart(WsfScenario& aScenario);
37 ~SurveillancePart() override = default;
38
39 ComputerPart* Clone() const override;
40
41 bool Initialize(double aSimTime, ComputerProcessor& aComputer) override;
42
43 bool ProcessInput(UtInput& aInput) override;
44
46 void HandleReceive(double aSimTime, const Messages::InitialBase& aMessage) override;
47
49 void HandleSend(double aSimTime) override;
50
53 bool SuppressSensor(WsfStringId aSensorName, bool aSuppress);
54
55 // GetTrackNumber called by an external method.
56 int GetTrackNumber(WsfLocalTrack& aLocalTrack);
57
58 // SendAirTrack called by an external method.
59 void SendAirTrack(double aSimTime, const WsfTrack& aTrack, int aTrackNumber);
60
62
63protected:
64 bool HaveReportingResponsibility(double aSimTime,
65 const WsfTrack* aTrackPtr,
66 const WsfLocalTrack* aLocalTrackPtr,
67 int aLink16_TrackQuality, // for aTrackPtr
68 std::string& aTrackNumberString,
69 bool& aIsR2_Switch);
70
72
80
81 void TrackUpdated(const WsfTrack& aTrack);
82
83 void TrackCreated(const WsfTrack& aTrack);
84
85 void TrackDropped(const WsfTrack& aTrack);
86
87 void RawTrackReceived(const WsfTrack& aTrack);
88
89 void RawTrackDropped(const WsfTrack& aTrack);
90
91 void SendLandTrack(double aSimTime, const WsfTrack& aTrack, int aTrackNumber);
92
93 void SendSubsurfaceTrack(double aSimTime, const WsfTrack& aTrack, int aTrackNumber);
94 void SendSurfaceTrack(double aSimTime, const WsfTrack& aTrack, int aTrackNumber);
95
96 void SendSpaceTrack(double aSimTime, const WsfTrack& aTrack, int aTrackNumber);
97
98 bool IsTrackReportable(const WsfTrack& aTrack);
99
100 bool IsSensorTrackSuppressed(const WsfTrack& aTrack);
101 struct TrackInfo;
102
103 using TrackMap = std::map<WsfTrackId, TrackInfo>;
104 using TrackList = std::list<TrackMap::iterator>;
105
107 {
109 TrackList::iterator mIterator;
111 };
112
113 TrackMap::iterator FindTrackToSend();
114
115 bool TrackAvailableToSend(double aSimTime);
116
117 // Map containing all of the current tracks
119
120 // Track lists:
121 // Tracks get pushed to back, and pulled from front
122
123 // A list of unmodified tracks.
125
126 // A list of tracks that have been modified
128 double mMaxSendInterval{6.0};
133 std::pair<int, int> mTrackNumberRange{0, 0};
136 std::set<int> mSuppressDomains;
137 std::set<WsfStringId> mSuppressSensors;
141};
142} // namespace WsfL16
143
144#endif
ut::script::Data UtScriptData
Definition WsfScriptContext.hpp:47
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
@ WSF_SPATIAL_DOMAIN_AIR
Cars, trucks, buildings, etc.
Definition WsfTypes.hpp:35
Reads values from UtInput to set an enumeration.
Definition InputEnumeration.hpp:22
ComputerPart(WsfScenario &aScenario, const std::string &aClassName="WsfProcessor")
Definition ComputerPart.cpp:41
Sends and receives link16 messages.
Definition ComputerProcessor.hpp:50
Definition Interface.hpp:116
Interface * mInterfacePtr
Definition SurveillancePart.hpp:140
int mNextTrackNumber
Definition SurveillancePart.hpp:134
bool HaveReportingResponsibility(double aSimTime, const WsfTrack *aTrackPtr, const WsfLocalTrack *aLocalTrackPtr, int aLink16_TrackQuality, std::string &aTrackNumberString, bool &aIsR2_Switch)
Definition SurveillancePart.cpp:415
void SendAirTrack(double aSimTime, const WsfTrack &aTrack, int aTrackNumber)
Definition SurveillancePart.cpp:729
SurveillancePart(WsfScenario &aScenario)
Definition SurveillancePart.cpp:44
ComputerPart * Clone() const override
Definition SurveillancePart.cpp:73
bool TrackAvailableToSend(double aSimTime)
Definition SurveillancePart.cpp:516
std::pair< int, int > mTrackNumberRange
Definition SurveillancePart.hpp:133
bool OwningPlatformWantsTrackRefNumber(const WsfTrack &aTrack)
Definition SurveillancePart.cpp:949
TrackList mUpdatedTracks
Definition SurveillancePart.hpp:127
bool ProcessInput(UtInput &aInput) override
Definition SurveillancePart.cpp:165
~SurveillancePart() override=default
std::set< int > mSuppressDomains
Definition SurveillancePart.hpp:136
void HandleSend(double aSimTime) override
This method is called when the a slot is open.
Definition SurveillancePart.cpp:240
bool mIgnoreReportingResponsibility
Definition SurveillancePart.hpp:131
TrackList mUnchangedTracks
Definition SurveillancePart.hpp:124
UtScriptData * mTrackVariablePtr
Definition SurveillancePart.hpp:139
TrackMap::iterator FindTrackToSend()
Definition SurveillancePart.cpp:522
bool mSuppressDeadTargets
Definition SurveillancePart.hpp:130
WsfTrackManager * mTrackManager
Definition SurveillancePart.hpp:132
int GetTrackNumber(WsfLocalTrack &aLocalTrack)
Definition SurveillancePart.cpp:916
std::list< TrackMap::iterator > TrackList
Definition SurveillancePart.hpp:104
std::set< WsfStringId > mSuppressSensors
Definition SurveillancePart.hpp:137
InputEnumeration mSpatialDomainInput
Definition SurveillancePart.hpp:138
bool SuppressSensor(WsfStringId aSensorName, bool aSuppress)
Definition SurveillancePart.cpp:973
bool mSendNonSensorReports
Definition SurveillancePart.hpp:129
std::map< WsfTrackId, TrackInfo > TrackMap
Definition SurveillancePart.hpp:103
bool Initialize(double aSimTime, ComputerProcessor &aComputer) override
Definition SurveillancePart.cpp:79
TrackEnvironment
Definition SurveillancePart.hpp:74
@ cAIR
Definition SurveillancePart.hpp:75
@ cSUBSURFACE
Definition SurveillancePart.hpp:77
@ cSURFACE
Definition SurveillancePart.hpp:76
@ cLAND
Definition SurveillancePart.hpp:78
WsfSimulation * GetSimulation() const
Definition SurveillancePart.cpp:968
int mDefaultTrackDomain
Definition SurveillancePart.hpp:135
void HandleReceive(double aSimTime, const Messages::InitialBase &aMessage) override
Handle an incoming message.
Definition SurveillancePart.cpp:236
TrackMap mTracks
Definition SurveillancePart.hpp:118
double mMaxSendInterval
Definition SurveillancePart.hpp:128
Definition WsfLocalTrack.hpp:32
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 WsfTrackManager.hpp:62
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
This file should be included prior to defining a message. Currently there is a limit of 32 fields per...
Definition AllMessages.hpp:55
Definition SurveillancePart.hpp:107
bool mIsUpdated
Definition SurveillancePart.hpp:110
TrackList::iterator mIterator
Definition SurveillancePart.hpp:109
double mLastSendTime
Definition SurveillancePart.hpp:108
Copyrights Multiple, All Rights Reserved