Simple gauge question

#1
I've never created gauges before and am just starting to trawl through that specific part of the FSX SDK. One immediate question I have is:

Does gauge code only run if the gauge is visible? i.e. while the user is in the 2D cockpit or VC?

If not, and your gauge does something fancy like trigger an alarm sound, or set some internal variable, how do you prevent it from doing it twice simulataneously if the user were in spot view, (or any other non-cockpit view)?

Sorry if this question is a bit "noddy", as gauge programming is a whole new wide world for me.

Thanks,

Si
 
#2
It depends on how the gauge is programmed...

Typically though, the gauge is "called" into action either when the panel (2d or 3d, wherever the gauge is located) is first loaded or when the aircraft is first loaded. Also, some gauges can run multiple instances or some will still only run one instance of itself even if more than one is displayed...

The basic "straight out of the SDK" examples will load when the panel loads. If you load your plane in spot view, they won't go active until you cycle into the panel view.

So...how's that for a waffling, non-commiting reply? :) (I hate to call it an answer.)
 
#3
Ok, that's a bit clearer. So after a gauge has loaded, the code continues to run if the user then switches to an external view?

Is there a secret to getting a gauge to load *before* the panel is displayed? i.e. if a flight is loaded in spot view?

Thanks,

Si
 
#4
Ok, that's a bit clearer. So after a gauge has loaded, the code continues to run if the user then switches to an external view?

Is there a secret to getting a gauge to load *before* the panel is displayed? i.e. if a flight is loaded in spot view?

Thanks,

Si
Once it's called, a "regular" gauge once loaded will continue to run until a new plane is loaded even when you're not in a view displaying the gauge.

This can be modified by changing how you set up your gauge's GAUGE_CALLBACK (info somewhere around line 4400 in the gauges.h file). I haven't used it very much myself so I really don't fully understand all the ins/outs of the gauge callback and how to use it.
 
Top