WSF
WsfMilScriptExtensions.cpp File Reference
#include "WsfMilScriptExtensions.hpp"
#include <string>
#include "UtMath.hpp"
#include "UtMemory.hpp"
#include "UtScriptClassDefine.hpp"
#include "WsfAcousticSignature.hpp"
#include "WsfAssetPerception.hpp"
#include "WsfComm.hpp"
#include "WsfCommandChain.hpp"
#include "WsfEW_CommComponent.hpp"
#include "WsfEW_Result.hpp"
#include "WsfEW_SensorComponent.hpp"
#include "WsfGeoPoint.hpp"
#include "WsfInfraredSignature.hpp"
#include "WsfInherentContrast.hpp"
#include "WsfLaserDesignator.hpp"
#include "WsfLaserTracker.hpp"
#include "WsfMil.hpp"
#include "WsfOpticalReflectivity.hpp"
#include "WsfOpticalSignature.hpp"
#include "WsfPerceptionProcessor.hpp"
#include "WsfPlatform.hpp"
#include "WsfSensor.hpp"
#include "WsfSimulation.hpp"
#include "WsfTaskManager.hpp"
#include "WsfTaskProcessor.hpp"
#include "WsfTrack.hpp"
#include "WsfTrackId.hpp"
#include "WsfUplinkProcessor.hpp"
#include "WsfWeapon.hpp"
#include "WsfWeaponEngagement.hpp"
#include "WsfWeaponObserver.hpp"
#include "WsfWeaponTask.hpp"
#include "WsfWeaponTaskManager.hpp"
#include "WsfWeaponTaskResource.hpp"
#include "script/WsfScriptDefs.hpp"
Include dependency graph for WsfMilScriptExtensions.cpp:

Namespaces

namespace  WsfCommScriptMethods
namespace  WsfEM_InteractionScriptMethods
namespace  WsfMoverScriptMethods
namespace  WsfPlatformScriptMethods
namespace  WsfProcessScriptMethods
namespace  WsfSensorScriptMethods
namespace  WsfTaskManagerScriptMethods
namespace  WsfTrackScriptMethods

Functions

WsfTrackId GetTrackId (const UtScriptData &aScriptArg)
bool HasOperationalWeapon (WsfPlatform *aPlatformPtr)
bool HasOperationalSubordinate (WsfPlatform *aCmdrPtr, WsfStringId aSubType, std::set< WsfPlatform * > &aChecked)
 WsfCommScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (wsf::comm::Comm, JammingPerceived, 0, "bool", "")
 WsfEM_InteractionScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfEM_Interaction, SignalToNoiseClutterJamming, 0, "double", "")
 WsfEM_InteractionScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfEM_Interaction, NoiseJammerPower, 0, "double", "")
 WsfEM_InteractionScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfEM_Interaction, PulseJammerPower, 0, "double", "")
 WsfEM_InteractionScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfEM_Interaction, CoherentJammerPower, 0, "double", "")
 WsfEM_InteractionScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfEM_Interaction, EW_Effects, 0, "WsfEW_Effects", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, PerceptionProcessor, 0, "WsfPerceptionProcessor", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, PerceivedAssets, 0, "Array<WsfAssetPerception>", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, PerceivedThreats, 0, "Array<WsfTrack>", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, UplinkProcessor, 0, "WsfUplinkProcessor", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, IsUplinkingTo, 1, "bool", "WsfPlatform")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, UplinkCount, 0, "int", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, UplinkCapable, 0, "bool", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, UplinkPlatformEntry, 1, "WsfPlatform", "int")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, StartUplinking_1, 1, "bool", "WsfPlatform")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, StartUplinking_2, 2, "bool", "WsfPlatform, WsfTrack")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, StopUplinking, 1, "bool", "WsfPlatform")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, MaxSupportedUplinks, 0, "int", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, Detonate, 1, "void", "string")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, Weapon, 1, "WsfWeapon", "string")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, WeaponCount, 0, "int", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, WeaponEntry, 1, "WsfWeapon", "int")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, TimeSinceWeaponLastFiredFor, 1, "double", "WsfTrackId")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, TimeSinceWeaponLastTerminatedFor, 1, "double", "WsfTrackId")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, WeaponsPendingFor, 1, "int", "WsfTrackId")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, WeaponsActiveFor, 1, "int", "WsfTrackId")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, RoundsCompleteFor, 1, "int", "WsfTrackId")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, RoundsFiredAt, 1, "int", "WsfTrackId")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, SalvosFiredAt, 1, "int", "WsfTrackId")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, ActiveWeaponPlatformsFor, 1, "WsfPlatformList", "WsfTrackId")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, WeaponEngagement, 0, "WsfWeaponEngagement", "")
