WSF
WsfOrbitalScriptEvent Class Reference

An orbital event that allows scripted behavior. More...

#include <WsfOrbitalScriptEvent.hpp>

Inheritance diagram for WsfOrbitalScriptEvent:
Collaboration diagram for WsfOrbitalScriptEvent:

Public Member Functions

 WsfOrbitalScriptEvent (const WsfScenario &aScenario)
 WsfOrbitalScriptEvent (const WsfOrbitalScriptEvent &aSrc)
WsfOrbitalScriptEventoperator= (const WsfOrbitalScriptEvent &)=delete
 ~WsfOrbitalScriptEvent () override
bool ProcessInput (UtInput &aInput) override
bool Initialize (const UtCalendar &aEpoch, const wsf::space::OrbitalMissionContext &aContext) override
WsfOrbitalEventClone () const override
 Make a copy of this object.
const char * GetScriptClassName () const override
bool GetNextExecutionTime (const UtCalendar &aCurrentTime, const UtOrbitalPropagatorBase &aPropagator, UtCalendar &aNextTime) override
const std::string & GetOnInitializeInput () const
const std::string & GetOnUpdateInput () const
const std::string & GetOnCompleteInput () const
const std::string & GetIsCompleteInput () const
void SetOnInitializeInput (const std::string &aInput)
void SetOnUpdateInput (const std::string &aInput)
void SetOnCompleteInput (const std::string &aInput)
void SetIsCompleteInput (const std::string &aInput)
void Accept (WsfOrbitalEventVisitor *aVisitorPtr) override
Public Member Functions inherited from WsfOrbitalEvent
 WsfOrbitalEvent (const WsfOrbitalEvent &aSrc)
WsfOrbitalEventoperator= (const WsfOrbitalEvent &)=delete
 ~WsfOrbitalEvent () override=default
bool CanVerify () const
 Return whether this event can be verified.
virtual bool VerifyCondition () const
virtual bool EvaluatePreconditions (const wsf::space::OrbitalMissionContext &aContext) const
virtual bool EvaluatePostconditions (const wsf::space::OrbitalMissionContext &aContext) const
virtual bool ValidateParameterRanges (const std::string &aExecutingPlatformName) const
bool IsComplete () const
 Return whether the event is complete.
bool IsCanceled () const
 Return whether the event is canceled.
void SetCanceled ()
 Mark the event as canceled.
bool Execute (const UtCalendar &aEpoch, wsf::space::OrbitalMissionContext &aContext)
const char * GetScriptClassName () const override
bool IsFinite () const
void SetFinite (bool aIsFinite)
 Set whether the event is finite.
bool HasExecuted () const
 Return whether the event has executed at least once (i.e., Execute() has been called).
const wsf::space::OrbitalPropagatorConditionGetCondition () const
 Return the condition for event execution (const).
wsf::space::OrbitalPropagatorConditionGetCondition ()
 Return the condition for event execution (non-const).
WsfStringId GetConditionString () const
 Return the condition string for event execution.
void SetCondition (std::unique_ptr< wsf::space::OrbitalPropagatorCondition > aConditionPtr)
 Set the condition for execution.
const UtCalendar & GetStartTime () const
 Return the time at which the event will begin executing.
void SetStartTime (const UtCalendar &aStartTime)
 Set the start time to begin event execution.
const UtCalendar & GetEvaluationTime () const
 Return the nominal time to execute the event impulsively.
UtTimeValue GetDuration () const
 Return the full duration of the event. If the event is impulsive, this method returns 0.
void SetDuration (const UtTimeValue &aDuration)
 Set the full duration of the event. A value of 0 implies and impulsive event; otherwise it is finite.
void SetOnlyDuration (const UtTimeValue &aDuration)
UtTimeValue GetUpdateInterval () const
 For finite events, return the interval at which the event is to be re-evaluated.
void SetUpdateInterval (const UtTimeValue &aUpdateInterval)
 Set the update interval for which the event is to be re-evaluated.
virtual const WsfOrbitalEventGetCurrentMissionEvent () const
virtual WsfOrbitalEventGetCurrentMissionEvent ()
virtual WsfOrbitalEventAdvanceMissionEvent (const UtCalendar &aEpoch, const wsf::space::OrbitalMissionContext &aContext)
virtual bool IsSequence () const
 Is this MissionEvent a MissionEvent sequence (WsfMissionEventSequence)?
