WSF
WsfSensorComponent Class Reference

#include <WsfSensorComponent.hpp>

Inheritance diagram for WsfSensorComponent:
Collaboration diagram for WsfSensorComponent:

Public Types

using TrackerSettings = WsfSensorTrackerSettings
Public Types inherited from WsfComponentT< WsfSensor >
typedef WsfSensor ParentType
 This is needed to support the WsfComponentList template.

Utility methods.

WsfSensorGetSensor () const
WsfPlatformGetPlatform () const
WsfSimulationGetSimulation () const

Generic methods.

Actual sensor model implementations do not need to worry about calling these directly because they are required to call base class methods that end up calling these methods. (e.g. WsfRadarSensor::ProcessInput calls WsfSensor::ProcessInput).

These always have the same argument lists as the routine from which they are called.

virtual bool ProcessModeInput (UtInput &aInput, WsfSensorMode &aSensorMode)
virtual bool ProcessBeamInput (UtInput &aInput, WsfSensorBeam &aSensorBeam)
virtual void PlatformAdded (double aSimTime, WsfPlatform *aPlatformPtr)
virtual void PlatformDeleted (WsfPlatform *aPlatformPtr)
virtual void SelectMode (double aSimTime, WsfStringId aModeNameId)
virtual void DeselectMode (double aSimTime, WsfStringId aModeNameId)
virtual void TurnOn (double aSimTime)
virtual void TurnOff (double aSimTime)
virtual bool Initialize (double aSimTime)
virtual bool Initialize2 (double aSimTime)
virtual bool PreInitialize (double aSimTime)
virtual bool ProcessInput (UtInput &aInput)

Model-specific methods.

Actual sensor models (e.g. WsfRadarSensor, WsfGeometricSensor, etc.) must place calls in their code because there is no common location from where these methods could be called. See the static wrapper methods below.

virtual void AttemptToDetect (double aSimTime, WsfSensorResult &aResult)
 Extends the sensor-model implementation of AttemptToDetect.
virtual void PostAttemptToDetect (double aSimTime, WsfPlatform *aTargetPtr, WsfSensorResult &aResult)
virtual void ComputeSphericalMeasurementErrors (const WsfSensorResult &aResult, wsf::SphericalMeasurementErrors &aErrors) const
virtual void PrePerformScheduledDetections (double aSimTime)
virtual void PostPerformScheduledDetections (double aSimTime)
virtual void UpdateTrack (double aSimTime, WsfTrack *aTrackPtr, WsfPlatform *aTargetPtr, WsfSensorResult &aResult)

Track maintenance.

These are called by derived implementations of WsfSensorTracker prior to performing the indicated function. They are more or less in order of call.

virtual bool TrackerAllowTracking (double aSimTime, const TrackerSettings &aSettings, const WsfTrackId &aRequestId, size_t aObjectId, WsfTrack *aTrackPtr, WsfSensorResult &aResult)
virtual void TrackerInitializeTrack (double aSimTime, const TrackerSettings &aSettings, const WsfTrackId &aRequestId, size_t aObjectId, WsfSensorMode *aModePtr, WsfTrack *&aTrackPtr)
virtual void TrackerUpdateTrack (double aSimTime, const TrackerSettings &aSettings, const WsfTrackId &aRequestId, size_t aObjectId, WsfSensorMode *aModePtr, WsfTrack *aTrackPtr, WsfPlatform *aTargetPtr, WsfSensorResult &aResult)
virtual void TrackerDropTrack (double aSimTime, const TrackerSettings &aSettings, const WsfTrackId &aRequestId, size_t aObjectId, WsfSensorMode *aModePtr, WsfTrack *aTrackPtr)

Model-specific wrapper methods.

These wrap the model-specific methods so specific models only need to have one line inserted into their code where component effects need to be evaluated.

static void AttemptToDetect (WsfSensor &aSensor, double aSimTime, WsfSensorResult &aResult)
 Convenience method to call AttemptToDetect on all the components.