aReturnVal WsfPlatformScriptMethods::SetBool (hasOpSub)
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, GetSubsCentroid, 0, "WsfGeoPoint", "")
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, WithinFieldOfView_1, 2, "bool", "WsfTrack, string")
 bool withinFieldOfView = WithinFieldOfView(WsfTrack aTrack, string aSensorOrWeapon)
 WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfPlatform, WithinFieldOfView_2, 2, "bool", "WsfPlatform, string")
 bool withinFieldOfView = WithinFieldOfView(WsfPlatform aPlatform, string aSensorOrWeapon)
 WsfProcessScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfProcessor, TargetAllocated, 3, "void", "double, WsfPlatform, WsfTrack")
 WsfProcessScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfProcessor, TargetEngaged, 3, "void", "double, WsfPlatform, WsfTrack")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, IsEP_TechniqueActive_1, 2, "bool", "string, string")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, IsEP_TechniqueActive_2, 1, "bool", "string")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, SelectEP_Technique_1, 2, "bool", "string, string")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, SelectEP_Technique_2, 1, "bool", "string")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, DeselectEP_Technique_1, 2, "bool", "string, string")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, DeselectEP_Technique_2, 1, "bool", "string")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, JammingPerceived_1, 0, "bool", "")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, JammingPerceived_2, 1, "bool", "string")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, ContinuousJammingPerceived_1, 0, "bool", "")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, ContinuousJammingPerceived_2, 1, "bool", "string")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, PulseJammingPerceived_1, 0, "bool", "")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, PulseJammingPerceived_2, 1, "bool", "string")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, LaserCode_1, 0, "int", "")
 WsfSensorScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfSensor, LaserCode_2, 1, "void", "int")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, TimeSinceWeaponLastFiredFor, 1, "double", "WsfTrackId")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, TimeSinceWeaponLastTerminatedFor, 1, "double", "WsfTrackId")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, WeaponsActiveFor_1, 1, "int", "WsfTrackId")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, WeaponsActiveFor_2, 2, "int", "WsfTrackId, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, RoundsFiredAt_1, 1, "int", "WsfTrackId")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, RoundsFiredAt_2, 2, "int", "WsfTrackId, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, SalvosFiredAt, 1, "int", "WsfTrackId")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, FireLocalWeapon, 4, "bool", "WsfTrack, string, WsfWeapon, int")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, FireRemoteWeapon_1, 5, "bool", "WsfTrack, string, string, int, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, FireRemoteWeapon_2, 6, "bool", "WsfTrack, string, string, int, WsfPlatform, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, AbortFiringAt, 1, "void", "WsfTrackId")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, HaveFiredAt, 1, "bool", "WsfTrackId")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartUplinking_1, 3, "bool", "WsfTrack, string, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartUplinking_2, 4, "bool", "WsfTrack, string, WsfPlatform, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartLocalJamming_1, 5, "bool", "WsfTrack, string, WsfWeapon, double, double")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartLocalJamming_2, 6, "bool", "WsfTrack, string, WsfWeapon, double, double, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartLocalJamming_3, 6, "bool", "WsfTrack, string, WsfWeapon, double, double, int")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartLocalJamming_4, 7, "bool", "WsfTrack, string, WsfWeapon, double, double, int, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartLocalJammingTrack_1, 3, "bool", "WsfTrack, string, WsfWeapon")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartLocalJammingTrack_2, 4, "bool", "WsfTrack, string, WsfWeapon, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJamming_1, 6, "bool", "WsfTrack, string, string, double, double, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJamming_2, 7, "bool", "WsfTrack, string, string, double, double, string, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJamming_3, 7, "bool", "WsfTrack, string, string, double, double, WsfPlatform, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJamming_4, 8, "bool", "WsfTrack, string, string, double, double, string, WsfPlatform, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJamming_5, 7, "bool", "WsfTrack, string, string, double, double, int, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJamming_6, 8, "bool", "WsfTrack, string, string, double, double, int, string, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJamming_7, 8, "bool", "WsfTrack, string, string, double, double, int, WsfPlatform, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJamming_8, 9, "bool", "WsfTrack, string, string, double, double, int, string, WsfPlatform, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJammingTrack_1, 4, "bool", "WsfTrack, string, string, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJammingTrack_2, 5, "bool", "WsfTrack, string, string, string, WsfPlatform")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJammingTrack_3, 5, "bool", "WsfTrack, string, string, WsfPlatform, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StartRemoteJammingTrack_4, 6, "bool", "WsfTrack, string, string, string, WsfPlatform, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StopLocalJamming_1, 5, "bool", "WsfTrackId, string, string, double, double")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StopLocalJamming_2, 6, "bool", "WsfTrackId, string, string, double, double, int")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StopLocalJammingTrack_1, 3, "bool", "WsfTrackId, string, string")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StopRemoteJamming_1, 6, "bool", "WsfPlatform, WsfTrackId, string, string, double, double")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StopRemoteJamming_2, 7, "bool", "WsfPlatform, WsfTrackId, string, string, double, double, int")
 WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTaskManager, StopRemoteJammingTrack_1, 4, "bool", "WsfPlatform, WsfTrackId, string, string")
 WsfTrackScriptMethods::if (targetIndex !=0)
