1
0
Fork 0
Commit graph

757 commits

Author SHA1 Message Date
James Turner
a458d46349 FGCom: don’t crash if properties change before postinit
Check the _initialized flag inside the listener, to avoid a crash
if Nasal sets fgcom properties during its startup, which happens
before FGCom runs its own postinit()

Ticket: https://sourceforge.net/p/flightgear/codetickets/2574/
2021-04-26 10:18:47 +01:00
James Turner
e1a9d27ca6 Generic protocols: suppress XML errors 2021-04-21 21:57:10 +01:00
Erik Hofman
5118009d44 Add a new network protocol: dds-props which for now only operates in the output mode: request a propery value using de FG_DDS_prop scheme and provide either it's path or property index id. UsageL fgfs --dds-props=dds,out,<hz>. Testing is possible with src/Network/DDS/fg_dds_prop to request a propery path/id or src/Network/DDS/fg_dds_log to log all propery samples passed over the DDS layer. 2021-04-16 11:26:21 +02:00
Julian Smith
d7d87479a9 In subsystem initialisation, don't default to SGSubsystemMgr::GENERAL.
Updated subsystem registrations to specify SGSubsystemMgr::GENERAL explicitly,
which makes things a little clearer.
2021-04-15 17:23:58 +01:00
Erik Hofman
f196c8418d Update the props sample description: remove an unnecessary type specifier (the union already holds it), add a sample version number and a mode to indicate reading from, or writing to, a property. The option to set a property value is reserved for future use and not yet implemented. 2021-04-15 10:11:42 +02:00
Erik Hofman
4f28e2dfff Add a proprety requester test utility 2021-04-09 14:44:33 +02:00
Erik Hofman
c88c47e1b5 No need to keep two maps: it's enough the have one PropertyList (vector) and a map 2021-04-09 14:43:20 +02:00
Erik Hofman
162f5f317d Switch to always add the GUID. Setting a string to null doesn't work for DDS samples and leads to a segmentation fault. 2021-04-09 14:42:38 +02:00
Erik Hofman
c951f3fcf4 Also log propery samples over DDS 2021-04-07 11:53:22 +02:00
Erik Hofman
202c69ad77 Implement the start of a property server using DDS. 2021-04-06 14:52:37 +02:00
Erik Hofman
e203336546 Udpate the logged name 2021-04-06 14:51:50 +02:00
James Turner
977dd6fd15 Add sentry breadcrumb for FGCom
Trying to understand FLIGHTGEAR-66 crashes where the IAXClient thread
is still running after FGCom::shutdown has (presumably?) been called
2021-04-04 16:35:40 +01:00
Erik Hofman
13a7eeef74 Use the new convenience constructor eliminating the need to call setup separately. 2021-03-28 09:00:15 +02:00
Julian Smith
797f02f9dd Allow listing of property children via telnet.
Adds new ls2 command with machine-readable output.
2021-03-27 22:37:47 +00:00
Erik Hofman
78b383734c Use the new helper function which converts the typename into a topic name. 2021-03-27 15:22:20 +01:00
Erik Hofman
2825feb4b2 Simplify the code even more: no need to explicitly define the type 2021-03-27 13:58:54 +01:00
Erik Hofman
2d684de929 Use the new templated helper functions to simplify the code 2021-03-27 13:57:05 +01:00
Erik Hofman
1467a8a170 Move the C version of fgfdm_log.c to examples/dds/ and convert it to C++ as fg_dds_log.cpp using the SimGear provided hepper classes. 2021-03-27 13:31:39 +01:00
Erik Hofman
f88f38ec53 Dot not only log FDM packets but also GUI and Ctrls packets when they arrive. 2021-03-25 14:21:30 +01:00
Erik Hofman
875713efad Merge all Net/DDS FDM, GUI and Ctrls struct handling into one source file and make it FlightGear agnostic which means that they can be used by, for instance, fgviewer. 2021-03-23 14:30:52 +01:00
Erik Hofman
8f5dc3e764 Use the renamed SG_DDS_Topic class 2021-03-19 13:52:44 +01:00
James Turner
f651ed2f15 Fixes for updated Package API 2021-03-17 09:09:30 +00:00
Erik Hofman
6e00c47d3d Revert "Use the desciptors typename as the topic name"
This reverts commit 1f3d9c089a.
2021-03-15 16:11:35 +01:00
Erik Hofman
1f3d9c089a Use the desciptors typename as the topic name 2021-03-15 15:19:13 +01:00
Lars Toenning
fb8ef10918 Reset unique ptr to delete object
Previously multiple start/stops of the swift-connection failed because the CPlugin object was not deleted
2021-03-12 10:28:42 +00:00
Lars Toenning
509fbbcebc swift - Add getOwnAircraftVelocityData dbus method 2021-03-12 10:28:42 +00:00
Lars Toenning
938bfd1604 Fix spelling mistake 2021-03-12 10:28:42 +00:00
Erik Hofman
c0bc09bf1a Cleaner code by a clear separation between sgFileType, sgDDSType and the default sgSocketType 2021-03-08 13:47:53 +01:00
Erik Hofman
0480bb15a9 (Try to) Prevent a one or more multiply defined symbols found error 2021-03-07 15:59:25 +01:00
James Turner
497a99f8d7 FGHTTP: add getOrCreate helper
Avoids duplicate creation when launcher & remote-tape are used
2021-03-07 13:08:29 +00:00
Erik Hofman
837010ac7b Clarify the license 2021-03-06 14:50:10 +01:00
Erik Hofman
ffc0105b47 Per request: Rename DDS to DataDistributionService to prevent confusion with DDS the image format. 2021-03-06 09:10:34 +01:00
Erik Hofman
5786d40272 * Support CycloneDDS as a SGIOChannel
* Support the native fdm, gui and ctrl protocols over DDS
* Add fgfdm_log as an fdm over DDS command line logging utility

