1
0
Fork 0
Commit graph

10900 commits

Author SHA1 Message Date
Julian Smith
4f4a793f80 src/Environment/environment_mgr.cxx: update nearest tower more frequently.
Changed interval from 30s to 10s - it appears to take only around 0.1ms so this
seems ok and improves the user experience.

---------------------
2019-08-09 12:56:19 +01:00
Julian Smith
a89fbc40aa src/Viewer/view.*: avoid confusing zooming artifacts in Tower View AGL mode.
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.
2019-08-09 12:56:19 +01:00
Julian Smith
e3b3f40f0a src/Viewer/view.*: in Tower View etc, use tower nearest to the multiplayer aircraft. 2019-08-09 12:56:19 +01:00
Julian Smith
c2f542b085 src/Environment/environment_mgr.cxx: find nearest airport/tower to viewed multiplayer aircraft.
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.
2019-08-09 12:55:24 +01:00
Julian Smith
da5fe03851 src/Viewer/ViewPropertyEvaluator.*: added support for dumping info about a single spec. 2019-08-08 11:31:44 +01:00
Julian Smith
83e98653c7 src/Viewer/view.cxx: fix fly-by view offset.
Need to treat /sim/view[]/config/root="" as "/".
2019-08-08 11:30:30 +01:00
Julian Smith
3b77ca4ce8 src/Viewer/view.: removed some now-unused code. 2019-08-08 11:30:12 +01:00
Ferran Obón Santacana
a0f47c151c Fix shadowing of static variable in ITM adiff() function 2019-08-07 16:02:45 +02:00
Julian Smith
af538746ac src/Viewer/viewmgr.cxx:FGViewMgr::setView(): don't call update(0).
This fixes transient view corruption when view is changed (e.g. by v or V).
2019-08-05 07:33:26 +01:00
Julian Smith
92c934f410 src/Viewer/ViewPropertyEvaluator.*: fixed bug with non-existent property nodes.
The fix is to call globals->get_props()->getNode with create=true, so that we
get to hear about changes to property nodes that do not currently exist.
2019-08-05 07:33:26 +01:00
Julian Smith
f00cfeaa02 src/Viewer/view.cxx: use /sim/current-view/view-number-raw.
Requires latest fgdata, and fixes problem with non-sequential view numbers,
e.g. on 777.
2019-08-05 07:33:26 +01:00
Torsten Dreyer
ca2072bf74 silence a warning (initialization order) 2019-08-01 17:34:11 +02:00
Torsten Dreyer
2ba77f7f73 ints can't be NULL 2019-08-01 17:29:12 +02:00
Torsten Dreyer
d34bcf0422 whitespace formatting issues. No functional change 2019-08-01 17:26:43 +02:00
Scott Giese
f55d7c3c37 [ViewPropertyEvaluator] assert does not compile. 2019-07-29 10:31:33 -05:00
Richard Harrison
e8a50475ec Mutiplayer: increase log level for potential problems;
This is partly experimental to see how often these occur; but also errors in MP packets should be more visible to the developer.
2019-07-29 14:33:45 +02:00
Julian Smith
d71f8daa86 Revert "src/MultiPlayer/multiplaymgr.cxx: don't overwrite /sim/multiplay/visibility-range-nm if already set."
This reverts commit 4a067e721f.
2019-07-27 15:42:17 +01:00
Julian Smith
f770dc1c50 src/Viewer/viewmgr.cxx: FGViewMgr::unbind(): call new ViewPropertyEvaluator::clear().
Frees all ViewPropertyEvaluator's SGPropertyNode_ptr's.
2019-07-27 08:47:28 +01:00
Julian Smith
dfb94c6cc6 src/Viewer/view.*: use new ViewPropertyEvaluator system.
Allows recently-modified multiplayer View code to run without overheads.
2019-07-27 08:47:28 +01:00
Julian Smith
bf29e469b0 src/Viewer/ViewPropertyEvaluator.*: added ViewPropertyEvaluator system.
Evaluates and caches nested properties.
2019-07-27 08:47:17 +01:00
Julian Smith
e778848dcb src/Viewer/view.cxx: fixed breakage of /sim/current-view/internal.
Breakage was introduced by the Tower AGL / multiplayer view changes.
2019-07-26 18:59:59 +01:00
Bertrand Coconnier
2fe0137e92 [JSBSim] Fixed a actuator SEGFAULT when triggering "hardover" without specifying <clipto>. 2019-07-24 23:15:40 +02:00
Julian Smith
f666a551b3 src/Viewer/view.cxx: Fix bad initialisation of SGVec3d's.
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.
2019-07-22 14:05:54 +01:00
Julian Smith
9a67910899 src/MultiPlayer/multiplaymgr.cxx: don't create view 8.
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.
2019-07-20 22:04:35 +01:00
James Turner
ed0a009224 Merge /u/cgdae/flightgear/ branch next into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/166/
2019-07-18 20:21:36 +00:00
James Turner
f643100dad Avoid a warning when inserting nil into a FP
This avoids the warning when procedure construction fails, and we have
a nil result rather than an empty vector as the arg.
2019-07-15 14:37:29 +01:00
Julian Smith
5990ba92f8 src/MultiPlayer/multiplaymgr.cxx: use std::initializer_list instead of C array.
After review. This simplifies iterating.
2019-07-04 13:16:22 +01:00
Julian Smith
2888eb00de Various fixes to view/multiplayer code after review.
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().
2019-07-04 13:16:22 +01:00
Julian Smith
a0ee3a4cc4 src/Viewer/renderer_legacy.cxx: fixed compiler warning about initialisation ordering. 2019-07-04 13:16:22 +01:00
Julian Smith
4a067e721f src/MultiPlayer/multiplaymgr.cxx: don't overwrite /sim/multiplay/visibility-range-nm if already set.
This allows it to be set e.g. in ~/.fgfsrc with --prop.
2019-07-04 13:16:22 +01:00
Julian Smith
5772325bc6 Allow most default views to work on multiplayer aircraft as well as the user's aircraft.
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().
2019-07-04 13:16:22 +01:00
Edward d'Auvergne
34a6cb3c74 SGSubsystem classes: Registration of all subsystems. 2019-07-01 14:51:32 +02:00
Edward d'Auvergne
d259c70560 SGSubsystem classes: Addition of staticSubsystemClassId() to all subsystems. 2019-07-01 14:51:32 +02:00
Edward d'Auvergne
0eb8716d45 Autopilot components: Switch to using the subsystem name.
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.
2019-07-01 14:27:30 +02:00
Edward d'Auvergne
332c240b38 SGSubsystemGroup: Removal of the subsystem group naming.
This is a partial reversion of 5253215065, the
changes of which are incompatible with the subsystem class IDs.
2019-07-01 14:27:30 +02:00
Edward d'Auvergne
fb5c36fc82 SGSubsystem classes: Renaming of the subsystem ID variables and functions. 2019-07-01 14:27:30 +02:00
Edward d'Auvergne
7a6e63ddb9 SGSubsystem classes: Subsystem and subsystem group API declaration standardisation.
This is a cleanup commit.
2019-07-01 14:27:30 +02:00
Edward d'Auvergne
60a2444766 SGSubsystem classes: Whitespace standardisation of the declarations.
This is a clean up commit prior to the subsystem API standardisation to simplify
the diffs.  It includes all SGSubsystem and SGSubsystemGroup derived classes.
2019-07-01 14:27:28 +02:00
James Turner
8428cd2a44 Revert "CommRadio: fix tuning 25Khz and 75Khz channels"
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.
2019-07-01 06:29:05 +01:00
James Turner
91cc83abb5 CommRadio: fix tuning 25Khz and 75Khz channels
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.
2019-06-27 15:45:53 +01:00
James Turner
4905aa255c Arrival procedure routing fixes
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
2019-06-24 16:37:56 +01:00
Torsten Dreyer
0d8d2addcf Autopilot member initialization order (removes warning) 2019-06-17 11:57:55 +02:00
Scott Giese
efcbdcfec2 [security] Prevent buffer overrun. 2019-06-15 21:30:54 -05:00
Scott Giese
47e3e7baed [Emesary] Fix compile on Linux. 2019-06-14 21:45:11 -05:00
James Turner
cfae6d2c9f CommRadio: fix power and noise/squelch
- 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)
2019-06-11 23:26:51 +01:00
Richard Harrison
6ebc91d3f7 Added mainloop frame notifications
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.
2019-06-11 14:38:38 +02:00
Richard Harrison
8c4334e3ae Increase severity of warning when trying to add a setlistener onto a tied property
- before this it was all to easy to miss being at DEBUG level and this is quite an important problem to be aware of for model developers
2019-06-11 14:38:38 +02:00
James Turner
4f4166e540 Use the global ATC sample group for the CommRadio
Remove the custom sample-group, and use the standard one, for the
comm-radio ATIS voice and noise.
2019-06-06 10:03:40 +01:00
James Turner
1a3daf39a0 ATC volume and settings passed to the group
Note sure this is strictly the correct place to do this, but it’s
where we do it for avionics, so following for now.
2019-06-06 10:03:40 +01:00
James Turner
3c56e74d07 Httpd: Avoid console spam by WS ping/pong frames 2019-06-05 17:41:07 +01:00
James Turner
0bea6153b0 Event input: button fire repeat 2019-06-05 17:41:07 +01:00
James Turner
5ffe96237f Fix a warning 2019-06-05 17:41:07 +01:00
James Turner
309aaa794f Flite always compiled now. 2019-06-03 16:51:08 +01:00
James Turner
688f49b487 Convert comm-radio to AbstractInstrument 2019-06-03 15:24:02 +01:00
James Turner
aad582f2c3 MarkerBeacon uses AbstractInstrument 2019-06-03 14:32:38 +01:00
James Turner
a26c671200 Migrate transponder to AbstractInstrument 2019-06-03 13:49:48 +01:00
James Turner
ff009bc58f Remove ‘X Double-scroll’ workaround
Remove this since it’s causing some other issues, let’s see if it
really still an issue on different platforms.
2019-06-03 11:54:25 +01:00
Ganael Laplanche
66e6afb449 Avoid crashing when udev_device_get_parent() returns a NULL pointer 2019-05-29 12:06:07 +02:00
James Turner
bd2c524b21 HID input: more debug output 2019-05-27 16:06:27 +01:00
James Turner
d8b6fbfef0 macOS / DBus : avoid abort on startup
Don’t do the fgOSDisableScreensave DBus stuff on macOS - there is no
global DBus daemon configured by default.
2019-05-27 16:05:19 +01:00
James Turner
88a78dd314 Remove last hard-coded default airport ID
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 :)
2019-05-27 11:42:53 +01:00
James Turner
4ed410dc09 Adjust code for some older GCC versions
Implicit conversion from raw-pointer to std::unique_ptr<T> was failing,
use a stub replacement for std::make_unqiue to wrap this up cleanly.
2019-05-27 11:38:37 +01:00
James Turner
c6feaafe2a Merge /u/fgarlin/flightgear-src/ branch next into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/164/
2019-05-22 12:54:52 +00:00
Fernando García Liñán
fa4ef2ab52 Added a property to indicate compositor support 2019-05-20 23:44:16 +02:00
Fernando García Liñán
b9e3ed67f0 Compositor: Fixed intersection checking for hotspots 2019-05-20 22:53:16 +02:00
Erik Hofman
8e2b2ff327 Add cstring 2019-05-20 14:17:36 +02:00
James Turner
4915b7d3a5 Merge /u/dancliff/flightgear/ branch fix_for_AI_radius into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/163/
2019-05-18 15:41:28 +00:00
Dan Wickstrom
c6e91d8751 Check for valid value when updating AI lod radius. 2019-05-18 11:30:37 -04:00
James Turner
910bd2c0fd Fix for sub-model initial offsets
The offset in body coordinates is needed by the FGAIBallistic in some
cases, restore this.
2019-05-18 16:20:31 +01:00
Dan Wickstrom
35c24ce5d4 Update radius of AI model after model data is loaded - prevents rendering artifacts at near/far camera boundary. 2019-05-18 07:10:40 -04:00
James Turner
2266c27930 Merge /u/legoboyvdlp/flightgear-src/ branch tcasPatch into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/162/
2019-05-17 09:03:52 +00:00
legoboyvdlp R
ee4f4a1273 TCAS: adjust property names to correct format 2019-05-17 08:48:26 +01:00
James Turner
955138d06e Avoid a crash on HID devices with no name. 2019-05-16 11:11:19 +02:00
Stuart Buchanan
5f2f72a4eb Fix AI Scenarios
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"
2019-05-15 21:09:49 +01:00
legoboyvdlp R
16b178a2d9 TCAS Instrument: add configuration options 2019-05-14 19:03:26 +01:00
James Turner
f159b98224 Fix some warnings from procedures loader 2019-05-13 14:41:28 +01:00
Bertrand Coconnier
b486273e0b [JSBSim] Add Windmilling flag
The flag allows to disable the windmilling of Turbine engines.
2019-05-08 16:39:26 +02:00
Bertrand Coconnier
0635380708 Restored humidity simulation in atmosphere.
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.
2019-05-08 16:11:06 +02:00
Bertrand Coconnier
c934348513 Remove the MSIS and Mars atmosphere files since they are not used. 2019-05-08 15:04:31 +02:00
Richard Harrison
50d4b37a7d Nasal timestamp - add elapsed uSec 2019-05-07 05:16:37 +02:00
Stuart Buchanan
1d1096d6f7 All start from parking position with no ground net
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.
2019-05-04 17:43:33 +01:00
Richard Harrison
7db06300c0 Nasal binding for SGTimeStamp via maketimestamp
usage:

