On Sun, 2007-02-18 at 12:22 -0500, John Denker wrote:
> 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.
Thanks John,
Just made the changes in your new patch to a copy of cvs source and all
compiled and ran OK. I was running a version of your prior patch that
was also good to 100K ft. I am not sure the new patch is giving the
same results, but I have not done any controlled comparisons; just one
flight from 2V2 (now KLMO) to KBJC with real metar weather. The QNH was
29.71 and later 29.70 as I approached KBJC. The field elevation with
the altimeter kollsman setting correct was about 60 ft low. I will
double check and compare some examples with the previous patch.
> 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);
>
Looking at FGaltimeter, the following calls allow separating PA and C.
If I want just the PA as in the encoder, the assign would be
pressureAltitude_ft = _altimeter.reading_ft(pressure, 29.92);
and if I want just the kollsman offset as in kap140.nas
kollsman_shift_ft = _altimeter.reading_ft(setting, 29.92);
Again, tomorrow, I will do some more comparisons and feed the results
back.
Thanks for staying with this.
--
Dave Perry
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel