1
0
Fork 0
Commit graph

12119 commits

Author SHA1 Message Date
Julian Smith
5ef60c33c6 src/Network/props.cxx: with key=value, allow value to contain '='. 2021-12-08 21:18:01 +00:00
Julian Smith
a98325e9d1 src/Aircraft/replay-internal.cxx: include file size in tape preview information. 2021-12-08 21:18:00 +00:00
Julian Smith
dd9f4ac890 src/: fail --load-tape-create-video if video encoding fails.
Also fail video encoding if output file already exists.
2021-12-08 21:17:45 +00:00
Julian Smith
dd7cbf56cc src/Aircraft/: interpolate view properties when replaying.
This might avoid some uneven changes to viewing angle when replay frame rate
differs from recording frame rate.
2021-12-08 21:17:16 +00:00
Julian Smith
1ffc9fb6bf Added support for auto video creation when replaying Continuous recordings.
If specified we start video encoding when replay starts, and stop video
encoding when we reach recording end.

This is supported with --load-tape on the command line and from the 'Load tape'
dialogue.

src/Aircraft/continuous.cxx
src/Aircraft/continuous.hxx
    If stopping replay with auto create video, then stop video encoding and
    restore original /sim/time/fixed-dt if we changed it.
src/Aircraft/replay-internal.cxx
src/Aircraft/replay-internal.hxx
    When starting replay, call view_mgr->video_start() and set
    /sim/time/fixed-dt if specified.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
    loadTape(): added bool create_video and double fixed_dt args.
src/Main/options.cxx
    Added new command-line options --load-tape-create-video and
    --load-tape-fixed-dt=<double> to allow auto create video and fixed-dt when
    replaying.
2021-12-08 21:15:49 +00:00
Julian Smith
6d3254647a Refactoring of record/replay code.
The main FGReplay subsystem class now contains just the public API for
record/replay, plus a pointer to instance of new ReplayInternal implementation
class. Also moved some Continuous-specific code into new source file.

src/Aircraft/CMakeLists.txt
    Updated for new files.
src/Aircraft/continuous.cxx
src/Aircraft/continuous.hxx
    New, code specific to Continuous record/replay.
src/Aircraft/flightrecorder.hxx
    Minor changes.
src/Aircraft/replay-internal.cxx
src/Aircraft/replay-internal.hxx
    New, contains implementation of record/replay.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
    Modified to be just concerned with public record/replay API. The
    implementation now defers to the ReplayInternal instance. Added support for
    auto create-video when loading Continuous recording.
src/Main/fg_init.cxx
    resetStatisticsProperties() is now in FGReplay, not FGReplayData - the
    latter is not in the replay.hxx header any more.
2021-12-08 10:43:14 +00:00
Julian Smith
c1a34ac4ce Added support for generating compressed video.
Uses simgear::VideoEncoder().

Added video-start and video-stop commands. We allow specification of container,
codec, quality, speed and bitrate.

src/Main/fg_commands.cxx
    Added video-start and video-stop commands.
src/Viewer/viewmgr.cxx
src/Viewer/viewmgr.hxx
    Added video_start() and video_stop().
2021-12-08 10:42:50 +00:00
Julian Smith
69344c29c0 src/Viewer/CameraGroup.*: give const access to 'CameraList _cameras;' member.
E.g. this allows callers to find Compositor(s) owned by CameraGroup.
2021-12-08 10:41:58 +00:00
Julian Smith
a77eabb9dc src/Time/TimeManager.*: in simple-time, added support for fixed fdm increment.
If in simple-time mode and /sim/time/fixed-dt is non-zero, we always increment
FDM time by fixed amount each frame, regardless of frame rate. Allows creation
of high quality videos even on slow hardware.
2021-12-08 10:40:28 +00:00
Julian Smith
3bda847f65 src/Time/TimeManager.*: added /sim/frame-number.
Useful for testing.
2021-12-08 10:40:28 +00:00
Julian Smith
b0f0700b19 src/Main/options.cxx: allow bool options to be disabled if set to 0 or false.
E.g. --disable-splash-screen=0 will not disable the splash screen.
2021-12-08 10:40:28 +00:00
Julian Smith
77c362a9d4 src/AIModel/: fixed some compiler warnings
src/AIModel/AICarrier.cxx
    Avoid warning about unused angle_tdp variable.
src/AIModel/AIFlightPlanCreate.cxx
    Increased a buffer size that was giving warning with snprintf(). Also
    always use sizeof(buffer) instead of duplicating the explicit size.
