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.

ATC ID in C...

Featured Replies

  • Moderator

I have been trying without success to read the XML token A:atc id, string and display it in a C gauge... Here is what I've tried so far. All I get for my trouble is an "N" showing up...: WCHAR n_number[15] = L"N200SR";//----------------------case PANEL_SERVICE_PRE_UPDATE:execute_calculator_code("(A:atc id, string)",&n_number,NULL,NULL);break;//----------------------FLOAT64 FSAPI atc_cb( PELEMENT_STRING pelement){swprintf(pelement->string, L"%s", n_number);return 0;}MAKE_STRING(String_atc,NULL,NULL,IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY | BIT7,0,8,5,98,27,1000000,MODULE_VAR_NONE,MODULE_VAR_NONE,MODULE_VAR_NONE,RGB(85,79,79),RGB(0,0,0),RGB(0,0,0),GAUGE_FONT_DEFAULT,GAUGE_WEIGHT_DEFAULT,GAUGE_CHARSET,0,0,NULL,atc_cb)PELEMENT_HEADER ElementList2[] = {&String_atc.header,NULL};

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Bill,This seems to work:PCSTRINGZ n_number;execute_calculator_code("(A:atc id, string)",NULL,NULL,&n_number);sprintf(pelement->string,"ATC %s", n_number );The execute_calculator_code function is pretty adament about having the string variable in the form of PCSTRINGZ. Fortunately, the sprintf function is OK with that.Doug

  • Author
  • Moderator

THANK YOU! :)It works a treat!Now I finally understand how this works:BOOL (FSAPI *execute_calculator_code) (PCSTRINGZ code, FLOAT64* fvalue, SINT32* ivalue, PCSTRINGZ* svalue);

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • 14 years later...

 hİ n4gix

 I am using simconnect in C#. I get or set almost all standart KeyEvents and Simulation variables.  But the aircraft contains some variables that special developer panels.     (L:Master_AC, bool),  (L:ignition, bool) , (L:Swapu, bool)  etc.

I want to change their values in C#.

As much as I understand I should use C++ language and execute_calculator_code to change their values.

The problem that I don'y know C++ or XML. Please help me to solve this problem.


 

  • Commercial Member

Since LVARS are only accessable via either execute_calculator_code (C code only) or in an XML gauge... I don't see how you're going to solve it.  There is no C# support for LVARS.

Ed Wilson

Mindstar Aviation
My Playland - I69

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.