1
0
Fork 0
Commit graph

16100 commits

Author SHA1 Message Date
James Turner
f7b0b77abb PU.h sprintf fixing
Adjust our customised pu.h to use snprintf, with correct buffer
size information. Also adjust includes so our custom version is used, ]
even when including the system puAux.h.
2023-01-09 10:55:58 +00:00
James Turner
048cb38cd0 Supress a warning building Flite 2023-01-09 10:36:18 +00:00
James Turner
dc467ebdfa Cmake Improve Finder for CppUnit
Define an imported target for the system CppUnit, so we can
correctly pass includes locations to FgfsTestSuite
2023-01-08 19:36:44 +00:00
James Turner
4c42600898 Sprintf to snprintf fixes
Reduce warning from Clang about use of sprintf.
2023-01-08 19:36:44 +00:00
James Turner
0fbe3547fb Nasal: test for hash creation from kw args 2023-01-08 19:36:44 +00:00
James Turner
3b36379c5c Nasal: improve module delete/reload
Allow modules to define an unload callback, and also drive
the 'loaded' property to false, to give modules the ability to clean
up when being unloaded. This makes reloading work without
errors for Canvas.

Additionaally, add some special code when creating the
Canvas module, to ensure the C++ defined pieces are loaded :
fortunately Canvas is the only module which needs this.
2023-01-06 10:41:01 +00:00
James Turner
3f742c1b1d Expose new Canvas methods to Nasal
Requires corresponding SimGear update
2023-01-05 14:06:46 +00:00
James Turner
fc842c17f0 Canvas: LayoutItem.setVisible can be chained
Wrap LayoutItem::setVisible so it returns self, and hence can be chained,
similar to methods implemented in Nasal.
2023-01-04 15:22:24 +00:00
James Turner
1b07851374 Canvas Layout: check arguments to add/insertItem
When the ItemRef argument is null, report a runtime error
instead of crashing.
2023-01-04 14:16:24 +00:00
D-ECHO
1889045891 YASim Hitch: correct typo brake to break 2023-01-04 10:58:37 +00:00
Roman Ludwicki
56aa2cd479 Prevent from closing the simulator just because it can't write to the logger file 2023-01-03 11:13:48 +00:00
portree_kid
3667e5de3c AI/ATC
* Added Messages for Takeoff
* Added Messages for Hold & Holdpatterns
* More enums instead of Magic Numbers
2022-12-29 22:21:23 +01:00
Gianfranco Costamagna
11eca7825d Fix build on riscv64 by using atomic int instead of atomic bool.
gcc on riscv64 is not able to compile natively atomic int, because of hw constraints, leading
to an additional to link external atomic libraries, making the code really slower to run.

Instead, using std::atomic<int> can be compiled and optimized natively without any additional -latomic linking.
2022-12-11 08:48:15 +01:00
portree_kid
097603452e Merge branch 'next' of ssh://git.code.sf.net/p/flightgear/flightgear into next 2022-12-03 21:48:42 +01:00
James Turner
e08eee587d Route-manager: is expose is-route property for UI 2022-12-02 12:22:15 +00:00
James Turner
78e6a209f1 Add some missing cases to Nasal FlightPlan binding
Expose 'between' restrictions as a 2-tuple.
2022-12-02 12:22:15 +00:00
Stuart Buchanan
56996cc01a WS30 - Clear WS30 data on tile unload
Previously WS30 data from STG files - in particular road/rail/river
data - was kept permanently.

This change unloads it with the STG-level tile.  This is the right
level to do so, as it will be reloaded from tile when the STG file
is loaded again.
2022-12-01 16:43:23 +00:00
Stuart Buchanan
ebe511439a Control number of database pager threads from prop
Previously we were hardcoded to 2 database pager threads,
one for files and one for http.

This commit adds a new property /sim/rendering/database-pager/threads
to control the number of threads on startup.

It also re-orders the code to set the database pager so that such
a setting has an effect.
2022-12-01 16:39:50 +00:00
James Turner
ff5752d1dd Mark time test as passing, with updated TZ data
Requires FGData commit  844c24a085b6f065a1d6c
2022-12-01 09:31:12 +00:00
Erik Hofman
bc3e80b2cb Sascha Reißner
Change all constant numeric values with the defined constant.
Changed the wrong '*offset-m' properties and the 'rollspeed-ms' property.

Maybe the wrong offset properties hasnt popped up because no dev used
it. This value will not be used in any animation because its normally a
fixed value that doesnt change at runtime.
2022-12-01 08:40:24 +01:00
James Turner
5800143b96 Add test case for SGTime::updateLocal crash
SF-ID: https://sourceforge.net/p/flightgear/codetickets/2780/
2022-11-30 14:13:35 +00:00
Erik Hofman
2c0b3d20a2 Sascha Reißner
With this patch, the dev can set <max-compression-ft> or <max-compression-m> in the set-file (or another
xml-file that get included from the set-file).
The code calculates also 'compression-m' for every gear.
If the 'max-compression-*' property is omitted, the code behave as before ('compression-norm' is the same as 'compression-ft').
2022-11-30 08:43:10 +01:00
Edward d'Auvergne
c8e7a019f5 Revert "SGSubsystemMgr: Switch to the new add() function with a single subsystem object argument."
This reverts commit 30d63b7209.
2022-11-29 22:23:34 +01:00
Edward d'Auvergne
30d63b7209 SGSubsystemMgr: Switch to the new add() function with a single subsystem object argument.
This allows for the static class ID, GroupType, and update interval to be automatically extracted
from the subsystem registration information.
2022-11-29 16:36:05 +01:00
Edward d'Auvergne
12ca368868 SGSubsystemMrg GroupType fixes for a few subsystem registrations. 2022-11-29 11:41:34 +01:00
Edward d'Auvergne
790b553500 Fix for incorrect subsystem grouping introduced in c5aa3ca0f1.
Some of the subsystems created in the fg_init fgCreateSubsystems() function were accidentally
shifted into the subsystem group SGSubsystemMgr::GENERAL, as these subsystems cannot be currently
registered with the subsystem manager and still have to use the non-templated subsystem manager
add() function.
2022-11-28 21:49:24 +01:00
James Turner
0a85e23cde Extend FlightPlan to handle ‘between’ restrictons
As part of this, also improve units handling in speed/altitude
restrictions.
2022-11-28 15:34:00 +00:00
James Turner
73463a3a98 Atmosphere: add ISA Mach conversion helpers
This is being added for use in FlightPlans, but replace equivalent
code in AIBallistic which showed up. As part of this, simplify 
AIbase.
2022-11-28 15:33:15 +00:00
James Turner
82dbef0c12 Make Swift tests conditional on Swift support 2022-11-28 15:13:16 +00:00
portree_kid
b1186e7da2 Merge branch 'next' of ssh://git.code.sf.net/p/flightgear/flightgear into next 2022-11-27 17:17:21 +01:00
portree_kid
f0b7e9c048 AI logging for missing runway at arrival airport 2022-11-27 17:16:17 +01:00
Stuart Buchanan
4f01ddb1cc WS30 - Remove log spam for missing tiles
Previously any missing WS30 tiles created multiple OSG WARN
messages from the file not being found.  This change does a check
to ensure the file actually exists before put it on the queue for
loading.
2022-11-27 14:31:46 +00:00
Stuart Buchanan
e6c2e258b5 Fix crash on exit
NasalModelDataProxy destructor relies on globals being valid.
2022-11-27 14:29:11 +00:00
portree_kid
ccf674e189 AI Prevent Segfault when aircraft gets bogus flightplan 2022-11-23 14:37:30 +01:00
Richard Harrison
bd4e7462ac Permit AI model to define basic submodel collision parameters.
AI models have rudimentary collision detection with submodels that performs two tests.

1. The height difference must be less than a defined amount
2. The centre point range must be less than a defined amount.

(2) above by itself would result in a spherical comparison; however (1) effectively modifies this to slice off the top and bottom of the sphere so that the sphere heigh is half of the value in (1).

Previously these heights and lengths were hardcoded - this change allows these to be defined in the xml instead using the <collision-length> and <collision-height> tags

e.g.
    <entry>
      <type>ship</type>
      <collision-length type="double">50</collision-length>
      <collision-height type="double">50</collision-height>
    </entry>

