On 18 Apr 2006, at 15:14, Jim Wilson wrote:
void FooSystem::update(double dt) { SGSubsystemMgr* ssmgr = gloabls->get_subsystem_manager(); if (!ssmgr->isRunning("dependecy1") || !issmgr->isRunning("dependency2")) { return; } } Such a scheme would be doable (the overhead is trivial), and named subsystem groups reduce the number of tests, just as they do in the case of listeners. My concern is that this is 'level-triggered' when what some things need is 'edge-triggered' behavior. One possibility would be to have a listener mechanism on SGSubsystemMgr which is notified when subsystems start and stop - probably some kind of callback function pointer. That's essentially identical to Nasal listeners, but in code. Regarding your comments on the complexity of dependencies for Nasal scripts, I think again the answer is to have the running status of each subsystem stored somewhere, and exposed via the property tree. The trick will be picking good groups, so most things have one or two dependencies, and having some documentation somewhere stating what's in each group. I'm sure other people can propose potential groups, but I'd imagine: early (nasal itself, GUI) time based subsystems (ephemeris, datetime, warp, properties, interpolator) environmental (weather fetch) aircraft systems (FDM, electrical, cockpit?, instruments, failures, GPS) scenery (tile manager, views, panels) input IO subsystems - ATC, traffic, multiplayer sound (note I'm not claiming that as a proposed initialization order either!) Melchior is probably the best person to comment on how appropriate or not these are for the Nasal scripts he's written. James |
- Re: [Flightgear-devel] Subsystem run-levels James Turner
- [Flightgear-devel] Re: Subsystem run-levels Melchior FRANZ
- Re: [Flightgear-devel] Re: Subsystem run-levels Curtis L. Olson