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.

Detect plane shutdown/change from gauge

Featured Replies

Hi,I´m building a gauge using C and I´d like to detect when the user is shooting down the plane.My gauge is open some network connection I´d like to close them properlyIs there a function called when the plane is being shutdown?Thanks in advanceJofre

You would have to define conditions for when the plane is shut down and then test them.For example, the plane could be considered shut down when all engines have 0 rpm and the main bus voltage is 0.But maybe you want to test the magnetos or fuelvalve as well.If you want to detect the moment the plane is shut down you can use a variable to record the previous state.You first determine the plane's current state and compare it to the previous state.If they are the same nothing has happened, if they are different the plane has just changed it's state.Then you write the current state into the previous state variable for the next iteration.

  • Moderator
Hi,I´m building a gauge using C and I´d like to detect when the user is shooting down the plane.My gauge is open some network connection I´d like to close them properlyIs there a function called when the plane is being shutdown?Thanks in advanceJofre
1. There is a dedicated forum for technical questions named MSFS Aircraft and Panel Design Forum, where such questions are best asked. Many folks who are gauge/panel systems developers don't follow this forum all that closely... :( 2. You will need to need to set up a callback to the sim's "Panel_Service" function, and place your "disconnect routine(s)" here:
void FSAPI gaugecall(PGAUGEHDR pgauge, int service_id, UINT32 extra_data){	switch(service_id)	{		case PANEL_SERVICE_CONNECT_TO_WINDOW:			/* START UP STUFF GOES HERE! */		break;		case PANEL_SERVICE_DISCONNECT:			/* SHUT DOWN STUFF GOES HERE! */		break;	}}

See the SDK's gauges.h file for a complete list of Panel_Service case events.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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.