static bool PostAttemptToDetect (WsfSensor &aSensor, double aSimTime, WsfPlatform *aTargetPtr, WsfSensorResult &aResult)
static WSF_DEPRECATED void ComputeMeasurementErrors (WsfSensor &aSensor, WsfSensorResult &aResult, double &aAzError, double &aElError, double &aRangeError, double &aRangeRateError)
 (DEPRECATED) Convenience method to call ComputeMeasurementErrors on all the components.
static void ComputeSphericalMeasurementErrors (WsfSensor &aSensor, const WsfSensorResult &aResult, wsf::SphericalMeasurementErrors &aErrors)
 Convenience method to call ComputeSphericalMeasurementErrors on all the components.
static void PrePerformScheduledDetections (WsfSensor &aSensor, double aSimTime)
 Convenience method to call PrePerformScheduledDetections on all the components.
static void PostPerformScheduledDetections (WsfSensor &aSensor, double aSimTime)
 Convenience method to call PostPerformScheduledDetections on all the components.
static void UpdateTrack (WsfSensor &aSensor, double aSimTime, WsfTrack *aTrackPtr, WsfPlatform *aTargetPtr, WsfSensorResult &aResult)
 Convenience method to call UpdateTrack on all the components.

Additional Inherited Members

Public Member Functions inherited from WsfComponentT< WsfSensor >
 WsfComponentT ()
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
virtual void ComponentParentChanged (ParentType *aParentPtr)
ParentTypeGetComponentParent () const
void SetComponentParent (ParentType *aParentPtr)
Public Member Functions inherited from WsfComponent
virtual ~WsfComponent ()=default
virtual WsfComponentCloneComponent () const =0
virtual WsfStringId GetComponentName () const =0
virtual const int * GetComponentRoles () const =0
virtual void * QueryInterface (int aRole)=0
virtual int GetComponentInitializationOrder () const
template<typename T>
bool QueryInterfaceT (T *&aRolePtr)
bool ComponentHasRole (int aRole)
 Returns true if the component has the specified role.
virtual void PreInput ()

Detailed Description

A abstract base class for sensor extension components. Components can be added to implement additional functionality beyond what is provided by a specific model. The responsibilities of a derived class include: -) Implementing the 'required interface' methods as defined in WsfComponent. -) Implementing any desired 'common framework' methods defined in WsfComponent. -) Implementing any desired methods as defined below. -) Implementing the specific capabilities required by the derived class.

Member Typedef Documentation

◆ TrackerSettings

Member Function Documentation

◆ AttemptToDetect() [1/2]

virtual void WsfSensorComponent::AttemptToDetect ( double aSimTime,
WsfSensorResult & aResult )
inlinevirtual

Extends the sensor-model implementation of AttemptToDetect.

Reimplemented in WsfCTD_SensorComponent, and WsfEW_SensorComponent.

Referenced by WsfSAR_Sensor::SAR_Mode::AttemptToDetect(), and WsfSurfaceWaveRadarSensor::RadarMode::AttemptToDetect().

◆ AttemptToDetect() [2/2]

void WsfSensorComponent::AttemptToDetect ( WsfSensor & aSensor,
double aSimTime,
WsfSensorResult & aResult )
static

Convenience method to call AttemptToDetect on all the components.

References WsfSensor::GetComponents(), and WsfComponentList::HasComponents().

◆ ComputeMeasurementErrors()

void WsfSensorComponent::ComputeMeasurementErrors ( WsfSensor & aSensor,
WsfSensorResult & aResult,
double & aAzError,
double & aElError,
double & aRangeError,
double & aRangeRateError )
static

◆ ComputeSphericalMeasurementErrors() [1/2]

virtual void WsfSensorComponent::ComputeSphericalMeasurementErrors ( const WsfSensorResult & aResult,
wsf::SphericalMeasurementErrors & aErrors ) const
inlinevirtual

