WSF
WsfWeapon Class Referenceabstract

#include <WsfWeapon.hpp>

Inheritance diagram for WsfWeapon:
Collaboration diagram for WsfWeapon:

Classes

class  WsfWeaponMode
 A 'mode' of the weapon. More...
class  FireTarget
 A target for a weapon to fire upon. More...
class  FireOptions
 Weapon firing options. More...
class  SalvoOptions
 Salvoing options. More...
class  FireResult
 Result of WsfWeapon::Fire(). More...
class  SalvoEvent
class  CompleteReloadEvent
struct  SalvoRequest
struct  ActiveWeapon
struct  WeaponStatus

Public Types

enum  WeaponState {
  cWEAPON_STATE_UNALLOCATED , cWEAPON_STATE_ALLOCATED , cWEAPON_STATE_DEALLOCATE , cWEAPON_STATE_NACK ,
  cWEAPON_STATE_READY
}
Public Types inherited from WsfArticulatedPart
enum  SlewMode { cSLEW_FIXED = 0 , cSLEW_AZ = 1 , cSLEW_EL = 2 , cSLEW_AZ_EL = 3 }
enum  SlewDirection { cUNDEFINED = 0 , cPOSITIVE = 1 , cNEGATIVE = 2 }
enum  {
  cNOT_CUED = 0x0000 , cMIN_AZ = 0x0001 , cMAX_AZ = 0x0002 , cMIN_EL = 0x0004 ,
  cMAX_EL = 0x0008 , cAT_LIMIT_AZ_MASK = 0x0003 , cAT_LIMIT_EL_MASK = 0x000B , cAT_LIMIT_MASK = 0x000F ,
  cCUED_AZ = 0x0010 , cCUED_EL = 0x0020 , cCUED_AZ_EL = 0x0030 , cCUED_MASK = 0x0030
}
enum  CueType { cCUED_TO_NOTHING , cCUED_TO_LOCATION , cCUED_TO_ANGLE }
Public Types inherited from WsfPlatformPart
enum  { cLEVEL_ONE_DEBUG = 0x00000001 , cLEVEL_TWO_DEBUG = 0x00000002 }
using InternalMessageQueue = std::queue<WsfMessage*>
using RecipientMessageQueue = std::queue<std::pair<WsfPlatformPart*, WsfMessage*>>
Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
Public Types inherited from WsfComponentT< WsfPlatform >
typedef WsfPlatform ParentType
 This is needed to support the WsfComponentList template.

Static Public Attributes

static const double cUNDEFINED_DOUBLE = 1.0E+30
Static Public Attributes inherited from WsfArticulatedPart
static constexpr double cINFINITE_SLEW_RATE = 1.0E+12 * UtMath::cRAD_PER_DEG
static constexpr double cALMOST_FULL_CIRCLE = 359.999 * UtMath::cRAD_PER_DEG
Static Public Attributes inherited from WsfAuxDataEnabled
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataAccessed
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataDestroyed

Component list support.

A processor contains a list of components.

using ComponentList = WsfComponentListT<WsfWeaponComponent>
ComponentListGetComponents ()
const ComponentListGetComponents () const

Weapon server support.

using WeaponStatusMap = std::map<WsfTrackId, WeaponStatus>
using WeaponStatusMapIter = WeaponStatusMap::iterator
using WeaponStatusMapConstIter = WeaponStatusMap::const_iterator
using WeaponStatusVal = std::pair<WsfTrackId, WeaponStatus>
WsfModeListmModeListPtr
 The pointer to the list of modes (for things like jammers).
WeaponStatusMap mWeaponStatusMap
virtual bool AllocateTheWeapon (double aSimTime, WsfTrack *aTrackPtr, int aStoreId)
 Begin the weapon server allocation sequence.
void SetState (WeaponState aState)
WeaponState GetState () const
 Return weapon state.
 WsfWeapon (const WsfWeapon &aSrc)
 Copy constructor (for Clone()).
WsfWeaponoperator= (const WsfWeapon &)=delete
bool IsQuantitySpecified () const
virtual void ProcessReloading (double aSimTime)
void SetIsReloading (bool aValue)
 Method used for derived classes to set or clear the IsReloading Flag.
void SetModeList (WsfModeList *aModeListPtr)
void SetTimeLastFired (double aTimeLastFired)
void SetMaximumRequestCount (unsigned int aMaximumRequestCount)
double GetReloadInterval () const
virtual void WeaponFireAborted (double aSimTime, const WsfTrack *aTargetTrackPtr, double aQuantity)

Weapon status methods

static double TimeWeaponLastFiredFor (const WsfPlatform &aPlatform, const WsfTrackId &aTrackId, WsfStringId aWeaponName=WsfStringId())
static double TimeWeaponLastTerminatedFor (const WsfPlatform &aPlatform, const WsfTrackId &aTrackId, WsfStringId aWeaponName=WsfStringId())
static int WeaponsPendingFor (const WsfPlatform &aPlatform, const WsfTrackId &aTrackId, WsfStringId aWeaponName=WsfStringId())
static int WeaponsActiveFor (const WsfPlatform &aPlatform, const WsfTrackId &aTrackId, WsfStringId aWeaponName=WsfStringId())
 Returns number of weapons that have been fired at the track and are still alive.
static int RoundsCompleteFor (const WsfPlatform &aPlatform, const WsfTrackId &aTrackId, WsfStringId aWeaponName=WsfStringId())
 Returns number of weapons that were fired at the track and are now terminated.
static int WeaponsActiveAndPendingFor (const WsfPlatform &aPlatform, const WsfTrackId &aTrackId, WsfStringId aWeaponName=WsfStringId())
 Equivalent to WeaponsActiveFor() plus WeaponsPendingFor().
static int RoundsFiredAt (const WsfPlatform &aPlatform, const WsfTrackId &aTrackId, WsfStringId aWeaponName=WsfStringId())
 Equivalent to WeaponsActiveFor() plus RoundsCompleteFor().
static int SalvosFiredAt (const WsfPlatform &aPlatform, const WsfTrackId &aTrackId, WsfStringId aWeaponName=WsfStringId())
 Returns number of salvo fire requests requested, and not the actual number of salvos fired.
static std::vector< size_t > ActiveWeaponPlatformsFor (const WsfPlatform &aPlatform, const WsfTrackId &aTrackId, WsfStringId aWeaponName=WsfStringId())
static void DetermineFirepowerStatus (WsfPlatform &aPlatform)
 Decide whether to set or clear the Firepower appearance bit.
 WsfWeapon (const WsfScenario &aScenario)
 ~WsfWeapon () override

Component infrastructure methods not provided by WsfPlatformPart.

WsfComponentCloneComponent () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override
int GetComponentInitializationOrder () const override

Common infrastructure methods.

const char * GetScriptClassName () const override
WsfWeaponClone () const override=0
bool PreInitialize (double aSimTime) override
bool Initialize (double aSimTime) override
bool Initialize2 (double aSimTime) override
void PreInput () override
bool ProcessInput (UtInput &aInput) override
void Update (double aSimTime) override
 Update the state of the weapon to the supplied time value.

Status methods.

void TurnOff (double aSimTime) override
void TurnOn (double aSimTime) override
void SetNonOperational (double aSimTime) override
void SetOperational (double aSimTime) override
void PartBroken (double aSimTime) override
void Restore (double aSimTime) override
double GetUpdateInterval () const override
 Get the update interval.

Receiver/Transmitter access methods.

These methods support accessing the underlying receiver and transmitter components.

virtual size_t GetEM_RcvrCount () const
virtual WsfEM_RcvrGetEM_Rcvr (size_t aIndex)
virtual size_t GetEM_XmtrCount () const
virtual WsfEM_XmtrGetEM_Xmtr (size_t aIndex)
virtual size_t GetEM_XmtrCount (size_t aModeIndex) const
virtual WsfEM_XmtrGetEM_Xmtr (size_t aModeIndex, size_t aIndex)
virtual WsfEM_XmtrGetEM_Xmtr (size_t aModeIndex, size_t aBeamIndex, size_t aIndex)

Mode selection methods.

These methods support the control of a multi-mode weapons (particularly jammers).

Note
Not all implementations support multiple modes.
virtual WsfStringId GetCurrentModeName () const
 Return the string ID of the string associated with the name of the current mode.
virtual WsfWeaponModeGetCurrentMode ()
virtual size_t GetModeCount ()
 Get the number of modes associated with the weapon.
virtual WsfWeaponModeGetModeEntry (size_t aModeIndex)
virtual size_t GetModeIndex (WsfStringId aModeNameId)
virtual WsfStringId GetModeName (size_t aModeIndex)
virtual void DeselectMode (double aSimTime, WsfStringId aModeNameId)
virtual void SelectMode (double aSimTime, WsfStringId aModeNameId)

Launch Computer Set/Get methods.

WsfLaunchComputerGetLaunchComputer () const
void SetLaunchComputer (WsfLaunchComputer *aLaunchComputerPtr)

Weapon Effects methods

WsfStringId GetWeaponEffectsType () const
 Get the string ID of the weapon effects to be used.
void SetWeaponEffectsType (WsfStringId aWeaponEffect)
 Set the string ID of the weapon effects to be used.

Firing and cueing methods

virtual void CueToTarget (double aSimTime, const WsfTrack *aTrackPtr)
virtual FireResult Fire (double aSimTime, const FireTarget &aTarget, const FireOptions &aSettings)
virtual bool FireSalvo (double aSimTime, const FireTarget &aTarget, const SalvoOptions &aSettings)
virtual void ContinueSalvo (double aSimTime, unsigned int aRequestId)
virtual void AbortSalvo (double aSimTime, const WsfTrackId &aTrackId)
virtual void CeaseFire (double aSimTime)
virtual unsigned int GetActiveRequestCount () const
 Return the number of 'FireSalvo' calls that are in process.
