1
0
Fork 0
Commit graph

11468 commits

Author SHA1 Message Date
Slawek Mikula
c9d1d58146 [Launcher] #2316 - fixed sorting in the aircraft grid/listview.
When there are installed the same aircrafts from different sources 
(fgdata + fgaddon + git) with identical descriptions, use the URI to
provide stable sorting.
2020-09-05 10:44:43 +01:00
James Turner
f5b5828bd0 AIFlightPlan: add test for XML parsing
This meant some slight refactoring to expose some easier APIs for
testing, but the normal methods should be unaffected.
2020-09-05 10:44:43 +01:00
James Turner
3a3ff07883 Start testing FGAIFlightPlan 2020-09-05 10:44:43 +01:00
Erik Hofman
0272a4fa3f Merge branch 'next' of ssh://git.code.sf.net/p/flightgear/flightgear into next 2020-09-04 16:03:39 +02:00
Erik Hofman
a95aaab0f4 use in-place declarations and clean up the code a bit 2020-09-04 16:03:04 +02:00
James Turner
2147eb8da9 Missed fixes from previous Yasim commit. 2020-09-04 13:05:11 +01:00
James Turner
d2fb16e071 Fix mismatched new/strdup/delete[] froub by ASan
See: https://sourceforge.net/p/flightgear/codetickets/2367/ for the
issue. Switch to using std::string instead of char*, and hence any
need to manually free the memory.
2020-09-04 12:41:56 +01:00
James Turner
4402d7b81d NavCache: only remove if the file exists.
Otherwise we block trying to re-create the cache, which is dumb. This
showed up as Sentry issue:
https://sentry.io/organizations/flightgear/issues/1875854826

Will back-port to 2020.2 once verified.
2020-09-04 12:29:45 +01:00
James Turner
1fd5502e9b Nasal removecommand: use a return value
Change removecommand() to indicate success or failure via a return
value: 1 for success, 0 for failure.
2020-09-04 10:56:41 +01:00
Erik Hofman
c6cb845f90 Merge branch 'next' of ssh://git.code.sf.net/p/flightgear/flightgear into next 2020-09-04 11:45:33 +02:00
Erik Hofman
6bd87586b0 Fix stability: CL and CD must be negative 2020-09-04 11:44:37 +02:00
Erik Hofman
e8fe8345bf Start using or own types for vectors and matrices for sharter and more readable code. Fix some sign issues 2020-09-04 10:58:18 +02:00
James Turner
9090d91be3 Fix a missed pu.h rename. 2020-09-03 20:25:14 +01:00
James Turner
61c6cfb050 AIAircraft: fix type of non-Swift aircraft 2020-09-03 17:51:40 +01:00
James Turner
d1fc4b58cb Start creating tests of AIModel code
First test just creates the manager, and ensures the user aircraft
updates in sync with the real aircraft.
2020-09-03 17:51:40 +01:00
Erik Hofman
ce1e85f656 Get the AISim FDM in a semi-flyable state 2020-09-03 14:39:38 +02:00
Erik Hofman
bdc66d5535 Rename our own version of pu.h to FlightGear_pu.h per James advice. Remove inclusion of pu.h where it isn't requirted. 2020-09-03 12:56:01 +02:00
Erik Hofman
0451816a82 Add our own version of pu.h and use it to prevent bug #2362 on all systems. This can be done since pu.h is to be considered in code freeze forever anyhow. 2020-09-01 10:12:42 +02:00
Scott Giese
ad2bf3cd09 Revert "Resolve Deprecation Warnings"
This reverts commit 8cede3f065.
2020-08-30 17:58:36 -05:00
Scott Giese
7b914bc5fb Removed unreachable code 2020-08-29 11:20:40 -05:00
Scott Giese
a87d9ca76f BezierNode: logic error in initialization 2020-08-29 11:03:31 -05:00
Scott Giese
532d879f72 Dead code removal 2020-08-29 11:00:55 -05:00
Scott Giese
e079f0d1eb Resolve warnings: comparison between unsigned and signed types 2020-08-29 10:15:02 -05:00
Scott Giese
8cede3f065 Resolve Deprecation Warnings 2020-08-29 10:12:35 -05:00
James Turner
37d820120d Unit-testing: tests for Nasal SGCommand API
Test adding/removing/invoking commands, and error handles when
duplicate adding and removing a command name.
2020-08-26 17:20:58 +01:00
James Turner
66f938be8e Sentry: fix naming clash. 2020-08-26 15:29:55 +01:00
James Turner
a882b75c9b Sentry: fix fatal-error event type. 2020-08-26 13:57:44 +01:00
James Turner
5dbab6e90e CMake: overhaul how we find 3rd-party files
Handle the standard windows-3rd-party setup (used by fgmeta) with no
extra options, and also handle the slightly odd setup we use on Jenkins.
Try to tolerate all permutations of setting MSVC_3RDPARTY_ROOT to 
different places in the hierarchy.

We no longer try to guess Boost_INCLUDEDIR by looking at parent dirs of
MSVC_3RDPARTY_ROOT, since this seemed kind of bad to me. Let’s try 
it and see.
2020-08-26 13:57:24 +01:00
Automatic Release Builder
9d775cdfe7 Fix duplicate init of Sentry on reset 2020-08-26 09:52:16 +01:00
Automatic Release Builder
73b4c3839d Sentry: more breadcrumbs 2020-08-26 09:52:09 +01:00
Automatic Release Builder
d9b7435dab Sentry logging of exceptions, fatal errors 2020-08-26 09:52:02 +01:00
Automatic Release Builder
bade1ec4c6 Attempt to fix ref-ptr crash on exit
Fixing Sentry issue FLIGHTGEAR-9
2020-08-26 09:51:55 +01:00
James Turner
06b026a218 GUI/knob animation: fire release binding over PUI
Fire the release bindings for active pick callbacks, even for a ‘handled’
mouse release. This means knobs, etc will fire their release binding
if the mouse is over a PUI dialog.

https://sourceforge.net/p/flightgear/codetickets/2347/
2020-08-25 20:48:29 +01:00
James Turner
8a1109160b Fix Nasal ‘removecommand’ so it actually works. 2020-08-25 19:23:43 +01:00
James Turner
cf424e4344 Rename buildId header file
Avoid the very common name ‘build.h’ in favour of something clearer
and FlightGear specific.
2020-08-24 15:05:16 +01:00
James Turner
178d1beb80 Cmake: Remove version.h machinery
Merge this file into config.h, this means we can save an include path
everywhere.
2020-08-24 15:04:24 +01:00
James Turner
6dfbda9bd1 Cmake: ifx abuse of OBJECT libraries
Use STATIC intermeidate libs for these pieces, to keep older CMake
versions happy.
2020-08-24 13:19:57 +01:00
James Turner
11932bac4e Trying to fix EnvironmentManager shutdown crash.
Not sure this will fix it, but it’s the only scenario I can spot so far,
so let’s try anwyay.

