Skip to content

Conversation

Nezz
Copy link
Contributor

@Nezz Nezz commented Jul 29, 2025

This was suggested in #2270.

The orphaned serials will be resolved automatically if there are only unique device names (e.g. one MCDU, one FCU) in a profile. If this happens successfully the dialog will not be displayed.

  • All device types are supported
    • MobiFlight Controllers
    • Joystick Controllers
    • Midi Controllers
  • Automatic replacement
    • For every device that is referenced in the profile but not connected, and
    • if another device of same type and same name is found, it will be used
  • No auto replacement if multiple devices are connected that match type and name
  • User message presented in case:
    • automatic profile update happened successfully, now changes have to be saved (best to new file)
    • automatic profile was not possible because user has to manually select
    • profile update was not possible because no matching device connected
  • Unit tests are added

Context: I'm one of those people who only uses MobiFlight with off-the-shelf hardware. This makes things easier for people who download profiles from the web and don't make build their own hardware.

Copy link

Build for this pull request:
MobiFlightConnector.zip

else if (opd.HasChanged())
{
// If there are no orphaned serials, serials can still be changed automatically
UpdateProject();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could add a TimeoutMessageDialog here, but I think these "serials" are an implementation detail we don't need to expose to users.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I kind of disagree - if we manipulate a config/profile then we should at least tell the user about it.

Please see my comment on the original issue #2270

If it is really straight forward, well then everything is fine and MobiFlight should just tell the user:

  • We have optimized this profile to use all your connected devices *

Also what about saving the changes? This would pop-up again next time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What if we can't resolve it? Two Yokes with the same name?

Copy link
Contributor Author

@Nezz Nezz Aug 11, 2025

Choose a reason for hiding this comment

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

I kind of disagree - if we manipulate a config/profile then we should at least tell the user about it.

It's just not actionable to the user. They probably just downloaded a profile and want it to work. Note that I didn't touch any of the edge-cases here where assignments could be destructive, only the trivial ones.

Also what about saving the changes? This would pop-up again next time.

There is no popup if everything resolves automatically. Only if there are two devices with the same name or a device that isn't connected.

What if we can't resolve it? Two Yokes with the same name?

If we can't resolve it then the popup will be displayed as usual.

@Nezz Nezz marked this pull request as ready for review July 29, 2025 20:22
@Nezz Nezz requested a review from DocMoebiuz as a code owner July 29, 2025 20:22
@Nezz Nezz changed the title Automatically resolve orphaned serials Automatically resolve simple orphaned serials Jul 29, 2025
@DocMoebiuz
Copy link
Collaborator

@Nezz thanks for all the effort. A PR shows in the release notes, and also serves as a piece of docs. It is also helpful if there is more "Acceptance criteria" mentioned in the description. Makes it easier to review the code and understand the functional and possibly non-functional requirements that are fulfilled.

Compare my PRs, like #2266, #2268

@DocMoebiuz
Copy link
Collaborator

I added some sensible "confirmations" as a starting point. Maybe you have some more ideas.

@Nezz
Copy link
Contributor Author

Nezz commented Aug 12, 2025

Feel free to make changes to the code

@DocMoebiuz
Copy link
Collaborator

Let's check the boxes that are already fulfilled

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

Successfully merging this pull request may close these issues.

2 participants