Modify or compute spherical measurement errors for any sensor error model that produces spherical sensor errors (see WsfStandardSensorErrorModel).

Reimplemented in WsfEW_SensorComponent.

Referenced by wsf::StandardSensorErrorModel::ComputeMeasurementErrors(), WsfPassiveSensor::PassiveMode::PassiveErrorModel::ComputeMeasurementErrors(), and WsfSensorMode::ComputeMeasurementErrors().

◆ ComputeSphericalMeasurementErrors() [2/2]

void WsfSensorComponent::ComputeSphericalMeasurementErrors ( WsfSensor & aSensor,
const WsfSensorResult & aResult,
wsf::SphericalMeasurementErrors & aErrors )
static

Convenience method to call ComputeSphericalMeasurementErrors on all the components.

References WsfSensor::GetComponents(), and WsfComponentList::HasComponents().

◆ DeselectMode()

virtual void WsfSensorComponent::DeselectMode ( double aSimTime,
WsfStringId aModeNameId )
inlinevirtual

◆ GetPlatform()

◆ GetSensor()

◆ GetSimulation()

◆ Initialize()

bool WsfComponent::Initialize ( double aSimTime)
virtual

Perform phase 1 initialization. This is called by WsfPlatform::Initialize() during phase 1 initialization of the platform. The component should complete validation of input data that could not be done by ProcessInput, as well as any other functions to prepare for simulation use (subject to the next paragraph).

The order in which components are initialized is defined by GetComponentInitializationOrder. In general a component implementation of this method should not be dependent on the state of another component, i.e.: it should not assume that the other components Initialize() method has been called. If such a dependency exists one should use Initialize2() if possible, or specify a value GetComponentInitializationOrder to force things to initialize in a particular order.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful (bad input data, etc.)
Note
This method should NOT add any other components to the platform. This MUST be done in PreInitialize().

Reimplemented from WsfComponent.

Reimplemented in WsfSolarElevationAtTargetSensorComponent, and WsfSolarIlluminationComponent.

◆ Initialize2()

bool WsfComponent::Initialize2 ( double aSimTime)
virtual

Perform phase 2 initialization. This is called by WsfPlatform::Initialize() during phase 2 of platform initialization. This method is typically used when a component may have some dependency on another component having completed its phase 1 initialization. The component should be ready for use in the simulation upon completion of this method.

The order in which components are initialized is defined by GetComponentInitializationOrder.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful.
Note
This method MUST NOT add any other components to the platform. This MUST be done in PreInitialize().

Reimplemented from WsfComponent.

◆ PlatformAdded()

virtual void WsfSensorComponent::PlatformAdded ( double aSimTime,
WsfPlatform * aPlatformPtr )
inlinevirtual

Reimplemented in WsfCTD_SensorComponent.

◆ PlatformDeleted()

virtual void WsfSensorComponent::PlatformDeleted ( WsfPlatform * aPlatformPtr)
inlinevirtual

Reimplemented in WsfCTD_SensorComponent.

◆ PostAttemptToDetect() [1/2]

◆ PostAttemptToDetect() [2/2]

bool WsfSensorComponent::PostAttemptToDetect ( WsfSensor & aSensor,
double aSimTime,
WsfPlatform * aTargetPtr,
WsfSensorResult & aResult )
static

Convenience method to call PostAttemptToDetect on all the components.

Parameters
aSensor[input] The sensor for which to loop all PostAttemptToDetect calls.
aSimTime[input] The current simulation time.
aTargetPtr[input] The platform under detection.
aResult[input/output] The results from the sensor detection causing the track update.
Returns
bool The aResult.Detected() for all calls to the sensor's components with PostAttemptToDetect.

References WsfSensorResult::Detected(), WsfSensor::GetComponents(), and WsfComponentList::HasComponents().

◆ PostPerformScheduledDetections() [1/2]

