WSF
WsfLaserDesignations Class Reference

#include <WsfLaserDesignations.hpp>

Inheritance diagram for WsfLaserDesignations:
Collaboration diagram for WsfLaserDesignations:

Classes

class  Spot
class  UpdateEvent

Public Member Functions

 WsfLaserDesignations ()=default
 WsfLaserDesignations (WsfLaserDesignationsData &aSetupData)
 ~WsfLaserDesignations () override
void Update (double aSimTime)
bool Initialize () override
void UpdateCallbacks ()
bool AddOrUpdate (const Spot &aDesignator, const double aEmitterLocationWCS[3])
bool Remove (const Spot &aDesignator)
void GetAllSpots (std::vector< const Spot * > &aSpotPtrs)
void GetSpecified (unsigned int aLaserCode, double aWaveLength, std::vector< const Spot * > &aSpotPtrs)
void PlatformDeleted (double aSimTime, WsfPlatform *aPlatPtr)
Public Member Functions inherited from WsfSimulationExtension
 WsfSimulationExtension ()
 ~WsfSimulationExtension () override=default
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
virtual void AddedToSimulation ()
virtual bool PrepareExtension ()
virtual bool PlatformsInitialized ()
virtual void PendingStart ()
virtual void Start ()
virtual void Complete (double aSimTime)
Public Member Functions inherited from WsfExtension
virtual ~WsfExtension ()=default
const std::string & GetExtensionName () const
Public Member Functions inherited from WsfLaserDesignationsData
 WsfLaserDesignationsData ()=default
 WsfLaserDesignationsData (const WsfLaserDesignationsData &aSrc)=default
 ~WsfLaserDesignationsData ()=default
void SetInputProcessed (bool aValue)
bool InputIsProcessed () const
void SetDebug (bool aValue)
bool DebugEnabled () const

Public Attributes

UtCallbackListN< void(const Spot &)> SpotUpdated

Additional Inherited Members

static void __private_SetSim (WsfSimulationExtension &aExtension, WsfSimulation *aSimPtr)
Protected Member Functions inherited from WsfExtension
void InitializeExtensionName (const std::string &aName)
Protected Attributes inherited from WsfLaserDesignationsData
bool mDebug {false}
bool mProcessedInput {false}
bool mSendExternal {true}
unsigned int mUpdatePrintModulus {157}
double mStaleOutInterval {5.0}
double mUpdateInterval {3.0}
double mPlatformRadius {1.5}

Detailed Description

A singleton class to obtain information about Laser Designations that exist in the Simulation, produced either locally, or received externally via DIS connection. Currently makes several simplifying assumptions: Only one emitter per platform, one designation per emitter, and one designation per target platform (no overspill or underspill). As class is fleshed out, the assumptions may be removed. Also, the DIS dead reckoning algorithm enumeration is not used, nor is the spot acceleration.

When a spot is placed in the environment, a flag is set to permit target occlusion of the spot to be internally considered by this class or not. A high-fidelity laser designator model may itself consider target occlusion, with a detailed target facet model available for this purpose. If so, the Spot it would place should have its SetAddLocalOcclusion(false). Note that the default is true. If true, the non-occulted "ground-lase" WCS location is always set into the spot, and is available as GetLocationWCS(), if there is no target platform association. But if a target entity is associated with the spot, the provided WCS laser spot is relocated in target-relative coordinates if appropriate. The relo- cation is to place the spot on the surface of a sphere at radius R toward the designator from the target center reference. A target ECS-relative offset is computed, using the relocated spot position. Then the "true" WCS spot location is obtainable via the GetTargetAdjustedLocationWCS() function. To prevent latency or coordinate frame mismatches from causing a designation position error, when the designation is associated with an entity, the local ECS offset should be used, rather than WCS. The GetTargetAdjustedLocationWCS() function does this automatically. WHAT CONSITUTES A "RADIUS"? - For each target, if Length, Width, and Height values are set in the platform, then R is computed as the cube root of (L * L + W * W + H * H). But if any of (L,W,H) are zero, we will use the default radius mPlatformRadius provided to this class.

