1
0
Fork 0
Commit graph

11787 commits

Author SHA1 Message Date
Erik Hofman
2825feb4b2 Simplify the code even more: no need to explicitly define the type 2021-03-27 13:58:54 +01:00
Erik Hofman
2d684de929 Use the new templated helper functions to simplify the code 2021-03-27 13:57:05 +01:00
Erik Hofman
1467a8a170 Move the C version of fgfdm_log.c to examples/dds/ and convert it to C++ as fg_dds_log.cpp using the SimGear provided hepper classes. 2021-03-27 13:31:39 +01:00
James Turner
3276c9a754 Map widget: tweaks to property creation
Allow these values to be auto-saved without getting over-written.
2021-03-26 10:44:27 +00:00
Erik Hofman
f88f38ec53 Dot not only log FDM packets but also GUI and Ctrls packets when they arrive. 2021-03-25 14:21:30 +01:00
Erik Hofman
ee503ba89f Add a property /sim/rendering/desert which can be used by the meterials definiton to alter the amount of dessertness based on latitude. It's op to the material definition what to do with it, if at all. This is not a prediction that there is actually desert at that latitude. 2021-03-25 11:13:38 +01:00
James Turner
1ee8b9e568 View tweaks to try to understand crash with no camera group
Sentry-Id: FLIGHTGEAR-H9F
2021-03-23 17:50:54 +00:00
James Turner
344058baba Avoid crash when early-exiting.
This is a work-around, but suitable for back-porting to 2020.3

Sentry-Id: FLIGHTGEAR-37D
2021-03-23 17:50:54 +00:00
James Turner
c1f54779ac Packages: allow localised URIs
Requested by Michael D, allow localisation of home/help/wiki URLs
for aircraft.
2021-03-23 17:50:54 +00:00
Erik Hofman
02a69f3af0 Remove an overzealous addition of globals->get_props() before &ctrls 2021-03-23 14:37:19 +01:00
Erik Hofman
875713efad Merge all Net/DDS FDM, GUI and Ctrls struct handling into one source file and make it FlightGear agnostic which means that they can be used by, for instance, fgviewer. 2021-03-23 14:30:52 +01:00
Erik Hofman
8f5dc3e764 Use the renamed SG_DDS_Topic class 2021-03-19 13:52:44 +01:00
James Turner
fe99747d37 Transponder: make standby mode work 2021-03-18 13:45:26 +00:00
James Turner
45786de6c9 TimeManager: fix uninitalized vars 2021-03-18 13:45:17 +00:00
gordonshamway23
d09046f9a2 Canvas placement on dynamic models
1. A canvas can be placed on dynamically created models. 
Implemented by adding a new placement factory.

2. Added a "loaded" property in every "models/model[...]" 
path to track when a model is finally loaded by OSG.

See https://forum.flightgear.org/viewtopic.php?f=30&t=38318
2021-03-18 08:39:56 +00:00
James Turner
1dd6ab3cfb Launcher: tip for drag/zoom of diagrams 2021-03-17 12:58:24 +00:00
James Turner
b76b6548a1 Launcher: detect user-entered aircraft args
Avoid double-setting or conflicting aircraft arguments being passed:
when the user enters an aircraft related argument manually, disable
the launcher setting them.
2021-03-17 12:42:54 +00:00
James Turner
85da09d5d5 Launcher: improve feedback entering invalid hangar URL.
Catch XML validation/parse errors, and mention the possibility that
the URL is not correct, in the feedback message.
2021-03-17 12:11:30 +00:00
James Turner
5ccae24f81 Error-reported: disable in no-gui mode 2021-03-17 11:44:41 +00:00
James Turner
ca632cfe4e Fix crash with auto-coordination. (Eg, the Beaver)
Identified by Michiel Fierst.
2021-03-17 11:44:21 +00:00
James Turner
f651ed2f15 Fixes for updated Package API 2021-03-17 09:09:30 +00:00
James Turner
b115c424ce Error-report: feedback from group review
Include command line / launcher options in the detailed report, and
pause the sim when showing an error dialog, in case the report
occurs at an unfortunate time.
2021-03-15 15:51:37 +00:00
Erik Hofman
6e00c47d3d Revert "Use the desciptors typename as the topic name"
This reverts commit 1f3d9c089a.
2021-03-15 16:11:35 +01:00
Erik Hofman
1f3d9c089a Use the desciptors typename as the topic name 2021-03-15 15:19:13 +01:00
James Turner
4b744820ea Fix macOS crash-on-exit with certain font
Sentry-Id: FLIGHTGEAR-M68
2021-03-14 14:47:18 +00:00
James Turner
fbbcc75229 Error reporting: report Traffic errors
Also add logging to Sentry.io
2021-03-14 14:47:17 +00:00
James Turner
1fd2797727 Fix false-positive listener warnings for /controls
Mark the properties as listener-safe, and ensure all C++ callers use
new wrapper methods which manually invoke fireValueChanged
2021-03-13 14:44:17 +00:00
Erik Hofman
846cc54f0b Add the timezone description to the property tree. 2021-03-13 10:13:33 +01:00
James Turner
4eecd088e8 TimeManager: handle reposition better
Extend the timeManager unit-tests to check for some movements, all
seems to work correctly now.
2021-03-12 14:45:25 +00:00
James Turner
9704c1cc93 Local time available without the clock instrument
Compute the local time value inside the TimeManager, so that the
UI doesn’t need to rely on the default clock instrument (which
might not exist) to show correct local time.