var timer = maketimestamp();

timer.stamp(); # start timing

print("elapsed ",timer.elapsedMSec(),"ms");
2019-05-02 07:31:37 +02:00
Lars Toenning
ff7db27cd1 swift: Add version number check 2019-04-30 10:35:30 +02:00
Lars Toenning
cea342a064 swift: Getting pressure altitude 2019-04-30 08:16:38 +02:00
Florent Rougon
9b019f6b72 FGJoystickInput: increase MAX_JOYSTICKS from 10 to 16
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)
2019-04-29 12:54:03 +02:00
Richard Harrison
9121079cfe Disable time easing if ctrl key pressed. 2019-04-28 19:40:26 +02:00
Richard Harrison
1399640d79 Use OSG to find out the maximum supported texture size
The DDS Texture cache will auto resize textures that are larger than this value.
2019-04-28 19:40:26 +02:00
Richard Harrison
d3ce7adc95 NasalTimers; ensure unique name as this is required to identify the timer for certain operations (e.g. stop) 2019-04-28 19:40:26 +02:00
Richard Harrison
d2a179f1f3 Multiplayer: do not transmit the transmission-frequency-hz 2019-04-28 19:40:26 +02:00
James Turner
bac5d6c713 Windows: read Unicode command line
One more step in full Unicode support.
2019-04-27 18:54:13 +01:00
James Turner
9d71d09072 Enable HID-input on Windows 2019-04-27 18:54:13 +01:00
Bertrand Coconnier
3539b13985 Stricter syntax checking for JSBSim.
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>
2019-04-27 12:29:22 +02:00
Lars Toenning
aaa753d169 swift: Fixed wrong startup message 2019-04-26 09:37:37 +02:00
Lars Toenning
21124e7b7e swift: CMake adjustment 2019-04-26 09:37:17 +02:00
James Turner
b83c069b0b Move power-btn and operable props into base class
AbstractInstrument now handles a generic power-btn and operable
property, and hence includes them in the serviceable-and-powered
check.
2019-04-25 17:11:50 +01:00
James Turner
40b96fef48 Convert ADF and (old) NavRadio to use new base class
This enables separate power-supply for each installation.
2019-04-25 17:11:50 +01:00
James Turner
9cd8ccae80 Merge /u/fgarlin/flightgear-src/ branch next into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/157/
2019-04-25 12:52:46 +00:00
Dan Wickstrom
1948304157 Fix problem where AI planes are placed on top of user aircraft when user either selects a specific spot or user selects parking to be an available spot. 2019-04-25 11:39:41 +01:00
James Turner
6261b71774 Add AbstractInstrument base class and convert DME
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>
2019-04-24 18:56:56 +01:00
Fernando García Liñán
e0507e9095 Fixed the aircraft showing on top of the splash screen when relocating/resetting 2019-04-23 13:21:19 +02:00
James Turner
b2bedfd485 Fix typo in submodels commit 2019-04-22 11:58:55 +01:00
James Turner
ea336af4dc Submodel offset supports pitch/yaw values
Reported by Stewart Andreason
2019-04-19 10:15:36 +01:00
James Turner
79562bcf31 Avoid crash on Cmd-Q exit of the app on macOS
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.
2019-04-17 22:53:10 +01:00
James Turner
e2ed179f4c Temporarily log out UI languages on launcher start
This is to help with diagnosing:
https://sourceforge.net/p/flightgear/codetickets/2121/
2019-04-17 15:11:23 +01:00
James Turner
4e8e69b4f8 Migrate invert-mouse-wheel setting from pre 2019.x
Flip the sense of this property, since the interpretation in SG is
also flipped now.
2019-04-11 20:40:17 +01:00
James Turner
4d562e2a90 Check existence of an OpenGL extension 2019-04-11 11:36:22 +01:00
Lars Toenning
85acefab95 Swift: initial support 2019-04-11 11:36:22 +01:00
Richard Harrison
8e1e6c8254 AI Traffic - better integration with terrasync.
- allow on demand update

