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.

How to make a popup gauge available in any aircraft?

Featured Replies

I would like to make a popup gauge (I'm sure there is a better term) which is available in any aircraft. Examples would be FSFlightMax and FSBrowser. I've downloaded the panel SDK and compiled the samples. They have a flight map gauge which is a popup, but it is only available if you tweak the panel.cfg for every airplane. How do I make it available in all the airplanes?

  • Moderator

You can't. Every panel.cfg must be edited manually to enable your custom popup...

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

any idea how those other addons I mentioned do it then? How does FSBrowser make itself available in every plane?

I think the examples you quote are FS modules. They are .dll's that are placed in the Modules folder and are loaded by FS when it loads. Gauges are very specific. While they are also, strictly speaking, .dll's, they are loaded through the FS panel routine and are thus only available when a panel containing them is loaded.Doug

Ah ok. So I guess my next question should be how do I make modules (as opposed to gauges)?There is no "modules" SDK, or did I just miss it?

As far as I know (please correct me if I'm wrong), here is my point:As you said, there is no module SDK (unfortunately), and developing a module is much more complex than developing a gauge. In addition, the SDK provides all the necessary tools to access the FS variables, and it is not the same for the modules. Accessing FS variables from a module DLL is not that easy, except if you use FSUIPC.Eric

Eric, it's possible without FSUIPC :)

>Eric, it's possible without FSUIPC :)But is it easy? :) I'm a software engineer, so perhaps you could just point me in the right direction?

  • Moderator

Download the FSUIPC SDK. All of the offsets are listed there, so it IS possible to access the sim without using FSUIPC itself.Search back in this forum about five months ago for a discussion and examples of how to fetch data from FS via the offsets.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

>>Eric, it's possible without FSUIPC :)>>But is it easy? :) I'm a software engineer, so perhaps you>could just point me in the right direction?Yes, it's easy.In Gauges.h you can see following structure:

/* This is the module's import table.	*/				GAUGESIMPORT	ImportTable =					{										{ 0x0000000F, (PPANELS)NULL },					{ 0x00000000, NULL }				};

When FS loads module (including gauge) and see{ 0x0000000F, (PPANELS)NULL } entry, it fills it with some addresses.You can insert such in your module and after this you will able use lookup_var and other FS routines.

This is interesting, but it doesn't work for me. I am not an expert in Windows programming and DLL development, so I'm sure I missed something here...When I include "Gauges.h", it makes a conflict with my own code because of a redifinition of the "Linkage" variable. In my code, it is defined like this:extern DLLEXPORT MODULE_LINKAGE Linkage = { 0x00000000, module_init, module_deinit, 0, 0, 0x0900, NULL};and it is already defined in "Gauges.h" like this:typedef struct GAUGESLINKAGE{ FSLINKAGE PGAUGEHDR gauge_header_ptr[];} GAUGESLINKAGE, *PGAUGESLINKAGE, **PPGAUGESLINKAGE;EXTERN_C DECLSPEC_EXPORT GAUGESLINKAGE Linkage;How can I make it work?I am very interested in being able to use the "lookup_var" function in my module.Thanks for your help !!Eric

Eric,This interested me quite a bit too. What I did...Pasted this block of code, from GAUGES.H, into my sourcecode.c file: /* This is the module's import table. */ GAUGESIMPORT ImportTable = { { 0x0000000F, (PPANELS)NULL }, { 0x00000000, NULL } }; /* This is the module's export table. */ GAUGESLINKAGE Linkage = { 0x000002d9, module_init, module_deinit, 0, 0, FS9LINK_VERSION, {0} };I then used GAUGES.H as the header file for the module.Seems to work OK! If you have other stuff in your header file, try just commenting out your definition of ImportTable and Linkage, rather than eliminating the file altogether.Doug

I already tried this, but then FS9 pops up a windws on startup, saying a module can not be loaded and will be disabled. If I load it, FS9 simply crashes. This is why I think the Linkage definition I have in my code is important.Eric

Then you did domething wrongActually there is no difference between gauge and module in FS.Both are dlls and have Linkage and ImportTable exports

You're right, something was wrong. It now works fine...Thanks.Eric

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.