1
0
Fork 0
Commit graph

12171 commits

Author SHA1 Message Date
James Turner
52731a7c04 Nasal: expose Canvas SpaceItem directly
Allow a SpacerItem to be explicitly created.
2022-03-09 16:52:19 +00:00
James Turner
77501672df Nasal expose propertyValue as a helper
Allow other code to map property values to an naRef, without exposing
the generic property node on their API. This avoids creating a wrapper
props.Node frequently for simple value access.
2022-03-09 16:52:19 +00:00
James Turner
cbd5ef9e7b GUI: XML to Nasal bridge, to keep PUI dialogs working
(Disabled by a CMake option)

This builds equivalent C++ objects to what the PUI dialogs build, with
properties exposed to Nasal. Peer objects are created by Nasal callbacks,
which can implement the various dialog functions needed to keep
compatibility, especially the ‘update’ and ‘apply’ hooks.
2022-03-09 16:52:19 +00:00
James Turner
5e0cb1b6e3 Remove some obsolete startup log messages 2022-03-09 16:52:19 +00:00
James Turner
e1cc22090d C++: use override in CanvasSystemAdapter header 2022-03-09 16:52:19 +00:00
James Turner
79f38a5742 Expose new GridLayout to Nasal
Requires up-to-date SimGear which includes the new header.
2022-03-09 16:52:19 +00:00
James Turner
a324ba4b41 Multiplayer: use standard position accessors
Replace manual property query with the standard position
accessors from FGGlobals.
2022-02-26 17:43:15 +00:00
James Turner
1ec67f05ff Multiplayer: ensure lag/ properties always exist
Create lag/foo properties used by the Pilot-list UI in bind(). This avoids
a race condition where motion info was not yet updated, but Nasal tries
to retrieve the lag properties and errors out.
2022-02-26 17:43:15 +00:00
James Turner
3fb81a34f5 Launcher: Add altenrate UI style file
Keep forgetitng to add this, commiting so it
doesn't get lost in the shuffle.
2022-02-26 17:43:15 +00:00
James Turner
16bf10b333 Avoid Marker-beacon spam on FDM NaN case
Check and bail out of marker beacon search if we are in NaN-land; this
should making it easier to trace the cause of the NaNs.
2022-02-20 16:20:04 +02:00
Julian Smith
076d0816b5 src/Aircraft/replay-internal.cxx: removed stray diagnostic in prev commit. 2022-02-19 12:41:21 +00:00
Julian Smith
2d53280fba src/Aircraft/replay-internal.cxx: fix replay of some legacy normal recordings.
Flightgear 2020.3 releases use a different encoding for multiplayer information
in Normal recordings (these are saved from in-memory recording data), which
we failed to parse. This commit restores handling of this encoding, enabling
replay of older recordings.

Also when replaying in-memory recording, don't do background in-memory record
of multiplayer information, because this gradually prunes the information that
is being replayed.
2022-02-19 12:03:56 +00:00
portree_kid
b216658ba1 AI improved entry into parking (heading and postition) 2022-02-13 20:34:17 +01:00
Torsten Dreyer
0e0acc9a10 Fix a memory leak 2022-02-11 08:50:13 +01:00
James Turner
f8afde7528 Yasim-test: add detailed lift/drag graphing
Patch by Huntley Palmer, to extend range of recorded angles, and
offer a detailed mode with finer resolution over a specific range.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2629/
2022-02-07 11:42:28 +00:00
portree_kid
82863d3f3e AI Fixes
* Fix turns (left-turn-bug)
* Better parking apporach
* CSV Logging via property
* ft vs m bug in setLeadDistance
* Split Runway Entry/Exit calculation
* Prototype wait pattern
2022-02-06 21:11:58 +01:00
Julian Smith
da7434f2e2 src/GUI/Highlight.cxx: fixed bug in FdmInitialisedListener destructor.
Use m_fdm_initialised to unregister our listener, as it waill always be valid,
unlike globals->get_props()->getNode(...).
2022-02-02 15:25:07 +00:00
b'Keith Paterson
f2d05e33e3 Merge /u/portree_kid/flightgear-portreekid/ branch topics/atc/clean_inheritance into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/288/
2022-02-01 19:29:30 +00:00
Stuart Buchanan
8bbb30225f WS30: Add property controlling splitting water mesh 2022-02-01 16:48:54 +00:00
Stuart Buchanan
13fab25b6f MR273 - Added the Milky Way onto the night sky
from Chris RINGEVAL

