scott-vincent / instrument-panel

An instrument panel for Microsoft Flight Simulator 2020
171 stars 29 forks source link

Display GPS cross track error on VOR #18

Closed emxsys closed 3 years ago

emxsys commented 3 years ago

When the GPS controls NAV1 the GPS cross track error should be displayed on the VOR's CDI.

To implement the desired behavior, the relevant simulation variables needed include:

Other related variables, but not anticipated for this specific feature, include:

scott-vincent commented 3 years ago

Added: simVars->gpsDrivesNav1 simVars->gpsWpCrossTrk

scott-vincent commented 3 years ago

If you need to debug and want to display the value of a variable during a flight in any instrument panel code you can do, e.g:

sprintf(globals.error, "crossTrk: %f", simVars->gpsWpCrossTrk);

and the output will appear on the Annunciator.

emxsys commented 3 years ago

Thanks! Where can I find SimConnect.h?

emxsys commented 3 years ago

Re: SimConnect. Nevermind. I found the MSFS SDK.

[DevMode] Help > SDK Installer
scott-vincent commented 3 years ago

Yes, that's the one.

emxsys commented 3 years ago

@scott-vincent We need to think about how to indicate when the GPS drives NAV1. FS2020 has a more modern VOR instrument which illuminates the GPS and NAV flags. To replicate the sim instrument's behavior we need to be able to show both GPS and NAV at the same time (for when GPS controls NAV1 and NAV1 is tuned to a VOR). How would you like to indicate this?

Ideas:

emxsys commented 3 years ago

@scott-vincent Here's another idea:

I really like this idea, even though it can't indicate a tuned VOR and GPS at the same time, it maintains the mechanical feel of the instrument.