1
0
Fork 0
Commit graph

11895 commits

Author SHA1 Message Date
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
James Turner
28f562d0ec Sentry: correct breadcrumbs for menu item activates. 2021-04-08 07:16:13 +01:00
Erik Hofman
c951f3fcf4 Also log propery samples over DDS 2021-04-07 11:53:22 +02:00
Erik Hofman
202c69ad77 Implement the start of a property server using DDS. 2021-04-06 14:52:37 +02:00
Erik Hofman
e203336546 Udpate the logged name 2021-04-06 14:51:50 +02:00
James Turner
0a1f6d406c Launcher: missed import/style fixes 2021-04-06 09:13:50 +01:00
James Turner
1f24f1b2bb Traffic: work around crash with bad trafficRef
Don’t crash when the arrival airport is null.

Sentry-Id: FLIGHTGEAR-893
2021-04-06 09:13:32 +01:00
James Turner
4b9f903f8f Launcher: fix include of FlightGear module files 2021-04-04 16:53:45 +01:00
James Turner
977dd6fd15 Add sentry breadcrumb for FGCom
Trying to understand FLIGHTGEAR-66 crashes where the IAXClient thread
is still running after FGCom::shutdown has (presumably?) been called
2021-04-04 16:35:40 +01:00
James Turner
019d6cc53a Launcher: tweak how Qt Fatal log messages are handled 2021-04-04 16:34:46 +01:00
James Turner
dd475e1934 Implement saving of graphics presets to XML 2021-04-04 16:10:38 +01:00
James Turner
ff65689eb6 Launcher: fix some missing hard-coded styles 2021-04-02 14:57:01 +01:00
James Turner
361bea19aa Graphics presets: tolerate watching tie()-ed props
Check if the actual value is changing, since tied properties see
an automatic setStringValue when initialized.
2021-04-02 12:07:01 +01:00
James Turner
664652ae39 Error-reporting: capture some properties to report
In the full error report, capture various property values to
aid debugging / investigation.
2021-04-02 10:48:39 +01:00
James Turner
5dae2d129e Launcher: fix compatability with older Qt
QQmlEngine::singletonInstance is >= 5.12. Work-around using a little
component+instance to achieve the same result.
2021-04-02 10:13:56 +01:00
Fernando García Liñán
2913b72f43 Remove unused properties and cmd options 2021-04-02 04:31:36 +02:00
Fernando García Liñán
a5443b77e0 Graphics presets: Add order-num parameter to allow more intuitive ordering 2021-04-02 03:11:42 +02:00
Julian Smith
0294db919f src/Main/fg_init.cxx: workaround for JSBSim failure because of reliance on FGReplay.
JSBSim fails on startup if some properties are not already created; some of
these are created by FGReplay, and this is going wrong now that FGReplay is
being run after the FDM.

So have added a hack where we call FGReplay::init() as soone as FGReplay has
been created.
2021-04-01 21:18:17 +01:00
James Turner
df0f3e1b47 Launcher: fix QML warnings closing notifications 2021-04-01 17:36:34 +01:00
James Turner
5738d8cca9 Launcher: remove obsolete PNG assets
Also switch to using the colored provider for the C++-derived icons,
especially the carrier.
2021-04-01 17:14:59 +01:00
James Turner
209898cb89 Coloring support for SVG icons 2021-04-01 15:53:20 +01:00
James Turner
adae75821d CommRadio frequency updates from Sascha Reißner
Reject invalid frequencies from apt.dat in the loader, and fix
25Khz encoding to be the exact value (i.e round frequencies ending
in 20 and 70 to 25 and 75)

Fix ATCdialog to show 3 digits of comm radio frequency at all times,
and remove its rounding-conversion.

Finally, expand the tests to capture the new behaviour. Test for
EPLL is disabled for now because it contains an invalid frequency.
2021-04-01 14:46:21 +01:00
James Turner
cec9ab5039 Launcher: convert most icons to masked.
Still need to add SVG support, but this improves feedback (eg hover)
for many icons in the launcher. Will remove the redundant PNGs in
another commit once other pieces are done.
2021-04-01 12:14:22 +01:00
Fernando García Liñán
1423e7d366 Add support for Compositor reloading in graphics presets 2021-03-31 03:54:02 +02:00
Julian Smith
3e9868093e src/AIModel/AIMultiplayer.cxx: can now log info about final mp position.
We log info about actual multiplayer speed for callsign that matches
/sim/replay/log-raw-speed-multiplayer.
2021-03-28 17:28:53 +01:00