Reported at Sentry as: FLIGHTGEAR-8
2020-08-24 10:25:09 +01:00
James Turner
4fe8a118cc Traffic: Improve iterator robustness
Attempting to fix Sentry crash FLIGHTGEAR-B, crash on shutdown. Not
sure this is quite right, but the logic is clearer and we handle
invalid iterators better.
2020-08-24 10:23:50 +01:00
James Turner
95fd692af1 CMake: move install() rule for compatability
Older CMake versions can’t install(TARGET…) from a different directory.
2020-08-23 21:50:36 +01:00
James Turner
476b9eb3d1 Ensure OSG headers are founding building the UI 2020-08-23 21:10:56 +01:00
James Turner
f7dc02d009 Fix Swift build with CMake 2020-08-23 11:31:37 +01:00
James Turner
218df89b29 Embedded resources: better cmake command
Use add_custom_command and an intermediate OBJECT library to avoid
rerunning fgrcc unless the XML input file has actually changed.
2020-08-23 11:31:37 +01:00
James Turner
47ff3e9f67 Improve CMake strucutre 2020-08-23 11:31:37 +01:00
Scott Giese
63d3dd4cbd REVIEW: Memory Leak - FLITEVoiceSynthesizer ctor
1,696 bytes in 4 blocks are definitely lost in loss record 6,145 of 6,440
2020-08-23 00:21:11 -05:00
Scott Giese
0ce2fdf190 REVIEW: Memory Leak - PositionedOctree.cxx
1,728 bytes in 36 blocks are still reachable
1,280 bytes in 8 blocks are still reachable
480 bytes in 3 blocks are still reachable
2020-08-23 00:15:42 -05:00
Scott Giese
dc1519bfe8 REVIEW: Memory Leak - screensaver_control
2,056 bytes in 1 blocks are still reachable
352 bytes in 1 blocks are indirectly lost
320 bytes in 1 blocks are still reachable
2020-08-22 22:59:33 -05:00
Scott Giese
f84a522f12 REVIEW: Memory Leak - FGPUIMenuBar::add_enabled_listener()
3,920 (3,136 direct, 784 indirect) bytes in 98 blocks are definitely lost
2020-08-22 22:22:47 -05:00
Scott Giese
9d6239031f REVIEW: Memory Leak - wxRadarBg::init()
4,096 bytes in 1 blocks are indirectly lost
2020-08-22 21:48:52 -05:00
Scott Giese
6c14eaa6e8 REVIEW: Memory Leak - FGLinuxEventInput::postinit()
4,995 (40 direct, 4,955 indirect) bytes in 1 blocks are definitely lost
2020-08-22 21:26:03 -05:00
Scott Giese
8e9e16bac6 REVIEW: Memory Leak - Branch::childAtIndex
9,152 bytes in 52 blocks are still reachable
2020-08-22 18:01:15 -05:00
Scott Giese
f21eb3a484 REVIEW: Memory Leak - Options ctor
15,768 bytes in 219 blocks are still reachable
2020-08-22 17:23:55 -05:00
Scott Giese
14b28d4f72 REVIEW: Memory Leak - FGLinuxEventInput::posinit()
55,004 (40 direct, 54,964 indirect) bytes in 1 blocks are definitely lost
2020-08-22 17:05:35 -05:00
Scott Giese
91f8b4dbef REVIEW: Memory Leak - ClipboardX11 ctor
55,397 (104 direct, 55,293 indirect) bytes in 1 blocks are definitely lost
2020-08-22 17:00:24 -05:00
Scott Giese
9d4a940bc0 REVIEW: Memory Leak - wxRadarBg::init()
277,296 (16 direct, 277,280 indirect) bytes in 1 blocks are definitely lost
2020-08-22 16:53:10 -05:00
James Turner
94ff2f8ee4 Load APT1000 comm frequencies correctly.
See discussion in:
https://sourceforge.net/p/flightgear/codetickets/2336/
2020-08-19 11:48:50 +01:00
James Turner
5b3cdb49c5 Sentry: add breadcrumb on scenery reload 2020-08-19 11:47:34 +01:00
Automatic Release Builder
bbce95b5ea Updates for sentry.io 0.4.0 API 2020-08-18 16:51:27 +01:00
Automatic Release Builder
439c5bf4f4 Adjust how we enable/disable Sentry.io
This allows for crash-reporting in the launcher,
but still disabling via default.xml or the command line.
2020-08-18 16:51:21 +01:00
James Turner
a297c89144 Flightplans: add clearAll, rename clear -> clearLegs
Improve naming of clear() methods, and expose the new ones to Nasal.
this will allow RouteManager dialog ‘clear’ button to clear all, soon.

See ticket:
https://sourceforge.net/p/flightgear/codetickets/2064/
2020-08-17 16:11:10 +01:00
James Turner
06a14b4b27 Fix a use-after-free ASan spotted. 2020-08-17 16:05:20 +01:00
James Turner
09067eecda Protocols: additional Hz rate validation
Patch by Huntley Palmer, to warn when passing Hz=0 for the protocol
args, which does not work so well.
2020-08-17 12:15:40 +01:00
James Turner
86f6b94300 Use new thread-safe particles manager.
Requires corresponding SG commit
2020-08-17 10:00:42 +01:00
James Turner
2295e82a0f Fix a use-after-free found by ASan. 2020-08-17 10:00:42 +01:00
Stuart Buchanan
51173f32ff Additional AI Aircraft properties for animation
Add a number of properties set by both AI Traffic and Swift aircraft:

gear/gear[0..5]/position-norm
surface-positions/flap-pos-norm
surface-positions/spoiler-pos-norm
surface-positions/speedbrake-pos-norm
controls/lighting/beacon
controls/lighting/cabin-lights
controls/lighting/landing-lights
controls/lighting/nav-lights
controls/lighting/strobe
controls/lighting/taxi-lights

Also improve take-off behaviour
2020-08-16 14:49:33 +01:00
James Turner
06e6883396 Call new simgear clearSharedTreeGeometry
Should remove the Final Effect (TM) and fix one source of memory
corruption on reset.
2020-08-14 16:47:02 +01:00
James Turner
095be63be4 Reset: Add some missing prop clears on unbind 2020-08-12 16:38:10 +01:00
James Turner
977bfb06bf Reset: ensure mobile tacan drop its AI references
Add a slightly ugly hook, to force mobile nav records to drop their
refs into the property tree on reset.
2020-08-12 16:37:52 +01:00
James Turner
51bb8ed5ce GUI: clean PUI junk on GUI shutdown 2020-08-12 16:36:22 +01:00
James Turner
5d2bb87601 On shutdown, the renderer might already be gone.
Check for this when trying to remove the event handler.
2020-08-12 15:33:20 +01:00
James Turner
16ae171333 Fix a read of freed-data when closing props channels
Ensure we close all channels, before the NetPoller is destroyed, to
avoid a use-after-free.
2020-08-12 15:32:52 +01:00
James Turner
a05e5075b2 FGCom: explicit init some member variables
Fix various places Valgrind identified as read-of-un-inited. Also
fix use of frequencies are integers: always use a double type explicitly,
which will make MSVC happier.
2020-08-12 15:32:02 +01:00
James Turner
d6a0dadf45 Windows build fixes
std::for_each needs <algorithm>
2020-08-11 19:20:32 +01:00
James Turner
56089b9dd9 Fix clean up of the PUI event handler on reset 2020-08-11 18:44:41 +01:00
James Turner
c913b752fc Improve reset main-loop interaction.
Actually remove our main-loop properties, and clear them from the
EventHandler, so we don’t report them as leaked properties.
2020-08-11 18:44:29 +01:00
James Turner
3b5721d77e Fix leaking of dynamics/AI traffic
Use a weak-ref for ParkingAssignment to refer to its owning dynamics,
to avoid a circular dependency.
2020-08-11 18:43:24 +01:00
James Turner
fa76d5b158 Fix errors with missing runways at KORD
This likely relates to stale runway preferences data.
2020-08-11 18:43:20 +01:00
James Turner
21629402ce ATCManagers: Use modern subsystem retrieval 2020-08-11 18:43:14 +01:00
James Turner
250669f75a Fix circular ownership in FGFX
FGFX isA SGSampleGroup, but owns some SGXmlSounds, which also take an
owning ref to their sample group. Clear out the XMLSounds on unbind(),
to break the circular reference.
2020-08-11 14:06:15 +01:00
James Turner
f8fcc8ff5d Default (XML) electrical system: fix leaks
Ensure shutdown of the electrical system actually cleans up components.

Fixes some leaks and dangling properties on reset.
2020-08-11 14:05:10 +01:00
James Turner
b4df97beb6 Fix a crash with clicks on reset 2020-08-11 14:03:55 +01:00
James Turner
fff2fa1718 Raw-pointer -> smarter pointer in TileMgr
Not fixing any leaks, just making ownership more explicit.
2020-08-11 11:44:29 +01:00
James Turner
e2e5223784 Fix leak of FGTerrain on shutdown
This fixes us leaking all STG objects on shutdown, due to an errant
raw pointer in the scenery layer.
2020-08-11 11:16:30 +01:00
Hans Kunkell
4743ede3b3 generates io channel names and adds to property tree 2020-08-10 10:49:09 +01:00
Hans Kunkell
2992e1b100 implements reinit of IO channels 2020-08-10 10:27:51 +01:00
Scott Giese
04a5c37a55 Memory Leak - Fixed
60,200,752 (59,468,656 direct, 732,096 indirect) bytes in 285,907 blocks are definitely lost in loss record 15,499 of 15,501
2020-08-07 12:28:15 -05:00
Richard Harrison
ab1ecb0a31 Directional point light (triangle) changes
Ensure that there are listeners on the properties as the scene features needs to be kept up to date with the properties.
2020-08-07 12:05:57 +02:00
Scott Giese
75e28368ea Memory Leak: 57 MB
60,200,752 (59,468,656 direct, 732,096 indirect) bytes in 285,907 blocks are definitely lost in loss record 15,499 of 15,501
2020-08-06 22:01:15 -05:00
James Turner
b04a0d74f6 Use new-style sub-system lookup 2020-08-05 15:15:17 +01:00
James Turner
379748fc6b Remove obsolete terraSync code 2020-08-03 17:57:59 +01:00
James Turner
f40c6187fb Launcher: omit some setup for in-sim mode
Unfortunately this doesn’t fix the weirdness reported in:
https://sourceforge.net/p/flightgear/codetickets/2180/ 
.. but will keep trying.
2020-07-30 12:30:23 +01:00
James Turner
ebdf34e81a Launcher add-ons: tweak display of missing version
Show missing min/max FG version as ‘-‘ to avoid a translation headache.
Thanks to Slawek Mikula for the suggestion.
2020-07-30 12:29:06 +01:00
legoboyvdlp R
d6b7eaf60f Fix that tp_type will return nil for transitions 2020-07-30 12:26:04 +01:00
legoboyvdlp R
668b499ff4 Correct restrictions above and below. Add test case. Fix contributed by Tobias Dammers 2020-07-30 12:25:02 +01:00
James Turner
25d88573d1 Launcher add-ons styling fixes
Suggested by Slawek Mikula, thanks!
2020-07-29 20:43:37 +01:00
Chris Speck
932938cbee Send fuel tank capacity, fuel density and level in m3 2020-07-29 20:13:07 +01:00
Florent Rougon
3300ac543e Print missing --data path in the "fatal message box"
As suggested by Slawek Mikula:

  https://sourceforge.net/p/flightgear/codetickets/2164/#c397