virtual unsigned int GetMaximumRequestCount () const

Time methods.

double GetTimeLastFired () const
 Get the simulation time when the weapon was last fired.
virtual double GetFiringDelay ()
void SetFiringDelay (const WsfRandomVariable &aFiringDelay)
virtual double GetSalvoInterval ()
double GetFiringInterval () const
void SetFiringInterval (double aFiringInterval)

Launched platform type methods.

WsfStringId GetLaunchedPlatformType () const
 Get the type of the platform that will be launched.
void SetLaunchedPlatformType (WsfStringId aLaunchedPlatformType)
 Set the type of the platform that will be launched.

Inventory methods.

The definition of quantity depends on the type of weapon. For some weapons it might be 'rounds', for others it might be 'Joules'.

double GetInitialStateQuantityRemaining () const
virtual double GetQuantityRemaining () const
virtual double GetQuantityCommitted () const
 Return the quantity that is currently committed.
virtual double GetMaximumQuantity () const
 Return the maximum quantity that may be 'loaded'.
virtual double GetTotalQuantityUsed () const
 Return the cumulative running total of the quantity used (fired).
virtual void SetQuantityRemaining (double aQuantity)
void ChangeQuantity (double aDeltaQuantity)

Reload specification methods.

These methods support the control of weapon inventory replenishment. For maximum user flexibility, the IsReloading() flag is accessible via script, the user must determine whether salvo firing will be interrupted during reload.

Note
Not all implementations support weapons reloading.
bool IsReloading () const
bool InhibitWhileReloading () const
 Flag indicating that when a weapon reload is in progress, any firing will be inhibited.
virtual void CompleteReloading (double aSimTime, double aQuantity)
double GetReloadInventory () const
double GetReloadThreshold () const
 Returns the depleted value of inventory at which a reload is attempted.
double GetReloadIncrement () const

Helpers for working with target data.

Sometimes a weapon needs a track against which to fire and the track has to have location data. These methods help dealing with cases where the required data may not be available, but other mechanisms may have been defined that indicate how to construct a location.

WsfTrackCreateTargetTrack (double aSimTime, const WsfTrack *aTrackPtr)
bool GetTargetLocationWCS (double aSimTime, const WsfTrack *aTrackPtr, double aTargetLocWCS[3])

Target cueing data methods.

Currently used in WsfRF_Jammer::JammerXmtr's functionalities for DIS operations, other future implementations are possible. The target data is stored in the inheriting classes.

virtual void SetTargetIndex (int aId, size_t aTargetIndex)
virtual size_t GetTargetIndex (int aId) const
virtual void SetTargetedLocationWCS (int aId, const double aTargetedLocationWCS[3])
virtual void GetTargetedLocationWCS (int aId, double aTargetedLocationWCS[3]) const
virtual bool TargetedLocationValid (int aId) const

Field of view methods.

Determines if the platform is within the weapons field of view.

virtual bool WithinFieldOfView (double aSimTime, WsfPlatform *aPlatformPtr)
virtual bool WithinFieldOfView (double aSimTime, WsfTrack *aTrackPtr)

Jammer methods.

These methods support jammer tasking.

virtual bool StartJamming (double aSimTime, double aFrequency, double aBandwidth, size_t aBeamNumber, WsfStringId aTechniqueId, WsfTrackId aTrackId, size_t aTargetIndex)
virtual bool StartJammingTrack (double aSimTime, WsfStringId aTechniqueId, const WsfTrack *aTrackPtr)
virtual bool StopJamming (double aSimTime, double aFrequency, double aBandwidth, size_t aBeamNumber, WsfTrackId aTrackId)
virtual bool UpdateJamming (double aSimTime, size_t aXmtrIndex, double aFrequency, double aBandwidth, WsfStringId aTechniqueId, WsfTrackId aTrackId, size_t aTargetIndex)
virtual size_t GetActiveBeamCount () const
virtual size_t GetMaximumBeamCount () const
virtual size_t GetActiveSpotCount (size_t aBeamNumber) const
virtual size_t GetMaximumSpotCount (size_t aBeamNumber) const

EA methods

These methods support EA jammer tasking.

virtual bool SelectEA_Technique (double aSimTime, double aFrequency, double aBandwidth, size_t aBeamNumber, WsfStringId aTechniqueId, WsfTrackId aTrackId)
virtual bool DeselectEA_Technique (double aSimTime, double aFrequency, double aBandwidth, size_t aBeamNumber, WsfStringId aTechniqueId, WsfTrackId aTrackId)
virtual bool SetEA_DeltaGainTechnique (double aSimTime, WsfStringId aTechniqueId, bool aOnOff, WsfStringId aEffectId, double aJammingDeltaGain_dB, WsfStringId aSystemTypeId, WsfStringId aFunctionTypeId)
virtual bool SetEA_DeltaGainTechnique (double aSimTime, WsfStringId aTechniqueId, bool aOnOff, WsfStringId aEffectId, double aJammingDeltaGain_dB, WsfStringId aSystemTypeId, WsfStringId aFunctionTypeId, double aFrequency, double aBandwidth, size_t aBeamNumber, WsfTrackId aTrackId)

Methods for simulation control of the update interval.

Note
These methods are only intended for use by simulation executives (classes derived from WsfSimulation) and WsfPlatformPartEvent and should not be invoked from any other place. Any other use is at your own risk.
void SetUpdateInterval (double aUpdateInterval) override

Query methods

double TimeWeaponLastFiredFor (const WsfTrackId &aTrackId) const
 Return the simulation time of the most recent weapon firing against the specified track.
double TimeWeaponLastTerminatedFor (const WsfTrackId &aTrackId) const
 Return the simulation time of the most recent weapon termination against the specified track.
int WeaponsPendingFor (const WsfTrackId &aTrackId) const
int WeaponsActiveFor (const WsfTrackId &aTrackId) const
int RoundsCompleteFor (const WsfTrackId &aTrackId) const
 Returns number of weapons that were fired at the track and are now terminated.
int WeaponsActiveAndPendingFor (const WsfTrackId &aTrackId) const
int RoundsFiredAt (const WsfTrackId &aTrackId) const
int SalvosFiredAt (const WsfTrackId &aTrackId) const
std::vector< size_t > ActiveWeaponPlatformsFor (const WsfTrackId &aTrackId) const
virtual void EngagementComplete (double aSimTime, WsfWeaponEngagement *aEngagementPtr)
void SetIFCEnabled (bool aEnabled)
 Set to true is IFC is supported.
bool GetIFCEnabled () const
 Returns 'true' if the platform supports IFC (Integrated Fire Control).

Additional Inherited Members

Public Member Functions inherited from WsfArticulatedPart
 WsfArticulatedPart (const WsfScenario &aScenario, int aPartType)
 WsfArticulatedPart (const WsfArticulatedPart &aSrc)
 ~WsfArticulatedPart () override
void SetPositionRateECS (const double aDX, const double aDY, const double aDZ)
void GetCurrentPositionRateECS (double &aDX, double &aDY, double &aDZ) const
double GetDX () const
double GetDY () const
double GetDZ () const
void EnableArticulationUpdates (double aSimTime, double aInterval)
void DisableArticulationUpdates (double aSimTime)
void SetArticulationUpdateInterval (double aUpdateInterval)
double GetArticulationUpdateInterval () const
unsigned int GetArticulationUpdateEventEpoch () const
void IncrementArticulationUpdateEventEpoch ()
bool ArticulationUpdateEventActive () const
 Is an 'Update' event active?
void SetArticulationUpdateEventActive (bool aUpdateEventActive)
 Indicate if the 'Update' event is active.
virtual double TimeToCue (double aDesiredAz, double aDesiredEl) const
const char * GetScriptClassName () const override
void SetPlatform (WsfPlatform *aPlatformPtr) override
virtual void UpdatePosition (double aSimTime)
void OnPlatformUpdated (double, WsfPlatform *) override
SlewMode GetSlewMode () const
 Get the allowed slewing mode.
double GetAzSlewRate () const
 Get the current azimuth slew rate.
double GetElSlewRate () const
 Get the current elevation slew rate.
double GetMaxAzSlewRate () const
 Get the maximum allowable azimuth slew rate.
double GetMaxElSlewRate () const
 Get the maximum allowable elevation slew rate.
double GetMinAzSlew () const
 Gets the minimum azimuth slew limit.
double GetMaxAzSlew () const
 Gets the maximum azimuth slew limit.
double GetMinElSlew () const
 Gets the minimum elevation slew limit.
double GetMaxElSlew () const
 Gets the maximum elevation slew limit.
int GetSlewState () const
 Get the slew limit state.
void SetSlewMode (SlewMode aSlewMode)
 Set the allowed slewing mode.
void SetSlewRates (double aAzSlewRate, double aElSlewRate)
 Set the angular slew rates, limited by the maximum slew rates.
void SetAzSlewLimits (double aMinAzSlew, double aMaxAzSlew)
 Set the azimuth slew limits.
void SetElSlewLimits (double aMinElSlew, double aMaxElSlew)
 Set the elevation slew limits.
void SetAzimuthSlewDirection (SlewDirection aAzSlewDirection)
 Set the azimuth slew direction.
bool IsSlewing () const
bool WithinSlewLimits (double aThisToTgtAz, double aThisToTgtEl) const
SlewMode GetCueMode () const
 Get the allowed cueing mode.
double GetAzCueRate () const
 Get the azimuth cue rate.
double GetElCueRate () const
 Get the elevation cue rate.
double GetMinAzCue () const
 Gets the minimum azimuth cue limit.
double GetMaxAzCue () const
 Gets the maximum azimuth cue limit.
double GetMinElCue () const
 Gets the minimum elevation cue limit.
double GetMaxElCue () const
 Gets the maximum elevation cue limit.
void SetCueMode (SlewMode aCueMode)
 Set the allowed cueing mode.
