On 3/31/03 at 10:51 AM [EMAIL PROTECTED] wrote: >Could the ATC manager be implemented as a low-priority thread which is >woken up every so often (few seconds) to update the list of distances to >the ground stations, and additionally if a frequency is changed? The >realtime loop would then always have ready-to-use references to the >currently selected stations. >
The update function of the ATC manager *is* the realtime loop. This handles updating the currently selected stations, and updating which stations should be currently selected. This results in a nice clean interface to Flightgear proper: globals->get_ATC_mgr()->Init(); and globals->get_ATC_mgr()->Update(); which should mean that anyone else who wants to put their own ATC system in can drop it in instead without too much trouble. It also means that the ATC manager can hide update rate details from Flightgear, such as updating ATIS stations very infrequently, and updating a tower station close to the user more frequently than a tower station further away. The framerate problem was caused by a bug in the code being executed by one of the selected stations - *not* the ATC manager, which really does very little itself. There is considerable scope for the ATC manager to run the selected stations at a much lower frequency than it does at present, but then problems like this wouldn't show up until a long way down the line, and I'd rather get them sooner rather than later when the changes are easier to find. And as Curt points out, even running at a lower frequency, there'd still be a 30ms pause in there due to the bug, it would just be less obvious and more likely to slip though. A callback to the ATC manager when the selected frequency is changed would make some sense though. As would myself being more careful about testing the frame rate with and without the ATC manager enabled before committing large changes to the ATC code :-) Cheers - Dave _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