new property traffic-manager/active indicating that AI Traffic is running
2019-04-07 09:00:01 +02:00
Stuart Buchanan
ff12994554 Execute load/unload Nasal for both detailed and AI
Previously only the first of a detailed/bare AI model tuple's Nasal
would be executed when the model is loaded.  This loads both.
2019-04-06 22:22:02 +01:00
Bertrand Coconnier
f011d5f567 JSBSim bug fixes
- 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
2019-04-06 23:09:36 +02:00
Florent Rougon
2720d9fd9f Minor improvements to loading of nav.dat files
- 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).
2019-03-28 07:44:59 +01:00
Florent Rougon
378999dd80 Improve parsing of apt.dat header
Properly report errors in the line that is supposed to contain the
format version of an apt.dat file.
2019-03-27 08:31:09 +01:00
Florent Rougon
8fbbf91270 Prevent a segfault when parsing malformed 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.
2019-03-27 07:57:24 +01:00
Richard Harrison
f014e8825d FGComm: added listener for comm volume
Without this listen volume only changed on comm retune / PTT release
2019-03-27 00:28:20 +01:00
James Turner
64eaf6fe03 Fix for route-path when leg 0 is not a runway
Avoid doing turn-computation for the first waypoint, even if it’s not
a runway. Add a unit-test to cover this case.

Reported by Josh Davidson
2019-03-26 22:50:46 +01:00
James Turner
7c2a5e9e99 FlightGear support for queued commands
This enables queued commands to be processed once per main event loop.
At present this is done after subsystem updates.
2019-03-24 17:59:23 +00:00
James Turner
6860627dea Tweaks to launcher diagrams, to debug parking clicks
Adding some info/qInfo log output, to try and diagnose missed clicks
reported by some users.
2019-03-23 14:46:03 +00:00
Richard Harrison
8db784bf17 FGcomm: PTT usage and volume
- 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
2019-03-21 17:56:59 +01:00
James Turner
669a80216d Launcher: fix aircraft switching on update
Remove some obsolete code which caused the current aircraft to get
switched unexpectedley when updating
2019-03-20 17:09:12 +00:00
Richard Harrison
b9dc64ab87 FGComm; logic change to disconnect comm when selected channel set to 0.
It will be reconnected if PTT is set; and not disconnected until selected channel is again set to 0.
2019-03-20 15:13:11 +01:00
Richard Harrison
b42969ae91 Add support for FGCom multiple radio support
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
2019-03-19 21:20:17 +01:00
Richard Harrison
a9761bb3ba Use simgear::strutils::replace instead of regex for compatibility. 2019-03-17 18:22:04 +01:00
Richard Harrison
c686f61817 Configurable METAR url
Use environment/realwx/metar-url if present; otherwise default to hardcoded value.

format: https://tgftp.nws.noaa.gov/data/observations/metar/stations/[station].TXT

i.e. [station] is replaced with the required station.
2019-03-17 00:45:31 +01:00
Richard Harrison
a81607049f Merge /u/fgarlin/flightgear-src/ branch next into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/153/
2019-03-07 15:23:30 +00:00
James Turner
d5ce11ce55 Merge /u/dancliff/flightgear/ branch launcher_addons_merge into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/151/
2019-03-04 15:20:44 +00:00
Dan Wickstrom
1e858767b1 Modifications to launcher to load Add-on modules and view related metadata. Each module can also be selectively enabled with a checkbox. Fixes also submitted by Florent Rougon. 2019-03-03 12:59:48 -05:00
James Turner
1183d282ae Avoid copying SGShared<FGTaxiNode> in ground-net
This makes some common iterations in the AI traffic code faster,
since there is no thrashing of the atomic operations.
2019-03-03 12:12:03 +00:00
James Turner
87f63c4cec Property list: show group id/name in verbose mode
Patch from Henning to simplify debugging canvas trees
2019-03-03 11:56:52 +00:00
James Turner
d80537eb2f Ensure the splash logo is a file, not a dir
Thanks to Richard Harrison for catching.
2019-03-03 11:39:04 +00:00
Richard Harrison
a95daa2a5a add command line options to enable and disable DDS Texture cache. 2019-03-01 19:06:42 +01:00
Fernando García Liñán
ed276141c7 Compositor: Removed the option to change the CameraGroup cull masks. Instead, the FGRenderer sets the view master camera cull mask, which may be inherited by any pass that needs it. 2019-02-23 23:36:07 +01:00
Richard Harrison
8e35b7efc7 OSG 3.4.0 compilation fixes. 2019-02-20 19:12:02 +01:00
Fernando García Liñán
bec41e7e17 Compositor: FG now gracefully quits if no valid Compositor has been found. Added a command line option (--compositor) to choose the default Compositor. 2019-02-20 03:09:17 +01:00
Richard Harrison
16dedfe78f Merge /u/fgarlin/flightgear-src/ branch next into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/149/
2019-02-19 07:29:05 +00:00
James Turner
c2fb01ccb7 Partial revert of METAR fix, now SimGear is fixed.
This reverts commit 2fdc24c109.
2019-02-17 19:03:19 +00:00
Richard Harrison
5253215065 Improvements to performance monitoring.
* Ensure that subsystems are named.
* Nasal timers are named appropriately
2019-02-10 18:07:07 +01:00
Bertrand Coconnier
f57d7329c2 Sync'ed JSBSim
- 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.
2019-02-10 10:25:56 +01:00
Stuart Buchanan
b166b523b2 Copy name into buffer on release builds
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.
2019-02-09 18:11:56 +00:00
Scott Giese
2fdc24c109 METAR fix 2019-02-07 01:26:05 -06:00
James Turner
df7988fb49 Fix NaNs in the VSI when pressure reading is invalid
Detect zero/very low pressure reading and avoid generating NaNs in the
main update code. Thanks to Johnathan Redpath for the report.
2019-02-06 20:48:18 +00:00
James Turner
dee1998979 Less Boost. 2019-02-06 17:36:36 +00:00
Torsten Dreyer
d1116b0e25 fix "error: use of ‘n’ before deduction of ‘auto’" 2019-02-06 09:45:45 +01:00
Torsten Dreyer
c177aeb623 Silence some warnings about unused variables.
No functional change
2019-02-06 09:41:08 +01:00
Scott Giese
edce380c7b Fix missing header for OSG macros.
Patch provided by Stewart Andreason.
2019-02-05 21:48:05 -06:00
Scott Giese
8fc59cbc49 Fix missing header files. 2019-02-05 00:24:12 -06:00
Scott Giese
7fd7c599a2 Fix missing header file for strutils 2019-02-04 23:49:02 -06:00
Fernando García Liñán
e042364dd0 Compositor framework initial commit. 2019-02-04 18:03:38 +01:00
James Turner
a9a49bc2e6 Unboosting files
Use simgear::strutils replacements in places, C++11 features in others
2019-02-04 15:20:22 +00:00
Torsten Dreyer
f6046836c0 Try fix windows build (missing includes) 2019-02-03 21:39:27 +01:00
Torsten Dreyer
5b379f904f METAR id needs to be uppercase not lowercase 2019-02-03 21:17:30 +01:00
Torsten Dreyer
9eeda7d339 unboost the environment 2019-02-03 19:32:57 +01:00
Torsten Dreyer
983227f18f remove usage of boost_foreach in realwx_ctrl.cxx 2019-02-03 15:11:45 +01:00
Torsten Dreyer
8a190f853f unboost the autopilot 2019-02-03 15:11:45 +01:00
James Turner
1e0e7f7ffa Rename {ai}/controls/flight/longitude-mode
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.
2019-02-03 13:38:51 +00:00
Torsten Dreyer
e23f0bc059 unboost commradio and newnavradio 2019-02-03 13:43:04 +01:00
James Turner
8c43b622e5 Launcher: fix handling carrier argument 2019-02-03 12:12:00 +00:00
James Turner
49c4dc5213 Scenarios from FG_HOME, aircraft and add-ons
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.
2019-02-03 12:12:00 +00:00
danw
1c4e146a43 Modifications to the Launcher to enable the management of Add-on modules 2019-02-02 15:46:09 -05:00
Richard Harrison
f05c0297c0 OSG < 3.4.x fixes
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
2019-01-26 18:20:52 +01:00
Richard Harrison
7ab07eb1c0 Ensure fonts list cleared in destructor.
This is part of work trying to track down a segfault that is caused after a replay session (F-15).
2019-01-26 18:20:52 +01:00
James Turner
305d555be4 Reduce log output at level=debug
These messages aren’t adding much based on my understanding, we can
re-add something more specific if needed.
2019-01-22 17:30:36 +01:00
James Turner
d6ae2e6aa0 Tweak pixel-ratio handling in the PUI camera 2019-01-22 10:50:55 +01:00
Richard Harrison
cbde4c90da optimise property usage for camera using local static for ratio. 2019-01-20 23:30:46 +01:00
Richard Harrison
d963aef562 OSG 3.5+ compatibility.
Still work to do here in implementing the methods; this just lets it compile and run.

Labelled with OSG:TODO
2019-01-20 23:28:32 +01:00
Richard Harrison
9639b63d44 Use readRef version of osgDB methods to give us thread safety 2019-01-20 23:26:58 +01:00
Richard Harrison
6e2443d268 Change to print exception type (inherited exceptions) 2019-01-20 23:26:58 +01:00
Richard Harrison
58314f359a Change screenshot filename to have date time
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
2019-01-20 23:26:58 +01:00
Richard Harrison
88f43a33a3 Remove messages that appear when no tile is loaded because it isn't present in the scenery
These get a little spammy when flying over areas without terrain and don't really serve much of a purpose.
2019-01-20 23:26:58 +01:00
James Turner
4deb61d0af Map dialog draws heliports now!
Patch from Daniel Wickstrom, with some style changes by James
2019-01-15 11:32:57 +00:00
James Turner
df537d6e57 Tolerate missing runways parsing procedures
Current Navigraph procedures contain runways we lack, skip these
procedures instead of failing to parse the data.
2019-01-14 16:46:38 +00:00
James Turner
fac110ca40 Airport-search can be filtered by type
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
2019-01-14 12:14:20 +00:00
James Turner
b3c72a6f2e Fix a crash clearing the flightplan runway 2019-01-12 23:40:51 +00:00
James Turner
8487ca7ee6 Add findByIdent to Nasal API 2019-01-12 23:40:51 +00:00
James Turner
416317e444 Nasal: allow filtering airport approaches by STAR 2019-01-12 23:40:51 +00:00
James Turner
4df6cb0558 Nasal: expose additional members on fixes/navaids
Add a ‘colocated_dme’ member to identify VOR/ILS pairings with DME. 
Also exposed the navaid unique ID for easy disambiguation.
2019-01-12 23:40:51 +00:00
James Turner
5affa13348 Nasal: expose airways data and via options 2019-01-12 23:40:50 +00:00
James Turner
d39bcca9cb Improve airway parsing in ICAO routes 2019-01-12 23:40:50 +00:00
James Turner
758518b248 Launcher: improve flight plan leg display 2019-01-12 23:40:50 +00:00
James Turner
612693c276 Via stores Airway ref instead of std::string
Avoid lots of ambiguity resolving airways, especially high- vs low-
level airways with identical idents.
2019-01-12 23:40:50 +00:00
James Turner
6fd5fcfda0 Add missing isType overload for FGFIx 2019-01-12 23:40:50 +00:00
James Turner
615c8433c1 Airway API tweaks to support FMC/routing 2019-01-12 23:40:50 +00:00
James Turner
c6aa7fee26 Hacking on airway loading logging 2019-01-12 23:40:50 +00:00
Bertrand Coconnier
9c7243e1c4 [JSBSim] Exports the fuel density to the property tree. 2019-01-12 15:40:09 +01:00
James Turner
6de242f184 Launcher: hook up ‘available parking’ option
Many cases of this option were not setup correctly, fix this so it
works as advertised.
2019-01-08 23:21:28 +00:00
James Turner
845e7c6bef Improved ‘is MP enabled’ check for pos-init
This fixes the MP detection check when selecting MP on the command-line
2019-01-08 23:20:51 +00:00
Richard Harrison
b56df3f1b7 Merge /u/janodesbois/flightgear-jano/ branch timemgr_mp into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/146/
2019-01-08 17:08:57 +00:00
James Turner
dd6294b5ea Red-sky: fix edge-case in NaN avoidance code
https://sourceforge.net/p/flightgear/codetickets/2087/
for discussion on this.
2019-01-08 11:08:23 +00:00
James Turner
b0dc850df1 Fix type of some numerical constants
Patch by Ron Haertel
2019-01-06 14:30:58 +00:00
ThomasS
2d5d26260e 1) model search order property in super class AIBase and overridden by sub classes.
2) model search order stored as the enum type in AIBase.
2019-01-06 13:57:22 +00:00
Bertrand Coconnier
e704d589f2 [JSBSim] Takes into account the amount of unusable fuel.
Properties /consumable/fuel/tank[*]/unusable-* supplied in the -set.xml file are propagated to the aircraft model and accounted for in the tanks management.
2018-12-31 00:59:21 +01:00
Bertrand Coconnier
466fb0979d [JSBSim] Added cyclic clipping for FCS components 2018-12-30 20:51:18 +01:00
Bertrand Coconnier
27ddcedad2 [JSBSim] Extend the usage of template funcs to all <function>. 2018-12-30 00:31:47 +01:00
Bertrand Coconnier
3267aaf5e0 Sync'ed JSBSim
* <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.
2018-12-27 18:40:03 +01:00
James Turner
018e193a58 Improve Nasal log callback handling
(Was being leaked on reset)
2018-12-20 16:07:44 +00:00
jean pellotier
faf06b42a3 preparation for the lag correction based on time sync, instead of fixed
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 ...
2018-12-18 02:38:46 +01:00
James Turner
c3cd7b3978 Remove public use of sglog()::would_log() 2018-12-14 15:41:53 +00:00
James Turner
56cc96f280 Parse radial+offset from lat,lon waypoint 2018-12-13 13:46:53 +00:00
James Turner
738101942f Yasim ground friction (stiction) changes
Original code by Brendan Black, with changes / updates by
Daniel Wickstrom.
2018-12-11 15:23:56 +00:00
James Turner
5215e6fcfc Fix an unused var warning 2018-12-10 16:09:53 +00:00
James Turner
f14aa4e57f Navradio: move glideslope angle to NavRecord
Simplifies logic in testing code
2018-12-10 16:09:42 +00:00
James Turner
9339fd2375 Add some /sim/presets properties to setDefaults
Ensure these properties are always defined, but with default values,
to simplify usage.
2018-12-04 09:50:48 +01:00
James Turner
a9475bd0fa Basic nav-radio ILS testing
Complex cases still to be added, but this tests the basic reception.
2018-12-04 09:39:36 +01:00
James Turner
1f1060431f Avoid NaNs in environment code at extreme altitude
Avoid the ‘red sky zone’ when going to higher orbital altitudes
(thousands of km).

