• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Trigger XML actions

Messages
531
Country
france
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
 

Vitus

Resource contributor
Messages
1,480
Country
newzealand
Hi Eric,
I think this is your problem, right?
FKqKMXD.png


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?
 
Messages
2,077
Country
us-ohio
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.
 
Messages
1,564
Country
thailand
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
 
Messages
531
Country
france
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
 
Messages
531
Country
france
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