1
0
Fork 0
Commit graph

390 commits

Author SHA1 Message Date
Florent Rougon
30c8328399 fix.dat parser: check the stream's badbit flag after each I/O operation
- new private method FixesLoader::throwExceptionIfStreamError();
- call it whenever appropriate.
2016-09-28 12:22:44 +02:00
Florent Rougon
d9c879ff30 fix.dat parser: new class FixesLoader; change loadFixes() into a method
- loadFixes() becomes FixesLoader::loadFixes();
- the previous 'cache' variable (NavDataCache *) is now a private member
  of FixesLoader, named '_cache'.
2016-09-28 09:24:33 +02:00
Florent Rougon
cf9759f78f fix.dat parser: fix line numbering and better handle malformed data
- Line numbering was incorrect, because "in >> lat >> lon >> ident;"
  happily skipped over blank lines without increasing the line number.

- Safe stream input handling: first, std::getline() tries to read data,
  then we check whether that was successful (via the input stream's
  bool() method, implicitly called in the 'for' loop's exit check), and
  only if this is the case, we process the data that was read. The main
  problem with the previous code is that checking the stream's eofbit
  can't possibly predict whether a _future_ read will be successful---it
  may fail due to an I/O error, at least.

- Currently, the code uses atof() to parse the latitude and longitude
  fields. This should be fast, though not good at detecting errors in
  the input; however, this is not worse than the previous code which
  didn't handle such cases at all.

- Correctly deal with input lines containing a number of fields
  different from 3 (except for the header and the special '99' line):
  log a warning, ignore the line and continue. This adresses the problem
  described in
  <https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/87shydeen1.fsf%40frougon.crabdance.com/#msg35034274>.
  In short, the previous code entered an endless loop trying to process

   31.815914 -106.281897 EL PA

  from recent earth_fix.dat
  (obtained from <http://gateway.x-plane.com/navaids/LatestNavFix.zip>).
2016-09-28 09:24:33 +02:00
James Turner
a60d07ea9c Incremental insert of NE data to the index. 2016-08-09 09:38:54 +01:00
James Turner
7f3fe584e3 Update for path-aware easyXML API 2016-07-03 23:43:39 +01:00
James Turner
9cffcf63ae Further SGPath encoding fixes. 2016-07-01 04:54:29 -05:00
James Turner
6d0c2070fd Use future-proof SGPath APIs.
Remove uses of .str(), .c_str() and some other methods of SGPath.
Pass SGPath directly where possible, or explicitly convert to the
appropriate 8-bit encoding.
2016-06-28 10:08:38 +01:00
James Turner
16814800ce Use Paths instead of strings. 2016-06-22 17:36:05 +01:00
James Turner
03ecac9dbc Work with new SGPath API. 2016-06-22 17:36:05 +01:00
Florent Rougon
959ac91a8b Add missing include in src/Navaids/NavDataCache.cxx
#include <sstream> is needed for NavDataCachePrivate::init()
which uses std::ostringstream.
2016-05-19 09:19:06 +02:00
James Turner
b431696e9b Fixes for first/last legs on a route
- fixes total route distance calculation
2015-12-17 19:22:14 -08:00
James Turner
9c467af6bf Interim windows build fix
(real fix to follow shortly)
2015-12-14 10:56:42 -06:00
James Turner
7afedb1702 Work on visualisation of Vias 2015-12-11 13:43:25 -06:00
James Turner
eaa147e3c2 Work on FlightPlan VIA / discontinuity support.
Needed for realistic FMS route support.
2015-12-11 13:43:25 -06:00
James Turner
545b347a16 Relocate implementation of geocRadialIntersection 2015-12-10 15:53:05 -06:00
James Turner
fc887b106b Checkpoint - ground-net skips the cache 2015-12-01 14:01:32 +00:00
James Turner
cec1de6219 Use a transaction when indexing polylines. 2015-11-29 14:18:30 +00:00
James Turner
e52e20b54f SHPParser 2015-11-27 23:02:42 +00:00
James Turner
b9acb26c07 Work on launcher diagrams. 2015-11-23 00:47:01 +00:00
James Turner
56d7d049bc Launcher GUI for in-air / navaid starts 2015-11-23 00:46:25 +00:00
James Turner
1e213201cf Work on the launcher 2015-11-23 00:45:21 +00:00
James Turner
bbff8dcbb6 Remove / reduce level on some debug output 2015-06-08 10:37:26 +01:00
Rebecca N. Palmer
659c5b9676 Fix spelling 2015-04-06 10:28:10 +01:00
James Turner
e0274af493 Percentage feedback during nav-cache build.
- also used by the GUI launcher for the same.
2015-03-19 12:01:38 -05:00
James Turner
c3543f8fdd GUI ‘restore defaults’ support.
- Hold ‘alt’ on launch to restore defaults, including launcher prefs.
2015-03-08 00:42:39 +00:00
James Turner
2d8cf78328 Fix Linux compilation.
- <memory> needed for auto_ptr
2015-02-25 23:53:49 +00:00
James Turner
e1def22193 Fix cleanup of RouteDataPrivate 2015-02-25 22:58:56 +00:00
James Turner
564177933b FlightPlan activation, delegate hook. 2015-02-23 13:41:50 +00:00
Stuart Buchanan
6725b460bf Clean up some trivial warnings 2015-01-18 19:49:14 +00:00
James Turner
dcf8ac1778 route-path: separate turn entry and exit parts.
Fixes appearance of runway legs with off-centerline previous
and next points, since we can generate different curves for each
end of the runway.
2015-01-14 23:28:52 +00:00
James Turner
e4f5f71aae Route path turn helpers.
Make the code more readable with some named helper functions.
2015-01-11 13:15:24 +00:00
James Turner
e94371ebfc Route-path bug fixes.
- explicit aircraft performance categories for turn radius
- allow overflight leg course behaviour to be selected
2015-01-08 19:46:04 +00:00
James Turner
78e8f53312 In-app launcher for Mac, based on Qt5.
The old Mac launcher doesn’t work on Yosemite, add a tiny
Qt-based launcher inside the main process (no need to fork /
exec) which runs before the OSG window is created.

Will be merged for 3.4, hopefully with no impact on other
platforms.
2015-01-06 19:13:30 +00:00
James Turner
5ccc835667 Fix turn entry path position computation. 2015-01-03 00:29:07 +00:00
James Turner
6db45dac9d Fix two route path issues found by Hyde
- course computation from a runway was wrong (used threshold pos)
- negative distance along path was using wrong distance to offset
2015-01-02 09:47:54 +00:00
James Turner
dbc47efa18 Partial fix for runway leg courses.
Don’t assume runway leg course matches the runway heading.
Full fix means generating separate entry/exit turns for runways.
2014-12-25 21:52:54 +03:00
James Turner
5c659b3970 Fix distance-along-path computation
(Thanks to Hyde Yamakawa for pointing this one)
2014-12-25 21:52:13 +03:00
James Turner
dd1b829618 When the turn angle is large, don’t fly-by.
This avoids the tan() term in the fly-by computation
causing huge turn cuts which will fail to sequence.
Convert such turns to fly-over.
2014-12-22 21:47:21 +03:00
James Turner
f80528f8d6 RoutePath mag-var and point-on-path fixes 2014-12-22 17:00:43 +03:00
James Turner
aa3333cd31 Fix runway path appearance. 2014-12-21 09:21:31 +03:00
James Turner
91992f6cf1 Route path
- better point along path computation
 - fix path distance for turns
 - detect and skip duplicated waypoints

(and provision to skip based upon impossible turn
geometry soon)
2014-12-20 15:19:00 +01:00
James Turner
088572e87d Route-path:
* better overflight pathing based on next wpt type
* tolerate procedures with bad intersections (eg KSFO OFFSH8)
2014-12-19 17:01:27 +00:00
James Turner
7317aff22d Fix route-path bugs:
- accurate fly-over / fly-by computations
 - parse additional LevelD XML elements
 - path vector contains curves for turns

Remove dead code.
2014-12-18 23:05:28 +00:00
James Turner
01622dd1f4 Fix flight-plan course and distance computations.
Always use the RoutePath system for course and distance computations
in the flight plan, so that dynamic segments are handled correctly.
2014-12-08 17:56:15 +00:00
James Turner
938a180c3d Level-D procedures: parse Flytype element
With this, the fly-by / fly-over info from the procedures is exposed
correctly.
2014-12-07 12:34:50 +00:00
James Turner
d806b68706 find waypoints in the flight plan. 2014-12-04 15:43:32 +00:00
James Turner
cb9919ef74 Drop ground-nets cache on scenery path change.
Unfortunately we can’t drop loaded ones, since the in-memory structures don’t have ref-counting, and we don’t
know what AI plans may be referencing them.
2014-12-02 16:31:34 +00:00
James Turner
fea8e96fe9 Fix for airport search on some platforms.
Ensure the std::string passed to sqlite lives for the duration
of the query.
2014-05-29 09:42:21 +01:00
Torsten Dreyer
2c3d779459 Add virtual destructor 2014-03-23 21:17:54 +01:00
James Turner
9847bf3d13 Fix for bug 1419, nav.dat runway binding
Clean runway names to standard structure (0-prefix) before looking up
in the cache, when binding ILS navs to runways.

https://code.google.com/p/flightgear-bugs/issues/detail?id=1419
2014-03-23 09:53:00 +00:00