• 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.

FSXA Setting a variable on a gauge

Messages
27
Country
us-newhampshire
Hello,

Let's say I am implementing a radar. I have a dot texture that I would like to move around the background. I know I create an XML gauge with the background image and a dot image, I also can place the dot depending on the value of a variable defined in the gauge. My question is: can I change the value of the variable using a message from my SimConnect application? The position of the dot is not determined by the position of airplanes in the simulation. I would like to move the dot at will based on my own calculations.

So far I read in these forums that I would need to create a C gauge and add SimConnect to it, and then my SimConnect can send messages that gauge SimConnect can receive and apply to the gauge itself. Is it the simplest way if all I want to do is set a value of a variable in a Gauge?

Thanks a lot.
 
There are two ways I can think of that you could implement it:

1) You could code your whole gauge in C, included a SimConnect client in it and set-up a client data area to share variable values between the gauge's simconnect client code and your external app.

2) You could write your gauge in XML and position the dot according to local XML L: variables, like you're probably doing. Then you could write a small C dll (easiest would be a gauge with no image) that either talked to your external app via SimConnect or some other method (like TCP/IP) to get the variable values. You can then use something like execute_calculator_code() in C to run an XML expression to write the values into your L: variables.

There's really not much difference between the two methods, except that you wont have to learn how to code your gauge graphics in C. But I don't think there's any getting away from having to use C somehow. (Unless maybe there are read/write parameters that FSUIPC can access that aren't used in your aircraft that you can hijack, maybe.)

Si
 
Back
Top