1
0
Fork 0
Commit graph

14119 commits

Author SHA1 Message Date
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
Edward d'Auvergne
d2a6eb69a5 Clean up of the Ephemeris class members, removing the raw pointers.
The property nodes have been switched to SGPropertyNode_ptr and _impl to std::unique_ptr.
2017-05-30 09:57:37 +02:00
Edward d'Auvergne
a0dc7b5ba3 Untied the /environment/moonlight property. 2017-05-29 09:47:31 +02:00
Bertrand Coconnier
24a148880c Fixes to the trim on ground feature.
* Skip the gears when located over water. They will be skipped by the ground reactions anyway making the trim irrelevant.
* Ignore the ground bumpiness during the trim. The trim algorithm seems not to
be robust enough to handle that. This does not make much difference to the
converged solution anyway since the bumpiness is generally low.
* Fixed the WOW status for contacts over water (was 'false' is now 'true').
* All the gear/contact data are now properly reset when WOW==false. The reset
code is now common to all the case where WOW is false.
2017-05-28 20:14:33 +02:00
Bertrand Coconnier
76ef08679d Cleaned up the JSBSim interface. 2017-05-28 20:12:30 +02:00
Alessandro Menti
f1ffe97991
Add CMake Linux install directives for the icons and the .desktop file 2017-05-24 22:47:01 +02:00
James Turner
eb5d482ded Use GetUserDefaultLocaleName
This should improve our locale detection on Windows, since it is the recommended
solution according to MSDN.
2017-05-22 17:50:50 +01:00
James Turner
27b34182c7 Launcher: Enable DPI-scaling
(for Windows especially)
2017-05-22 08:53:27 +01:00
James Turner
15c84139fa Fix launcher failure with custom MP server
When the user specified an MP server without providing a port, the
launcher would pass a malformed command line, leading the the simulator
bailing out. 

(Should go to the release branch)
2017-05-22 08:53:27 +01:00
James Turner
18b8b59af6 Validate MP callsign with a reg-exp 2017-05-22 08:53:27 +01:00
James Turner
42508619ee Validation of METAR in the launcher 2017-05-22 08:53:27 +01:00
Richard Harrison
0c4eaa8b29 Canvas exception during re-init.
Add defensive logic to ensure that a null pointer isn't dereferenced. This happened to me once or twice during a reinit (Location/Position In Air to the current position). It may be related to the model, but in any case the code needs to ensure that the static cast failure is handled correctly.
2017-05-20 13:40:02 +02:00