|
From: Torsten D. <To...@t3...> - 2009-04-24 10:01:15
|
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:
Index: FGFCSComponent.cpp
===================================================================
RCS
file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/models/flight_control/FGFCSComponent.cpp,v
retrieving revision 1.5
diff -u -p -r1.5 FGFCSComponent.cpp
--- FGFCSComponent.cpp 10 Jul 2008 17:23:04 -0000 1.5
+++ FGFCSComponent.cpp 24 Apr 2009 09:54:24 -0000
@@ -205,6 +205,7 @@ void FGFCSComponent::bind(void)
} else {
tmp = Name;
}
+ if( PropertyManager->isTied( tmp ) ) PropertyManager->Untie( tmp );
PropertyManager->Tie( tmp, this, &FGFCSComponent::GetOutput);
}
Greetings, Torsten
|