|
From: Torsten D. <To...@t3...> - 2009-05-21 13:13:49
|
> > I think there are two choices:
> > 1. Declare naming of components outside the jsbsim property base as
> > legal.
> > Then there is a bug which should be fixed.
>
> I think I choose #1, and I have in mind a fix which would simply give a
> message that the property is already defined and will not be redefined.
> Would that be intrusive? Should no message be given?
Good choice - it's my favourite ;-)
Since I brought up this topic, I thought I should also have a solution.
I added a member to FGPropertyManager containing a vector<string> to store all
property names it ties. I also added a Untie() method (without args) which
iterates through the vector and unties all properties named here.
Please find attached a patch against latest FlightGear CVS.
The FGFDMExec::checkTied method seems obsolete now and might be removed (which
I didn't).
Works like a charm here within FlightGear but not tested in standalone JSBSim.
BTW:
I stepped into your carefully layed out trap in JSBSim.cxx:
fdmex = new FGFDMExec( (FGPropertyManager*)globals->get_props() );
by first not declaring the tied_properties member as static which caused a
segfault ;-)
Torsten
|