> > Hi Bertrand,
> >
> > I am currently working on a more generic solution to the issue based on
> > your
> > patch. Currently we have at least three different places within
> > FlightGear
> > calculating tank contents and converting them between different units.
> > The idea is to have a TankProperties class encapsulating all property-
> > conversions and to have the fdm_shell create instances of the class.
> > With
> > that, you can write to any of it's properties (level, capacity,
> > density) using
> > any unit and have all other properties correct. There is no need to
> > have this
> > in every FDM and also in Nasal.
> > I'm curently testing various aircraft on Windows and Linux and I hope
> > to get
> > this commited later today.
> >
> > Greetings, Torsten
> 
> I've been so busy I missed this one earlier. Maybe I am missing something
> here. I certainly agree that doing things in several places (redundantly)
>  is a bad idea. But I wonder if the creation of a TankProperties class is
>  needed, or rather if there is some deficiency in the way tanks are handled
>  in the FDMs at this time? In JSBSim (and I assume in YASim) the JSBSim API
>  provides sufficient insight into the tank "state." Certain properties are
>  also available.
> 
> I know that the tank-related properties are probably not referred to the
> same way on the FlightGear side and on the JSBSim (and other FDM) side. Is
> that what your TankProperties class is supposed to coordinate? Would it be
> better to use the API rather than properties, if that is the case?
> 
> This also leads to an interesting situation which has probably been
> discussed before, but which I don't recall. The existing tanks in any
> vehicle model may be filled as specified by the modeler (hopefully the fuel
> tanks are filled up). That is very important for when running JSBSim in a
> standalone mode. Of course FlightGear can and should allow filling of the
> tanks to any degree desired, so the TankContents value in the JSBSim
> aircraft config file is irrelevant for FlightGear - although it might allow
> for a default fill level if desired. But the location, capacity, and other
> values should be respected, as I assume they are.
> 
> Jon
We used to have (and still have) a myriad of places where fuel-mass, -weight 
and -volume are computed in english, american und metric units - more or less 
correct, sometimes using hard-coded densities, sometimes using the provided 
density-property. Not only in the FDM but many aircraft-nasal scripts have 
very creative ways of implementing fuel consumption.

My idea was to have the FlightGear properties in /consumeables/fuel/ handled 
by instances of a class wrapping all the computation and keeping all props in 
a consistend state. Using tied properties ensures that, when changing the 
density, all volume properties change their value, too (assuming the mass of 
fuel is constant). Consuming fuel by decreasing content as volume 
automatically keeps the mass in sync and vice versa. Also (and newly) there is 
a property for unusable fuel (aka "pocket fuel") and and an "empty" property, 
all automatically computed. A tank is "empty" for example, if the content 
(volume) is less than the usable fuel (volume).
Also, some properties for total-fuel (sum of all tanks) as volume and mass 
come along with this.

Bertrand provided the initial work to make sure the values defined in 
FlightGear's aircraft configuration overwrite the values define in JSBSim 
config and JSBSim's values are used if no definition exists within FlightGear.

All this could obsolete a lot of nasal code for aircraft and should unify the 
fuel-properties across FDM. 

Torsten



------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to