|
From: Anders G. <and...@gi...> - 2009-04-24 12:09:00
|
On Fri, 24 Apr 2009, Torsten Dreyer wrote: > There is a bug in FGFCS.cpp that shows up after a reset of JSBSim in > FlightGear. > If you use a component hat has a name with an absolute path, the > PropertyManager fails to tie this property to object methods after reset, > because it is allready tied. > > Example: > <switch name="/foo"> > <default value="0.0"> > <test value="1.0"> > something gt 0 > </test> > </switch> > > failes to Tie property /foo after a reset. Using relative paths is no problem. > I think the bug showed up, when the reset feature in JSBSim was implemented. > > The problem is easy to fix: do a conditional Untie() before performing the > Tie(). Here is a patch against latest FlightGear cvs: Hi Torsten, Good catch. :) But I think it would be better to figure out why JSBSim didn't untie the property during the teardown phase and fix that rather than working around the problem in the subsequent constrution phase. My first guess would be that the JSBSim "cleanup all properties" method (I'm not sure what it is really called or where it is off the top of my head) assumes that all properties with absolute paths are owned by some external entity (e.g. FlightGear). FWIW (and IIRC) I always put my FCS components inside the /fdm/jsbsim/ subtree and only write to properties outside that using <output>...</output>. Cheers, Anders -- --------------------------------------------------------------------------- Anders Gidenstam WWW: http://www.gidenstam.org/FlightGear/ |