Board index FlightGear Development Weather

CAT II / IIIb - what's going on?

Everything related to weather simulation, visuals should be discussed in the shader subforum.

Re: CAT II / IIIb - what's going on?

Postby wkitty42 » Sat Sep 15, 2018 7:40 pm

i'm going to bring this up on the dev list... this would be an area that james has been in recently and he would likely see the problem faster than anyone else...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9123
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: CAT II / IIIb - what's going on?

Postby Thorsten » Sat Sep 15, 2018 9:20 pm

Or you could simply open a text editor and search the code for what I described and test whether the launcher indeed triggers something here...
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: CAT II / IIIb - what's going on?

Postby legoboyvdlp » Wed Sep 19, 2018 11:48 am

Hi,
Removing the FG parameter from the METAR of the scenario resulted in this:
Image

Image

Would anyone be able to tell me where METAR is parsed so I can check what's wrong with the FG part?

I'm also using METAR tile selection mode, perhaps I should be using realistic weather when using scenarios?
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: CAT II / IIIb - what's going on?

Postby legoboyvdlp » Sat Sep 22, 2018 4:01 pm

Thorsten wrote in Sat Sep 15, 2018 5:48 pm:The launcher thing is probably easy - one of you can have a go at it - look closely at everything that calls set_tile() - probably the call is duplicated when the property set by the launcher changes to true in-sim.



This is the code in the launcher:

Code: Select all
onApply: {
                    // important that we always set a value here, to override
                    // the auto-saved value in FlightGear. Otherwise we get
                    // confusing behaviour when the user toggles the setting
                    // inside the sim
                    _config.setProperty("/nasal/local_weather/enabled", advancedWeather.checked);

                    // Thorsten R advises that these are also needed for AW to startup
                    // correctly.
                    if (advancedWeather.checked) {
                        _config.setProperty("/sim/gui/dialogs/metar/mode/global-weather", !advancedWeather.checked);
                        _config.setProperty("/sim/gui/dialogs/metar/mode/local-weather", advancedWeather.checked);
                        _config.setProperty("/sim/gui/dialogs/metar/mode/manual-weather", advancedWeather.checked);
                    }

                    var index = weatherScenario.selectedIndex;

                    // set description from the weather scenarios, so Local-weather
                    // can run the appropriate simulation
                    if (fetchMetar.checked) {
                        if (advancedWeather.checked) {
                            _config.setProperty("/local-weather/tmp/tile-management", "METAR");
                            _config.setProperty("/local-weather/tmp/tile-type", "live");
                        }
                    } else {
                        if (weatherScenario.isCustomMETAR) {
                            _config.setArg("metar", customMETAR.value)
                        } else {
                            _config.setArg("metar", _weatherScenarios.metarForItem(index))
                        }

                        // either way, set the scenario name since Local-Weather keys off
                        // this to know what to do with the scenario + metar data
                        _config.setProperty("/environment/weather-scenario",
                                            _weatherScenarios.nameForItem(index))

                        if (advancedWeather.checked) {
                            // set AW tile options
                            var s = _weatherScenarios.localWeatherData(index);
                            if (s.length === 0) {
                                console.warn("Weather scenario " + _weatherScenarios.nameForItem(index)
                                             + " does not specify local weather data");
                            } else {
                                _config.setProperty("/local-weather/tmp/tile-management", s[0]);
                                _config.setProperty("/local-weather/tmp/tile-type", s[1]);
                            }
                        } // of using Advanced (local) weather
                    } // of not using real-wxr
                }



The apply button of the dialog calls this:

Code: Select all
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");

          # General weather settings based on scenario
          if (manual_weather_enabled == 1) {
            setprop( "/environment/params/metar-updates-environment", 0 );
            setprop( "/environment/realwx/enabled", 0 );
            setprop( "/environment/config/enabled", 1 );
            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" );
            setprop("/environment/weather-scenario", scenarioName);
          } else {
            setprop( "/environment/params/metar-updates-environment", 1 );
            setprop( "/environment/realwx/enabled", 0 );
            setprop( "/environment/config/enabled", 1 );
            metar = getprop( me.base ~ "/metar-string" );
            setprop("/environment/weather-scenario", scenarioName);
          }

          if( metar != nil ) {
            setprop( "environment/metar/data", normalize_string(metar) );
          }

          # Clear any local weather that might be running
          if (getprop("/nasal/local_weather/loaded")) local_weather.clear_all();
          setprop("/nasal/local_weather/enabled", "false");

          if (local_weather_enabled) {
            # If Local Weather is enabled, re-initialize with updated
            # initial tile and tile selection.
            setprop("/nasal/local_weather/enabled", "true");

            # Re-initialize local weather.
            settimer( func {local_weather.set_tile();}, 0.2);
          }
        },


The bug should be somewhere in there. Possibly in
Code: Select all
# Re-initialize local weather.
            settimer( func {local_weather.set_tile();}, 0.2); i
in dialogs/weather.xml?
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Previous

Return to Weather

Who is online

Users browsing this forum: No registered users and 2 guests