virtual void WsfSensorComponent::PostPerformScheduledDetections ( double aSimTime)
inlinevirtual

Extends WsfSensor::PerformScheduledDetections Called by models just after exiting the loop.

Reimplemented in WsfEW_SensorComponent.

Referenced by WsfRadarSensor::PerformScheduledDetections().

◆ PostPerformScheduledDetections() [2/2]

void WsfSensorComponent::PostPerformScheduledDetections ( WsfSensor & aSensor,
double aSimTime )
static

Convenience method to call PostPerformScheduledDetections on all the components.

References WsfSensor::GetComponents(), and WsfComponentList::HasComponents().

◆ PreInitialize()

bool WsfComponent::PreInitialize ( double aSimTime)
virtual

Perform pre-initializion function. This is called by WsfPlatform::Initialize prior to actually initializing the components on a platform (i.e.: calling Initialize and Initialize2 for each component). The primary reason for this method is to allow components to add other components that will then be subsequently initialized. The component may examine the component list and add components, but it must not assume ANYTHING about the actual state of the component.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful (bad input data, etc.)

Reimplemented from WsfComponent.

◆ PrePerformScheduledDetections() [1/2]

virtual void WsfSensorComponent::PrePerformScheduledDetections ( double aSimTime)
inlinevirtual

Extends WsfSensor::PerformScheduledDetections. Called by models just before entering the loop.

Reimplemented in WsfEW_SensorComponent.

Referenced by WsfRadarSensor::PerformScheduledDetections().

◆ PrePerformScheduledDetections() [2/2]

void WsfSensorComponent::PrePerformScheduledDetections ( WsfSensor & aSensor,
double aSimTime )
static

Convenience method to call PrePerformScheduledDetections on all the components.

References WsfSensor::GetComponents(), and WsfComponentList::HasComponents().

◆ ProcessBeamInput()

virtual bool WsfSensorComponent::ProcessBeamInput ( UtInput & aInput,
WsfSensorBeam & aSensorBeam )
inlinevirtual

◆ ProcessInput()

bool WsfComponent::ProcessInput ( UtInput & aInput)
virtual

Evaluate the current input command and determine if it is one processed by the component. The component should get the current command from the input stream and determine if it is one that it recognizes. If it does not recognize the command then it should leave the command in the input stream and return false. If it does recognize the command then it should process the command and return true. If invalid arguments are encountered then it should throw an exception.

Parameters
aInputThe input stream.
Returns
true if the current command was recognized (and processed), or false if the command was not recognized.
Exceptions
UtInput::ExceptionBaseif an invalid input was encountered.

Reimplemented from WsfComponent.

◆ ProcessModeInput()

virtual bool WsfSensorComponent::ProcessModeInput ( UtInput & aInput,
WsfSensorMode & aSensorMode )
inlinevirtual

◆ SelectMode()

virtual void WsfSensorComponent::SelectMode ( double aSimTime,
WsfStringId aModeNameId )
inlinevirtual

◆ TrackerAllowTracking()

virtual bool WsfSensorComponent::TrackerAllowTracking ( double aSimTime,
const TrackerSettings & aSettings,
const WsfTrackId & aRequestId,
size_t aObjectId,
WsfTrack * aTrackPtr,
WsfSensorResult & aResult )
inlinevirtual

Called when WsfSensorTracker::TargetDetected receives a detection.

Parameters
aSimTimeThe current simulation time.
aSettingsThe 'aSettings' argument from the calling 'Target...' method.
aRequestIdThe 'aRequestId' argument from the calling 'Target...' method.
aObjectIdThe 'aObjectId' argument from the calling 'Target...' method.
aTrackPtrPointer to the current track if one exists (can be null).
aResultThe results from the sensor detection. Return true to allow track update/creation to proceed with the current detection. If false the detection will be ignored and any existing track will be dropped.

Reimplemented in WsfCTD_SensorComponent, and WsfEW_SensorComponent.