virtual double GetRequiredDeltaV (const UtOrbitalPropagatorBase &aPropagator) const
 Return the minimum required delta-v needed to complete this event; the default is to return 0.0.
virtual double GetDeltaV () const
 Get the delta V expended to execute this event; the default is to return 0.0.
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 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)

Static Public Member Functions

static WsfStringId GetTypeId ()
Static Public Member Functions inherited from WsfOrbitalEvent
static WsfOrbitalEventCreate (const WsfScenario &aScenario, UtInput &aInput, bool aIgnoreSomeExceptions=false)

Protected Member Functions

bool ExecuteEvent (const UtCalendar &aEpoch, wsf::space::OrbitalMissionContext &aContext) override
bool EvaluateCompletion (const UtCalendar &aEpoch, const UtOrbitalPropagatorBase &aPropagator) override
Protected Member Functions inherited from WsfOrbitalEvent
 WsfOrbitalEvent (const WsfScenario &aScenario)
virtual bool InitializeVariables (const UtCalendar &aCurrentTime, const UtCalendar &aEvaluationTime, const wsf::space::OrbitalMissionContext &aContext)
virtual bool InitializeTimes (const UtCalendar &aEpoch, const wsf::space::OrbitalMissionContext &aContext)
Protected Member Functions inherited from WsfUniqueId
void AssignUniqueId (WsfSimulation *aSimulationPtr)
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Additional Inherited Members

Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
Static Protected Member Functions inherited from WsfOrbitalEvent
static WsfOrbitalEventCreate (const WsfScenario &aScenario, WsfStringId aType)
Protected Attributes inherited from WsfOrbitalEvent
ut::CloneablePtr< wsf::space::OrbitalPropagatorConditionmCondition {}
bool mIsFinite
bool mHasExecuted
bool mIsComplete
bool mIsCanceled
bool mDebug
bool mCanVerify
UtCalendar mStartTime
 Can this event be verified without running in a simulation?
UtCalendar mEvaluationTime
UtTimeValue mDuration
UtTimeValue mUpdateInterval
const WsfScenariomScenario

Detailed Description

An orbital event that allows scripted behavior.

Constructor & Destructor Documentation

◆ WsfOrbitalScriptEvent() [1/2]

WsfOrbitalScriptEvent::WsfOrbitalScriptEvent ( const WsfScenario & aScenario)
explicit

◆ WsfOrbitalScriptEvent() [2/2]

WsfOrbitalScriptEvent::WsfOrbitalScriptEvent ( const WsfOrbitalScriptEvent & aSrc)

◆ ~WsfOrbitalScriptEvent()

WsfOrbitalScriptEvent::~WsfOrbitalScriptEvent ( )
override

Member Function Documentation

◆ Accept()

void WsfOrbitalScriptEvent::Accept ( WsfOrbitalEventVisitor * aVisitorPtr)
overridevirtual

◆ Clone()

WsfOrbitalEvent * WsfOrbitalScriptEvent::Clone ( ) const
overridevirtual

Make a copy of this object.

Implements WsfOrbitalEvent.

References WsfOrbitalEvent::WsfOrbitalEvent(), and WsfOrbitalScriptEvent().

◆ EvaluateCompletion()

bool WsfOrbitalScriptEvent::EvaluateCompletion ( const UtCalendar & aEpoch,
const UtOrbitalPropagatorBase & aPropagator )
overrideprotectedvirtual

Evaluate whether an event is marked as complete. If it is complete, mIsComplete is true in Execute(), and the event sequence will progress to the next event.

Note
This is a template method called within Execute(...).

Reimplemented from WsfOrbitalEvent.

References WsfOrbitalEvent::EvaluateCompletion(), WsfObject::GetName(), and WsfScriptContext::GetPLATFORM().

◆ ExecuteEvent()

bool WsfOrbitalScriptEvent::ExecuteEvent ( const UtCalendar & aCurrentTime,
wsf::space::OrbitalMissionContext & aContext )
overrideprotectedvirtual

Perform any necessary event processing. For example, in the case of orbital maneuvers, the actual Maneuver(...) method is called and delta-V computations are performed.

