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

Manual device management dialog #413

Merged
merged 18 commits into from
Nov 21, 2023
Merged

Manual device management dialog #413

merged 18 commits into from
Nov 21, 2023

Conversation

alexdewar
Copy link
Collaborator

@alexdewar alexdewar commented Nov 14, 2023

This PR moves the panel used for opening/closing connections to devices into a separate dialog (#395) and fixes a small associated bug (#397). This makes the main window less cluttered (see #405) and also means that we no longer have to load all plugins unless the user is using the manual device management dialog. Otherwise, the plugins will just be loaded as needed.

As this is (probably) the end of my tinkering with the DeviceControl class, I've added tests for it (#398). The coverage for the hardware_sets module is at 100% which takes us to 80% coverage overall 🥳

Closes #395. Closes #397. Closes #398. Closes #405.

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (34a4a78) 74.92% compared to head (8387c0d) 78.87%.

Files Patch % Lines
finesse/gui/main_window.py 0.00% 3 Missing ⚠️
finesse/hardware/manage_devices.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #413      +/-   ##
==========================================
+ Coverage   74.92%   78.87%   +3.95%     
==========================================
  Files          56       56              
  Lines        2839     2874      +35     
==========================================
+ Hits         2127     2267     +140     
+ Misses        712      607     -105     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alexdewar alexdewar force-pushed the manual_device_config_dialog branch from a2d2d8c to 7894715 Compare November 14, 2023 13:48
@alexdewar alexdewar marked this pull request as ready for review November 14, 2023 13:53
Copy link
Contributor

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

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

It looks good! Anything that declutters the main window is a step in the right direction. This looks a bit odd, though, and I'm not sure if its behaviour is the expected one.

The following screenshot is FINESSE just after opening it:
image

Note the odd dangling POLL Server light in the EM27 Monitor, with nothing else in that area. Then, I connect the (dummy) EM27 monitor in the brand new dialog, and I get a bunch of readings, displacing shuffling a bit the layout (specially the log, which get's squeeze):

image

Finally, I close the EM27 monitor in the dialog. The sensor readings remain, but greyed out.

image

Is this behaviour intentional? To be honest, I'm not entirely sure what I was expecting, but maybe some sort of symmetric behavior when connecting/disconnecting, the POLL light flushed to the bottom of the area and a more... maybe "rigid" layout, so adding/removing widgets do not upset the GUI?

As I say, I'm not sure what I was expecting and therefore I cannot advise what to change.

@alexdewar
Copy link
Collaborator Author

@dalonsoa It's less that it was intentional and more that that's just how it's ended up 😛.

I think there are three related problems here:

  1. There are too many controls on the right cf. the left (maybe the data file controls could be moved to the left?)
  2. The EM27 sensor panel has the issues that you mention. They've only really become apparent since I made it so that you have to connect to the EM27 sensors explicitly (Make EM27 sensors module into plugin #375). Maybe the poll light should also be invisible while the control is disabled?
  3. The OPUS panel also needs reorganising. The log isn't particularly useful so the whole panel could just consistent of buttons, maybe with a much smaller control displaying the current status (GUI should show EM27 status in more user-friendly form #396)

See also: #405

How about I open separate issues for these and tackle them later?

@dalonsoa
Copy link
Contributor

That's totally fine with me :)

@alexdewar
Copy link
Collaborator Author

We could also add to the list: 4. The temperature plot on the right is too big

@dc2917
Copy link
Contributor

dc2917 commented Nov 17, 2023

Trying to position the POLL Server indicator & label sensibly was an absolute pain - it's definitely not positioned as intended! It bugs me every time I open the window but yeah, from what I recall it's not straightforward to fix.

@dalonsoa dalonsoa self-requested a review November 21, 2023 09:21
Copy link
Contributor

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

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

It looks good - nice collection of tests! I just have a minor comment you can ignore.

Having said that, the comments I made before on the layout persist. Did you mention you were going to open an issue about beautifying this?

class DeviceTypeControl(QGroupBox):
"""A set of widgets for choosing a device and its params and connecting to it."""

def __init__(
Copy link
Contributor

Choose a reason for hiding this comment

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

This constructor is quite long. It might make sense to break it down into smaller chunks, roughly matching your commented sections.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. As I've since modified this code on newer branches, I'll open an issue for it and fix it later.

@alexdewar
Copy link
Collaborator Author

Thanks for the review 😄. I've opened two more issues about the GUI's appearance: #419 and #420

Copy link
Contributor

@dc2917 dc2917 left a comment

Choose a reason for hiding this comment

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

Looks good to me, seems to work correctly from a bit of a play-around.

@alexdewar alexdewar enabled auto-merge November 21, 2023 12:26
@alexdewar alexdewar force-pushed the manual_device_config_dialog branch from f1d5a9c to 8387c0d Compare November 21, 2023 12:29
@alexdewar alexdewar merged commit cc9f81c into main Nov 21, 2023
14 checks passed
@alexdewar alexdewar deleted the manual_device_config_dialog branch November 21, 2023 12:37
alexdewar added a commit that referenced this pull request Apr 17, 2024
…ig_dialog

Manual device management dialog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants