1
0
Fork 0
Commit graph

13514 commits

Author SHA1 Message Date
James Turner
aa9ad6a780 Fix view right-drag interaction with PUI
When PUI doesn’t handle the right-mouse down, ensure it ignores the
mouse-up event.
2018-01-14 13:17:59 +00:00
Bertrand Coconnier
bb315488e1 JSBSim synchronization.
Added the ability to specify N1 & N2 spool up/down velocity via functions for turbines.
2018-01-13 19:48:35 +01:00
Bertrand Coconnier
c9e276e5dd Removed obsolete files from JSBSim.
These files were originally included for special trim routines. But these routines are no longer maintained in JSBSim and have already been partially removed from FlightGear.
2018-01-13 19:46:41 +01:00
James Turner
08a877cb8e Message box on start if FG-home is read-only
If running with the launcher, and FG-home is read-only, show a warning
to the user, since this is probably a surprise to them.

(In non-launcher mode we don’t show the box, since it’s more likely to
be an intentional duplicate launch)
2018-01-12 22:18:59 +00:00
James Turner
1681b92c31 Silence a clang warning 2018-01-12 22:18:59 +00:00
James Turner
b4cdac238e remove_if clean-ups while auditing :) 2018-01-12 22:18:59 +00:00
James Turner
1493c0adc8 Fix missing style import in the delegate 2018-01-12 22:18:59 +00:00
Henning Stahlke
cbd5cb916f YASim bugfix: XML processing failed if <control-speed> appeared before <control-input> in XML file. 2018-01-10 21:25:52 +01:00
Florent Rougon
451f41fe0c Add-ons: lower the priority of the add-on resource provider to PRIORITY_DEFAULT
The previous priority was PRIORITY_NORMAL, which happens to be higher
than PRIORITY_DEFAULT. Even though the add-on resource provider should
be quite fast at rejecting resource paths that don't start with
'[addon=', I currently can't see any reason that justifies to give it a
higher priority than other paths added to the simgear::ResourceManager
with addBasePath(..., PRIORITY_DEFAULT).
2018-01-10 16:21:34 +01:00
Florent Rougon
39bf5d6b8a Add-ons: add fallback code for compilers without working <regex>
This is another place where the add-on code uses regexps, and so far I
had forgotten to add the fallback code for compilers that don't support
<regex> as per the C++11 standard.
2018-01-10 10:03:56 +01:00
Florent Rougon
1f2ba814a4 Add-ons: silence a compilation warning
Fix mismatch of 'struct' vs. 'class' keyword in declaration and
definition of Addon::Metadata.
2018-01-10 08:17:24 +01:00
Florent Rougon
5f50e25535 Add-ons: add method resourcePath() to addons.Addon ghosts
This method takes a string such as "this/is/a/relative/path" and returns
"[addon=ADDON_ID]this/is/a/relative/path", substituting the add-on
identifier for ADDON_ID.

This way, add-on authors don't even have to know the special syntax
'[addon=ADDON_ID]relative/path' used for add-on-specific resource paths,
and don't need to hardcode their add-on identifier inside each such path
either.
2018-01-10 01:25:50 +01:00
Florent Rougon
717fdfec39 Add-ons: register the add-on ResourceProvider with the simgear::ResourceManager
This makes it possible to look up files from add-on directories using
for instance FGGlobals::resolve_resource_path(), passing a string such
as "[addon=ADDON_ID]relative/path" as explained in the previous commit.
2018-01-10 01:25:36 +01:00
Florent Rougon
8c82fca416 Add-ons: add a simgear::ResourceProvider for add-on-specific lookup
A resource can be specified with the syntax:

  [addon=ADDON_ID]relative/path

Such a resource corresponds to the file $addon_base_path/relative/path
for the specific add-on whose identifier is ADDON_ID.

If the particular add-on isn't registered, looking up such a resource
throws sg_exception.
2018-01-10 01:25:36 +01:00
Florent Rougon
a137aed541 Add-ons: move parsing of the metadata file to a separate translation unit
This will be tidier, esp. since I am going to introduce another XML
config file.
2018-01-10 01:25:36 +01:00
Florent Rougon
4ed99dd05c Add-ons: make Addon::getMetadataFile() a private member function 2018-01-10 01:25:36 +01:00
Thomas Geymayer
7c8ab6c52a Update for nasal::Context changes 2018-01-09 23:22:55 +01:00
Florent Rougon
a999b87e06 Add-ons: rename ContactTraits to contact_traits for style consistency
This will be consistent with other traits classes such as
shared_ptr_traits (in flightgear::addons as well as in nasal
namespaces).
2018-01-08 08:05:35 +01:00
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