2020-07-28 10:25:25 +02:00
Stuart Buchanan
3fc1bdff45 Fix W/S ground net position strings. 2020-07-26 20:20:28 +01:00
legoboyvdlp R
3255105190 Ensure that cruise parameters are set when cloning flightplan 2020-07-22 11:31:07 +01:00
Lars Toenning
cdacea1315 [swift] Fix coding style 2020-07-21 11:57:58 +01:00
Lars Toenning
d78b19546a [swift] Add parts support 2020-07-21 11:57:53 +01:00
James Turner
3893754537 Refactor dynamics lat/lon parsing
Using C++11 idioms, and avoid conversion to C strings for atof
2020-07-21 11:52:32 +01:00
James Turner
f5f3054a7a Launcher: Fix cast of helipd to runway
Should fix trying to retrieve an ILS from a pad.
2020-07-17 12:04:12 +01:00
James Turner
ae094f9a77 Nasal: fix valgrind error in print/logprint
Requires matching Simgear change.
2020-07-17 12:03:28 +01:00
James Turner
2f4b2153ef Fix test: find airways.
Fix handling of ‘both’ level option in several places, and amend
the test to make it explicit that we want Clacton VOR, not NDB.
2020-07-16 11:28:50 +01:00
James Turner
ae5b17920c Launcher: Fix a missed translation tag 2020-07-16 09:21:33 +01:00
James Turner
9df688659e Remove redundant line from prior commit. 2020-07-16 09:18:34 +01:00
James Turner
dc4201ed9f Launcher: improve hit-testing of helipad
Use the other circle only, for hit testing pads in the airport diagram.
2020-07-15 09:52:02 +01:00
Florent Rougon
f105e8dfb2 Improve locale handling
- fgfs --language=fr-FR now works as expected for the launcher (also with
  --language=fr_FR as before): the value added by option --language to
  the _languages member of FGLocale is normalized in "underscore" style
  (e.g., fr_FR).

- Add-on translations must now use a hyphen in their property node names
  in addon-metadata.xml (talking about children of <localized>): i.e.,
  use for instance <fr-FR> there, not <fr_FR>. An exception
  (addons::errors::error_loading_metadata_file) is thrown if one of
  these nodes has a name containing an underscore.
2020-07-14 12:23:23 +01:00
James Turner
54264e6591 Add —disable-gui option
Prevents showing a GUI message box if the user wants to run from the
console.

As requested here:
   https://sourceforge.net/p/flightgear/codetickets/2306/
2020-07-14 12:05:53 +01:00
James Turner
f9e9dbf309 Fix naming of Traffic PerformanceDB props
Use correct spelling and splitting of names, but keep reading the old
values as well, for backwards compatibility.
2020-07-14 11:24:42 +01:00
James Turner
1c1a41ed22 Remove an obsolete comment 2020-07-13 14:29:20 +01:00
James Turner
3993fc7d35 Launcher: fix helipad selection
Helipads were not being shown for convention airports, only for
heliports. Fix this up so helipads work alongside runways at
conventional airports, when the selected aircraft is a helicopter.
2020-07-13 14:29:20 +01:00
James Turner
b08de513d0 Launcher: show helipads and runways for airports
Where an airport (as opposed to heliport) has helipads, show them
as well in the diagram.
2020-07-13 14:29:20 +01:00
James Turner
f5c70e01b0 Launcher: fix detection of seaplanes and helis. 2020-07-13 14:29:20 +01:00
James Turner
ece20db882 Fix helipad runtime type definition
This broke various places trying to detect helipads vs runways.
2020-07-13 14:29:20 +01:00
James Turner
faa211bf5d Launcher: cap the search history at 20 items. 2020-07-13 14:29:20 +01:00
Florent Rougon
37aba7dbd4 Remove unused code and fix typos 2020-07-11 13:22:33 +02:00
James Turner
0bb9600795 Add-ons localization support
Add-on meta-data can be localized now, in the same manner as aircraft
metadata.
2020-07-09 18:14:56 +01:00
James Turner
f0d3663102 Nasal unit-testing: allow deep struct equality.
Add a deep comparison of vecs and hashes, when deciding equality in
test assertions.
2020-07-08 15:22:27 +01:00
Stuart Buchanan
2bb15866b8 WS3.0 AirportBuilder update to use Effects. 2020-07-07 13:09:34 +01:00
James Turner
c71fc5ae73 Fix missing File menu in Dutch translation
Set the menu action roles to avoid the text heuristic, which erroneously
confuses our configuration menu items with preferences and moves them.

Fixes bug:
https://sourceforge.net/p/flightgear/codetickets/2253/

Will pick to 2018.3, 2020.1 and 2020.2 since it’s nicely self-contained
and rather annoying.
2020-07-04 14:38:38 +01:00
James Turner
73c15c4d5c Improve a method name, as suggested by Florent 2020-07-03 12:34:37 +01:00
James Turner
9e00715079 Allow cmd line & add-ons to supply FGData extensions
Allow add-ons to define an FGData subdir, and support multiple —data=
command line arguments, to avoid the need to modify FG_ROOT (which might
be read-only). Allow additional data paths to be either higher or lower
priority than FG_ROOT, so that add-ons cannot replace files in FG_ROOT.
2020-07-03 12:29:21 +01:00
James Turner
f97ea1f621 Fix route-path hiding of waypoints
Also hide the path, if the preceding waypoint is hidden. Fixes the
route-manager test JonathanR added.
2020-07-02 12:19:19 +01:00
Stuart Buchanan
39cedd1256 Fix fgviewer for Compositor 2020-07-01 21:02:16 +01:00
Stuart Buchanan
c4942eaa69 AirportBuilder to generate airports from apt.dat 2020-07-01 20:57:15 +01:00
James Turner
bb75d24fc0 Make the launcher defensive about bad add-ons
Tolerate missing add-on data if a bogus add-on is added by the user.

https://sourceforge.net/p/flightgear/codetickets/2266/
2020-07-01 11:57:04 +01:00
James Turner
736485ab76 Expose a Nasal FP method under a better name
Match the C++ name for this, not sure why I ever though pathGeod was a
good name for this.
2020-06-30 17:09:55 +01:00
legoboyvdlp R
cd5a0ffe0b Expose totalDistanceNm to Nasal flightplan ghost
Requested by Tobias Dammers, includes associated test. 
May be cherry-picked to 2020.2.
2020-06-30 13:30:35 +01:00
Scott Giese
034c9f4c86 VPB: Initial Commit
Not for LTS
2020-06-28 11:34:37 -05:00
James Turner
de89d72593 Keep more old log files
Suggested on the tracker, keep log files around longer. Currently we
keep the previous ten files.

Note we still don’t log for secondary running copies, since this would
violate the ‘only one copy can write to FGHome’ principle.

https://sourceforge.net/p/flightgear/codetickets/2243/
2020-06-26 10:13:13 +01:00
James Turner
4a568a42e4 Tweak a log-level 2020-06-25 11:03:08 +01:00
James Turner
05e40bfde3 Log-to-file level can be raised to debug/bulk
Fixes ticket:
https://sourceforge.net/p/flightgear/codetickets/2100/
2020-06-25 11:01:52 +01:00
James Turner
ee6f4388ee Change how fatalMessageBoxThenExit works
This avoids crashing when using Qt : we cannot call exit() safely since
QGuiApplication won’t shut down correctly. Instead throw a special
marker object and catch this in boostrap.

For an instance of this, see:

https://sourceforge.net/p/flightgear/codetickets/2070/
2020-06-24 15:48:02 +01:00
Julian Smith
222a96503d src/FDM/YASim/yasim-test.cpp: added options to calculate settings at zero overall lift.
-D shows speed and drag values at fixed altitude.

--aD shows best speed at different altitudes.

Example:
    yasim fgaddon-git/Harrier-GR3/Harrier-GR3.xml --aD
2020-06-24 07:32:41 +01:00
James Turner
b85f2aba5c Launcher: margin tweaks suggested by Slawek
Use a margin on all the vertical scrolled lists, for text readability

