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

From Serious Documentation
Jump to: navigation, search
(Created page with "=== Node: {{Node|timer}} === {| class="wikitable" style="margin: 1em auto 1em auto;" ! scope="col" | Property ! scope="col" | Data Type ! scope="col" | Description |- |<onlyi...")
 
(Node: {{Node|timer}})
Line 7: Line 7:
 
|<onlyinclude>{{Prop|timer|enabled}}||{{DataType|Boolean}}|| If {{Reserved|true}} (default if unset) this {{Node|timer}} is enabled.</onlyinclude>
 
|<onlyinclude>{{Prop|timer|enabled}}||{{DataType|Boolean}}|| If {{Reserved|true}} (default if unset) this {{Node|timer}} is enabled.</onlyinclude>
 
|}
 
|}
 +
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}}.
  
When {{Node|timer}}.{{Prop|timer|enabled}} is set to {{Reserved|true}} and the {{Node|timer}}.{{Prop|timer|value}} property is non-zero, 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}} on various conditions, 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.
  
On a {{Prop|timer|value}} transition from <code>1</code> to <code>0</code>, the {{Prop|timer|alarm}} property is set to {{Reserved|true}} and at that point the {{Node|timer}}.{{Prop|timer|enabled}} property will be set by the {{Node|timer}} to {{Reserved|false}} and the {{Node|timer}} will stop if ''either'' of the following two conditions are true:
+
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 {{Prop|timer|autoreload}} is set to {{Reserved|false}}
 
#the {{Prop|timer|autoreload}} is set to {{Reserved|true} but the reload {{Prop|timer|period}} is set to <code>0</code>
 
  
Otherwise, the {{Node|timer}}'s {{Prop|timer|value}} will be automatically reloaded from the {{Prop|timer|period}}, the {{Prop|timer|enabled}} property will remain {{Reserved|true}}, and the {{Node|timer}} will re-start the count down.
+
When ({{Prop|timer|value}} == <code>0</code>), the {{Prop|timer|enabled}} property may be self-set to {{Reserved|false}} and the timer halted if '''any''' of the following conditions are true:
 +
*the {{Prop|timer|oneshot}} property is {{Reserved|true}}, or,
 +
*the {{Prop|timer|autoreload}} property is {{Reserved|false}}, or,
 +
*the {{Prop|timer|autoreload}} property is {{Reserved|true}} ''and'' the {{Prop|timer|period}} property value is <code>0</code>
 +
 
 +
Otherwise the {{Prop|timer|enabled}} property remains {{Reserved|true}}, the {{Node|timer}} reloads the count {{Prop|timer|value}} from the {{Prop|timer|period}}, and the {{Node|timer}}restarts counting down from the new reloaded {{Prop|timer|value}}.

Revision as of 06:54, 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.