Also fix updating of time-offset/time-zone, to be based on distance
travelled instead of elapsed wall-clock time.

(needs an FGData update as well)

Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2514/
2021-03-12 12:49:41 +00:00
Lars Toenning
fb8ef10918 Reset unique ptr to delete object
Previously multiple start/stops of the swift-connection failed because the CPlugin object was not deleted
2021-03-12 10:28:42 +00:00
Lars Toenning
509fbbcebc swift - Add getOwnAircraftVelocityData dbus method 2021-03-12 10:28:42 +00:00
Lars Toenning
938bfd1604 Fix spelling mistake 2021-03-12 10:28:42 +00:00
Erik Hofman
8a9cc389e4 UpdateLocal time when repositioning, the timezone might have changed 2021-03-12 10:46:26 +01:00
James Turner
c5c7532179 Launcher: make help docs link point to online location 2021-03-11 20:35:46 +00:00
James Turner
026b02d7e9 CMake: make another object dependency explicit
Since we’re not using target_link_libraries, we need to explicitly
define fgfsObjects (which contains main.cxx) as depending on the
embedded resources target.
2021-03-10 10:17:15 +00:00
James Turner
9fc45e598f Remove Qt includes from fgfsObjects build
Sink all Qt classes into the specific libraries, so the main objects
don’t need the includes available.
2021-03-09 21:54:47 +00:00
James Turner
37272b14ac Remove the custom graphics window impl
Probably not worth the compat hassle :)
2021-03-08 17:00:58 +00:00
James Turner
c92c41a50f Switch test_suite build to use an OBJECT library
Remove use of BUILDING_TESTSUITE from headers. Where possible, move
test APIs to their own file in the test_suite dir (testApis.cxx). For
some others, add them to a special list of ‘sources which depend on
the build mode’. This will hopefully go away with some further
refactoring.
2021-03-08 16:59:15 +00:00
James Turner
33e205f123 Switch to using OBJECT library for main build
Allows sharing object files between the fgfs and test_suite targets, in
a follow-up commit.
2021-03-08 16:59:14 +00:00
Erik Hofman
af329b794f Use the find_dependency option to parse Simgear dependencies to FlightGear 2021-03-08 16:15:51 +01:00
Erik Hofman
c0bc09bf1a Cleaner code by a clear separation between sgFileType, sgDDSType and the default sgSocketType 2021-03-08 13:47:53 +01:00
James Turner
ee5b49668a Add a notification when catalog refresh fails 2021-03-08 11:01:08 +00:00
James Turner
81df48b858 Add tests for MP-runway start, and fix behaviour.
Fix a bug in how taxi-nodes were classified, which meant that MP start
on a runway was not applied correctly.
2021-03-08 10:23:43 +00:00
Julian Smith
0c7630d263 src/Aircraft/replay.cxx: Fix issue where end time wasn't alway updated correctly when replaying from url.
The end time is updated in background when replaying from url, so we must not
set /sim/replay/end-time elsewhere. So we now only set /sim/replay/end-time in
FGReplay::get_end_time() if recording is not Continuous.
2021-03-07 16:22:43 +00:00
Erik Hofman
0480bb15a9 (Try to) Prevent a one or more multiply defined symbols found error 2021-03-07 15:59:25 +01:00
James Turner
7e074f6b8b MP: reduce a replay message level, to avoid spamming at INFO 2021-03-07 13:08:29 +00:00
James Turner
497a99f8d7 FGHTTP: add getOrCreate helper
Avoids duplicate creation when launcher & remote-tape are used
2021-03-07 13:08:29 +00:00
James Turner
de90c281a5 ErrorReporting: MP error attribution 2021-03-07 13:08:29 +00:00
James Turner
cbe46468d1 Error-reporting: attribute AIObjects from scenarios
Ensure scenario-path is propagated through model loading for AI objects.
2021-03-07 12:33:06 +00:00
Erik Hofman
e4ca169618 Use the new name for sg_dds.hxx 2021-03-07 11:57:48 +01:00
Erik Hofman
837010ac7b Clarify the license 2021-03-06 14:50:10 +01:00
Julian Smith
6ec2170a95 src/Aircraft/replay.cxx: show stats when indexing continuous recording. 2021-03-06 08:52:20 +00:00
Julian Smith
335ac0cb67 src/Main/options.cxx:fgOptLoadTape(): enable compression when downloading recording. 2021-03-06 08:52:20 +00:00
Julian Smith
d7b889a74a src/Aircraft/replay.*: Be able to exclude user aircraft's signals from Continuous recording.
Controlled by /sim/replay/record-signals.

E.g. one can now record only multiplayer aircraft.
2021-03-06 08:52:20 +00:00
Erik Hofman
ffc0105b47 Per request: Rename DDS to DataDistributionService to prevent confusion with DDS the image format. 2021-03-06 09:10:34 +01:00
Erik Hofman
5786d40272 * Support CycloneDDS as a SGIOChannel
* Support the native fdm, gui and ctrl protocols over DDS
* Add fgfdm_log as an fdm over DDS command line logging utility

Usage:
 --native-fdm=dds,out,60
 --native-ctrls=dds,in,60