Usage:
 --native-fdm=dds,out,60
 --native-ctrls=dds,in,60

etc.
2021-03-05 16:10:04 +01:00
Scott Giese
7fe25aa97f Merge branch 'next' of https://git.code.sf.net/p/flightgear/flightgear into next 2021-02-26 21:40:11 -06:00
Scott Giese
a3c4dcf522 Maintenance: plugin
Minor whitespace adjustments.
2021-02-26 21:03:11 -06:00
Scott Giese
82c34590f6 Maintenance: swift_connection
Fix memory leaks.
Fix mixed use of tab/spaces for indentation.
2021-02-26 21:01:35 -06:00
Julian Smith
91dbc902a2 src/Network/props.cxx: added 'telnet server' to comment to make it easier to grep for. 2021-02-26 22:29:33 +00:00
Scott Giese
d605294348 Maintenance: nmea
use vector.empty instead of vector.size == 0.
convert atof (c) to stod (c++)
2021-02-21 20:26:45 -06:00
Scott Giese
f56e2a1b3a Maintenance: nmea
overflow prevention
2021-02-21 16:02:50 -06:00
Scott Giese
08fce6d680 Maintenance: atlas
overflow prevention
2021-02-21 15:51:08 -06:00
Julian Smith
f62e5b9ce3 CompositeViewer: Support for multiple view windows using osgViewer::CompositeViewer.
Overview:

    Previously Flightgear always used a single osgViewer::Viewer(), which
    inherits from both osgViewer::ViewerBase and osgViewer::View, giving a
    single view window.

    If CompositeViewer is enabled, we instead use a osgViewer::CompositeViewer
    which contains a list of osgViewer::View's. Each of these View's can have
    its own eye position, so we can have multiple different views of the same
    scene.

    Enable at runtime with: --composite-viewer=1