void SetCueRates (double aAzCueRate, double aElCueRate)
 Set the angular cueing rates.
void SetAzCueLimits (double aMinAzCue, double aMaxAzCue)
 Set the azimuth cueing limits.
void SetElCueLimits (double aMinElCue, double aMaxElCue)
 Set the elevation cueing limits.
double GetRoll () const
void SetRoll (double aRoll)
 Set the platform-relative (ECS) roll angle of the articulated part.
double GetPitch () const
void SetPitch (double aPitch)
double GetYaw () const
void SetYaw (double aYaw)
 Set the platform-relative (ECS) yaw angle of the articulated part.
double GetTilt () const
void SetTilt (double aTilt)
void GetCurrentOrientationECS (double &aYaw, double &aPitch, double &aRoll)
void GetLOS_UnitVectorWCS (double aUnitLOS_WCS[3])
 Get the current WCS Frame Line-Of-Sight unit vector.
CueType GetCueType () const
bool IsCued () const
 Get the cued status.
void ClearCueing ()
bool GetActualCuedOrientation (double &aAzimuth, double &aElevation) const
void GetCurrentCuedOrientation (double &aAzimuth, double &aElevation) const
bool GetCuedLocationWCS (double aCuedLocationWCS[3]) const
void SetCuedLocationWCS (const double aCuedLocationWCS[3])
bool GetCuedOrientation (double &aAzimuth, double &aElevation) const
void SetCuedOrientation (double aAzimuth, double aElevation)
void GetAbsoluteCuedOrientation (double &aAzimuth, double &aElevation, double aBaseNED[3])
void ClearTransientCue ()
bool TransientCueActive () const
bool GetTransientCuedLocationWCS (double aCuedLocationWCS[3]) const
void SetTransientCuedLocationWCS (const double aCuedLocationWCS[3])
WsfStringId GetMaskingPatternState () const
void SetMaskingPatternState (WsfStringId aMaskingPatternStateId)
double GetMaskingPatternFactor (double aViewAzPCS, double aViewElPCS, const double aViewVecWCS[3])
void SetIsPrivate (bool aIsPrivate)
bool IsPrivate () const
Public Member Functions inherited from WsfPlatformPart
 WsfPlatformPart (const WsfScenario &aScenario, int aPartType)
WsfPlatformPartoperator= (const WsfPlatformPart &aRhs)=delete
 ~WsfPlatformPart () override
bool DebugEnabled () const
 Returns 'true' if debugging is enabled for this instance.
void SetDebugEnabled (bool aDebugEnabled)
unsigned int GetDebugMask ()
bool IsExternallyControlled () const
virtual void SetExternallyControlled (double aSimTime, bool aIsExternallyControlled)
int GetPartType () const
const char * GetScriptClassName () const override
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
WsfStringId GetComponentName () const override
void ComponentParentChanged (WsfPlatform *aPlatformPtr) override
WsfPlatformGetPlatform () const
virtual void PlatformAdded (double aSimTime, WsfPlatform *aPlatformPtr)
virtual void PlatformDeleted (WsfPlatform *aPlatformPtr)
double GetLastStatusChangeTime () const
void SetLastStatusChangeTime (double aSimTime)
 Allows a system to set the time at which the device was initialized.
bool CanBeMadeOperational () const
 Returns an indication that this system can be made operational.
bool CanBeMadeNonOperational () const
 Returns an indication that this system can be made non-operational.
bool CanBeTurnedOn () const
 Returns an indication that this system can be turned on.
bool CanBeTurnedOff () const
 Returns an indication that this system can be turned off.
bool IsTurnedOn () const
bool InitiallyTurnedOn () const
 Is the system to be turned 'on' when added to the simulation?
void SetInitiallyTurnedOn (bool aInitiallyTurnedOn)
 Sets if the system is turned on when added to the simulation.
bool IsOperational () const
bool SetOperational (double aSimTime, bool aMakeOperational)
double GetDamageFactor () const
bool SetDamageFactor (double aSimTime, double aDamageFactor)
bool IsCritical () const
void SetCritical (bool aValue)
virtual void OnPlatformBrokenEvent (double aSimTime)
 Owning platform has issued a broken event.
bool IsBroken () const
WsfInternalLinksGetInternalLinks ()
 Return the internal links for this part.
virtual bool HasInternalLinks () const
 Does this platform part have a communication link to other platform parts?
virtual bool ProcessMessage (double aSimTime, const WsfMessage &aMessage)
virtual bool ReceiveMessage (double aSimTime, const WsfMessage &aMessage)
virtual void SendMessage (double aSimTime, const WsfMessage &aMessage)
virtual void SendMessageTo (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId)
void SendMessageToProcessor (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId)
virtual void SendQueuedMessages (double aSimTime)
const WsfCategoryListGetCategories () const
 Get the categories to which this part belongs.
void AddCategory (WsfStringId aCategoryId)
 Adds the provided category to the platform part's category list.
bool IsCategoryMember (WsfStringId aCategoryId) const
const WsfGroupListGetGroups () const
 Get the groups to which this platform part belongs.
void JoinGroup (WsfGroup *aGroupPtr)
 Join the given group.
void LeaveGroup (WsfGroup *aGroupPtr)
 Leave the given group.
bool IsGroupMember (WsfStringId aGroupId)
unsigned int GetUpdateEventEpoch () const
void IncrementUpdateEventEpoch ()
bool UpdateEventActive () const
 Is an 'Update' event active?
void SetUpdateEventActive (bool aUpdateEventActive)
 Indicate if the 'Update' event is active.
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)
Public Member Functions inherited from WsfComponentT< WsfPlatform >
 WsfComponentT ()
 WsfComponentT (const WsfComponentT &) noexcept
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
ParentTypeGetComponentParent () const
void SetComponentParent (ParentType *aParentPtr)
Public Member Functions inherited from WsfComponent
virtual ~WsfComponent ()=default
template<typename T>
bool QueryInterfaceT (T *&aRolePtr)
bool ComponentHasRole (int aRole)
 Returns true if the component has the specified role.
Public Member Functions inherited from WsfUniqueId
 WsfUniqueId ()
 Construtor initializes the unique identifier to 0.
 WsfUniqueId (const WsfUniqueId &)
 Copy constructor initializes the unique identifier to 0.
WsfUniqueIdoperator= (const WsfUniqueId &)
unsigned int GetUniqueId () const
 Get the unique identifier assigned to this object.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
Public Member Functions inherited from WsfAuxDataEnabled
 WsfAuxDataEnabled ()=default
 WsfAuxDataEnabled (const WsfAuxDataEnabled &aSrc)=default
WsfAuxDataEnabledoperator= (const WsfAuxDataEnabled &aRhs)
 WsfAuxDataEnabled (WsfAuxDataEnabled &&)=default
WsfAuxDataEnabledoperator= (WsfAuxDataEnabled &&)=default
virtual ~WsfAuxDataEnabled () noexcept
void SetAuxData (const WsfAttributeContainer &aAuxData)
void DeleteAuxData ()
 Delete the aux data container from the object.
void MergeAuxData (const WsfAuxDataEnabled &aSrc)
 Merge the object's aux data with aux data from an existing object.
void UpdateAuxData (const WsfAuxDataEnabled &aSrc)
 Update the object's aux data with aux data from an existing object.
bool HasAuxData () const
 Returns true if this object has aux data.
bool ProcessInput (UtInput &aInput)
template<typename T>
void Serialize (T &aBuff)
 (De)serialization for XIO
WsfAttributeContainerGetAuxData ()
const WsfAttributeContainerGetAuxData () const noexcept
const WsfAttributeContainerGetAuxDataConst () const noexcept
Public Member Functions inherited from WsfSinglePlatformObserver
virtual ~WsfSinglePlatformObserver ()
virtual void OnPlatformDeleting (double aSimTime, WsfPlatform *aPlatformPtr)
 Called before the platform is actually deleted.
virtual void OnPlatformDeleted (double aSimTime, WsfPlatform *aPlatformPtr)
 Called just before the platform is removed from the simulation.
UtCallbackListN< void(double)> SlewComplete
bool FullCircle () const
virtual double GetAzimuthRotationRate () const
virtual double GetElevationRotationRate () const
void SlewToOrientation (double aSimTime, double aDesiredAz, double aDesiredEl)
virtual void TimeToRotate (double &aDeltaAz, double &aDeltaEl, double &aAzRate, double &aElRate, double &aTimeToAz, double &aTimeToEl) const
void UpdateCuedOrientation (double aSimTime)
bool UpdateOrientation (double aSimTime)
 WsfPlatformPart (const WsfPlatformPart &aSrc)
 Copy constructor (for Clone()).
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).
Protected Member Functions inherited from WsfUniqueId
void AssignUniqueId (WsfSimulation *aSimulationPtr)
WsfMaskingPatternmMaskingPatternPtr
 The masking factor.
WsfStringId mMaskingPatternName
WsfStringId mMaskingPatternStateId
double mYaw
 The orientation of the device coordinate system.
double mPitch
double mRoll
double mDX
 The velocity of the part.
double mDY
double mDZ
double mTilt
 The tilt angle above below the scan plane.
double mAzSlewRate
 The slewing rates and limits of the device with respect to the device coordinate system.
double mElSlewRate
double mMaxAzSlewRate
double mMaxElSlewRate
double mMinAzSlew
double mMaxAzSlew
double mMinElSlew
double mMaxElSlew
SlewMode mSlewMode
SlewDirection mAzSlewDirection
int mSlewState
double mAzCueRate
 The cueing rates and limits of the device with respect to the device coordinate system.
double mElCueRate
double mMinAzCue
double mMaxAzCue
double mMinElCue
double mMaxElCue
SlewMode mCueMode
 The directions (az and/or el) in which cueing can be performed.
CueType mCueType
bool mTransientCueActive
 'true' if the transient cue is defined
double mCuedLocationWCS [3]
 The cued location if mCueType is cCUED_TO_LOCATION.
double mCuedAz
 The cued azimuth if mCueType == cCUED_TO_ANGLE.
double mCuedEl
 The cued elevation if mCueType == cCUED_TO_ANGLE.
double mTransientCuedLocationWCS [3]
 The transient cue, if mTransientCueActive is true.
double mActualCuedAz
 The actual cued location, subject to the slewing limits.
double mActualCuedEl
double mCurrentAz
double mCurrentEl
double mLastAzElUpdateTime
 The time when the current az/el were last updated.
double mLastUpdateTime
 The time when the x/y/z position was last updated.
bool mSlewMethodCoordinated
 'true' if slcue rates are dynamically adjusted so the target angles are reached simultaneously.
bool mIsSlewing
 'true' if the part is slewing to satisfy a cueing request.
bool mIsPrivate
 'true' if the part is considered 'private' and not to visible to external simulations.

Detailed Description

A base class for all types of weapon systems.

A weapon is defined to be something that is in some way meant to prevent the operation of some other object (either permanently or temporarily). The base class only provides an abstract definition of a weapon. It is up to derived classes to provide the actual implementation of the weapon.

Weapons come in two basic forms:

  • Explicit weapons. These result in the creation of a new platform that causes the intended effect. (Such as a missile or a bomb that is modeled as a separate platform).
  • Implicit weapons. These do not result in the creation of a new platform. Directed energy weapons could be considered implicit weapons. Bombs and missiles could also be modeled implicitly by using geometry and probabilities to determine effect.

The state of a weapon engagement is contained within the WsfWeaponEngagement class.

The effect of a weapon on a target is modeled by derived classes of the WsfWeaponEffects class.

Note
Derived classes should invoke the methods ChangeQuantity() and SetTimeLastFired() to ensure external decision makers have the correct data.

Member Typedef Documentation

◆ ComponentList

◆ WeaponStatusMap

using WsfWeapon::WeaponStatusMap = std::map<WsfTrackId, WeaponStatus>
protected

◆ WeaponStatusMapConstIter

using WsfWeapon::WeaponStatusMapConstIter = WeaponStatusMap::const_iterator
protected

◆ WeaponStatusMapIter

using WsfWeapon::WeaponStatusMapIter = WeaponStatusMap::iterator
protected

◆ WeaponStatusVal

using WsfWeapon::WeaponStatusVal = std::pair<WsfTrackId, WeaponStatus>
protected

Member Enumeration Documentation

◆ WeaponState

Enumerator
cWEAPON_STATE_UNALLOCATED 
cWEAPON_STATE_ALLOCATED 
cWEAPON_STATE_DEALLOCATE 
cWEAPON_STATE_NACK 
cWEAPON_STATE_READY 

Constructor & Destructor Documentation

◆ WsfWeapon() [1/2]

◆ ~WsfWeapon()

WsfWeapon::~WsfWeapon ( )
override

References mModeListPtr.

◆ WsfWeapon() [2/2]

WsfWeapon::WsfWeapon ( const WsfWeapon & aSrc)
protected

Member Function Documentation

◆ AbortSalvo()

void WsfWeapon::AbortSalvo ( double aSimTime,
const WsfTrackId & aTrackId )
virtual

Abort any pending rounds from a salvo.

Parameters
aSimTimeThe current simulation time.
aTrackIdThe track ID of the track that was passed to the FireSalvo request whose salvo is to be aborted. If the track ID is Null() then all pending salvos will be aborted.
Note
This only aborts rounds that have not yet been fired.

Reimplemented in WsfExplicitWeapon.

References WsfPlatformPart::GetSimulation(), WsfTrackId::IsNull(), WsfObserver::WeaponFireAborted(), and WeaponFireAborted().

Referenced by WsfExplicitWeapon::AbortSalvo(), CeaseFire(), WsfWeaponTaskManager::TaskCanceled(), and TurnOff().

◆ ActiveWeaponPlatformsFor() [1/2]

std::vector< size_t > WsfWeapon::ActiveWeaponPlatformsFor ( const WsfPlatform & aPlatform,
const WsfTrackId & aTrackId,
WsfStringId aWeaponName = WsfStringId() )
static

Returns all platform indices for weapon platforms that were fired from this platform and... ...are still active against the track

References ActiveWeaponPlatformsFor(), WsfComponentList::RoleIterator< T >::AtEnd(), WsfComponentList::GetComponent(), and WsfWeapon().

Referenced by WsfWeaponTaskManager::AbortFiring(), ActiveWeaponPlatformsFor(), and WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT().

◆ ActiveWeaponPlatformsFor() [2/2]

std::vector< size_t > WsfWeapon::ActiveWeaponPlatformsFor ( const WsfTrackId & aTrackId) const

Returns all platform indices for weapon platforms that were fired from this platform and... ...are still active against the track

References WsfTrackId::IsNull(), and mWeaponStatusMap.

◆ AllocateTheWeapon()

bool WsfWeapon::AllocateTheWeapon ( double aSimTime,
WsfTrack * aTrackPtr,
int aStoreId )
virtual

Begin the weapon server allocation sequence.

References cWEAPON_STATE_READY, WsfPlatformPart::GetSimulation(), ok, and WsfObserver::WeaponSelected().

◆ CeaseFire()

void WsfWeapon::CeaseFire ( double aSimTime)
virtual

◆ ChangeQuantity()

void WsfWeapon::ChangeQuantity ( double aDeltaQuantity)

Change the quantity of the weapon resource that has been used and is remaining by a delta amount.

Note
Negative delta values decrement the quantity remaining, while positive values increment the quantity remaining. The total quantity used will also be modified inversely.
Parameters
aDeltaQuantityThe change in quantity remaining and (inversely) total quantity used.

References SetQuantityRemaining().

Referenced by WsfExplicitWeapon::AddWeaponToSimulation(), WsfImplicitWeapon::BeginEngagement(), and WsfExplicitWeapon::ProcessDeferredLaunchEvent().

◆ Clone()

WsfWeapon * WsfWeapon::Clone ( ) const
overridepure virtual

◆ CloneComponent()

WsfComponent * WsfWeapon::CloneComponent ( ) const
inlineoverridevirtual

Clones a component. May return null if component does not support clone.

Implements WsfComponent.

References WsfObject::Clone().

◆ CompleteReloading()

void WsfWeapon::CompleteReloading ( double aSimTime,
double aQuantity )
virtual

Utility method called by the nested CompleteReloadEvent class to trigger the completion of a reload. (This method has to be made public, but is not to be called directly.)

References WsfPlatformPart::GetSimulation(), WsfObserver::WeaponQuantityChanged(), and WsfObserver::WeaponReloadEnded().

◆ ContinueSalvo()

◆ CreateTargetTrack()

WsfTrack * WsfWeapon::CreateTargetTrack ( double aSimTime,
const WsfTrack * aTrackPtr )

Attempt to create a target track for hand-off to the weapon.

This method attempts to create a track to hand off to the weapon. If a track has been provided and it has a valid location then a clone of the track will be returned. If the track does not have a valid location or if no track was provided AND if the user defined an 'unknown_target_range' then a new track will be created that has a location that is at the indicated range directly in front of the launching platform.

Parameters
aSimTimeThe current simulation time.
aTrackPtrPointer to the source track (may be 0).
Returns
A pointer to the newly created hand-off track. This may be zero!

References WsfTrack::Clone(), WsfTrack::cPROCESSED, WsfPlatformPart::GetPlatform(), WsfPlatformPart::GetSimulation(), GetTargetLocationWCS(), and trackPtr.

Referenced by WsfExplicitWeapon::FireP().

◆ CueToTarget()

void WsfWeapon::CueToTarget ( double aSimTime,
const WsfTrack * aTrackPtr )
virtual

Cue the weapon to a target.

Parameters
aSimTimeThe current simulation time.
aTrackPtrThe track that represents the target. If aTrackPtr is 0, will attempt to use WsfPlatform::GetCurrentTarget().

References WsfLaunchComputer::cFOREVER, computerPtr, WsfArticulatedPart::cSLEW_FIXED, WsfTrackManager::GetCurrentTarget(), GetFiringDelay(), GetLaunchComputer(), WsfPlatformPart::GetPlatform(), WsfArticulatedPart::GetSlewMode(), GetTargetLocationWCS(), WsfPlatform::GetTrackManager(), WsfArticulatedPart::SetCuedLocationWCS(), and trackPtr.

Referenced by ContinueSalvo().

◆ DeselectEA_Technique()

virtual bool WsfWeapon::DeselectEA_Technique ( double aSimTime,
double aFrequency,
double aBandwidth,
size_t aBeamNumber,
WsfStringId aTechniqueId,
WsfTrackId aTrackId )
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ DeselectMode()

void WsfWeapon::DeselectMode ( double aSimTime,
WsfStringId aModeNameId )
virtual

Deselect the mode given the string ID of the name of the desired mode.

Parameters
aSimTimeThe current simulation time.
aModeNameIdThe string ID of the mode to be deselected.
Note
This method does nothing unless the weapon is a multi-mode weapon. Deselecting a mode with a single-mode weapon is accomplished by selecting a new mode.

References GetModeCount(), WsfPlatformPart::GetSimulation(), mModeListPtr, and WsfObserver::WeaponModeDeactivated().

Referenced by WsfXIO_WeaponComponent::HandleStateChangeRequest().

◆ DetermineFirepowerStatus()

void WsfWeapon::DetermineFirepowerStatus ( WsfPlatform & aPlatform)
static

Decide whether to set or clear the Firepower appearance bit.

References WsfComponentList::RoleIterator< T >::AtEnd(), WsfComponentList::GetComponentCount(), WsfPlatform::SetAppearance(), and WsfWeapon().

Referenced by PartBroken(), and Restore().

◆ EngagementComplete()

