On 02/12/2007 08:43 PM, Dave Perry wrote:

> What I am proposing is to create a C++ function (say height_ft) that has
> two arguments, P0 and P1 that does the interpolation in John's new patch
> using his constants.
> 
> Then the kap140.nas could use that function, the encoder could use that
> function to compute PA and the altimeter 

Those who are interested may try out the alpha version of
the FGaltimeter::reading_ft(,) feature in:

   http://www.av8n.com/fly/fgfs/atmo.diff

The interface to this feature is about as simple as it could
possibly be.  In Instrumentation/altimeter.cxx we find only
the following three lines:

  1) Grab the definitions
      #include <atmo.hxx>
  2) Instantiate the object (once, at startup time):
      FGaltimeter _altimeter;
  3) Ask for the altimeter reading:
      _altimeter.reading_ft(pressure, setting)

This is implemented as a class rather than as a plain-old
function, so that it can build and use an interpolation
table.

This altimetry method is valid to above 100,000 feet, and
correctly handles Kollsman settings (unlike the altimeter
instrument in the current and previous cvs versions).

========================
Notes:

1) I did say this an _alpha_ feature, right?  That means
  a) Now is a particularly timely time to make suggestions.
  b) There is even less warranty than the usual "no warranty"
   and there are no promises of stability.  I can't presently
   think of any reason to change the FGaltimeter::reading_ft(,)
   interface, but no promises are being made.

2) You may notice the files contain quite a bit of additional
functionality beyond the FGaltimeter::reading_ft(,) feature,
but it is pre-alpha.  That means
   a) Play if you dare.
   b) Comments are welcome.
   c) I /know/ some of it is going to change.

If you want to play with member functions in the FGatmobase
class, it suffices to call them using an anonymous temporary
instance, as in:
      FGatmobase().qnh(elev, Pfield);


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to