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;
vboxhbox411message1.00.40.4left/sim/terrasync/ui-message-nodetruevboxtableleftfalse0