1
0
Fork 0
Commit graph

13430 commits

Author SHA1 Message Date
James Turner
5ba953ad61 Fix custom download-dir in launcher
Updating the value takes immediately, as it did in 2017.1 and prior.
Additionally, passing —download-dir on the command-line is detected
and handled specially; the UI option is disabled, and no changes are
made to the value passed in. (The launcher does not override the value
with any value it has saved)
2017-07-19 19:24:33 +01:00
James Turner
8fdb56a185 Only qInfo was added in 5.5
Other logging operators are present in 5.0, so simplify this code.
2017-07-19 13:21:06 +01:00
Torsten Dreyer
f6698a0b1f Introduce commandline-option --addon
using  --addon=/foo/bar does
 * add /foo/bar/config.xml as propertyfile
 * add /foo/bar to aircraft_paths to provide read-access
 * sets property /addons/addon[n]/path = "/foo/bar"
 * addons get initialized from addons.nas in FGDATA/Nasal
2017-07-18 12:13:44 +02:00
Torsten Dreyer
c9eff67409 Hopefully fix "qInfo not defined" 2017-07-07 11:50:06 +02:00
Florent Rougon
a38153db33 Merge /u/martymac/flightgear/ branch freebsd-input-fix into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/102/
2017-07-07 07:34:26 +00:00
Torsten Dreyer
169b0f59e5 Use SGMisc wrapper for _isnan makes "other" OSes happy 2017-07-07 09:12:16 +02:00
Ganael Laplanche
e26df90ea4 FreeBSD: fix build when libudev is found 2017-07-06 23:02:52 +02:00
Richard Harrison
2c8aad12ba Model relative property tree root binding.
Change fgcommand to take an optional property tree root element.

This fixes the animation bindings to use the defined property tree root - to support multiplayer (or other) model that can bind to the correct part of the property tree.

Requires a corresponding fix in sg to allow the command methods to take an optional root parameter.

What this means is that when inside someone else's multiplayer model (e.g. backseat, or co-pilot), the multipalyer (AI) model will correctly modify properties inside the correct part of the property tree inside (/ai), rather than modifying the properties inside the same part of the tree as the non-ai model.

This means that a properly setup model will operate within it's own space in the property tree; and permit more generic multiplayer code to be written.

This is probably responsible for some of the pollution of the root property tree with MP aircraft properties.
2017-07-05 11:37:17 +02:00
Richard Senior
ef6af467ed Add airspeed and ground bit to MP protocol for Mode-S transponders
Ground-bit is set manually (via the transponder GND knob position) or
automatically using a property referenced in instrumentation.xml.

Aircraft will only transmit these new properties when using the
multiplayer v2 protocol.
2017-06-27 16:04:30 +01:00
Alessandro Menti
a70e34dc21
Translate man pages to Italian 2017-06-25 22:20:58 +02:00
Alessandro Menti
78a7313d65
Man pages: fix some errors
Fix some typos/errors/style issues in the man pages.
2017-06-25 22:19:41 +02:00
James Turner
ec1990907e Non-launcher parts of minimum-fg-version support
This adds console and message-box warnings, based upon aircraft
declaring the minimum FG version they support. A follow-up commit
will extend the launcher UI to warn the user about this in a nicer
way.
2017-06-22 00:22:18 +01:00
James Turner
aef9bc4e06 Launcher: more robust preview downloading.
Tolerate download failures, which seem to happen due to Ibiblio rate-
limiting, more gracefully.
2017-06-21 23:50:04 +01:00
James Turner
67dfff9a84 Fix for build with Qt 5.2 2017-06-19 19:32:15 +01:00
James Turner
af6611d7f6 Initial attempt at —-uninstall mode for FGFS
This is a headless mode, designed to be invoked from an installer, not
used directly by users. It doesn’t touch the ‘normal’ installation, but
rather removes the other files FG typically creates or downloads.
2017-06-15 18:30:37 +01:00
Florent Rougon
0855f0414f Tentative fix for the MSVC build
When building with MSVC, use the CMAKE_MSVCIDE_RUN_PATH variable to
prepend ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/bin to the PATH in
order to (hopefully) allow fgrcc to find the libraries it needs. We may
need to add something similar for SimGear---will see.

