We set /environment/metar/description to human-readable description of metar,
for use by fgdata's weather dialogue, using simgear FGMetar's new description()
method.
Use a new SGPropertyNode flag, LISTENER_SAFE, to white-list properties
where we do correctly fire listeners, and test this flag when listening
from Nasal, to avoid the warning.
One test so far, attempting to reproduce a bug I see with the 737.
Note these tests are skipped unless you have procedures available
and set a magic env var to find them.
Ensure changes from Nasal are picked up by delegates (such as GPS) when
they are made. Add a route-manager test which sets and exits a hold
using Nasal.
As part of this, update the test API to make it easy to run Nasal from
a test.
The GPS/RNAV system can now fly holds, both left and right-handed.
The correct entry is selected, and hold count can be selected.
Also there's lots of lovely test cases.
Avoid screwing up the derived / trend data when we are repositioned;
detect instantaneous position changes and don’t update the trend
data in this case.
GPS now lets the delegate handle the sequencing behaviour, by
setting a new config property. The default GPS delegate (in Nasal)
now sets this property.
This requires a corresponding FGData update.
- set wp[1] properties immediately (don’t require an update cycle)
- direct-to course-error is correct when init-ing the Direct-To; it
was previously wrong when beginning the DTO, due to invalid course
between identical SGGeods.
FlowRegime to wing definitions). (Daniel)
//amended according to James hints: change initializer to float constants, fix indention issues, add Math::polynomial and use it in Surface. (Henning)
The existence of the property that is used for <table> independent vars is now checked during execution rather than when the XML definition is parsed. This relaxes the order in which filters, table and more generally flight controls need to be declared in the XML definition files.
E.g. fgaddon/Aircraft/Icaro_MRX13/Icaro_Laminar_13_MRX-set.xml sets
/sim/current-view/view-number to 9.
It seems that recent View changes broke this, but this fix is in unchanged
code.
Prior to the recent multiplayer view changes, /sim/current-view/?-offset-m
contained the current view's offsets from /sim/view[]/config/?-offset-m. The
multiplayer view changes modified things to set /sim/current-view/?-offset-m
to zeros, and instead use /sim/view[]/config/?-offset-m. This was so
that multiplayer views could be implemented simply by prefixing with
/ai/models/multiplayer[]/set/ to get the right offsets.
We still added in /sim/current-view/?-offset-m, but these were usually zero.
However some aircraft write to /sim/current-view/?-offset-m, and assume that
values must include the /sim/view[]/config/?-offset-m. E.g. the spaceshuttle
does this in order to simulate SRB shaking. This results in the offset being
included twice, which breaks things.
So this commit restores the original handling of /sim/current-view/?-offset-m
by doing an additional subtraction of /sim/view[]/config/?-offset-m. It also
avoids resetting /sim/current-view/?-offset-m to zeros when the view changes.
This results in views working for user aircraft, user aircraft that do custom
view handling, and multiplayer aircraft.
- [Backward compatibility breakage] Gyros are now measuring rotation rates instead of rotational accelerations. Gyros that measure rotational accelerations do not exist in the real world.
- Output properties of flight control elements are no longer tied. This saves a lot of spurious warning messages and allows direct references of the same properties among several flight controls.
- Water vapor in the atmosphere is now managed through its mass fraction rather than its partial pressure. The former being the physical quantity that is conserved when pressure and temperature vary.
- Check that there are at least 3 contacts before trying to trim on ground.
- ECEF to ECI frame conversion has been moved from FGLocation to FGPropagate and FGInitialConditions since not all FGLocation need to manage that.
- Gravity computations have been moved to FGInertial because it is where all the constants to compute gravity are stored. This reduces the amount of data transmitted between FGInertial and FGAccelerations.
- Added optional transmission of the simulation time for FG UDP interface
- Code cleanup and use more C++11 idioms (override, constexpr, range-based for loop, etc.)
We now keep the aircraft in view when zooming, sacrificing the view of the
ground. I.e. we move the bottom of the view upwards, while keeping the top of
the view unchanged.
Recent changes to ViewPropertyEvaluator mean that
ViewPropertyEvaluator::getDoubleValue() doesn't handle default values very
well, so we were ending up with chase-distance of zero, not the default -25,
leading to over-zooming.
Un-caching of scenery appears to happen fairly often, and means that we fail
to find height of ground under aircraft, so we now go back to the last found
value instead of using zero.
This allows Tower View etc to use nearest tower when vewing remote multiplayer
aircraft.
Also force an update of nearest airport whenever multiplayer view changes, to
reduce delay before Tower View works.
SGVec3d's default constructor leaves the fields uninitialised, which seems to
sometimes break fg with lots of NaN-related diagnostics.
The fix is to use SGVec3d::zeros() instead.
Also call resetOffsetsAndFOV() from the View::View() constructor, to ensure
that things are set up consistently.
View 8 used to be new Tower View AGL view, but this interfered with hard-coded
aircraft view numbers. So fgdata now has removed Model View, meaning Tower
View AGL uses Model View's old number (7), which keeps sequential view numbers
unchanged.
src/MultiPlayer/multiplaymgr.cxx
src/MultiPlayer/multiplaymgr.hxx
removed starts_with() and ends_with() - already provided in simgear::.
removed output() fn for SGPropertyNode, as unused.
added makeStringPropertyNameSafe().
FGMultiplayMgr::addMultiplayer(): use std::find_if() to find model file.
added FGMultiplayMgr::subsystemName().
src/Viewer/view.cxx
src/Viewer/view.hxx
removed getDoubleValue() as not required.
moved agl code into new View::handleAGL() fn.
renamed View::Damping::setGet() => View::Damping::updateTarget().
Currently this works for all the default views except for Tower Look From (for
which it doesn't really make sense) and Fly-by View.
We now search for and load a -set.xml that matches the model .xml,
when new multiplayer aircraft is set up. This allows us to find view
offsets etc, e.g. allowing cockpit and helicopter views to work with
multiplayer aircraft. Properties from the -set.xml are placed into
/ai/models/multiplayer[]/set, so for example viewing offsets are in
/ai/models/multiplayer[]/set/sim/view[]/config/target-{x,y,z}-offset-m. We also
copy the aircraft's chase-distance into the view config params, similar to how
fgdata:defaults.xml does for the user's aircraft. And we also fill in views'
missing offsets from the Helicopter View config; e.g. this enables the new
Tower View AGL to show aircraft correctly centred, despite aircraft currently
not having this view defined in their -set.xml. [We don't currently attempt to
cache or reuse -set.xml data.]
Have ensured that view position responds to mouse movement in the same way for
viewing the user's aircraft as for multiplayer aircraft (previously, Model View
reversed the affect of vertical mouse movements).
Added new Tower AGL view. Behaves similarly to Tower view, but automatically
scales and pans vertically in order to always show the vertical range
extending from just above the aircraft down to the ground immediately below
the aircraft. We use aircrafts chase-distance as an indication of size. We
damp the ground level value to reduce the viewing jumping around too much
e.g. if the aircraft flies over buildings. The amount of damping is set by
fgdata:defaults.xml's lookat-agl-damping value.
Fixed problem where Tower View eye position moves slightly as target
aircraft heading changes. This was caused by us unnecessarily applying the
aircraft-centre correction to the eye position.
src/FDM/flight.cxx: also make /orientation/true-heading-deg. This allows
local orientation to be used like multiplayer orientation, which only
has /ai/models/multiplayer[]/orientation/true-heading-deg. [A better fix
might be to replace all occurrencies of /orientation/true-heading-deg with
/orientation/heading-deg, but this would be a rather large commit.]
Details:
src/Viewer/view.*: removed View::updateData() as is no longer required.
src/MultiPlayer/multiplaymgr.cxx: use helicopter view target offsets as
defaults. E.g. in tower view agl, aircraft won't currently be defining these
offsets. More generally, this allows aircraft to define target offsets only in
helicoter view.
src/FDM/flight.cxx
FGMultiplayMgr::FillMsgHdr(): Added tie of /orientation/true-heading-deg to
get_Psi_deg, so it duplictes the existing /orientation/heading-deg.
src/MultiPlayer/multiplaymgr.cxx
src/MultiPlayer/multiplaymgr.hxx
FGMultiplayMgr::addMultiplayer(): look for and load -set.xml that matches
the model. Patch various view-related things up in similar way to what we
do for the user's aircraft, so that multiplayer views work.
Made FGMultiplayMgr::getMultiplayer() public, so it can be used by
src/Viewer/view.cxx.
src/Viewer/view.cxx
src/Viewer/view.hxx
View::View(): Added lookat_agl, lookat_agl_damping params for new Tower
View AGL. Preserve user's field-of-view in separate variable so that Tower
View AGL can modify the actual field of view independently.
Added view_index param so that we can find multiplayer view[]/config/
properties.
getViewOffsets(): new fn that finds view offsets for user aircraft or
multiplayer aircraft.
View::recalcLookFrom() View::recalcLookAt: Lots of changes to allow things
to work with multiplayer aircraft. View::recalcLookAt() can now do Tower
View AGL.
View::Damping: support for damping, used by Tower View AGL. Might be good
to use this for other damping.
View::updateData(): removed, as calculations are now all done inside
View::recalc*().
put properties {x,y,z}-offset-m into new View::_adjust_offset_m member
instead of _offset_m. This avoids confusion between a view's offsets and
the offsets added in by the user via the 'Adjust View Position' dialogue.
src/Viewer/viewmgr.cxx
FGViewMgr::init(): pass view number to
flightgear::View::createFromProperties().
The _name, get_name(), and set_name() variables and functions have been removed.
The Component::get_name() function is now handled by Subsystem::subsystemId(),
and Component::set_name() replaced by SGSubsystem::set_name(). The
Component::_name variable is replaced by SGSubsystem::_subsystemId.
This is a clean up commit prior to the subsystem API standardisation to simplify
the diffs. It includes all SGSubsystem and SGSubsystemGroup derived classes.
Revert this change - I will re-add the unit-tests again, but we need
a different approach for 8.3 stations, than what I did here.
This reverts commit 91cc83abb5.
In 8.3 mode, ensure that 25 and 75Khz channels can be tuned using the
abbreviated syntax (eg 118.02 for 118.025).
As part of this, add test coverage of the CommRadio for basic and 8.3-
mode operation.
Deal with some cases in STAR -> approach routing better:
- when the IAF is the initial wpt of the approach primary sequence,
just accept this instead of warning. This is common in some XML
files from Navigraph, for example EDDF
- don’t duplicate the IAF into the wpts returned by Approach::route
- when add-noise is false, mute noise completely
- if the CommRadio is not powered by the generic electrical system,
work by default (as was previously the case)
Using Emesary Global Transmitter the following events are notified
* Frame Begin
* Frame End
* Mainloop started
* Mainloop stopped
This integrates with the background threaded Nasal Garbage collection (simgear:nasal/cppbind/NasalEmesaryInterface.hxx) and is also controlled by the properties as follows
* /sim/nasal-gc-threaded (true) - use background threaded GC
* /sim/nasal-gc-threaded-wait (false) - at the start of the frame wait for the previous GC thread to complete.
I initially thought that the wait at the start of the frame would be necessary; however in 100 or so hours of flight without the await for completion at the start of frame no threading problems (or any other problems) were shown; so nasal-gc-threaded-wait is defaulted to false which gives a slight boost in performance.
So what this does is to it removes the GC pause of 10-20ms every 4 seconds (test using the F-15). This change doesn't really give much extra performance per frame because normally GC is only performed when needed.
Neither Torsten nor I can recall why we continued to hard-code this,
so make it dynamic for now. When we remember why we hard-code it,
we can add a BigComment from future-James to future-future-James about
why not to do this again :)
Due to e43fe82094 models in AI scenarios were
being searched down the AI/Aircraft and Aircraft paths, where in fact
they are by default a full path from FGDATA.
This fixes the problem by setting DATA_ONLY as the search order.
Other search orders can be set in the scenario file by setting
the search-order tag to "DATA_ONLY", "PREFER_AI", "PREFER_DATA"
Based on the dew point temperature supplied by FG, JSBSim updates the atmosphere density and computes all the usual parameters (RH, vapor pressure, saturated vapor pressure, etc.)
The mass fraction of water per unit of air mass is capped according to the record high from ISA 1976 standard atmosphere. As a consequence, at very high altitudes, air is always extremely dry (approx. 30 ppm i.e. 30 parts per million) whatever the conditions at sea level.
Fix for https://sourceforge.net/p/flightgear/codetickets/2125/
Previously, selecting a non-pushback parking position from the l
auncher that did not have a ground network resulted in the
aircraft being placed in the center of the airport.
This resolves the problem by creating a default segment simply
moving forward 2m.
Since PLIBjs uses joyGetDevCaps()[1] on Windows and this function
accepts joystick ids from 0 to 15 (-1 being special), setting
MAX_JOYSTICKS to 16 ensures that FGJoystickInput::init() can scan all
joysticks that joyGetDevCaps() is able to report about.
[1] https://docs.microsoft.com/en-us/previous-versions/dd757105(v%3Dvs.85)
JSBSim was not checking the tag names inside <test> and <condition> statements and this has led to abusive use of tags unsupported by JSBSim such as <and> and <or>. The problem is that JSBSim was not interpreting the <or> statement as the user meant it: JSBSim interpreted it as <test logic="AND"> while the user obviously meant <test logic="OR">. As a result JSBSim silently swallowed the tag and gave results which were not was the user expected without any obvious indication about what was going wrong.
As a result, this commit implements stricter syntax checking and rejects illegal tags within <test> and <condition> statements.
This commit also introduces stricter checking on XML elements which allow either a real value or a property name to be used. JSBSim now rejects the statements where the property name is specified inside a <property> statement. For example, the follwoing statement is rejected:
<clipto>
<min> <property> /fdm/jsbsim/some/property </property> </min>
...
The correct syntax being
<clipto>
<min> /fdm/jsbsim/some/property </min>
Base class handles some common instrument features, such as the
serviceable node and electrical supply. The electrical supply node
and minimum voltage to operate can now be set in the configuration
via <power-supply>/path/to/output/volts</> and <minimum-supply-volts>
On this code path, AppKit uses exit, rather than letting main run as
normal. We handle most things via C++ destructors, which do run, but
Qt is happier if we clean it up explicitly.
- Fixed the scripts end time computation
- Fixed nested tests in switches
- Simplifications to the computation of the aerodynamics angles alpha & beta
- Account for the contact transition in the gear compression speed
- Fixed docs in FGTank
- simgear::strutils::readNonNegativeInt<unsigned int>() is better than
std::stoul() at detecting and reporting erroneous input (for one, it
checks that the given string *represents* an integer that fits in the
specified type, as opposed to just "starts with digits").
- The format version is now an unsigned int (just because it's largely
enough and simgear::strutils::readNonNegativeInt<unsigned long, 10>()
isn't instantiated for now).
- The format version is now printed to the log (it was already for
apt.dat files, but not for nav.dat files).
Instead of doing an illegal memory access (to fields[0]), properly
report the problem when the line that is supposed to contain the format
version of a nav.dat file is empty.
- PTT will now use whatever channel is selected; non zero simply means PTT active.
- The volume as set in the comm[]/radio will now be used as a factor on the FGComm volume
PTT now uses an int channel number (0 means not pressed, 1 = comm radio 1 (index [0]),etc...)
/comm-radio-selected is the default comm channel to use. This should usually be the same as will be set by PTT into /controls/radios/comm-ptt
However PTT will switch the FG comm inbound and outbound frequency to whichever radio was PTT'd.
New properties also set in multi-player to indicate the transmission frequency and normalised power (currently just set to 1.0)
13001(int) : sim/multiplay/comm-transmit-frequency-hz
13002(short-norm) : sim/multiplay/comm-transmit-power-norm
- New system component linear_actuator from Adriano Bassignana.
- Bug fix of Euler angles computations in FGMatrix33 (a pure westward heading of 270 deg was erroneously converted to a pure eastward heading of 90 deg). This could make the aircraft trimming fail when spawning with a heading of 270 deg.
Problem seen with Nasal setChildren/setValues where names were not
being passed down the stack. Identified as over-zealous IF_DEF
to remove unused variable compiler which meant snprintf was not being called
for non debug builds (see c177aeb623)
Fix is to change assert() calls to an naRuntime error, which ensures
that the len variable is always used and is
more appropriate as buffer overrun could occur in any release build if
someone tried to set a name of >1024 characters.
Assuming this should have been ‘vertical-mode’ all along, since the
corresponding other mode property is called ‘lateral-mode’. Make an
alias to the old name to keep existing scripts working.
Enhancements suggested by Nikolai Verner-Christensen - support loading
scenarios from {FG_HOME}/Scenarios, {aircraft-dir}/Scenarios and
{add-on}/Scenarios.
Additionally, allow passing the path to a scenario file to
—ai-scenario, eg —ai-scenario=/home/jmt/FGFS/my-test-scenario.xml
When a scenario defines a carrier, and —carrier is used to request a
carrier start, we now auto-load the corresponding scenario, to give
a nicer user experience.
This will use the inherently unsafe versions of the load methods which can result in deleting an object (from the cache) that has just been loaded in the database thread.
Symptom OSG WARN deleting still referenced object.
branches next, origin/next
Format fgfs-YYYYMMDDHHMMSS[-#] where the # is for the rare case when there are multiple screenshots per second.
The change makes the filenames sortable based on date and slightly improves run time performance when there are a lot of screenshots in a particular directory
Adjust the special NavCache function used for airport search, to
allow filtering by type (which is exposed in an upcoming patch to the
dialog code).
Patch by Daniel Wickstrom
Properties /consumable/fuel/tank[*]/unusable-* supplied in the -set.xml file are propagated to the aircraft model and accounted for in the tanks management.
* <function> and <fcs_function> that are only applied on constant parameters are now recognized and replaced by their result during initialization.
* Fixed a regression which prevented the wheels rotation speed to slow down while the gears were retracted.
* Added the ability to control the turbine engines spin down factor (thanks to Jonathan Redpath for the pull request).
* Internals : JSBSim has been refactored to use FGPropertyValue in many FCS components. This will allow consistent behavior accross the FCS components including the ability to prepend property names with minus signs '-' to indicate that the opposite sign of the property should be used.
lag compensation, this is the time manager part.
- introduction of a pure steady clock initialised from system clock at init
- the mp protocol clock have an offset available (will be used
to sync the players, in case ntpd is not accurate or inavailable)
- got a way to see drift between system clock and the fg steady clock, mainly
to see how differents OS behave ...