https://sourceforge.net/p/flightgear/codetickets/2268/
2020-06-23 23:21:01 +01:00
James Turner
c07a4c2df9 Launcher: improve local -set.xml scanning
Fix some more cases found by LarsT, where -set.xml scanning would
failure due to include paths.
2020-06-23 23:13:43 +01:00
James Turner
3883b19556 Remove use of unary_function, binary_function
Preparing for switch to C++17
2020-06-22 10:25:51 +01:00
James Turner
425a2f4fe3 C++ version fixes for C++17 support 2020-06-22 10:25:51 +01:00
James Turner
39a2d270fc Fix some macOS 10.12 SDK deprecation warnings 2020-06-22 10:25:51 +01:00
James Turner
a9f48ce130 Fix some file/class name violations.
Ensure the file-name matches the class within, to avoid confusing
people more than necessary.
2020-06-22 10:25:51 +01:00
James Turner
7d7b7b3bd1 Launcher: if user has favorites defined, show them.
Suggested by Henning, that if the user has defined favorite aircraft,
default to that tab.

Will pick to 2020.2 once verified.
2020-06-22 10:25:51 +01:00
Julian Smith
59a7d50fb1 src/Main/fg_init.cxx: add support for auto-generated tooltips on animations.
Results in tooltips for instrument needles, and control surfaces.

Enabled with /sim/rendering/automatic-animation-tooltips/enabled.
The max number of auto-created tooltips can be specified in
/sim/rendering/automatic-animation-tooltips/max-count (too many can cause
problems, e.g. on 777 i had to set max to 45).

src/Model/acmodel.cxx:fgLoad3DModelPanel(): pass new property values to
simgear::SGModelLib::loadModel(), so we can have auto-created tooltips for
animations in the user's aircraft.

[This all requires matching changes to simgear.]
2020-06-20 19:09:12 +01:00
Julian Smith
5af966cfcc src/Scripting/NasalSys.cxx: use override in SimNasalLogFileLine. 2020-06-20 19:09:12 +01:00
Julian Smith
eddd042dbf src/Instrumentation/HUD/HUD.cxx: removed unnecessary newline in SG_LOG() text. 2020-06-20 19:09:12 +01:00
Julian Smith
b35bf51fa0 src/Scripting/NasalSys.cxx: Optionally prefix all Nasal output with Nasal file:line.
Depends on /sim/nasal-log-file-line. E.g. enable with:

    --prop:/sim/nasal-log-file-line=1.
2020-06-19 20:45:11 +01:00
Julian Smith
9e610af55d Added some #includes of Qt headers that were missing.
We get away with things without these includes because
the build concats lots of C++ files together into
build/flightgear/src/GUI/fglauncher_autogen/mocs_compilation.cpp and luckily
earlier ones had the right includes.
2020-06-19 20:45:11 +01:00
Julian Smith
0506a72b30 Improved handling of continuous replay and added recovery system.
Continuous replay:
    If the user replays a continuous recording from file and then end replay
    with the 'My controls' or 'End replay' buttons, we now forget about the
    continuous recording. This enables the usual in-memory record/replay to be
    used subsequently. Also added a '-continuous' suffix to continuous fgtape
    filenames.

New recovery system:
    If /sim/replay/recovery-period is set and greater than zero, we
    periodically save a single-item continuous recording to a recovery file
    called <aircraft-type>-recovery.fgtape (with no date or time in the name),
    doing so in such a way as to ensure that there is always a valid recovery
    file even if flightgear crashes. One can then resume the flight from the
    most recently-saved point by loading this from within flightgear or with
    the --load-tape=... option.

Also did a fair amount of refactoring and tried to clarify the different
property nodes that we embed within recordings.
2020-06-19 20:44:26 +01:00
James Turner
4e12748b8c Fix some compiler warnings 2020-06-19 10:46:01 +01:00
James Turner
5a11e57d0a I18N: support localised local aircraft strings
Allows us to localize aircraft names/descriptions, especially for the
UFO and C172
2020-06-19 10:45:47 +01:00
James Turner
bd666f952e Raise minimum OSG version to 3.4.1 2020-06-18 17:39:48 +01:00
James Turner
06e0924bfc Remove checks for older Qt versions 2020-06-18 13:23:26 +01:00
James Turner
cc798bf21a Launcher: use built-in QQC2 ScrollBar
The built-in has some nice features and generally updates better than
my previous verion.
2020-06-18 13:20:02 +01:00
James Turner
7313f62353 Qt 5.9: drop overlay for Shortcut support
Now we required 5.9, can use this everywhere
2020-06-18 13:03:35 +01:00
James Turner
112d1028bf I18N: fix behaviour when defaultLocale == current 2020-06-18 12:57:30 +01:00
Julian Smith
4e855c3182 src/Scripting/nasal-props.cxx: avoid gcc initialisation warning. 2020-06-17 22:46:42 +01:00
Julian Smith
03537a85d7 src/Network/: fixed gcc warnings and use snprintf. 2020-06-17 22:46:42 +01:00
Julian Smith
a4457d995b src/Main/options.cxx: fix gcc initialisation warnings and minor reformat. 2020-06-17 22:46:42 +01:00
Julian Smith
aeb75738ed src/Instrumentation/: use sizeof in snprintf. 2020-06-17 22:46:42 +01:00
Julian Smith
61aaf44495 src/Input/FGHIDEventInput.cxx: fix gcc comparison warnings. 2020-06-17 22:46:42 +01:00
Julian Smith
037db25e29 src/GUI/FGQQWindowManager.cxx: fix gcc warning about initialiser. 2020-06-17 22:46:41 +01:00
Julian Smith
8ae21d86dd src/GUI/FGFontCache.cxx: fix gcc warning about initialiser. 2020-06-17 22:46:41 +01:00
Julian Smith
fd30fe0e68 src/FDM/LaRCsim/ls_interface.c: use snprintf(). 2020-06-17 22:46:41 +01:00
Julian Smith
50ef1cf337 src/FDM/ExternalPipe/ExternalPipe.cxx: avoid gcc warning. 2020-06-17 21:11:29 +01:00
Julian Smith
a00e9e571d src/Airports/: fixed some minor warnings and use snprintf. 2020-06-17 21:11:29 +01:00
Julian Smith
be3329e4b4 src/Aircraft/flightrecorder.hxx: use unsigned to fix gcc warning elsewhere. 2020-06-17 21:11:29 +01:00
Julian Smith
6007327da9 src/ATC/trafficcontrol.cxx: fix some minor warnings. 2020-06-17 21:11:28 +01:00
Julian Smith
778c81a9b5 src/AIModel/: fixed warnings about use of const with no affect. 2020-06-17 21:11:28 +01:00
Julian Smith
001c1d231d If multiplayer record is enabled, carry on recording while replaying.
This background recording keeps the user aircraft stationary while recording
all movements of multiplayer aircraft. Allows one to look at replay without,
for example, disturbing continuous record to file.
2020-06-17 21:10:33 +01:00
Julian Smith
15915b5a79 Added support for continuous uncompressed save to file.
This allows full-fidelity recordings of arbitrary length (limited only by disc
space) to be created and replayed. These recordings always contain multiplayer
information, regardless of /sim/replay/multiplayer.

When an uncompressed recording is loaded, it is not copied into memory. Instead
we extract individual frame information as required when replaying.

Recording to file is activated by setting /sim/replay/record-continuous to
true. We use the same filename pattern as ordinary fgtapes. The file format
is similar except for being uncompressed (so that replaying can seek within
the recording; gzip etc don't seem to support seeking within the uncompressed
stream.)
2020-06-17 21:10:33 +01:00
James Turner
dbec99abc9 Translate weather scenarios names+descriptions
Allow weather scenarios to be translated, and display this in the
launcher.
2020-06-17 16:15:01 +01:00
James Turner
38cccc3f62 Bugfix: empty popup menus in the launcher
Propagate the display role to the overlay menu correctly.
2020-06-17 16:12:37 +01:00
James Turner
7948a135b6 Launcher: load aircraft with odd -set.xml includes
Lars T identified some cases where the launcher would fail to include
local aircraft due to them using weird ways to include additional
XML into their -set.xml. Add a temporary resource provider while the
launcher is scanning, to make this work.

Will pick to LTS branch once verified.
2020-06-17 11:51:16 +01:00
James Turner
00d34b67e1 Fix translation of migration-notification dialog.
Was being shown before locale was selected, so always using default
translation. Fixed by deferring the dialog, and also added an assert
for debug builds, if trying to access translated string too early.
2020-06-17 10:57:34 +01:00
Lars Toenning
42ed210c9c Add warning if *-set.xml couldn't be parsed for launcher 2020-06-16 22:48:26 +01:00
James Turner
46084c59ff Splash: fix a missing translation Slawek spotted
Allow the ‘% completed’ text to be translated.
2020-06-15 18:42:02 +01:00
James Turner
c8a88f7c40 Fix some missed translation markers for Add-ons
See: https://sourceforge.net/p/flightgear/codetickets/2163/