◆ TrackerDropTrack()

virtual void WsfSensorComponent::TrackerDropTrack ( double aSimTime,
const TrackerSettings & aSettings,
const WsfTrackId & aRequestId,
size_t aObjectId,
WsfSensorMode * aModePtr,
WsfTrack * aTrackPtr )
inlinevirtual

Called from an implementation of the WsfSensorTracker 'Target...' methods when they want to drop a track.

Parameters
aSimTimeThe current simulation time.
aSettingsThe 'aSettings' argument from the calling 'Target...' method.
aRequestIdThe 'aRequestId' argument from the calling 'Target...' method.
aObjectIdThe 'aObjectId' argument from the calling 'Target...' method.
aModePtrThe sensor mode last used in updating the track.
aTrackPtrThe track to be dropped.

Reimplemented in WsfCTD_SensorComponent, and WsfEW_SensorComponent.

Referenced by WsfSensorTracker::DropTrackP().

◆ TrackerInitializeTrack()

virtual void WsfSensorComponent::TrackerInitializeTrack ( double aSimTime,
const TrackerSettings & aSettings,
const WsfTrackId & aRequestId,
size_t aObjectId,
WsfSensorMode * aModePtr,
WsfTrack *& aTrackPtr )
inlinevirtual

Called from an implementation of the WsfSensorTracker 'Target...' methods when they want to initiate a track.

Parameters
aSimTimeThe current simulation time.
aSettingsThe 'aSettings' argument from the calling 'Target...' method.
aRequestIdThe 'aRequestId' argument from the calling 'Target...' method.
aObjectIdThe 'aObjectId' argument from the calling 'Target...' method.
aModePtrThe sensor mode used in creating the track.
aTrackPtrUpdated with the pointer to the created track.

Reimplemented in WsfEW_SensorComponent.

Referenced by WsfSensorTracker::InitializeTrackP().

◆ TrackerUpdateTrack()

virtual void WsfSensorComponent::TrackerUpdateTrack ( double aSimTime,
const TrackerSettings & aSettings,
const WsfTrackId & aRequestId,
size_t aObjectId,
WsfSensorMode * aModePtr,
WsfTrack * aTrackPtr,
WsfPlatform * aTargetPtr,
WsfSensorResult & aResult )
inlinevirtual

Called from an implementation of the WsfSensorTracker 'Target...' methods when they want to update a track.

Parameters
aSimTimeThe current simulation time.
aSettingsThe 'aSettings' argument from the calling 'Target...' method.
aRequestIdThe 'aRequestId' argument from the calling 'Target...' method.
aObjectIdThe 'aObjectId' argument from the calling 'Target...' method.
aModePtrThe sensor mode used in updating the track.
aTrackPtrThe track to be updated.
aTargetPtrThe platform representing the updated track.
aResultThe results from the sensor detection causing the track update.

Reimplemented in WsfEW_SensorComponent.

Referenced by WsfSensorTracker::UpdateTrackP().

◆ TurnOff()

virtual void WsfSensorComponent::TurnOff ( double aSimTime)
inlinevirtual

Reimplemented in WsfCTD_SensorComponent.

◆ TurnOn()

virtual void WsfSensorComponent::TurnOn ( double aSimTime)
inlinevirtual

◆ UpdateTrack() [1/2]

virtual void WsfSensorComponent::UpdateTrack ( double aSimTime,
WsfTrack * aTrackPtr,
WsfPlatform * aTargetPtr,
WsfSensorResult & aResult )
inlinevirtual

◆ UpdateTrack() [2/2]

void WsfSensorComponent::UpdateTrack ( WsfSensor & aSensor,
double aSimTime,
WsfTrack * aTrackPtr,
WsfPlatform * aTargetPtr,
WsfSensorResult & aResult )
static

Convenience method to call UpdateTrack on all the components.

References WsfSensor::GetComponents(), and WsfComponentList::HasComponents().


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