etc.
2021-03-05 16:10:04 +01:00
Scott Giese
7fe25aa97f Merge branch 'next' of https://git.code.sf.net/p/flightgear/flightgear into next 2021-02-26 21:40:11 -06:00
Scott Giese
380e0c1105 Maintenance: ExternalNet
Prevent buffer overflow.
Inconsistent whitespace use.
2021-02-26 21:13:13 -06:00
Scott Giese
cc2336c5fa Maintenance: FGPUIDialog
Inconsistent whitespace.
2021-02-26 21:09:13 -06:00
Scott Giese
a3c4dcf522 Maintenance: plugin
Minor whitespace adjustments.
2021-02-26 21:03:11 -06:00
Scott Giese
82c34590f6 Maintenance: swift_connection
Fix memory leaks.
Fix mixed use of tab/spaces for indentation.
2021-02-26 21:01:35 -06:00
Julian Smith
ccddbffbd0 src/Aircraft/replay.cxx: minor improvement to recovery snapshot failure dialogue text. 2021-02-26 22:29:33 +00:00
Julian Smith
1868d66e45 src/Viewer/sview.cxx: minor cleanup. 2021-02-26 22:29:33 +00:00
Julian Smith
91dbc902a2 src/Network/props.cxx: added 'telnet server' to comment to make it easier to grep for. 2021-02-26 22:29:33 +00:00
Julian Smith
4553d813b1 Various fixes and improvements to replaying of Continuous recordings.
FGFlightRecorder::replay():
    Fixed behaviour when going back in time while replaying - we were not
    replaying initial property changes correctly because we deliberately
    don't load signals data for some frames when we are only interested in
    multiplayer or extra properties.

    Removed incorrect code that tried to avoid replaying the same frame twice
    in succession.

FGReplay::update(double dt):
    Improved how we figure out which frames we need to replay just for multiplayer
    or extra property changes.

FGReplay::makeTapePath():
    New fn containing the code for converting tape name into path by prepending
    tape dir and appending .fgtape as necessary. Called when loading tape at
    startup or at runtime.

Cached some more property nodes in SGPropertyNode_ptr's.

Don't recordCHAT_MSG_ID messages; unfortunately it looks like most (all?)
chat message text is received as part of POS_DATA_ID messages tied to
sim/multiplay/chat, so this doesn't actually avoid recording chat messages.
2021-02-26 22:29:33 +00:00
Julian Smith
538e32d555 src/Main/options.cxx: Fixed bug introduced by recent support for replaying from url.
We used to modify the --aircraft and --airport options when handling
--load-tape, which invalidated iterators and for example could cause later
options to be ignored.

The solution here is rather crude - we store the new options in globals to
ensure that they are used in preference later on.
2021-02-26 22:29:33 +00:00
Julian Smith
ad1b932324 src/Main/options.cxx: replay url: improved location of local file.
We now put local file inside directory specified in /sim/replay/tape-directory,
and also use 'url-' prefix on leafname.

E.g. with
    --prop:/sim/replay/tape-directory=.../fgtapes and
    --load-tape=http://foo.com/harrier-gr3-continuous.fgtape

- the local file is:
 .../fgtapes/url_foo.com_harrier-gr3-continuous.fgtape
2021-02-26 22:28:22 +00:00
James Turner
fadc900a0a Revert "NaturalEarthLoader: free the thread, oops"
THis doesn't work in all timing conditions, because the thread
can commit suicide.

This reverts commit aeca129034.
2021-02-25 09:02:58 +00:00
James Turner
dc3da7a237 Error-reporting: add more features
Add timestamp to saved reports, and the file name, and print the 
time-stamp for occurences in a saved report. Add de-duplication 
support to avoid generating huge reports for recurring errors.
2021-02-24 14:48:25 +00:00
James Turner
15dfc492dc AIModelData: add error report context
Not complete yet, but add the ability to pass context in from the
AIBase to the loader thread. Also add error context to more places
in AI / scenario loading.
2021-02-24 14:47:01 +00:00
James Turner
2178de9d0d Rework OpenGL check to avoid potential problems
A few versions of the Windows Intel drivers seem to crash while 
performing the OpenGL check; re-order the code to try and prevent
this.

Sentry-Id: FLIGHTGEAR-K7R
2021-02-24 11:41:33 +00:00
Automatic Release Builder
41f9884b70 Launcher: improve automatic language selection
Don’t fail to select the language, when the UI language includes
a ‘script’ value, as happens for Chinese on macOS. 

Thanks to Sidi Liang for reporting.
2021-02-22 10:43:36 +00:00
Automatic Release Builder
8551654cf0 Guard against ancient Intel OpenGL drivers
If we get back Intel < 2.1, bail out with the ‘drivers update needed’
warning.
2021-02-22 10:41:34 +00:00
James Turner
d30f5d63fe Launcher: Getting started tips updates 2021-02-22 10:37:52 +00:00
Scott Giese
190aad784b Maintenance: AIModel
Improve inheritance/polymorphism by eliminating shadow methods.
2021-02-21 23:18:15 -06:00
Scott Giese
7ee64f9994 Maintenance: AIAircraft
Remove dead code
2021-02-21 23:15:40 -06:00
Scott Giese
0d3f387214 Maintenance: performancedata
explicit ctor
2021-02-21 22:27:43 -06:00
Scott Giese
efcd505c9c Maintenance: AIAircraft
fix a few missing initializations.
remove dead code.
2021-02-21 22:14:05 -06:00
Scott Giese
d605294348 Maintenance: nmea
use vector.empty instead of vector.size == 0.
convert atof (c) to stod (c++)
2021-02-21 20:26:45 -06:00
Scott Giese
f56e2a1b3a Maintenance: nmea
overflow prevention
2021-02-21 16:02:50 -06:00
Scott Giese
08fce6d680 Maintenance: atlas
overflow prevention
2021-02-21 15:51:08 -06:00
Scott Giese
3626b6c0a9 Maintenance: FlightPlan
convert to size_t
2021-02-21 15:50:28 -06:00
Scott Giese
3e982bbae7 Maintenance: ErrorReporter
convert to size_t
2021-02-21 15:49:58 -06:00
James Turner
0b0d079d51 Missed error-reporting changes 2021-02-21 19:15:55 +00:00
James Turner
462fac1933 Fix CommRadio in 8.3Khz mode, when frequency does not match channel
Fix a bug where we would copy-assign a PropertyObject, when we
actually wanted to copy the value.

