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

From Serious Documentation
Jump to: navigation, search
(Node: {{Node|timer}})
(Node: {{Node|timer}})
Line 9: Line 9:
 
The {{Node|timer}} {{Prop|timer|enabled}} property enables the {{Node|timer}} to count down from its current {{Prop|timer|value}} to zero.  The {{Node|timer}} is paused and does not count down when {{Prop|timer|enabled}} is {{Reserved|false}}. If ({{Prop|timer|value}} &gt; <code>0</code>) and {{Prop|timer|enabled}} is set to {{Reserved|true}} either in a [[SHIP:Sail|Sail]] script at run-time or in [[SHIPTide]] then the {{Node|timer}} begins to count down, with the {{Prop|timer|value}} property decrementing at 0.1Hz.
 
The {{Node|timer}} {{Prop|timer|enabled}} property enables the {{Node|timer}} to count down from its current {{Prop|timer|value}} to zero.  The {{Node|timer}} is paused and does not count down when {{Prop|timer|enabled}} is {{Reserved|false}}. If ({{Prop|timer|value}} &gt; <code>0</code>) and {{Prop|timer|enabled}} is set to {{Reserved|true}} either in a [[SHIP:Sail|Sail]] script at run-time or in [[SHIPTide]] then the {{Node|timer}} begins to count down, with the {{Prop|timer|value}} property decrementing at 0.1Hz.
  
The {{Node|timer}} node can self-set the {{Prop|timer|enabled}} property to {{Reserved|false}} but can never self-set the property to {{Reserved|true}}.  The {{Prop|timer|enabled}} property can only be set {{Reserved|true}} in [[SHIPTide]] at GUI design time and in a [[SHIP:Sail|Sail]] script at run-time.
+
The {{Node|timer}} node can self-set the {{Prop|timer|enabled}} property to {{Reserved|false}} but can never self-set the property to {{Reserved|true}}.  The {{Prop|timer|enabled}} property can only be set {{Reserved|true}} in [[SHIPTide]] at GUI design time and in a [[SHIP:Sail|Sail]] script at run-time. The {{Node|timer}} node will self-set the {{Prop|timer|enabled}} property to {{Reserved|false}} when '''all'' the following conditions are true:
 
 
The {{Node|timer}} node will self-set the {{Prop|timer|enabled}} property to {{Reserved|false}} when '''all'' the following conditions are true:
 
 
*the {{Prop|timer|oneshot}} property is {{Reserved|true}}, or,
 
*the {{Prop|timer|oneshot}} property is {{Reserved|true}}, or,
 
*the count {{Prop|timer|value}} transitions from <code>1</code> to <code>0</code>.
 
*the count {{Prop|timer|value}} transitions from <code>1</code> to <code>0</code>.

Revision as of 18:16, 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. 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.

The timer node can self-set the enabled property to false 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. The timer node will self-set the enabled property to false when 'all the following conditions are true:

Therefore, in free running mode (i.e. oneshot is false) the timer enabled property will never be self-set to false.

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.202, timer nodes' enabled property does not block events from listeners within them.

This exception is by design so that, for example, alarms 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.