Class AbstractApp0<SimType, TimeGraphType>Abstract

Abstract base class that creates the standard set of views, graphs and controls which are common to applications that run an ODESim.

Defines regular expressions for easy Terminal scripting using short names instead of fully qualified property names.

The constructor takes an argument that specifies the names of the HTML elementIds to look for in the HTML document; these elements are where the user interface of the simulation is created. This allows for having two separate simulation apps running concurrently on a single page because each app can have different ids for its HTML elements.

No global variables are created other than two root global variables: the myphysicslab global holds all of the myPhysicsLab classes; and a global variable is created for this application instance. This application global is created outside of this file in the HTML where the constructor is called. The name of that global variable holding the application is passed to defineNames() method so that short-names in scripts can be properly expanded.

Type Parameters

Hierarchy (view full)




  • Adds the standard set of simulation controls: show energy, show clock, pan-zoom of simView, time step, time rate, diff eq solver, background menu

    Returns void

  • Define short-cut name replacement rules. For example sim is replaced by app.sim when myName is app.


    • myName: string

      the name of this object, valid in global Javascript context.

    Returns void

  • Parameters

    • script: string
    • output: boolean = true

      whether to print the result to the output text area and add the script to session history; default is true

    Returns any

    the result of evaluating the string

  • Creates the EasyScriptParser for this app. See explanation of dependent Subjects in EasyScriptParser documentation.


    • Optional opt_dependent: Subject[]

      additional dependent Subjects

    Returns void

  • Sets whether this Subject will broadcast events, typically used to temporarily disable broadcasting. Intended to be used in situations where a subclass overrides a method that broadcasts an event. This allows the subclass to prevent the superclass broadcasting that event, so that the subclass can broadcast the event when the method is completed.


    • value: boolean

      whether this Subject should broadcast events

    Returns boolean

    the previous value

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:


    Returns string

    a minimal string representation of this object.

  • Force classes to be bundled (by esbuild), so they can be used in Terminal scripts.

    Returns void

Generated using TypeDoc