Thanks to Sascha Reißner for tracking the problem down.
2021-02-21 19:15:55 +00:00
James Turner
aeca129034 NaturalEarthLoader: free the thread, oops
Used the wrong smart pointer type, use the regular C++ one now.
2021-02-21 19:15:55 +00:00
Scott Giese
641db612aa Maintenance: kln89
prevent overflow
convert atoi to stoi
2021-02-21 10:49:20 -06:00
Scott Giese
8567209ada Maintenance: kr_87
overflow prevention
2021-02-21 10:15:15 -06:00
Scott Giese
6e64bd12e0 Maintenance: gps
overflow prevention
2021-02-21 10:07:27 -06:00
Scott Giese
cd5ec691af Maintenance: clock
Reduce type size.  Overflow prevention.
2021-02-21 09:53:08 -06:00
Scott Giese
2414397073 Maintenance: gui_funcs
Improved type choice.
Suppress compile warning.
2021-02-21 09:10:36 -06:00
James Turner
c2c4e6f126 Fix crash when menu item has no label 2021-02-21 12:13:00 +00:00
Scott Giese
edf766481d Modernize: genTransponderCode()
update to c++
2021-02-21 01:26:50 -06:00
Scott Giese
cea9ba87a4 Suppress warning: potential uninitialized variable 2021-02-21 00:40:42 -06:00
Scott Giese
eb708eb5fe Maintenance: runways
whitespace formatting.
increase buf size
convert atoi() to stoi()
2021-02-21 00:03:47 -06:00
Scott Giese
4a2cbc7389 Maintenance: HUD
prevent buffer overflow
2021-02-20 23:38:33 -06:00
Scott Giese
98e9c45287 Maintenance: yasim-test
unintialized variable correction
2021-02-20 23:04:13 -06:00
Scott Giese
4ce8be87a0 Maintenance: DefaultAircraftLocator
type correctness during comparison
2021-02-20 22:50:56 -06:00
Scott Giese
2c9e2d86db Maintenance: MPServersModel
type correctness
2021-02-20 22:29:55 -06:00
James Turner
caad29e7c8 Add error reporting to common failure points.
Not exhaustive by far, but adds many of the common failure points
witnessed on Sentry.
2021-02-20 20:06:27 +00:00
James Turner
a0ff4adbc6 Tweaks to sentry integration
Report menu item activation, and define a RAII helper for setting
the XML error reporting state.
2021-02-20 20:05:51 +00:00
James Turner
c85916d88d Add error reporting subsystem
Requires corresponding SimGear commit
2021-02-20 20:05:03 +00:00
James Turner
cab0dc12a1 Remove a lingering Boost usage 2021-02-20 19:59:13 +00:00
Scott Giese
dd60a041b1 Maintenance: Yasim
unused static const char* warning.
Eliminate the variable since it is the only one defined.
2021-02-20 11:12:15 -06:00
Julian Smith
32a066f810 Fixed replay-from-url bug.
Need to use simgear::HTTP::FileRequestRef shared pointer, otherwise
HTTPFileRequest will delete it after the transfer.

Also changed callback to a lambda to match reinstated simgear API.
2021-02-20 13:54:04 +00:00
Julian Smith
309e28c6d7 src/Viewer/viewmgr.cxx: removed asserts on inputs from aircraft/nasal code.
The fgfs executable is the unit within which it makes sense to check
preconditions with assert. We are not in control of aircraft code in the same
way.

This allows debug build of test-suite to check handling of out-of-range view
numbers.
2021-02-19 22:27:34 +00:00
Julian Smith
ca423e0e3e src/Aircraft/replay.cxx: downgrade recording indexing diagnostic. 2021-02-19 10:21:21 +00:00
Julian Smith
5b2fd572e4 src/Main/options.cxx: fixed Windows build error - use SGTimeStamp::sleepForMSec(), not sleep(). 2021-02-19 10:21:21 +00:00
Scott Giese
0019b22046 Code Maintenance - nullptr checking 2021-02-18 23:52:46 -06:00
Scott Giese
86ff18e0e6 Replay: Resolve missing mutex header 2021-02-18 23:12:31 -06:00
Julian Smith
5a70245ba9 src/Aircraft/replay.*: modified to match change to simgear::HTTP::FileRequest::setCallback().
We now use a function pointer instead of a lambda.
2021-02-18 23:21:01 +00:00
Julian Smith
f3679f121d Allow replay of Continuous recordings if --load-tape is given a URL.
E.g. for --load-tape=http[s]://foo.com/foo/bar/wibble.fgtape, we download in
the background to a file called foo.com_[MD5]_wibble.fgtape, where [MD5] is an
8-character hash of /foo/bar.

