FSX Trigger XML actions

Hello experts,

For those who don't know me yet, I must say that I am a real beginner in XML coding, I never thought XML was an appropriate language for coding. On the other hand, I am an expert in C/C++ with which I developed many panel gauges and systems, including drivers for hardware devices.
Today I would like to use a hardware rotary knob to control the navigation display that is based on the FSX GPS in some add-on aircraft, especially the double rotary knob that controls the GPS input. I can open and read the XML code for this gauge, but I don't know how to reach my goal. I guess I should find the actions triggered when the knob is turned and write a code that triggers the same actions when the physical knob is turned. I tried to do this but I hardly understood the XML code and reproducing all the actions when the knob is turned looks difficult to me, not to say impossible...
Do you know any simple way to trigger the actions of a knob rotation in an XML gauge?

Thanks,
Eric
 
Hi Eric,
I think this is your problem, right?


Takes a while to get used to the silly way of programming XML gauges...

Just generally speaking:
Whenever you call on a variable, it is put on the top of your processing stack. So a call like:
Code:
(L:COOLNESS OF ERIC,number)
loads the variable "COOLNESS OF ERIC" into the stack. You can then perform operations on the variable in the stack, like so:
Code:
(L:COOLNESS OF ERIC,number) 1 +
that adds one to the coolness of Eric, however this is still just sitting in the stack. You need to update your original variable:
Code:
(L:COOLNESS OF ERIC,number) 1 + (>L:COOLNESS OF ERIC,number)
For your GPS knob it'd be similar, but it so depends on how everything is set up. Are you using the sims A-variables and K-events? Or do you stick with your custom variables?

The details of how to use that soooo much depends on your gauge, so maybe post what you've got so we can have a look at it?
 
There is a small app that is part of the SDK called InfixToPostfix.exe. It can translate between XML and C well enough to get the idea of what the XML is trying to do.
 
A physical hardware rotary knob, not a mouse click area on an image of a knob? Is that the question? If yes, then this thread may shed some light. It discusses interface of a physical Garmin GCU 477 with XML.

Bob
 
Thanks @Vitus
I know a little about the Polish notation, I had an HP-15C calculator when I was young, a long time ago :)
I can read XML and understand what it does when it comes to variable manipulation, but it is much harder for me when dealing with event management. In this case, using the GPS knob on the screen consists in 4 click spots to which actions are related. If the action was only to change a variable value, such as the GPS range, that would be easy. But it is much more complex in my case... The actions related to the click spots are much more than updating a variable. I am afraid I am not allowed to share the XML code with you here because of copyright reasons.

Eric
 
A physical hardware rotary knob, not a mouse click area on an image of a knob? Is that the question? If yes, then this thread may shed some light. It discusses interface of a physical Garmin GCU 477 with XML.

Bob
Thank you Bob, this thread is very interesting, this is exactly what I want to do. If I can update LVars with FSUIPC, that's fine, but I'm afraid it will be more complex than this. Anyway I think I can do it by copying the code of the original XML gauge into a custom gauge that triggers the same actions according to a LVar value change. It should work :)
 
Top