Changes to allow use of osgViewer::CompositeViewer:

    Previously FGRenderer had this method:

        osgViewer::Viewer* getViewer();

    This has been replaced by these two new methods:

        osgViewer::ViewerBase* getViewerBase();
        osgViewer::View* getView();

    If CompositeViewer is not enabled (the default), the actual runtime state
    is unchanged, and getViewerBase() and getView() both return a pointer to
    the singleton osgViewer::Viewer() object.

    If CompositeViewer is enabled, getViewerBase() returns a pointer to a
    singleton osgViewer::CompositeViewer object, and getView() returns a
    pointer to the first osgViewer::View in the osgViewer::CompositeViewer's
    list.

    The other significant change to FGRenderer() is the new method:

        osg::FrameStamp* getFrameStamp()

    If CompositeViewer is not enabled, this simply returns
    getView()->getFrameStamp(). If CompositeViewer is enabled it returns
    getViewerBase()->getFrameStamp(). It is important that code that previously
    called getView()->getFrameStamp() is changed to use the new method, because
    when CompositeViewer is enabled individual osgViewer::View's appear to
    return an osg::FrameStamp with zero frame number).

    All code that uses FGRenderer has been patched up to use the new methods so
    that things work as before regardless of whether CompositeViewer is enabled
    or not.

    We make FGRenderer::update() call SviewUpdate() which updates any extra
    views.

Extra view windows:

    If CompositeViewer is enabled, one can create top-level extra view windows
    by calling SviewCreate(). See src/Viewer/sview.hxx for details.

    Each extra view window has its own simgear::compositor::Compositor
    instance.

    Currently SviewCreate() can create extra view windows that clone the
    current view, or view from one point to another (e.g. from one multiplayer
    aircraft to the user's aircradt) or keep two aircraft in view, one at a
    fixed distance in the foreground.

    SviewCreate() can be called from nasal via new nasal commands "view-clone",
    "view-last-pair", "view-last-pair-double" and "view-push". Associated
    changes to fgdata gives access to these via the View menu. The "view-push"
    command tags the current view for later use by "view-last-pair" and
    "view-last-pair-double".

    Extra view windows created by SviewCreate() use a new view system called
    Sview, which allows views to be constructed at runtime instead of being
    hard-coded in *-set.xml files. This is work in progress and views aren't
    all fully implemented. For example Pilot view gets things slightly wrong
    with large roll values, Tower View AGL is not implemented, and we don't
    implement damping. See top of src/Viewer/sview.cxx for an overview.

OpenSceneGraph-3.4 issues:

    OSG-3.4's event handling seems to be incorrect with CompositeViewer -
    events get sent for the wrong window which causes issues with resize and
    closing. It doesn't seem to be possible to work around this, so closing
    extra view windows can end up closing the main window for example.

    OSG-3.6 seems to fix the problems.

    We warn if CompositeViewer is enabled and OpenSceneGraph is 3.4.
2020-11-21 13:27:02 +00:00
Automatic Release Builder
df42c6f026 Launcher: UI feedback for hangar migrations
Add pop-up notification when we migrate to a new version of a hangar.
Convert the ‘new version available’ message to use a pop-up
notification as well.
2020-10-29 16:24:39 +00:00
Bertrand Coconnier
4049acd84e Bump the protocol version because Chris Speck's changes broke the backward compatibility. 2020-10-02 21:30:54 +02:00
James Turner
cf424e4344 Rename buildId header file
Avoid the very common name ‘build.h’ in favour of something clearer
and FlightGear specific.
2020-08-24 15:05:16 +01:00
James Turner
178d1beb80 Cmake: Remove version.h machinery
Merge this file into config.h, this means we can save an include path
everywhere.
2020-08-24 15:04:24 +01:00
James Turner
47ff3e9f67 Improve CMake strucutre 2020-08-23 11:31:37 +01:00
James Turner
16ae171333 Fix a read of freed-data when closing props channels
Ensure we close all channels, before the NetPoller is destroyed, to
avoid a use-after-free.
2020-08-12 15:32:52 +01:00
James Turner
a05e5075b2 FGCom: explicit init some member variables
Fix various places Valgrind identified as read-of-un-inited. Also
fix use of frequencies are integers: always use a double type explicitly,
which will make MSVC happier.
2020-08-12 15:32:02 +01:00
Hans Kunkell
2992e1b100 implements reinit of IO channels 2020-08-10 10:27:51 +01:00
Chris Speck
932938cbee Send fuel tank capacity, fuel density and level in m3 2020-07-29 20:13:07 +01:00