Thanks to Slawek for spotting these.
2020-06-15 12:24:57 +01:00
James Turner
1d97267663 Fix crash on shutdown in FGFontCache
Reported here by Michael:
https://sourceforge.net/p/flightgear/codetickets/2114/
2020-06-12 11:26:20 +01:00
James Turner
dce282d7b8 Rename js.h -> FlightGear_js.h
Ensure we don’t get weird conflicts as our internal version is
starting to diverge from the original PLIB one.
2020-06-11 17:48:49 +01:00
James Turner
00cffc2f01 Allow correct re-init of joysticks on macOS
With this change, “Reload Input” will discover newly attached devices
on macOS, which previously did not work.

Also add correct detection of disconnected devices, which previously
was not handled well, especially with the new ‘keep trying to open
devices’ behaviour of FGJoystickInput.

Should fix:
https://sourceforge.net/p/flightgear/codetickets/2259/
2020-06-11 17:43:55 +01:00
James Turner
9326c88f9b Move Qt root path variable to top-level CMakeList 2020-06-10 17:59:09 +01:00
James Turner
c1afb053a1 Fix flight-plan cloning with approach transitions 2020-06-10 17:58:31 +01:00
James Turner
bce6b56c8d Remove use of QQ.Window / PopupTracker
Overlay menus work better than native popups for most use-cases, and
simplify integration (no window focus changes). Switch the remaining
menus to always use the overlay system

As part of this, fix how Overlay positions are adjusted, to avoid
the ugly zero-interval timer.
2020-06-10 16:54:27 +01:00
James Turner
aedaf798c0 Launcher: add key shortcut for Fly!
Ctrl-F, since we don’t have a find function.

Requested by Richard, and easy to add :)
2020-06-09 14:53:43 +01:00
Julian Smith
43130aa581 Fixed splash download statistics to use 'B' for bytes rather than 'b'.
'b' usually means bits.
2020-06-09 10:43:15 +01:00
James Turner
6278e74e4b Fix MSVC build: include <atomic>
(Weirdly, only needed with some MSVC versions…)
2020-06-09 08:43:14 +01:00
James Turner
2574783656 ATC: Fix crash with missing traffic ID
https://sourceforge.net/p/flightgear/codetickets/2254/
2020-06-08 22:44:52 +01:00
James Turner
32ff21c1df UI: support OSG multi-threading modes, partially
Requires private header, so might need an additional package installed
on some Unixes.
2020-06-08 22:44:52 +01:00
James Turner
2ca06d5b69 Launcher: move PNGs to assets/ subdir 2020-06-05 22:16:02 +01:00
James Turner
3cd3ad465e Add Qt dialog state controller
Allow standard control of drill-down dialogs (with back / forward
navigation)
2020-06-05 22:09:03 +01:00
James Turner
faa070307d Add property Qt item-model
Allows exposing a set of property nodes as a model in combo boxes,
lists, etc.
2020-06-05 22:09:03 +01:00
James Turner
c2c3bc17f6 Expose child-props to QML binding class 2020-06-05 22:09:03 +01:00
Julian Smith
edb5be38ee Multiplayer replay: add support to fgtape recordings. improved replay behaviour.
Fgtape:

    If multipayer replay is active we write multiplayer packet information to
    fgtape files. We also add /sim/replay/multiplayer to the properties written
    to fgtape file so at load time we knows whether to expect multiplayer
    packets.

    New builds of fg can load and replay old recordings.

    It is expected (but has not been tested) that old builds of fg will be able
    to read new fgtape recordings where /sim/replay/multiplayer was unset or
    false (currently the default).

    Old builds of fg will not be able to load fgtape recordings that include
    multiplayer data.

Avoid incorrect removal of multiplayer aircraft when replaying:

    We now clear multiplayer motion history when we jump forwards or backwards
    during replay. This ensures that multiplayer code doesn't remove
    multiplayer aircraft because of inconsistent-looking time stamps.

    We preserve some multiplay information when purging recorded information
    to save space. This ensures that when replaying we get frequent enough
    packets to avoid the multiplayer code thinking that multiplayer aircraft
    have disappeared.
2020-06-05 21:21:14 +01:00
Julian Smith
4de00657c9 Multiplayer replay: added properties showing memory usage info. 2020-06-05 21:21:14 +01:00
Julian Smith
e7b1f3f52e Multiplayer replay: new, support for replaying multiplayer aircraft as well as the user's aircraft.
At the moment this only works for live replays - we don't (yet) write the
multiplayer information to fgtape files.

Enable with:
    --prop:bool:/sim/replay/multiplayer=true

This works by copying all raw multiplayer packets into a buffer in
FGMultiplayMgr. Each time it is called, FGFlightRecorder::capture() moves all
the available packet from this buffer into its FGReplayData. Thus we store
roughly syncronised multiplayer packets along with the user aircraft's detailed
replay properties.

When replaying, FGFlightRecorder pushes packets into a buffer in
FGMultiplayMgr, which are used instead of live multiplayer packets. [Actually
when replaying FGMultiplayMgr still reads live packets in order to handle live
chat messages, and ignores chat messages from FGFlightRecorder.]
2020-06-05 21:21:14 +01:00
James Turner
0015744486 Nasal unit-testing feedback from Henning 2020-06-05 21:00:59 +01:00
James Turner
033a53f1d7 Add missing code to previous commit :) 2020-06-05 20:49:05 +01:00
James Turner
a9e5a27e55 UI handling tweaks
- add class to handle top-level windows
- remove requirement to use custom graphics-window
- order alongside PUI UI
2020-06-05 17:54:27 +01:00
James Turner
6beeea2bd5 Nasal flight-plans: allow clearing transitions
When nil is set on the _trans members, clear the transition value
internally. Also fix an error message.
2020-06-04 17:54:13 +01:00
James Turner
023fbe35ea Tweaks to avoid a crash when asking for FGData path
exit(-1) early in startup seems to cause QApplication to be cleaned
up in a weird way
2020-06-04 17:43:27 +01:00
James Turner
9cc9a8a197 Add ‘makesingleshot’ helper to Nasal.
Makes a timer object, but set to single shot mode and starts it.
2020-06-01 11:16:37 +01:00
James Turner
26b0148747 Preserve developer-mode on reset
Thanks to Henning for pointing out problem.
2020-06-01 11:15:45 +01:00
James Turner
13bb1adf54 Better fix for orientation nodes init
(Avoid the chance that we overwrite a value set earlier)
2020-05-31 12:24:36 +01:00
James Turner
c0d347859f Ensure various properties have a value on start.
Ensure /orientation/heading-magnetic-deg, etc have a type of double
immediately. Showed up as a bug in the SenecaII, since the property
is created but has NIL value until the first update() call.
2020-05-31 12:18:07 +01:00
James Turner
03563a1601 Fix DME intercept handling in route/GPS
Both the route-path cade and the RNAV code were using some bad logic
to compute the intersection point. All fixed now, but requires a
new helper in Simgear.
2020-05-30 15:59:07 +01:00
James Turner
e51a0c55b5 Fly-by support for Radial intercepts
In the common case, avoid an overshoot when doing radial
intercepts.
2020-05-30 15:59:07 +01:00
James Turner
6bb1478067 GPS fly-by support
Remove the non-functional turn-anticipation code from the GPS, and
enable fly-by mode in (some of the) RNAV controllers: initially the
leg controller.

