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 ...
The problem was using FLT_MAX, FLT_MAX to disable a model; this tricked OSG into thinking that FLT_MAX was a valid range and therefore didn't do the update traversal (found by Stuart).
The correct technique to disable a model is to set the min/max range to 0,0
Also generally improved the way that the ranges are managed.
Maps foo=bar arguments to the top-level arguments dictionary of the
command, as strings only. (We could add CMake style foo:type=bar in
the future if needed). Very basic but this enables a bunch of useful
cases, since SGPropertyNode will do value conversion from string on
access.
- avoid updating the formatted frequencies each update()
- reset the station search timer when frequencies change
This should make the radio a bit more responsive (which aids testing
since we don’t need to wait for the search timeout when changing
frequencies)
- pass texture cache control properties to simgear
- /sim/rendering/texture-cache/cache-enabled
- /sim/rendering/texture-cache/compress-transparent
- /sim/rendering/texture-cache/compress-solid
- /sim/rendering/texture-cache/compress
- support --texture-cache-dir command line option
- set max reported supported texture size during splashscreen.
If a model is marked as <usage>interior</usage> there were a number of problems.
1 - the LOD setting AI/MP interior used the distance from the aircraft; this obviously doesn't quite work for when using the model view.
2 - with the way that models are now loaded as two LOD levels only the interior from the first model loaded (usually the lowest detail) would be considered or processed because the model loader had marked itself as already run (which it had, but not for the model that was actually just loaded.
(2) above could also be the cause of other things not working because the nasal model loaded would not be called, nor would the sound path be setup. There could be other things that aren't working properly because the assumption is that there is just one model.
The fix for (1) is to use the standard OSG PagedLOD and let it handle the details, so I've changed the interior to use this and removed the distane from ownship checks.
The fix for (2) is to use a map to decide if the model that has just finished loading has already been processed, and if not then proceed as normal.
Change the single model case to always set the range on the only model rather than the constant modelHighDetail. This is a regressions caused by the change from 0 to modelHighDetail and the reordering the list. When there is only one model the setRange must always refer to model range index 0.
- This could have caused models to not display correctly.
The feature fail_hardover of the <actuator> component was not giving the correct output in some occurences when clipmax was smaller in absolute value than clipmin.
Tables CORNERING_COEFF could not be used for BOGEY contact points.
No longer throw an exception when the `internal` keyword of a table is ignored.
The location where errors have been found are now reported.
Rework the LOD ranges.
1. The scenery ranges are now deltas (avoids overlapping values)
2. The AI/MP pixel mode now has a default radius that is 20 for Aircraft, 200 for ships, 350 for carriers. This is a simple constant in a virtual function.
3. Added the ability to set the AI/MP ranges equal which means use the low detail model.
4. Changed high detail only to be indicated by a -ve number in maxRangeDetail
5. Re-ordered the range list to go from lowest detail at [0] to highest detail at the end. This is because OSG always loads the models starting from zero on the assumption that the detail increases with the index.
This fixes the pixel mode, which previously would use the radius of the parent which would be confusingly large, and unrelated to the actual size of the model. With the simple defaults that we have the pixel values set in the ranges won't exactly match the rendered size of the model on screen, but it will be a lot closer and more importantly meaningful.
The following new features have been added to JSBSim:
* Added the ability to set up the starter and acceleration times of a turbine (parameters <n1spinup>, <n2spinup>, <n1startrate>, <n2startrate>).
* The <integrator> filter can now be reset to 0.0 by setting its <trigger> property to a negative value.
* The integration scheme of the <integrator> filter can now be chosen among "rect" (Euler), "trap" (Trapezoidal), "ab2" 2nd order Adams-BashForth and "ab3" 3rd order Adams-Bashforth
* The following functions can now be used in <function>: floor, ceil and fmod. Their functionalities are the same than the corresponding C/C++ functions.
The following bugs are fixed by this commit:
* PID integration with the 3rd order Adams-Bashforth was inccorect.
* The fail_stuck property of sensors (accelerometers, magnetometers, gyro, etc.) without a <lag> element was setting the output to zero instead of sticking to the last output value. Thanks to Jonathan Redpath (aka legoboyvdlp) for the bug report.
* When a sensor was stuck, the drift, gain, bias and quantization of the last output before being stuck were ignored. Thanks to Dennis J. Linse for the bug report.
Due to how the popup menu was refresh, using MP servers at index 0 or 1
didn’t work correctly. Change some logic and add a helper to make this
work reliably, without a second Repeater and dummy properties.
Expand the range of filtering options on axis values to include the
optional use of an interpolation table, which gives many more options
when dealing with some devices.
When the lat-lon of a waypoint disagrees with the discovered ident by
more than a threshold, assume we have a DB mismatch, and just revert
to a basic wpt specified by lat-lon. This avoids inserting huge
legs by selecting a very distant navaid with matching ident
https://sourceforge.net/p/flightgear/codetickets/1814/
* Disables dew point transmission as the humidity model is not handling the case where the vapor saturation pressure gets higher than the ambient pressure.
* Removed computations for temperatures at very high altitudes as they don't match with the rest of JSBSim atmosphere model.
Use an internal window (instead of a real OS window) for popup choices,
and cap the maximum size. Use a scrollbar when the number of items is
too large, and adjust the position to fit in the window.
If the thumbnail is less than 172px wide, centre in the available
space. This ensures consistent alignment of the main content (name
and aircraft description)
- Fixed the Calibrated Air Speed (CAS) computations for supersonic velocities
- Fixed the Nlf (Normal load factor) sign
- Nlf can now be specified as an initial condition via the property ic/targetNlf
- Added blocking sockets to the input features
- Added a property to piston engines to get the AFR (Air to Fuel Ratio)
- Added conversion from m/s to ft/s
- Restored the initial conditions for engines running (-1 means all engines)
These are the time statistics that are the simulation code, which is basically everything except the rendering.
For a while I've wondered how efficient each of my JSBSim models are, and how much of our valuable frame time is spent on simulation modules.
Ideally the simulation modules should be taking 2-3ms, anything longer indicates a need to consider optimising things more.
These are the new properties that are added by this change:
/sim/rendering/sim-frame-count Number of frames since start (or last time
/sim/rendering/sim-frame-count-reset Reset statistics. Can be useful to reset monitoring after a slow startup
/sim/rendering/sim-host-avg-ms Average amount of time spent in the "simulation" rather than rendering. This attempts to take into consideration the
frame rate throttling but when throttled this figure is less reliable.
/sim/rendering/sim-host-total-ms Total milliseconds since reset
/sim/time/frame-wait-ms Current frame wait to meet throttling rate.