1
0
Fork 0
Commit graph

369 commits

Author SHA1 Message Date
James Turner
d8a3f160ef Bugfix: guard against corrupted airport XML. 2014-01-14 13:42:11 +00:00
James Turner
5cf8157a66 Security: more conservative dir permission masks.
Use 0755 instead of 077 everywhere we create a directory.
2013-12-19 14:53:39 +00:00
James Turner
c3c0f68f76 NavData: can refresh some in-place.
(Hacking to support faster scenery-path switching)
2013-11-22 22:52:33 +00:00
James Turner
8b4b49cad2 Read-only mode fixes. 2013-11-18 15:40:14 +00:00
James Turner
0cda3cbfb2 Multiple-instance support.
Write PID file to FG_HOME, use this to detect multiple launches.
When this situation is detected, set a marker property and place various
objects into read-only mode, such as the NavCache and TerraSync.

PID file is created using open+unlink semantics on POSIX, and 
DELETE_ON_CLOSE on Windows, so it will be removed when fgfs exits,
even if killed or crashes.
2013-11-15 21:04:15 +00:00
bcoconni
139af0026f Synchronized FG with the removal of 'using std::*' in simgear's easyxml 2013-11-14 22:07:50 +00:00
James Turner
c72ac27098 Experimental sorter for airports.
Sort by size (cumulative runway length).
2013-10-27 13:03:01 +00:00
James Turner
386d87e098 Cleanup exit handling.
Replace many lingering calls to exit() from the code,
replacing most with exception throws, which can be
caught by the existing mechanisms.

