Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Pseudo Degrees

Featured Replies

How are 16-bit signed integers representing pseudo-degrees converted into "real" degrees?

Gerry Howard

  • Author

I'm interested in magnetic variation in magdec.bgl

Gerry Howard

  • Commercial Member

Since that's not an FS variable, you'll have to beg someone in the scenery department.FYI, if you're reading directly from BGL's... be very, very, very careful. Microsoft shut someone down a while back for doing just that. I can't give details... just a friendly FYI.

Ed Wilson

Mindstar Aviation
My Playland - I69

  • Moderator
How are 16-bit signed integers representing pseudo-degrees converted into "real" degrees?
Gerry, didn't we have this discussion back in 2006?http://forums1.avsim.net/index.php?showtop...=pseudo-degreesIf the variable is for the adf, then:
lookup_var(&mvadfndl); adfndl = mvadfndl.var_value.n; adfdir = (360 + adfndl + heading); if (adfdir > 359) { adfdir = adfdir - 360; } if (adfdir < 0) { adfdir = adfdir + 360; }

For your proposed purpose, perhaps Ed's suggestion of simply stripping all bits past the 256-bit mark... the 0x1ff will accomplish that...

adf_hdg = (ADF_NEEDLEvar.var_value.n && 0x1ff) // adf_hdg = 419 adf_hdg = (adf_hdg * 360) / 512; // adf_hdg = 294.6

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author

My memory's going - I'd forgotten about the previous post!However the suggestions in it doesn't give sensible answers in my case. Thanks for the help anyway - I'll try the scenery forum.Rereading the original post shouldn'tadf_hdg = (ADF_NEEDLEvar.var_value.n && 0x1ff) // adf_hdg = 419 read adf_hdg = (ADF_NEEDLEvar.var_value.n & 0x1ff) // adf_hdg = 419 The first uses the logical-and which returns only true (1) or false (0). The second is the bitwise-and which masks out bits.

Gerry Howard

  • Author

I may have answered my own question. According to the FS2000 scenery SDK pseudo degrees represent the range 0 -360 with different degrees of precision in 8 bit (byte) 16 bit (word) 32 bit (double word) and 48 bit unsigned integers.

Gerry Howard

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.