void WsfWeapon::EngagementComplete ( double aSimTime,
WsfWeaponEngagement * aEngagementPtr )
virtual

Method used by the weapon engagement when the weapon platform terminates or the engagement is about to be marked "complete" (which is not the same as "ended"). This is not an observer callback but is used to update weapon and engagement status prior to the WsfObserver::WeaponTerminated call.

Reimplemented in WsfDirectedEnergyWeapon, and WsfImplicitWeapon.

References WsfWeaponEngagement::GetInitialTargetTrackId(), WsfWeaponEngagement::GetSerialNumber(), WsfTrackId::IsNull(), and mWeaponStatusMap.

Referenced by WsfDirectedEnergyWeapon::EngagementComplete(), and WsfImplicitWeapon::EngagementComplete().

◆ Fire()

WsfWeapon::FireResult WsfWeapon::Fire ( double aSimTime,
const FireTarget & aTarget,
const FireOptions & aSettings )
virtual

Attempt to fire a weapon. WsfPlatform::GetCurrentTarget() will be used as the target if it is defined.

Parameters
aSimTimeThe current simulation time.
aTargetThe target of the weapon.
aSettingsOptions for firing the weapon.
Note
This is the only virtual Fire() method, it should be implemented by derived classes.

Reimplemented in wsf::six_dof::ExplicitWeapon, WsfChaffWeapon, WsfCuedLaserWeapon, WsfDirectedEnergyWeapon, WsfExplicitWeapon, WsfImplicitWeapon, WsfLaserWeapon, and WsfP6DOF_ExplicitWeapon.

Referenced by ContinueSalvo(), WsfDisWeaponEvents::InitiateWeaponTransfer(), and WsfWeaponServer::ProcessCommand().

◆ FireSalvo()

bool WsfWeapon::FireSalvo ( double aSimTime,
const FireTarget & aTarget,
const SalvoOptions & aSettings )
virtual

Fire a salvo at the specified target.

This method is intended to be used to fire a salvo of one or more discrete rounds subject to the firing_delay and salvo_delay values. It is not intended continuous weapons like lasers.

This method only schedules events which will call Fire() at the appropriate times. Even if all the delays are zero, the Fire() for the first round will not be called until the next call to the event dispatcher.

Parameters
aSimTimeThe current simulation time.
aTargetThe target of the weapon.
aSettingsOptions for firing the weapon.
Returns
'true' if successfully initiated, 'false' otherwise (salvo already in progress).

References WsfSimulation::AddEvent(), GetFiringDelay(), GetFiringInterval(), WsfPlatformPart::GetSimulation(), GetTimeLastFired(), WsfWeapon::SalvoOptions::mQuantity, WsfWeapon::FireTarget::mTrackId, WsfWeapon::FireTarget::mTrackPtr, mWeaponStatusMap, and WsfObserver::WeaponFireRequested().

Referenced by WsfWeaponTaskManager::AcquireResource(), WsfWMAIEngagementMod::AddBehaviorsToStack(), and WsfChaffWeapon::DropChaffCloud().

◆ GetActiveBeamCount()

virtual size_t WsfWeapon::GetActiveBeamCount ( ) const
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ GetActiveRequestCount()

virtual unsigned int WsfWeapon::GetActiveRequestCount ( ) const
inlinevirtual

Return the number of 'FireSalvo' calls that are in process.

Reimplemented in WsfRF_Jammer.

Referenced by WsfAssetPerception::AssetSystem::AssetSystem(), WsfBMStatusMessage::SetWeaponStatus(), and WsfRIPRProcessor::WeaponFired().

◆ GetActiveSpotCount()

virtual size_t WsfWeapon::GetActiveSpotCount ( size_t aBeamNumber) const
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ GetComponentInitializationOrder()

int WsfWeapon::GetComponentInitializationOrder ( ) const
inlineoverridevirtual

Forces a specific initialization order. Components are initialized in increasing initialization order value.

Reimplemented from WsfComponent.

References cWSF_INITIALIZE_ORDER_WEAPON.

◆ GetComponentRoles()

const int * WsfWeapon::GetComponentRoles ( ) const
overridevirtual

Returns a zero-terminated array of component roles. Note that the array should be in decreasing order of specificity and should generally the inheritance hierarchy. The first entry should be the components 'primary' role. For example a sensor would do the following:

return roles;
@ cWSF_COMPONENT_SENSOR
A 'sensor' component (WsfSensor).
Definition WsfComponentRoles.hpp:105
@ cWSF_COMPONENT_PLATFORM_PART
The component derives from WsfPlatformPart.
Definition WsfComponentRoles.hpp:98
@ cWSF_COMPONENT_ARTICULATED_PART
The component derives from WsfArticulatedPart.
Definition WsfComponentRoles.hpp:99

Reimplemented from WsfArticulatedPart.

References cWSF_COMPONENT_ARTICULATED_PART, cWSF_COMPONENT_NULL, cWSF_COMPONENT_PLATFORM_PART, and cWSF_COMPONENT_WEAPON.

◆ GetComponents() [1/2]

ComponentList & WsfWeapon::GetComponents ( )
inline

◆ GetComponents() [2/2]

const ComponentList & WsfWeapon::GetComponents ( ) const
inline

◆ GetCurrentMode()

WsfWeapon::WsfWeaponMode * WsfWeapon::GetCurrentMode ( )
virtual

References GetModeEntry(), and mModeListPtr.

◆ GetCurrentModeName()

WsfStringId WsfWeapon::GetCurrentModeName ( ) const
virtual

Return the string ID of the string associated with the name of the current mode.

References WsfModeList::GetDefaultModeNameId(), and mModeListPtr.

Referenced by WsfXIO_WeaponComponent::FillPartState(), and WsfMilDisPlatform::UpdateJammerSystem().

◆ GetEM_Rcvr()

WsfEM_Rcvr & WsfWeapon::GetEM_Rcvr ( size_t aIndex)
virtual

Get the attributes for the receiver with a specified index.

Parameters
aIndexThe index of the receiver whose attributes are being requested. This must be in the range [0, GetEM_RcvrCount() - 1].
Note
It is an error to call this method if the weapon does not have any receivers (i.e.: GetEM_RcvrCount() == 0).

References WsfEM_Rcvr::cRF_INTERFERER.

Referenced by WithinFieldOfView(), and WithinFieldOfView().

◆ GetEM_RcvrCount()

size_t WsfWeapon::GetEM_RcvrCount ( ) const
virtual

Return the number of receivers associated with the weapon.

Returns
The number of receivers associated with the weapon. This can be zero.

Referenced by WithinFieldOfView(), and WithinFieldOfView().

◆ GetEM_Xmtr() [1/3]

WsfEM_Xmtr & WsfWeapon::GetEM_Xmtr ( size_t aIndex)
virtual

Get the attributes for the transmitter with a specified index.

Parameters
aIndexThe index of the transmitter whose attributes are being requested. This must be in the range [0, GetEM_XmtrCount() - 1].
Note
It is an error to call this method if the weapon does not have any transmitters (i.e.: GetEM_XmtrCount() == 0).

Reimplemented in WsfRF_Jammer.

References WsfEM_Xmtr::cXF_INTERFERER.

Referenced by WsfRF_Jammer::GetEM_Xmtr(), WsfRF_Jammer::GetEM_Xmtr(), WsfRF_Jammer::GetJammerXmtr(), WsfXIO_WeaponComponent::HandleStateChangeRequest(), WsfMilDisInterface::RemoveXmtrs(), WsfMilDisPlatform::UpdateJammerSystem(), WsfMilDisInterface::UpdateSystemFromWeapon(), and WsfMilDisInterface::UpdateWeapon().

◆ GetEM_Xmtr() [2/3]

WsfEM_Xmtr & WsfWeapon::GetEM_Xmtr ( size_t aModeIndex,
size_t aBeamIndex,
size_t aSpotIndex )
virtual

Get the attributes for the transmitter on the specified beam and spot index.

Parameters
aModeIndexThe index of the mode containing the beam with the transmitter.
aBeamIndexThe index of the beam containing the transmitter.
aSpotIndexThe index of the transmitter whose attributes are being requested. This must be in the range [0, GetEM_XmtrCount() - 1] for the specified beam.
Note
It is an error to call this method if the weapon does not have any transmitters (i.e.: GetEM_XmtrCount() == 0).

Reimplemented in WsfRF_Jammer.

References WsfEM_Xmtr::cXF_INTERFERER.

◆ GetEM_Xmtr() [3/3]

WsfEM_Xmtr & WsfWeapon::GetEM_Xmtr ( size_t aModeIndex,
size_t aIndex )
virtual

Get the attributes for the transmitter with a specified index.

Parameters
aModeIndexThe index of the mode containing the transmitter.
aIndexThe index of the transmitter whose attributes are being requested. This must be in the range [0, GetEM_XmtrCount() - 1].
Note
It is an error to call this method if the weapon does not have any transmitters (i.e.: GetEM_XmtrCount() == 0).

Reimplemented in WsfRF_Jammer.

References WsfEM_Xmtr::cXF_INTERFERER.

◆ GetEM_XmtrCount() [1/2]

size_t WsfWeapon::GetEM_XmtrCount ( ) const
virtual

◆ GetEM_XmtrCount() [2/2]

size_t WsfWeapon::GetEM_XmtrCount ( size_t aModeIndex) const
virtual

Return the number of transmitters associated with the weapon.

Parameters
aModeIndexThe index of the mode containing the transmitter.
Returns
The number of transmitters associated with the weapon. This can be zero.

Reimplemented in WsfRF_Jammer.

◆ GetFiringDelay()

virtual double WsfWeapon::GetFiringDelay ( )
inlinevirtual

Get the amount of time that must elapse from the time a request is made until the first round can be fired.

Note
This may be a statistical distribution. Each call causes a new draw and may be zero.

Referenced by CueToTarget(), and FireSalvo().

◆ GetFiringInterval()

