On Thu, Apr 04, 2002 at 07:57:00PM -0500, David Megginson wrote: > Tony Peden writes: > > > We'll have to talk about how to implement this. Right now, it would > > all be in /fdm/jsbsim[1,2,3...]. We need a non-FDM specific way of > > handling both this sort of thing and xml-defined parameters. > > Here's what I've been thinking of (for a while): > > 1. Add methods something like these: > > SGPropertyNode * FGSubsystem::getBranch (); > void FGSubsystem::setBranch (SGPropertyNode * branch); > > 2. Whenever tying or referencing properties specific to a vehicle, > session, or whatever, reference them relative to the branch: > > double throttle = getBranch()->getDoubleValue("controls/throttle[0]"); > > 3. At the top level, manage a separate branch for each vehicle. > > Perhaps an easier solution would be simply to swap property trees in > and out for each vehicle, like process pages in a CPU. That makes it > hard to access global (non-vehicle-specific) state, though. > > Comments? > The latter would certainly be easier, no code would need to be changed. Wouldn't it have the effect of forcing client code to keep track of which vehicle was being referenced in the tree? A good example here, I think, would be the view manager. Another good example would be the real-time plotting code Curt discussed a few weeks back. In both cases, just blindly using the data in the tree would be likely to have some interesting results.
> > All the best, > > > David > > -- > David Megginson > [EMAIL PROTECTED] > > > _______________________________________________ > Flightgear-devel mailing list > [EMAIL PROTECTED] > http://mail.flightgear.org/mailman/listinfo/flightgear-devel -- Tony Peden [EMAIL PROTECTED] We all know Linux is great ... it does infinite loops in 5 seconds. -- attributed to Linus Torvalds _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel