1
0
Fork 0

weather-dialog: handle incoming METAR

metar/data is a tied property, it does not trigger
a listener - metar/valid does.
This commit is contained in:
Torsten Dreyer 2010-09-12 23:04:49 +02:00
parent a93bc69add
commit d02cff21cf

View file

@ -994,9 +994,9 @@
setprop("sim/gui/dialogs/weather-scenario/metar", metar );
});
var metarListener = setlistener( "environment/metar/data", func(n) {
var metar = n.getValue();
if( metar == nil ) metar = "";
var metarListener = setlistener( "environment/metar/valid", func(n) {
var metar = getprop("environment/metar/data");
if( metar == nil or metar == "" ) metar = "NIL";
metar = normalize_string(metar);
setprop("sim/gui/dialogs/weather-scenario/metar", metar );
gui.dialog_update( "weather", "metar" );