1
0
Fork 0
Commit graph

585 commits

Author SHA1 Message Date
Florent Rougon
9a64150d57 Fix crash in src/ATC/trafficcontrol.cxx (invalid iterator dereferenced)
When the test:

  if (i == activeTraffic.end() || (activeTraffic.empty()))

was true, the iterator named 'current' was uninitialized and later
dereferenced.

Fix:
  - when the previously-mentioned test is true, return;
  - initialize 'current' only when it is really needed (i.e., later and
    after the test), and since we don't need it for iterating, make it
    an FGTrafficRecord&.
2017-05-10 16:54:55 +02:00
James Turner
4f020602e6 Missing config.h includes
This is about to become much more important.
2017-03-25 15:34:10 +00:00
James Turner
39b239957e Startup-tip system.
Replace the license / website text with a startup tip. Tips are shown
based on the day of the year, can be changed easily.
2017-03-03 23:21:18 +02:00
Florent Rougon
8f24de831d Adapt includes according to relocation of SimGear's iostreams-related files
This change is the logical counterpart of SimGear's change from commit
79f869a7f32910197be72b21f6489fbbba02c836 that moved the following files
from simgear/misc to simgear/io/iostreams:

  gzcontainerfile.cxx
  gzcontainerfile.hxx
  gzfstream.cxx (formerly zfstream.cxx)
  gzfstream.hxx (formerly zfstream.hxx)
  sgstream.cxx
  sgstream.hxx
  sgstream_test.cxx
2017-02-12 21:30:51 +01:00
James Turner
1c4656512a Enforce separation of ground-net and dynamics.
This ensures ground-network is retrieved through the airport only, and
hence can be done safely early in init, when ATC/AI/dynamics don’t
exist yet.
2016-11-13 14:05:20 +00:00
James Turner
ac33092032 Fix crash disabling AI traffic at runtime.
https://sourceforge.net/p/flightgear/codetickets/1848/
2016-10-20 22:52:27 +01:00
James Turner
03ecac9dbc Work with new SGPath API. 2016-06-22 17:36:05 +01:00
Richard Senior
29fe6569c4 Fix incorrect QNH in spoken ATIS when using live weather fetch
When using live weather fetch, the QNH should be obtained from
environment/metar/pressure-inhg.

See: http://sourceforge.net/p/flightgear/mailman/message/35037125

Add new method getQnhInHg to ATISInformationProvider and its implementations
to avoid rounding errors converting from hPa back to inches in ATIS reports.

The CurrentWeatherATISInformationProvider (used when live weather fetch is
not in use) continues to use the property environment/pressure-sea-level-inhg.
This produces the incorrect QNH at airports significantly above sea level
but this needs fixing elsewhere to calculate the correct QNH.
2016-04-26 10:52:29 +01:00
Richard Senior
f825bb4f3c Eliminate use of non-standard round() function in ATISEncoder
Use of round() produces compilation errors with MSVC10 and the build server
2016-04-26 10:42:48 +01:00
Richard Senior
13f31782a1 Improvements to spoken ATIS
- Add section tag to support inclusion of ATIS fragments.

- Add visibility, QNH and cloud tokens to support new ATIS formats.

- Add support for starts-with, ends-with and contains comparisons in
  conditionals, including negated versions.

- Strip and convert case in comparisons.

- Speak VRB wind direction as "variable".

- Speak zeroes in fractional part of QNH inHg.

- Force US voice in US, Canada and Pacific; UK voice in UK.
2016-04-24 10:42:26 +02:00
James Turner
c15e4753ac Different fix for traffic shutdown crash.
Fix for: https://sourceforge.net/p/flightgear/codetickets/1864/
2016-04-15 16:26:54 +01:00
Richard Senior
78de2af130 Allow ATIS format specifications to compare tokens against text values
Prior to this change, it was only possible to compare the values of tokens
to each other for use in conditionals, e.g. landing and departing runway.
This change allows comparison of a token to a text value, e.g. to compare
wind speed to zero.
2016-04-07 00:58:34 +01:00
Durk Talsma
31c66226e1 AI traffic refused to take-off, because the TrafficRecord destructor would unassign an AIAircraft from it's ATC. This caused it to get stuck in front of the runway and block all other traffic.
This patch may introduce an occasional crash on exit again, because it effectively undoes commit [a972df]. I'll try to find a better fix for that later on.
2016-03-06 21:23:26 +01:00
James Turner
a972df05dc Fix a potential use-after-free in ATC code
- when dynamics shuts down the ATC controllers, they clear their
  traffic vectors (destroying the records), but we didn’t notify
  the AI aircraft of this. Ensure the controller is cleared so
  the AI aircraft shutdown doesn’t crash.
2016-01-12 12:22:23 -06:00
James Turner
540d4c2111 Use SGTime instead of time() in traffic/AI code
- avoids manual handling of /sim/time/warp in many places
2016-01-05 23:19:28 -06:00
James Turner
fadad5d70b Make TrafficRecord own its AIAircraft.
- use the ref-counting system, hopefully avoid a dangling pointer
  crash I encountered. (Of course it may turn into a leak)
2016-01-04 13:34:39 -06:00
James Turner
83ea6d32d0 Make PerformanceDB a real subsystem 2015-12-19 00:29:00 -08:00
James Turner
e80fc563e5 Fix off-by-one errors in GroundController
findSegment() and segments[] array use different indexing, account
for this in the conversion to always use findSegment
2015-12-19 00:08:07 -08:00
James Turner
865bb365ed Trying to bullet-proof the traffic code. 2015-12-18 21:42:22 -08:00
James Turner
c76d106e64 Runtime checks for GroundContoller crashes.
Trying to identify what’s actually going wrong here.
2015-12-17 20:23:45 -08:00
James Turner
c585f7f7d1 Asserts to pin down a reported crash. 2015-12-16 13:02:06 -08:00
James Turner
8877b442f8 ATC/Traffic doesn’t crash reset.
- remove some global headers from AI headers, to avoid pollution
- change how ATC owns the ‘player’ FGAIAircraft so reset works
- ensure AIAircraft controllers are cleared on unbind for reset
2015-12-11 12:11:59 -06:00
James Turner
6446d67431 Split GroundNetwork class down the middle
- ATC functions move to GroundController, which layers above
  remaining GroundNetwork functionality
- dynamics owns both the groundNetwork and the ground controller.
2015-12-10 15:53:05 -06:00
James Turner
2af076e6cb Add airport dynamics manager
- decouple dynamic airport data from the static (nav-db) data.
2015-12-05 00:25:29 +00:00
James Turner
fc887b106b Checkpoint - ground-net skips the cache 2015-12-01 14:01:32 +00:00
Torsten Dreyer
cd0f0b9856 Fix some warnings 2015-06-12 11:51:11 +02:00
Torsten Dreyer
f780480088 Fix random crash on exit in atc_mgr
make the ParkingAssignment a local object instead of
creating it on the heap as a member of the ATCManager
2015-06-10 12:04:47 +02:00
Torsten Dreyer
1ad81ee94e Silence some warnings
AIBallistic: wrong order of member initialization
Other: unused variables
2015-05-29 10:27:25 +02:00
Torsten Dreyer
9c63b77133 Remove debug console output in FGApproachController
Console was filled with
FGApproachController::render function not yet implemented
2015-05-27 10:19:18 +02:00
Durk Talsma
dbde1f2232 Some preparatory work for reinstating a missing piece of code in the routing algorithm for the AI system. 2015-05-14 18:22:42 +02:00
Durk Talsma
1dc7d4cf11 Reformatting. 2015-05-14 18:20:25 +02:00
Durk Talsma
98682c0c68 Fix bug when starting using the --parkpos option. Create a pointer to a ParkingAssignment object, so that the reference counter doesn't get reset to 0 when the local class is destroyed. 2015-05-14 18:15:30 +02:00
Torsten Dreyer
01dfd52d69 Fix wrong ATIS for negative temperatures 2015-01-12 16:46:24 +01:00
Stuart Buchanan
b654477794 New materials.xml format 2014-08-09 20:43:34 +01:00
Torsten Dreyer
19dd46c5b0 ATISEncoder: minor tweak
no trailing blank at runway designator
2014-04-23 17:07:00 +02:00
Thomas Geymayer
88b7d4f530 Update for SGPropertyNode changes. 2014-03-06 00:41:41 +01:00
Torsten Dreyer
c068049d84 NewAtis: handle varying winds 2014-03-05 13:52:43 +01:00
Torsten Dreyer
090207155e ATIS: say wind direction as three digits 2014-03-01 20:15:52 +01:00
Torsten Dreyer
0c7f21a259 New ATIS System: Fallback for no-realwx and some fixes
Added the fallback for realweather fetch disabled, creating
ATIS from present weather
Fixed some formatting errors, mainly missing spaces
Some code cleanup
2014-03-01 12:44:01 +01:00
Torsten Dreyer
dd6cccdda1 A new comm radio and atis implementation 2014-02-28 11:45:49 +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
a7e4f2a971 std:: namespace fixes, AIBase cleanup.
Make data members in AIBase protected, and move FGAIModelData to be
a private helper in the .cxx file.
2013-03-28 16:49:52 +00: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
James Turner
fce2a53fc7 Fix crash starting at heliport.
Don't assume FGAirports have runways, they might only have helipads.
2013-03-05 13:19:10 +00:00
Thomas Geymayer
45e3b7e2d1 Clean up/prepare for porting NasalPositioned to cppbind 2013-03-04 16:31:37 +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
2013f7149d Some headers missing... ;) 2013-02-07 19:00:54 +01:00
ThorstenB
1c6643d7ac traffic: more pass by reference + member init 2012-11-25 16:41:10 +01:00
ThorstenB
1827825fcb Clean up namespace issues
avoiding "uses..." in header files.
2012-11-23 21:16:08 +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
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
7d547d1287 Make traffic take-off roll look a little better.
Expand the performance DB logic to support aliases, and select based on aircraft type as well as class. This allows to introduce some variation into AI traffic performance. Change the initial climb-out waypoints to use pitch-hold until passing 3000', which looks much more convincing
2012-10-05 18:12:46 +01: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
James Turner
ebf3a0793d Tolerate the lack of a GUI in some places. 2012-09-26 13:39:38 +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
James Turner
9b900e9430 Implement a persistent cache for navigation data.
Cache the parsed navigation and airport data in a binary file to reduce
startup times and memory consumption (since only referenced FGPositioned
elements are held in memory).

Data will be reimported when the mod-time of any input file is changed.
If a global file is changed (nav.dat, awy.dat, apt.dat, etc), the cache
will be completely rebuilt, which takes approximately 30 seconds on
moderate hardware. (Future work may reduce this).
2012-09-19 11:38:19 +01:00
James Turner
8a087582bc Whoops, case-sensitivity matters on Linux. 2012-08-22 00:53:48 +01:00
James Turner
588eba658a Make some include dependencies explicit. 2012-08-22 00:07:53 +01:00
James Turner
7fabeed85d Fix some places relying on public 'using std::string' in SimGear
(Otherwise my next SimGear commit will break them)
2012-08-21 17:07:47 +01:00
ThorstenB
d6ef7bb091 Drop obsolete ATCDCL dialog. 2012-05-12 23:53:29 +02:00
Frederic Bouvier
75fc136931 Remove redundant inclusion of math/SGMath.hxx 2012-05-05 11:20:04 +02:00
ThorstenB
10d2d94778 Avoid compiler warnings.
Unsigned values are always >= 0...
2012-04-30 14:33:38 +02:00
James Turner
2d267a5782 Remove PositionedBinding (which no one ever used), Nasal is better for this jobs. 2012-04-26 00:37:47 +01:00
ThorstenB
7dc8db8ef5 Fix some compiler warnings.
Also removes "itm.cpp" from CMake to avoid code duplication/warnings, since
this the file is already included by radio.cxx.
2012-04-05 21:02:09 +02:00
Mathias Froehlich
c71c9aee0a Adapt to simgear SGMath change.
Simgears SGMath has lost its dependency on osg.
Update includes and code using these methods.
2012-03-03 13:37:43 +01:00
ThorstenB
a8d5ac90c6 #656: COM1 frequency set to 0 at startup
Also, don't flood the screen with AI ATC messages when COM1/2 is set to 0
(ignore aircraft "transmissions" on frequency "0 MHz").
2012-02-10 23:43:03 +01:00
Durk Talsma
aab04f44bd Bugfixes and some finetuning:
* Pregenerating taxiroutes could interfere with runway assignments by ATC, when conditions changed, resulting in a taxi to one runway and a takeoff from another
* A simpler solution for the "Error in Traffic record bug". This still needs some more testing, but I haven't seen any error message anymore, since changing to the current code.
* Initialize AI traffic at speed zero, this should prevent some weirdness observed under boundary conditions.
* Don't activate groundnetwork proximity detection for pushback traffic until the "ready for startup message is transmitted. this should allow sufficient time for them to reserve a route, but a little more testing still needs to be done.
2012-01-02 22:23:24 +01:00
Durk Talsma
e0b6ee9d5d --debugMsg; 2012-01-01 15:30:51 +01:00
Durk Talsma
cf279e320b Bugfix: Shutdown the ATC manager when it runs out of waypoints. 2012-01-01 13:12:13 +01:00
Durk Talsma
53445c80d4 Some commented out debugging code that may help us trace down bug 532. 2011-12-31 18:16:38 +01:00
Durk Talsma
b648b71671 Fix for issue: 520: Error in FGTrafficRecord::setPositionAndIntentions. 2011-12-30 15:27:21 +01:00
James Turner
c831d9c857 Get the ATC frequency dialogs working again for the 2.6 release. 2011-12-27 22:55:52 +00:00
Durk Talsma
762d8a90dd Remove a stray debug message.Z 2011-12-24 16:34:33 +01:00
Erik Hofman
1fb790eb60 comment out unused variables and function and properly initialize variables 2011-12-19 16:50:21 +01:00
ThorstenB
d47342a5a4 Add --log-class option, improve logging classes.
Replace SG_GENERAL by more specific log classes in many places.
Allow "," to separate logging classes (using "|" is odd on the
command-line).
Also add new option to make logging more useful for developers.
You can use:
  --log-level=debug --log-class=environment
