Skip to content

Add WinCtrl CDU support for Laminar Boeing 747-400.#2904

Merged
DocMoebiuz merged 3 commits intoMobiFlight:mainfrom
maboehme:laminar_b744
Apr 16, 2026
Merged

Add WinCtrl CDU support for Laminar Boeing 747-400.#2904
DocMoebiuz merged 3 commits intoMobiFlight:mainfrom
maboehme:laminar_b744

Conversation

@maboehme
Copy link
Copy Markdown
Contributor

This change also enables support for the Sparky
747-400
mod, which is based on
the Laminar Boeing 747-400 and uses the same CDU datarefs.

This change also enables support for the [Sparky
747-400](https://github.com/mSparks43/747-400) mod, which is based on
the Laminar Boeing 747-400 and uses the same CDU datarefs.
@maboehme maboehme requested a review from DocMoebiuz as a code owner April 14, 2026 18:57
@github-actions
Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Winwing CDU Python script for the Laminar Boeing 747-400 (and Sparky 747-400 mod) and wires it into the script auto-run mapping so it launches when the aircraft is detected.

Changes:

  • Added laminar_747_400.py X-Plane dataref-to-CDU translation + websocket forwarding script (Captain/CoPilot/Observer).
  • Registered the script in ScriptMappings.json for aircraft description matching.
  • Updated MobiFlightConnector.csproj to ship the new script as content.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/MobiFlightConnector/Scripts/Winwing/laminar_747_400.py New Winwing CDU integration script for Laminar/Sparky 747-400 datarefs.
src/MobiFlightConnector/Scripts/ScriptMappings.json Adds aircraft snippet mapping to run the new script for “boeing 747-400”.
src/MobiFlightConnector/MobiFlightConnector.csproj Ensures the new script is copied to output on build.

display_data = [[] for _ in range(CDU_CELLS)]

for row in range(CDU_ROWS):
# Strings are sometimes empty, so pad with spaces to the full expected wwidth.
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: "wwidth" should be "width".

Suggested change
# Strings are sometimes empty, so pad with spaces to the full expected wwidth.
# Strings are sometimes empty, so pad with spaces to the full expected width.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed!

Comment on lines +201 to +204
dataref_name = dataref_map[dataref_id]

new_values[dataref_name] = base64.b64decode(value).decode()

Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decoding subscribed dataref values with base64.b64decode(value).decode() can leave embedded NUL characters ("\x00") in the resulting string and can raise decoding errors on unexpected byte sequences. Other Winwing X-Plane scripts sanitize text values by decoding with a defined error strategy and replacing NULs with spaces; doing the same here will avoid sending invalid characters to the CDU and prevent the task from crashing.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the error strategy to errors='replace' (so that non-UTF-8 input doesn't raise an error) and replaced null characters with spaces.

@DocMoebiuz
Copy link
Copy Markdown
Collaborator

@maboehme - please take a look at the review feedback

Copy link
Copy Markdown
Collaborator

@DocMoebiuz DocMoebiuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See review comments by CoPilot

*  Fix typo in "wwidth"
*  Make bytes-to-string decoding more resilient to erroneous input
@maboehme
Copy link
Copy Markdown
Contributor Author

@maboehme - please take a look at the review feedback

Thanks, I've made changes in response to the review comments!

@github-actions
Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@github-actions
Copy link
Copy Markdown

Build for this pull request:
MobiFlightConnector.zip

@DocMoebiuz DocMoebiuz merged commit b4aae43 into MobiFlight:main Apr 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants