1
0
Fork 0
Commit graph

14 commits

Author SHA1 Message Date
James Turner
45d969f319 Add tests cases around bug 2616
Can't reproduce this, but capturing in a unit-test just to make sure.

SF-Ticket: https://sourceforge.net/p/flightgear/codetickets/2616/
2021-08-21 13:09:39 +01:00
James Turner
4bf88a0b67 Extend unit-test for route-manager waypoint selection
SF-Ticket: https://sourceforge.net/p/flightgear/codetickets/2372/
2021-08-20 12:08:17 +01:00
James Turner
7a3f8276a6 Add unit-tests for Route-manager commands
Fix some bugs in insert-waypt command discovered during the testing
(w00t, tests FTW)
2020-12-14 11:45:46 +00:00
James Turner
72f1b84837 Improve waypointFromString logic
- exclude POIs and some other types from the ident match, to avoid
  confusing results
- improve how the search vicinity is computed when inserting a leg,
  which is the common case for a route with a destination set. Use
  the midpoint of the leg ending at the insert position, as the optimal
  search vicinity
- move the waypointFromString code into route.cxx, since it is mostly
  independent of a FlightPlan instance
- extend the tests to cover the bug which flagged these issues

Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2372/
2020-12-13 17:55:32 +00: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
fffcd14362 Fix FlightPlan procedure transition handling
Overhaul how transitions are stored in FlightPlan XML, and how
they’re exposed to Nasal. Simplify the Nasal access by making
‘sid_trans’ and ‘star_trans’ writeable.

Extend the unit-tests a lot to cover this, both from C++ and also
from Nasal

As part of this, overhaul the ownership of FlightPlan delegate
factories, to make it safer (use ref-counting of the factories,
and allow the factory to customise delegate clean-up behaviour)
2020-05-21 22:32:28 +01:00
James Turner
8af20fbcab Fix for loading of FGFP plans.
Where the plan does not contain departure / arrival WPs, fire the
corresponding delegate methods after load, to run the selection logic.

Also, add a ‘loaded’ delegate callback, to give delegates a chance to
perform validation and fix-up after all flight-plan loads.
2020-05-19 22:01:42 +01:00
legoboyvdlp R
5747b51df3 Add test for fgfp procedures (failing) 2020-05-14 11:32:49 +01:00
James Turner
134685b527 Fix FP delegate when loading GPXs
When load a GPX route, run normal departure/arrival airport callbacks
on the delegates. (They are blocked for ‘native’ XML routes to avoid
losing SIDs and STARs)

https://sourceforge.net/p/flightgear/codetickets/2227/
2020-05-03 08:30:18 +01:00
James Turner
6baa55b36b Waypoint hiding support (for the A320, etc)
To support FMS which delete ‘past’ waypoints, add some helpers:
 - waypoints can be flagged as hidden, this property is exposed to Nasal
 - currentWP() accepts an offset parameter, allowing FlightPlan indexing
   to treat the current WP as index 0
 - a ‘numRemainingWaypoints()’ function on flightPlan in Nasal, again
   to range how many waypoints are left, starting from the current WP

Add some basic tests of these new features to the route-manager tests.
2020-05-01 09:28:42 +01:00
James Turner
17774dbe4c FlightPlan: DISCON works with pointAlongRoute
Add some tests for the default GPS / route-manager handling of
DISCON in flight-plans. Especially check behaviour when sequencing
a DISCON, and resuming with a Direct-to after one. 

This requires a corresponding FGData update to the default GPS Nasal.
2020-04-19 16:44:49 +01:00
James Turner
18c19885c6 Improvements to Nasal hold API
Ensure changes from Nasal are picked up by delegates (such as GPS) when
they are made. Add a route-manager test which sets and exits a hold
using Nasal.

As part of this, update the test API to make it easy to run Nasal from
a test.
2019-09-24 11:29:05 +01:00
James Turner
45df8f51b2 Move GPS sequencing into Nasal (optionally)
GPS now lets the delegate handle the sequencing behaviour, by
setting a new config property. The default GPS delegate (in Nasal)
now sets this property.

This requires a corresponding FGData update.
2019-09-20 13:05:57 +01:00
James Turner
1c58de62ed Route-manager unit-tests
Also contains large extensions to the TestPilot helper
2019-09-18 23:42:39 +01:00