We assume any existing file contains valid data and only download any remaining
data (by specifying an http Range header).

Also, when loading/downloading and replaying continuous recordings at startup,
we set the aircraft and airport from the recording.

src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
    FGReplay::loadContinuousHeader()
        Loads properties from Continuous recording's header, distinguishing
        between failure due to incorrect header, or due to a truncated file.
    FGReplay::indexContinuousRecording()
        Contains Continuous recording indexing code, in a form that can be used
        in background while we are downloading.
    Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
    be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
    fgOptLoadTape():
        Modified to handle --load-tape=<url>. We start download, and read
        the header before returning, so that we can force the FDM to use the
        recording's aircraft instead of the user's default. Limit recording
        download rate if /sim/replay/download-max-bytes-per-sec is set, by
        calling new filerequest->setMaxBytesPerSec().
2021-02-18 09:32:15 +00:00
James Turner
02e0d17dbc Fix MSVC unused-var warning 2021-02-15 09:33:30 +00:00
jano
4a4117b9ab make the mp protocol send rate independant from time accel,
based on mp protocol clock.
2021-02-15 09:27:36 +00:00
jano
a28bf28ee0 Throttle Hz aligned to time-grid, add initial offset.
Allows sync of two or more FG session, if wall clock are in synch.
2021-02-15 09:11:46 +00:00
jano
7dfbcf0918 Make the steady clock and MP clock init at modelHz boundary.
This removing any fractional (of a modelHz step) part when initialising.
This allow us to sync time in different FG instances, if FPS allow.
2021-02-15 08:58:51 +00:00
legoboyvdlp R
bf26817d53 Splash screen: add counter displaying how many MBs are left to extract 2021-02-14 17:07:18 +00:00
James Turner
00dbd23bec Fix unit-tests for particles lifetime.
Missed call to ParticlesGlobalManager::clear on scenery shutdown
2021-02-14 16:40:14 +00:00
Julian Smith
31ec727872 Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.

Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.

To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.

Recording extra properties:
    This is enabled by:
        /sim/replay/record-extra-properties

    The extra properties that are recorded are identified by the property
    paths in the values of /sim/replay/record-extra-properties-paths/path[]
    properties. We record the entire tree for each specified path.

Recording of main window position size:
    We have specific support for record and replay of main window position/size.

    This is enabled by:
        /sim/replay/record-main-window

Recording of main window view:
    We have specific support for recording the view type and direction/zoom
    settings.

    This is enabled by:
        /sim/replay/record-main-view

    We record the /sim/current-view/ property tree, excluding some subtrees
    that continuously vary but are not required for replaying of the view.

When replaying, we allow separate control of what extra property changes are
replayed, with:

    /sim/replay/replay-extra-property-changes
    /sim/replay/replay-extra-property-removal
    /sim/replay/replay-main-window-position
    /sim/replay/replay-main-window-size
    /sim/replay/replay-main-view

We work around some problems caused by the use of tied properties when
replaying changes to view-number.

Window position issue:

    When replaying window position and size changes, things get a little tricky
    because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
    for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
    the position of the interior of the window; for example the y values will
    differ by the height of the window's titlebar. This can cause windows to
    move progressively further down each time they are positioned or resized.

    There doesn't seem to be a way of finding the size of a window's
    furniture directly. So instead this commit adds a new method
    osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
    wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
    following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
    for x and y position that are used for subsequent calls.

docs-mini/README-recordings.md:
    Updated to document new Continuous format.

scripts/python/recordreplay.py:
    New script to test various aspects of record/replay.

Other:

    We now create convenience softlink to most recent continuous recording, using
    SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
    Windows.

    Changed format of Continuous recordings to contain a single property tree
    in header. This is much simpler than having separate Config and Meta trees.
2021-02-13 11:38:52 +00:00
Julian Smith
1ff0ce2222 src/Viewer/sview.*: added support for damping in rotate steps. 2021-02-13 11:38:52 +00:00
Colin Geniet
9008b3194f AI: Fix unit problems for AIBase::vs
It was supposed to be in ft/min, but everything except AIAircraft was
using it as ft/sec. Change the name to AIBase::vs_fps and ensure the
same unit is used everywhere.
2021-02-11 09:27:36 +00:00
James Turner
130cd2ae41 Fix crash spotted on Sentry 2021-02-11 09:26:38 +00:00
James Turner
ab95c8149a Change code to use copyProperties 2021-02-10 13:42:50 +00:00
Guillaume Deshors
0bca9e75b0 take into account headtracking offsets in the view 2021-02-10 12:49:47 +00:00
Erik Hofman
7847418005 Differentiate between snow and wetness. Snow shows with every amount of precipitation but rain puddles only start showing up above 50mm of rain per day. 2021-02-10 11:32:12 +01:00
Stuart Buchanan
2dbf915393 WS30: Remove listener for lod-max-range 2021-02-09 10:31:46 +00:00
Erik Hofman
4894497ce2 Update the way the snow thickness is calculated, otherwise there will never be snow 2021-02-07 16:03:08 +01:00
James Turner
ba8b25db5f Update particles API again
Rename methods to make it clear they do additional work
2021-02-07 11:36:06 +00:00
James Turner
0cc465d39f Tweak Natural-earth loading to reduce DB contention
Reduce ‘SQLITE BUSY’ issues with multiple running copies of FG
2021-02-05 11:14:34 +00:00
James Turner
b915d02f55 Fix crash in AI/Traffic code
Sentry-Id: FLIGHTGEAR-139
2021-02-04 16:11:08 +00:00
James Turner
2ae51b69b0 Sentry: fix UUID init 2021-02-04 11:49:25 +00:00
James Turner
3e9a9e3730 Attempt to log bad allocation errors at source
Use a std::set_new_handler to capture allocation failures at their
origin, instead of in the main loop exception handler
2021-02-04 11:49:25 +00:00
James Turner
7214d95040 Sentry: suppress more XML errors from reports
DOn’t report Ground-net or traffic schedule XML errors, and add
another XML message whitelist entry.
2021-02-04 11:49:25 +00:00
James Turner
7f5f7e0b11 Sentry: add reporting for common path errors
Adding bread-crumbs preceding common failures seen on Sentry, around
addon and aircraft loading.
2021-02-04 11:49:25 +00:00
James Turner
b86baa68c0 Launcher: quit if OpenGL 2.1 isn’t available
Avoid crashing if no OpenGL drivers are available, instead show a
warning message to alert the user.