Default values:
+---------------+-------------+------------+
| Type          | Height(m)   |  Length(m) |
+---------------+-------------+------------+
| Null          |      0      |        0   |
| Aircraft      |     50      |      100   |
| Ship          |    100      |      200   |
| Carrier       |    250      |      750   |
| Ballistic     |      0      |        0   |
| Rocket        |    100      |       50   |
| Storm         |      0      |        0   |
| Thermal       |      0      |        0   |
| Static        |     50      |      200   |
| Wingman       |     50      |      100   |
| GroundVehicle |     20      |       40   |
| Escort        |    100      |      200   |
| Multiplayer   |     50      |      100   |
+---------------+-------------+------------+
2022-11-21 22:00:26 +00:00
portree_kid
95a274c135 Merge branch 'next' of ssh://git.code.sf.net/p/flightgear/flightgear into next 2022-11-20 21:55:32 +01:00
portree_kid
b8d173c3e4 #2358 AI Aircraft not taking off 2022-11-20 21:55:25 +01:00
Edward d'Auvergne
45243c96e8 TestSuite: System tests for subsystem creation via the global registrations.
This covers all instantiated SGSubsystem derived classes, i.e. those that are
not base classes, including subsystem groups.  Both non-instanced and instanced
subsystem creation is tested.  The tests for subsystems yet to be registered are
commented out.
2022-11-17 15:57:39 +00:00
Edward d'Auvergne
c1c7b043ac SGSubsystemMgr::get_subsystem(): Universal switch to the templated function.
The globals non-templated get_subsystem() helper function has been made private
to enforce the switch.
2022-11-17 15:57:39 +00:00
Edward d'Auvergne
c5aa3ca0f1 SGSubsystem classes: Switch to the new SGSubsystemMgr::add() functions.
Most subsystems are now created via the subsystem manager using the global
subsystem registrations.

The FGGlobals add_subsystem() and add_new_subsystem() methods have been removed
as the subsystem manager addition and creation function interface now exceeds
the functionality of these helper functions.
2022-11-17 15:57:39 +00:00
Edward d'Auvergne
ad33e50324 SGSubsystem classes: Registration of all subsystems added since mid 2018. 2022-11-17 15:57:39 +00:00
Roman Ludwicki
ec52a4ee7b Add possibility to call ls2 telnet command without dir parameter (like for ls command) 2022-11-13 18:38:42 +01:00
Stuart Buchanan
535c5a5ff1 Scenery data attribution - sources.xml
Read a sources.xml file in Scenery directories and copy into
the property tree under /scenery/sources

Expected format:

<?xml version="1.0"?>
<PropertyList>
    <source>
        <name>Corine Land Cover (CLC) 2018, Version 2020_20u1</name>
        <link>http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A</link>
        <license>GMES Open License</license>
    </source>
    <source>
        <name>NASADEM Merged DEM Global 1 arc second V001</name>
        <link>https://www.earthdata.nasa.gov/</link>
        <license>Public Domain</license>
    </source>
    <source>
        <name>OpenStreetMap</name>
        <link>https://www.openstreetmap.org/copyright</link>
        <license>Open Data Commons Open Database License</license>
    </source>
</PropertyList>
2022-11-12 20:45:01 +00:00
portree_kid
9b4bd6fdcb AI Better approach descent 2022-11-12 21:18:16 +01:00
James Turner
d8f212ed3b Adjust Nasal reload command name
Avoid conflict with modules.nas command that does something
similar. Command is now 'nasal-reload'.
2022-11-10 11:20:58 +00:00
James Turner
c509744b0f Nasal: support for module reload via command
This won’t work for all modules, depending on what inter-dependencies
exist.
2022-11-08 22:38:04 +00:00
James Turner
6bb22caea2 PUI Compat: handle failed loads without crash 2022-11-08 22:38:04 +00:00
James Turner
c6ed57d04b Fix an occasional traffic crash 2022-11-08 22:38:04 +00:00
Stuart Buchanan
6d76b657d6 WS30 - remove separate water mesh option
No longer required now water shader integrated into
main ws30 shader.  Also clean up.
2022-11-08 21:47:41 +00:00
Florent Rougon
0deaec870a Adapt to SG 952d071c0 (SGSoundSample ctor now takes std::unique_ptr by value)
The aforementioned SG change[1] was done in line with Herb Sutter's
writing at [2] in order to clearly express sink semantics.

[1] 952d071c08/
[2] https://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/
2022-11-08 14:34:24 +01:00