https://sourceforge.net/p/flightgear/codetickets/2087/
2018-12-04 09:39:36 +01:00
Richard Harrison
015742b28d LOD: Multiplayer fix
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.
2018-12-03 06:19:04 +01:00
James Turner
6d68e36523 Simple argument parsing for Props protocol
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.
2018-11-30 13:59:05 +00:00
Richard Harrison
c09f49e70c LOD: use FLT_MAX as the maximum value in setRange (rather than 100k)
- This is one/the reason for the carrier not being visible when viewing it closely (e.g on cat-1 when view zoomed in)
2018-11-26 21:54:48 +01:00
James Turner
1e104bbdfe Version the FG-root setting
This ensures fresh installs will see an empty value, and hence 
default to the shipped version.
2018-11-25 14:06:51 +00:00
James Turner
4956386b84 Launcher: disable magnetic bearing/headings
These don’t work right now (FG doesn’t support passing them in via
arguments) so disable them in the UI to avoid confusion.
2018-11-25 13:51:06 +00:00
James Turner
2f5df005df NavRadio updating via listener
- 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)
2018-11-25 13:12:50 +00:00
James Turner
c7b28a1960 UNit-tests for the NavRadio
Still needs ILS and GS tests, but starting to be useful already.
2018-11-25 13:12:50 +00:00
Richard Harrison
1e636ce4cf Support for DDS Texture Cache
- 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.
2018-11-24 20:21:46 +01:00
Bertrand Coconnier
8742fee23d JSBSim : <function> now checks the number of its arguments. 2018-11-24 18:33:53 +01:00
ThomasS
a8b550ee95 fgcommands "add-aiobject" and "remove-aiobject" for adding/removing objects to the AI subsystem. 2018-11-21 09:28:44 +01:00
James Turner
0239d5ef44 Grid-view for the launcher 2018-11-14 17:11:13 +00:00
James Turner
df810f7970 Fix crash with invalid airway in route 2018-11-12 16:47:50 +01:00
James Turner
31f8f86e12 Fix an inverted flag in Radar calculation
https://sourceforge.net/p/flightgear/codetickets/2083/

Thanks to Jean Pellotier for spotting.
2018-11-08 09:43:29 +01:00
James Turner
2cd3036488 Improved launcher metric units support
For our Russian friends, especially. Also add preliminary support
for above-field elevations (needs FG changes)
2018-11-07 09:39:54 +01:00
James Turner
3b3c99777d Reduce level of a log message 2018-11-07 09:39:54 +01:00
James Turner
8cda76e92b Fix a launcher console warning 2018-11-07 09:39:54 +01:00
James Turner
68813d1c57 Fix missed case in ModelDataExtractor
handle QList<QObject*> case, needed for location:airport runway
and parking selection. Thanks to Jonathan Redpath for the catch.
2018-11-07 09:39:54 +01:00
Richard Harrison
88720a031b Changes to the model interior LOD management.
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.
2018-11-06 18:42:07 +01:00
Richard Harrison
e970db3c61 LOD ranges:
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.
2018-11-05 19:29:20 +01:00
Bertrand Coconnier
d3aa4b19a1 Bug fix for JSBSim.
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.
2018-11-04 17:03:46 +01:00
Bertrand Coconnier
4c7402fb23 Bug fix for JSBSim
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.
2018-11-02 23:05:40 +01:00
Richard Harrison
c99ea20883 LOD ranges rework.
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.
2018-10-30 21:05:55 +01:00
Bertrand Coconnier
04eb045931 New features for JSBSim (not to be included in release 2018.3)
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.
2018-10-28 16:16:20 +01:00
Bertrand Coconnier
94e1cdc551 JSBSim bug fixes (candidate for cherry picking to release 2018.3)
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.
2018-10-28 14:38:02 +01:00
James Turner
66d635dc9c Launcher: fix a bug when using MP server 0 or 1
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.
2018-10-25 12:10:42 +01:00
James Turner
df9c368099 PUI: change alpha composition mode.
This fixes the missing model-view text, but needs some wider testing,
since it may mess up some other things.
2018-10-25 00:04:54 +01:00
James Turner
07cb303e8c Fix for jumping view when right-dragging
This happens because we were not storing the new position when the
OSG event-adapter handled the event, which includes PUI

