Speeding Up Gauge Development

If there’s one thing we try to avoid when working on anything, it’s tediousness. Sometimes it’s as simple as using Notepad to replace all instances of a line of text. In the case of the displays on the 717, we wrote a program to design the gauges visually rather than in code. Why, might you ask? To answer that, allow me to give a bit of an overview of gauge development.

One of the options when programming gauges in C++ is to use Direct2D for the visual components. Direct2D is a 2D graphics API that’s part of the DirectX libraries. It’s a modern API for rendering 2D shapes and text to make up a digital display in FSX. Normally when testing out a program, it’s quite simple to launch it, try out your new code, and shut it back down to make a tweak. However, this isn’t so quick or simple in FSX. To test a change to anything, let’s say, the shape of the attitude indicator on the PFD of the 717, we must first switch to a different aircraft so that our gauge (a DLL/GAU, you’ve probably seen them in your FSX folder before) is not being used by FSX, “build” (essentially means our code is being converted to its final usable format) the new copy of the gauge, then open up our aircraft menu and select the 717 again (and of course click through that annoying dialog that asks us if we want to run the new DLL…). Those aren’t a lot of steps, but when you need to do this hundreds of times AND edit things point by point, it can take up a lot of…time. Above all, it’s just tedious and annoying to do. While powerful, Direct2D can be unpredictable in the way its shapes are rendered, which just makes this worse. We thought, there must be something we can do to make this easier? That’s when it dawned on us.

Direct2D isn’t just an API for use in graphics engines/games. It can also be used to render shapes in a standard desktop program. After a bit of research and some planning, we set to work on what we call D2D Studio (seen below, with the 717’s PFD loaded up). Keep in mind that the screenshot below demonstrates a work-in-progress version of the PFD and is by no means final.

D2D Studio Main Window

Rather than having to build our DLL and switch out of/in to the 717 every time, we can design most of the major shapes in real time. This makes it very quick to draw arcs, lines, and place text.

D2D Studio Line

We also implemented a feature where we can add a background image behind the display. This is helpful since we have real photographs of every display in the plane. We can set the background and start designing based on the actual locations of components of the displays. Below is an example of this – all of the PFD components we’ve drawn so far, with our photograph behind it.

D2D Studio PFD Background

Once we have what we need “drawn out” in D2D Studio, we have a feature for generating C++ code based on what we’ve made. We can then directly copy and paste this code into Visual Studio (an application/programming tool). Once we have the code in, we can then start adding functionality to our creations.

This program took us about a week to make, but saves us potentially months of development time.

Posted in Development and tagged , , , , , , , , , .

Collin Biedenkapp

I am the lead programmer at TFDi Design.