Failure management in C++ / Virtual Cockpit gauge

#1
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
 

Luka

Resource contributor
#4
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.
 
Top