The use of CMAKE_MSVCIDE_RUN_PATH and other ways to address this problem
are discussed at
<https://stackoverflow.com/questions/28533012/how-to-set-runtime-path-for-cmake-custom-command-on-windows>.
2017-06-13 17:58:21 +02:00
James Turner
f55fd3f10c Compat fixes for older Qt versions. 2017-06-11 23:15:52 +01:00
James Turner
9031182583 GraphicsWindowQt5: improved keyboard + modifiers
This fixes many kinds of input weirdness, caused by ‘stuck’ modifiers
being set internally, and causing input bindings to be excluded.
2017-06-11 23:11:33 +01:00
Florent Rougon
b2cc191bc6 Integrate the EmbeddedResourceManager into FlightGear
${CMAKE_SOURCE_DIR}/src/EmbeddedResources/FlightGear-resources.xml
(currently empty) is automatically "compiled" into
${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.[ch]xx by
fgrcc inside the build directory. These files are incorporated into the
FlightGear build (FlightGear-resources.cxx is linked into FlightGear).

When the XML embedded resource declaration file added here,
FlightGear-resources.xml, is compiled, fgrcc is passed the
--root=${CMAKE_SOURCE_DIR} option, so that files referred to in
FlightGear-resources.xml are looked up relatively to the root directory
of the FlightGear repository. One could use a second XML embedded
resource declaration file compiled with a different --root option to
grab files from FGData, for instance. I would name such a file
FGData-resources.xml to be consistent with the current naming scheme.

Note: this --root option applies to the paths of real files. Don't
      confuse it with the 'prefix' attribute of <qresource> elements
      inside XML resource declaration files (such as
      FlightGear-resources.xml), which applies to the virtual path of
      each resource defined beneath.

The commands in src/Main/CMakeLists.txt ensure that
FlightGear-resources.xml is recompiled with fgrcc whenever it is
changed, and obviously also when FlightGear-resources.cxx or
FlightGear-resources.hxx is missing. However, CMake doesn't know how to
parse fgrcc XML resource declaration files, therefore when a resource is
modified but the XML file it is declared in is not (here,
FlightGear-resources.xml), you have to trigger yourself a recompilation
of the XML resource declaration file to see the new resource contents
inside FlightGear. The easiest ways to do so are:
  - either update the timestamp of the XML resource declaration file;
  - or remove one or both of the generated files
    (FlightGear-resources.cxx and FlightGear-resources.hxx here).

The EmbeddedResourceManager is created in fgMainInit() just after
Options::processOptions() set the language that was either requested by
the user or obtained from the system (locales). Resources from
FlightGear-resources.cxx are added to it, after which
EmbeddedResourceManager::selectLocale() is called with the user's
preferred locale (obtained with FGLocale::getPreferredLanguage()).

Upon reset (fgStartNewReset()), EmbeddedResourceManager::selectLocale()
is called in a similar way after Options::processOptions(), however in
this case the EmbeddedResourceManager instance doesn't have to be
recreated.
2017-06-11 18:57:58 +02:00
Florent Rougon
acb5650b83 Minor changes in locale.cxx and locale.hxx
- remove use of boost in src/Main/locale.cxx;
- add missing header <cstring> for std::strlen();
- replace NULL with nullptr;
- fix some broken indentation;
- other small readability improvements.
2017-06-11 18:57:58 +02:00
Florent Rougon
905e1973eb Add method FGLocale::getPreferredLanguage()
This function returns the preferred "locale"[1] according to user choice
and/or settings (i.e., it is influenced by --language if passed,
otherwise by current locale/system settings). The return value never has
an encoding part. It is the empty string if nothing could be found,
otherwise should look like fr_BE or it_IT.

[1] "language" term used in the function name for consistency with the
    existing and related FGLocale::selectLanguage().
2017-06-11 18:57:58 +02:00
Florent Rougon
1bf3aee5df Make the Unix impl. of FGLocale::getUserLanguage() consistent with the others
Windows and Mac implementations return a string without any encoding
specifier -> remove this specifier directly in the Unix/Linux
implementation for consistency.

Also do some small refactoring with the new static method
FGLocale::removeEncodingPart(). Slight difference with the previous
algorithm: if a '.' is found in the given locale spec, we assert() that
it is not the first character. The previous code in
FGLocale::findLocaleNode() used to consider such weird locale specs
starting with a dot as normal locale specs without any encoding part.

Note: the same change could be done where FGLocale::findLocaleNode()
      looks for an underscore in order to prepare for the fallback
      search (e.g., 'fr' after not finding translations for 'fr_FR').
2017-06-11 18:57:58 +02:00
Florent Rougon
ed9f985f92 Fix warnings in fgrcc.cxx
The braces fix is apparently needed to avoid warnings due to a compiler
bug, or at least missing feature (cf. [1] and [2]). The other one in
std::accumulate() seems legitimate.

[1] http://en.cppreference.com/w/cpp/container/array
[2] https://stackoverflow.com/questions/14178264/c11-correct-stdarray-initialization
2017-06-11 18:52:45 +02:00
Florent Rougon
42821d6a63 Embedded resources: add a resource compiler (fgrcc)
For more info, run 'fgrcc --help' and/or read the presentation at [1]
(will be probably added to $FG_ROOT/Docs at some later point).

[1] https://sourceforge.net/p/flightgear/mailman/message/35870025/
2017-06-11 17:46:32 +02:00
Bertrand Coconnier
b76db7737d Added the generation of wake induced force and moment for JSBSim models.
The wake induced force and moment are computed as an external reaction to the JSBSim model. For these force and moment to be accounted for by JSBSim, the following external reaction needs to be added to FDM XML definition:
<external reaction>
  <force name="ai-wake">
    ...
  </force>
  <moment name="ai-wake">
    ...
  </moment>
</external reaction>

This is similar to how the hook and wire feature is modeled in JSBSim.
2017-06-10 23:27:52 +02:00
James Turner
aaddfdcea7 Different work-around for Qt < 5.5 2017-06-10 21:57:53 +01:00
Bertrand Coconnier
96df6689e6 Added the computation of the wake of all AI aircrafts.
Wake computations are now performed for all AI aircrafts within a range lower or equal to the value indicated by the property /fdm/ai-wake/max-radius-nm.

These computations are triggered by the property /fdm/ai-wake/enabled (it is disabled by default).

The result of the wake computations is not yet used by the FDMs so do not expect the user aircraft to react to the AI wake.
2017-06-10 21:13:20 +02:00
Bertrand Coconnier
b5fe38c1eb Compile AI wake numerical core in FG main executable.
AI wake code is still dead code except that it is now compiled with FG.

Input data for wake computations are extracted from the performance database. The data must be specified as follows (values are for illustration only) :
<geometry>
  <wing>
    <span-ft> 100. </span-ft>
    <chord-ft> 12. <chord-ft>
  </wing>
  <weight-lbs> 90000. </weight-lbs>
</geometry>
2017-06-10 20:19:43 +02:00
Bertrand Coconnier
cdf299391d Added missing <cmath> header for Mac to compile. 2017-06-10 19:22:15 +02:00
Bertrand Coconnier
c1313f2ecb Added the core of the AI wake computations with its tests.
At the moment, this is dead code: only the tests are compiled. FG is still compiled without this code.

A new directory is created that contains all the numerical computations made to estimate the wake induced by AI aircrafts. This is based on the venerable Vortex Lattice Method (VLM) which was all the rage in the 60's Computational Fluid Dynamics (CFD).

Even though quite old, the method is relevant to compute aircrafts wake in real time since 3D Navier-Stokes (NS3D) is out of reach for real time computations even with modern multicore personal computers and their GPUs.
2017-06-10 18:27:19 +02:00
Bertrand Coconnier
8667300483 Added missing header <memory> for Linux. 2017-06-10 18:03:03 +02:00
James Turner
b309b8a7ac Fix compilation with older OSG / Qt 2017-06-10 15:59:37 +01:00
James Turner
5e04aab318 QtGraphicsWindow: Remove deferred event support.
No longer needed, since we are using windows, not a widget.
2017-06-10 15:49:09 +01:00
James Turner
09972be25a Expose device-pixel-ratio to properties.
This allows scaling of the UI accordingly, to keep things usable on
HiDPi screens. (Note this is not fixed yet, but this is a step)
2017-06-10 15:48:11 +01:00
James Turner
4d900a5c26 Strong and stable ownership of the window, context
Use owning pointers in GraphicsWinQt to own the GLwindow and QOGLContext,
so shutdown is more orderly, especially when driven from the OSG or
window-manager, as opposed to an ‘internal’ quit.
2017-06-10 15:46:16 +01:00
Bertrand Coconnier
34a0c6c2a8 Make some methods public for the AI wake feature.
In order to compute the AI aircrafts wake, the FDM will need access to the list of AI aircrafts as well as being able to compute their range to discard aircrafts which are too far.
2017-06-10 15:28:28 +02:00
James Turner
40cc4cc02c Let Qt pick the default window position.
(For GraphicsWindowQt5 only)
2017-06-08 15:18:23 +01:00
James Turner
bafcf2de38 GraphicsWinQt toggles fullscreen natively.
This also improves handling when starting full-screen, and keeps the
window and internal state in sync.
2017-06-08 14:51:38 +01:00
James Turner
0c59583b32 Fix intermittent crash on exit with Qt+XCB
We can still crash on exit(-1) code paths since we can’t run this from
atexit, but at least the non-error paths are ok.
2017-06-07 17:52:47 +01:00
Florent Rougon
889c1bf0cb Remove alignLocaliserWithRunway(): deemed to be a "misfeature" :-)
In the thread at
<https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/87tw7sm5uw.fsf%40frougon.crabdance.com/#msg35673402>,
it was decided that alignLocaliserWithRunway() was a bad idea overall,
and should just be removed. The feature was already disabled by default
in recent releases via defaults.xml (since FlightGear 2017.1, precisely
FGData commit ea76305e42fd245e79a2b5bb569c8c61161f5721). Remove the code
entirely now.