Sentry-Id: FLIGHTGEAR-76
2021-02-04 11:49:25 +00:00
James Turner
85f870f607 macOS: don’t crash if menu items are used early
Because we create the menubar earlier on macOS, the user can select
items before Nasal is loaded, causing a crash.
2021-02-04 11:49:25 +00:00
James Turner
f5410cee9c Sentry: whitelist one more XML message 2021-02-04 11:49:25 +00:00
James Turner
9e07b57c45 Launcher: additional bread-crumbs around catalogs 2021-02-04 11:49:25 +00:00
James Turner
203a9fe918 Launcher: fix a QML bug setting animation easing 2021-02-04 11:49:25 +00:00
James Turner
f45f41d4ec Guard against crash reported by Sentry
Avoid inserting null FGPositioned entries into the recent items
list, since this causes a crash in the model code

Sentry-Id: FLIGHTGEAR-1BM
2021-02-04 11:49:25 +00:00
Automatic Release Builder
6b6defbead Add getting-started tips to the launcher
QML implementation of getting started tips, with a nice styled
background box. Tips are defined+positioned inline, and displayed
when their enclosing scope is active.
2021-02-04 11:49:25 +00:00
James Turner
89de1defa0 Launcher: fix crash on slow update check
Cancel the update check HTTP request when the launcher ends, so we
don’t crash if the response arrives.

Sentry-Id: FLIGHTGEAR-DYT
2021-02-04 10:39:34 +00:00
James Turner
64b03b70a8 Clear ATCDialog instance on reset
Showed up as a variety of crashes on Sentry, due
to a stale instance of this object hanging around
after reset.

Sentry-Id:FLIGHTGEAR-T5
2021-02-04 10:38:26 +00:00
James Turner
6caadf2450 Sentry: reduce reporting spam for shader/Metar
Tune the exception logic to avoid many spurious reports from manually
entered METAR, and from missing shaders being probed repeatedly.
2021-02-04 10:37:55 +00:00
James Turner
9f18ccd425 Catch XML errors loading rwyuse.xml 2021-02-04 10:35:44 +00:00
James Turner
3fd54b2477 macOS: detect and warn if running translocated
Translocation forces us to rebuild the nav-cache each launch, and might
mess up some other details, so let’s warn the user they should copy
the app to Applications or similar.
2021-02-04 10:34:59 +00:00
Automatic Release Builder
31bb36b347 Increase log-level of language messages
This is to help in-field debug of incorrect language selection, eg
as reported by Sidi Liang
2021-02-04 10:31:08 +00:00
Automatic Release Builder
f1ab977ceb Avoid double-invoke of Launcher Fly! button
If the user double-clicks, and their system is slow, the action can
fire twice, which then breaks because we add options twice.

Sentry-Id: FLIGHTGEAR-HKV
2021-02-04 10:30:59 +00:00
James Turner
d57bc67420 Particles: changes to support new API in SimGear
Matches corresponding SimGear rewrite of global particle manager code.
2021-02-03 21:11:00 +00:00
Guillaume Deshors
3e2233cba7 create a new prop to control OSG autoadjust of aspect ratio when stereo view is split 2021-02-03 09:43:29 +00:00
Stuart Buchanan
54acb84f6f WS30: Add better controls for LOD
Use SGSceneFeatures to set VPB properties
2021-02-02 15:17:44 +00:00
Erik Hofman
f700d46452 Slightly alter the way th season property is calculated. 2021-02-01 16:18:17 +01:00
Julian Smith
3233f85833 src/Viewer/renderer.cxx: Avoid warning about initialisation of virtual base class.
In VisibleSceneInfoVistor's copy constructor, explicitly initialise virtual
base class osg::Object.
2021-01-30 12:48:06 +00:00
Julian Smith
2e782100c8 src/Aircraft/initialstate.cxx: fixed typo in diagnostic when --state=... is not found. 2021-01-30 12:48:06 +00:00
Julian Smith
fb027e0193 src/Scripting/nasal-props.cxx:f_setValueHelper(): improved diagnostic.
Added s_val_description() which returns string describing a naRef.
2021-01-30 12:48:06 +00:00
Julian Smith
8672a60699 src/Viewer/sview.cxx: minor improvements to Step view's tower views.
Move forward 1 metre in tower view look from, to slightly improve view of
ground near tower.

