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.

Magic or science - do we really need that code?

Featured Replies

I read Dai Griffiths' excellent summary on gauge programmingand I found something I could not believe. He states that thetwo lines in element callback functions are obligatory:FLOAT64 FSAPI active_units_update( PELEMENT_STRING pelement ){ FLOAT64 val=pelement->source_var[0].var_value.n; val = !val; ...}He also explains:"The first line in the body of the structure is an FS2K+ requirement even if you are not actually reading a Token Variable. It seems to be needed to trigger FS to check if the string needs updating. The next line does the dirty deed and forces FS to run an update; each time it runs through this line it simply inverts the previous value of val thus creating the change necessary to trigger the update function."Well, these were the first lines had I deleted from the code I inherited and it still works. On the other hand I can not theoretically imagine how a simple read (first line) and update (second line) instruction would trigger FS at all. These are not FS API calls but are direct memory manipulations and only the CPU knows about them, the FS core application will not. The memory area "belongs" to FS application, but I know no mechanisms throught which FS would have been informed about any reads or updates there.Gabor

Never used such code. You are right, there is should be no difference

Where can I find this summary on gauge programming?

  • Author

Martin,Look for sd2gau17.zip on flightsim.com. I'm not sure if the file is available here or not.Doug Dawson

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.