Window

Type: Window

Script class for Window utilities.

A global 'window' object is provided to access these functions and the 'workpage'.

var button = window.findViewByID("do_not_press"); var button2 = window.do_not_press; // shorthand 

var button = window.do_not_press; // shorthand

Properties

PropertyDescription
Since version 4.04.23, view IDs may be accessed directly instead of through findViewByID. Assignment to an unspecified ID shall set the script id of the view being assigned.

Methods

MethodDescription
addView(type [, options]) Create a new view of the given type, with the given options.

Returns a reference to the newly created view.

options is an object containing key/value pairs of view properties to set on creation.

  • title - Title to assign to the view.
  • object - Reference to an object to set on the view, e.g. a ecu.channel(..) or ecu.map(..) etc.
  • id - Script ID to assign to the view.
  • label - Label to display on e.g. button.
  • action - Action ID for button (optional).
  • wizard - If creating a Wizard, the wizard ID to create.
  • width, height - Size of the view in pixels. Or may be specified as a string with style units - e.g. "10em" or "50vw" or "50dp"

Type May be one of the following:

  • graph
  • grid
  • slice
  • wizard
  • channels
  • options
  • tacho
  • number
  • bar
  • audit
  • aspect_selector
  • pinout
  • scope
  • bitmap
  • button
  • sequencer
  • canrx
  • checkbox
  • radio
  • toggle
  • combobox
  • number_edit
  • dial
  • signal_generator
  • label
  • options
  • notes
  • media
  • group
  • wizardList
  • wizard
  • logmap_controller
  • sensor_calibration
  • unit_selector
  • unit_preference

Not all view types are available in all editions of the software.

Some view types may require additional parameters in the options object.

close() Close the tab
findViewByID(id) Searches child views for the first one with a script ID that matches 'id' (set via view properties). Returns a reference to the view, or 'null' if nothing found.
findViewByTitle(title) Searches child views for the first one with a title that matches 'title'. Returns a reference to the view, or 'null' if nothing found.
getParent() Get the parent window/view (if any) of this window.
setRefreshTimer(callback) Sets a callback function to be called periodically, dependent upon the user interface update rate setting in general preferences.

Typically around 25Hz.

To cancel the timer, call this function with a 'null' argument.

show() Show the tab