Difference between revisions of "SHIP:Property:timer:enabled"

From Serious Documentation
Jump to: navigation, search
(Special Note on {{Node|listener}}s and the {{Node|timer}} {{Prop|timer|enabled}} Property)
Line 26: Line 26:
 
Starting with SHIPEngine v4.0.122, {{Node|timer}} nodes' {{Prop|timer|enabled}} property does ''not'' block events from {{Node|listener}}s within them.  
 
Starting with SHIPEngine v4.0.122, {{Node|timer}} nodes' {{Prop|timer|enabled}} property does ''not'' block events from {{Node|listener}}s within them.  
  
This exception behavior is by design so that {{Prop|timer|alarm}}s, for example, can be listened for in a {{Node|listener}} held inside a {{Node|timer}} node.  Otherwise, when the {{Node|timer}} expired and the {{Prop|timer|enabled}} went {{Reserved|false}}, a contained {{Node|listener}} would immediately be disabled and the {{Node|timer}} {{Prop|timer|alarm}} would be unheard.
+
This exception is by design so that {{Prop|timer|alarm}}s, for example, can be listened for in a {{Node|listener}} held inside a {{Node|timer}} node.  Otherwise, when the {{Node|timer}} expired and the {{Prop|timer|enabled}} went {{Reserved|false}}, a contained {{Node|listener}} would immediately be disabled and the {{Node|timer}} {{Prop|timer|alarm}} would be unheard.

Revision as of 07:03, 29 November 2012

Node: timer

Property Data Type Description
enabled Boolean If true (default if unset) this timer is enabled.

The timer enabled property enables the timer to count down from its current value to zero. The timer is paused and does not count down when enabled is false.

The timer node can self-set the enabled property to false on various conditions, but can never self-set the property to true. The enabled property can only be set true in SHIPTide at GUI design time and in a Sail script at run-time.

If (value > 0) and enabled is set to true either in a Sail script at run-time or in SHIPTide then the timer begins to count down, with the value property decrementing at 0.1Hz.

When (value == 0), the enabled property may be self-set to false and the timer halted if any of the following conditions are true:

Otherwise the enabled property remains true, the timer reloads the count value from the period, and the timerrestarts counting down from the new reloaded value.

Special Note on listeners and the timer enabled Property

Normally, any false enabled property in any parent (or grandparent, or great-grandparent, etc.) of a listener node will disable that listener. For example, a listener in a box where the box's enabled property is false will prevent the listener from waking on events.

Starting with SHIPEngine v4.0.122, timer nodes' enabled property does not block events from listeners within them.

This exception is by design so that alarms, for example, can be listened for in a listener held inside a timer node. Otherwise, when the timer expired and the enabled went false, a contained listener would immediately be disabled and the timer alarm would be unheard.