double WsfWeapon::GetFiringInterval ( ) const
inline

Get the amount of time that must elapse between firings. Time from the completion of the last request until the start of the next request (trailing edge to leading edge).

Referenced by ContinueSalvo(), WsfExplicitWeapon::Fire(), WsfImplicitWeapon::Fire(), and FireSalvo().

◆ GetIFCEnabled()

bool WsfWeapon::GetIFCEnabled ( ) const
inline

Returns 'true' if the platform supports IFC (Integrated Fire Control).

Referenced by WsfExplicitWeapon::FireP().

◆ GetInitialStateQuantityRemaining()

double WsfWeapon::GetInitialStateQuantityRemaining ( ) const
inline

Get the initial state of the weapon layout. Return the initial quantities.

Referenced by WsfTowedMover::CleanUpStowedAsset(), and WsfChaffWeapon::GetQuantityRemaining().

◆ GetLaunchComputer()

WsfLaunchComputer * WsfWeapon::GetLaunchComputer ( ) const
inline

◆ GetLaunchedPlatformType()

◆ GetMaximumBeamCount()

virtual size_t WsfWeapon::GetMaximumBeamCount ( ) const
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ GetMaximumQuantity()

double WsfWeapon::GetMaximumQuantity ( ) const
virtual

Return the maximum quantity that may be 'loaded'.

Referenced by WsfImplicitWeapon::Initialize(), and SetQuantityRemaining().

◆ GetMaximumRequestCount()

virtual unsigned int WsfWeapon::GetMaximumRequestCount ( ) const
inlinevirtual

Return the maximum number of 'FireSalvo' calls that may be in process at a time. For RF jammers, this represents the maximum number of spots per mode.

Reimplemented in WsfRF_Jammer.

Referenced by WsfAssetPerception::AssetSystem::AssetSystem(), WsfBMStatusMessage::SetWeaponStatus(), and WsfMilDisInterface::UpdateWeapon().

◆ GetMaximumSpotCount()

virtual size_t WsfWeapon::GetMaximumSpotCount ( size_t aBeamNumber) const
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ GetModeCount()

size_t WsfWeapon::GetModeCount ( )
virtual

Get the number of modes associated with the weapon.

References mModeListPtr.

Referenced by WsfAssetPerception::AssetSystem::AssetSystem(), DeselectMode(), WsfXIO_WeaponComponent::FillPartState(), GetModeName(), and SelectMode().

◆ GetModeEntry()

◆ GetModeIndex()

size_t WsfWeapon::GetModeIndex ( WsfStringId aModeNameId)
virtual

Return the index of the mode with the specified name (ID).

Parameters
aModeNameIdThe string ID of the name whose index is requested. If this value is zero then 0 will be returned.
Returns
If 0 was specified for aModeNameId then 0 will be returned. If the mode exists the value will be the index of the mode in the range 0 <= index < GetModeCount(). If the mode does not exist then the value of GetModeCount() will be returned.

References mModeListPtr.

◆ GetModeName()

WsfStringId WsfWeapon::GetModeName ( size_t aModeIndex)
virtual

Return the string ID of the string associated with the name of the mode with the specified index.

Parameters
aModeIndexThe index of the desired mode such that 0 <= aModeIndex < GetModeCount().

References WsfModeList::GetDefaultModeNameId(), GetModeCount(), and mModeListPtr.

◆ GetQuantityCommitted()

double WsfWeapon::GetQuantityCommitted ( ) const
virtual

Return the quantity that is currently committed.

◆ GetQuantityRemaining()

double WsfWeapon::GetQuantityRemaining ( ) const
virtual

Return the quantity (rounds, bombs, units) remaining.

This includes the number of units that have been committed via 'FireSalvo'.

Note
The quantity is expressed as real value rather than an integer value to provide for weapons that expend themselves in a continuous manner rather than a discrete manner). For example, "quantity" might be a unitless discrete number representing the number of JDAM remaining, or it could mean the (more or less continuous) number of joules available to a high-energy laser (HEL). The derived class should maintain the quantity as desired and implement this method to return the current remaining quantity.

Reimplemented in WsfChaffWeapon, WsfExplicitWeapon, WsfLaserWeapon, and WsfRF_Jammer.

Referenced by WsfWMAIEngagementMod::AddBehaviorsToStack(), WsfAssetPerception::AssetSystem::AssetSystem(), WsfXIO_WeaponComponent::FillPartState(), WsfImplicitWeapon::Fire(), WsfExplicitWeapon::GetQuantityRemaining(), WsfWeaponServer::ProcessCommand(), WsfBMStatusMessage::SetWeaponStatus(), WsfL16::SystemStatusPart::WeaponQuantity(), and WsfMilEventPipe::WeaponQuantityChanged().

◆ GetReloadIncrement()

double WsfWeapon::GetReloadIncrement ( ) const
inline

Flag indicating the (nominal) amount of inventory replenished during a reload event. The nominal reload increment will be reduced if the 'external inventory' contains less than this amount, or if the full increment would exceed the maximum capacity of the weapon.

◆ GetReloadInterval()

double WsfWeapon::GetReloadInterval ( ) const
inlineprotected

◆ GetReloadInventory()

double WsfWeapon::GetReloadInventory ( ) const
inline

Returns the quantity available in 'external inventory' This amount will not be consumed during weapon firing, but will be during a reload.

Referenced by ProcessReloading().

◆ GetReloadThreshold()

double WsfWeapon::GetReloadThreshold ( ) const
inline

Returns the depleted value of inventory at which a reload is attempted.

Referenced by ProcessReloading().

◆ GetSalvoInterval()

virtual double WsfWeapon::GetSalvoInterval ( )
inlinevirtual

Get the amount of time that must elapse between rounds in a multi-round salvo.

Note
This may be a statistical distribution. Each call causes a new draw and may be zero.

Referenced by ContinueSalvo().

◆ GetScriptClassName()

const char * WsfWeapon::GetScriptClassName ( ) const
override

◆ GetState()

WeaponState WsfWeapon::GetState ( ) const
inline

Return weapon state.

Referenced by WsfExplicitWeapon::AddWeaponToSimulation().

◆ GetTargetedLocationWCS()

virtual void WsfWeapon::GetTargetedLocationWCS ( int aId,
double aTargetedLocationWCS[3] ) const
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ GetTargetIndex()

virtual size_t WsfWeapon::GetTargetIndex ( int aId) const
inlinevirtual

◆ GetTargetLocationWCS()

bool WsfWeapon::GetTargetLocationWCS ( double aSimTime,
const WsfTrack * aTrackPtr,
double aTargetLocWCS[3] )

Return the target location from the track.

Parameters
aSimTimeThe current simulation time.
aTrackPtrThe pointer to the track from which the location is to be extracted (may be 0)
aTargetLocWCSThe resulting target location. This will be valid only if the return value from this method is 'true'.
Returns
'true' if 'aTargetLocWCS' contains valid data.

References wsf::Terrain::GetElevInterp(), WsfMeasurement::GetExtrapolatedLocationWCS(), WsfPlatformPart::GetPlatform(), and WsfPlatformPart::GetSimulation().

Referenced by CreateTargetTrack(), and CueToTarget().

◆ GetTimeLastFired()

double WsfWeapon::GetTimeLastFired ( ) const
inline

Get the simulation time when the weapon was last fired.

Referenced by ContinueSalvo(), WsfExplicitWeapon::Fire(), WsfImplicitWeapon::Fire(), and FireSalvo().

◆ GetTotalQuantityUsed()

double WsfWeapon::GetTotalQuantityUsed ( ) const
virtual

Return the cumulative running total of the quantity used (fired).

Referenced by WsfExplicitWeapon::FireP(), and WsfChaffWeapon::GetQuantityRemaining().

◆ GetUpdateInterval()

double WsfWeapon::GetUpdateInterval ( ) const
inlineoverridevirtual

Get the update interval.

Implements WsfPlatformPart.

Referenced by WsfATG_LaunchComputer::Initialize().

◆ GetWeaponEffectsType()

WsfStringId WsfWeapon::GetWeaponEffectsType ( ) const
inline

Get the string ID of the weapon effects to be used.

Referenced by WsfImplicitWeapon::BeginEngagement(), WsfExplicitWeapon::FireP(), and WsfDisDirectedEnergyFire::Process().

◆ InhibitWhileReloading()

bool WsfWeapon::InhibitWhileReloading ( ) const
inline

Flag indicating that when a weapon reload is in progress, any firing will be inhibited.

Referenced by WsfAssetPerception::AssetSystem::AssetSystem(), WsfExplicitWeapon::Fire(), and WsfImplicitWeapon::Fire().

◆ Initialize()

bool WsfWeapon::Initialize ( double aSimTime)
overridevirtual

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 WsfArticulatedPart.