The new config property is gps/config/enable-fly-by, defaults to off
for compatibility.
2020-05-30 15:59:07 +01:00
James Turner
58d7454976 Explicit support for approach transitions
Make the handling of approach transitions consistent with SID and STAR
transitions, including the Nasal API. Add some tests to cover the
new features.
2020-05-27 21:44:59 +01:00
James Turner
55ce199535 Fixes for cloning FPs with procedures 2020-05-27 16:09:18 +01:00
Bertrand Coconnier
9ed2406878 [JSBSim] Actuator <lag> elements can now be specified by either a value or a property.
Thanks to Sean McLeod for the patch.
2020-05-27 15:48:41 +02:00
Stuart Buchanan
d852308dc6 Nasal library load order
Previously, the Nasal files in fgdata/Nasal/*.nas were loaded in
file-name order.  This created a particular problem file files
beginning with "a" which might want to use props.nas.

This adds support for an ordered list of files to be defined
in the property tree that will be loaded before the rest of the
Nasal files.
2020-05-25 19:45:40 +01:00
James Turner
0423524b82 Fix crash on first-run on macOS 2020-05-25 14:13:21 +01:00
Lars Toenning
265d721bab [swift] Transfer connection settings to defaults.xml
Related to commit d0cb2f on fgdata
2020-05-24 14:15:27 +01:00
James Turner
54f660764e Tests: change how we find+load data files
Avoid encoding test-data as strings, since this exceeds MSVC limits
on string literals, and tests don’t need to be relocatable anyway,
so we can just hard-code the source location into config.h
2020-05-24 14:14:35 +01:00
James Turner
f242d1a226 Fix case sensitivity of Compositor spec names
https://sourceforge.net/p/flightgear/codetickets/2249/
2020-05-24 08:53:25 +01:00
James Turner
ce6bd859b3 Add Nasal source location to unit-tests 2020-05-22 17:35:24 +01:00
James Turner
3576f5ab3e Split NasalPositioned in two
File was getting huge, break it in half.
2020-05-22 16:38:53 +01:00
James Turner
d66edf42f5 Expose new index-of-interest FP methods to Nasal
Add some test checks for the Nasal API as well
2020-05-22 15:52:54 +01:00
James Turner
1eef7300be PosInit: fix a crash with invalid park-pos.
Add test-cases for this,
2020-05-21 23:19:39 +01:00
Lars Toenning
f3edffd42b Exit on startup if defaults.xml is corrupted 2020-05-21 22:49:57 +01:00
James Turner
fffcd14362 Fix FlightPlan procedure transition handling
Overhaul how transitions are stored in FlightPlan XML, and how
they’re exposed to Nasal. Simplify the Nasal access by making
‘sid_trans’ and ‘star_trans’ writeable.

Extend the unit-tests a lot to cover this, both from C++ and also
from Nasal

As part of this, overhaul the ownership of FlightPlan delegate
factories, to make it safer (use ref-counting of the factories,
and allow the factory to customise delegate clean-up behaviour)
2020-05-21 22:32:28 +01:00
James Turner
5f5a9d2a5e Fix RNAVProcedureTests::testIndexOf
Make FlightPlan::findIndexOfWp use the correct ::matches() method,
and special case this for basic waypoints. This fixes the behaviour
when loaded routes / procedures store a navaid-waypoint as basic.
2020-05-19 22:24:07 +01:00
James Turner
2759977ab6 Fix Launcher compositor setting 2020-05-19 22:22:04 +01:00
James Turner
8af20fbcab Fix for loading of FGFP plans.
Where the plan does not contain departure / arrival WPs, fire the
corresponding delegate methods after load, to run the selection logic.

Also, add a ‘loaded’ delegate callback, to give delegates a chance to
perform validation and fix-up after all flight-plan loads.
2020-05-19 22:01:42 +01:00
James Turner
63fe5237c6 Improve interaction of —parkpos and repositioning
Re-work how position-init and ATC-manager work together to do
parking assignment and fallback (when the parking is unavailable).
Improve the logic for the reposition case, and teach ATC-manager about
reposition explicitly.

When the parking is unavailable, explicitly fall back to best-runway
selection in finalizePosition.

Add many additional position-init tests, to cover all of this.
2020-05-19 18:00:34 +01:00
Bertrand Coconnier
1c10ccdd61 [JSBSim] Added a new property "accelerations/Nx".
Completed the set of properties accelerations/N{x,y,z}.
2020-05-18 23:00:36 +02:00
James Turner
1cf8e5641c Fix testing version of previous commit. 2020-05-18 11:47:11 +01:00
James Turner
645548cbcc Launcher: ensure cache rebuild dialog stays open.
Disable the auto-close behaviour, which was causing us to end the
rebuild too early, and then corrupt the DB
2020-05-18 11:46:17 +01:00
Lars Toenning
91263fc873 [swift] Initialize/cleanup traffic module correctly 2020-05-14 11:13:26 +01:00
Lars Toenning
7b9940f1b1 [swift] Code cleanup 2020-05-14 11:13:26 +01:00
Lars Toenning
f823e033f1 [swift] Use AIManager for swift aircrafts 2020-05-14 11:13:26 +01:00
James Turner
f010e78e55 Launcher: basic Compositor support 2020-05-14 10:57:16 +01:00
James Turner
0c0947458f NavCache init: make progress updates smoother 2020-05-13 15:51:42 +01:00
James Turner
31c66b3a37 Use QApp::exec to run the nav-cache init dialog.
This avoids an issue where the dialog doesn’t update on macOS, if it’s
shown immediately after a native message box, such as the migration
warning dialog.
2020-05-12 22:00:43 +01:00
James Turner
620a02bad3 Make sentry APi key customisable 2020-05-12 12:01:59 +01:00
James Turner
fec454def9 PUI map: disable key-bindings for now 2020-05-12 11:26:07 +01:00
Stuart Buchanan
f5b469aee0 Set viewer-[lon|lat]-deg on initial View bind
Previously /sim/current-view/viewer-[lon|lat]-deg were set to
(0,0) when a view was bind() for the first time by the view
manager.  This cause the scenery tile cache to immediately clear
and all scenery to be reloaded.

Now these values are set correctly the first time the view
bind() is called, so the cache behaves correctly.

Also fixed what looks like a possible bug on code read where
the tiles of the current view had a very short expiry time
set.  Seems wrong.
2020-05-10 14:17:40 +01:00
James Turner
b52d41b0c3 Allow region/local specifications of translations 2020-05-08 14:54:53 +01:00
James Turner
6b41eb69eb Lock-file dialog: allow quit-ing, make translated
Add translation macros for the text of the lock-file warning dialog,
and update the default text after some discussion on the devel list.
Also allow quiting the app, as an alternative option.
2020-05-07 16:49:50 +01:00
Lars Toenning
da666ae83c Fix segfauls in swift service 2020-05-07 11:13:12 +01:00
James Turner
bf72e1d729 Fix for reposition crash for some users
Speculative fix for a reposition assert which Huntley is seeing:
  https://sourceforge.net/p/flightgear/codetickets/2229/

Unclear why it’s not happening for me other some other folks, but this
should logically be the correct fix. Let’s find out.
2020-05-07 11:07:47 +01:00
James Turner
522c742419 Draft version of Nasal unit-testing API
Only the in-sim version works for now, the test-suite mode is not
implemented yet. Also the test API will evolve, but should stay close
to what CppUnit defines.

Run a test file by specifying a path to nasal-test : examples will be
added to FGData shortly.
2020-05-06 15:20:26 +01:00
James Turner
ee3958f971 Skeleton work on Nasal GC test
Incomplete, but the goal is to stess the Nasal GC system by creating
and destroying large number of objects continously.
2020-05-06 15:20:26 +01:00
James Turner
a01f3442c6 Fix non-Qt build.
Thanks Huntley for the catch.
2020-05-04 21:29:23 +01:00
James Turner
ddc7baada2 Improve UI around read-only mode / lock-files
See ticket:
https://sourceforge.net/p/flightgear/codetickets/2133/

Give the user a chance to intervene, if we select read-only mode.
Offer a button to clear the lock file if it’s stale, and start in
read-write mode.

This is still evolving, but want to get some feedback on it.
2020-05-03 18:02:20 +01:00
James Turner
9d2e50fa56 Addon-config: don’t overwrite autosaved props
Fix for: https://sourceforge.net/p/flightgear/codetickets/2059/

When copying addon-config into the main property tree, skip props
which already exist and which are marked ARCHIVE, on the assumption
they came from autosave.xml.
2020-05-03 12:23:54 +01:00
James Turner
134685b527 Fix FP delegate when loading GPXs
When load a GPX route, run normal departure/arrival airport callbacks
on the delegates. (They are blocked for ‘native’ XML routes to avoid
losing SIDs and STARs)

https://sourceforge.net/p/flightgear/codetickets/2227/
2020-05-03 08:30:18 +01:00
Julian Smith
387b61e211 src/GUI/MapWidget.cxx: don't pan map with cursor keys if /gui/map/key-pan is 0.
Allows control of autopilot with cursor keys when map is being displayed.

Default is 1, which preserves old behaviour.
2020-05-02 10:09:04 +01:00
Julian Smith
99c1612ddc src/Instrumentation/HUD/: added enable-ground-velocity-vector
Similar to enable-velocity-vector, but indicates velocity relative to ground,
rather than velocity relative to air. E.g. useful for crosswind landings.
2020-05-02 10:09:04 +01:00
James Turner
6baa55b36b Waypoint hiding support (for the A320, etc)
To support FMS which delete ‘past’ waypoints, add some helpers:
 - waypoints can be flagged as hidden, this property is exposed to Nasal
 - currentWP() accepts an offset parameter, allowing FlightPlan indexing
   to treat the current WP as index 0
 - a ‘numRemainingWaypoints()’ function on flightPlan in Nasal, again
   to range how many waypoints are left, starting from the current WP

Add some basic tests of these new features to the route-manager tests.
2020-05-01 09:28:42 +01:00
James Turner
100efeebab Quiet some noisy logging in ATC code 2020-04-30 16:22:59 +01:00
James Turner
e60d131a4e Ensure dtor is virtual 2020-04-30 16:22:59 +01:00
legoboyvdlp R
18c0613762 Replace activeTraffic iterations with a standard function 2020-04-30 16:22:59 +01:00
legoboyvdlp R
3e1dc4683b Keep revising ATC 2020-04-30 16:22:59 +01:00
legoboyvdlp R
64aa3927a7 Rename departure cue to departure queue, formatting, document ActiveRunway class 2020-04-30 16:22:59 +01:00
legoboyvdlp R
8268cdc5e0 Optimize slot checking routines so unneeded code is not run, document function 2020-04-30 16:22:59 +01:00
legoboyvdlp R
97ca43a52a Correct description of getDistanceToGo() - this returns meters, not feet. Looking at the code it appears that it won't break anything to use the wrong units, so we'll just fx the documentation to make it clear its meters 2020-04-30 16:22:59 +01:00
legoboyvdlp R
0132ddf7a1 A missing call to initializeAirports() restored; this now works. Add documentation to atcdialog. 2020-04-30 16:22:59 +01:00
legoboyvdlp R
c789687da0 Formatting, change single-use pointers to std::unique_ptr 2020-04-30 16:22:59 +01:00
legoboyvdlp R
86dae35b37 Document atc_mgr, remove method from SchedFlight 2020-04-30 16:22:59 +01:00
legoboyvdlp R
84c075a20f Make it bulk again - I don't know how it reverts 2020-04-30 16:22:59 +01:00
legoboyvdlp R
6c3828bf84 ATC/AI: SG_LOG will now use BULK for render message 2020-04-30 16:22:59 +01:00
legoboyvdlp R
4af75c4666 ATC / AI subsystem: replace iostream with SG_LOG() and make new function in SchedFlight that will create a new scheduled flight instance 2020-04-30 16:22:59 +01:00
James Turner
d2a04cecf7 Fix string category for locale 2020-04-30 16:22:59 +01:00
Bertrand Coconnier
ca8fffda3e Fixed a segfault occuring when changing the LOD ranges with a JSBSim aircraft.
Bug report and testing by Jonathan Redpath (see details in issue #276 at GitHub).

The check of FGInterface::get_agl_ft return value has been discarded a few years ago (commit 86b346) on the ground that the method was returning a meaningful altitude above ground level even if it failed.
See mailing lists discussions:
https://sourceforge.net/p/flightgear/mailman/message/32246380/
https://sourceforge.net/p/flightgear/mailman/message/32247050/

There is no indication however that the other parameters are populated with meaningful values when FGInterface::get_agl_ft reports an error. The returned `material` pointer is therefore discarded when an error is reported. Ground reactions are still processed in all cases as was decided in 2014.

Took the opportunity to initialize the `material` pointer to null, to avoid yet another problem with unitialized values.
2020-04-30 15:25:22 +02:00
Bertrand Coconnier
7f319d69ca Fixed uninitialized variables in FGPiston.
Some members were used before being initialized in FGPiston which could randomly generate invalid floating point values that could propagate to many places in JSBSim.
As a cure to the problem, all variables are now initialized to valid default values in the header (as allowed by C++11). The constructor is only expected to set the members to meaningful values.
2020-04-30 15:10:30 +02:00
James Turner
4a485adcf3 Fix crash on —show-aircraft
Change how we return, so QApplication doesn’t explode. exit() is not
a happy thing for QApplication.

Ticket:
https://sourceforge.net/p/flightgear/codetickets/2139/
2020-04-29 14:55:37 +01:00
James Turner
de0826294c Aircraft-loading: resolve symlinked dirs earlier.
This is to ensure we pass a realpath when validating Nasal / dialogs,
to fix: https://sourceforge.net/p/flightgear/codetickets/2057/
2020-04-29 12:33:25 +01:00
James Turner
954385ce0d Improve log message when fgfs_lock.pid exists
Part of addressing:
https://sourceforge.net/p/flightgear/codetickets/2133/

Still need to decide about a better GUI dialog for this.
2020-04-29 11:44:21 +01:00
James Turner
489e6abb2a Allow translation of ‘autosave migration’ dialog.
Thanks to Slawek Mikula for the suggestion, this can now be
translated.
2020-04-29 11:44:13 +01:00
James Turner
6c66126bdb I18N: fix translation of nav-cache-init dialog
Thanks to Slawek Mikula for spotting, that this was not working
correctly, now it does.
2020-04-29 11:44:09 +01:00
James Turner
6ae2c387bf Canvas: expose dirtyPixels() to Nasal 2020-04-28 14:04:40 +01:00
Erik Hofman
b96327acf7 Remove an unused header file 2020-04-28 08:36:51 +02:00
James Turner
b69055ffca Fix normalization of heading-mag-deg 2020-04-27 14:21:47 +01:00
James Turner
1f07a8eba8 PUIDialog: some C++11 style clean-ups 2020-04-27 14:21:47 +01:00
James Turner
027bd7105e Fix a comment typo 2020-04-27 14:21:47 +01:00
James Turner
aae2ddd7e4 Launcher: split on non-word characters in search
This means ‘pa-28’ or ‘c-130’ will match pa28 or c130, where previously
they did not. This makes search for aircraft designations a bit easier.
2020-04-27 14:21:47 +01:00
Scott Giese
5b12b1f360 Revert "Fix HUD scale"
This reverts commit 93a1d5e2d1.
2020-04-26 21:56:07 -05:00
James Turner
d17c1bbaf2 Merge /u/kaklik/flightgear/ branch next into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/197/
2020-04-25 15:34:37 +00:00
gallaert
99083d6b35 Replace boost::tuple by std::tuple 2020-04-22 14:06:13 +01:00
gallaert
f7cbcd9e60 Replace boost::function by std::function 2020-04-22 14:06:13 +01:00
gallaert
27ae79b5da Replace boost::bind by std::bind and lambda function 2020-04-22 14:06:13 +01:00
gallaert
4854607382 Replace boost::lexical_cast by std::ostringstream and std:stof/stoi/stod 2020-04-22 14:06:13 +01:00
gallaert
c6124b5c5a Replace boost::enable_if/disable_if/enable_if_c/disable_if_c by std::enable_if 2020-04-22 14:05:47 +01:00
gallaert
0dfed0a096 Replace boost::shared_ptr/weak_ptr by std::shared_ptr/weak_ptr 2020-04-22 14:05:46 +01:00
James Turner
381919451d Fix for reset crash:
https://sourceforge.net/p/flightgear/codetickets/2217/

This requires a matching Simgear change, but ensure all places
tolerate Nasal subsystem being gone, since this occurs during reset.
2020-04-22 10:56:54 +01:00
James Turner
858fc6ea01 Launcher: Fix compilation with Qt < 5.6 2020-04-21 16:34:24 +01:00
James Turner
b85048db2d GPS/FLightPlan test updates
- fix reseting of the NavData each test
- improve the test-pilot’s GPS following (reduce turn range close
   to the desired course)
- test DME intercepts
2020-04-21 15:48:41 +01:00
James Turner
fdd509a080 Logging for Nasal errors, disabled for now.
Code to log Nasal, as well as C++, errors. But need a way to reduce
the false-positive rate, so disabled for now.
2020-04-20 11:03:35 +01:00
James Turner
17774dbe4c FlightPlan: DISCON works with pointAlongRoute
Add some tests for the default GPS / route-manager handling of
DISCON in flight-plans. Especially check behaviour when sequencing
a DISCON, and resuming with a Direct-to after one. 

This requires a corresponding FGData update to the default GPS Nasal.
2020-04-19 16:44:49 +01:00
James Turner
1a925b152d FlightPlan: don’t assert on invalid waypoints
When there is no first anchor waypoint (eg a runway or navaid), avoid
asserts from the RoutePath code.
2020-04-19 12:27:50 +01:00
Stuart Buchanan
682293c0d0 Fix for C++11 using simgear::strutils::lowercase 2020-04-18 22:00:04 +01:00
James Turner
d96d903c0b Sentry: fix conversion of Build-ID to string 2020-04-18 18:13:37 +01:00
Stuart Buchanan
1d6b6d9753 Add carrier parking positions to property tree
This adds the names of the available parking positions/catapults
to the property tree, so we can build a suitable in-sim list
of parking positions for users to select from.
2020-04-18 18:07:25 +01:00
jano
dc1bc21d2f Manufacturer code added to the igc file
to make gpsbabel accept our igc files, added the manufacturer code , wich should
 be the first line in igc file, as stated page 35 in :

https://www.fai.org/sites/default/files/igc_fr_ts_2016.pdf
2020-04-18 13:36:04 +02:00
Stuart Buchanan
52a6245b49 Add --carrier-position command line argument
Takes special values "FLOLS" and "abeam" to set up
aligned for final approach or at the 180 for the carrier flight
deck.  Or alternatively a catapult or parking position.
2020-04-17 20:25:18 +01:00
James Turner
faee5dbabf Code changes for crash reporting with Sentry. 2020-04-17 17:55:34 +01:00
James Turner
a24301f746 UI for enabling crash-reporting in the launcher 2020-04-16 22:33:37 +01:00
James Turner
7986999650 Nasal: add _toggleBoolValue helper for Henning 2020-04-16 16:41:18 +01:00
James Turner
e939e877dc Nasal isInt : handle LONG property type 2020-04-15 16:14:24 +01:00
James Turner
4c0965e3c1 Some initial tests for route discontinuities.
Probably many more to add, but this is some basic testing at least of
inserting, querying and removing discontinuities.
2020-04-15 16:11:33 +01:00
James Turner
fa898e7cd6 Add _adjustValue helper to Nasal-props 2020-04-15 11:24:32 +01:00
gallaert
8da16eddd6 Replace boost::to_lower and boost::to_upper by strutils::lowercase and strutils::uppercase 2020-04-14 13:26:53 +01:00
James Turner
81ba646111 Add some type-checking helpers to Nasal.Props 2020-04-14 13:26:29 +01:00
James Turner
e1d00509c7 Enable sentry linkage (for Jenkins)
Note this require a sentry-native build with this commit applied:
0c631f6ec7
2020-04-14 11:15:40 +01:00
James Turner
264451246e Add compositor text to splash, if enabled
This will be removed post 2020.2 release, so not worrying about
translation of this.
2020-04-14 11:13:56 +01:00
Erik Hofman
2fd0877824 Only load the video settings when the autosave file is not found. This requires the properties in the video settings configuration file to have the archive attribute set but it solves the problem of loading the autosave file twice (and too late in the process) 2020-04-13 17:03:37 +02:00
James Turner
ba08eee096 Hopefully fix MSVC205 build
Tested 2017 which works fine, but 2015 seems unhappy, hopefully this
fixes it.
2020-04-13 14:40:08 +01:00
James Turner
d7398866c7 Launcher: allow ‘Airports’ when adding a scenery path
Adjust the warning message to allow for ‘Airports-only’ scenery paths
to be added.
2020-04-13 09:35:52 +01:00
Stuart Buchanan
9b20c08db3 Fix compiler warnings 2020-04-12 21:52:19 +01:00
Stuart Buchanan
6ab7c08aa5 Fix --heading for --ndb position option.
Previously setting an offset for an NDB start position
resuled in any --heading setting being ignored.  This fixes it.
2020-04-12 21:45:20 +01:00
Richard Harrison
bf85a2d542 Fixes to static LOD ranges 2020-04-12 21:34:41 +02:00
gallaert
fb65f64342 Replace BOOST_FOREACH by C++ 11 for range loop. 2020-04-12 14:40:36 +01:00
gallaert
36f8036ce1 Statements following return, break, continue, goto or throw will never be executed. 2020-04-11 22:07:15 +01:00
Vit Hanousek
30528a9d6c Merge branch 'master' into electric-engine 2020-04-11 09:15:21 +02:00
Jakub Kákona
2247badaa6 coding style improvements according to ticket #595. 2020-04-10 23:49:22 +02:00
James Turner
4571769ee7 Quiet some log messages 2020-04-10 19:12:10 +01:00
James Turner
440ca82bca Launcher: fix a bug setting combo box state
Fix for callsign broke settings where the default value of setting is
not that of the control.
2020-04-10 19:09:54 +01:00
James Turner
6bed3fc4dd Autopilot: fix duplicate call to bind()
This fixes an error where the ‘serviceable’ property is tie()-ed twice.
The actual AP components don’t use bind (and aren’t created until init(),
so this only affects the serviceable property.
2020-04-10 13:54:30 +01:00
James Turner
4fd59a6613 Launcher: fix a glitch in restoring callsign
The base version of setValue used the wrong syntax, causing callsign
restoring to fail.
2020-04-10 11:58:18 +01:00
James Turner
0a6fe33bc3 Add support for compatible-fg-version in -set.xml
This is to evaluate if this is a good idea, not sure if we actually
want to commit to this approach yet.
2020-04-10 10:40:32 +01:00
James Turner
9304bcc9af Change some warnings to developer mode. 2020-04-10 10:40:32 +01:00
James Turner
ef76bb3064 MP startup: exclude parking positions as hold-shorts
Only consider actual taxi nodes, not parking positions, as potential
hold-short locations, when doing an MP runway-start relocation. This
avoids some odd behaviours for groundnets which only define
parking positions and nothing else.
2020-04-10 10:40:32 +01:00
James Turner
54ff853454 Fire listeners on metar-properties
Mark these as listener-safe, to reduce Nasal warnings.
2020-04-10 10:40:32 +01:00
James Turner
b1395a86ba Add —disable-hold-short option for MP
Allow explicit disabling of the hold-short behaviour when it causes
problems.
2020-04-10 10:40:32 +01:00
Richard Harrison
b8f28d54c6 Carrier init:
As well as "FLOLS" in the runway allow it in the parkpos; probably we should rename this to "position" rather than "parkpos"
2020-04-10 00:06:00 +02:00
James Turner
c78e6fb443 Nasal: expose SG log levels as constants
This avoids the need to use integers as the first argument to logprint()
in Nasal, which is confusing. Add global constants LOG_INFO, LOG_WARN,
etc.
2020-04-09 13:59:37 +01:00
James Turner
11fb8b8c84 Minor C++11 modernizations in NavDisplay.cxx 2020-04-09 12:04:40 +01:00
James Turner
b1df2ad88a Fix a 0 -> nullptr 2020-04-09 09:55:42 +01:00
James Turner
f5b04684cf Disable linking to sentry for now, due to a bug
Discovered na upstream issue in sentry-native’s exported CMake targets,
at least on macOS. Disabling until I hear back from them.
2020-04-08 16:07:31 +01:00
James Turner
785436abf4 Nasal: support for unregister FP delegates 2020-04-08 12:27:31 +01:00
James Turner
2500534b1e Build changes for new crash-reporting system. 2020-04-07 09:38:13 +01:00
Stuart Buchanan
00fd5fbaec Carrier "abeam" position support
Support for --carrier-abeam option, which places the aircraft
at the end of a downwind opposite the FLOLS.

Add launcher support for above.

Add carrier display for launcher showing position relative to
carrier.
2020-04-05 23:13:32 +01:00
Vit Hanousek
cc8b981301 Fix const attribute at eletric motor 2020-04-05 19:49:17 +02:00
Stuart Buchanan
dc6fb53596 Correct defaults FLOLS angle from 3 to 3.5 degrees
Adjusted to match the FLOLS model and code.

On carrier approaches 0.5 degress makes a surprising
level of difference!
2020-04-04 18:03:20 +01:00
Stuart Buchanan
5d75933bac add /fdm/yasim/respect-external-gear-state
Previously YASim set /controls/gear/gear-down during startup
depending on whether the aircraft was on the ground or in the air.
As YASim initialization takes place after the overlay is applied,
this over-rode any setting from the overlay.

This change adds a property which can be used by an overlay to
ensure that its /controls/gear/gear-down configuration is not
over-ridden.
2020-04-04 14:55:51 +01:00
Julian Smith
26168e5175 src/GUI/FavouriteAircraftData.cxx: add #include of <memory> to fix compile error. 2020-04-04 11:19:46 +01:00
James Turner
e596eb3716 Launcher: move favourites to its own storage class
This allows viewing/changing favourite-ness from the details view.
2020-04-04 09:20:23 +01:00
James Turner
330422faf3 C++ modernisation tweaks 2020-04-04 08:06:15 +01:00
James Turner
42a8adb07e Traffic: use new-style subsystem lookup 2020-04-04 08:06:15 +01:00
James Turner
1d8cad58db Mouse input: tidy some logic 2020-04-04 08:06:15 +01:00
Richard Harrison
cb08eb6d6d Fix for range animations in the scenery
Reinstate lod/rough and lod/bare and therefore fix the use of range animations that implement hardwired LOD.

Initially I was reluctant to do this - but after a lot more research I'm no longer convinced that range animations cause a huge performance hit and so we can keep this fix until either the scenery is fixed or the situation becomes clear.

Ideally this fix should be reviewed prior to the next LTS release; or maybe after the next LTS release - but in future reviewed it must be
2020-04-04 00:55:12 +02:00
Stuart Buchanan
e0fb27037b Carrier launcher: Usability improvements
- Support for <description> under <entry> in AI scenario
- Carrier icon consistent with UI
- Location "ship" icon toggles between ships and airports.
2020-04-03 21:43:19 +01:00
Stuart Buchanan
6b17604ba8 Carrier launcher: Allow setting altitude 2020-04-03 20:37:37 +01:00
Stuart Buchanan
8a782ea386 Updated Aircraft Carrier iconography for Launcher 2020-04-03 16:16:11 +01:00
Stuart Buchanan
e1f9f6707c Add carrier-take-off and carrier-approach overlays
Adds support for carrier variants of the take-off
and approach overlays, with Automatic selection if
requested.
2020-04-03 16:06:55 +01:00
James Turner
968fbd82e0 Fix typo breaking mag-compass and others 2020-04-03 09:57:13 +01:00
James Turner
f24b886ce4 Launcher: fix favourites loading
Also fix some warnings, closer to no output from the launcher.
2020-04-02 16:13:12 +01:00
gallaert
1ce36af298 - When HLA is enabled in Simgear, HLA is also enabled in Flightgear
making the build between Simgear and Flightgear consistent.
- Fix an issue with lib/lib64 path between CentOS/RedHat distributions
  and Debian derived distributions.
- Fix a compilation issue with HLA in the Flightgear code.
2020-04-01 21:02:24 +01:00