Removed incorrect attempt to move towards target in other tower views, that
didn't work.
2021-01-30 12:47:52 +00:00
Julian Smith
c59d9e039d src/Viewer/sview.cxx: in Step views, scale panning by fov/window_size, to allow fine control even at high zoom.
This means that the image on screen moves by the same distance as the mouse
(for small movements), regardless of window size or zoom level. Current mouse
drag handling in extra view windows is poor though - mouse is constrained by
screen size.

Would be good to do this for standard views as well, but the code in view.cxx
is more complex so haven't been able to figure out how.
2021-01-30 12:46:13 +00:00
James Turner
ffbf37d198 Marker beacons: support correct timing, audio sync.
Allow the option to have the marker beacon instrument use either the
correct timing, or ‘always on’ when the beacon is in range. Try to
ensure the audio is synchronised with the visual property. by using
the same timing values.

Also avoids losing sync when using the ‘audio-btn’ toggle, and increases
the update rate to allow accurate timing. Finally, switch from tied
properties to regular ones, so listeners on the beacon properties are
updated directly.
2021-01-28 21:00:51 +00:00
Julian Smith
1f5a84df0c src/Viewer/sview.hxx: updated doc comments - various limitations removed a while ago. 2021-01-27 23:24:42 +00:00
Stuart Buchanan
35c0f7d028 WS30: Property configuration VPB
Configure the VPB elevation mesh via properties:

/scenery/elevation-mesh/sample-ratio controls the elevation
mesh sampling, allowing reduction in mesh size

/scenery/elevation-mesh/vertical-scale is just for fun and
scales the mesh vertically making mountains taller.

/scenery/elevation-mesh/constraint-gap-m controls how much below
airports etc. elevation vertices are forced to be.
2021-01-27 20:03:49 +00:00
James Turner
d10d9dfadd Ensure /sim/aircraft is only the leaf ID
Keep the (possibly) fully-qualified ID in /sim/aircraft-id property

This should fix aircraft which rely on /sim/aircraft to be the
variant name.

Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2502/
2021-01-24 15:01:45 +00:00
Julian Smith
c031abe8d2 Partial fix for reset when using --composite-viewer=1.
[Marked as 'Partial' because, for me, reset eventually runs out of memory with
both composite-viewer and non-composite-viewer.]

fgStartNewReset(): pass existing composite_viewer to FGRenderer constructor so
that it is used after reset instead of us creating a new instance. Also reuse
existing osgViewer::View.

In FGRenderer::init(), don't create new osgViewer::CompositeViewer if
this->composite_viewer is already set.
2021-01-23 16:27:12 +00:00
Julian Smith
42eacf6928 src/Main/fg_init.cxx: open popup message if going readonly because of existing fgfs process.
Should avoid confusion, e.g. because terrasync being disabled.
2021-01-23 16:27:12 +00:00
Julian Smith
25e56ceee7 src/Main/main.cxx: added diagnostic if initTerrasync() fails because /sim/fghome-readonly is true. 2021-01-23 16:27:12 +00:00
James Turner
8ec91b3220 Launcher: remove obsolete winter/ALS settings 2021-01-23 14:40:00 +00:00
James Turner
73b14cd69d GPS: fix crash when failing to build RNav controller
Sentry-Id: FLIGHTGEAR-FFX
2021-01-23 14:40:00 +00:00
Erik Hofman
41587d61ee A reinit of the FGFX class left all the previous samples in the sample group in a stale state. The sample group code is robust enough to handle such a situation but they still occupy memory. So stop the inherited sample group explicityly at reinit to free the samples. 2021-01-23 12:01:47 +01:00
Erik Hofman
ed94db3e18 Remove another instances of Conditional jump or move depends on uninitialised value(s) as reported by valgrind 2021-01-22 11:07:20 +01:00
Erik Hofman
168a50756e Remove two instances of Conditional jump or move depends on uninitialised value(s) as reported by valgrind 2021-01-22 11:00:48 +01:00
Erik Hofman
b4f0e43ccc Remove season selection 2021-01-22 11:00:21 +01:00
James Turner
9e77cdf6cb Add some real TimeManager tests. 2021-01-19 17:35:12 +00:00
Slawek Mikula
354d7d02d2 #2177 - launcher - added flightplan info to summary window:
- Summary.qml - new row with Flight Plan info
- LauncherController.hxx, Launcher.qml - signals to show flightPlan & 
  exposing flight plan object
- FlightPlan.qml - add red color to information about airport mismatch
- FlightPlanController.cxx, FlightPlanController.hxx - description
  handling, support to loading flight-plan from command line argument 
  'flight-plan', saving last used dir when loading/saving flightplans
2021-01-18 12:38:58 +00:00
Colin Geniet
4f4a81d12b Submodels: Fix initial position offset
Fixes https://sourceforge.net/p/flightgear/codetickets/2521/

