terrasync 0) return "Errors occurred during download"; # we need to suggest some remedial action here! if (getprop('/sim/terrasync/stalled')) return "Downloading has stalled. Check your network connection and settings"; if (getprop('/sim/terrasync/busy')) { var kbytesSec = getprop('/sim/terrasync/transfer-rate-bytes-sec') / 1024; return sprintf('Downloading: %dKB/sec', int(kbytesSec)); } # we are enabled but not busy, so idle return "Ready"; } # timer function, update summary status string var updateStatusText = func { var s = computeStatusText(); setprop("/sim/gui/dialogs/terrasync/status", s); var msg = ""; if (getprop("/sim/terrasync/available")) { if (getprop("/sim/terrasync/enabled")) msg = "Automatic download active; monitor your bandwidth on metered connection."; } else { if (getprop("/sim/terrasync/intialized")) msg = "Automatic download not active."; else msg = "Automatic download not supported."; } setprop("/sim/terrasync/ui-message-node", msg); } # the TerraSync properties of interest are tied, so we can't use a # listener. Let's poll while the dialog is open; not ideal but not # a major problem. var statusTimer = maketimer(0.4, updateStatusText); statusTimer.start(); updateStatusText(); setprop("/sim/gui/dialogs/terrasync/display-mode", "0"); ]]> statusTimer.stop(); statusTimer = nil; vbox hbox 4 1 1 message 1.0 0.4 0.4 left /sim/terrasync/ui-message-node true vbox table left false 0 0 center terrasync-enabled left 0 1 3 /sim/terrasync/enabled true dialog-apply terrasync-enabled /sim/terrasync/scenery-dir 1 1 center ai-data-enabled left 1 2 /sim/terrasync/ai-data-enabled true dialog-apply ai-data-enabled /sim/terrasync/enabled /sim/traffic-manager/enabled warning_text 3 04 1.0 0.4 0.4 1 center hbox left 4 center center hbox left table fill fill 0 table left top false 0 0 /sim/gui/dialogs/terrasync/display-mode 0 0 0 2 left 200 Status: %s /sim/gui/dialogs/terrasync/status true 0.7 0.7 0.7 1 left 1 0 0.7 0.7 0.7 1 1 1 %d /sim/terrasync/downloaded-kbytes true right true 0.7 0.7 0.7 1 left 2 0 0.7 0.7 0.7 1 2 1 %s /sim/terrasync/update-count true true right 0.7 0.7 0.7 1 left 3 0 0.7 0.7 0.7 1 3 1 %s /sim/terrasync/tile-count true true right 0.7 0.7 0.7 1 0 0 /sim/gui/dialogs/terrasync/display-mode 1 fill fill true 600 300 terrasync 6 hbox 3 true true