Difference between revisions of "SHIP:Node:listener"

From Serious Documentation
Jump to: navigation, search
(Properties)
Line 1: Line 1:
 
[[SHIP:Node|Node Home]]
 
[[SHIP:Node|Node Home]]
 
__TOC__
 
__TOC__
<onlyinclude>A [[SHIP:Node:listener|listener]] nodes watch one or more properties (including variable values!) and, when an optional condition passes, invoke a script.</onlyinclude>
+
{| class="wikitable" style="margin: 1em auto 1em auto;"
 +
! scope="col" | Node Type
 +
! scope="col" | Description
 +
|-
 +
|<onlyinclude>{{Node|listener}}{{#if: {{{1|}}}|{{{1}}} }}||Monitors one or more properties (including variable values!) for changes, and on changes invokes a script.</onlyinclude>
 +
|}
 +
{{Node|listener}} nodes are the heart of the event system.  With the {{Prop|listener|listeningto}} property, a {{Node|listener}} can monitor one or more properties (including variable values) in SHIP.  When any of these properties change, the {{Node|listener}} is awoken.  It tests the (optional) {{Prop|listener|condition}}, and if the {{Prop|listener|condition}} passes (or does not exist) it then runs any enclosed {{Node|script}} nodes.
 +
 
 +
{{Node|listener}} nodes can exist only in the {{Node|layout}} area.
 +
 
 
== Parent Nodes ==
 
== Parent Nodes ==
 
The following nodes are permitted to hold this node:
 
The following nodes are permitted to hold this node:

Revision as of 12:47, 25 January 2013

Node Home

Node Type Description
listener Monitors one or more properties (including variable values!) for changes, and on changes invokes a script.

listener nodes are the heart of the event system. With the listeningto property, a listener can monitor one or more properties (including variable values) in SHIP. When any of these properties change, the listener is awoken. It tests the (optional) condition, and if the condition passes (or does not exist) it then runs any enclosed script nodes.

listener nodes can exist only in the layout area.

Parent Nodes

The following nodes are permitted to hold this node:

Child Nodes

The following nodes are permitted to exist within this node:

Properties

Property Name Data Type Description
SHIP:Property:listener:name
listeningto** Reference:property List Comma separated list of one or more node properties that, when changed, wake the listener
condition** NumRetExp (optional) If this expression evaluates to be non-zero or true the attached script is allowed to run.
SHIP:Property:listener:enabled

*available at SHIPEngine run time only and cannot be set in SHIPTide. Use a Sail script at shiplaunch time if this property needs to be set when the GUI starts to run.

**available only in SHIPTide; cannot be accessed from Sail scripts at run-time.

Examples