https://sourceforge.net/p/flightgear/flightgear/merge-requests/273/

Squashed commit of the following:

commit ea6e808e418533db1a41671c67a7873ddbfcc858
Author: Gonzalo Pesquero <gpesquero@yahoo.es>
Date:   Sun Nov 21 17:44:44 2021 +0100

    Add translations on splash screen

commit 3c47d771877743692f5d0d63e980d6694a549405
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Sat Nov 27 16:37:31 2021 +0100

    Moon direction vector in the eye frame available to shaders

commit 70728f7ea29dad75c34cad69745021ee927bea31
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Sun Nov 21 22:18:38 2021 +0100

    Add altitude to scolor object as needed by Milky Way texturing
2022-02-01 16:23:07 +00:00
portree_kid
cf0d90ef3d Cleanup Inheritance in ATC 2022-01-31 22:34:05 +01:00
Tobias Dammers
fe8b7bea21 Marker pins 2022-01-27 08:47:48 +00:00
James Turner
af0df69126 Fix MK-VIII GPWS crash caused by getStringValue
Change local variable storage to a string, to avoid a crash
in this code detected by ASan.
2022-01-24 22:26:18 +00:00
James Turner
7d3f511560 Fix a typo and re-word Univeral CRT warning.
Thanks to Scott Giese for pointing out.
2022-01-21 07:59:44 +00:00
James Turner
1114d836da Check Universal CRT version on Windows
Catch older versions of Ucrtbase.dll which can deadlock inside
setlocale() for us.
2022-01-20 20:37:44 +00:00
James Turner
fe9aadd8bb RoutePath: fix pointAlongPath for fly-overs
FIx some bugs in computing turnExitPos for fly-over waypoints,
and computing leg course when preceeeding leg is a runway.
In both cass we had an incorrect turnExitPos, so points along
the leg were incorreclty positioned.

Extend the test cases to cover this further.
2022-01-20 20:33:37 +00:00
James Turner
b50ba41a15 Standardise max-flyBy angle to 90 degrees
90 degrees is the Airbus value, previously used value of 120 is
not used  in any real-world device so let's go with 90 for now.
2022-01-20 20:30:05 +00:00
James Turner
08a70297ff GPS/RNAV: configurable max-flyBy-angle
Make the max-flyBy angle configuable, since for exmaple AIrbus uses 90
degrees. Expose this via a new gps/config property, and extend the tests
to verify that angles greater than the fly-by angle behav as fly-over
waypoints.

Extend the RoutePath code to share this configuration, so that route
visualisations match the configured angle.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2694/
2022-01-18 16:07:54 +00:00
James Turner
29ef5210a7 Fix crash when no waypt controller is created
When we don't build any wapy controller, also bail out, rather than
crashing. Jonathan could trigger this with an empty route on the A320,
although no stand-alone test-case so far.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2695/
2022-01-18 12:17:13 +00:00
Scott Giese
f198ac8d8d AIBase: Refactor
getTypeString returns string_view
object_type to strongly-typed enum
ModelSearchOrder to strongly-typed enum
2022-01-15 22:54:30 -06:00
Scott Giese
42ee4822c7 AIFlightPlan: Maintenance
virtual dtor
ensure members are initialized
double constants with double types
variable scope conflict fixed
2022-01-15 20:09:28 -06:00
Scott Giese
1816e3e551 AIManager: Maintenance
ensure all members are initialized
std::transform with back_inserter
std:find_if for collection crawl
2022-01-15 20:06:11 -06:00
Scott Giese
4dce923ef3 AIMultiplayer: Maintenance
scope conflict with parent variables
2022-01-15 20:01:58 -06:00
Scott Giese
1998ffce84 performancedb: Maintenance
default ctor, dtor
2022-01-15 20:00:00 -06:00
Scott Giese
f5acb22929 submodel: Maintenance
virtual default dtor
2022-01-15 19:59:04 -06:00
Scott Giese
912d08fa59 AIWingman: Maintenance
default dtor
2022-01-15 18:59:55 -06:00
Scott Giese
ba5ae5148e AIStatic: Maintenance
virtual default dtor
remove unused includes
2022-01-15 18:53:48 -06:00
Scott Giese
a177aa76bc AIEscort: Maintenance
default dtor
ensure all members are initialized
_max_speed was hiding parent member
double constants with double types
2022-01-15 17:49:10 -06:00
Scott Giese
a9cb94fdbd AIBallistic: Maintenance
virtual dtor
_submodel and _elevation_m hiding parent members
ensure all members are initialized
use double constants with double types
2022-01-15 17:27:59 -06:00
James Turner
9023a09739 Change Via-from-string parsing
Previosu parse had embedded whitespace which is annoying
to parse in other places, switch to using backslash to
seperate terms, similar to how navdaid offsets are defined.
2022-01-15 22:23:38 +00:00
James Turner
3cd0a3d002 Apt.dat runyway loading: fix a typo
Jonathan R spotted this typo, which means the
distance_remaining field was always NULL.
2022-01-15 22:23:38 +00:00
James Turner
d59db8ea54 FlightPlan: distuinguish routes from flight-plans
Add a bool flag isRoute to flight-plan, and use it to model
routes (which contain VIAs) from plans/legs, which do not.

Default isRoute to false, so most users only see expanded
Vias, and hence something that can be flown directly.
2022-01-15 22:23:38 +00:00
James Turner
bc09d5e64d Airways: findEnroute by Positioned
Avoid any ambiguity with naming from the string version
2022-01-15 22:23:38 +00:00
James Turner
9a08d9fcd6 AP input: add property-path support to Inputs
Allow making the AP source indirect (via a string property),
so that the actual source property can be configured or
adjusted from a -set.xml, or at runtime.
2022-01-15 22:23:37 +00:00
Scott Giese
3f2c9ece5a AIThermal/AIStorm: Maintenance
virtaul dtor
ensure all members are initialized
config.h is unused
bool assignment via int type fixed
2022-01-15 15:51:49 -06:00
Scott Giese
75941319d2 AITanker: Maintenance
virtual dtor
ensure all members are initialized
config.h is unused
2022-01-15 15:20:21 -06:00
Scott Giese
6bd7415d94 AIAircraft: Maintenance
virtual dtor
initialize members before the ctor
config.h is not used
YawTo() is unused
assertSpeed() is unused
initializeFlightPlan() is unused
getTimeString() is unused
get/set is old school
2022-01-15 15:05:11 -06:00
Scott Giese
8ba35b2553 AIShip: Maintenance
default dtor
YawTo() seems to be unused
ensure all members are initialized
_path and _elevation_m were hiding parent members
config.h is not used

TODO: string compare not via strcmp()
TODO: remove magic number
2022-01-15 14:06:39 -06:00
Scott Giese
e1d35b26d5 AIGroundVehicle: Maintenance
ensure all members are initialized
config.h is never used
double initialized with int values
default dtor
2022-01-15 13:33:50 -06:00
Scott Giese
1e40006f06 'using' statement are for source files, not header files
using-declarations are okay in headers (i.e. aliasing)
2022-01-15 01:48:01 -06:00
PlayeRom
cef5dc6544 Add anti-aliasing 8x in Launcher 2022-01-12 11:15:24 +00:00
Lars Toenning
bda359558c Update osg AI model LOD structure 2022-01-11 18:51:48 +00:00
portree_kid
b5dd4a8b6b ATC : Split out ATC Controllers 2022-01-10 20:45:10 +01:00
James Hogan
89b7f8139f
VRManager: Handle removal of prop getValue<const char *>()
Handle removal of SGPropertyNode::getValue<const char *>() in
VRManager::Listener<const char *>::valueChanged() by switching the
string listeners and VRManager setter handlers to std::string.

This fixes the following link error when VR is enabled:
ld: VRManager.cxx.o: in function `flightgear::VRManager::Listener<char const*>::valueChanged(SGPropertyNode*)':
src/Viewer/VRManager.hxx:147: undefined reference to `char const* SGPropertyNode::getValue<char const*>(std::enable_if<simgear::props::PropertyTraits<char const*>::Internal, void>::type*) const'
2022-01-08 22:47:59 +00:00
Julian Smith
76dcb745e1 src/Aircraft/: fixed bug in recovery recordings.
If continuous compression is enabled, we used to compress recovery recording's
data, without setting continuous-compression to true in recording header, so it
would fail to load.

The fix is to compress recording data only if we are making a continuous
recording.
2022-01-08 16:11:53 +00:00
Julian Smith
311961a522 src/Viewer/: reduced some startup diagnostics. 2022-01-08 16:11:53 +00:00
Florent Rougon
b191f0a57d Use current "getstart" URL
Two affected places:
  - the built-in launcher (command line options link);
  - package/org.flightgear.FlightGear.metainfo.in.