to only get environment debug messages, or
  --log-level=debug --log-class=sound,ai
to only get debug messages related to the sound or AI subsystem.
2011-12-11 14:06:17 +01:00
Durk Talsma
32eb0fd00c Merge branch 'merge-requests/1555' into next 2011-12-04 17:33:04 +01:00
Durk Talsma
fcfb905ef1 Make sure not to disable the entire ATC system when handling special cases. 2011-12-04 17:31:02 +01:00
adrian
a6b9beca9d rename FGRadio to FGRadioTransmission, add RX and TX antenna heights 2011-11-28 10:38:58 +02:00
adrian
2c6946c3e8 refactor receiveATC(), implement simple LOS routine, set comm1-signal property 2011-11-24 17:25:49 +02:00
adrian
0025dfb9bc Merge branch 'next' into comm-subsystem 2011-11-24 10:20:34 +02:00
adrian
e17852f679 prepare for festival volume 2011-11-24 10:00:28 +02:00
adrian
9bcc3a87b6 cleanup 2011-11-24 06:39:54 +02:00
adrian
98a94d83ef call from FGATCController::transmit() 2011-11-24 06:20:59 +02:00
adrian
9ab41ea158 Merge branch 'next' into comm-subsystem
Conflicts:
	src/Instrumentation/Makefile.am
2011-11-23 14:02:43 +02:00
James Turner
a05ea36acb Restructure GUI code, isolate PLIB in source files, to ease future refactoring and alternative GUI layers. 2011-11-19 20:25:51 +00:00
Frederic Bouvier
f1d0ac52a6 Fix MSVC9 build 2011-11-14 08:38:58 +01:00
James Turner
c92a3313bc Fix a secondary issue in bug 484 - avoid a crash when --lat, --long *and* --airport were specified. ATCmgr assumes /sim/atc/runway is set in this case, but it is not, leading the a runway-not-found assert. 2011-11-12 18:00:12 +00:00
James Turner
70b4f38ebc Goodbye automake. 2011-11-01 11:15:53 +00:00
adrian
c6062ad93c Merge branch 'next' into comm-subsystem 2011-10-29 12:22:00 +03:00
Durk Talsma
538e632f45 * Updated routing algorithm. Just sorting the schedules by usage heuristics doesn't work well for major multihub airlines.
* Improved groundnetwork routing algorithm. Don't uncesscarily block taxiways. Instead, use a "just-in-time" blocking system. The unblocking algorithm still needs some work, but the current version is already a major improvement over the previous version.
* Some tweaks to the handover from ground to tower controller. Aircraft could refuse to take-off of even refuse to taxi onto the runway. This now seems to be solved.
2011-10-26 22:26:37 +02:00
James Turner
b1b4b7ecf4 Fix (nearly) all the std:: namespace violations in headers, in preparation for fixing SGsmplstat.hxx to *not* do a 'using namespace std'. 2011-10-17 17:41:59 +01:00
Durk Talsma
02712dc1ad Several Bugfixes:
* Landing AIAircraft now land properly!!!
 * Fixed problems with takeoff scheduling.
 * Untangled several vertical speed calculation algorithms.
 * No more bent-over-backwards and jump-in-the-air AI aircraft initializations.
 * Fixed intermixed target speed and target altitude during climb phase.
 * Implemented beginnings of a "line up and wait" procedure.
 * Tried to use actual runway elevation for calculating the decent profile.
2011-10-09 00:25:04 +02:00
adrian
312447c565 Merge branch 'next' into comm-subsystem
Conflicts:
	src/ATC/trafficcontrol.cxx
	src/ATC/trafficcontrol.hxx
	src/Instrumentation/CMakeLists.txt
2011-10-06 15:18:44 +03:00
Durk Talsma
f2b354d9cb Merge branch 'next' of gitorious.org:fg/flightgear into next 2011-10-03 20:57:32 +02:00
Durk Talsma
4640f5bb02 * A new algorithm for determining hold position instructions. This version still needs some finetuning, but already appears to be more solid than the old version.
* Some tweaks to the traffic scheduling algorithm.
* Misc cleanup.
2011-10-03 20:54:58 +02:00
ThorstenB
a6a6910653 ATCMGR: fix minor output formatting issue 2011-10-02 13:22:09 +02:00
James Turner
dbda2fb95d Switch ATCmgr comm station search to filter by range in cartesian, not geodetic, space, to avoid numerical instability with extremely distant stations. 2011-09-28 09:06:31 +01:00