References WsfWeaponEffectsTypes::Get(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfPlatformPart::GetScenario(), WsfPlatform::GetScriptContext(), WsfSimulation::GetScriptContext(), WsfPlatformPart::GetSimulation(), WsfArticulatedPart::Initialize(), mModeListPtr, ok, and SetQuantityRemaining().

Referenced by WsfMilExtInterface::AddWeapon(), WsfExplicitWeapon::Initialize(), WsfImplicitWeapon::Initialize(), WsfLaserWeapon::Initialize(), WsfRF_Jammer::Initialize(), WsfDisWeaponEvents::InitiateWeaponTransfer(), and WsfWeaponServer::ProcessCommand().

◆ Initialize2()

bool WsfWeapon::Initialize2 ( double aSimTime)
overridevirtual

Perform phase 2 initialization of the part. This is invoked by WsfPlatform::Initialize() during phase 2 initialization of the platform. During phase 2, platform components may assume that the platform location has been defined, initial tracks have been loaded and that all components have completed phase 1 initialization.

Parameters
aSimTimeThe current simulation time.
Returns
'true' if successful or 'false' if some sort of error occurred.

Reimplemented from WsfPlatformPart.

References WsfComponent::Initialize2(), and ok.

Referenced by WsfExplicitWeapon::Initialize2().

◆ IsQuantitySpecified()

bool WsfWeapon::IsQuantitySpecified ( ) const
inlineprotected

◆ IsReloading()

bool WsfWeapon::IsReloading ( ) const
inline

Flag indicating that weapon reload is in progress. If true a weapon reload is in progress and the amount of inventory in 'external' replenishment storage has been decremented, but the weapon quantity has not yet been incremented.

Referenced by WsfAssetPerception::AssetSystem::AssetSystem(), WsfExplicitWeapon::Fire(), and WsfImplicitWeapon::Fire().

◆ operator=()

WsfWeapon & WsfWeapon::operator= ( const WsfWeapon & )
protecteddelete

References WsfWeapon().

◆ PartBroken()

void WsfWeapon::PartBroken ( double aSimTime)
overridevirtual

Set the status to Broken.

Parameters
aSimTimeThe current simulation time.
Note
This method should not be invoked directly by application code.

Reimplemented from WsfPlatformPart.

References DetermineFirepowerStatus(), WsfPlatformPart::GetPlatform(), WsfPlatformPart::GetSimulation(), WsfPlatformPart::PartBroken(), and WsfObserver::WeaponKilled().

◆ PreInitialize()

bool WsfWeapon::PreInitialize ( double aSimTime)
overridevirtual

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.

References WsfPlatformPart::GetScenario(), ok, WsfComponent::PreInitialize(), and WsfComponentFactoryList< PARENT_TYPE >::PreInitialize().

◆ PreInput()

void WsfWeapon::PreInput ( )
overridevirtual

Perform pre-input processing. This is called in certain contexts just before input processing is FIRST done for a component (See WsfObjectTypeListBase::LoadComponentP.) The primary motivation is to allow the newly created component to invoke the type/role-specific PreInput method in the component factories, which may in turn add any sub-components that MAY be required for input processing or for run-time.

This is currently implemented only for platform level components such as WsfComm, WsfProcessor, WsfSensor and some components implemented in optional projects. You can look at the PreInput methods in each of these and see they are very simple.

The reason for this is that WsfObjectTypeListBase::LoadComponentP cannot simply invoke the PreInput methods in the component factories. PreInput is only defined in the template WsfComponentFactoryT<>, and the PreInput method in the template defines a method whose argument is a reference to the object being created. There is no way for LoadComponentP to do this in general. Delegating it to to component solves the problem.

Note
This method may get called more than once as input objects derive from other input type-objects.

Reimplemented from WsfComponent.

References WsfPlatformPart::GetScenario(), and WsfComponentFactoryList< PARENT_TYPE >::PreInput().

◆ ProcessInput()

bool WsfWeapon::ProcessInput ( UtInput & aInput)
overridevirtual

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from WsfArticulatedPart.

References WsfLaunchComputerTypes::Get(), WsfPlatformPart::GetScenario(), mModeListPtr, WsfArticulatedPart::ProcessInput(), WsfAuxDataEnabled::ProcessInput(), and WsfComponentFactoryList< PARENT_TYPE >::ProcessInput().

Referenced by WsfExplicitWeapon::ProcessInput(), WsfLaserWeapon::ProcessInput(), and WsfRF_Jammer::ProcessInput().

◆ ProcessReloading()

void WsfWeapon::ProcessReloading ( double aSimTime)
protectedvirtual

After a successful weapon Fire(), this method checks to see if the reload threshold has been reached, and will initiate reloading, as needed, and if possible.

References WsfSimulation::AddEvent(), GetReloadInventory(), GetReloadThreshold(), WsfPlatformPart::GetSimulation(), and WsfObserver::WeaponReloadStarted().

Referenced by WsfExplicitWeapon::AddWeaponToSimulation(), WsfImplicitWeapon::BeginEngagement(), and ContinueSalvo().

◆ QueryInterface()

void * WsfWeapon::QueryInterface ( int aRole)
overridevirtual

Requests a component's role interface. A component can support one or more roles.

Parameters
aRoleThe role whose interface is to be returned.
Returns
A pointer to the object if it supports the indicated role, or 'null' if it does not. Usage: WsfProcessor* procPtrOrNull = (WsfProcessor*)componentPtr->QueryComponentInterface(cWSF_COMPONENT_PROCESSOR);

Reimplemented from WsfArticulatedPart.

References cWSF_COMPONENT_WEAPON, and WsfArticulatedPart::QueryInterface().

Referenced by WsfRF_Jammer::QueryInterface().

◆ Restore()

void WsfWeapon::Restore ( double aSimTime)
overridevirtual

Perform process of Restoring a part (return to Operational from non-Operational). This virtual function will usually be a response to a time-queued event. If the Damage Factor of the part is totally damaged, it will be set to "slightly" less than totally damaged, to permit the part to become Operational again.

Parameters
aSimTimeThe current simulation time.

Reimplemented from WsfPlatformPart.

References DetermineFirepowerStatus(), WsfPlatformPart::GetPlatform(), and WsfPlatformPart::Restore().

◆ RoundsCompleteFor() [1/2]

int WsfWeapon::RoundsCompleteFor ( const WsfPlatform & aPlatform,
const WsfTrackId & aTrackId,
WsfStringId aWeaponName = WsfStringId() )
static

◆ RoundsCompleteFor() [2/2]

int WsfWeapon::RoundsCompleteFor ( const WsfTrackId & aTrackId) const

Returns number of weapons that were fired at the track and are now terminated.

References WsfTrackId::IsNull(), and mWeaponStatusMap.

◆ RoundsFiredAt() [1/2]

◆ RoundsFiredAt() [2/2]

int WsfWeapon::RoundsFiredAt ( const WsfTrackId & aTrackId) const

Return the count of the number of rounds that have been fired at the specified track .

Parameters
aTrackIdThe local track ID of the track of interest.

References RoundsCompleteFor(), and WeaponsActiveFor().

◆ SalvosFiredAt() [1/2]

int WsfWeapon::SalvosFiredAt ( const WsfPlatform & aPlatform,
const WsfTrackId & aTrackId,
WsfStringId aWeaponName = WsfStringId() )
static

Returns number of salvo fire requests requested, and not the actual number of salvos fired.

References WsfComponentList::RoleIterator< T >::AtEnd(), WsfComponentList::GetComponent(), SalvosFiredAt(), and WsfWeapon().

Referenced by SalvosFiredAt(), WsfWeaponTaskManager::SalvosFiredAt(), and WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT().

◆ SalvosFiredAt() [2/2]

int WsfWeapon::SalvosFiredAt ( const WsfTrackId & aTrackId) const

Return the count of the number of salvos that have been fired at the specified track.

Parameters
aTrackIdThe local track ID of the track of interest.

References WsfTrackId::IsNull(), and mWeaponStatusMap.

◆ SelectEA_Technique()

virtual bool WsfWeapon::SelectEA_Technique ( double aSimTime,
double aFrequency,
double aBandwidth,
size_t aBeamNumber,
WsfStringId aTechniqueId,
WsfTrackId aTrackId )
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ SelectMode()

void WsfWeapon::SelectMode ( double aSimTime,
WsfStringId aModeNameId )
virtual

Set the weapon mode given the string ID of the name of the desired mode.

Parameters
aSimTimeThe current simulation time.
aModeNameIdThe string ID of the desired mode.

References GetModeCount(), WsfPlatformPart::GetSimulation(), mModeListPtr, and WsfObserver::WeaponModeActivated().

Referenced by WsfXIO_WeaponComponent::HandleStateChangeRequest().

◆ SetEA_DeltaGainTechnique() [1/2]

virtual bool WsfWeapon::SetEA_DeltaGainTechnique ( double aSimTime,
WsfStringId aTechniqueId,
bool aOnOff,
WsfStringId aEffectId,
double aJammingDeltaGain_dB,
WsfStringId aSystemTypeId,
WsfStringId aFunctionTypeId )
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ SetEA_DeltaGainTechnique() [2/2]

virtual bool WsfWeapon::SetEA_DeltaGainTechnique ( double aSimTime,
WsfStringId aTechniqueId,
bool aOnOff,
WsfStringId aEffectId,
double aJammingDeltaGain_dB,
WsfStringId aSystemTypeId,
WsfStringId aFunctionTypeId,
double aFrequency,
double aBandwidth,
size_t aBeamNumber,
WsfTrackId aTrackId )
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ SetFiringDelay()

void WsfWeapon::SetFiringDelay ( const WsfRandomVariable & aFiringDelay)
inline

Set the amount of time that must elapse from the time a request is made until the first round can be fired.

Note
This may be a statistical distribution.

◆ SetFiringInterval()

void WsfWeapon::SetFiringInterval ( double aFiringInterval)
inline

Set the amount of time that must elapse between firings. Time from the completion of the last request until the start of the next request (trailing edge to leading edge).

◆ SetIFCEnabled()

void WsfWeapon::SetIFCEnabled ( bool aEnabled)
inline

Set to true is IFC is supported.

◆ SetIsReloading()

void WsfWeapon::SetIsReloading ( bool aValue)
inlineprotected

Method used for derived classes to set or clear the IsReloading Flag.

◆ SetLaunchComputer()

void WsfWeapon::SetLaunchComputer ( WsfLaunchComputer * aLaunchComputerPtr)

Set the launch computer pointer.

Parameters
aLaunchComputerPtrpointer to the aggregated instance.

Referenced by WsfLaunchComputerTypes::LoadInstance().

◆ SetLaunchedPlatformType()

void WsfWeapon::SetLaunchedPlatformType ( WsfStringId aLaunchedPlatformType)
inline

◆ SetMaximumRequestCount()

void WsfWeapon::SetMaximumRequestCount ( unsigned int aMaximumRequestCount)
inlineprotected

◆ SetModeList()

void WsfWeapon::SetModeList ( WsfModeList * aModeListPtr)
protected

Set the pointer to the 'mode list'.

Parameters
aModeListPtrPointer to the new mode list object. The weapon assumes ownership of the object. Any existing mode list will be deleted.

References mModeListPtr.

Referenced by WsfRF_Jammer::WsfRF_Jammer().

◆ SetNonOperational()

void WsfWeapon::SetNonOperational ( double aSimTime)
overridevirtual

Set the status to non-Operational.

Parameters
aSimTimeThe current simulation time.
Note
This method should not be invoked directly by application code.

Reimplemented from WsfPlatformPart.

References WsfPlatformPart::GetSimulation(), WsfPlatformPart::SetNonOperational(), and WsfObserver::WeaponNonOperational().

◆ SetOperational()

void WsfWeapon::SetOperational ( double aSimTime)
overridevirtual

Set the status to Operational.

Parameters
aSimTimeThe current simulation time.
Note
This method should not be invoked directly by application code.

Reimplemented from WsfPlatformPart.

References WsfPlatformPart::GetSimulation(), WsfPlatformPart::SetOperational(), and WsfObserver::WeaponOperational().

◆ SetQuantityRemaining()

void WsfWeapon::SetQuantityRemaining ( double aQuantity)
virtual

◆ SetState()

void WsfWeapon::SetState ( WeaponState aState)

============================================================================================== Used primarily by the weapon server to set the state of the weapon during allocation and weapon data setup. A series of two SetData/Data pdus are sent/received, the first is the Allocation SetData Pdu/Data Acknowledge Pdu, the second is the Umbilical Set Data Pdu/Data Acknowledge Pdu. When the first is sent/received the weapon is put into the cWPN_ALLOCATE state, when the umbilical data is send/received the weapon is then put into the cWPN_READY state, then a fire pdu can be sent when a fire command is issued. If a NACK was received back in the first Data pdu or any of the acknowledge Data Pdus were not received, then the weapon would not have been allocated.

Referenced by WsfExplicitWeapon::AddWeaponToSimulation().

◆ SetTargetedLocationWCS()

virtual void WsfWeapon::SetTargetedLocationWCS ( int aId,
const double aTargetedLocationWCS[3] )
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ SetTargetIndex()

virtual void WsfWeapon::SetTargetIndex ( int aId,
size_t aTargetIndex )
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ SetTimeLastFired()

void WsfWeapon::SetTimeLastFired ( double aSimTime)
protected

Set the time the weapon the was last fired. The 'last firing time' should represent when the weapon was last known to be firing. In general, a derived class should invoke this method in Fire when it fires the weapon. If the weapon is one where a firing event extends over a period of time (such as a laser) then it should also be called again when the firing event stops. The net effect is that GetLastTimeFired() + GetFiringInterval() would be the next time the weapon could be fired.

Parameters
aSimTimeThe current simulation time.

Referenced by WsfExplicitWeapon::AddWeaponToSimulation(), and WsfImplicitWeapon::BeginEngagement().

◆ SetUpdateInterval()

void WsfWeapon::SetUpdateInterval ( double aUpdateInterval)
inlineoverridevirtual

Set the time interval between the periodic calls to Update(). A value of less than or equal to zero indicates periodic updates are not to be performed.

Parameters
aUpdateIntervalThe new update interval.
Note
Users should call WsfSimulation::SetPartUpdateInterval() to set the interval.

Implements WsfPlatformPart.

◆ SetWeaponEffectsType()

void WsfWeapon::SetWeaponEffectsType ( WsfStringId aWeaponEffect)
inline

Set the string ID of the weapon effects to be used.

◆ StartJamming()

virtual bool WsfWeapon::StartJamming ( double aSimTime,
double aFrequency,
double aBandwidth,
size_t aBeamNumber,
WsfStringId aTechniqueId,
WsfTrackId aTrackId,
size_t aTargetIndex )
inlinevirtual

◆ StartJammingTrack()

virtual bool WsfWeapon::StartJammingTrack ( double aSimTime,
WsfStringId aTechniqueId,
const WsfTrack * aTrackPtr )
inlinevirtual

Reimplemented in WsfRF_Jammer.

Referenced by WsfWeaponTaskManager::AcquireResource().

◆ StopJamming()

virtual bool WsfWeapon::StopJamming ( double aSimTime,
double aFrequency,
double aBandwidth,
size_t aBeamNumber,
WsfTrackId aTrackId )
inlinevirtual

◆ TargetedLocationValid()

virtual bool WsfWeapon::TargetedLocationValid ( int aId) const
inlinevirtual

Reimplemented in WsfRF_Jammer.

◆ TimeWeaponLastFiredFor() [1/2]

◆ TimeWeaponLastFiredFor() [2/2]

double WsfWeapon::TimeWeaponLastFiredFor ( const WsfTrackId & aTrackId) const

Return the simulation time of the most recent weapon firing against the specified track.

References mWeaponStatusMap, and simTime.

◆ TimeWeaponLastTerminatedFor() [1/2]

◆ TimeWeaponLastTerminatedFor() [2/2]

double WsfWeapon::TimeWeaponLastTerminatedFor ( const WsfTrackId & aTrackId) const

Return the simulation time of the most recent weapon termination against the specified track.

References mWeaponStatusMap, and simTime.

◆ TurnOff()

void WsfWeapon::TurnOff ( double aSimTime)
overridevirtual

Turn the weapon off.

Parameters
aSimTimeThe current simulation time.
Note
This method should not be invoked directly by application code. Use the WsfSimulation::TurnWeaponOff method.

Reimplemented from WsfPlatformPart.

References AbortSalvo(), WsfPlatformPart::GetSimulation(), mModeListPtr, WsfPlatformPart::TurnOff(), TurnOff(), WsfObserver::WeaponTurnedOff(), and WSF_CALL_VOID_COMPONENTS.

Referenced by WsfCuedLaserWeapon::TurnOff(), WsfExplicitWeapon::TurnOff(), WsfLaserWeapon::TurnOff(), WsfRF_Jammer::TurnOff(), and TurnOff().

◆ TurnOn()

void WsfWeapon::TurnOn ( double aSimTime)
overridevirtual

Turn the weapon on.

Parameters
aSimTimeThe current simulation time.
Note
This method should not be invoked directly by application code. Use the WsfSimulation::TurnWeaponOn method.

Reimplemented from WsfPlatformPart.

References WsfPlatformPart::GetSimulation(), mModeListPtr, WsfPlatformPart::TurnOn(), TurnOn(), WsfObserver::WeaponTurnedOn(), and WSF_CALL_VOID_COMPONENTS.

Referenced by WsfRF_Jammer::TurnOn(), and TurnOn().

◆ Update()

void WsfWeapon::Update ( double aSimTime)
overridevirtual

Update the state of the weapon to the supplied time value.

Reimplemented from WsfPlatformPart.

Referenced by WsfImplicitWeapon::Update().

◆ UpdateJamming()

virtual bool WsfWeapon::UpdateJamming ( double aSimTime,
size_t aXmtrIndex,
double aFrequency,
double aBandwidth,
WsfStringId aTechniqueId,
WsfTrackId aTrackId,
size_t aTargetIndex )
inlinevirtual

Reimplemented in WsfRF_Jammer.

Referenced by WsfMilDisInterface::UpdateWeapon().

◆ WeaponFireAborted()

void WsfWeapon::WeaponFireAborted ( double aSimTime,
const WsfTrack * aTargetTrackPtr,
double aQuantity )
protectedvirtual

◆ WeaponsActiveAndPendingFor() [1/2]

◆ WeaponsActiveAndPendingFor() [2/2]

int WsfWeapon::WeaponsActiveAndPendingFor ( const WsfTrackId & aTrackId) const

Return the count of the number of weapons that are active & pending against the specified track.

Parameters
aTrackIdThe local track ID of the track of interest.

References WeaponsActiveFor(), and WeaponsPendingFor().

◆ WeaponsActiveFor() [1/2]

int WsfWeapon::WeaponsActiveFor ( const WsfPlatform & aPlatform,
const WsfTrackId & aTrackId,
WsfStringId aWeaponName = WsfStringId() )
static

◆ WeaponsActiveFor() [2/2]

int WsfWeapon::WeaponsActiveFor ( const WsfTrackId & aTrackId) const

Return the count of the number of weapons that are active against the specified track.

Parameters
aTrackIdThe local track ID of the track of interest.

References WsfTrackId::IsNull(), and mWeaponStatusMap.

◆ WeaponsPendingFor() [1/2]

int WsfWeapon::WeaponsPendingFor ( const WsfPlatform & aPlatform,
const WsfTrackId & aTrackId,
WsfStringId aWeaponName = WsfStringId() )
static

Returns number of weapons that will be but have not yet been fired yet at the track Typically pending for firing delays or salvo intervals

References WsfComponentList::RoleIterator< T >::AtEnd(), WsfComponentList::GetComponent(), WeaponsPendingFor(), and WsfWeapon().

Referenced by WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), WeaponsActiveAndPendingFor(), and WeaponsPendingFor().

◆ WeaponsPendingFor() [2/2]

int WsfWeapon::WeaponsPendingFor ( const WsfTrackId & aTrackId) const

Return the count of the number of weapons that are pending against the specified track.

Parameters
aTrackIdThe local track ID of the track of interest.

References WsfTrackId::IsNull(), and mWeaponStatusMap.

◆ WithinFieldOfView() [1/2]

◆ WithinFieldOfView() [2/2]

bool WsfWeapon::WithinFieldOfView ( double aSimTime,
WsfTrack * aTrackPtr )
virtual

Member Data Documentation

◆ cUNDEFINED_DOUBLE

const double WsfWeapon::cUNDEFINED_DOUBLE = 1.0E+30
static

◆ mModeListPtr

◆ mWeaponStatusMap


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