Jump to content
Sign in to follow this  
n4gix

ATC ID in C...

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

 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.


 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...