Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin v1.4 - Using L vars with SimConnect may require Unit specifier. #58

Closed
mpaperno opened this issue Aug 5, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@mpaperno
Copy link
Owner

mpaperno commented Aug 5, 2023

[previously posted on Discord]

Plugin version 1.4 switched L var handling from using the custom WASM server/client to using the new "native" SimConnect L var feature (introduced in SU12).

However, it seems in some cases SimConnect will convert L variable values to some other relevant Unit type before delivery. As a result, the value received by this plugin will not match what is expected, meaning what was returned with plugin v1.3/WASM and what is shown in the MSFS Dev view variable inspector.

For example, as reported by a user, on the FBW A320, the value of variable A32NX_AUTOPILOT_HEADING_SELECTED is normally shown in whole degrees. However when read via the new SimConnect L var feature, the value is returned in radians instead.

Up until now there hasn't been any way I know of to retrieve this value in radians (or any other specific unit) at all. It's not clear what SimConnect is doing here, or how it even "knows" that the value can reasonably be converted to another angle measurement unit. AFAIK there's no way to specify a Unit type for a L var except via whatever SimConnect is now doing.

So far only 2 L vars are known to do this... all others seem to act as before, ignoring any Unit type specification. The 2nd known example is A32NX_AUTOPILOT_VS_SELECTED and it needs to be requested with a Unit type pf "ft/min".

When using custom variable requests via .INI config files, the Unit type can still be specified now, and is respected by SimConnect. Just like for "A" type Sim Vars. So the current workaround is to specify the actual unit type for any such "problem" L vars. For example A32NX_AUTOPILOT_HEADING_SELECTED can be requested with a specific Unit = "degrees" and the result will again be as expected with the previous plugin v1.3.

However when using the plugin's "Custom States & Variables" actions to add/edit L var requests, the Unit type is now either ignored or not shown (for L vars) at all. There's no workaround besides saving the requests to an INI file and then (re)loading the requests from the edited file.

To address this issue, my current thought is to:

  1. Provide a plugin-wide setting to "always use WASM for L vars when available" which, if enabled, would simply restore the v1.3 behavior of using WASM if it available, or falling back to SimConnect otherwise.
  2. Add the ability to specify Unit type for L var requests added via the plugin's actions. Unfortunately since the Unit is ignored in most cases, this may lead to some user confusion.
@mpaperno mpaperno added the bug Something isn't working label Aug 5, 2023
@mpaperno
Copy link
Owner Author

mpaperno commented Aug 5, 2023

Implemented option 2 in v1.4.2 (commit 0283648). Hopefully the added notes in the affected actions about the L var Unit will help prevent some confusion.

@mpaperno mpaperno closed this as completed Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant