Skip to content

Conversation

@ghingres
Copy link

@ghingres ghingres commented Jan 5, 2026

Ifly 737 winwing CDU python script updated to support both MAX/Advanced and NG legacy series of SDK integration

  • MAX/Advanced ( used in MSFS, Prepare3D v5 )
  • NG legacy ( used in FSX, FS2004, Prepare3D v1 ~ v4, Cockpit Builders Edition ).

Additional Improvements

  • Display blank CDU screen when SDK "iFly 737 CDU can display" indicator is (NG Series)
  • Display "Waiting for iFly 737" on CDU screen if a reset is requested during simulator running (MAX & NG)

Support iFly737 NG series integration (FSX, FS2004, P3D v1 ~ v4, CBE)
Copy link
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

This PR extends the Winwing CDU integration to support both iFly 737 MAX/Advanced and iFly 737 NG legacy series aircraft through their respective SDK implementations. The changes enable compatibility across multiple flight simulator platforms (MSFS, FSX, FS2004, Prepar3D v1-v5).

Key changes:

  • Added support for iFly 737 NG SDK2 memory-mapped interface alongside existing MAX SDK support
  • Implemented conditional CDU display states (blank screen when unpowered, waiting message during disconnection)
  • Added automatic SDK version detection to determine which aircraft model is loaded

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Koseng
Copy link
Contributor

Koseng commented Jan 5, 2026

@ghingres please work through the copilot review. If you do not follow a suggestion, please write in the comment why.

Updated comments and structure names following co-pilot review
@ghingres
Copy link
Author

ghingres commented Jan 5, 2026

@Koseng Source code updated as per Co-Pilot review.

@Koseng
Copy link
Contributor

Koseng commented Jan 6, 2026

Hi, now I looked into in detail. There are a lot of code copies, which should be avoided.

But first some questions:

  • Does that mechanism to determine MAX or NG really work always? If the memory layout is different, then trying to read the state on a NG returns an arbitrary value? Or not? Is that a good idea?

  • If the memory layout is really different, wouldn't it be better to create a separate python file for the NG? That would only make sense, if you could distinguish the two planes via a different AircraftIdSnippet in ScriptMappings.json.

@Koseng
Copy link
Contributor

Koseng commented Jan 6, 2026

@ghingres could you please attach the 737MAX_SDK.h and the .h file from the NG?

@ghingres
Copy link
Author

ghingres commented Jan 6, 2026

Hi @Koseng

Attached are the MAX/Advanced (SDK_Defines) and NG (SDK and SDK_CDU) include files. With the MAX/Advanced, iFly have merged the legacy NG files into a single file going forward. With Python, if a requested MMF is unknown, it creates it ( I'm assuming that the allocated area is initialised ).

SDK.h.txt
SDK_CDU.h.txt
SDK_Defines.h.txt

Updating the AircraftIdSnippet is an option if we have other iFly users that can provide Ifly MAX & Advanced snippet ID(s) and compare these to the legacy NG. For information legacy NG is showing these strings in debug log : -

01/06/2026 15:24:19(238): ScriptRunner.CheckAndExecuteScripts(): ScriptRunner - Current aircraft description: ifly 737-800 (wide screen).
01/06/2026 15:24:19(238): ScriptRunner.CheckAndExecuteScripts(): ScriptRunner - Add ifly_737_winwing_cdu.py to execution list.

My concern is the around the iFly Advanced 737 for P3D v5 which also contains models 800 & 900 ! Without access to this release we have no idea which version of the SDK is being used (back in August someone posted on the support forums a question to iFly however they haven't had a response). If iFly Advanced 737 for P3D v5 is using the legacy SDK this would simplify things if the snippet ID(s) are different between the 737 MAX and NG. I will ask on the iFly forum if the poster could run one of the example SDK .exe(s) to assist in determing which version of the SDK the P3D v5 is using.

Throughout this change, I've assumed MAX & Advanced iFly users with MobiFlight and WinWing CDU are all working successfully (P3D v5 and MSFS). This is why I've avoided any refactoring of the as-is code to support the legacy SDK.

Gary

Head in shame moment - failing to test
@ghingres
Copy link
Author

ghingres commented Jan 8, 2026

@DocMoebiuz My sincere apologies, rookie mistake after doing a text edit...

My python had a syntax error - I should have tested it before commiting..

I've corrected the error, tested and commited the working code.

@DocMoebiuz
Copy link
Collaborator

@DocMoebiuz My sincere apologies, rookie mistake after doing a text edit...

My python had a syntax error - I should have tested it before commiting..

I've corrected the error, tested and commited the working code.

nw - happens to the best :D

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

Build for this pull request:
MobiFlightConnector.zip

@Koseng
Copy link
Contributor

Koseng commented Jan 10, 2026

@ghingres please:

  • Try to avoid duplicate code and use shared code/functions for the nx and max
  • In setup_memory_map check whether the memory map exists. Should be possible via windows api.
  • Use list functions like "extend" in python and have look at pyhon "list comprehensions". List handling and simple for loops can be done quite elegant in python.

I asked Copilot do all of that. I attach the resulting file as a reference. I did not test and run that code. You can have a look at it and try it and use it as a base.

ifly_737_winwing_cdu_refactor.py

@Koseng
Copy link
Contributor

Koseng commented Jan 10, 2026

@ghingres are you able to test both variants? So the max as well? If not then we will ask someone else to test it.

@ghingres
Copy link
Author

@Koseng

Apologies for delay ( I've been busy debugging a FSUIPC with Mobiflight - appears it's within FSUIPC .net integration layer.. still working on it to try and get a test case over to FSUIPC team)...

Regarding the python refactored script: just tested and this works with NG version of iFly.. I have no access to the Max version so we will need someone else to test it continues to function. This will allow Mobiflight to work with all iFLY variants 👍

- Avoid duplicate code
- Use system DLL to check Memory mapped file exists
- Use list functions to simplify
@ghingres
Copy link
Author

@Koseng - I've now commited the refactored python file as it makes sense we use this going forward.

What are the next steps to get this included in next Beta build ?

@Koseng
Copy link
Contributor

Koseng commented Jan 24, 2026

@tristanmcpherson did you create the initial ifly 737 max script?
Can you test the one in the PR and see whether it is still working ok?

@tristanmcpherson
Copy link
Contributor

@tristanmcpherson did you create the initial ifly 737 max script? Can you test the one in the PR and see whether it is still working ok?

Yes, that was me. I should be able to test

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.

4 participants