Parameters
aCurrentTimeThe current time to be used in the event execution.
aContextThe orbital mission context in which this event is executing.
Note
This is a template method called from within Execute(...).

Implements WsfOrbitalEvent.

References WsfSimulation::GetDateTime(), WsfPlatformPart::GetPlatform(), wsf::space::OrbitalMissionContext::GetSimulation(), wsf::space::OrbitalMissionContext::GetSpaceMover(), WsfDateTime::GetStartDateAndTime(), simTime, and WsfPlatform::Update().

◆ GetIsCompleteInput()

const std::string & WsfOrbitalScriptEvent::GetIsCompleteInput ( ) const
inline

◆ GetNextExecutionTime()

bool WsfOrbitalScriptEvent::GetNextExecutionTime ( const UtCalendar & aCurrentTime,
const UtOrbitalPropagatorBase & aPropagator,
UtCalendar & aNextTime )
overridevirtual

If the orbital constraint was at a point in the orbit for an impulsive event (duration == 0.0), return a time at the same point in the next orbit. Otherwise perform default scheduling.

Reimplemented from WsfOrbitalEvent.

References wsf::space::NoneCondition::cTYPE, wsf::space::RelativeTimeCondition::cTYPE, WsfOrbitalEvent::GetCondition(), WsfOrbitalEvent::GetNextExecutionTime(), wsf::space::OrbitalPropagatorCondition::GetTimeToCondition(), WsfObject::GetType(), WsfOrbitalEvent::IsFinite(), and wsf::space::OrbitalPropagatorCondition::SetOrbitNumber().

◆ GetOnCompleteInput()

const std::string & WsfOrbitalScriptEvent::GetOnCompleteInput ( ) const
inline

◆ GetOnInitializeInput()

const std::string & WsfOrbitalScriptEvent::GetOnInitializeInput ( ) const
inline

◆ GetOnUpdateInput()

const std::string & WsfOrbitalScriptEvent::GetOnUpdateInput ( ) const
inline

◆ GetScriptClassName()

const char * WsfOrbitalScriptEvent::GetScriptClassName ( ) const
inlineoverride

◆ GetTypeId()

WsfStringId WsfOrbitalScriptEvent::GetTypeId ( )
static

◆ Initialize()

bool WsfOrbitalScriptEvent::Initialize ( const UtCalendar & aEpoch,
const wsf::space::OrbitalMissionContext & aContext )
overridevirtual

Initialize this MissionEvent in preparation to execute it.

Parameters
aEpochThe current epoch, to be used as the basis for evaluating the next mission event in the sequence.
aContextThe orbital mission context in which this event is executing.

Reimplemented from WsfOrbitalEvent.

References WsfSimulation::GetDateTime(), WsfSpaceMoverBase::GetScriptContext(), wsf::space::OrbitalMissionContext::GetSimulation(), wsf::space::OrbitalMissionContext::GetSpaceMover(), WsfDateTime::GetStartDateAndTime(), WsfOrbitalEvent::Initialize(), and ok.

◆ operator=()

WsfOrbitalScriptEvent & WsfOrbitalScriptEvent::operator= ( const WsfOrbitalScriptEvent & )
delete

◆ ProcessInput()

bool WsfOrbitalScriptEvent::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 WsfOrbitalEvent.

References WsfOrbitalEvent::ProcessInput().

◆ SetIsCompleteInput()

void WsfOrbitalScriptEvent::SetIsCompleteInput ( const std::string & aInput)
inline

Set the complete input string representing the name of a context-accessible script.

Note
This method is primarily used in the corresponding script class.

◆ SetOnCompleteInput()

void WsfOrbitalScriptEvent::SetOnCompleteInput ( const std::string & aInput)
inline

Set the complete input string representing the name of a context-accessible script.

Note
This method is primarily used in the corresponding script class.

◆ SetOnInitializeInput()

void WsfOrbitalScriptEvent::SetOnInitializeInput ( const std::string & aInput)
inline

Set the initial input string representing the name of a context-accessible script.

Note
This method is primarily used in the corresponding script class.

◆ SetOnUpdateInput()

void WsfOrbitalScriptEvent::SetOnUpdateInput ( const std::string & aInput)
inline

Set the update input string representing the name of a context-accessible script.

Note
This method is primarily used in the corresponding script class.

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