https://sourceforge.net/p/flightgear/codetickets/2073/
2018-10-24 22:16:51 +01:00
James Turner
951a3ea6ad Fix Windows build, missined windows.h 2018-10-24 14:28:58 +01:00
James Turner
8510776c1f Switch next to use trunk aircraft catalog 2018-10-23 12:08:28 +01:00
James Turner
00eec40d51 Fix JS header include path 2018-10-23 11:00:59 +01:00
James Turner
196aa472fb Fix crash on Ctrl-V in PUI 2018-10-23 11:00:40 +01:00
James Turner
49c3fc064a XLIFF: Fix loading of indexed strings 2018-10-13 21:22:18 +01:00
James Turner
2313f482a3 Add missing C-string include for strcmp 2018-10-13 09:07:32 +01:00
James Turner
dbb99ee550 XLIFF: fix null approved-attr handling 2018-10-13 08:42:05 +01:00
James Turner
53de09d151 Fix dumb commit for XLIFF approved-attr handling 2018-10-13 00:20:38 +01:00
James Turner
73be50b308 Event-input: axis interpolater support
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.
2018-10-13 00:03:30 +01:00
James Turner
ae4fe62d5b Crashfix: props protocol invoking Nasal commands
The protocol was sending command args using a stack local SGPropertyNode,
which doesn’t work since FGNasalSys holds a reference
2018-10-12 22:25:34 +01:00
James Turner
adea824bd3 XLIFF parser ignores un-approved translations
As suggested by Florent, ensure we respect the XLIFF ‘approved’
attribute, so we can track translations which don’t work yet due to
PLIB limitations.
2018-10-12 22:24:33 +01:00
James Turner
8f67ddf896 Route-manager: expose new flight-plan values
There were existing properties for these values, make them attached to
the flight-plan values now, especially for cruise settings.
2018-10-12 15:27:51 +01:00
Florent Rougon
4c6a0467a6 Remove splash/ lookup prefix for the unstable-warning (nightly builds)
This was forgotten in commit 6d6e1809f0,
thanks to Mihajlo Tomić for the report.
2018-10-12 13:21:09 +02:00
James Turner
f819750287 Launcher respects --language arg if set 2018-10-12 11:37:39 +01:00
James Turner
1613b44c6a Text fix in ‘Install custom scenery’ dialog 2018-10-12 09:11:20 +01:00
Florent Rougon
6d6e1809f0 Fix translations handling in the splash screen
Don't use the splash/ prefix, it doesn't exist in our XLIFF files.
2018-10-12 07:38:09 +02:00
Florent Rougon
4ee9021eab Launcher: print the locale name when translations were successfully loaded 2018-10-11 22:37:33 +02:00
Erik Hofman
43c201d9d0 Fix an almost certain buffer overflow 2018-10-10 09:24:02 +02:00
James Turner
d7d37ae137 Launcher: further flight plan tweaks
Various improvements based on discussion here:
https://sourceforge.net/p/flightgear/codetickets/2066/
2018-10-09 17:14:23 +01:00
James Turner
180cf66077 Launcher: tweak sidebar icons 2018-10-09 10:25:50 +01:00
James Turner
1cbcae9795 Bugfix: fix range/ident priority of loaded wpts
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/
2018-10-08 16:40:25 +01:00
James Turner
b3bcfb084e Fix linux build: missing <cassert> include 2018-10-08 16:04:51 +01:00
James Turner
c450fa9f4e Flight-plan: improve GPX loading
- support elevation values
- parse the first/last points in case they are airports, and set
as the plan airports in this case.

https://sourceforge.net/p/flightgear/codetickets/2066/
2018-10-08 15:09:46 +01:00
James Turner
22c5c456cc Launcher flight-planning: UI to sync initial location
Show a prompt message to ensure the initial startup location matches
the flight-plan departure airport.