Update the option-parsing code to return an explicit
value indicating what to do (e.g., exit status to return
to the shell).
2013-10-15 22:16:50 +01:00
Tom Paoletti
81cd33e2fa Performance optimization: empty() instead of size()>0
empty() is guaranteed to be constant complexity for both vectors and lists, while size() has linear complexity for lists.
2013-08-19 09:01:59 +01:00
James Turner
ebfe2ee6f5 Bug 1137, handle single-digit runways.
rwyprefs.xml sometimes specify runways without a leading '0', which
confuses the ident lookup. Print a message, and fix up such idents at
load time, so '8' -> '08', '3L' -> '03L' which matches our internal
scheme.
2013-07-04 10:30:04 +01:00
James Turner
05572cbb3e Speculative fix for bug 1149, AI traffic on helipads.
Avoid helipads when doing runway choice fallback.
http://code.google.com/p/flightgear-bugs/issues/detail?id=1149
2013-06-30 16:48:14 +01:00
James Turner
2ec4b6ecc2 Fix warnings identified by updated XCode.
Mostly unused private vars, for various reasons.
2013-06-21 18:39:24 +01:00
Christian Schmitt
461d89cb22 Fix some uninitialized variables (found by valgrind) 2013-03-10 01:24:57 +01:00
Thomas Geymayer
3047c316dc Clean up/simplify NasalPositioned_cppbind
Ensure all FGPositioned related functions return SGSharedPtr
instead of raw pointers to allow automatic conversion to
nasal ghosts without custom helper functions.
2013-03-06 23:21:49 +01:00
Thomas Geymayer
1c905e5881 Typos, license headers... 2013-03-06 01:04:52 +01:00
Thomas Geymayer
22a1c9b2af Finish porting airportinfo to cppbind 2013-03-04 23:14:26 +01:00
Thomas Geymayer
4b573ebd13 Start porting NasalPositioned to cppbind.
For now it is available in the positioned Nasal
module. FGAirport is fully ported, but especially
procedures/navaids and free functions are still
missing.
2013-03-04 19:24:47 +01:00
Thomas Geymayer
45e3b7e2d1 Clean up/prepare for porting NasalPositioned to cppbind 2013-03-04 16:31:37 +01:00
Christian Schmitt
4f4f099ad5 Fix missing includes 2013-02-28 20:16:26 +01:00
James Turner
88a4435cef Remove isReciprocal from FGRunway.
This was a bogus concept, either runways have a reciprocal or not (if singled-ended), really this was simply exposing an artefact of the apt.dat encoding. Change to an API which gives what is actually wanted - the ability to extract an airport's runways without any reciprocals included.
2013-02-28 18:21:29 +00:00
Christian Schmitt
715c48e2d7 Convert runway parser and all internals to metric units and 2 runway ends.
This eliminates many conversations between ft and m and gives us runway start/end
points that are needed for many calculations. Also, this prepares the internals for
the upcoming apt.dat 850+ format that uses the metric system as well as start/end points.
2013-02-28 13:38:04 +01:00
Christian Schmitt
8588eb2e4b Expose heliports to Nasal for future use in maps 2013-02-26 18:20:10 +01:00
Christian Schmitt
3a1709b31a apt_loader.cxx: 810 helipads are now treated as such internally 2013-02-24 22:18:49 +01:00
Christian Schmitt
6ffdb1bc54 apt_loader.cxx: update version parsing to 4-digit versions,
some tweaks according to the spec.
2013-02-24 22:03:29 +01:00
James Turner
1eb8ae1fbf Give the FGAirport class a sane filename.
simple.[cxx|hxx] -> airport.[cxx|hxx]
2013-02-21 11:32:02 +00:00
Christian Schmitt
11c00afaec Add support for helipads from apt.dat 850+ 2013-02-21 00:01:36 +01:00
Christian Schmitt
2319948b95 airport traffic routes from apt.dat 1000 are unknown to FG, so ignore them for now 2013-02-20 23:49:48 +01:00
Christian Schmitt
2013f7149d Some headers missing... ;) 2013-02-07 19:00:54 +01:00
James Turner
f3dec6a64d Fix runway elevations when threshold.xml is used.
SGGeodesy::direct doesn't preserve elevations, oops.
2013-01-01 20:58:42 +00:00
James Turner
41481967f1 Revised cache transaction handling.
Use a RAII object to manage cache transactions, and reset queries immediately after they are done, to avoid auto-commit transactions lasting long periods of time. Re-write the commit and step logic to handle SQLITE_BUSY, with progressively increasing waits when there is DB contention (multiple processes accessing the DB).
2012-12-23 23:32:53 +00:00
James Turner
3c6fbffdf2 Fix a typo. 2012-12-19 10:06:52 +00:00
James Turner
ec2975bac3 Fix some groundnet cache issues.
ThorstenB identified some cases where mod-times changing could lead to corrupted ground-cache data in the DB - handle both of these. What's still unclear is why the mod-times changes; hopefully the additional debug info will reveal this.
2012-11-24 12:14:56 +00:00
ThorstenB
830526a793 Traffic performance: add airport memory cache
to avoid repeating identical NavCache/SQL queries. Also ensures we're
not using multiple FGAirport instances for an airport - each triggering
identical queries to pull in airport data.
Airports by ICAO ID are requested very frequently at run-time, so caching
significantly boosts performance.
2012-11-24 12:42:31 +01:00
James Turner
18da917ddd Bracket threshold.xml loading in a DB transaction.
Should mitigate (but not completely fix, yet) bad map performance when initially zooming out, or panning when zoomed out.
2012-11-19 22:24:10 +00:00
ThorstenB
be3f94f63a Remove static subsystem dependencies
preventing us from recreating subsystems on reset/reinit.
2012-11-18 17:29:29 +01:00
ThorstenB
58380b286e Fixed some uninitialized member vars and a mem leak. 2012-11-18 16:39:22 +01:00
ThorstenB
a784443a24 Remove static property dependencies
preventing us from wiping properties on reset/reinit/subsystem recreate.
(more work required for "native_gui" and "ATC-Outputs" protocols)
2012-11-18 16:35:54 +01:00
James Turner
78d97fa468 Support for creating default SID/approach.
Durk reminded me of this - when we're missing procedures data (the common case), synthesise a plausible (but possibly dangerously unrealistic) departure and approach. Will work fine for airports in gentle terrain, and likely kill you at challenging airports. You have been warned.
2012-11-12 22:30:28 +01:00
James Turner
08d82294bd Fix bug 905.
When a position is modified for an in-cache FGPositioned, we need to update the runtime information too, or the Octree code may (rightly) complain that it's seeing inconsistent data. Also make the Octree check an exception throw, and verbose, so this is easier to detect in the future.
2012-11-10 14:48:00 +00:00
James Turner
afcdbd3158 Overhaul the ground-net / parking code.
Use the nav-data-cache to cache groundnet information, including
parking positions and the taxi-node graph.
2012-11-08 09:07:05 +00:00
James Turner
c79e2465df Traffic improvements.
Make landings and takeoffs look more correct; tweak climb-out and touchdown phases in particular, so the turn to destination heading occurs earlier on climb out, and touchdown occurs close the GS transmitter / some distance down the runway from the beginning.
2012-10-30 15:43:54 +00:00
ThorstenB
076bbb8487 Fix some compiler warnings.
Unused vars, loss of precision, bool type conversions.
2012-10-13 17:59:47 +02:00
Thomas Geymayer
5ac3de21e3 Fix some CommStation bugs
- kHz/mHz conversion needs factor 1000 not 100
 - Correctly read name for CommStations from NavCache
 - Fix parsing CommStation names from apt.dat (Name
   can contain spaces)
2012-09-27 12:21:22 +02:00
ThorstenB
e5b81a8bb6 Minor pointer safety and compiler warning issues. 2012-09-25 22:10:06 +02:00
James Turner
8050f39089 Fix linux build, needs explicit <cstring> 2012-09-25 10:29:32 +01:00
James Turner
b1ff365a8f Make FGTaxiNode and FGParking inherit FGPositioned.
In preparation for caching the groundnet in the NavCache, make taxi-nodes and parkings inherit from FGPositioned. As part of this, make them heap (as opposed to value) classes, disable their copy-constructors, remove many mutating operations, and give them real constructors.
2012-09-25 00:31:17 +01:00
James Turner
fd99e9fdfb std namespace fixes in headers. 2012-09-24 08:39:30 +01:00
James Turner
b1854459b3 Clean up dynamics/parking handing code.
Refactor some parking / airport-dynamics APIs, in preparation for caching the ground cache data in the nav-cache.
2012-09-23 21:42:40 +01:00
Stuart Buchanan
a3a40af860 Simplify code for taxiways. 2012-09-20 21:53:31 +01:00
Stuart Buchanan
ac1fc699b7 Expose surface types and taxiways via the airportinfo() Nasal call. 2012-09-19 22:33:43 +01:00