1
0
Fork 0
Commit graph

182 commits

Author SHA1 Message Date
Scott Giese
43c530b660 Modernize: std::string_literals 2020-12-05 14:25:59 -06:00
Scott Giese
eabd4bbc7f Fix textNasalSys 2020-12-05 13:35:48 -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
James Turner
423c754009 Reposition: tolerate more scenarios in ATC_mgr
When starting at an airport, but not at parking or a runway, create
an empty AIFlightPlan, and ensure the AIManager code doesn’t choke on
empty FPs.

Add a unit-test which simulates the C172 tutorial reposition logic,
which is a little gnarly.
2020-10-27 18:32:18 +00:00
legoboyvdlp R
b00520ffdb Add test case for issue with routepath at Paro. Also add support for approaches to the TestDelegate. 2020-10-13 09:32:11 +01:00
James Turner
830a890eff Tests: skeleton ViewManager/Views tests 2020-09-08 12:31:42 +01:00
James Turner
5da15c3773 TestSuite: Fix include paths for logging 2020-09-08 11:37:13 +01:00
James Turner
e46c6f587b AIFlightPlan: remove ‘erase’ option from Decrement
Thankfully, the erase option to DecrementWaypoint was never used, so
remove it, since it’s … mental.
2020-09-05 11:16:36 +01:00
James Turner
02cfaeabba Tests: AIFlightPlan Increment/Decrement
Capture the current behaviour of Increment/DecrementWaypoint in
AI flightplans, prior to making some simplifications. Especially try
to test the behaviour of the ‘increment and erase’ logic.
2020-09-05 11:14:00 +01:00
James Turner
f5b5828bd0 AIFlightPlan: add test for XML parsing
This meant some slight refactoring to expose some easier APIs for
testing, but the normal methods should be unaffected.
2020-09-05 10:44:43 +01:00
James Turner
3a3ff07883 Start testing FGAIFlightPlan 2020-09-05 10:44:43 +01:00
James Turner
1f6b43c38f More AI tests 2020-09-03 17:51:40 +01:00
James Turner
d1fc4b58cb Start creating tests of AIModel code
First test just creates the manager, and ensures the user aircraft
updates in sync with the real aircraft.
2020-09-03 17:51:40 +01:00
James Turner
37d820120d Unit-testing: tests for Nasal SGCommand API
Test adding/removing/invoking commands, and error handles when
duplicate adding and removing a command name.
2020-08-26 17:20:58 +01:00
James Turner
5dbab6e90e CMake: overhaul how we find 3rd-party files
Handle the standard windows-3rd-party setup (used by fgmeta) with no
extra options, and also handle the slightly odd setup we use on Jenkins.
Try to tolerate all permutations of setting MSVC_3RDPARTY_ROOT to 
different places in the hierarchy.

We no longer try to guess Boost_INCLUDEDIR by looking at parent dirs of
MSVC_3RDPARTY_ROOT, since this seemed kind of bad to me. Let’s try 
it and see.
2020-08-26 13:57:24 +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
fef50310bf Cmake: fix some issues Scott spotted. 2020-08-23 18:15:07 +01:00
James Turner
218df89b29 Embedded resources: better cmake command
Use add_custom_command and an intermediate OBJECT library to avoid
rerunning fgrcc unless the XML input file has actually changed.
2020-08-23 11:31:37 +01:00
James Turner
47ff3e9f67 Improve CMake strucutre 2020-08-23 11:31:37 +01:00
Edward d'Auvergne
04ee8c34a4 TestSuite: Execution of multiple tests or suites using comma separated lists.
This enables options such as '-u AeroElementTests,YASimAtmosphereTests'.  It
should help tracking down bugs whereby a test failure or error is triggered
solely due to a previous test.
2020-08-17 20:14:32 +02:00
James Turner
a297c89144 Flightplans: add clearAll, rename clear -> clearLegs
Improve naming of clear() methods, and expose the new ones to Nasal.
this will allow RouteManager dialog ‘clear’ button to clear all, soon.

