From 661090c86186129f6512ee94d175b37ad169c60b Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Thu, 7 Jan 2016 21:01:16 +0100 Subject: [PATCH] Add time of day slider --- gui/dialogs/timeofday.xml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gui/dialogs/timeofday.xml b/gui/dialogs/timeofday.xml index 3d2f1fcb1..704431095 100644 --- a/gui/dialogs/timeofday.xml +++ b/gui/dialogs/timeofday.xml @@ -220,6 +220,27 @@ /instrumentation/clock/local-short-string + + 2 + 0 + sl_minute + /sim/time/demand-minute-of-day + 1 + 0 + 1440 + 1 + 250 + + dialog-apply + sl_minute + + + nasal + + + @@ -467,6 +488,14 @@ if (getprop("/sim/time/demand-day") > monthmax[month-1]) setprop("/sim/time/demand-day",sprintf("%02d",monthmax[month-1])); } + tod_setminuteofday = func(minute){ + var hour = minute/60; + var minute = math.fmod(minute,60); + var second = 0; + var new_dt=sprintf("%04d-%02d-%02dT%02d:%02d:%02d",getprop("/sim/time/demand-year"),month,getprop("/sim/time/demand-day"),hour,minute,second*1); + setprop("/sim/time/gmt",new_dt); + printf(new_dt); + } ]]>