2021-12-08 10:40:28 +00:00
Julian Smith
d81445a3bb Improved some exception diagnostics. 2021-12-02 00:34:02 +00:00
Gonzalo Pesquero
04722ce9f6 Add translations on splash screen 2021-12-01 12:23:33 +00:00
Gonzalo Pesquero
cf5b724776 Add missing translation calls in aircraft download panel 2021-11-20 23:30:21 +01:00
Bertrand Coconnier
e5fe747662 Sync'ed with JSBSim v1.1.10
- Fixed an error which prevented the equatorial and polar radii from <planet> to be propagated to the initial conditions.
- The planet radii in <planet> can now be specified by the tags <equatorial_radius> and <polar_radius> which are more self explanatory than <semimajor_axis> and <semiminor_axis> (which are still valid).
- Improved the error messages returned by FGTable: the file name and line number where the error occurred are now printed.
- Check the number of <input> tags for flight controls such as <pure_gain> (GitHub issue #497). This avoids a crash when some or all <input> elements are missing.
- JSBSim now accepts 2 sign conventions for the cross product inertia (xy, xz, yz) in <mass_balance> (GitHub Pull Request #502). The sign convention is specified by the parameter negated_crossproduct_inertia which defaults to true for backward compatibility.
- Turbine engines can now windmill even before they start (GitHub issue #494 and Pull Request #509).
- Fixed a sign error in the computation of aero/h_b-mac-ft (GitHub Pull Request #508 )
- Fixed a bug where FGTable instances were not untied from the property manager during their destruction. This could lead to segmentation faults when the property manager was later destroyed.
- Exceptions raised by FGTable are now instances of the TableException class.
2021-11-20 18:23:34 +01:00
Julian Smith
5023e9786a Highlighting: cope if Highlight subsystem is not present.
This should allow things to run ok if globals->get_subsystem<Highlight>()
returns null, e.g. in a unit test or similar.
2021-11-20 17:15:58 +00:00
Julian Smith
77b4e6a713 Highlighting: changed implementation to use camelCase for method names. 2021-11-20 16:53:22 +00:00
Julian Smith
3b5bd7a5ff Highlighting: changed FGInterface::property_associations() callback to use std::function.
Replaces previous function pointer plus void*.
2021-11-20 16:53:22 +00:00
Julian Smith
0c6f4983dc Highlighting: use camelCase for method names in Highlight API. 2021-11-20 16:53:22 +00:00
SDeAstis
493a9fa60d Modified Cmake and bootstrap to porperly support exclusion of Sentry.io 2021-11-18 16:20:08 +00:00
portree_kid
6320c06e6b Stuck AI Aircraft wenn entry to runway > 105m 2021-11-16 08:38:29 +00:00
PlayeRom
db8092351d Fix --enable-mouse-pointer command line option 2021-11-15 12:01:48 +00:00
Julian Smith
a7b9721296 Fixed some gcc warnings.
src/AIModel/AIFlightPlan.cxx:
    Clarify expression with extra round brackets.
src/AIModel/AIFlightPlanCreate.cxx:
    Increased buffer size to match longest possible string.
src/FDM/JSBSim/input_output/FGOutputFG.cpp:
    Use cast to avoid comparison of int with enum.
2021-11-11 18:49:55 +00:00
Tobias Dammers
5fabf44e51 src/Instrumentation/tcas.cxx: fixed handling of Swift craft.
Altitude of Swift craft is not in transponder information.
2021-11-09 22:00:11 +00:00
Julian Smith
ec1a53d428 src/Radio/itm.cpp: avoid warnings about fallthrough in switch blocks.
Uses C==17's [[fallthrough]] attribute.
2021-11-09 22:00:11 +00:00
Julian Smith
3b902aa0a0 src/Time/TimeManager.cxx: use C++'s chrono to avoid need for platform-dependent time/sleep code. 2021-11-09 22:00:07 +00:00
Julian Smith
0571418fe6 src/GUI/GettingStartedTip.hxx: fixed clang++ warning. 2021-11-09 21:47:00 +00:00
Julian Smith
50a4d86961 Added support for performance testing by replaying recordings.
scripts/python/performance_replay.py
    New, script for replaying a recording in Flightgear and gathering
    statistics.
scripts/python/recordreplay.py
    Minor change.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
    If /sim/replay/log-frame-times is true, populate
    /sim/replay/log-frame-times/dt[] with frame times while replaying.
2021-11-08 22:44:25 +00:00
Julian Smith
217d612d6a src/Time/TimeManager.*: fixed bug when transitioning to simple-time.
We need to set _firstUpdate when /sim/time/simple-time/enabled changes to true,
otherwise there can be a delay before the FDM carries on.
2021-10-24 15:25:20 +01:00
Julian Smith
2b6ccadef6 src/Aircraft/replay.cxx: extra diagnostic if save to file fails.
Also reduced m_continuous_in_config diagnostic.
2021-10-24 15:23:58 +01:00
Stuart Buchanan
c1fc71066b WS30 Move VPB tile loading to the tile manager
Previously VPB tiles were loaded by the STG file loader.

This was not ideal as the VPB tile granularity is 1x1 degree
while the STG file loader is 20x20km.

This change makes the tile manager load VPB tiles explicitly
on range, and allows better prioritization of the underlying
terrain.
2021-10-20 23:39:59 +01:00
Tobias Dammers
c8a3f60245 Synchronize elevation-ft property in environment
This fixes some issues with Basic Weather producing invalid pressure
altitudes under some circumstances.
2021-10-20 13:34:32 +01:00
James Turner
b6e4cbbf14 Metar: add safe string storage for tied property 2021-10-20 13:25:02 +01:00
Richard Harrison
138a678a30 Carriers; support for island textures 2021-10-18 18:12:11 +02:00
Richard Harrison
533791d53a AutoTower: Remove obsolete warnings and code 2021-10-18 18:11:46 +02:00
Richard Harrison
380e647d6f Fix compile error for Highlight on windows 2021-10-18 18:11:28 +02:00
Richard Harrison
0f6341352b Added gear position in meters to yasim and jsbsim 2021-10-18 18:11:11 +02:00
Richard Harrison
be39d5b6ef Fix compile warnings 2021-10-18 18:10:40 +02:00
James Turner
d576b4c6e9 Adapt to revised SGMetar API
API is changed to use strings instead of raw pointers.
2021-10-15 15:32:11 +01:00
James Turner
c136b31791 Updated for revised SGMetar API 2021-10-15 12:14:01 +01:00
Stuart Buchanan
c92d1c01a7 WS30: Remove lod-range-factor and VPB max range
Better handled by setting the LoDScale in the camera
rather than modifying the LoD ranges themselves.
2021-10-12 21:41:11 +01:00
Julian Smith
96dee79873 src/GUI/Highlight.cxx: fixed bug in ::bind() that causes crash on startup.
We need to create sim/highlighting/enabled if it doesn't already exist.
2021-10-08 23:13:39 +01:00
b'Fernando Garc\xc3\xada Li\xc3\xb1\xc3\xa1n
5536dce0fd Merge /u/amalon/flightgear/ branch vr_3 into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/264/
2021-10-08 14:17:23 +00:00
portree_kid
8c537a911e Init of repositioned flag 2021-10-08 13:25:07 +01:00
Julian Smith
1bafe15c4c Added highlighting system.
If /sim/highlighting/enabled is true, we highlight animated objects under the
pointer, and also highlight other objects that are animated by the same or
related properties.

The intent here is to be able to give a visual indication of what cockpit
controls do or what cockpit controls affect particular aircraft objects - for
example moving the pointer over the flaps will highlight the flaps and also
highlight any controls or rotary indicators in the cockpit that are associated
with the flaps.

To make this work, we have to discover associations between properties. This
is currently done for YASim (e.g. associations between /controls/flight/flaps
and /surface-positions/flap-pos-norm) and autopilot filters (e.g. with
the 777, digital filters associate /controls/flight/rudder-nul with
/fcs/fbw/yaw/rudder-ratio-out). We don't currently gather associations between
properties in JSBSim

We also detect associations between dialogs, menus and keypresses and
properties, which is used to populate /sim/highlighting/current with
information about dialogs, menus and keypresses that are associated with the
currently highlighted nodes' properties.

Details:

src/GUI/Highlight.cxx
src/GUI/Highlight.hxx
src/GUI/CMakeLists.txt
src/Main/fg_init.cxx
    New subsystem called 'highlight', with support for registering and
    recovering links between menus, dialogs, keypresses and OSG node
    animations.

    Provides a function Highlight::highlight_nodes() which highlights
    related nodes using internal NodeHighlighting class, and populates
    /sim/highlighting/current with information about related dialogs, menus and
    keypresses.

    The NodeHighlighting class works by making nodes use an alternative
    StateSet which shows up as a distinct material on screen. We remember each
    highlighted node's original StateSet so that we can un-highlight. We update
    the material parameters using a listener for /sim/highlighting/material,
    which allows some control over the appearence of highlighted nodes.

src/FDM/flight.cxx
src/FDM/flight.hxx
    Added virtual method FGInterface::property_associations() which returns
    property associations from the FDM. Default implementation returns empty
    set. Implemented in YASim, but not (yet) in JSBSim. Uses a simple function
    pointer at the moment to avoid requring FDMs to use recent C++ features.

src/FDM/YASim/FGFDM.cpp
src/FDM/YASim/FGFDM.hpp
src/FDM/YASim/YASim.cxx
src/FDM/YASim/YASim.hxx
    Gathers information about property associations on startup such as
    /controls/flight/flaps => /surface-positions/flap-pos-norm, then
    YASim::property_associations() overrides default implementation to return
    these associations.

src/Autopilot/analogcomponent.cxx
src/Autopilot/analogcomponent.hxx
src/Autopilot/digitalfilter.cxx
src/Autopilot/inputvalue.cxx
src/Autopilot/inputvalue.hxx
    Filters now gather information about their input/output properties and
    register with Highlight::add_property_property(). For example this makes
    highlighting work on the 777, where pilot controls affect control surfaces
    only via filters.

src/GUI/new_gui.cxx
    Scan menus, keypresses and dialogs and register associations with
    Highlight::add_*().

src/GUI/property_list.cxx
src/GUI/property_list.hxx
src/GUI/FGPUIDialog.cxx
    Added <readonly> flag to property-list. If set, we don't show .. or . items
    and don't respond to mouse/keyboard.

    Used by fgdata's new Highlighting dialogue.

src/Model/acmodel.cxx
src/Model/acmodel.hxx
    Visit the user aircraft's scene graph when it is loaded, gathering
    information about osg::Node's that are animated by properties, and register
    these associations with Highlight::add_property_node().

src/Viewer/renderer.cxx
    When scanning for pick highlights, use Highlight::highlight_nodes() to
    highlight animated objects under the pointer and related objects.
2021-10-08 06:13:04 +01:00
Julian Smith
95ea8248c8 src/Autopilot/digitalfilter.hxx: removed unused members. 2021-10-06 12:18:44 +01:00
James Hogan
bad7047c36
VR: Visibility mask support
Update osgXR to 0.3.3 which provides support for visibility masks using
the depth buffer, and extend VRManager to support them.

The following properties are added:
 - /sim/vr/openxr/extensions/visibility-mask: This exposes whether
   visibility masks are supported by the current OpenXR runtime, and
   maps to osgXR::Manager::hasVisibilityMaskExtension().
 - /sim/vr/visibility-mask: This allows visibility masks to be enabled
   and disabled, and maps to osgXR::Settings::setVisibilityMask() via a
   listener.

Finally we inform osgXR that it should use SimGear's newly defined
LEFT_BIT and RIGHT_BIT NodeMask bits for the visibility masks using
osgXR::Manager::setVisibilityMaskNodeMasks(). This allows a single
stereo camera to have a visibility mask for each eye.
2021-10-05 23:44:27 +01:00
PortreeKid
cf4801e11c * Improved lead distance & handling of sharp turns
* Takeoff leg respects displaced threshold
2021-09-30 11:20:11 +01:00
James Turner
8574b4f1bc Launcher: improve local acft rescan behaviour 2021-09-30 11:19:41 +01:00
Julian Smith
3e7e970e5d src/Instrumentation/tcas.*: condensed checking of transponder.
Transponder-checking code is now done in new static function
checkTransponderLocal() which also sets altitude via an out-param. This
avoids duplicate string comparisons in the previous checkTransponder() and
getAltitude() functions.

Also check for controls/invisible for all aircraft, which could allow ignoring
of AI and Swift aircraft in future.

TCAS::ThreatDetector::checkTransponder() now simply calls
checkTransponderLocal() with a dummy altitude out-param; it doesn't appear to
be used so could probably be removed.
2021-09-25 10:56:06 +01:00
Michael Danilov
9b05b2f941 src/Instrumentation/tcas.*: improved treatment of AI, MP and Swift aircraft.
Change the assumption that velocity < 40kt implies the transponder is off, to
only apply to AI aircraft, because exact information is available for other
(i.e. multiplayer and swift) aircraft.

Add new check for multiplayer/swift aircraft where if the altitude is -9999, we
treat the transponder as off.

With swift and multiplayer aircraft, use the transponder altitude information,
not the sim's internal altitude data for the aircraft.
2021-09-25 10:56:06 +01:00
James Hogan
7db47beb0e
VR: Implement mirroring of VR to desktop
Set up the default camera as a mirror of the VR view when needed, using
a new CameraInfo flag named VR_MIRROR based on a camera property
"vr-mirror" which is set on the default camera group. When set this flag
causes the compositor to be constructed (and reloaded) using
buildVRMirrorCompositor() and osgXR's mirror camera setup code, rather
than the usual Compositor::create().
2021-09-12 00:02:44 +01:00
James Hogan
7bea10a8e4
VRManager: Add mirror properties
Implement VR mirror properties and associated getUseMirror() accessor:
 - /sim/vr/mirror-mode: This will allow the user to control the VR
   mirror via a GUI.
 - /sim/vr/mirror-enabled: This isn't written, but is used by
   getUseMirror() in combination with isRunning() to determine whether
   the mirror should be used.
2021-09-11 23:49:25 +01:00
James Hogan
04c6821b8c
CameraGroup: Reset compositor order offset on reload
Use the newly added simgear::Compositor::resetOrderOffset() to reset the
order offset counter with each compositor reload. This prevents the
counter increasing indefinitely, which soon results in render orders
beyond those set statically for the GUI and upcoming VR mirror.
2021-09-11 18:05:27 +01:00
James Turner
07dfb6496c Allow aircraft directory name validation.
Patch by Michael Danilov: allow an aircraft set XML to define the requied
directory name, and if one is provided,  validate the actual name against
this. This catches common issues where a manually downloaded aircraft
has the wrong name and some assets will therefore not load.

SF-Ticket-ID: https://sourceforge.net/p/flightgear/codetickets/2647/
2021-09-06 16:05:09 +01:00
Lars Toenning
f00d843c8f swift: COM volume support 2021-09-06 14:12:42 +01:00
b'Fernando Garc\xc3\xada Li\xc3\xb1\xc3\xa1n
c50fe8de07 Merge /u/amalon/flightgear/ branch vr_1 into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/253/
2021-09-03 22:19:11 +00:00
James Hogan
db4525abf9
VR: Implement minimal VR support
Implement support for virtual reality headsets via version 0.3 of the
osgXR[1] library I've been working on which uses OpenXR.

Add a new VRManager class based on osgXR::Manager to implement its
callbacks. When osgXR needs a new view created, we build a new camera in
the default camera group, and notify osgXR of each new "scene" typed
render pass. It also hooks into the CameraInfo's new compositor reload
callback to ensure osgXR is updated when the compositors are reloaded.

VR settings are controlled by properties, and new --enable-vr /
--disable-vr options are implemented to enable/disable VR at start.

This is enough to get basic VR for looking around the cockpit, but more
work will be required to support a desktop mirror of VR view, VR splash
screen, VR GUI, controller interaction, and correct positional sound.

[1] https://github.com/amalon/osgXR
2021-09-03 12:09:20 +01:00
James Hogan
dcdda1044a
VR: Find the osgXR library
Allow the osgXR[1] library to be found and linked against. We'll use
this to implement VR in FlightGear.

[1] https://github.com/amalon/osgXR
2021-09-02 22:29:09 +01:00
James Turner
90f14626f5 Guard against a possible crash in TowerController 2021-09-02 11:29:02 +01:00
Fernando García Liñán
08aed1ccc8 Canvas: Do not hold a reference to the GUI camera
It might be not be valid anymore after a reset. Just query it when needed.
2021-08-31 18:15:28 +02:00
PortreeKid
f1a44c98df AI Improvements
* Relax runway exit route requirement to 80°
* Ensure parking is only reset if airport for AI aircraft has changed
* Heading Error signed and arrival lead distance
2021-08-31 09:43:24 +01:00
James Turner
06c03a0672 Tolerate Aircraft/ prefix in preview paths
Reuqested by Jonathan R, allow Aircraft/<acft-dir>/foo paths to work
for preview iamges.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2644/
2021-08-31 08:57:18 +01:00
Julian Smith
74dd221e60 src/Viewer/splash.cxx: removed CompositeViewer startup message. 2021-08-29 23:13:32 +01:00
Fernando García Liñán
83b0a31b76 Canvas cameras are slave cameras instead of scene graph cameras
This was a long-standing issue where Canvas cameras were rendered
multiple times, once per slave camera. In the case of the Classic
pipeline they were being rendered twice.

Making them slave cameras has the issue of them not being shared
across GraphicsContexts anymore, so it's not possible to see Canvas
displays in extra CameraGroup windows. This is fixed by using OSG
context sharing feature and sharing the initial windows' context
with all subsequent windows.
2021-08-27 18:34:19 +02:00
Julian Smith
11426c8177 src/Scripting/NasalSys.cxx: simplified FGNasalSys::logNasalStack(). 2021-08-26 22:24:12 +01:00
James Hogan
e25a560591
CameraGroup: Add compositor reload callbacks
Add a compositor reload callback object to CameraInfo, with callbacks
for just prior and after the CameraInfo's compositor is reloaded by
reloadCompositors().

This will allow VR cameras to be reconfigured after a reload.
2021-08-23 16:00:52 +01:00
James Hogan
9e430b3fc2
CameraGroup: Add removeCamera()
Add removeCamera() method to CameraGroup to find and remove a single
CameraInfo.

This will allow cameras created for VR to be dynamically reconfigured.
2021-08-23 16:00:52 +01:00
James Hogan
7a096d9835
CameraGroup::buildCamera(): Return CameraInfo*
Make CameraGroup::buildCamera() return the new CameraInfo* so the caller
can make adjustments.
2021-08-23 16:00:52 +01:00
James Turner
45d969f319 Add tests cases around bug 2616
Can't reproduce this, but capturing in a unit-test just to make sure.

SF-Ticket: https://sourceforge.net/p/flightgear/codetickets/2616/
2021-08-21 13:09:39 +01:00
Michael Danilov
985abe8d43 Typo in "Addon-config: don’t overwrite autosaved props" (ticket 2059) 2021-08-20 16:53:37 +02:00
James Turner
049b3dcba6 Fix Map initial position
Since 'center on aircraft' is now persistent, we need to expliictly init
this value when showing the map. Thanks to Michael Danilov and Colin
Geniet for the fix.

SF-Id: https://sourceforge.net/p/flightgear/codetickets/2637/
2021-08-20 11:26:13 +01:00
Michael Danilov
732548bcb1 HUD: make vertical gauges look the same as horizontal ones (ticket 2374). 2021-08-19 18:00:52 +02:00
Michael Danilov
abbfa6578c Property browser: show values assigned to property folders in non-verbose mode as well (ticket 2479). 2021-08-19 17:47:20 +02:00
portree_kid
96b9cfabe0 Improved searching of Runway exits 2021-08-16 12:27:47 +01:00
James Turner
4b7ef90b31 YASim: Add Lift/Drag to test output
Patch from Huntley Palmer
2021-08-11 11:40:16 +01:00
James Turner
86899de63b Fix some comments in the runway_remap change 2021-08-11 11:38:14 +01:00
Julian Smith
7ed93e4e64 src/Viewer/sview.*: fixed various issues with extra view windows.
Reversed the affect of mouse in some legacy views, e.g. Helicopter and Pilot
views now move in expected direction for mouse drags. Also increased scale
of movement to make things similar to the default view system.

In chase view etc, apply mouse movements after damping of aircraft orientation,
previously mouse movements were getting damped.

Removed SviewStepFinalToTarget. SviewStepFinal now automatically aims at target
if new posdir.target_is_set flag is true.

Improved double views: Avoid duplicate SviewStepCopyToTarget step. Disabled
mouse drag handling - was gives weird results and is not required or
helpful. Be more consistent in using target position if available, otherwise
eye position; for example using a Helicopter view to create a double view now
uses the target of the helicopter view, not the eye point, which works much
better.

Removed internal use of SviewStepFinal from SviewStepDouble - used to be
special case.

Split mouse drag handling out of SviewStepRotate into new SviewStepMouseDrag.

Simplified last-pair code - both last-pair and last-pair double find position
and target in the same way.
2021-08-06 21:48:32 +01:00
Julian Smith
d860a79901 src/Main/fg_commands.cxx: reduced extra-view diagnostics. 2021-08-06 19:20:34 +01:00
Julian Smith
281fe6d47d Fixed some snprintf buffer size warnings and added comments about possibly unused variables. 2021-08-06 19:20:18 +01:00
legoboyvdlp R
01216e4c19 Add ability to override airport runway definitions by creating a rwy_override.xml file which allows procedures to be loaded for airports which have new runway numbering 2021-08-04 10:27:40 +01:00
James Turner
20155df3f6 Sentry: don't catch cmd-line aircraft init failures
Only worry about mis-config which occur when using the
launcher, since basically all non-launcher ones look to be user errors.
2021-08-04 09:53:13 +01:00
James Turner
fc40caf40e Launcher: remove obsolete variable
Also imrpvoe abandoning behaviour of the natural earth loader.
2021-08-04 09:51:23 +01:00
James Turner
f72983e1a6 TrafficL Avoid crash on invalid active runway
Work-around + log message when the AI flight has an invalid
arrival runway.
2021-08-04 09:08:32 +01:00
James Turner
dab9e6ba5f Launcher: fix Fly! menu enablement 2021-08-04 09:08:32 +01:00
James Turner
e58a06465c AI ATC: only use audio if enabled in the dialog
Patch by Stefan Frank, check the dialog checkbox setting before sending
messages to audio rather than text output.
2021-08-04 09:08:32 +01:00
James Turner
a79e6e46da GUI: don't warn on empty dialogs 2021-08-04 09:08:32 +01:00
PlayeRom
622ae7d329 Change "click here" links into links telling what you click 2021-08-04 09:08:31 +01:00
James Turner
073784fa03 Catch exceptions in FDM init more precisely
Rather than letting these rise to the global handler, do a more
targeted message.
2021-08-04 09:08:31 +01:00
Julian Smith
f6a11ced91 src/Viewer/FGEventHandler.cxx: reduced noisy diagnostic with custom camera-group.
Looks like SviewGetEventViewport() often returns null when using custom
camera-group?
2021-08-03 15:37:37 +01:00
Julian Smith
333c790086 src/Autopilot/pidcontroller.* added params for control of startup behaviour.
Added <startup-current> param. Default is false which preserves previous
behaviour where internal state is initialised to zero. Otherwise we initialise
internal state using the current error value, which can reduce oscillations.

Added <startup-its> param, default is zero. For the first <startup-its>
iterations we don't update the output, which can be used to cope with initial
bad data from earlier controllers.

Also refactored the code to hopefully make it clearer and modified debug
logging to output all info in a single statement and on a single line for
clarity.

For example avoid initial oscillations with:

    <pid-controller>
        ..
        <startup-current>true</startup-current>
        ...
    </pid-controller>
2021-08-02 22:38:11 +01:00
Julian Smith
8d2205ca2e src/Autopilot/digitalfilter.cxx: show subsystemId() in debug output. 2021-08-02 22:38:11 +01:00
Julian Smith
17d40cdd80 src/Viewer/FGEventHandler.cxx: fixed multi-window event-handling bug.
Ever since support for CompositeViewer was added in f62e5b9ce3,
FGEventHandler::eventToViewport() has been always calling
window_builder->getDefaultWindow() so it could decide whether an event was for
the main window or not. But if a custom camera-group was specified, there would
be no existing window called 'FlightGear' so getDefaultWindow() would create
one, which then interfered with event handling.

The fix is to change the global WindowBuilder::defaultWindowName to match
sim/rendering/camera-group/gui/window/name when we are handling a custom
camera-group, which ensures that when FGEventHandler::eventToViewport() calls
window_builder->getDefaultWindow(), it gets the main window, not a new window
called 'FlightGear'.
2021-08-02 22:38:11 +01:00
Stuart Buchanan
c542e0d427 WS30: Stop trees from growing on roads, rivers 2021-08-02 17:11:34 +01:00
Stuart Buchanan
a8aa77b1b2 WS30: Fix crash on reset caused by VPBTechnique 2021-08-01 20:52:25 +01:00
Stuart Buchanan
a3b01a1c1e Fix infinite loop on negative speed. 2021-08-01 20:51:18 +01:00
James Turner
d47442a8b2 Control over reporting of fatal errors 2021-07-31 17:23:46 +01:00
James Turner
66b5c4259e Sentry: use new SimGear reporting control 2021-07-31 17:23:46 +01:00
James Turner
a156c5a14d Error reporting: check custom scenery before FGData
Some people put custom scenery inside FGData, re-order to catch
that case.
2021-07-31 17:23:46 +01:00
James Turner
0a6c4aaf7a Launcher: fix aircraft hanagr paths
Avoid a warning by explicitly appending Aircraft suffix.
2021-07-31 17:23:46 +01:00
Julian Smith
ef96808a18 src/Main/ErrorReporter.cxx: fixed couple of warnings. 2021-07-31 10:29:11 +01:00
Julian Smith
581e7980b3 src/Network/props.cxx: use std::setprecision(16) when sending double values. 2021-07-31 10:29:11 +01:00
Julian Smith
930c77b69f src/Aircraft/replay.cxx: fix bug with end of replay end when recording multiplayer.
With Normal recordings, if we are recording multiplayer aircraft, we continue
appending to the in-memory recording while replaying, so we need to stop when
we reach the original end of recorded frames.
2021-07-31 10:29:11 +01:00
Julian Smith
6eaff10ef4 Improved normal-recording time-keeping.
New properies so recordreplay can know extent of current in-memory normal
recording:

    sim/replay/record-normal-begin
    sim/replay/record-normal-end

This is required since scripts/python/recordreplay.py improved checking of
recording length when replaying.

scripts/python/recordreplay.py
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
2021-07-31 10:29:11 +01:00
Julian Smith
7d414886e0 Added support for compressed continuous recordings.
src/Aircraft/replay.*:
    If /sim/replay/record-continuous-compression is true, we compress each
    frame's data as a separate raw zlib stream.

    Requires latest simgear's simgear/io/iostreams/zlibstream.cxx for
    decompression with ZLibCompressionFormat::ZLIB_RAW. Haven't figured out how
    to extend simgear's code to provide a compressing ostream so for now we
    have our own local compression code.

    We open popup and set sim/replay/replay-error=true if we fail to read
    compressed data.

scripts/python/recordreplay.py:
    Added test of compressed continuous recordings.

docs-mini/README-recordings.md:
    Added information about compressed format.
2021-07-31 10:29:11 +01:00
Julian Smith
08390be391 src/AIModel/: use Simgear's unit conversion constants, e.g. SG_KT_TO_FPS. 2021-07-31 10:29:11 +01:00
James Turner
df98d54948 Reduces crashes after reset
Ensure the Pager doesn't hold onto a stale request.
2021-07-29 17:54:17 +01:00
James Turner
b01beac664 Add error report for Nasal load failures 2021-07-29 08:49:32 +01:00
Julian Smith
8425a05bbe src/Main/sentryIntegration.cxx: fixed build error if HAVE_SENTRY undefined. 2021-07-28 23:17:19 +01:00
James Turner
ce237e4a74 Explicit fatal error for bad_alloc
Give the user some feedback if we're exiting due to out-of-
memory condition.
2021-07-28 13:47:15 +01:00
James Turner
e72f8e0286 Sentry: bad_alloc suppression feature
Allow supression of bad_alloc reports based on a RAII helper. This
will allow reducing backend reports for code-paths where we know bad_alloc
is handled.
2021-07-28 13:46:39 +01:00
James Turner
8535126a7d Remove Sentry XML error suppression
We now supress XML errors from reporting internally, so this can
be removed, woo-hoo.
2021-07-28 13:45:23 +01:00
James Turner
f84f4ba592 ErrorReport: heuristic for aircraft files
When we don't have an explicit attribute, check if the file path mentions the current
aircraft directory. This should fix attribution for some GUI dialogs and property rules.
2021-07-28 10:54:01 +01:00
James Turner
8853fded29 play-audio-sample command: check path
Don't try to play missing paths.
2021-07-27 16:04:00 +01:00
James Turner
383fb2a5d1 Fix a typo 2021-07-27 14:21:08 +01:00
James Turner
734f2a60d5 ErrorReport: catch BTG paths
BTG load is often delayed, so there is no STG path in the error context
2021-07-27 14:20:56 +01:00
James Turner
19a010307d Error-reporter: don't crash on reset
Sentry-Id: FLIGHTGEAR-QFP
2021-07-26 11:48:06 +01:00
James Turner
39f761e171 Terrain wetness: reimstate clamping term
Re-add this clamping of the terrain wetness value, to avoid out of bounds
values in shaders appearing as black. Thanks to Colin Geniet for the testing and fix.

SF-Id: https://sourceforge.net/p/flightgear/codetickets/2604/
2021-07-26 11:20:20 +01:00
Bertrand Coconnier
81313f4aa2 Sync'ed with JSBSim v1.1.8
- Always set useDefault to false when calling SGPropertyNode::tie()
- Mass flows can now be specified using SI unit (kg/s)
- Add a new property propulsion/fuel_freeze to freeze fuel consumption.
- Add a new flag DONT_EXECUTE_RUN_IC that can be specified to FGFDMExec::ResetToInitialConditions. When specified, this flag avoid calling FGFDMExec::RunIC when executing FGFDMExec::ResetToInitialConditions.
- Fix a bug in <linear_actuator> that resulted in erroneous output values when the input was oscillating around the zero value.
- Add an assert that forbids to set the value of FGPropertyValue when the property was specified with a minus sign.
- Fix the compatibility with recent versions of MinGW64
- Fix ws2tcpip.h casing for compilation on case sensitive OS.
- Improve the templating of FGPropertyManager::Tie().
- Expand FGParameterValue exception message (James Turner)
- TurboProp: Filters out negative powers when the propeller is not rotating
2021-07-24 19:19:14 +02:00
James Turner
364be50967 Rewrite FGScheduledFlight::processTimeString
Use modern-style parsing to tolerate different numbers of
digits in time strings.
2021-07-21 22:57:16 +01:00
James Turner
e64f70bc72 ModelMgr: catch not-found paths
When findDataFile reutrns an empty path, don't continue trying to pass
it to OSG.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2609/
2021-07-21 22:55:39 +01:00
James Turner
609eeb65e4 Fix the spoken ATIS
Ensure we create the sample group if required.
2021-07-21 18:34:19 +01:00
James Turner
16295cd536 Remove a per-frame property lookup
Cache some property nodes so the GPS doesn't do a lookup
by name each update().
2021-07-21 15:46:03 +01:00
James Turner
e2ef3dacd6 Route-manager: cache the routePath
Re-creating the route-path every update is wasteful, just cache it
until the roue changes. Since we already have similar logic for
the property-tree waypoint mirror, just piggy-back off that.
2021-07-21 15:45:13 +01:00
James Turner
12f18b325b Avoid crash on tests with no TZ set 2021-07-21 10:58:27 +01:00
James Turner
80816a205b Fixes to duplicate AI waypoint detection 2021-07-21 10:58:08 +01:00
James Turner
2915c5978f GroundNetwork: improve ATC performance
Use an unordered-map to avoid a linear scan of all segments when
blocking segments during update()
2021-07-14 15:05:27 +01:00
portree_kid
8c7ff0a486 GA Test 2021-07-13 10:52:30 +01:00
portree_kid
07cf4e93bf Logging & Pushbackspeed negative start speed 2021-07-13 10:52:30 +01:00
portree_kid
f4bc2913c1 Flightplan Test 2021-07-13 10:52:30 +01:00
portree_kid
45ac50d2b7 Time moving 2021-07-13 10:49:06 +01:00
portree_kid
3db8351928 Better Logging for bad groundnet 2021-07-13 10:49:06 +01:00
portree_kid
bd96c767d5 Logging for createPushBack, FlightPlan
createPushBack Logging
2021-07-13 10:49:06 +01:00
portree_kid
8fdc03981c Better Turnprediction 2021-07-13 10:41:30 +01:00
portree_kid
54de08a3b6 Fix #2576 Added findWithHeading 2021-07-13 10:41:30 +01:00
portree_kid
3d3ff623cd Add dump() method to AIAircaft 2021-07-13 10:41:30 +01:00
portree_kid
47ca5c251f Schedflight logging 2021-07-13 10:41:30 +01:00
portree_kid
40579bbc67 FIXME Comment 2021-07-13 10:29:03 +01:00
portree_kid
fcb7cf86c6 Errormessage for Sched time parse error 2021-07-12 16:21:19 +01:00
portree_kid
fb5848896e ALERT and not SIGSEGV when no local scenery 2021-07-12 16:19:44 +01:00
James Turner
009d86e7a6 Sentry: only report METAR parse failures once per session. 2021-06-26 16:25:33 +01:00
James Turner
8e90e4657f Sentry: add ‘updateTag’ helper to modify tags
Use this to fix reported tags in a few erroneous places.
2021-06-26 16:25:14 +01:00
Julian Smith
c872af41bf Allow AI carrier to be always tied exactly to MP carrier.
Also fixed uneven MP carrier motion.

If /ai/models/carrier[]/ai-latch is true (e.g. by MPCarrier.nas), we
set /position/* and /orientation/* in C++ every frame instead of in
nasal. For external multiplayer carriers the values are copied from
/ai/models/multiplayer[]/*, so the AI carrier follows the corresponding MP
carrier exactly. For this to be useful, multiplayer motion needs be smooth,
e.g. with /sim/time/simple-time/enabled=true.

scripts/python/recordreplay.py
    Added --carrier test - checks that multiplayer carrier moves with even
    speed.

src/AIModel/AIBase.hxx
    Added speed_fps, to be kept up to date and tied to velocities/uBody-fps
    when we are a carrier. Previously this was set from Nasal which doesn't
    do what is required when all updates happen in C++.

src/AIModel/AICarrier.cxx
src/AIModel/AICarrier.hxx
    If is-user-craft is true, we directly update /position/* every frame.

    If ai-latch is true, we don't call TurnToLaunch(), TurnToRecover(),
    ReturnToBox(), TurnToBase() etc, because our position and orientation is
    determined only by multiplayer packets.

src/AIModel/AIMultiplayer.cxx
src/AIModel/AIMultiplayer.hxx
    If an mp craft is a carrier, MP packets define velocities/speed-kts but
    set ecLinearVel to all-zeros. So we now copy across to ensure that the
    extrapolation algorithm has a velocity to work with. Previously the zero
    velocity caused very uneven motion.

    If ai-latch is true we set AI craft's position+velocities directly from
    the equivalent (extrapolated or interpolated) MP position, every frame. We
    also set AI craft's orientation. And we copy MP's uBody-fps to AI's
    velocities/speed-kts which ensures that friction works between carrier deck
    and aircraft undercarriage.

    Added logging of raw speeds implied by multiplayer packets, activated by
    /sim/log-multiplayer-callsign; used by scripts/python/recordreplay.py's
    --carrier test.

src/AIModel/AIShip.cxx
    Tie velocities/uBody-fps to new speed_fps member and set speed_fps in
    update() along with members that are tied to properties.

    Replaced code that calculated new position using heading and speed:

        Previously the new position after dt was calculated using
        ft_per_deg_lat, ft_per_deg_lon, speed_north_deg_sec and
        speed_east_deg_sec. But this was moving slightly faster than the
        specified speed.

        This was leading to incremental errors when a different Flightgear
        instance extrapolated the multiplayer position from the information in
        multiplayer packets, because the specified velocity was too small, so
        we jumped forwards when extrapolation moved to a new packet.

        The fix is to use a Quaternion-based calculation to calculate movement
        in the direction specified by (heading, pitch, roll), as done by other
        code such as the view code.

src/Main/fg_init.cxx
    Moved FGAIManager to just before FGMultiplayMgr so we send latest info in
    mp packets.

src/MultiPlayer/multiplaymgr.cxx
    Fixed minimum transmit rate calculation - if transmit rate is less than 1,
    default to 1, not 10.

src/Network/props.cxx
    Use more precision when sending double-precision values e.g. to telnet
    client. Otherwise for example UTC times don't have sufficient resolution.

src/Viewer/viewmgr.cxx
    Generate internal logs of multiplayer position and speed (after
    interpolation/extrapolation) if /sim/log-multiplayer-callsign is set. Used
    by scripts/python/recordreplay.py's --carrier test.
2021-06-25 11:08:12 +01:00
Julian Smith
31c7fc8565 src/Scripting/NasalSys.cxx: show source line if we get error while parsing Nasal.
Helps track down errors in Nalsa embedded inside XML - line numbers are from
start of Nasal, not start of XML file.
2021-06-25 10:32:17 +01:00
Julian Smith
97a25b79ea src/Scripting/NasalSys.cxx: avoid noisy diagnosic if running test-suite. 2021-06-25 10:32:17 +01:00
legoboyvdlp R
0a0d0adc5f De-yodify a true condition too 2021-06-24 15:29:10 +01:00
legoboyvdlp R
3ab4de1436 De-Yodify false == conditions throughout the code-base 2021-06-24 15:29:10 +01:00
legoboyvdlp R
667dc8a02a audioindex.cxx: readability improvements: remove Yoda condition and use NOT operator rather than == false 2021-06-24 15:29:10 +01:00
James Turner
788d6ab666 Attempt to catch exceptions during subsystem creation.
Part of isolating location of ‘random fatal exception on startup’
issues.
2021-06-24 15:26:47 +01:00
James Turner
c404bb6b37 Reduce warning log spam in NaN position.
Try to catch NaN SGGeod position before we pass them to the intersect
visitor, so we don’t fill the console/logs with error messages: we
catch NaNs in other places.
2021-06-24 15:24:20 +01:00
James Turner
083d364f9c NavCache: don’t crash if rebuild is abandoned
Add a flag, so we can cleanly exit/join the rebuild thread, if we
are asked to delete the NavCache during a rebuild.
2021-06-18 12:38:50 +01:00
James Turner
20e605ca13 NavCache: tolerate BUSY in prepares
This is obscure, but with multiple copies of FG running, we can
get SQLITE_BUSY when doing prepares as well as during exec/steps.
2021-06-18 10:05:42 +01:00
James Turner
bee7b0164f Fix reset hang: shut down the Emesary recipient
Requires corresponding SimGear update
2021-06-17 15:57:03 +01:00
James Turner
c31d8c4e65 Make NavData cache exception silent 2021-06-17 15:57:03 +01:00
James Turner
0243b996fe Base texture-cache-dir on actual download dir
Previously we always used the default download dir, and ignored any
user override of this. Use the active download dir as the base for
the cache dir.

Also write the cache dir to the property tree, and wipe it on a
clean uninstall.
2021-06-14 13:54:32 +01:00
James Turner
bcc728f4e5 Launcher: don’t persistent cache GUIDs
GUIDs aren’t stable across different builds of the cache, which causes
odd behaviour when switching between stable and next. Use idents and
lat-lon instead, since these should be stable.
2021-06-14 11:50:57 +01:00
James Turner
e407ba75ef Launcher: add ‘restart on exit’ option 2021-06-14 10:49:29 +01:00
James Turner
bdcb30d785 Launcher: pass catalog paths via fg-aircraft
This should enable hangar aircraft to be found when searching for MP
models
2021-06-14 10:49:04 +01:00
James Turner
fa50fe60cd Update file extension for FGData 2021-06-13 19:41:16 +01:00
James Turner
c8d5296f7b Fix a missed rename in debug builds. 2021-06-11 15:40:25 +01:00
James Turner
6232fd7978 Fix for abandoned cache rebuild dialog
Sentry-Id: FLIGHTGEAR-75G
Sentry-Id: FLIGHTGEAR-860
Sentry-Id: FLIGHTGEAR-BR2
2021-06-11 12:56:23 +01:00
James Turner
e23bf8d7d2 TerraSync: match API change
Pass the scenery path suffixes here to terraSync explicitly, to
avoid it needing to read the properties from a hard-coded path,
which is inefficient.
2021-06-11 09:59:33 +01:00
James Turner
72ec70f275 Ensure transient octrees bypass the NavCache 2021-06-11 09:59:33 +01:00
James Turner
a17180f5b0 ATCMgr: cache the destination property node
Avoid a per-update fgGetString call
2021-06-10 14:39:15 +01:00
James Turner
cf160cc925 AIAircraft: cache controls propertes
Avoid a per-update() lookup of the AI controls properties. As part
of this, bypass updatePrimaryTargetValues for the user aircraft,
where it doesn’t make sense.
2021-06-10 14:39:15 +01:00
James Turner
14b7b5d3a1 Use a node for setting local time zone string 2021-06-10 14:39:15 +01:00
James Turner
691abf25c5 ATC: fix crashes on shutdown 2021-06-10 14:39:15 +01:00
Julian Smith
411953e89b src/AIModel/AIMultiplayer.cxx: fixed some replay unevenness.
We previously ignored mp packets if their .time was very different from local
time, but this stops time-compensation (e.g. with simple-time) from working and
is unnecessary because we clean up old packets anyway.

Also removed unnecessary erase of mp packets after interpolation.
2021-06-10 07:34:50 +01:00
James Turner
d77606cbe9 FindAndCacheAircraft: better error messages
When we fail to find the request aircraft, ensure we log the paths
to Sentry. If the user didn’t supply any aircraft paths at all, or
was using a hangar aircraft, adjust the error dialog text, to make
it a bit clearer what is going wrong.
2021-06-08 17:48:20 +01:00
James Turner
9695847a00 FGCom: log more IAX messages at SG_INFO 2021-06-08 17:47:11 +01:00
James Turner
6a7de07fda ErrorReporter: fix a crash on exit found by ASan
If we exit without shutdown()-ing the error report, ensure the
error logging callback is cleaned up.
2021-06-08 17:46:05 +01:00
Lars Toenning
8a8973fe15 AIManager: Explicitly take SGSharedPtr
Otherwise a SGSharedPtr is implicitly created on ai_list.push_back(model). It's not clear to the caller that FGAIManager takes care of the passed raw pointer.

Also fixes a bug for swift using the passed dangling pointer after the created SGSharedPtr of FGAIManager got out of scope and deleted the resource.

As this commit mainly addresses the swift crash (also for backport to LTS) it doesn't fix other calls to ::attach(..) which might also use the raw pointer afterwards.
2021-06-07 12:43:50 +01:00
James Turner
2895ea8b77 GroundNet: try to reduce crashes with bad routes
Throw an exception in the condition encountered in FLIGHTGEAR-NJN
2021-06-04 16:59:12 +01:00
James Turner
7935d5d97c NavData poly-lines: split out from main Octree
Use a transient index for the poly-lines. This avoids NavCache disk
contention when multiple copies of FG race after the rebuild completes.

Should reduce locking errors early in startup.
2021-06-04 16:59:12 +01:00
Julian Smith
ef07f26023 src/Scripting/nasal-props.cxx:f_getAttribute(): added VALUE_CHANGED_UP and VALUE_CHANGED_DOWN. 2021-06-02 19:06:58 +01:00
Julian Smith
a5de1cc33f src/Main/main.cxx: updated call to SGPropertyLockControl().
We now allow restoration of previous value-changed property callback behaviour.
2021-06-02 19:06:58 +01:00
Julian Smith
23b3c21669 src/Main/main.cxx: workaround for ui callbacks without default parent callbacks.
We now set VALUE_CHANGED_DOWN on /sim, otherwise popup text does not appear.
2021-06-02 19:06:57 +01:00
Julian Smith
07b676a6c8 src/Main/main.cxx: moved property-locking control into /sim/property-locking/. 2021-06-02 19:06:57 +01:00
Bertrand Coconnier
d310b84bdf Avoid propeller spinning in the wind (issue #2581)
Some propellers could start windmilling very easily under mild wind conditions (11 kts). And in stronger wind the propeller could even generate some power and torque strong enough to turn the aircraft upside down.

This was due to the combination of:
- Propellers generating power (wind turbine) for advance ratio higher than 1.0 (is it plausible !?!)
- Powers and torques computed with ludicrously small RPMs.

So this commit basically filters out extremely small RPMs in order to avoid huge numbers resulting from division by small values.
2021-05-29 15:59:56 +02:00
James Turner
3bef9e7747 Move some ALERTS to MANDATORY_INFO 2021-05-28 11:59:10 +01:00
James Turner
cc60472d26 Ground-net errors: use a tag for the ICAO 2021-05-26 11:10:21 +01:00
James Turner
118c2095b6 Launcher: remove a log message 2021-05-26 10:24:36 +01:00
James Turner
180ad8d2d8 NavCache: avoid spurious message on rebuild 2021-05-26 10:22:59 +01:00
James Turner
34b8fbc58e Precomputed random numbers API
Use updated pre-compute API for random numbers

By Marc Eberhard
2021-05-25 12:57:07 +01:00
James Turner
4370d3d1f7 Fix another Qt forwards/backwards compat point 2021-05-24 16:45:35 +01:00
James Turner
a702fd7b27 Controls: ensure engine index is valid
Some spacecraft send out-of-range engine numbers from the JSBsim side.
Should probably be fixed in JSBsim itself but let’s check here to
keep compat with existing FDMs.
2021-05-24 15:54:17 +01:00
James Turner
bc4a2b3ab7 If-def for Qt compat forwards and backwards. 2021-05-24 15:44:19 +01:00
James Turner
f009c54773 Qt deprecation fixes 2021-05-23 20:14:19 +01:00
Julian Smith
f7704a0339 Fix some warnings about constructor initialisation order. 2021-05-23 08:18:52 +01:00
Julian Smith
837a200811 src/GUI/LauncherArgumentTokenizer.hxx: fix compile failure on recent devuan.
Avoids: error: invalid use of incomplete type 'class QVariant'.
with gcc version 10.2.1 20210110 (Debian 10.2.1-6).
2021-05-23 08:18:52 +01:00
Julian Smith
90625848de src/Main/main.cxx: support for properties locking control.
Define properties that are passed to new SGPropertyLockControl() function in
order to allow runtime control of whether we use property locking.
2021-05-23 08:18:52 +01:00
Julian Smith
2e030218ea src/Viewer/splash.cxx: show message if we are a debug build. 2021-05-23 08:18:52 +01:00
Bertrand Coconnier
d4f31c3507 Filters out negative powers when the propeller is not rotating. 2021-05-22 12:41:50 +02:00
James Turner
d3956a4af7 Add bi-directional support to the generic protocol
Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/1191/
2021-05-19 15:11:55 +01:00
James Turner
d5789b5f74 Fix an error with new OSG compilation
Ensure we include <QOpenGLContext> before any OSG headers
2021-05-19 15:10:17 +01:00
jano
804f689da8 made the --multiplay option only set sim/multiplay/tx-rate-hz for the
out command, in option curently overwrite the rate given by the out option
eg: --multiplay=out,20,localhost,5000 --multiplay=in,,,5003 end with a tx
rate of "0" and this end with the default value 10 later
2021-05-17 09:27:18 +01:00
Bertrand Coconnier
773a44c072 Tentative fix for the issue #2581 (propeller spinning indefinitely after aborting crank). 2021-05-08 18:50:34 +02:00
James Turner
2614945b8f Ground-net loading: collect which nets have problems
Log problem airports so we can fix them case-by-case.
2021-05-04 12:03:27 +01:00
James Turner
cf75ba1fe9 Fix crash in tower selection logic in empty areas.
When starting a long way from any carrier, don’t crash because no
carrier was found. Thanks to Fahim Dalvi for finding thing.
2021-05-02 16:48:55 +01:00
James Turner
4e432b3f8e Error reporter: tweak enable, is-critical logic
Disable error-reports in ‘developer-mode’, and only consider aircraft
errors critical if they happen before postinit(). 

Add logic to show the correct report when a popup is clicked.
2021-04-30 13:46:10 +01:00
James Turner
e04c179767 Environment manager: reduce log message levels 2021-04-30 13:46:10 +01:00
Bertrand Coconnier
01dd0a987d Sync'ed with JSBSim v1.1.5
- Lower the allowable minimum propeller inertia from 1e-3 to 1e-6
- Account for the vehicle angular rates in the computation of propellers local velocities.
- Apply the engine torque to the vehicle (The aerodynamic torque was applied until now but it is the engine generated torque that the aircraft is actually submitted to)
- Prevent FGPiston from sending negative powers to thrusters
- Fixed FGMagnetometer : no need to update the magnetic field every time step.
- FGMassBalance: remove a direct reference to FGGroundReactions
2021-04-30 12:15:59 +02:00
Fernando García Liñán
558a498850 Fix hotspots being shown for a single frame after startup
FGRenderer::update() happens after the CameraGroup is updated, which causes the
Compositor to use the previous frame cull mask. Setting the cull masks
explicitly during FGRenderer::update() fixes the issue.
2021-04-29 12:18:50 +02:00
James Turner
94c202375c Fix a warning spotted by Fahim Dalvi. 2021-04-28 12:09:32 +01:00
James Turner
1b4ae1e46b Launcher: detect command line scenery/acft paths 2021-04-28 11:25:49 +01:00
Stuart Buchanan
6529234abe Fix compiler warnings 2021-04-26 21:01:49 +01:00
James Turner
8085d1fa2c Clear ATC on the user aircraft as well
Avoids an assert/crash on exit, in some ATC configurations.
2021-04-26 11:14:06 +01:00
James Turner
a458d46349 FGCom: don’t crash if properties change before postinit
Check the _initialized flag inside the listener, to avoid a crash
if Nasal sets fgcom properties during its startup, which happens
before FGCom runs its own postinit()

Ticket: https://sourceforge.net/p/flightgear/codetickets/2574/
2021-04-26 10:18:47 +01:00
James Turner
8a33f86e46 Error-reporting: improve UI/display behaviour
Assess how critical the error is, and based on this, show a popup
instead of the dialog in some cases. Add commands to allow delayed
display of the main dialog, and stepping through multiple error
reports in the dialog.

Also add a new error category for shader errors, since these are
always emitted from the render thread and we can’t easily attribute
them to an aircraft, scenery or core feature.
2021-04-25 19:18:56 +01:00
James Turner
e8952b6c0f Update tests for revised Subsystem API 2021-04-25 19:18:56 +01:00
James Turner
e6307b1494 Fix dumb inverted logic commit 2021-04-25 19:18:56 +01:00
James Turner
6e42b9ae02 Attempting to fix AIAircraft/controller crash
Add an assertion that controller has been cleared before the AIAircraft
destructor is run. If it’s not, then we are too late, don’t try to
sign off since the controller is probably gone.

Sentry-Id: FLIGHTGEAR-15
2021-04-25 19:18:56 +01:00
James Turner
14d01ccffe Panel/cockpit loading: report errors 2021-04-25 19:18:56 +01:00
Richard Harrison
ba783ccce9 AI Carriers: tidy and resolve ctor order
Tidying up:

* change to use direct initializtion
* put all of member variables in alpha order
* adjust init spacing to make init values clear.
* change all member variables to start with an underscore. The reason for this isn't clear but some had an underscore and some didn't; so although I don't know what the convention was intended for this seems to be the appropriate changes.
2021-04-25 17:30:21 +02:00
James Turner
a47d126ba5 Autosave loading: suppress XML errors 2021-04-21 21:57:55 +01:00
James Turner
e1a9d27ca6 Generic protocols: suppress XML errors 2021-04-21 21:57:10 +01:00
James Turner
a1b5f452e3 Input-device configuration: report config errors 2021-04-21 21:56:52 +01:00
James Turner
fba1e9fa61 YASim: fix warnings from bind()
Add a version of fgUntie which is quiet, if the property does not
currently exist.
2021-04-21 21:56:33 +01:00
James Turner
8aec2710b6 Nasal / Emesary: explicitly init the recipient
Sync with the updated SimGear APi for this, explicitly init the
recipient before the main loop starts.
2021-04-21 12:50:16 +01:00
Richard Harrison
3ab197a000 Active Tower improvements.
Previous commit removed the logic that sets the tower position and altitude; this commit fixes this.

Also added limits and default for tower altitude because there are a lot of towers that are at the same altitude as the airport; this is clearly a lack of data. Also there are some towers that are ludicrously high (e.g. KLSV). This commit defines a reasonable minimum and maximum values for tower altitude; together with a default altitude which will be added to the airport elevation when the tower altitude is outside of these ranges (above airpot altitude).

---------------
I used the following queries can against the navdata cache to figure out what sensible values were:

to locate overly tall towers

  select a.type, a.ident, a.name, (p.elev_m - a.elev_m) from positioned as p
    inner join positioned as a on a.octree_node = p.octree_node
    where p.type=22 and a.type=1 and abs(p.elev_m - a.elev_m) > 100

to locate towers at ground level:

  select a.type, a.ident, a.name, (p.elev_m - a.elev_m) from positioned as p
    inner join positioned as a on a.octree_node = p.octree_node
    where p.type=22 and a.type=1 and abs(p.elev_m - a.elev_m) < 0.1

to calculate the average tower height

  select avg(p.elev_m - a.elev_m) from positioned as p
    inner join positioned as a on a.octree_node = p.octree_node
    where p.type=22 and a.type=1 and abs(p.elev_m - a.elev_m)
2021-04-19 18:04:47 +02:00
Julian Smith
68e6527574 src/AIModel/AIMultiplayer.*: split out some code from FGAIMultiplayer::update(double dt).
Moved motion test code into separate function and removed some now-unnecessary
logging.

Moved extrapolation code into separate method.

Converted some stray tabs into spaces.
2021-04-18 17:17:00 +01:00
Julian Smith
7753ce229d Fixed uneven replay of user vs multiplayer aircraft.
FGReplay was using time t, AIMultiplayer was using t+dt. The fix is to make
FGReplay also use t+dt.

scripts/python/recordreplay.py
    Make --test-motion-mp test for this problem - we check that user and mp
    aircraft are a constant distance apart when replaying.

src/AIModel/AIMultiplayer.cxx
    Create properties showing distance moved since start by user and mp
    aircraft, which can then be tested by recordreplay.py.

src/Aircraft/replay.cxx
    Increment current_time by dt before calling replay(current_time), to
    ensure that replay() sees the time as is later used by AIMultiplayer (via
    /sim/replay/time).
2021-04-18 12:12:50 +01:00
Julian Smith
3e57ba3332 src/Aircraft/replay.cxx: fixed potential segv when moving packest between medium/long term store. 2021-04-18 12:12:50 +01:00
Julian Smith
967cff2b6f src/Model/acmodel.cxx: Fixed broken aircraft sound after change to ordering of subsystems.
Moved creation of FGFX() from FGAircraftModel constructor into
FGAircraftModel::init().

Thanks to Colin Geniet for bug report and suggested fix.
2021-04-17 19:24:05 +01:00
Richard Harrison
d92da2cb17 Restore shared pointer in checkCarrierSceneryLoaded
I'd removed this as part of testing and this restores it back to how it should be.
2021-04-17 09:32:30 +02:00
James Turner
4096f354df Fix compile error when sentry is enabled 2021-04-16 23:14:14 +01:00
Richard Harrison
522d7e8450 Finish 2021-carriers-and-ai-part-1-towers
Carrier improvements

- Calculate lineup deviation (degrees left/right)
- Position for touchdown added (for more accurate lineup and glideslope deviation checks)
- LSO position and Tower position added (for views)
- Better logic for controlling the FLOLS
- Added ability to start on a specific course (works better
  with the launcher if the carrier starts on a recovery course
  when positioning in air for recovery (approach)
- Support for normal, tower, LSO views (via controls/view-index)
- Aircraft can define offset for FLOLS in sim/model/reference-offset-{xyz}

Added the ability to find the nearest carrier to use as a tower

Rework of the tower position so that it updates frequently to support moving towers.

TODO: Need to review how to better implement/integrate 'sub-views' i.e. ai/models/carrier[]/controls/view-index which is actually a sub index for the tower view.
2021-04-16 22:02:11 +02:00
Erik Hofman
303e518e87 Aparently MSVC doesn't like it this way. 2021-04-16 14:44:03 +02:00
Erik Hofman
deab07d527 Do not include dds_props.hxx if CycloneDDS was not found 2021-04-16 13:22:06 +02:00
Erik Hofman
5118009d44 Add a new network protocol: dds-props which for now only operates in the output mode: request a propery value using de FG_DDS_prop scheme and provide either it's path or property index id. UsageL fgfs --dds-props=dds,out,<hz>. Testing is possible with src/Network/DDS/fg_dds_prop to request a propery path/id or src/Network/DDS/fg_dds_log to log all propery samples passed over the DDS layer. 2021-04-16 11:26:21 +02:00
Julian Smith
1aeef58ded src/Time/TimeManager.cxx: include <algorithm> for std::max.
Hopefully will fix windows build failure.
2021-04-15 22:24:15 +01:00
Julian Smith
edc6d88993 src/AIModel/AIMultiplayer.*: Improve behaviour if simple-time enabled.
Moved interpolation code into new method
FGAIMultiplayer::FGAIMultiplayerInterpolate().

FGAIMultiplayer::update():
    If simple-time is enabled, always use getMPProtocolClockSec() (or
    /sim/replay/time if replaying) as current time, so that multiple instances
    of Flightgear all using simple-time will all show user and MP aircraft
    in the same relative positions.

    When interpolating, don't special-case single iterator, instead pass the
    single iterator as both args to FGAIMultiplayerInterpolate().

    Fixed removal of outdated frames using mMotionInfo.erase() - previously
    this was not done if we had done extrapolation, and with interpolation we
    left one too many frames in place.

FGAIMultiplayer::addMotionInfo():
    If simple-time is enabled, apply compensation to MP aircraft's .time fields
    if incoming packets' .time field differs significantly from our local UTC
    time.

    This allows simple-time to work with non-simple-time MP aircraft, or with
    simple-time MP aircraft whose UTC clocks differ from local UTC clock. But
    without the guarantee of consistent rendering across Flightgear instances.

    We don't calculate lag when compensating in this way.

With these changes, scripts/python/recordreplay.py --test-motion-mp passes (the
test sets /sim/replay/simple-time").
2021-04-15 17:23:58 +01:00
Julian Smith
10be9a1b60 src/AIModel/AIMultiplayer.cxx: FGAIMultiplayer::update(): re-indented.
Old indentation was messed up, making it very difficult to work on the code.
2021-04-15 17:23:58 +01:00
Julian Smith
70647ffd35 src/Aircraft/replay.*: use getMPProtocolClockSec if /sim/time/simple-time/enabled is set.
Also, when moving MP packets around, medium_term buffer can become empty. Have
added checks for empty short, medium and long term buffers when moving packets.
2021-04-15 17:23:58 +01:00
Julian Smith
745273ab26 src/Aircraft/flightrecorder.cxx: Improved logging of raw speed values. 2021-04-15 17:23:58 +01:00
Julian Smith
cb00971dcb src/Time/TimeManager.*: added simple-time mode.
Simple-time mode is enabled by /sim/time/simple-time/enabled.

Simple-time is implemented by new TimeManager::computeTimeDeltasSimple()
method. This uses a plain UTC clock (e.g. with CLOCK_REALTIME /
gettimeofday()) for basic timing, and sets _mpProtocolClock (as returned by
getMPProtocolClockSec()) to the calculated FDM time.

We use our own fns to get UTC time and for sleeping, because
TimeManager doesn't work for us, e.g. SGTimeStamp::SGTimeStamp() uses
_POSIX_MONOTONIC_CLOCK if available so doesn't return UTC.

So getMPProtocolClockSec() now serves as a consistent time for both the
user aircraft and MP aircraft, avoiding problems where different Flightgear
instances could show aircraft in different relative positions.

For example it can be put into outgoing MP packets (which are about
the time/position of the user aircraft), and used as the target
time when calculating the position of multiplayer aircraft using
interpolation/extrapolation of incoming MP packets.

And getMPProtocolClockSec() can also be written into recordings, ensuring
that multiplayer replay will also show all aircraft with the correct relative
positions, regardless of varying frame rates at record or replay time. This is
tested by 'scripts/python/recordreplay.py --test-motion-mp'.
2021-04-15 17:23:58 +01:00
Julian Smith
ebe4f43abc src/Main/fg_init.cxx: put FGReplay after FGMultiplayMgr and before FGAIManager.
This will improve record and replay of MP packets - we will always see the most
recently-avialbale packets.
2021-04-15 17:23:58 +01:00
Julian Smith
ae9d8ce088 src/Main/fg_init.cxx: fgCreateSubsystems(): group registrations by GroupType.
This is just for code clarity.

It changes the order of construction/registration of subsystems to match the
order in which subsystem groups are called when Flightgear is running.
2021-04-15 17:23:58 +01:00
Julian Smith
d7d87479a9 In subsystem initialisation, don't default to SGSubsystemMgr::GENERAL.
Updated subsystem registrations to specify SGSubsystemMgr::GENERAL explicitly,
which makes things a little clearer.
2021-04-15 17:23:58 +01:00
Julian Smith
1789002417 src/Main/fg_init.cxx: fgCreateSubsystems(): removed unnecessary comments.
The comments in this function were redundant and took up a lot of vertical
space which affected readability.
2021-04-15 17:23:58 +01:00
Julian Smith
1d4e2a2a69 src/MultiPlayer/multiplaymgr.cxx: decreased a diagnostic. 2021-04-15 17:23:58 +01:00
Erik Hofman
f196c8418d Update the props sample description: remove an unnecessary type specifier (the union already holds it), add a sample version number and a mode to indicate reading from, or writing to, a property. The option to set a property value is reserved for future use and not yet implemented. 2021-04-15 10:11:42 +02:00
Julian Smith
04e664bb33 src/Viewer/FGEventHandler.*: fixed mouse events in non-main window without CompositeViewer.
Need to only test for sview window if /sim/rendering/composite-viewer-enabled
is true.
2021-04-11 16:40:27 +01:00
Erik Hofman
4f28e2dfff Add a proprety requester test utility 2021-04-09 14:44:33 +02:00
Erik Hofman
c88c47e1b5 No need to keep two maps: it's enough the have one PropertyList (vector) and a map 2021-04-09 14:43:20 +02:00
Erik Hofman
162f5f317d Switch to always add the GUID. Setting a string to null doesn't work for DDS samples and leads to a segmentation fault. 2021-04-09 14:42:38 +02:00
Richard Harrison
3274925cf3 Win32: reworked console opening
This is mainly for standalone FGCOM - because the error message is always shown because it is a console app and --console isn't required.
2021-04-08 21:58:52 +02:00
Richard Harrison
58d8b7faa0 minor improvement in comments in Multiplay mgr 2021-04-08 21:58:52 +02:00
James Turner
766b1f6c54 Tweak how error reports are passed to Sentry 2021-04-08 11:34:40 +01:00