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

Console: Port to Qt #1161

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

nikhil-sethi
Copy link

Hey everyone!
In light of my conversation with @khancyr at Discord about MAVproxy improvements for GSOC 2023, I've started with a very basic port to the QT framework for the console. A lot of It is based on the previous console to avoid significant changes.

Features

  • Uses QT's signals and slots instead of callback functions
  • module loading and unloading (module name: qt_console)
  • mavlink information messages + Show map action working

Caveats

  • There are a lot of modules that depend on wx for updating information using set_status whose signature might need to be updated as the row argument might not be required.
  • Need to cleanup and separate classes into multiple files

I know that there shouldn't be more than one commit and merge commits in a PR. Please let me know if I should squash and rebase. I was also wondering if some re-organization of items on the console is needed which is a bit cluttered right now. We could use tabs to distribute info better. Any ideas are welcome.

Screenshot from 2023-03-10 18-45-54

@peterbarker
Copy link
Contributor

Nice POC.

Could you outline some of the advantages you see here QT-vs-WX, please? This might just be a copy/paste summary from Discord.

Need a requirements.txt file inside your new directory - we don't want to make PySide6 a hard dependency yet, but having a requirements.txt in the subdirectory is a pattern we've used elsewhere.

Need this patch to ease testing:

--- a/setup.py
+++ b/setup.py
@@ -82,6 +82,7 @@ on how to use MAVProxy.''',
                 'MAVProxy.modules.mavproxy_paramedit',
                 'MAVProxy.modules.mavproxy_smartcamera',
                 'MAVProxy.modules.mavproxy_cesium',
+                'MAVProxy.modules.mavproxy_qt_console',
                 'MAVProxy.modules.mavproxy_joystick',
                 'MAVProxy.modules.mavproxy_magical',
                 'MAVProxy.modules.mavproxy_optitrack',

Whatever we do here - we should ensure the existing wx-based console continues to function. I don't think a magic "switch-over" to this new console is appropriate - MAVProxy's module system should allow both to co-exist for now.

@nikhil-sethi
Copy link
Author

nikhil-sethi commented Mar 14, 2023

Hey @peterbarker
Thanks for reviewing! With regards to qt vs wx, there are some differences that are nice but at the end of the day, it depends if they matter or not:

  1. Signal and slot mechanism allows more flexibility in the widget and reduces code as compared to callbacks
  2. I made the widget in this PR very fast on Qt-designer which can autogenerate UI code as a .py file (pyside-uic). One major advantage this has is that the UI code is well-separated and can be updated via the designer easily.
  3. Qt definitely has much cleaner, clearer documentation and forums.

In the meantime, I'll also ask @khancyr and others on the discord about what they have in mind regarding Qt.
I agree there shouldn't be a switch-over and I was thinking of minimally invasive ways to manage both. Can you recommend something that you might have used in the past?
I'll add the commits for the requirements etc. and push. Cheers!

@peterbarker
Copy link
Contributor

peterbarker commented Mar 15, 2023 via email

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