See ticket:
https://sourceforge.net/p/flightgear/codetickets/2064/
2020-08-17 16:11:10 +01:00
James Turner
7eb52fa081 Add another timer test
Trying to trace down https://sourceforge.net/p/flightgear/codetickets/2257/
2020-08-07 11:39:07 +01:00
legoboyvdlp R
d6b7eaf60f Fix that tp_type will return nil for transitions 2020-07-30 12:26:04 +01:00
legoboyvdlp R
02c7b37122 Add test case for issue with last waypoint being a runway 2020-07-30 12:25:17 +01:00
legoboyvdlp R
668b499ff4 Correct restrictions above and below. Add test case. Fix contributed by Tobias Dammers 2020-07-30 12:25:02 +01:00
James Turner
1e403ae6dd Fix an assert running aero tests
FGLocale needs to be init-ed, before calling splash progress.
2020-07-22 11:49:14 +01:00
legoboyvdlp R
3255105190 Ensure that cruise parameters are set when cloning flightplan 2020-07-22 11:31:07 +01:00
James Turner
2f4b2153ef Fix test: find airways.
Fix handling of ‘both’ level option in several places, and amend
the test to make it explicit that we want Clacton VOR, not NDB.
2020-07-16 11:28:50 +01:00
James Turner
f0d3663102 Nasal unit-testing: allow deep struct equality.
Add a deep comparison of vecs and hashes, when deciding equality in
test assertions.
2020-07-08 15:22:27 +01:00
James Turner
c3fce7e436 Tests: load loadprioirty.xml
Otherwise we screw up Nasal load order.
2020-07-02 12:19:19 +01:00
legoboyvdlp R
cd5a0ffe0b Expose totalDistanceNm to Nasal flightplan ghost
Requested by Tobias Dammers, includes associated test. 
May be cherry-picked to 2020.2.
2020-06-30 13:30:35 +01:00
legoboyvdlp R
585c821bde Extend wp.hidden unit test to ensure path is empty after a hidden waypoint 2020-06-19 09:47:16 +01:00
legoboyvdlp R
f05c10e13a Add test for airway() nasal function 2020-06-18 09:22:03 +01:00
James Turner
9326c88f9b Move Qt root path variable to top-level CMakeList 2020-06-10 17:59:09 +01:00
legoboyvdlp R
b210f9e253 Add test for cloning flightplan with approach transitions 2020-06-10 17:18:23 +01:00
James Turner
2f1852ee83 Add test-case for timer restart
Test rescheduling of timer during activation. See:
https://sourceforge.net/p/flightgear/codetickets/2257/
2020-05-31 14:20:01 +01:00
James Turner
ea40f3d424 Adjust LBEL SID departure test work work 2020-05-31 12:16:59 +01:00
James Turner
03563a1601 Fix DME intercept handling in route/GPS
Both the route-path cade and the RNAV code were using some bad logic
to compute the intersection point. All fixed now, but requires a
new helper in Simgear.
2020-05-30 15:59:07 +01:00
James Turner
e51a0c55b5 Fly-by support for Radial intercepts
In the common case, avoid an overshoot when doing radial
intercepts.
2020-05-30 15:59:07 +01:00
James Turner
176ccfa8dc Test updates for new GPS fly-by 2020-05-30 15:59:07 +01:00
James Turner
eb55cd4a8c Test pilot changes for data logging 2020-05-30 15:59:07 +01:00
James Turner
5a73859b62 Add missing license 2020-05-30 15:59:07 +01:00
James Turner
e8bf4220a8 Add test-data logger 2020-05-30 15:58:59 +01:00
legoboyvdlp R
e76787fa62 Add test for Heathrow ILS 27L
To try and diagnose user problems intercepting glideslope at 4000 feet
+ 12 miles.
2020-05-29 16:42:41 +01:00
James Turner
58d7454976 Explicit support for approach transitions
Make the handling of approach transitions consistent with SID and STAR
transitions, including the Nasal API. Add some tests to cover the
new features.
2020-05-27 21:44:59 +01:00
James Turner
55ce199535 Fixes for cloning FPs with procedures 2020-05-27 16:09:18 +01:00
legoboyvdlp R
1a94f4858b Test for cloning plan with procedures 2020-05-25 09:42:52 +01:00
legoboyvdlp R
14c729027c Tests for cloning flightplan.
Two initial tests: basic flightplan and with fgfp-loaded flightplan
2020-05-25 09:42:44 +01:00
James Turner
54f660764e Tests: change how we find+load data files
Avoid encoding test-data as strings, since this exceeds MSVC limits
on string literals, and tests don’t need to be relocatable anyway,
so we can just hard-code the source location into config.h
2020-05-24 14:14:35 +01:00
James Turner
ce6bd859b3 Add Nasal source location to unit-tests 2020-05-22 17:35:24 +01:00