WSF
WsfThreatProcessor.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 WSFTHREATPROCESSOR_HPP
13#define WSFTHREATPROCESSOR_HPP
14
15#include "wsf_mil_export.h"
16
17#include <set>
18
20class WsfLocalTrack;
21class WsfScript;
23class WsfTrack;
24#include "WsfTrackId.hpp"
25#include "WsfTrackList.hpp"
26
31
32class WSF_MIL_EXPORT WsfThreatProcessor : public WsfScriptProcessor
33{
34public:
36 WsfThreatProcessor(WsfScenario& aScenario, const std::string& aPartClass, const std::string& aPartVarName);
38 ~WsfThreatProcessor() override = default;
39 WsfProcessor* Clone() const override;
40
41 bool Initialize(double aSimTime) override;
42 void Update(double aSimTime) override;
43 bool ProcessInput(UtInput& aInput) override;
44
45 void Enable() { mEnabled = true; }
46 void Disable() { mEnabled = false; }
47
48 std::set<WsfTrackId>* GetThreatList();
49 WsfTrack* GetNearestThreat();
50
51 void AddThreat(WsfTrack* aTrackPtr);
52 void RemoveThreat(WsfTrack* aTrackPtr);
53
54 const char* GetScriptClassName() const override { return "WsfThreatProcessor"; }
55
56 bool IsThreatening(WsfTrack* aTrackPtr, bool aKnown = false);
57
58protected:
60
62 virtual void IdentifiedNewThreat(double aSimTime, const WsfTrack* aTrackPtr);
63
65 virtual void DroppedThreat(double aSimTime, const WsfTrack* aTrackPtr);
66
67private:
68 void UpdateThreatList(double aSimTime);
69 bool IsKnown(WsfTrack* aTrackPtr);
70 void RemoveDroppedTracks(double aSimTime);
71
72 UtScript* mIdentifiedNewThreatScriptPtr;
73 UtScript* mDroppedThreatScriptPtr;
74
75 std::set<WsfTrackId> mThreatList;
76 bool mEnabled;
77 double mThreatVelocity; // the velocity above which a track is considered threatening
78 double mThreatAngleSpread; // the relative heading of the threat to you
79 // required (or smaller) for something to be threatening
80 double mThreatTimeToIntercept; // the distance/vel threshold below which
81 // a track may be considered to be threatening
82 bool mRequireIFF_FOE; // require an IFF_FOE for threat
83 bool mIgnoreLowerAlts; // prunes out all threats at lower altitude
84 bool mIgnoreNoLocation; // prune out threats that lack location data
85 bool mIgnoreNoVelocity; // prune out threats that lack velocity data
86
87 UtScriptClass* mTrackClassPtr;
88};
89
90#endif
Definition WsfLocalTrack.hpp:32
WsfProcessor(const WsfScenario &aScenario)
Definition WsfProcessor.cpp:25
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfScriptContext.hpp:71
void Update(double aSimTime) override
Definition WsfScriptProcessor.cpp:281
WsfProcessor * Clone() const override
Definition WsfScriptProcessor.cpp:97
WsfScriptProcessor(const WsfScenario &aScenario)
Definition WsfScriptProcessor.cpp:30
bool Initialize(double aSimTime) override
Definition WsfScriptProcessor.cpp:104
bool ProcessInput(UtInput &aInput) override
Definition WsfScriptProcessor.cpp:186
Definition WsfThreatProcessor.hpp:33
const char * GetScriptClassName() const override
Definition WsfThreatProcessor.hpp:54
WsfThreatProcessor(WsfScenario &aScenario)
The default constructor.
Definition WsfThreatProcessor.cpp:40
void Disable()
Definition WsfThreatProcessor.hpp:46
~WsfThreatProcessor() override=default
void Enable()
Definition WsfThreatProcessor.hpp:45
WsfThreatProcessor & operator=(const WsfThreatProcessor &)=delete
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Copyrights Multiple, All Rights Reserved