Event Controls

Event-driven scripts

An event-driven script is a script called when an event occurs in the Filter or Simulator, or when the application's RunScript function is called. Such a script needs to contain a function which matches the name of the file, and the function takes as inputs a message string and the object calling the script (either a filter, simulator or application object). See the Python Guidance Help topic for prerequisite steps.

As an example, here is a Filter's OnComplete script which will write the message string to the message window:

Filename:
	FilterComplete.vbs
Contents:
	Function FilterComplete(msg, fil)
  	Dim App = fil.Parent.Parent.Application
  	App.WriteMessage msg, "debug"
	End Function

Event controls

Event controls give you the option of specifying event-driven script files which are called upon any or all of the following filter and/or simulator events:

  • OnInternalError -- applicable in case of an internal error while running the Filter or Simulator, such as satellite reentry (altitude too low to propagate)


  • OnStart (simulator only) -- to be run before the Simulator begins processing


  • OnResume (filter only) -- applicable if you interrupt and restart the Filter


  • OnComplete -- applicable at the conclusion of the filter or simulator run.


  • OnHalt -- applicable if you interrupt the Filter or Simulator run


  • OnNoMoreMeas (filter only) -- applicable when the Filter's stop time occurs after the last measurement and the StopMode is not set to LastMeasurement.