|
From: James T. <ja...@fl...> - 2023-07-21 10:02:43
|
> On 20 Jul 2023, at 16:03, PlayeRom Roman Ludwicki <rom...@pl...> wrote: > > Nothing from me We need to do a bit of re-design on this: it’s going to cause issues to check specific non-C++ controlled properties inside _recalc_sl_temperature (check if local weather s on/off and the weather scenario name). We try to avoid using fgGetXYZ anywhere called more than once, and also we want to avoid making C++ code which breaks if Nasal is changed, which means we can’t read properties which are created by Nasal code to make simulation decision, usually. Instead I’d propose we add instead a flag property, something like ‘atmosphere/is-isa’, and Tie this in FGEnvironment::Tie, and then map it to an internal bool (eg, bool _isISA in FGEnvironment.hxx), via new methods get_is_isa_atmosphere / set_is_isa_atmosphere in FGEnvironment. Then your if() test in _recalc_sl_temperature simply becomes a check of that bool value to decide which temperature calculation to use, no more use of fgGetBool / fgGetString. For this this to work, we would then adjust the listener callback in weather_scenarios.nas to check the local-weather / scenario-name values and update the value of /environment/atmosphere/is-isa accordingly. Hopefully that all makes sense : let me know if anything is unclear or if you need assistance with it. Kind regards, James |