2010-10-07 15:56:24 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<PropertyList>
|
2012-08-07 20:27:29 +00:00
|
|
|
<nasal>
|
2013-02-27 23:37:55 +00:00
|
|
|
<open>
|
|
|
|
<![CDATA[
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2013-05-21 19:50:21 +00:00
|
|
|
setprop("sim/gui/dialogs/metar/description[1]",
|
2015-06-03 19:14:28 +00:00
|
|
|
"Simple and fast weather engine that interprets METAR data " ~
|
2013-05-21 19:50:21 +00:00
|
|
|
"directly or a set of manually defined parameters. Recommended for use with Multiplayer.");
|
|
|
|
setprop("sim/gui/dialogs/metar/description[2]",
|
|
|
|
"Advanced weather engine that gives more detailed and realistic results based on METAR " ~
|
2015-05-15 19:08:53 +00:00
|
|
|
"data and a set of predefined parameters. Click on 'Apply' to run the engine, as the engine " ~
|
|
|
|
"does not automatically load upon startup.");
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
var normalize_string = func(src) {
|
|
|
|
if( src == nil ) src = "";
|
|
|
|
var dst = "";
|
|
|
|
for( var i = 0; i < size(src); i+=1 ) {
|
|
|
|
if( src[i] == `\n` or src[i] == `\r` )
|
|
|
|
src[i] = ` `;
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
if (i == 0 and src[i] == ` `)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if( i != 0 and src[i] == ` ` and src[i-1] == ` ` )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
dst = dst ~ " ";
|
|
|
|
dst[size(dst)-1] = src[i];
|
|
|
|
}
|
|
|
|
return dst;
|
|
|
|
}
|
|
|
|
|
|
|
|
var GlobalWeatherDialogController = {
|
|
|
|
|
|
|
|
new : func( dlgRoot ) {
|
|
|
|
var obj = { parents: [GlobalWeatherDialogController] };
|
|
|
|
obj.dlgRoot = dlgRoot;
|
|
|
|
obj.base = "sim/gui/dialogs/metar";
|
|
|
|
obj.baseN = props.globals.getNode( obj.base, 1 );
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
},
|
|
|
|
|
|
|
|
refresh : func {
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
var scenarioName = getprop( me.base ~ "/source-selection");
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
if (getprop( me.base ~ "/mode/manual-weather")) {
|
2012-08-09 20:38:36 +00:00
|
|
|
# In manual weather mode we have to disable live weather
|
2012-08-07 20:27:29 +00:00
|
|
|
# fetch so the weather can be changed by the user in the
|
2015-06-03 19:14:28 +00:00
|
|
|
# weather configuration dialog.
|
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
setprop( "/environment/params/metar-updates-environment", 0 );
|
|
|
|
setprop( "/environment/realwx/enabled", 0 );
|
2013-04-25 21:02:47 +00:00
|
|
|
setprop( "/environment/config/enabled", 1 );
|
2012-08-07 20:27:29 +00:00
|
|
|
} else if( scenarioName == "Live data" ) {
|
|
|
|
# If we've selected Live Data we need to force
|
|
|
|
# a refresh of the Live Data setting.
|
|
|
|
setprop( "/environment/realwx/enabled", 1 );
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
open : func {
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
# Determine the weather mode.
|
|
|
|
if ( getprop("/nasal/local_weather/enabled") == 1) {
|
|
|
|
# Local weather mode
|
|
|
|
setprop( me.base ~ "/mode/global-weather", "0" );
|
|
|
|
setprop( me.base ~ "/mode/local-weather", "1" );
|
2015-06-03 19:14:28 +00:00
|
|
|
setprop( me.base ~ "/mode/manual-weather", "0" );
|
2012-08-07 20:27:29 +00:00
|
|
|
} else if ( getprop( "environment/params/metar-updates-environment" ) == 0 ) {
|
|
|
|
# Manual weather mode
|
2013-05-21 19:50:21 +00:00
|
|
|
setprop( me.base ~ "/mode/global-weather", "1" );
|
2012-08-07 20:27:29 +00:00
|
|
|
setprop( me.base ~ "/mode/local-weather", "0" );
|
|
|
|
setprop( me.base ~ "/mode/manual-weather", "1" );
|
|
|
|
} else {
|
|
|
|
# Global weather mode
|
|
|
|
setprop( me.base ~ "/mode/global-weather", "1" );
|
|
|
|
setprop( me.base ~ "/mode/local-weather", "0" );
|
|
|
|
setprop( me.base ~ "/mode/manual-weather", "0" );
|
|
|
|
}
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
# initialize the METAR source selection
|
|
|
|
if( getprop( "environment/realwx/enabled" ) ) {
|
|
|
|
setprop( me.base ~ "/source-selection", "Live data" );
|
|
|
|
} else {
|
|
|
|
# preset configured scenario
|
|
|
|
var wsn = props.globals.getNode( "/environment/weather-scenarios" );
|
2012-08-09 20:38:36 +00:00
|
|
|
var current = getprop("/environment/weather-scenario", "");
|
2012-08-07 20:27:29 +00:00
|
|
|
var found = 0;
|
|
|
|
if( wsn != nil ) {
|
|
|
|
var scenarios = wsn.getChildren("scenario");
|
|
|
|
forindex (var i; scenarios ) {
|
|
|
|
var metarN = scenarios[i].getNode("metar");
|
|
|
|
metarN == nil and continue;
|
2012-08-09 20:38:36 +00:00
|
|
|
if( scenarios[i].getNode("name").getValue() == current ) {
|
2012-08-07 20:27:29 +00:00
|
|
|
setprop( me.base ~ "/source-selection", scenarios[i].getNode("name").getValue() );
|
|
|
|
found = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( found == 0 )
|
|
|
|
setprop( me.base ~ "/source-selection", "Manual input" );
|
|
|
|
}
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
setprop( me.base ~ "/metar-string", normalize_string(getprop("environment/metar/data")) );
|
2017-04-09 21:02:08 +00:00
|
|
|
gui.findElementByName( me.dlgRoot, "metar-string-input" ).getNode("legend", 1).setValue(normalize_string(getprop("environment/metar/data")));
|
2012-08-07 20:27:29 +00:00
|
|
|
|
|
|
|
# fill the METAR source combo box
|
|
|
|
var combo = gui.findElementByName( me.dlgRoot, "source-selection" );
|
|
|
|
var wsn = props.globals.getNode( "/environment/weather-scenarios" );
|
|
|
|
if( wsn != nil ) {
|
|
|
|
var scenarios = wsn.getChildren("scenario");
|
|
|
|
forindex (var i; scenarios ) {
|
|
|
|
combo.getChild("value", i, 1).setValue(scenarios[i].getNode("name").getValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
me.scenarioListenerId = setlistener( me.base ~ "/source-selection", func(n) { me.scenarioListener(n); }, 1, 1 );
|
|
|
|
me.metarListenerId = setlistener( "environment/metar/valid", func(n) { me.metarListener(n); }, 1, 1 );
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
# Update the dialog itself
|
|
|
|
me.refresh();
|
|
|
|
},
|
|
|
|
|
|
|
|
close : func {
|
|
|
|
removelistener( me.scenarioListenerId );
|
|
|
|
removelistener( me.metarListenerId );
|
|
|
|
},
|
|
|
|
|
|
|
|
apply : func {
|
|
|
|
var scenarioName = getprop( me.base ~ "/source-selection");
|
|
|
|
var metar = getprop( "environment/metar/data" );
|
|
|
|
var global_weather_enabled = getprop( me.base ~ "/mode/global-weather");
|
|
|
|
var local_weather_enabled = getprop( me.base ~ "/mode/local-weather");
|
|
|
|
var manual_weather_enabled = getprop( me.base ~ "/mode/manual-weather");
|
2015-06-03 19:14:28 +00:00
|
|
|
|
|
|
|
# General weather settings based on scenario
|
2012-08-07 20:27:29 +00:00
|
|
|
if (manual_weather_enabled == 1) {
|
|
|
|
setprop( "/environment/params/metar-updates-environment", 0 );
|
|
|
|
setprop( "/environment/realwx/enabled", 0 );
|
2012-08-09 20:38:36 +00:00
|
|
|
setprop( "/environment/config/enabled", 1 );
|
2012-08-07 20:27:29 +00:00
|
|
|
metar = "";
|
|
|
|
} else if( scenarioName == "Live data" ) {
|
|
|
|
setprop( "/environment/params/metar-updates-environment", 1 );
|
|
|
|
setprop( "/environment/realwx/enabled", 1 );
|
|
|
|
setprop( "/environment/config/enabled", 1 );
|
|
|
|
} else if( scenarioName == "Manual input" ) {
|
|
|
|
setprop( "/environment/params/metar-updates-environment", 1 );
|
|
|
|
setprop( "/environment/realwx/enabled", 0 );
|
|
|
|
setprop( "/environment/config/enabled", 1 );
|
|
|
|
metar = getprop( me.base ~ "/metar-string" );
|
2017-04-09 21:02:08 +00:00
|
|
|
setprop("/environment/weather-scenario", scenarioName);
|
2012-08-07 20:27:29 +00:00
|
|
|
} else {
|
|
|
|
setprop( "/environment/params/metar-updates-environment", 1 );
|
|
|
|
setprop( "/environment/realwx/enabled", 0 );
|
|
|
|
setprop( "/environment/config/enabled", 1 );
|
|
|
|
metar = getprop( me.base ~ "/metar-string" );
|
2013-04-25 21:02:47 +00:00
|
|
|
setprop("/environment/weather-scenario", scenarioName);
|
2012-08-07 20:27:29 +00:00
|
|
|
}
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
if( metar != nil ) {
|
|
|
|
setprop( "environment/metar/data", normalize_string(metar) );
|
|
|
|
}
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
# Clear any local weather that might be running
|
2021-08-19 00:31:04 +00:00
|
|
|
if (getprop("/nasal/local_weather/enabled")) local_weather.clear_all();
|
2012-08-07 20:27:29 +00:00
|
|
|
setprop("/nasal/local_weather/enabled", "false");
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
if (local_weather_enabled) {
|
2015-06-03 19:14:28 +00:00
|
|
|
# If Local Weather is enabled, re-initialize with updated
|
2012-08-07 20:27:29 +00:00
|
|
|
# initial tile and tile selection.
|
|
|
|
setprop("/nasal/local_weather/enabled", "true");
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
# Re-initialize local weather.
|
2015-06-03 19:14:28 +00:00
|
|
|
settimer( func {local_weather.set_tile();}, 0.2);
|
|
|
|
}
|
2012-08-07 20:27:29 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
findScenarioByName : func(name) {
|
|
|
|
var wsn = props.globals.getNode( "/environment/weather-scenarios" );
|
|
|
|
if( wsn != nil ) {
|
|
|
|
var scenarios = wsn.getChildren("scenario");
|
|
|
|
foreach (var scenario; scenarios ) {
|
|
|
|
if( scenario.getNode("name").getValue() == name )
|
|
|
|
return scenario;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil;
|
|
|
|
},
|
|
|
|
|
|
|
|
scenarioListener : func( n ) {
|
2012-08-09 20:38:36 +00:00
|
|
|
var description = "";
|
|
|
|
var metar = "nil";
|
|
|
|
var local_weather_props = nil;
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
var scenario = me.findScenarioByName( n.getValue() );
|
|
|
|
if( scenario != nil ) {
|
|
|
|
description = normalize_string(scenario.getNode("description", 1 ).getValue());
|
|
|
|
metar = normalize_string(scenario.getNode("metar", 1 ).getValue());
|
2012-08-09 20:38:36 +00:00
|
|
|
local_weather_props = scenario.getNode("local-weather");
|
2012-08-07 20:27:29 +00:00
|
|
|
}
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
if (n.getValue() == "Live data") {
|
|
|
|
# Special case - retrieve live data
|
|
|
|
var metar = getprop( "environment/metar/data" );
|
|
|
|
}
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
if (n.getValue() == "Manual input") {
|
|
|
|
# Special case - retain current values
|
|
|
|
var metar = getprop( me.base ~ "/metar-string" );
|
2015-06-03 19:14:28 +00:00
|
|
|
}
|
2012-08-07 20:27:29 +00:00
|
|
|
|
|
|
|
setprop(me.base ~ "/description", description );
|
|
|
|
setprop(me.base ~ "/metar-string", metar );
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-09 20:38:36 +00:00
|
|
|
# Set the wind from the METAR string.
|
|
|
|
var result = [];
|
|
|
|
var msplit = split(" ", string.uc(metar));
|
|
|
|
foreach (var word; msplit) {
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-09 20:38:36 +00:00
|
|
|
if ((size(word) > 6) and string.match(word, "*[0-9][0-9]KT")) {
|
|
|
|
# We've got the wind definition word. Now to split it up.
|
|
|
|
# Format is nnnmmKT or nnnmmGppKT
|
|
|
|
# Direction is easy - the first 3 characters.
|
|
|
|
var dir = chr(word[0]) ~ chr(word[1]) ~ chr(word[2]);
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-09 20:38:36 +00:00
|
|
|
if (dir == "VRB") {
|
|
|
|
setprop("/local-weather/tmp/tile-orientation-deg", 360.0 * rand());
|
|
|
|
setprop("/local-weather/tmp/gust-angular-variation-deg", 180.0);
|
|
|
|
setprop("/local-weather/tmp/gust-frequency-hz", 0.001);
|
|
|
|
} else {
|
2015-06-03 19:14:28 +00:00
|
|
|
setprop("/local-weather/tmp/tile-orientation-deg", dir);
|
2012-08-09 20:38:36 +00:00
|
|
|
setprop("/local-weather/tmp/gust-angular-variation-deg", 0.0);
|
|
|
|
setprop("/local-weather/tmp/gust-frequency-hz", 0.0);
|
|
|
|
}
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-09 20:38:36 +00:00
|
|
|
# Next two are the base wind
|
|
|
|
var spd = chr(word[3]) ~ chr(word[4]);
|
|
|
|
setprop("/local-weather/tmp/windspeed-kt", spd);
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-09 20:38:36 +00:00
|
|
|
var gst = 0;
|
|
|
|
if ((size(word) > 7) and (chr(word[5]) == 'G')) {
|
|
|
|
# Gusty case
|
|
|
|
gst = chr(word[6]) ~ chr(word[7]);
|
|
|
|
}
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-09 20:38:36 +00:00
|
|
|
if ((gst > spd) and (spd > 0)) {
|
|
|
|
setprop("/local-weather/tmp/gust-relative-strength", (gst - spd) / spd);
|
|
|
|
setprop("/local-weather/tmp/gust-frequency-hz", 0.7);
|
|
|
|
} else {
|
|
|
|
setprop("/local-weather/tmp/gust-relative-strength", 0.0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-06-03 19:14:28 +00:00
|
|
|
|
|
|
|
|
2012-08-09 20:38:36 +00:00
|
|
|
if (local_weather_props != nil) {
|
2015-06-03 19:14:28 +00:00
|
|
|
# The local weather properties need to be set now, so they can
|
2012-08-09 20:38:36 +00:00
|
|
|
# be configured by the user if they select Advanced Settings
|
|
|
|
props.copy(local_weather_props, props.globals.getNode("/local-weather/tmp", 1));
|
|
|
|
} else {
|
|
|
|
# If no local weather properties have been set, we'll read from the scenario
|
|
|
|
# METAR
|
|
|
|
setprop("/local-weather/tmp/tile-type", "manual");
|
|
|
|
setprop("/local-weather/tmp/tile-management", "METAR");
|
2015-06-03 19:14:28 +00:00
|
|
|
}
|
2012-08-09 20:38:36 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
me.refresh();
|
|
|
|
},
|
|
|
|
|
|
|
|
metarListener : func( n ) {
|
2015-06-03 19:14:28 +00:00
|
|
|
var metar = getprop("environment/metar/data");
|
2012-08-07 20:27:29 +00:00
|
|
|
if( metar == nil or metar == "" ) metar = "NIL";
|
|
|
|
metar = normalize_string(metar);
|
2020-06-28 06:27:19 +00:00
|
|
|
logprint(LOG_DEBUG, "new METAR: " ~ metar );
|
2012-08-07 20:27:29 +00:00
|
|
|
setprop( me.base ~ "/metar-string", metar );
|
|
|
|
gui.dialog_update( "weather-conditions", "metar-string" );
|
|
|
|
},
|
2015-06-03 19:14:28 +00:00
|
|
|
|
2012-08-07 20:27:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var controller = GlobalWeatherDialogController.new( cmdarg() );
|
|
|
|
controller.open();
|
2013-02-27 23:37:55 +00:00
|
|
|
]]>
|
|
|
|
</open>
|
2012-08-07 20:27:29 +00:00
|
|
|
|
2013-02-27 23:37:55 +00:00
|
|
|
<close>
|
|
|
|
<![CDATA[
|
2012-08-07 20:27:29 +00:00
|
|
|
controller.close();
|
2013-02-27 23:37:55 +00:00
|
|
|
]]>
|
|
|
|
</close>
|
2012-08-07 20:27:29 +00:00
|
|
|
</nasal>
|
2010-10-07 15:56:24 +00:00
|
|
|
|
|
|
|
<!-- Control the weather -->
|
|
|
|
<name>weather</name>
|
|
|
|
<modal>false</modal>
|
|
|
|
<resizable>false</resizable>
|
|
|
|
<layout>vbox</layout>
|
|
|
|
<default-padding>3</default-padding>
|
|
|
|
|
|
|
|
<!-- Title bar with close button -->
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<default-padding>1</default-padding>
|
|
|
|
|
|
|
|
<empty>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
</empty>
|
|
|
|
|
|
|
|
<text>
|
2012-08-07 20:27:29 +00:00
|
|
|
<label>Weather Conditions</label>
|
2010-10-07 15:56:24 +00:00
|
|
|
</text>
|
|
|
|
|
|
|
|
<empty>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
</empty>
|
|
|
|
|
|
|
|
<button>
|
|
|
|
<legend/>
|
|
|
|
<key>Esc</key>
|
|
|
|
<pref-width>16</pref-width>
|
|
|
|
<pref-height>16</pref-height>
|
|
|
|
<border>2</border>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-close</command>
|
|
|
|
</binding>
|
|
|
|
</button>
|
|
|
|
</group>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2010-10-07 15:56:24 +00:00
|
|
|
<hrule/>
|
|
|
|
|
|
|
|
<group>
|
2015-05-03 16:13:50 +00:00
|
|
|
<layout>hbox</layout>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
2015-05-03 16:13:50 +00:00
|
|
|
<!-- only for a gap -->
|
|
|
|
<group>
|
|
|
|
<layout>vbox</layout>
|
|
|
|
<default-padding>1</default-padding>
|
|
|
|
<text>
|
|
|
|
<label> </label>
|
|
|
|
</text>
|
|
|
|
</group>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
2010-10-07 15:56:24 +00:00
|
|
|
<group>
|
2015-05-03 16:13:50 +00:00
|
|
|
<layout>vbox</layout>
|
|
|
|
|
|
|
|
<text>
|
|
|
|
<halign>left</halign>
|
|
|
|
<label>Select Weather Engine</label>
|
|
|
|
</text>
|
|
|
|
|
2010-10-07 15:56:24 +00:00
|
|
|
<group>
|
2015-05-03 16:13:50 +00:00
|
|
|
<layout>hbox</layout>
|
|
|
|
<halign>left</halign>
|
|
|
|
<group>
|
|
|
|
<layout>table</layout>
|
|
|
|
<!--
|
|
|
|
<pref-width>500</pref-width>
|
|
|
|
-->
|
|
|
|
<radio>
|
|
|
|
<row>0</row>
|
|
|
|
<col>0</col>
|
|
|
|
<halign>left</halign>
|
|
|
|
<name>simple-weather</name>
|
2012-08-07 20:27:29 +00:00
|
|
|
<property>sim/gui/dialogs/metar/mode/global-weather</property>
|
2015-05-03 16:13:50 +00:00
|
|
|
<live>true</live>
|
|
|
|
<label>Basic Weather</label>
|
|
|
|
<binding>
|
|
|
|
<command>property-assign</command>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/global-weather</property>
|
|
|
|
<value>1</value>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>property-assign</command>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/local-weather</property>
|
|
|
|
<value>0</value>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>property-assign</command>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/manual-weather</property>
|
|
|
|
<value>0</value>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>
|
|
|
|
controller.refresh();
|
|
|
|
</script>
|
|
|
|
</binding>
|
|
|
|
</radio>
|
|
|
|
<checkbox>
|
|
|
|
<row>0</row>
|
|
|
|
<col>1</col>
|
|
|
|
<halign>right</halign>
|
|
|
|
<name>manual-weather-config</name>
|
2012-08-07 20:27:29 +00:00
|
|
|
<property>sim/gui/dialogs/metar/mode/manual-weather</property>
|
2015-05-03 16:13:50 +00:00
|
|
|
<label>Manual Configuration</label>
|
|
|
|
<live>true</live>
|
|
|
|
<enable>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/global-weather</property>
|
|
|
|
</enable>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
<object-name>manual-weather-config</object-name>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>
|
|
|
|
controller.refresh();
|
|
|
|
</script>
|
|
|
|
</binding>
|
|
|
|
</checkbox>
|
|
|
|
|
|
|
|
<empty>
|
|
|
|
<row>0</row>
|
|
|
|
<col>2</col>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
</empty>
|
|
|
|
|
|
|
|
<button>
|
|
|
|
<row>0</row>
|
|
|
|
<col>3</col>
|
|
|
|
<halign>right</halign>
|
|
|
|
<!--
|
|
|
|
<pref-width>170</pref-width>
|
|
|
|
-->
|
|
|
|
<legend>Manual Configuration ...</legend>
|
|
|
|
<enable>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/manual-weather</property>
|
|
|
|
</enable>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-show</command>
|
|
|
|
<dialog-name>weather-configuration</dialog-name>
|
|
|
|
</binding>
|
|
|
|
<!--<binding>
|
|
|
|
<command>property-assign</command>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/manual-weather</property>
|
|
|
|
<value>1</value>
|
|
|
|
</binding>-->
|
|
|
|
</button>
|
|
|
|
</group>
|
2013-02-27 23:37:55 +00:00
|
|
|
</group>
|
|
|
|
|
2015-05-03 16:13:50 +00:00
|
|
|
<textbox>
|
|
|
|
<name>basic description</name>
|
|
|
|
<halign>fill</halign>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
<!--
|
|
|
|
<pref-width>250</pref-width>
|
|
|
|
-->
|
|
|
|
<pref-height>70</pref-height>
|
|
|
|
<slider>15</slider>
|
|
|
|
<editable>false</editable>
|
|
|
|
<wrap>true</wrap>
|
|
|
|
<live>true</live>
|
|
|
|
<top-line>0</top-line>
|
|
|
|
<property>sim/gui/dialogs/metar/description[1]</property>
|
|
|
|
</textbox>
|
2012-08-07 20:27:29 +00:00
|
|
|
|
2013-02-27 23:37:55 +00:00
|
|
|
<group>
|
2015-05-03 16:13:50 +00:00
|
|
|
<layout>hbox</layout>
|
|
|
|
<halign>left</halign>
|
|
|
|
<group>
|
|
|
|
<layout>table</layout>
|
|
|
|
<!--
|
|
|
|
<pref-width>500</pref-width>
|
|
|
|
-->
|
|
|
|
<radio>
|
|
|
|
<row>0</row>
|
|
|
|
<col>0</col>
|
|
|
|
<label>Detailed Weather</label>
|
|
|
|
<halign>left</halign>
|
|
|
|
<name>simple-weather</name>
|
2012-08-07 20:27:29 +00:00
|
|
|
<property>sim/gui/dialogs/metar/mode/local-weather</property>
|
2015-05-03 16:13:50 +00:00
|
|
|
<live>true</live>
|
|
|
|
<binding>
|
|
|
|
<command>property-assign</command>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/local-weather</property>
|
|
|
|
<value>1</value>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>property-assign</command>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/global-weather</property>
|
|
|
|
<value>0</value>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>property-assign</command>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/manual-weather</property>
|
|
|
|
<value>0</value>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>
|
|
|
|
controller.refresh();
|
|
|
|
</script>
|
|
|
|
</binding>
|
|
|
|
</radio>
|
|
|
|
|
|
|
|
<text>
|
|
|
|
<row>0</row>
|
|
|
|
<col>1</col>
|
|
|
|
<label> </label>
|
|
|
|
</text>
|
|
|
|
|
|
|
|
<empty>
|
|
|
|
<row>0</row>
|
|
|
|
<col>2</col>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
</empty>
|
|
|
|
|
|
|
|
<button>
|
|
|
|
<row>0</row>
|
|
|
|
<col>3</col>
|
|
|
|
<legend> Advanced Settings ...</legend>
|
|
|
|
<halign>right</halign>
|
|
|
|
<!--
|
|
|
|
<pref-width>170</pref-width>
|
|
|
|
-->
|
|
|
|
<enable>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/local-weather</property>
|
|
|
|
<value>1</value>
|
|
|
|
</enable>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-show</command>
|
|
|
|
<dialog-name>local-weather</dialog-name>
|
|
|
|
</binding>
|
|
|
|
</button>
|
|
|
|
</group>
|
2010-10-07 15:56:24 +00:00
|
|
|
</group>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
2015-05-03 16:13:50 +00:00
|
|
|
<textbox>
|
|
|
|
<name>advance-description</name>
|
|
|
|
<halign>fill</halign>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
<!--
|
|
|
|
<pref-width>250</pref-width>
|
|
|
|
-->
|
2015-05-15 19:08:53 +00:00
|
|
|
<pref-height>90</pref-height>
|
2015-05-03 16:13:50 +00:00
|
|
|
<slider>15</slider>
|
|
|
|
<editable>false</editable>
|
|
|
|
<wrap>true</wrap>
|
|
|
|
<live>true</live>
|
|
|
|
<top-line>0</top-line>
|
|
|
|
<property>sim/gui/dialogs/metar/description[2]</property>
|
|
|
|
</textbox>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
2015-05-03 16:13:50 +00:00
|
|
|
<!--
|
|
|
|
<group>
|
|
|
|
<layout>table</layout>
|
|
|
|
|
|
|
|
</group>
|
|
|
|
-->
|
|
|
|
<empty>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
</empty>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
|
|
|
</group>
|
|
|
|
|
2015-05-03 16:13:50 +00:00
|
|
|
<!-- only for a gap -->
|
|
|
|
<group>
|
|
|
|
<layout>vbox</layout>
|
|
|
|
<default-padding>1</default-padding>
|
|
|
|
<text>
|
|
|
|
<label> </label>
|
|
|
|
</text>
|
|
|
|
</group>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
2010-10-07 15:56:24 +00:00
|
|
|
</group>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
|
|
|
<hrule/>
|
2010-10-07 15:56:24 +00:00
|
|
|
|
|
|
|
<group>
|
2015-05-03 16:13:50 +00:00
|
|
|
<layout>hbox</layout>
|
2010-10-07 15:56:24 +00:00
|
|
|
|
2015-05-03 16:13:50 +00:00
|
|
|
<!-- only for a gap -->
|
2010-10-07 15:56:24 +00:00
|
|
|
<group>
|
2015-05-03 16:13:50 +00:00
|
|
|
<layout>vbox</layout>
|
|
|
|
<default-padding>1</default-padding>
|
2010-10-07 15:56:24 +00:00
|
|
|
<text>
|
2015-05-03 16:13:50 +00:00
|
|
|
<label> </label>
|
2010-10-07 15:56:24 +00:00
|
|
|
</text>
|
|
|
|
</group>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
2010-10-07 15:56:24 +00:00
|
|
|
<group>
|
2015-05-03 16:13:50 +00:00
|
|
|
<layout>vbox</layout>
|
|
|
|
<halign>left</halign>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<halign>left</halign>
|
|
|
|
<group>
|
|
|
|
<layout>table</layout>
|
|
|
|
<text>
|
|
|
|
<row>0</row>
|
|
|
|
<col>0</col>
|
|
|
|
<label>Weather Conditions</label>
|
|
|
|
<halign>left</halign>
|
|
|
|
</text>
|
|
|
|
<text>
|
|
|
|
<row>0</row>
|
|
|
|
<col>1</col>
|
|
|
|
<label> </label>
|
|
|
|
<halign>left</halign>
|
|
|
|
</text>
|
|
|
|
<combo>
|
|
|
|
<row>0</row>
|
|
|
|
<col>2</col>
|
|
|
|
<name>source-selection</name>
|
|
|
|
<halign>fill</halign>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
<pref-width>300</pref-width>
|
|
|
|
<property>sim/gui/dialogs/metar/source-selection</property>
|
|
|
|
<enable>
|
|
|
|
<equals>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/manual-weather</property>
|
|
|
|
<value>0</value>
|
|
|
|
</equals>
|
|
|
|
</enable>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
<object-name>source-selection</object-name>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-update</command>
|
2017-04-09 21:02:08 +00:00
|
|
|
<object-name>metar-string-input</object-name>
|
2015-05-03 16:13:50 +00:00
|
|
|
</binding>
|
|
|
|
</combo>
|
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
|
2019-11-06 17:46:00 +00:00
|
|
|
<textbox>
|
|
|
|
<name>description</name>
|
|
|
|
<halign>fill</halign>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
<pref-width>450</pref-width>
|
|
|
|
<pref-height>100</pref-height>
|
|
|
|
<slider>15</slider>
|
|
|
|
<editable>false</editable>
|
|
|
|
<wrap>true</wrap>
|
|
|
|
<live>true</live>
|
|
|
|
<top-line>0</top-line>
|
|
|
|
<property>sim/gui/dialogs/metar/description[0]</property>
|
|
|
|
</textbox>
|
|
|
|
|
|
|
|
<!-- only for a gap -->
|
|
|
|
<group>
|
|
|
|
<layout>vbox</layout>
|
|
|
|
<default-padding>1</default-padding>
|
|
|
|
<text>
|
|
|
|
<label> </label>
|
|
|
|
</text>
|
|
|
|
</group>
|
|
|
|
|
2015-05-03 16:13:50 +00:00
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<text>
|
|
|
|
<label>METAR Data</label>
|
|
|
|
</text>
|
|
|
|
<empty>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
</empty>
|
|
|
|
<text>
|
|
|
|
<label> </label>
|
|
|
|
</text>
|
|
|
|
<text>
|
|
|
|
<label>Data is valid</label>
|
|
|
|
</text>
|
|
|
|
<checkbox>
|
|
|
|
<property>/environment/metar/valid</property>
|
|
|
|
<label/>
|
|
|
|
<live>true</live>
|
|
|
|
<enable>
|
|
|
|
<false/>
|
|
|
|
</enable>
|
|
|
|
</checkbox>
|
|
|
|
</group>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<textbox>
|
2017-04-09 21:02:08 +00:00
|
|
|
<name>metar-string-input</name>
|
2015-05-03 16:13:50 +00:00
|
|
|
<halign>fill</halign>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
<!--
|
|
|
|
<pref-width>250</pref-width>
|
|
|
|
-->
|
|
|
|
<pref-height>70</pref-height>
|
|
|
|
<slider>15</slider>
|
2015-06-03 19:14:28 +00:00
|
|
|
<editable>true</editable>
|
2015-05-03 16:13:50 +00:00
|
|
|
<wrap>true</wrap>
|
2017-04-09 21:02:08 +00:00
|
|
|
<!-- <live>true</live> -->
|
2015-05-03 16:13:50 +00:00
|
|
|
<top-line>0</top-line>
|
|
|
|
<property>sim/gui/dialogs/metar/metar-string</property>
|
|
|
|
<enable>
|
|
|
|
<and>
|
|
|
|
<equals>
|
|
|
|
<property>sim/gui/dialogs/metar/mode/manual-weather</property>
|
|
|
|
<value>0</value>
|
|
|
|
</equals>
|
|
|
|
<equals>
|
|
|
|
<property>sim/gui/dialogs/metar/source-selection</property>
|
|
|
|
<value>Manual input</value>
|
|
|
|
</equals>
|
|
|
|
</and>
|
|
|
|
</enable>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
2017-04-09 21:02:08 +00:00
|
|
|
<object-name>metar-string-input</object-name>
|
2015-05-03 16:13:50 +00:00
|
|
|
</binding>
|
|
|
|
</textbox>
|
|
|
|
</group>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
2019-11-06 17:46:00 +00:00
|
|
|
<button>
|
|
|
|
<legend>METAR Description...</legend>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-show</command>
|
|
|
|
<dialog-name>weather-metar-description</dialog-name>
|
|
|
|
</binding>
|
|
|
|
</button>
|
2015-05-03 16:13:50 +00:00
|
|
|
<empty>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
</empty>
|
|
|
|
</group>
|
2010-10-07 15:56:24 +00:00
|
|
|
|
2011-01-23 11:15:37 +00:00
|
|
|
</group>
|
2010-10-07 15:56:24 +00:00
|
|
|
|
2015-05-03 16:13:50 +00:00
|
|
|
<!-- only for a gap -->
|
2012-08-07 20:27:29 +00:00
|
|
|
<group>
|
2015-05-03 16:13:50 +00:00
|
|
|
<layout>vbox</layout>
|
|
|
|
<default-padding>1</default-padding>
|
2012-08-07 20:27:29 +00:00
|
|
|
<text>
|
2015-05-03 16:13:50 +00:00
|
|
|
<label> </label>
|
2012-08-07 20:27:29 +00:00
|
|
|
</text>
|
|
|
|
</group>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2010-10-07 15:56:24 +00:00
|
|
|
</group>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
2010-12-27 20:19:31 +00:00
|
|
|
<hrule/>
|
|
|
|
|
2012-01-22 17:29:11 +00:00
|
|
|
<group>
|
|
|
|
<empty>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
</empty>
|
|
|
|
<layout>hbox</layout>
|
2012-08-07 20:27:29 +00:00
|
|
|
|
2012-01-22 17:29:11 +00:00
|
|
|
<button>
|
2012-08-07 20:27:29 +00:00
|
|
|
<legend>OK</legend>
|
2015-05-03 16:13:50 +00:00
|
|
|
<equal>true</equal>
|
2012-08-07 20:27:29 +00:00
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
2017-04-09 21:02:08 +00:00
|
|
|
<object-name>metar-string-input</object-name>
|
2012-08-07 20:27:29 +00:00
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>
|
|
|
|
controller.apply();
|
|
|
|
</script>
|
|
|
|
</binding>
|
2012-01-22 17:29:11 +00:00
|
|
|
<binding>
|
|
|
|
<command>dialog-close</command>
|
|
|
|
</binding>
|
|
|
|
</button>
|
2013-02-27 23:37:55 +00:00
|
|
|
|
2012-01-22 17:29:11 +00:00
|
|
|
<button>
|
2012-08-07 20:27:29 +00:00
|
|
|
<legend>Apply</legend>
|
2015-05-03 16:13:50 +00:00
|
|
|
<equal>true</equal>
|
2012-01-22 17:29:11 +00:00
|
|
|
<binding>
|
2012-08-07 20:27:29 +00:00
|
|
|
<command>dialog-apply</command>
|
2017-04-09 21:02:08 +00:00
|
|
|
<object-name>metar-string-input</object-name>
|
2012-01-22 17:29:11 +00:00
|
|
|
</binding>
|
|
|
|
<binding>
|
2012-08-07 20:27:29 +00:00
|
|
|
<command>nasal</command>
|
|
|
|
<script>
|
|
|
|
controller.apply();
|
|
|
|
</script>
|
2012-01-22 17:29:11 +00:00
|
|
|
</binding>
|
2012-08-07 20:27:29 +00:00
|
|
|
</button>
|
|
|
|
|
|
|
|
<button>
|
|
|
|
<legend>Close</legend>
|
2015-05-03 16:13:50 +00:00
|
|
|
<equal>true</equal>
|
2012-08-07 20:27:29 +00:00
|
|
|
<default>true</default>
|
|
|
|
<key>Esc</key>
|
2012-01-22 17:29:11 +00:00
|
|
|
<binding>
|
|
|
|
<command>dialog-close</command>
|
|
|
|
</binding>
|
|
|
|
</button>
|
|
|
|
<empty>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
</empty>
|
|
|
|
</group>
|
2010-12-27 20:19:31 +00:00
|
|
|
|
2010-10-07 15:56:24 +00:00
|
|
|
</PropertyList>
|