From 55b17f4c5e006591c7c1e10e9b7a10aa78a740b1 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sun, 21 Aug 2022 15:57:34 +0200 Subject: [PATCH] Block metar winds if simbrief winds are active --- Nasal/local_weather/local_weather.nas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Nasal/local_weather/local_weather.nas b/Nasal/local_weather/local_weather.nas index 38210acff..942e01ff4 100644 --- a/Nasal/local_weather/local_weather.nas +++ b/Nasal/local_weather/local_weather.nas @@ -3444,6 +3444,11 @@ append(windIpointArray, w); var set_wind_ipoint_metar = func (lat, lon, d0, v0) { +if (getprop("/sim/gui/dialogs/weather/simbrief-loaded")) { + # METAR winds should not interfere with simbrief winds + return; +} + # insert a plausible pattern of aloft winds based on ground info @@ -3689,6 +3694,11 @@ create_cloudbox(type, lat, lon, alt, x,y,z,n, f_core, r_core, h_core, n_core, f_ } var load_simbrief_weather_from_xml = func { + setprop("/sim/gui/dialogs/weather/simbrief-loaded", "true"); + + # Clear existing wind data (e.g. from metar mode) + windIpointArray = []; + var file = getprop("/sim/fg-home") ~ "/Export/weater_simbrief.xml"; var node = io.readxml(file); @@ -3757,7 +3767,6 @@ var load_simbrief_weather_from_xml = func { } } - setprop("/sim/gui/dialogs/weather/simbrief-loaded", "true"); setprop("/sim/gui/dialogs/weather/simbrief-last-flight", departure ~ " - " ~ arrival); }