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

Repeated commands are lost with the WASM module #1876

Open
Nezz opened this issue Dec 7, 2024 · 0 comments
Open

Repeated commands are lost with the WASM module #1876

Nezz opened this issue Dec 7, 2024 · 0 comments

Comments

@Nezz
Copy link

Nezz commented Dec 7, 2024

Describe the bug
I noticed an issue with the Winwing FCU (and EFIS) knobs, but it might affect other devices too that send lots of repeated commands.

When the Winwing FCU's knobs are turned quickly (see additional context), some commands don't get executed by the WASM module.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Configure the heading knob to execute the following:
    1 (A:AUTOPILOT HEADING LOCK DIR:1, degrees) 1 - dnor (>K:2:HEADING_BUG_SET)
  2. Start a flight with the 172, turn on avionics
  3. Turn the knob quickly

Expected behavior
The heading changes by the amount of commands sent (see this code)

Actual behavior
MF.SimVars.Set is sent to the WASM module the correct times, but it does not change the heading correctly. The slower the sim runs, the less the heading will change.

Details

  • MobiFlight Version: 10.4.0.1 and lastest main (fa27040)
  • FlightSim: MSFS 2024
  • AddOn: Tested with default G1000 or G3000 aircraft, possibly others

Additional context

Mobiflight exposes the knobs as buttons, and it simulates a button press for each increment:

for (int i = 0; i < Math.Abs(increment); i++)
{
// For encoder buttons only send press event
TriggerButtonPress(EncoderButtonsToTrigger[id], MobiFlightButton.InputEvent.PRESS);
}

This can result in dozens of events sent to the sim at the same time. I debugged this issue and it seems that Mobiflight Connector sends the commands to the WASM module correctly, so the issue is either with simconnect not liking this many events, or the WASM module not handling them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant