1
0
Fork 0
Commit graph

13696 commits

Author SHA1 Message Date
Florent Rougon
59d8dea0d7 Add-ons: use shared_ptr_traits<>::makeStrongRef(...) instead of new Foobar(...)
Replace the previously-written manual calls to "new SomeClass(...)" with
their equivalent using
flightgear::addons::shared_ptr_traits<>::makeStrongRef(). This way, when
SomeClassRef is changed from SGSharedPtr<SomeClass> to
std::shared_ptr<SomeClass>, these calls will magically use
std::make_shared<SomeClass>(...) instead of the "new SomeClass(...)"
call.
2018-01-08 08:05:35 +01:00
James Turner
d2cb99ba1d Launcher: fixes for scanning local aircraft dirs
When multiple ‘added items’ signals occur, don’t loose some entries,
always pull the full list from the aircraft cache.
2018-01-07 14:19:28 +00:00
James Turner
178c6440f6 Permit three-letter (FAA) airport identifiers
Patch from Jean-Paul Anceaux to allow some FAA but non-ICAO airports to
be used with the route-manager dialog.
2018-01-05 16:39:34 +00:00
Richard Harrison
97c1b34fa5 JSBSim: revised arrestor wire handling.
Change the arrestor wire handling as follows;

- expose property to indicate when arrestor wire has been snagged: /fdm/jsbsim/systems/hook/arrestor-wire-engaged-hook
- add property to allow the model to request that the wire is released: /fdm/jsbsim/systems/hook/tailhook-release-cmd. This permits an overspeed approach to catch the wire and then drop it.
2018-01-04 03:54:23 +01:00
Richard Harrison
2f84be16f9 Multiplayer: Do not interpolate integer values:
Jean Pellotier, 2018-01-02 : we don't want interpolation for integer values, they are mostly used
for non linearly changing values (e.g. transponder etc ...)
ref: https://sourceforge.net/p/flightgear/codetickets/1885/
2018-01-04 03:54:23 +01:00
Florent Rougon
4d36082398 Add-ons: detailed, machine-parseable metadata for authors and maintainers
(everything described here lives in the namespace flightgear::addons)

New classes: Author, Maintainer, and Contact. Author and Maintainer
derive from Contact. For each contact, the following can be defined in
addon-metadata.xml: name, email, and url. See [1] for details about the
syntax and usage policy. Nasal bindings have been updated accordingly,
there are three new ghosts: addons.Contact, addons.Author and
addons.Maintainer.

The enum class UrlType has two new members: author and maintainer. The
Addon::getUrls() method has a new signature:

  std::multimap<UrlType, QualifiedUrl> getUrls() const;

because non-empty 'url' fields for authors and maintainers contribute to
the result, and there can be an arbitrary number of authors and an
arbitrary number of maintainers defined for a given add-on---therefore,
std::map can't be used anymore.

Finally, QualifiedUrl has a new field (detail) which stores the author
name (resp. maintainer name) when the QualifiedUrl type is
UrlType::author (resp. UrlType::maintainer). Currently, this 'detail'
field is not used for other URL types, but this could be changed if
desired.

[1] https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Docs/README.add-ons
2018-01-02 21:57:35 +01:00
Florent Rougon
843383fdc3 Add-ons: add pointer traits
flightgear::addons::shared_ptr_traits allows one to easily switch for
instance from an SGSharedPtr<T> to an std::shared_ptr<T> for "all" uses
of a particular T, and automatically have std::make_shared<T>(...) used
instead of SGSharedPtr<T>(new T(...)) when creating a shared instance of
T. This is interesting because std::make_shared<T>() allocates all
needed memory as one block, whereas std::shared_ptr<T>(new T(args...))
would perform at least two allocations (one for the object T and one for
the control block of the shared pointer).

This is done via static methods (one for each kind of smart pointer):

  shared_ptr_traits<SGSharedPtr<T>>::makeStrongRef()
  shared_ptr_traits<std::shared_ptr<T>>::makeStrongRef()

that forward their arguments in the same way as std::make_shared<T>().
2018-01-02 00:35:50 +01:00
Florent Rougon
f1e0a4e43f Add-ons: add missing include 2018-01-01 20:04:59 +01:00
Florent Rougon
7d2f35c7e3 Add-ons: update namespace in a string and a comment
These were forgotten in commit f5ab26bd71.
2018-01-01 01:14:37 +01:00
Florent Rougon
31de119169 Add-ons: alternative code for C++ compilers that don't have a working <regex>
Normally, <regex> should be available and working in any compliant C++11
implementation, however at least g++ 4.8[1] lies about its C++11
compliance: its <regex> is utterly unusable, see [2] and [3] for
details.

This requires SimGear commit ab1e2d49abdf5b1aca9035a51d9d73d687f0eba7,
for the HAVE_WORKING_STD_REGEX preprocessor symbol.

[1] Which appears to be (precisely 4.8.5) the version shipped in
    CentOS 7, and used on FlightGear's current Jenkins installation.

[2] https://stackoverflow.com/a/12665408/4756009

[3] https://sourceforge.net/p/flightgear/mailman/message/36170781/
2017-12-29 14:14:41 +01:00
Florent Rougon
ea45c4980b Merge /u/jsb1685/flightgear/ branch yasim into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/115/
2017-12-29 08:26:24 +00:00
Henning Stahlke
21aef4da70 YASim: bugfix for wing section (wrong surface positions).
Reformated and extended output of CLI tool.
2017-12-29 08:16:32 +01:00
Florent Rougon
3d12ed6ce0 Add-ons: minor changes
Changes to test_AddonManagement.cxx:

  - in testAddonVersionSuffix(), fgtest::initTestGlobals() was called
    with the wrong test name (not used anyway, but might be in the
    future);

  - in testAddon():
      * rename variable 'm' to 'addon' ('m' used to stand for the old
        class name AddonMetadata);
      * call fgtest::initTestGlobals() and fgtest::shutdownTestGlobals()
        (not technically needed, but cleaner).
2017-12-28 08:35:39 +01:00
Richard Harrison
8cfa799284 Multiplayer: add properties for Emesary MP bridge.
- The Emesary MP bridge can use any string property; however it seems sensible to separate the properties out into a distinct block.
- There is a now a type property for each bridge. This is to allow the bridge to identify its type based on what it can transfer based on function. This will allow rapid filtering of unrequired notifications within the bridge (NYI)
2017-12-28 01:12:20 +01:00
Florent Rougon
ccfb0d78ae Add-ons: whitespace-strip every leaf node contents in addon-metadata.xml files
All nodes were already stripped except <version>, <min-FG-version> and
<max-FG-version>; these are the ones affected by this change.
2017-12-26 19:45:19 +01:00
Florent Rougon
ec349c6ac5 Add-ons: add UrlType enum class, QualifiedUrl class and Addon::getUrls() method
QualifiedUrl is essentially a pair containing an enum value
(addons::UrlType::homePage, addons::UrlType::download, etc.) and an
std::string for the URL per se, with adequate getters and setters.

Addon::getUrls() is for people who wish to process all non-empty URLs
occurring as part of the add-on metadata in batch.

Mailing-list discussion:

  https://sourceforge.net/p/flightgear/mailman/message/36159711/
2017-12-26 19:44:15 +01:00
Florent Rougon
f5ab26bd71 Add-ons: move all code to the flightgear::addons namespace 2017-12-26 19:44:15 +01:00
Florent Rougon
c3b1442546 Add-ons: new supported fields: authors, maintainers, license/*, url/*, tags
- Parsing of the addon-metadata.xml file is now handled by a new static
  method of Addon:

    static Addon fromAddonDir(const SGPath& addonPath);

  This method will be reusable to gather all add-on metadata from a set
  of add-on directories (just call the method once per add-on). This
  change also simplifies AddonManager::registerAddonMetadata().

- New supported fields:

    authors
    maintainers
    license/{designation,file,url}
    url/{home-page,download,support,code-repository}
    tags

  See
  https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Docs/README.add-ons
  for documentation on these fields.

Mailing-list discussion:

  around https://sourceforge.net/p/flightgear/mailman/message/36155660/
2017-12-26 19:43:20 +01:00
Florent Rougon
d81599efd1 Add-ons: move exceptions to their own translation unit 2017-12-25 21:24:26 +01:00
James Turner
01f0f27c84 HID-input: don’t crash when open fails
Important since hidraw devices need special permissions on Linux.
2017-12-25 18:13:03 +00:00
Henning Stahlke
2538ab717a YASim: more output for CLI tool, e.g. wingspan, area, levers, load factor... 2017-12-23 01:06:38 +01:00
Florent Rougon
c325a8d2cd Fix typos in src/Input/FGLinuxEventInput.cxx 2017-12-23 00:04:21 +01:00
James Turner
216d2328a3 Linux fixes 2017-12-22 14:44:29 -08:00
James Turner
fed8ce623b Fix Windows compilation. 2017-12-22 15:48:52 +00:00
Henning Stahlke
7e5a1bb6b9 try to fix windows build error 2017-12-21 18:56:29 +01:00
James Turner
34630f935d Fix GCC indentation warning 2017-12-20 04:04:17 -08:00
James Turner
407a6d4b3e Linux fixes for HID-input 2017-12-20 04:04:17 -08:00
James Turner
edc1d63b26 Merge /u/jsb1685/flightgear/ branch yasim2 into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/110/
2017-12-19 23:06:03 +00:00
Henning Stahlke
9289c79e05 YASIM reduce precision of lift/drag output from CLI tool to .4 2017-12-19 08:44:41 +01:00
Henning Stahlke
87149931dd YASim refactoring parser 2017-12-19 08:44:41 +01:00
Henning Stahlke
7c55aa2c4a YASim variable and method name clarification in class Surface 2017-12-19 08:44:41 +01:00
Henning Stahlke
f7c5d2b1f9 YASIM refactoring class Surface
and export more properties to proptree
2017-12-19 08:44:41 +01:00
Henning Stahlke
408e645bb2 YASIM add wing section support
refactoring of FGFDM parser
replace old helpers with lib functions from <cstring>
remove typecast that kills 'const'
add some comments and clarify variable names
2017-12-19 08:44:41 +01:00
James Turner
e630bc4be7 Make HID-Input test also conditional
Forgot to wrap this in the relevant CMake test, causing non-HID-input
builds to erroneously fail.
2017-12-18 18:22:44 +00:00
James Turner
e920dc7509 Event input layer based on HID-Api
Thus runs in parallel to the existing implementation on Linux and Mac,
but can (soon) replace the Mac code and will run on Windows eventually.
2017-12-18 17:15:55 +00:00
James Turner
c14f37edc0 HID-api codebase
This is based off James’ fork on GitHub, with report-descriptor
parsing added to the basic HIDAPi codebase.
2017-12-15 15:46:57 +00:00
James Turner
d98cd3a717 Launcher: move QML files to a sub-directory 2017-12-15 14:38:23 +00:00
James Turner
f964728422 Launcher aircraft list: show counts 2017-12-15 14:38:23 +00:00
James Turner
595b0d16da Launcher aircraft: fix a layout bug 2017-12-15 14:38:23 +00:00
Henning Stahlke
e913e44aa0 YASIM type name clarification 2017-12-15 15:20:29 +01:00
Henning Stahlke
13e00b275b YASim: export more forces to prop tree for in flight debugging 2017-12-15 15:20:29 +01:00
Henning Stahlke
a199ca817c YASim: user Math functions in RigidBody 2017-12-15 15:20:29 +01:00
Henning Stahlke
abb451256d YASim CLI tool: add more CG outputs
remove non-significant digits from inertia printf()
2017-12-15 15:20:29 +01:00
Henning Stahlke
78f7950fa6 YASim: move common helper functions to new yasim-common.cpp 2017-12-15 15:20:28 +01:00
Henning Stahlke
c63ded1c44 YASIM add initialization
use Math::clamp in ControlMap
2017-12-15 15:20:28 +01:00
Henning Stahlke
b2000e1cca YASIM add a local var 2017-12-15 15:20:28 +01:00
Henning Stahlke
5aead123fc YASIM refactoring of ControlMap 2017-12-15 15:20:28 +01:00
Henning Stahlke
09c60ee40e YASIM add variable initialization 2017-12-15 15:20:28 +01:00
Henning Stahlke
3809137f7d YASIM add method multiplyLiftRatio to class Wing 2017-12-15 15:20:28 +01:00
Henning Stahlke
6feca92060 YASIM add struct StallParams to Wing 2017-12-15 15:20:27 +01:00