1
0
Fork 0
fgdata/gui/dialogs/timeofday.xml

352 lines
9.4 KiB
XML
Raw Normal View History

2003-09-17 15:49:39 +00:00
<?xml version="1.0"?>
<PropertyList>
<name>timeofday</name>
<layout>vbox</layout>
<padding>20</padding>
<modal>false</modal>
2003-09-17 15:49:39 +00:00
<group>
<layout>hbox</layout>
<empty><stretch>1</stretch></empty>
<text>
<label>Time Settings</label>
</text>
<empty><stretch>1</stretch></empty>
<button>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<legend></legend>
<keynum>27</keynum>
<border>2</border>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
2003-09-17 15:49:39 +00:00
<hrule/>
2003-09-17 15:49:39 +00:00
<group>
<layout>hbox</layout>
2003-09-17 15:49:39 +00:00
<group>
<layout>vbox</layout>
2005-12-14 12:16:11 +00:00
<empty>
<stretch>true</stretch>
</empty>
<group>
<layout>hbox</layout>
<!-- Date setting. Use the split out properties in the dialog load, this way these will remain constant when the dialog
is opened. Set these automatically when changed - however there appears to be a timezone/dst issue that subtracts an hour.
-->
<group>
<layout>vbox</layout>
<text>
<label>Year</label>
</text>
<input>
<property>/sim/time/demand-year</property>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
setprop("/sim/time/gmt",getprop("/sim/time/demand-year")~"-"~getprop("/sim/time/demand-month")~"-"~getprop("/sim/time/demand-day")~"T "~substr(getprop("/sim/time/gmt"),11));
</script>
</binding>
</input>
</group>
<group>
<layout>vbox</layout>
<text>
<label>Month</label>
</text>
<input>
<property>/sim/time/demand-month</property>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
setprop("/sim/time/gmt",getprop("/sim/time/demand-year")~"-"~getprop("/sim/time/demand-month")~"-"~getprop("/sim/time/demand-day")~"T "~substr(getprop("/sim/time/gmt"),11));
</script>
</binding>
</input>
</group>
<group>
<layout>vbox</layout>
<text>
<label>Day</label>
</text>
<input>
<property>/sim/time/demand-day</property>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
setprop("/sim/time/gmt",getprop("/sim/time/demand-year")~"-"~getprop("/sim/time/demand-month")~"-"~getprop("/sim/time/demand-day")~"T "~substr(getprop("/sim/time/gmt"),11));
</script>
</binding>
</input>
</group>
</group>
<!-- end of date setting -->
<empty>
<stretch>true</stretch>
</empty>
<layout>vbox</layout>
<group>
<layout>table</layout>
<halign>center</halign>
2005-12-14 12:16:11 +00:00
<text>
<row>0</row>
<col>0</col>
<halign>left</halign>
<default-padding>0</default-padding>
<label>UTC</label>
</text>
<text>
<row>0</row>
<col>1</col>
<halign>left</halign>
<default-padding>0</default-padding>
<label>00:00:00</label>
<live>true</live>
<property>/sim/time/gmt-string</property>
</text>
2005-12-14 12:16:11 +00:00
<text>
<row>1</row>
<col>0</col>
<halign>left</halign>
<default-padding>0</default-padding>
<label>Local</label>
</text>
<text>
<row>1</row>
<col>1</col>
<halign>left</halign>
<default-padding>0</default-padding>
<label>00:00</label>
<live>true</live>
<property>/instrumentation/clock/local-short-string</property>
</text>
</group>
<hrule/>
<text>
<label>Simulation Rate</label>
</text>
<text>
<label></label>
<live>true</live>
<property>/sim/speed-up</property>
</text>
<group>
<layout>hbox</layout>
<default-padding>0</default-padding>
<button>
<legend>-</legend>
<binding>
<command>nasal</command>
<script>controls.speedup(-1);</script>
</binding>
</button>
<button>
<legend>Reset</legend>
<binding>
<command>property-assign</command>
<property>/sim/speed-up</property>
<property>/sim/time/warp-delta</property>
<value>1</value>
</binding>
</button>
<button>
<legend>+</legend>
<binding>
<command>nasal</command>
<script>controls.speedup(1);</script>
</binding>
</button>
</group>
<empty>
<pref-height>1</pref-height>
</empty>
<hrule/>
<text>
<label>Time Warp</label>
</text>
<text>
<live>true</live>
<property>/sim/time/warp-delta</property>
</text>
<group>
<layout>hbox</layout>
<default-padding>0</default-padding>
<button>
<legend>-</legend>
<binding>
<command>property-adjust</command>
<property>/sim/time/warp-delta</property>
<step type="int">-30</step>
</binding>
</button>
<button>
<legend>Reset</legend>
<binding>
<command>property-assign</command>
<property>/sim/time/warp-delta</property>
<value>0</value>
</binding>
</button>
<button>
<legend>+</legend>
<binding>
<command>property-adjust</command>
<property>/sim/time/warp-delta</property>
<step type="int">30</step>
</binding>
</button>
</group>
2005-12-14 12:16:11 +00:00
<empty>
<stretch>true</stretch>
</empty>
</group>
<empty>
<pref-width>2</pref-width>
</empty>
<group>
<layout>vbox</layout>
<default-padding>0</default-padding>
<button>
<legend>Clock Time</legend>
<equal>true</equal>
<binding>
<command>timeofday</command>
<timeofday>real</timeofday>
</binding>
</button>
2005-12-14 12:16:11 +00:00
<button>
<legend>Dawn</legend>
<equal>true</equal>
<binding>
<command>timeofday</command>
<timeofday>dawn</timeofday>
</binding>
</button>
2003-09-17 15:49:39 +00:00
<button>
<legend>Morning</legend>
<equal>true</equal>
<binding>
<command>timeofday</command>
<timeofday>morning</timeofday>
</binding>
</button>
2003-09-17 15:49:39 +00:00
<button>
<legend>Noon</legend>
<equal>true</equal>
<binding>
<command>timeofday</command>
<timeofday>noon</timeofday>
</binding>
</button>
2003-09-17 15:49:39 +00:00
<button>
<legend>Afternoon</legend>
<equal>true</equal>
<binding>
<command>timeofday</command>
<timeofday>afternoon</timeofday>
</binding>
</button>
2003-09-17 15:49:39 +00:00
<button>
<legend>Dusk</legend>
<equal>true</equal>
<binding>
<command>timeofday</command>
<timeofday>dusk</timeofday>
</binding>
</button>
2003-09-17 15:49:39 +00:00
<button>
<legend>Evening</legend>
<equal>true</equal>
<binding>
<command>timeofday</command>
<timeofday>evening</timeofday>
</binding>
</button>
2003-09-17 15:49:39 +00:00
<button>
<legend>Night</legend>
<equal>true</equal>
<binding>
<command>timeofday</command>
<timeofday>midnight</timeofday>
</binding>
</button>
<group>
<layout>hbox</layout>
<checkbox>
<property>sim/time/warp-easing</property>
<live>true</live>
<binding>
<command>property-toggle</command>
<property>sim/time/warp-easing</property>
</binding>
</checkbox>
<text>
<label>Easing</label>
</text>
</group>
</group>
</group>
2003-09-17 15:49:39 +00:00
<hrule/>
<button>
<legend>Close</legend>
<default>true</default>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
<nasal>
<open>
<![CDATA[
# Extract the year month day into properties
var dtv = getprop("/sim/time/gmt");
var year = substr(dtv,0,4);
var month = substr(dtv,5,2);
var day = substr(dtv,8,2);
setprop("/sim/time/demand-year",year);
setprop("/sim/time/demand-month",month);
setprop("/sim/time/demand-day",day);
]]>
</open>
</nasal>
</PropertyList>