WSF
WsfScriptProcessor Class Reference

#include <WsfScriptProcessor.hpp>

Inheritance diagram for WsfScriptProcessor:
Collaboration diagram for WsfScriptProcessor:

Public Member Functions

 WsfScriptProcessor (const WsfScenario &aScenario)
 WsfScriptProcessor (const WsfScenario &aScenario, WsfStringId aPartClass, const std::string &aPartVarName)
 ~WsfScriptProcessor () override
WsfProcessorClone () const override
bool Initialize (double aSimTime) override
bool Initialize2 (double aSimTime) override
bool ProcessInput (UtInput &aInput) override
void Update (double aSimTime) override
bool ProcessMessage (double aSimTime, const WsfMessage &aMessage) override
void SendMessage (double aSimTime, const WsfMessage &aMessage) override
virtual void ExecuteOnMessageCreate (double aSimTime, WsfMessage &aMessage)
virtual bool ExecuteScript (double aSimTime, const std::string &aScriptName)
virtual bool ExecuteScript (double aSimTime, WsfStringId aScriptName, UtScriptData &aScriptRetVal, const UtScriptDataList &aScriptArgs=UtScriptDataList())
void ExecuteScriptAtTime (double aTime, WsfStringId aScriptName, const UtScriptDataList &aScriptArgs)
virtual void SuppressMessage (bool aSuppressMessage)
WsfScriptMessageHandlerGetMessageHandler ()
WsfScriptContextGetScriptContext ()
UtScriptContext * GetScriptAccessibleContext () const override
void SetPlatform (WsfPlatform *aPlatformPtr) override
const WsfBehaviorTreeBehaviorTree () const
WsfAdvancedBehaviorTreeAdvancedBehaviorTree () const
virtual const WsfScriptStateMachineGetStateMachine () const
wsf::ExternalLinksGetExternalLinks ()
std::string State ()
std::string StateAll ()
void SetState (std::string &stateName)
void SetStateAll (std::string &stateNameAll)
Public Member Functions inherited from WsfProcessor
 WsfProcessor (const WsfScenario &aScenario)
 ~WsfProcessor () override=default
ComponentListGetComponents ()
const ComponentListGetComponents () const
virtual void ProcessCallback (double aSimTime, const WsfCallback &aCallback)
WsfComponentCloneComponent () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override
int GetComponentInitializationOrder () const override
const char * GetScriptClassName () const override
bool PreInitialize (double aSimTime) override
void PreInput () override
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
double GetUpdateInterval () const override
void SetUpdateInterval (double aUpdateInterval) override
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.
virtual void Restore (double aSimTime)
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 ReceiveMessage (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

Protected Member Functions

 WsfScriptProcessor (const WsfScriptProcessor &aSrc)
 WsfProcessor (const WsfProcessor &aSrc)
 Copy constructor (for Clone()).
WsfProcessoroperator= (const WsfProcessor &aRhs)=delete
 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)

Protected Attributes

WsfScriptContextmContextPtr
 Pointer to the script context.
WsfScriptMessageHandlermMessageHandlerPtr
 Pointer to the 'on_message' handler.
UtScript * mOnMessageCreateScriptPtr
 Pointer to the 'on_message_create' script.
UtScriptClass * mMessageClassPtr
wsf::ExternalLinks mExternalLinks
 The external recipients.
WsfBehaviorTreemBehaviorTreePtr
ut::CloneablePtr< WsfAdvancedBehaviorTreemAdvancedBehaviorTreePtr
std::unique_ptr< WsfScriptStateMachinemStateMachinePtr
int mStateIndex
bool mSuppressMessage

Additional Inherited Members

using ComponentList = WsfComponentListT<WsfProcessorComponent>
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 inherited from WsfAuxDataEnabled
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataAccessed
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataDestroyed

Detailed Description

WsfScriptProcessor provides a means to execute scripts on simulation updates and message processing. From within an input file the user can specify an "on_update" script (i.e. script void on_update() ... end_script). During runtime, each call to Update will subsequently call the "on update" script. The same holds true for the processing of messages, a user can specify a custom script named "on_message" and it will be called during runtime each time ProcessInput is called. In addition, the following variables will be available to the scripts:

PLATFORM  A reference to the platform that owns the script processor.
PROCESSOR A reference to script processor.
TIME_NOW  The current simulation time in seconds.
MESSAGE   A reference to the message currently being processed (applicable to on_message). 

Constructor & Destructor Documentation

◆ WsfScriptProcessor() [1/3]

WsfScriptProcessor::WsfScriptProcessor ( const WsfScenario & aScenario)

References GetScriptContext(), mAdvancedBehaviorTreePtr, mBehaviorTreePtr, mContextPtr, mExternalLinks, mMessageClassPtr, mMessageHandlerPtr, mOnMessageCreateScriptPtr, mStateIndex, mSuppressMessage, and WsfProcessor::WsfProcessor().

Referenced by Clone(), WsfAssetManager::WsfAssetManager(), WsfAssetManager::WsfAssetManager(), WsfAssetManager::WsfAssetManager(), WsfBattleManager::WsfBattleManager(), WsfBattleManager::WsfBattleManager(), WsfBMDisseminateC2::WsfBMDisseminateC2(), WsfBMDisseminateC2::WsfBMDisseminateC2(), WsfBMSensorsManager::WsfBMSensorsManager(), WsfBMSensorsManager::WsfBMSensorsManager(), WsfBMWeaponsManager::WsfBMWeaponsManager(), WsfBMWeaponsManager::WsfBMWeaponsManager(), WsfExchangeProcessor::WsfExchangeProcessor(), WsfExchangeProcessor::WsfExchangeProcessor(), WsfFusionCenter::WsfFusionCenter(), WsfFusionCenter::WsfFusionCenter(), WsfGuidanceComputer::WsfGuidanceComputer(), WsfGuidanceComputer::WsfGuidanceComputer(), WsfMessageProcessor::WsfMessageProcessor(), WsfMessageProcessor::WsfMessageProcessor(), WsfOrbitalConjunctionProcessor::WsfOrbitalConjunctionProcessor(), WsfOrbitalConjunctionProcessor::WsfOrbitalConjunctionProcessor(), WsfOrbitalConjunctionProcessor::WsfOrbitalConjunctionProcessor(), WsfPerceptionProcessor::WsfPerceptionProcessor(), WsfPerceptionProcessor::WsfPerceptionProcessor(), WsfRIPRProcessor::WsfRIPRProcessor(), WsfRIPRProcessor::WsfRIPRProcessor(), WsfRIPRProcessor::WsfRIPRProcessor(), WsfRIPRProcessor::WsfRIPRProcessor(), WsfSA_Processor::WsfSA_Processor(), WsfSA_Processor::WsfSA_Processor(), WsfScriptProcessor(), WsfScriptStateMachineProcessor::WsfScriptStateMachineProcessor(), WsfScriptStateMachineProcessor::WsfScriptStateMachineProcessor(), WsfTaskManager::WsfTaskManager(), WsfTaskManager::WsfTaskManager(), WsfThreatProcessor::WsfThreatProcessor(), WsfThreatProcessor::WsfThreatProcessor(), WsfThreatProcessor::WsfThreatProcessor(), WsfTrackProcessor::WsfTrackProcessor(), WsfTrackProcessor::WsfTrackProcessor(), WsfTrackStateControllerProcessor::WsfTrackStateControllerProcessor(), WsfTrackStateControllerProcessor::WsfTrackStateControllerProcessor(), WsfUplinkProcessor::WsfUplinkProcessor(), WsfUplinkProcessor::WsfUplinkProcessor(), WsfWeaponFuse::WsfWeaponFuse(), WsfWeaponFuse::WsfWeaponFuse(), WsfWeaponThreatProcessor::WsfWeaponThreatProcessor(), and WsfWeaponThreatProcessor::WsfWeaponThreatProcessor().

◆ WsfScriptProcessor() [2/3]

WsfScriptProcessor::WsfScriptProcessor ( const WsfScenario & aScenario,
WsfStringId aPartClass,
const std::string & aPartVarName )

◆ ~WsfScriptProcessor()

WsfScriptProcessor::~WsfScriptProcessor ( )
override

◆ WsfScriptProcessor() [3/3]

Member Function Documentation

◆ AdvancedBehaviorTree()

◆ BehaviorTree()

◆ Clone()

◆ ExecuteOnMessageCreate()

void WsfScriptProcessor::ExecuteOnMessageCreate ( double aSimTime,
WsfMessage & aMessage )
virtual

Let the user examine/modify the outbound message prior to it being sent. This is primarily to let them set the message priority.

Parameters
aSimTimeThe current simulation time.
aMessageThe message to be transmitted.
Note
Derived classes are responsible for invoking this at the point where they create the message for which

References mContextPtr, mMessageClassPtr, and mOnMessageCreateScriptPtr.

Referenced by WsfTrackProcessor::SendTrackP().

◆ ExecuteScript() [1/2]

bool WsfScriptProcessor::ExecuteScript ( double aSimTime,
const std::string & aScriptName )
virtual

◆ ExecuteScript() [2/2]

bool WsfScriptProcessor::ExecuteScript ( double aSimTime,
WsfStringId aScriptName,
UtScriptData & aScriptRetVal,
const UtScriptDataList & aScriptArgs = UtScriptDataList() )
virtual

References mContextPtr.

◆ ExecuteScriptAtTime()

void WsfScriptProcessor::ExecuteScriptAtTime ( double aTime,
WsfStringId aScriptName,
const UtScriptDataList & aScriptArgs )

Execute the script with the specified string name ID at the specified time.

Parameters
aTimeThe time at which to execute the script.
aScriptNameThe string name ID of the script to be executed.
aScriptArgsThe list of arguments to pass to the script.

References WsfSimulation::AddEvent(), and WsfPlatformPart::GetSimulation().

◆ GetExternalLinks()

wsf::ExternalLinks & WsfScriptProcessor::GetExternalLinks ( )
inline

References mExternalLinks.

◆ GetMessageHandler()

WsfScriptMessageHandler * WsfScriptProcessor::GetMessageHandler ( )
inline

◆ GetScriptAccessibleContext()

UtScriptContext * WsfScriptProcessor::GetScriptAccessibleContext ( ) const
override

References mContextPtr.

◆ GetScriptContext()

◆ GetStateMachine()

virtual const WsfScriptStateMachine * WsfScriptProcessor::GetStateMachine ( ) const
inlinevirtual

Reimplemented in WsfScriptStateMachineProcessor.

References mStateMachinePtr.

◆ Initialize()

bool WsfScriptProcessor::Initialize ( double aSimTime)
overridevirtual

Perform phase 1 initialization of the part. This is invoked by WsfPlatform::Initialize() during phase 1 initialization of the platform. During phase 1 initialization, platform components must not assume the existence of ANY data that is the responsibility of another platform component. In particular, the platform location and initial tracks cannot be assumed to be valid.

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

Reimplemented from WsfProcessor.

Reimplemented in WsfScriptStateMachineProcessor, WsfSensorsManagerFov, WsfSimpleSensorsManager, WsfTaskManager, WsfTaskProcessor, WsfThreatProcessor, WsfTrackProcessor, WsfTrackStateControllerProcessor, WsfUplinkProcessor, WsfWeaponFuse, WsfWeaponsManagerAI, WsfWeaponsManagerSAM, and WsfWeaponThreatProcessor.

References WsfPlatformPart::GetPlatform(), WsfProcessor::Initialize(), mAdvancedBehaviorTreePtr, mBehaviorTreePtr, mContextPtr, mExternalLinks, mMessageHandlerPtr, mOnMessageCreateScriptPtr, mStateIndex, mStateMachinePtr, and ok.

Referenced by wsf::six_dof::GuidanceComputer::Initialize(), WsfAssetManager::Initialize(), WsfBattleManager::Initialize(), WsfBMDisseminateC2::Initialize(), WsfBMSensorsManager::Initialize(), WsfBMWeaponsManager::Initialize(), WsfExchangeProcessor::Initialize(), WsfFusionCenter::Initialize(), WsfGuidanceComputer::Initialize(), WsfMessageProcessor::Initialize(), WsfOrbitalConjunctionProcessor::Initialize(), WsfP6DOF_GuidanceComputer::Initialize(), WsfPerceptionProcessor::Initialize(), WsfRIPRProcessor::Initialize(), WsfSA_Processor::Initialize(), WsfScriptStateMachineProcessor::Initialize(), WsfTaskManager::Initialize(), WsfThreatProcessor::Initialize(), WsfTrackProcessor::Initialize(), WsfTrackStateControllerProcessor::Initialize(), WsfUplinkProcessor::Initialize(), WsfWeaponFuse::Initialize(), and WsfWeaponThreatProcessor::Initialize().

◆ Initialize2()

bool WsfScriptProcessor::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 WsfProcessor.

Reimplemented in WsfSensorsManagerFov, WsfSimpleSensorsManager, WsfTaskManager, WsfTaskProcessor, WsfWeaponFuse, WsfWeaponsManagerAI, and WsfWeaponsManagerSAM.

References WsfProcessor::Initialize2(), mContextPtr, and ok.

Referenced by WsfAssetManager::Initialize2(), WsfBattleManager::Initialize2(), WsfBMDisseminateC2::Initialize2(), WsfBMSensorsManager::Initialize2(), WsfBMWeaponsManager::Initialize2(), WsfGuidanceComputer::Initialize2(), WsfRIPRProcessor::Initialize2(), WsfSA_Processor::Initialize2(), WsfTaskManager::Initialize2(), WsfWeaponFuse::Initialize2(), and WsfQuantumTaskerProcessor::operator=().

◆ ProcessInput()

bool WsfScriptProcessor::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 WsfProcessor.

Reimplemented in WsfScriptStateMachineProcessor, WsfSensorsManagerFov, WsfSimpleSensorsManager, WsfTaskManager, WsfTaskProcessor, WsfThreatProcessor, WsfTrackProcessor, WsfTrackStateControllerProcessor, WsfUnclassifiedAssetManager, WsfUnclassifiedBattleManager, WsfUnclassifiedDisseminateC2, WsfUplinkProcessor, WsfWeaponFuse, WsfWeaponsManagerAI, WsfWeaponsManagerSAM, and WsfWeaponThreatProcessor.

References EditBehavior(), WsfPlatformPart::GetScenario(), mAdvancedBehaviorTreePtr, mBehaviorTreePtr, mContextPtr, mExternalLinks, mMessageHandlerPtr, mStateMachinePtr, WsfProcessor::ProcessInput(), and WsfScriptStateMachine::State::ProcessInput().

Referenced by WsfAssetManager::ProcessInput(), WsfBattleManager::ProcessInput(), WsfBMDisseminateC2::ProcessInput(), WsfBMSensorsManager::ProcessInput(), WsfBMWeaponsManager::ProcessInput(), WsfExchangeProcessor::ProcessInput(), WsfFusionCenter::ProcessInput(), WsfGuidanceComputer::ProcessInput(), WsfMessageProcessor::ProcessInput(), WsfOrbitalConjunctionProcessor::ProcessInput(), WsfP6DOF_GuidanceComputer::ProcessInput(), WsfPerceptionProcessor::ProcessInput(), WsfRIPRProcessor::ProcessInput(), WsfSA_Processor::ProcessInput(), WsfScriptStateMachineProcessor::ProcessInput(), WsfTaskManager::ProcessInput(), WsfThreatProcessor::ProcessInput(), WsfTrackProcessor::ProcessInput(), WsfTrackStateControllerProcessor::ProcessInput(), WsfUplinkProcessor::ProcessInput(), WsfWeaponFuse::ProcessInput(), and WsfWeaponThreatProcessor::ProcessInput().

◆ ProcessMessage()

bool WsfScriptProcessor::ProcessMessage ( double aSimTime,
const WsfMessage & aMessage )
overridevirtual

Process a received message.

Parameters
aSimTimeThe current simulation time.
aMessageThe message that is being sent.
Returns
'true' if the message was processed or 'false' if not.
Note
A message is first received by ReceiveMessage which then calls ProcessMessage to process the message. A derived class ReceiveMessage method may choose to delay the message before calling ProcessMessage or may choose to ignore the message altogether.