The previous link points to an old version of the manual.
2022-01-08 14:09:01 +01:00
James Turner
d5bc2d4629 Map: make POI display optional 2022-01-07 11:16:19 +00:00
James Turner
33eb4a55fb Enable POIs on Windows, for testing
Jonathan Redpath reports that POI loading seems okay for him, let's enable
it on next and see who complains, and how loudly :)
2022-01-07 11:16:19 +00:00
James Turner
d135122408 Via: add a comment 2022-01-07 11:16:19 +00:00
Julian Smith
02bda6d8d2 src/MultiPlayer/multiplaymgr.cxx: avoid compiler warning for strncpy() call. 2022-01-06 22:17:05 +00:00
Julian Smith
3351a785be src/Viewer/viewmgr.cxx: enable/disable video encoding menu items.
It doesn't look like menubar items can be enabled/disabled using <property>
or <expression>, so instead we write to the File menu's items tree
/sim/menubar/default/menu[]/name[]/enabled.

We also set /sim/video/encoding-path to '' or path of video file that we are
encoding to.
2022-01-06 22:17:05 +00:00
Florent Rougon
e3b619dd05 Fix missing include in src/Scripting/NasalFlightPlan.cxx 2022-01-06 12:11:02 +01:00
James Turner
c1e5cc3074 Improve creating VIA segments
Improve argument parsing for createViaTo, createViaFromTo to
handle Airway ghosts as well as strings. As part of this, allow
specification of the airway level explicitly when looking
up an airway.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2686/
2022-01-05 15:44:50 +00:00
James Turner
a7ae3bf6cd Fix up linkage of Nasal tests inside CppUnit
Ensure correct test backend is used inside fgfs_test_suite
2022-01-05 15:41:33 +00:00
Jonathan Redpath
2b88a3c23f Level D 767 Parser - set approach type based on approach name 2022-01-05 12:05:01 +00:00
Jonathan Redpath
0bf618d7f1 Make geodFromHash accept geo.Coord with Cartesian coords.
geodFromHash() will now respect the _pdirty and _cdirty flags. This
ensres that FGPositioned functions are protected from invalid or
outdated coordinates, and therefore from erroneous results.
2022-01-04 12:08:14 +00:00
portree_kid
1043e6f7f5 Remove FGATCDialogNew 2021-12-28 20:26:39 +01:00
Erik Hofman
d813b9cdd9 keep a copy of the string returend by p->getStringValue() in setProp until it is sent to the DDS layer. 2021-12-27 09:04:20 +01:00
Scott Giese
44177b0362 runwayprefs: make argument const 2021-12-26 20:28:31 -06:00
Scott Giese
6657e35a52 Best practice 2021-12-26 20:18:00 -06:00
Scott Giese
e38fb0c440 GroundController: remove always false condition 2021-12-26 20:16:41 -06:00
Scott Giese
3e096fed41 ATISEncoder: remove always true condition 2021-12-26 20:09:20 -06:00
Scott Giese
17fde93fb2 AIGroundVehicle: remove always true condition 2021-12-26 19:45:33 -06:00
Scott Giese
4d10f37992 AIEscort: bug fix 2021-12-26 19:40:15 -06:00
Scott Giese
3c4220e784 AICarrier: clamp bug fix.
Since this code attempts to clamp values between 0.0 and 1.0, the comparision needs to occur using double types.
2021-12-26 19:32:44 -06:00
Scott Giese
f008531fd5 AIWingman Join bug fix
Also removal of redundant code (always true conditions).
2021-12-26 12:41:06 -06:00
Scott Giese
27b518e306 Best practice for pre/post incr/decr. 2021-12-26 12:39:22 -06:00
Scott Giese
3850700ce1 Undefined Behavior fix.
Shifting bits into the sign-bit is unpredictable.
Should be an unsigned type.
2021-12-26 12:38:08 -06:00
SDeAstis
560e7a3d12 Solved the problem with custom menu labels not properly displayed. 2021-12-26 12:51:37 +00:00
James Turner
7d2955347e Initialize a pointer to null. 2021-12-25 13:40:26 +00:00
James Turner
5b537a176e Adjust EnvironmentMgr API to avoid copying
getEnvironment encouraged pass-by-value of FGEnvironment
which is heavy and mostly unnecessary.
2021-12-25 13:40:25 +00:00
James Turner
a12a7e9bec Autopilot code tweaks
Move config.h include to correct place, and use
override instead of virtual in a few places.
2021-12-25 13:40:25 +00:00
Erik Hofman
6414df325d Cope with SGPropertyNode::getStringValue() now returning std::string by value. 2021-12-25 12:56:49 +01:00
Scott Giese
a993ff7ccb Revert "APT.DAT version 810 and 850 are both obsolete."
This reverts commit 913eb83e10.
2021-12-25 02:16:40 -06:00
Julian Smith
ee4d97097c src/Aircraft/continuous.cxx: reduced a diagnostic. 2021-12-24 14:49:06 +00:00
Roman Ludwicki
82f967ab92 Cope with SGPropertyNode::getStringValue() now returning std::string by value.
This is by Lars Toenning <dev@ltoenning.de>, Roman Ludwicki <romek21@op.pl> and
SDeAstis <salvatore.deastis@gmail.com>, in 2021 Hackathon.

