Skip to content

Refactor project#40

Merged
EliasJRH merged 9 commits into
mainfrom
eh/refactor-widget
Nov 23, 2024
Merged

Refactor project#40
EliasJRH merged 9 commits into
mainfrom
eh/refactor-widget

Conversation

@EliasJRH

Copy link
Copy Markdown
Member

Closes #39

This PR refactors basically the entire project structure into something more organized. The first thing that was done was renaming widget.py to main_window.py as it's the main widget in the application. All code related to the main_window was then move into a separate directory. main.py is not the entrypoint of the application and all it does in create an instance of MainWindow and show it.

Files related to the user interface, those being form.ui and resources.qrc were moved into main_window/ui. Going forward all generated code from these files must be created in this directory as well. There are a few ways this can be done.

In QT Designer, add two custom build steps (one for UI and one for resources file) in the project build steps tab
image
Note that the command and working directory fields for each should be replaced in respect to you're working directory.

As part of this PR and build.py script will be provided that be run whenever making modifications to the UI which should correctly recompile the files

Finally, most of the logic within main_window.py was refactored. Specifically:

  • All code and button handlers related to UDP stuff was moved to udp.py
  • Code related to recording and play back of data was moved to recording_and_playback.py
  • Code related to plotting points/updating labels was moved to data_handlers.py
  • Code related to the logOut was moved to logging.py

These files are imported within the MainWindow class, effectively breaking the class up into manageable files.

@EliasJRH
EliasJRH marked this pull request as draft November 22, 2024 23:19
@EliasJRH
EliasJRH marked this pull request as ready for review November 23, 2024 02:34
@EliasJRH EliasJRH changed the title Refactor widget class Refactor project Nov 23, 2024
@EliasJRH
EliasJRH merged commit 9c63bdb into main Nov 23, 2024
@EliasJRH
EliasJRH deleted the eh/refactor-widget branch November 23, 2024 02:35
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.

Refactor widget class functions to separate files

1 participant