Reimplemented from WsfPlatformPart.

Reimplemented in WsfScriptStateMachineProcessor, WsfTaskManager, WsfTaskProcessor, WsfTrackProcessor, WsfTrackStateControllerProcessor, WsfUplinkProcessor, and WsfWeaponThreatProcessor.

References mAdvancedBehaviorTreePtr, mBehaviorTreePtr, mMessageHandlerPtr, mSuppressMessage, WsfAdvancedBehaviorTreeNode::ProcessMessage(), WsfBehaviorTreeNode::ProcessMessage(), and SendMessage().

Referenced by WsfAssetManager::ProcessMessage(), WsfBattleManager::ProcessMessage(), WsfBMDisseminateC2::ProcessMessage(), WsfBMSensorsManager::ProcessMessage(), WsfBMWeaponsManager::ProcessMessage(), WsfQuantumTaskerProcessor::ProcessMessage(), WsfRIPRProcessor::ProcessMessage(), and WsfTrackStateControllerProcessor::ProcessMessage().

◆ SendMessage()

void WsfScriptProcessor::SendMessage ( double aSimTime,
const WsfMessage & aMessage )
overridevirtual

A convenience for derived classes to send a message to linked objects.

Parameters
aSimTimeThe current simulation time.
aMessageThe message to be sent.

Reimplemented from WsfPlatformPart.

References mExternalLinks, and WsfPlatformPart::SendMessage().

Referenced by ProcessMessage(), and WsfMessageProcessor::SendMessage().

◆ SetPlatform()

void WsfScriptProcessor::SetPlatform ( WsfPlatform * aPlatformPtr)
overridevirtual

Set the platform to which this part is associated.

Parameters
aPlatformPtrPointer to the containing platform.
Note
A part can be associated with only one platform. It is an error to associate a part with more than one platform!

Reimplemented from WsfPlatformPart.

References WsfPlatform::GetScriptContext(), mContextPtr, and WsfPlatformPart::SetPlatform().

◆ SetState()

void WsfScriptProcessor::SetState ( std::string & stateName)

References mStateIndex, and mStateMachinePtr.

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ SetStateAll()

◆ State()

std::string WsfScriptProcessor::State ( )

References mStateIndex, and mStateMachinePtr.

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ StateAll()

◆ SuppressMessage()

void WsfScriptProcessor::SuppressMessage ( bool aSuppressMessage)
virtual

Indicate if forwarding of the current message to linked recipients should be suppressed.

This is invoked from scripts in the user message handler to declare if the message being processed should be prevented from the normal forwarding to linked recipients. When each message is received the suppression flag is set to false. The script message handler can then call SupressMessage() to suppress the eventual forwarding of the message. being processed should be forwarded to linked recipients. When each message is received, the flag is cleared that

Parameters
aSuppressMessageIf true, suppress the forwarding of the message to linked recipients.

References mSuppressMessage.

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ Update()

Member Data Documentation

◆ mAdvancedBehaviorTreePtr

◆ mBehaviorTreePtr

◆ mContextPtr

WsfScriptContext* WsfScriptProcessor::mContextPtr
protected

Pointer to the script context.

