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

Failure management in C++ / Virtual Cockpit gauge

Messages
18
Country
italy
Hello,

I'm working on a project with all gauges animated in 3dsmax, and controlled via "animations" written in XML inside modeldef.xml.
For example:

XML:
  <PartInfo>
    <Name>mach_scale</Name>
    <AnimLength>90</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:Airspeed mach,machs) 0.3 - 100 * </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipText>Mach %((A:Airspeed mach,machs))%!1.2f!%</TooltipText>
    </MouseRect>
  </PartInfo>

Now I need to manage also failures. I have seen that for 2d gauges there is a special tag Failures:

XML:
<Gauge>
  <Element>
    <Failures>
        <SYSTEM_ELECTRICAL_PANELS Action="-20"/>
        <SYSTEM_ELECTRICAL_AVIONICS Action="-20"/>
      </Failures>
      ....

However, this tag is not present in modeldef.xml. So I was wondering if I could catch failure in C++. In file gauges.h there is this enum:

C++:
typedef enum    FAILURE_KEY
{
        FAIL_NONE = 0,

        FAIL_SYSTEM_ENGINE,
        FAIL_SYSTEM_PITOT_STATIC,
        FAIL_SYSTEM_VACUUM,

        FAIL_GAUGE_ADF,
        FAIL_GAUGE_AIRSPEED,
        ...

Can these values be catched as "events" in C++, so that I can change a custom L value, that in turn can be read in modeldef.xml?


Thank you,
Mauro
 
There are variables you can read for most if not all of them.
 
FSX SDK:
Code:
(A:PARTIAL PANEL ADF, Enum)
(A:PARTIAL PANEL AIRSPEED, Enum)
(A:PARTIAL PANEL ALTIMETER, Enum)
(A:PARTIAL PANEL ATTITUDE, Enum)
(A:PARTIAL PANEL COMM, Enum)
(A:PARTIAL PANEL COMPASS, Enum)
(A:PARTIAL PANEL ELECTRICAL, Enum)
(A:PARTIAL PANEL AVIONICS, Enum)
(A:PARTIAL PANEL ENGINE, Enum)
(A:PARTIAL PANEL FUEL INDICATOR, Enum)
(A:PARTIAL PANEL HEADING, Enum)
(A:PARTIAL PANEL VERTICAL VELOCITY, Enum)
(A:PARTIAL PANEL TRANSPONDER, Enum)
(A:PARTIAL PANEL NAV, Enum)
(A:PARTIAL PANEL PITOT, Enum)
(A:PARTIAL PANEL TURN COORDINATOR, Enum)
(A:PARTIAL PANEL VACUUM, Enum)

0 = ok, 1 = fail, 2 = blank.
 
Back
Top