Also cope with removal of SGPropertyNode::getName() - use getNameString()
instead.
2021-12-24 14:49:06 +00:00
James Turner
93d278d63a ATC: use owning ref for AIAIrcraft
Avoid a crash where the raw pointers in AcitveRunway become
stale; use a real owning ref-ptr instead.
2021-12-24 13:06:10 +00:00
Florent Rougon
63df3351db Fix for --view-offset
Make --view-offset set /sim/view[0]/config/heading-offset-deg instead of
/sim/current-view/heading-offset-deg. Setting the latter has no effect
because of what flightgear::View::createFromProperties() does when it
initializes flightgear::View::View. This was discussed at [1].

[1] https://sourceforge.net/p/flightgear/mailman/message/37406317/
2021-12-24 08:58:49 +01:00
Scott Giese
913eb83e10 APT.DAT version 810 and 850 are both obsolete.
Remove 810 parsing.
Eliminate version strings from method names and messages.
2021-12-22 23:55:38 -06:00
Scott Giese
eefd878529 AirportBuilder: missing header guard corrected. 2021-12-22 23:50:37 -06:00
Erik Hofman
930ed00ba9 Adjust friction factors and bumpiness when the material is a lake and frozen solid. For JSBSim take precipitation and temperature into account, YASim is a bit simpler. 2021-12-22 14:38:17 +01:00
Erik Hofman
f287bd9133 Set the inland-ice property when the mean ground temperatures get low enough 2021-12-21 10:31:37 +01:00
Erik Hofman
dbba5d9ad2 Read annual precipitation fro the blue channel 2021-12-20 11:44:55 +01:00
James Turner
c3beaee307 Launcher: fix a lingering season reference 2021-12-19 18:44:21 +00:00
Julian Smith
ef38e07c61 src/Time/TimeManager.cxx: support fixed-dt when not in simple-time mode. 2021-12-19 16:34:28 +00:00
Julian Smith
cb7343eb35 src/Time/TimeManager.*: fixed simple-time indeterminism that could cause hang on startup.
_simple_time_fdm was not being initialised, which was causing occasional hangs
on startup. So set to zero in constructor and TimeManager::init().

For simplicity, we also initialise all other basic type state in the
TimeManager class.

If _simple_time_fdm's starting value happens to be very large (e.g. 1e228),
_simple_time_fdm + fixed_dt would result in _simple_time_fdm, so we would end
up always setting simDt and realDt to zero.

This stops SGEventMgr from processing any events, which means that
initPosition()'s event to call finalizePosition() is never processed so
/sim/position-finalized is stuck on false, which results in the FDM never
setting /sim/fdm-initialized.
2021-12-19 15:57:16 +00:00
James Turner
5f66ffc96b Disable Sentry if init fails
This will fix other uses of the APi blocking because the backend
failed to start. Enable debug logging in non-release builds so
it's obvious when the deploymenty is not configured right.
2021-12-19 12:39:23 +00:00
PlayeRom
271073d869 Remove 'Season' option from Qt Launcher 2021-12-19 11:45:58 +00:00
Bertrand Coconnier
a49f865515 Avoid spurious error messages when the property is already untied. 2021-12-18 17:32:59 +01:00
Gonzalo Pesquero
8d4bd24235 Modified AircraftRating item width 2021-12-17 12:49:50 +00:00
Julian Smith
c4c29f33d4 src/Input/FGLinuxEventInput.cxx: don't throw if we cannot open device.
Throwing halts execution; we now output a diagnostic and return false, and
flightgear appears ok to continue.
2021-12-09 23:09:52 +00:00
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