Board index FlightGear Development Weather

METAR does not update wind direction  Topic is solved

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

Re: METAR does not update wind direction

Postby dom_vc10 » Fri Aug 26, 2022 9:12 pm

Thanks all. I wanted to add earlier that maybe it would be better if it changed when you selected to use METARS however you all jumped onto it to do that. Really appreciate the efforts! :-)

Thorsten wrote in Fri Aug 26, 2022 12:04 pm:
The 'constant' setting is on by default



Wait - now I think I know what happens. You never actually select METAR mode in the UI in-sim, right? You probably pre-select it in the launcher, which is why the old 'we'll set this convenient for you' behavior doesn't apply and the in-sim UI thinks you consciously selected 'constant' as wind model....


Yep set in the launcher
Last edited by dom_vc10 on Fri Aug 26, 2022 10:15 pm, edited 1 time in total.
dom_vc10
 
Posts: 339
Joined: Mon Jul 27, 2020 8:33 am
Location: CZ - LKTB
Version: nightly
OS: Linux Mint 20.2

Re: METAR does not update wind direction

Postby MariuszXC » Fri Aug 26, 2022 10:02 pm

TheEagle wrote in Fri Aug 26, 2022 8:58 pm:I can confirm that my suggested change works as expected - in my autosave.xml file I have the wind model still set to constant, yet with the below change it gets automatically set to aloft waypoints when the Live METAR weather scenario is selected in the launcher.

Great.
And how will it behave in some of our MP use cases, where we disable live METAR fetch, but supply a predefined METAR (like we did with glider soaring)?
I think it shouldn't matter, as a single predefined METAR is equivalent to constant wind (I think), but do others think the same?

I'll add some code to address the command-line users, too ! :wink:

So the knowledge what to modify will end up built into two different places? I guess it is OK, if there is no other way, but it will be twice the maintenence (code wise).

I tested the patch @cgdae posted and it seems to work. I'll spend some more time testing with different scenarios.
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: METAR does not update wind direction

Postby TheEagle » Fri Aug 26, 2022 11:03 pm

MariuszXC wrote in Fri Aug 26, 2022 10:02 pm:And how will it behave in some of our MP use cases, where we disable live METAR fetch, but supply a predefined METAR (like we did with glider soaring)?

I thought the same, so I added another line to have the wind model set to constant in tile when live weather is disabled - tell me what you think about it, maybe constant would be the better choice ?

MariuszXC wrote in Fri Aug 26, 2022 10:02 pm:So the knowledge what to modify will end up built into two different places? I guess it is OK, if there is no other way, but it will be twice the maintenence (code wise).

Yeah, it's not ideal but almost unavoidable the way FGLauncher and the command line option parsing is currently organized ! :|

Here's the updated patch:
Code: Select all
diff --git a/src/GUI/qml/Environment.qml b/src/GUI/qml/Environment.qml
index 0d778a464..d56ea4cc9 100644
--- a/src/GUI/qml/Environment.qml
+++ b/src/GUI/qml/Environment.qml
@@ -184,8 +184,10 @@ Item {
                         if (advancedWeather.checked) {
                             _config.setProperty("/local-weather/tmp/tile-management", "METAR");
                             _config.setProperty("/local-weather/tmp/tile-type", "live");
+                            _config.setProperty("/local-weather/config/wind-model", "aloft waypoints");
                         }
                     } else {
+                        _config.setProperty("/local-weather/config/wind-model", "constant in tile");
                         if (weatherScenario.isCustomMETAR) {
                             if (customMETAR.isMETARValid && (customMETAR.value != "")) {
                                 _config.setArg("metar", customMETAR.value)
diff --git a/src/Main/options.cxx b/src/Main/options.cxx
index 8e5de40cb..672d44aeb 100644
--- a/src/Main/options.cxx
+++ b/src/Main/options.cxx
@@ -1231,6 +1231,23 @@ fgOptMetar(const char *arg)
 
     return FG_OPTIONS_OK;
 }
+
+static int
+fgOptDisableRealWeatherFetch(const char *arg)
+{
+    fgSetString("/local-weather/config/wind-model", "constant in tile");
+    fgSetBool("/environment/realwx/enabled", false);
+    return FG_OPTIONS_OK;
+}
+
+static int
+fgOptEnableRealWeatherFetch(const char *arg)
+{
+    fgSetString("/local-weather/config/wind-model", "aloft waypoints");
+    fgSetBool("/environment/realwx/enabled", true);
+    return FG_OPTIONS_OK;
+}
+
 static int
 fgOptConsole(const char *arg)
 {
@@ -1815,8 +1832,8 @@ struct OptionDesc {
     {"enable-random-vegetation",     false, OPTION_BOOL,   "/sim/rendering/random-vegetation", true, "", 0 },
     {"disable-random-buildings",     false, OPTION_BOOL,   "/sim/rendering/random-buildings", false, "", 0 },
     {"enable-random-buildings",      false, OPTION_BOOL,   "/sim/rendering/random-buildings", true, "", 0 },
-    {"disable-real-weather-fetch",   false, OPTION_BOOL,   "/environment/realwx/enabled", false, "", 0 },
-    {"enable-real-weather-fetch",    false, OPTION_BOOL,   "/environment/realwx/enabled", true,  "", 0 },
+    {"disable-real-weather-fetch",   false, OPTION_FUNC,   "", false, "", fgOptDisableRealWeatherFetch },
+    {"enable-real-weather-fetch",    false, OPTION_FUNC,   "", false,  "", fgOptEnableRealWeatherFetch },
     {"metar",                        true,  OPTION_FUNC,   "", false, "", fgOptMetar },
     {"disable-ai-models",            false, OPTION_BOOL,   "/sim/ai/enabled", false, "", 0 },
     {"enable-ai-models",             false, OPTION_BOOL,   "/sim/ai/enabled", true, "", 0 },

Compilation, linking and installation went fine, I'll leave the testing of the new command line behaviour to you, but I'm 99% sure it works as it should ! :)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3413
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: METAR does not update wind direction

Postby Thorsten » Sat Aug 27, 2022 6:02 am

Conceptually I think we'd like the following:

* for a pristine FG install from scratch, the default should be 'aloft waypoints' (that works well in METAR and offline weather usage and gives you what you'd expect - winds changing in altitude and position)

* if the user ever modifies the wind model, let's assume he has reasons to do it. For instance for FDM testing purposes or ridge lift soaring, 'constant' or 'aloft interpolated' might be a reasonable option - so when the user has modified it, keep it for the next session

* however, if the user selects live METAR that's usually not testing, so then switch it back to 'aloft waypoints' - if the user wants something different, he can still select it in-sim in the detailed weather GUI

* if the user enters a METAR and does not use live weather, chances are you are dealing with a power user who knows what he's doing (at least he can compose a valid METAR string...) - and go with whatever setting is in memory

I believe this should strike a reasonable balance between running 'out of the box' for casual users while not being too annoying for power users - I understand that a first- timer will have some trouble figuring out what the setting ought to be, but once you specifically use the config dialog for setting up something, you should be completely in control and not have to deal with implicit dependencies or changes.

Always consider that the casual user will typically use the launcher to set up weather, while the power user will use the more detailed in-sim UI.

(To be clear - I would make that change of wind model rather at the time the user actively selects 'live weather' - and not every time the system finds live weather selected at startup)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: METAR does not update wind direction

Postby TheEagle » Sat Aug 27, 2022 11:00 am

In that case, remove the lines:
Code: Select all
_config.setProperty("/local-weather/config/wind-model", "constant in tile");

and
Code: Select all
fgSetString("/local-weather/config/wind-model", "constant in tile");

from the diff, and you'll get exactly what you described, Thorsten, if you also apply cgdae's FGData patch.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3413
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: METAR does not update wind direction

Postby Thorsten » Sat Aug 27, 2022 6:01 pm

I can't apply patches because I have no up-to-date repository (I said so earlier). So that's not a request for my benefit but advice for making a merge request. :D
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: METAR does not update wind direction

Postby TheEagle » Sat Aug 27, 2022 10:24 pm

"you" was not referring to you, @Thorsten, (except for in "as you described, Thorsten"), but rather "anyone interested in testing the patch and / or committing it to SF" ! :wink: Sorry for not being clear enought.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3413
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: METAR does not update wind direction

Postby Hooray » Tue Sep 06, 2022 4:14 pm

Thorsten wrote in Fri Aug 26, 2022 6:15 am:
You wrote a complicated piece of simulation, with many options. However there is no weather related help anywhere in sim.


Well, let's say that the UI design is something that was hotly discussed and then a compromise found - it is not how I would have structured it, and indeed at one point a few years ago I planned to create a modern canvas UI with things like tooltips when I was told that canvas UIs are discouraged...


Speaking in general, it should be trivial to add an arbitrary tag with context related help to each PUI widget - e.g. something like <tooltip>Hello world</tooltip> - these could in turn be processed from Nasal space - and given that the new UI system is currently being developed using Nasal and Canvas, adding custom tags for such "meta information" is cheap and doable - the Nasal side of things would then simply set up a custom tooltip for each widget's "mouseover" event, i.e. in a corresponding for-each loop.

So if there is anything that people would consider useful/helpful or necessary, please make suggestions and share them here - adding a <tooltip></tooltip> to each PUI widget is free of charge, and can then be processed rather easily from scripting space. Localization is another matter however, because as far as I remember, the underlying APIs are not currently exposed to scripting space, so there really is no way to access that stuff, short of re-doing it in scripting/XML space - e.g. by using a Nasal hash with English descriptions as fallback, whenever a localized help string cannot be found.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: METAR does not update wind direction

Postby MariuszXC » Tue Sep 06, 2022 5:32 pm

In recent fgdata there is a small modification to weather dialog, with additional 'Weather help' button.
It tries to open local help file, as it is always present and does not require Internet connectivity. However, it may not always work, due to browser security features. For example, it does not work for me (using Firefox 104.0.1 (64-bit) Snap for Ubuntu), even though all file and directory permissions are u,g=rx but I can open the same file using file:// url and a lynx text mode browser..

Would like to know what others experience is re this button..
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: METAR does not update wind direction

Postby polly » Tue Sep 06, 2022 5:54 pm

The Help opened OK for me: Firefox (dnf'ed) Fedora 35. I don't see a METAR string though, I didn't notice 'N/A' moments ago before I checked out next branch.
Do you suppose it's Snap's fault ?

Edit Hmm, the METAR string shows fine for release/2020.3 build, not for next, so
there's another issue along with the Help file permissions.
PPS Never mind about the METAR string, third time's a charm and METAR re-appeared after building next a second time.
User avatar
polly
 
Posts: 956
Joined: Thu Nov 04, 2010 3:45 pm

Re: METAR does not update wind direction

Postby Hooray » Thu Sep 08, 2022 4:33 pm

We should have everything we need to display such help in-sum.
We could either display plain text help or use a Nasal loop to strip off HTML tags and use markdown markup in-sim

Even though, hrefs should come in handy and should be doable too in Nasal space, we can even display images that way.

As a matter of fact, if you want to be up and running, just convert the help file to Svg and load that into a dialog with a scroll area - that should work as is, because we can already process Svg.

Extending the parser to support more of HTML is also straightforward
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: METAR does not update wind direction

Postby MariuszXC » Fri Sep 09, 2022 9:59 pm

cgdae wrote in Fri Aug 26, 2022 6:00 pm:Would this fgdata patch fix both launcher and command-line usage?

Code: Select all
...
-    <wind-model type="string" userarchive="y">constant</wind-model>
+    <wind-model type="string" userarchive="y">aloft waypoints</wind-model>
...


In the meantime I did some more testing and did not observe any side effects, so if this change could be applied it would be perfect.

Marius
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: METAR does not update wind direction

Postby eatdirt » Sun Jan 22, 2023 2:45 pm

Hi there,
I've added a comment on the ticket:

https://sourceforge.net/p/flightgear/codetickets/2754/

With live weather + default settings, there is a bug when entering the atmosphere from space, we get a huge wind kick that creates very hard to damp oscillations. This was not present on 2018. I cannot tell if this is when crossing tiles or when entering the highest aloft wind (which are not set in the AWS menu).

Cheers.
eatdirt
 
Posts: 1012
Joined: Wed Aug 15, 2018 3:06 pm

Re: METAR does not update wind direction

Postby david.megginson » Sun Jan 22, 2023 3:19 pm

eatdirt wrote in Sun Jan 22, 2023 2:45 pm:Hi there,
I've added a comment on the ticket:

https://sourceforge.net/p/flightgear/codetickets/2754/

With live weather + default settings, there is a bug when entering the atmosphere from space, we get a huge wind kick that creates very hard to damp oscillations. This was not present on 2018. I cannot tell if this is when crossing tiles or when entering the highest aloft wind (which are not set in the AWS menu).

Cheers.

Are those worse than the actual windshear you'd expect at the tropopause?

https://www.aviationweather.ws/076_The_Tropopause.php
David MEGGINSON (he/him)
I need more tea.
Scenery: FlightGear Americas Scenery
Fediverse: @david_megginson@mstdn.ca
User avatar
david.megginson
 
Posts: 602
Joined: Sat Dec 10, 2016 8:25 pm
Location: CYRO (Ottawa, Canada)
Pronouns: he/him
Version: next
OS: Linux Ubuntu

Re: METAR does not update wind direction

Postby eatdirt » Mon Jan 23, 2023 10:28 pm

For the wind kicks, I've found the culprit: https://sourceforge.net/p/flightgear/fgdata/merge-requests/308/
eatdirt
 
Posts: 1012
Joined: Wed Aug 15, 2018 3:06 pm

Previous

Return to Weather

Who is online

Users browsing this forum: No registered users and 4 guests