For submodels with rotation offsets, the rotation was applied to the
translation offset.
This is incorrect: translation offsets should be in the aircraft local
frame, and thus are not affected by submodel rotation offsets.
2021-01-18 11:45:31 +00:00
Stuart Buchanan
85f3183232 Fix Shuttle AI scenario 2021-01-17 19:13:42 +00:00
Stuart Buchanan
82356aefca Remove Rembrandt command-line options 2021-01-17 14:40:15 +00:00
Stuart Buchanan
1579258320 WS3.0: Remove setLODScale property
This scales all LOD ranges and was added in an attempt
to control WS3.0 LOD ranges.  However it badly impacts
WS2.0 draw distances, and is not the right solution
for WS3.0.  So removing.
2021-01-14 20:08:15 +00:00
Stuart Buchanan
24e50def19 WS3.0: Remove duplicate elevation constraints
Elevation constraints are now added by the ReaderWriterSTG
for all OBJECT entries, so aren't explicitly required for
the .icao loader.  This also allows us to clean up the BVH
generation, as the constraint is added after the model loading
is completed and the BVH policy applied.
2021-01-14 11:33:56 +00:00
Stuart Buchanan
cb90785810 WS3.0: Place airports based on apt.dat entry
Previously WS3.0 airports could be placed via .stg
file.

Now they are OBJECT entries rather than OBJECT_STATIC
and the placement information is taken from the apt.dat file.

Also added as elevation constraint for WS3.0 terrain.
2021-01-13 20:29:00 +00:00
Erik Hofman
bb21d4a870 Better handle Spring coloring of the scenery. It is a bit abrupt, but then again so is the start of the growing season. 2021-01-10 15:21:55 +01:00
Eatdirt
4c1f921156 Remove the Moon and Sun illusion effects 2021-01-10 13:03:33 +00:00
Eatdirt
e385fa4ecc Fix apparent size of Moon and Sun (too large by a factor of two) 2021-01-10 13:03:20 +00:00
Bertrand Coconnier
d3a11d72bb Always set useDefault to false when calling SGPropertyNode::tie()
Setting useDefault to true is equivalent to using unitialized variables we are getting whatever is currently in the memory whether it is relevant or not.
2021-01-09 18:51:50 +01:00
Bertrand Coconnier
12996087de Fixed the initialization of the struct addrinfo. 2021-01-09 17:53:28 +01:00
James Turner
d1f35253e2 Tooltips: wait for commands to be registered
Avoid invoking the tooltip commands prematurely on startup. Requires
corresponding FGData update.
2021-01-08 19:34:07 +00:00
James Turner
3b3e69e358 Quiet some noisy log messages 2021-01-08 19:33:10 +00:00
James Turner
9b25e25935 Remove an unnecessary SG_ALERT 2021-01-07 09:57:47 +00:00
James Turner
a8351bd544 Reset: avoid terraSync warning
Avoid the old value being set, which causes the ‘terrasync-dir not
saved’ warning to appear incorrectly on reset.
2021-01-07 09:57:30 +00:00
James Turner
a4aa7595c0 GPS: bool return from RNAVWayptController::init
avoids an exception throw when the controller fails to init, which
avoids us breaking the stack when called via setMode, etc. Showed
up as error reports on Sentry.
2021-01-07 09:56:41 +00:00
James Turner
af387107a3 CPDLC updates from Henning 2021-01-06 15:46:56 +00:00
Henning Stahlke
527f58d353 Refactored CPDLP. 2021-01-06 15:46:56 +00:00
James Turner
06bd0708b9 Festival: Fix volume/pitch/speed after preamble
Fix from Antonello: when we send a premable to Festival, we need to
set the parameters afterwards. Re-order the code so this occurs
automatically.
2021-01-06 14:06:27 +00:00
James Turner
a9323432d0 Change JSBSim MatrixException base type
Make this exception inherit std::runtime_exception, so that it’s
caught by the ‘normal’ exception cases in FG boostrap.cxx

This is the only exception I can find in the codebase, which does not
inherit from either std::exception or std::string, so this is to fix
‘unknown exception’ errors reported in the wild.

Sentry-Id: FLIGHTGEAR-1C
2021-01-04 11:34:48 +00:00
James Turner
984e88bddd LaRCSim / UIUC fixes to make the Wright flier work
We had missed some places which needed a config.h include, to ensure
ENABLE_UIUC is set.
2021-01-04 10:56:42 +00:00
James Turner
34d4462327 Fix Festival support in FGVoice
Send a real (Lisp) command to check if Festival is running, instead
of SayText. Antonello (RedGriffin) reports this works better.
2021-01-04 10:29:20 +00:00
James Turner
f5eadf2e37 Event-input: Change reporting of failure to open
Don’t use an exception here, not needed and makes for noise on the
reporting backedning.
2021-01-01 22:40:24 +00:00
Julian Smith
e1caf04b41 src/AIModel/AIManager.hxx: added comment about loadScenarioCommand()'s return value. 2021-01-01 17:54:10 +00:00
Julian Smith
380ecdf8ba src/Viewer/viewmgr.*: added asserts, diagnostics and checking for out-of-range view numbers.
It seems that some aircraft sometimes incorrectly pass view indices rather
than numbers resulting in out-of-range access to FGViewMgr::views[]; See
flightgear-devel thread with subject "View crash (after loading errors)".

With this commit, if we are given an incorrect view number, we output a
diagnostic with SG_ALERT, assert fail, and cope with the problem. Arguably we
could do something more serious such as opening a popup or throw an exception.
2021-01-01 17:54:10 +00:00
Julian Smith
b38a5c95d4 src/FDM/JSBSim/input_output/FGfdmSocket.cpp: avoid warning about zero initialisation. 2021-01-01 17:54:10 +00:00
Julian Smith
abfb90db32 src/Airports/runwayprefs.cxx: avoid signed/unsigned comparison warning. 2021-01-01 17:54:10 +00:00