https://sourceforge.net/p/flightgear/codetickets/2068/
2018-10-08 13:31:33 +01:00
James Turner
290261d1ae Launcher flight-planning, allow GPX loading
https://sourceforge.net/p/flightgear/codetickets/2067/
2018-10-08 13:30:46 +01:00
James Turner
28f55889b0 Fix launcher ratings order and labelling
Had a dumb string naming glitch, and also we didn’t check for the
ordering of ratings being different when dealing with packaged
aircraft.
2018-10-08 12:31:27 +01:00
Bertrand Coconnier
8e05816b43 Bug fixes for JSBSim atmosphere model at very high altitudes
* 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.
2018-10-06 19:24:06 +02:00
James Turner
6589c71f62 Tweaks to HID local descriptors 2018-10-04 23:21:05 +01:00
James Turner
1c08ca0e2d Launcher: don’t update already updating aircraft 2018-10-04 21:22:05 +01:00
James Turner
abbaf8f640 HID input: allow descriptors from XML
This allows ignoring the USB-supplied descriptor in favour of our
own, which might considerably better or less broken at least.
2018-10-04 17:43:36 +01:00
James Turner
6366dea197 HID event-input debugging
Adding more debugEvents-enabled log output to HDI input
2018-10-04 12:17:01 +01:00
James Turner
96cce67040 HID input: fix multi-device Nasal support
Ensure each laoded device gets a unique Nasal module name,
otherwise they combine with each other and Stuff Breaks(TM)
2018-10-04 12:17:01 +01:00
James Turner
1d20913b1f Fix initial launcher screen state
This showed up as environment page controls being active under the
summary logo image. Thanks to Nikolai Verner Christensen for spotting
the bug.
2018-10-03 08:41:50 +01:00
James Turner
40c0710f2b Change launcher pop-up to support scrolling
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.
2018-10-02 14:19:14 +01:00
James Turner
cce3ae0268 Launcher: tweak aircraft list key handling 2018-10-01 14:22:48 +01:00
James Turner
c8ed3f02fe Close & delete telnet (props) channels on close 2018-10-01 13:52:01 +01:00
James Turner
9723f26f23 MirrorPropWebSocket: improve node recycling
Adjust logic for node recycling so common patterns observed with
remote canvas work correctly (remove + add of same nodes).
2018-09-30 10:16:31 +01:00
James Turner
2d348bd641 Change CAVOK visibility to 9999.0 metres
This should trigger automatic computation by AW.
2018-09-29 12:47:29 +01:00
James Turner
a66f0243bf Use GetUserPreferredUILangauges on Windows
This should accurately reflect the user's language preferences in the control
panel, unlike the previous method.
2018-09-28 12:09:24 +01:00
Scott Giese
994b752a27 Bug Fix #1999 missing "break"-s.
KLN89 case statements failing through.
Confirmed break is necessary to avoid text overlap.
Resolved.
2018-09-28 00:24:58 -05:00
James Turner
28629b65f2 Property mirror: handle request for missing nodes 2018-09-27 22:39:39 +01:00
James Turner
22bf5eb6e5 Launcher: tweak alignment of thumbnails
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)
2018-09-27 15:23:14 +01:00
Richard Harrison
54ba92afd8 Fix null pointer dereference during startup
(may happen at other times, but definitely happened to me on startup)
2018-09-25 16:53:06 +02:00
James Turner
8b25244d90 Performance: cache TCAS nodes on AI aircraft
Removes some remaining hot property lookups each frame
2018-09-24 15:34:20 +01:00
James Turner
421a5601c1 Launcher state naming fix (parked vs parking)
Ensure both ‘parked’ and ‘parking’ are handled by the launcher display
code and auto-state-selection logic.
2018-09-24 14:52:32 +01:00
James Turner
eb70f5edd4 Mac build fix for updated SDK 2018-09-22 17:23:50 +01:00
James Turner
518d3cbd0f Tweak launcher update timer to sleep the CPU
Fix the launcher keeping the main thread busy all the time (use a non-
zero timeout to ensure the dispatcher sleeps a bit)
2018-09-20 11:03:47 +01:00
James Turner
098c489ae0 Make —parking-id an alias for —parkpos 2018-09-20 10:26:48 +01:00
James Turner
110aec6039 Tiny code cleanups while doing other changes 2018-09-18 17:34:23 +01:00
Richard Harrison
4eaeb594ab NavDataCache: do not write to db in read-only mode 2018-09-15 18:06:23 +02:00
Bertrand Coconnier
3889af3170 Fixed compilation errors due to the synchronization of JSBSim 2018-09-15 17:00:27 +02:00
Bertrand Coconnier
6cc3d14032 Sync'ed JSBSim
- 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)
2018-09-15 16:45:42 +02:00
James Turner
ec0b515864 Whoops, fix a bad typo. 2018-09-15 10:57:02 +01:00
James Turner
72e1737aa6 Reset: wipe the Effect UniformCache 2018-09-13 23:52:52 +02:00
James Turner
47d33b5de3 Fix disabled appearance of ToggleSwitch 2018-09-12 12:04:38 +02:00
James Turner
43e3d7ef38 Electrical system: cache property nodes
Remove some hot spots in the electrical simulation, by caching
property nodes in two places.
2018-09-10 10:45:58 +01:00
James Turner
14a1390a68 Crash fix: warn doing fallback for heliport runways
Due to an apt.dat bug, EGEL (Coll) is actually a heliport (Eddystone
lighthouse) with zero runways. Guard against this case to avoid a
crash.
2018-09-10 10:44:49 +01:00
James Turner
ef98b667b4 AI: cache radar properties as nodes
When many AI objects, the cost of looking up the radar properties
for each object, each frame, is significant.
2018-09-09 15:24:52 +01:00
James Turner
ec488bf204 Launcher: fix missing translation annotations
Thanks to Sidi Liang for catching these.
2018-09-09 14:52:54 +01:00
James Turner
9549ac8027 Build fix: missing headers from project 2018-09-09 13:43:06 +01:00
James Turner
72239c9a52 Code cleanups while checking reposition performance
Some C++11 fixes and give FDMShell, Reply a subsystem-name
2018-09-09 13:42:51 +01:00
James Turner
f39b81c872 Launcher: update Advanced-weather handling
Use the information from Environment/environment.xml to init the
local-weather control properties.
2018-09-07 15:56:10 +01:00
James Turner
0747c2b373 Fix for a flight-plan / delegate crash
Catch a specific issue (-1 index not permitted for fp.current in Nasal),
but also catch
2018-09-07 15:17:55 +01:00
James Turner
e7f2c1439c Fix some integer signed-ness warnings 2018-09-06 17:12:12 +02:00
James Turner
35c5be004f Reduce CPU hit in FGTaxiSegment::unblock
size() is O(N), empty() is constant time.
2018-09-02 19:56:35 +01:00
James Turner
95be7220a2 Merge /u/martymac/flightgear/ branch clang7-FreeBSD into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/141/
2018-09-02 18:20:36 +00:00
Ganael Laplanche
63d6f0218b Use nullptr instead of NULL 2018-09-02 14:17:26 +02:00
Richard Harrison
7795ba60ff Added time statistics for the simulation host.
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.
2018-09-02 13:47:55 +02:00
Richard Harrison
8271bb0456 TACAN: Add support for setting TACAN by frequency
set instrumentation/tacan/selected-mhz to the required frequency and the channel will be correctly set based on frequency matching in the TACAN db.
2018-09-02 13:39:52 +02:00
Richard Harrison
c923ae5b32 Set the active dialog property to the one that is on top after a dialog is closed 2018-09-02 12:27:31 +02:00