aReturnVal WsfTrackScriptMethods::SetBool (believedAlive)
aReturnVal WsfTrackScriptMethods::SetBool (believedDead)
 WsfTrackScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT (WsfTrack, TargetKilled, 0, "bool", "")
 Uses truth knowledge to report whether or not the target of the track is dead or deleted.

Variables

WsfStringId WsfPlatformScriptMethods::subType = WsfStringId(aVarArgs[0].GetString())
bool WsfPlatformScriptMethods::hasOpSub = ::HasOperationalSubordinate(aObjectPtr, subType, checked)
size_t WsfTrackScriptMethods::targetIndex = aObjectPtr->GetTargetIndex()

Function Documentation

◆ GetTrackId()

WsfTrackId GetTrackId ( const UtScriptData & aScriptArg)

A helper method to get a track ID from a script argument. This method will return the track ID from a script argument. If the pointer to the track ID is null then a null track ID object will be returned. This allows a script user to pass a track ID reference which has not been populated.

Referenced by WsfBeamDirector::PointAtTarget(), WsfDefaultSensorScheduler::Request::Request(), WsfBeamDirector::TurnOff(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), WsfTaskManagerScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT(), and WsfLocalTrackStatus::WsfLocalTrackStatus().

◆ HasOperationalSubordinate()

bool HasOperationalSubordinate ( WsfPlatform * aCmdrPtr,
WsfStringId aSubType,
std::set< WsfPlatform * > & aChecked )

Determine if a any subordinate has any weapons that it can deploy. NOTE: This may end up checking the same weapon system twice, but short of keeping a checked-weapon list, there is no way to get around this. This is eventually going to get replaced.

References WsfComponentList::RoleIterator< T >::AtEnd(), HasOperationalSubordinate(), and HasOperationalWeapon().

Referenced by HasOperationalSubordinate().

◆ HasOperationalWeapon()

bool HasOperationalWeapon ( WsfPlatform * aPlatformPtr)

Determine if a platform has any available weapons to deploy. TODO This needs to be extended to also check to see if the associated tracker (if any) is also available.

References WsfComponentList::RoleIterator< T >::AtEnd().

Referenced by HasOperationalSubordinate().

Copyrights Multiple, All Rights Reserved