Referenced by WsfQuantumTaskerProcessor::AssigneesForTask(), WsfTaskManager::CancelTask(), WsfGuidanceComputer::CheckForPhaseChange(), WsfP6DOF_GuidanceComputer::CheckForPhaseChange(), WsfThreatProcessor::DroppedThreat(), WsfExchangeProcessor::ExchangeCompleted(), WsfExchangeProcessor::ExchangeRequestFailed(), ExecuteOnMessageCreate(), ExecuteScript(), ExecuteScript(), GetScriptAccessibleContext(), GetScriptContext(), WsfThreatProcessor::IdentifiedNewThreat(), WsfExchangeProcessor::Initialize(), WsfGuidanceComputer::Initialize(), WsfImageProcessor::Initialize(), WsfMessageProcessor::Action::Initialize(), WsfMessageProcessor::Initialize(), WsfMessageProcessor::Selector::Initialize(), WsfOrbitalConjunctionProcessor::Initialize(), WsfRIPRProcessor::Initialize(), Initialize(), WsfThreatProcessor::Initialize(), WsfTrackStateControllerProcessor::Initialize(), Initialize2(), WsfTaskManager::Initialize2(), WsfTrackProcessor::InitializeMemberData(), WsfTrackProcessor::IsTrackReportable(), WsfMessageProcessor::Selector::Matches(), WsfTaskManager::OperatingLevelChanged(), WsfWeaponFuse::PrivateDetonate(), WsfMessageProcessor::ProcessAction(), WsfGuidanceComputer::ProcessInput(), WsfMessageProcessor::Action::ProcessInput(), WsfMessageProcessor::Selector::ProcessInput(), WsfOrbitalConjunctionProcessor::ProcessInput(), WsfP6DOF_GuidanceComputer::ProcessInput(), WsfQuantumTaskerProcessor::ProcessInput(), WsfRIPRProcessor::ProcessInput(), ProcessInput(), WsfThreatProcessor::ProcessInput(), WsfRIPRProcessor::QueryBid(), WsfTaskManager::ReportTaskComplete(), wsf::six_dof::GuidanceComputer::SelectPhase(), WsfGuidanceComputer::SelectPhase(), WsfP6DOF_GuidanceComputer::SelectPhase(), SetPlatform(), WsfTaskManager::TaskAssigned(), WsfTaskManager::TaskAssignSent(), WsfTaskManager::TaskCanceled(), WsfTaskManager::TaskCompleted(), WsfOrbitalConjunctionProcessor::Update(), WsfSA_Processor::Update(), Update(), WsfSA_Processor::UpdateBehaviorCalculation(), wsf::six_dof::GuidanceComputer::UpdateGuidance(), WsfGuidanceComputer::UpdateGuidance(), WsfExchangeProcessor::WsfExchangeProcessor(), WsfExchangeProcessor::WsfExchangeProcessor(), WsfOrbitalConjunctionProcessor::WsfOrbitalConjunctionProcessor(), WsfRIPRProcessor::WsfRIPRProcessor(), WsfRIPRProcessor::WsfRIPRProcessor(), WsfRIPRProcessor::WsfRIPRProcessor(), WsfRIPRProcessor::WsfRIPRProcessor(), WsfScriptProcessor(), WsfScriptProcessor(), WsfScriptProcessor(), WsfScriptStateMachineProcessor::WsfScriptStateMachineProcessor(), WsfScriptStateMachineProcessor::WsfScriptStateMachineProcessor(), WsfTaskManager::WsfTaskManager(), WsfTaskProcessor::WsfTaskProcessor(), WsfTaskProcessor::WsfTaskProcessor(), WsfThreatProcessor::WsfThreatProcessor(), WsfTrackStateControllerProcessor::WsfTrackStateControllerProcessor(), WsfTrackStateControllerProcessor::WsfTrackStateControllerProcessor(), and ~WsfScriptProcessor().

◆ mExternalLinks

◆ mMessageClassPtr

UtScriptClass* WsfScriptProcessor::mMessageClassPtr
protected

◆ mMessageHandlerPtr

◆ mOnMessageCreateScriptPtr

UtScript* WsfScriptProcessor::mOnMessageCreateScriptPtr
protected

Pointer to the 'on_message_create' script.

Referenced by ExecuteOnMessageCreate(), Initialize(), WsfScriptProcessor(), WsfScriptProcessor(), and WsfScriptProcessor().

◆ mStateIndex

◆ mStateMachinePtr

◆ mSuppressMessage

bool WsfScriptProcessor::mSuppressMessage
protected

'true' if the current message should be suppressed. This is set to 'false' before invoking the message handler for a received message. The user can invoke the script method 'SuppressMessage' to indicate that it will not be sent to the internal/external links.

Referenced by WsfImageProcessor::ProcessMessage(), WsfMessageProcessor::ProcessMessage(), ProcessMessage(), SuppressMessage(), WsfScriptProcessor(), WsfScriptProcessor(), and WsfScriptProcessor().


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