Constructor & Destructor Documentation

◆ WsfLaserDesignations() [1/2]

◆ WsfLaserDesignations() [2/2]

WsfLaserDesignations::WsfLaserDesignations ( WsfLaserDesignationsData & aSetupData)

◆ ~WsfLaserDesignations()

WsfLaserDesignations::~WsfLaserDesignations ( )
override

Member Function Documentation

◆ AddOrUpdate()

bool WsfLaserDesignations::AddOrUpdate ( const Spot & aDesignation,
const double aEmitterLocationWCS[3] )

Function to refresh a particular laser designation.

Parameters
aDesignationLaser designation to update. (The designation itself will contain a time stamp.)
aEmitterLocationWCSLocation of the designator. Is used to discern LOS of sensor.
Returns
true if the designation had to be created and added.

References WsfLaserDesignations::Spot::GetDesignatingIndex(), WsfSimulation::GetSimTime(), WsfSimulationExtension::GetSimulation(), WsfLaserDesignations::Spot::IsLocal(), WsfLaserDesignationsData::mDebug, WsfLaserDesignationsData::mPlatformRadius, WsfLaserDesignationsData::mSendExternal, WsfLaserDesignationsData::mUpdatePrintModulus, simTime, SpotUpdated, and UpdateCallbacks().

Referenced by WsfLaserDesignations().

◆ GetAllSpots()

void WsfLaserDesignations::GetAllSpots ( std::vector< const Spot * > & aSpotPtrs)

Referenced by WsfLaserDesignations().

◆ GetSpecified()

void WsfLaserDesignations::GetSpecified ( unsigned int aLaserCode,
double aWaveLength,
std::vector< const Spot * > & aSpotPtrs )

Referenced by WsfLaserDesignations().

◆ Initialize()

bool WsfLaserDesignations::Initialize ( )
overridevirtual

Function to Initialize the laser designations. (Function is internally callback-queued, so does not need explicitly called by the user.)

Returns
true if successful.

Reimplemented from WsfSimulationExtension.

References WsfLaserDesignationsData::mProcessedInput, and success.

Referenced by WsfLaserDesignations(), and WsfLaserDesignations().

◆ PlatformDeleted()

void WsfLaserDesignations::PlatformDeleted ( double aSimTime,
WsfPlatform * aPlatPtr )

Function to inform the object of simulation platform deletions. Called by the simulation, users need not call it explicitly.

Parameters
aSimTimeCurrent simulation time.
aPlatPtrPointer to the platform to be deleted.

References WsfPlatform::GetIndex(), and WsfSimulationExtension::GetSimulation().

Referenced by UpdateCallbacks(), and WsfLaserDesignations().

◆ Remove()

bool WsfLaserDesignations::Remove ( const Spot & aDesignation)

Function to remove a particular laser designation.

Parameters
aDesignationLaser designation to remove.
Returns
true if the designation was indeed removed.

References WsfLaserDesignations::Spot::GetDesignatingIndex(), WsfSimulation::GetSimTime(), WsfSimulationExtension::GetSimulation(), WsfLaserDesignations::Spot::IsExternal(), WsfLaserDesignationsData::mDebug, and simTime.

Referenced by WsfLaserDesignations().

◆ Update()

void WsfLaserDesignations::Update ( double aSimTime)

Function to refresh the laser designations, including getting rid of stale/orphaned ones. (Function is internally event-queued, so does not need explicitly called by the user.)

Parameters
aSimTimeCurrent simulation time.

References WsfLaserDesignationsData::mDebug, and WsfLaserDesignationsData::mStaleOutInterval.

◆ UpdateCallbacks()

void WsfLaserDesignations::UpdateCallbacks ( )

Member Data Documentation

◆ SpotUpdated

UtCallbackListN<void(const Spot&)> WsfLaserDesignations::SpotUpdated

Referenced by AddOrUpdate().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved