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.

Help setting up client gauge in C

Featured Replies

I have a gauge I would like to receive a var sent out from a server gauge. I have read the SDK, which illustrates three syntax codes: void register_var_by_name(PVOID var, VAR_TYPE var_type, PSTRINGZ name)void unregister_var_by_name(PSTRINGZ name)void initialize_var_by_name(PMODULE_VAR module_var, PSTRINGZ name)However, I'm a little unsure how to use them, as I cannot find any examples in the SDK or elsewhere. If anyone has any experience setting up a client gauge to receive a custom var from a server gauge I would really appreciate a little help getting started! Many thanks. Andrew

Server Gauge:BOOL fcc_pos;In PANEL_SERVICE_PRE_INSTALL: register_var_by_name (&fcc_pos, TYPE_BOOL, "FCC Power On");In PANEL_SERVICE_PRE_KILL: unregister_var_by_name ("FCC Power On");Make sure the server gauge is on the main panel.Client Gauge:MODULE_VAR fcc_pos;BOOL* FCC_On;In PANEL_SERVICE_PRE_UPDATE:if (fcc_pos.var_ptr == NULL){ initialize_var_by_name (&fcc_pos, "FCC Power On"); FCC_On = fcc_pos.var_ptr;}Use FCC_On as normal. ;)Matt

Matt Kaprocki

Boeing777_Banner_DevTeam.jpg

For fastest support, please submit a ticket at http://support.precisionmanuals.com

Check the SDK.Flightmap.c sample from the SDK, it shows the use of a clint gauge (not the server).Arne Bartels

Thanks for your help. I have looked at the Flightmap.SDK and the above example - though I'm still missing something - and I can't find out what. I don't understand why what I have below does not work? If anyone can see anything I have missed out, or something that may be in the wrong place I would be very grateful if you could let me know. The gauge compiles and works in FS with token vars - though I would like it to use my own. /////////////////////////////////////////MODULE_VAR afttrim;initialize_var_by_name (&afttrim, "Afttrim System");aft = (afttrim*)afttrim.var_ptr;void FSAPI atatankCallback ( PGAUGEHDR pgauge, SINT32 service_id, UINT32 extra_data ){switch(service_id){case PANEL_SERVICE_CONNECT_TO_WINDOW:FSUIPC_Open(SIM_FS2K2 , &dwResult);break;case PANEL_SERVICE_PRE_UPDATE://if condition to top up tanks set the level to 100%=66536*128if (aft == 0){ fuellevel=66536*128;FSUIPC_Write(LEFT_AUX_LEVEL, 4, &fuellevel, &dwResult);FSUIPC_Write(RIGHT_AUX_LEVEL, 4, &fuellevel, &dwResult);FSUIPC_Process(&dwResult);}//if condition to empty tanks set the level to 0%=0if (aft == 1){ fuellevel=0;FSUIPC_Write(LEFT_AUX_LEVEL, 4, &fuellevel, &dwResult);FSUIPC_Write(RIGHT_AUX_LEVEL, 4, &fuellevel, &dwResult);FSUIPC_Process(&dwResult);}break;////////////////////////////////////////Thanks again, Andrew

Got it to work. :-) I found some good examples in the sd2gau14 documentation that showed the layout of the client gauge. Thanks Matt for the post, and also a big thank you to Arne, for all your help this week. Regards,Andrew

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.