1
0
Fork 0
Commit graph

11971 commits

Author SHA1 Message Date
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
Erik Hofman
13a7eeef74 Use the new convenience constructor eliminating the need to call setup separately. 2021-03-28 09:00:15 +02:00
Julian Smith
a606315bbb src/MultiPlayer/multiplaymgr.*: optionally gather info about multiplayer aircraft speed.
Used by scripts/python/recordreplay.py to test multiplayer packets.
2021-03-27 23:04:10 +00:00
Julian Smith
778f359a89 src/Main/fg_init.cxx: don't open blocking popup if switching to readonly.
It looks like --read-only will not have been noticed yet, so this popup isn't
good.
2021-03-27 22:46:28 +00:00
Julian Smith
6b08e31b23 src/Main/fg_init.cxx: Fixed uneven replay of user aircraft when frame rate changes.
The problem was that we were recording aircraft state before the FDM updated
it, which meant that simtime changes were out of step with aircraft position by
one frame.

The fix is to run the FGReplay subsystem after the FDM subsystem
instead of before, which simply requires changing the code to use
SGSubsystemMgr::POST_FDM.

This makes './flightgear/scripts/python/recordreplay.py --test-motion' pass (it
previously failed).
2021-03-27 22:37:54 +00:00
Julian Smith
5c76f41743 Added support for analysing raw speed values when replaying.
Setting sim/replay/log-raw-speed logs raw speed to
/sim/replay/log-raw-speed-values/value[].

'scripts/python/recordreplay.py --test-motion' uses this to test for a bug
where the user aircraft simtime and signals information don't quite match in
continuous recordings.
2021-03-27 22:37:54 +00:00
Julian Smith
797f02f9dd Allow listing of property children via telnet.
Adds new ls2 command with machine-readable output.
2021-03-27 22:37:47 +00:00
Julian Smith
0ff0cc30fd src/Aircraft/replay.hxx: removed unused class member. 2021-03-27 21:55:35 +00:00
Erik Hofman
78b383734c Use the new helper function which converts the typename into a topic name. 2021-03-27 15:22:20 +01:00
Erik Hofman
2825feb4b2 Simplify the code even more: no need to explicitly define the type 2021-03-27 13:58:54 +01:00
Erik Hofman
2d684de929 Use the new templated helper functions to simplify the code 2021-03-27 13:57:05 +01:00
Erik Hofman
1467a8a170 Move the C version of fgfdm_log.c to examples/dds/ and convert it to C++ as fg_dds_log.cpp using the SimGear provided hepper classes. 2021-03-27 13:31:39 +01:00
James Turner
3276c9a754 Map widget: tweaks to property creation
Allow these values to be auto-saved without getting over-written.
2021-03-26 10:44:27 +00:00
Erik Hofman
f88f38ec53 Dot not only log FDM packets but also GUI and Ctrls packets when they arrive. 2021-03-25 14:21:30 +01:00
Erik Hofman
ee503ba89f Add a property /sim/rendering/desert which can be used by the meterials definiton to alter the amount of dessertness based on latitude. It's op to the material definition what to do with it, if at all. This is not a prediction that there is actually desert at that latitude. 2021-03-25 11:13:38 +01:00
James Turner
1ee8b9e568 View tweaks to try to understand crash with no camera group
Sentry-Id: FLIGHTGEAR-H9F
2021-03-23 17:50:54 +00:00
James Turner
344058baba Avoid crash when early-exiting.
This is a work-around, but suitable for back-porting to 2020.3

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

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

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

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

(needs an FGData update as well)

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

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

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

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

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

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

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

Cached some more property nodes in SGPropertyNode_ptr's.

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

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

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

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

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

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

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

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

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

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

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

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

src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
    FGReplay::loadContinuousHeader()
        Loads properties from Continuous recording's header, distinguishing
        between failure due to incorrect header, or due to a truncated file.
    FGReplay::indexContinuousRecording()
        Contains Continuous recording indexing code, in a form that can be used
        in background while we are downloading.
    Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
    be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
    fgOptLoadTape():
        Modified to handle --load-tape=<url>. We start download, and read
        the header before returning, so that we can force the FDM to use the
        recording's aircraft instead of the user's default. Limit recording
        download rate if /sim/replay/download-max-bytes-per-sec is set, by
        calling new filerequest->setMaxBytesPerSec().
2021-02-18 09:32:15 +00:00
James Turner
02e0d17dbc Fix MSVC unused-var warning 2021-02-15 09:33:30 +00:00
jano
4a4117b9ab make the mp protocol send rate independant from time accel,
based on mp protocol clock.
2021-02-15 09:27:36 +00:00
jano
a28bf28ee0 Throttle Hz aligned to time-grid, add initial offset.
Allows sync of two or more FG session, if wall clock are in synch.
2021-02-15 09:11:46 +00:00