The properties /sim/navdb/localizers/auto-align and
/sim/navdb/localizers/auto-align-threshold-deg have no effect anymore,
you may remove them from your configs if you somehow set them.

This goes with FGData commit 6dd9f6e8d962b00a1ccddc6af487c404cc935b92.

In case someone wanted to reuse the removed code, please consider
Szymon's proposed change at
<https://sourceforge.net/p/flightgear/flightgear/merge-requests/76/>,
which was:

,----
| Fixed bug in alignLocaliserWithRunway when building NavCacheDb
|
| The position of the localizer was converted to a distance from
| the displaced threshold, and then back to the posistion on the
| centerline, but the origin of the second computation was
| non-displaced threshold.
|
| --- a/src/Navaids/navdb.cxx
| +++ b/src/Navaids/navdb.cxx
| @@ -104,8 +104,8 @@
|  void alignLocaliserWithRunway(FGRunway* rwy, const string& ident, SGGeod& pos, double& heading)
|  {
|    assert(rwy);
| -  // find the distance from the threshold to the localizer
| -  double dist = SGGeodesy::distanceM(pos, rwy->threshold());
| +  // find the distance from the (non-displaced) threshold to the localizer
| +  double dist = SGGeodesy::distanceM(pos, rwy->geod());
|
|    // back project that distance along the runway center line
|    SGGeod newPos = rwy->pointOnCenterline(dist);
`----
2017-06-07 14:03:32 +02:00
James Turner
444864c7ba GraphicsWindow using Qt5, work-in-progress.
Enable by setting:
	/sim/rendering/graphics-window-qt=1

Known issues with HiDPI scaling of PUI & Canvas, and probably many
other issues besides.
2017-06-07 08:23:17 +01:00
James Turner
8bad6f11e5 Merge /u/elgaton/flightgear/ branch disable-deprecated-enhanced-lighting-and-adf into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/99/
2017-06-06 12:10:35 +00:00
James Turner
aac0085253 Merge /u/elgaton/flightgear/ branch new-man-pages into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/98/
2017-06-06 12:08:50 +00:00
Bertrand Coconnier
1a0e5a20ae Fixed LaRCSim matrix computation routines.
There was a couple of typos in the routine. This code will be used by the AI wake feature.
Also added a test for the matrix code to make sure they will be no regression.
2017-06-05 17:18:52 +02:00
Bertrand Coconnier
7d80a48d94 Sync. w/ JSBSim
External moments can now be specified in addition to external forces. This feature is needed for the AI wakes.
Headers clean up to reduce the amount of recompilation when modifying an header file.
2017-06-05 13:09:00 +02:00
Alessandro Menti
7245357751
Mark enhanced lighting options and --adf as deprecated
Print an error message and exit if --{enable,disable}-enhanced-lighting
or --adf are used (those deprecated options will be removed in a future
version of FlightGear).
2017-06-04 16:56:17 +02:00
Alessandro Menti
aa090b5f21
Man pages update
Add man pages for those programs that did not have one (exceptions:
yasim and yasim-proptest) and update the existing ones to make them
compliant with man-pages(7) conventions.
2017-06-04 15:34:50 +02:00
Richard Harrison
ac89ec94a3 Console: restore option to open console early. 2017-05-31 11:38:13 +02:00
Richard Harrison
16a7493de7 Fix --console from the launcher 2017-05-30 17:59:34 +02:00
James Turner
7951abefe2 Auto-select built-in FGdata when possible.
As spotted by Thorsten, reduce user annoyance by asking about FGData
when the built-in data is acceptable. (Advanced users can use the
launcher or other options to change FGdata as normal).
2017-05-30 10:02:41 +01:00