Airports dialog: Don't implement backend logic in UI
Now that request-metar/clear-metar commands work properly, use those instead of direct manipulation of metar properties. Also, don't write to properties intended for read-only use.
This commit is contained in:
parent
e2d228811e
commit
89b304cd1f
1 changed files with 2 additions and 4 deletions
|
@ -121,13 +121,11 @@
|
|||
|
||||
if (info.has_metar) {
|
||||
# Retrieve an updated METAR, and indicate that we've not got one currently.
|
||||
setprop("/sim/gui/dialogs/airports/selected-airport/metar/station-id", airport_id);
|
||||
setprop("/sim/gui/dialogs/airports/selected-airport/metar/time-to-live", 0);
|
||||
setprop("/sim/gui/dialogs/airports/selected-airport/metar/data", "Retrieving METAR, please wait.");
|
||||
fgcommand("request-metar", var n = props.Node.new({ "path": "/sim/gui/dialogs/airports/selected-airport/metar",
|
||||
"station": airport_id}));
|
||||
} else {
|
||||
# This airport has no METAR. Rather than cancelling the retrieve-metar command, simply set the TTL
|
||||
# to a very long time so it won't over-ride our message.
|
||||
setprop("/sim/gui/dialogs/airports/selected-airport/metar/data", "No METAR available from this airport");
|
||||
setprop("/sim/gui/dialogs/airports/selected-airport/metar/time-to-live", 9999);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue