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

ENH: layout changes for compact complex screens + row positioner widget #563

Merged
merged 41 commits into from
Sep 1, 2023

Conversation

klauer
Copy link
Contributor

@klauer klauer commented Aug 5, 2023

Description

  • Add 'single line positioner' variant
  • Tweaked the logic for "should we show a 'detailed tree' at each device layer", now taking into account whether or not the tree is nested (i.e., is it a top-level device?)
  • Tweaked some other layout things while attempting to squeeze in the space a bit more
  • Other things probably too
  • (TODO) Devices snuck their way in here but those need to be removed. Solely for testing purposes.
  • "Notes" feature needs to be re-added for positioners

Tweaks to the layout of the row positioner widget by @ZLLentz :

  • Shorter text in positioner row alarm label
  • Status container always visible
  • Dynamic showing/hiding of status info
  • Infinite arrangement/sizing/size policy nitpicking
  • Drop the concept of the whole widget getting a colored border during/after moves
  • No alarm borders inside the widget
  • Add some more accurate placeholder templates for twincat states things
  • Remove typhos stylesheet for the error pydm label widget

TODO

  • Zach will modify layout
  • Later: decide as to if there should be a new row category for templates? Aspect ratio buckets for templates?
  • Get feedback from ECS, then scientists, ...
  • Remove device UI files from this repo and move them to pcdsdevices prior to merging

Motivation and Context

Request was "always show the embedded screen!" (#532)
That unfortunately does not render well if you take it literally. I'm of the opinion that it shouldn't be taken literally and we should explore options like this one.

Oh, turns out there was an actual issue for this: closes #543
I must have read it and forgotten about it. The single row display for motors was what we used by default back at NSLS-II with CSS, so this was something I always wanted to see in typhos and only recently found the inspiration for.

How Has This Been Tested?

Minimally, with at2l0 and multi motor example

import ophyd
from ophyd import Component, Device, EpicsMotor, EpicsSignal
from qtpy import QtCore, QtWidgets

from typhos.suite import TyphosSuite

app = QtWidgets.QApplication([])

class MyMotors(ophyd.Device):
    m1 = Component(EpicsMotor, "AT2L0:XTES:MMS:01")
    m2 = Component(EpicsMotor, "AT2L0:XTES:MMS:02")
    m3 = Component(EpicsMotor, "AT2L0:XTES:MMS:03")
    m4 = Component(EpicsMotor, "AT2L0:XTES:MMS:04")
    m5 = Component(EpicsMotor, "AT2L0:XTES:MMS:05")
    m6 = Component(EpicsMotor, "AT2L0:XTES:MMS:06")
    m7 = Component(EpicsMotor, "AT2L0:XTES:MMS:07")
    m8 = Component(EpicsMotor, "AT2L0:XTES:MMS:08")
    m9 = Component(EpicsMotor, "AT2L0:XTES:MMS:09")
    m9 = Component(EpicsMotor, "AT2L0:XTES:MMS:09")
    m10 = Component(EpicsMotor, "AT2L0:XTES:MMS:10")
    m11 = Component(EpicsMotor, "AT2L0:XTES:MMS:11")
    m12 = Component(EpicsMotor, "AT2L0:XTES:MMS:12")
    m13 = Component(EpicsMotor, "AT2L0:XTES:MMS:13")
    m14 = Component(EpicsMotor, "AT2L0:XTES:MMS:14")
    m15 = Component(EpicsMotor, "AT2L0:XTES:MMS:15")
    m16 = Component(EpicsMotor, "AT2L0:XTES:MMS:16")
    m17 = Component(EpicsMotor, "AT2L0:XTES:MMS:17")
    m18 = Component(EpicsMotor, "AT2L0:XTES:MMS:18")
    m19 = Component(EpicsMotor, "AT2L0:XTES:MMS:19")


device = MyMotors(name="device")
suite = TyphosSuite.from_device(device)
suite.show()
app.exec_()

Where Has This Been Documented?

Screenshots (if appropriate):

Latest screenshot with first-pass adjustments from Zach and now the new notes:
image

Previous screenshot(s) from WIP

image

image

image

image

image

Click here for typhos master screenshot for comparison (ew!):

image

at2l0:
image

It'd be nice to regain a bit more vertical space - but in any case, we still have drastically improved over the master branch version in that regard

@ZLLentz
Copy link
Member

ZLLentz commented Aug 7, 2023

The concept here is solid

There's some friction with the templates in https://github.com/pcdshub/pcdsdevices/tree/master/pcdsdevices/ui which might need a simultaneous PR, for feeling-good-about-packaging reasons we've kept typhos to only having templates that match up with ophyd built-ins

I think the layouts themselves are infinitely nitpick-able, I'd like to sit down together and nitpick maximally and agree on a final layout. It's worth comparing notes with https://github.com/pcdshub/ecs-pydm-ui/blob/master/widgets/positioner_row.ui

@klauer
Copy link
Contributor Author

klauer commented Aug 8, 2023

There's some friction with the templates in https://github.com/pcdshub/pcdsdevices/tree/master/pcdsdevices/ui which might need a simultaneous PR, for feeling-good-about-packaging reasons we've kept typhos to only having templates that match up with ophyd built-ins

Yeah, 100% agreed
Buried in the PR description is "Devices snuck their way in here but those need to be removed. Solely for testing purposes."

I think the layouts themselves are infinitely nitpick-able, I'd like to sit down together and nitpick maximally and agree on a final layout.

Definitely - let's set up a meeting so we're all happy with this and then we can talk about how to move forward

It's worth comparing notes with https://github.com/pcdshub/ecs-pydm-ui/blob/master/widgets/positioner_row.ui

Ah, I wasn't aware of this one. Maybe that should be taken as a starting point instead of what I have here.

@klauer klauer changed the title WIP/POC: positioner which uses horizontal space - a "one line positioner" WIP/POC: positioner which uses horizontal space - a "positioner row" widget Aug 8, 2023
@klauer
Copy link
Contributor Author

klauer commented Aug 8, 2023

I think I'll need to pull out the screenshot feature into a separate PR so we can effectively diff this row positioner vs the standard one

@klauer
Copy link
Contributor Author

klauer commented Aug 9, 2023

(Rebased on #566 ; may do that again post-review/merge)

@klauer klauer changed the title WIP/POC: positioner which uses horizontal space - a "positioner row" widget ENH: layout changes for compact complex screens + row positioner widget Aug 15, 2023
@klauer
Copy link
Contributor Author

klauer commented Aug 15, 2023

(The tests are broken because this PR temporarily changes internal templates. Those will be removed before this is marked as ready for review)

In the meantime, I'm passing this over to @ZLLentz as he has some tweaks to do on the row positioner widget

Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

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

I only saw one edge case bug, I'm pretty happy with how these look
Pushed a small commit to address Robert's screenshot

Copy link
Member

Choose a reason for hiding this comment

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

This is the biggest pre-rel I've ever seen

Comment on lines +890 to +893
panel = TyphosSignalPanel()
panel.omitNames = self.get_names_to_omit()
panel.sortBy = SignalOrder.byName
panel.add_device(self.device)
Copy link
Member

Choose a reason for hiding this comment

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

missing is here is filtering the new signal panel by the kinds specified in the menu above

interactively right now, if you deselect e.g. config or add omitted it only applies to existing signal panels

Copy link
Contributor Author

@klauer klauer Aug 29, 2023

Choose a reason for hiding this comment

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

Good catch - that needs addressing

Edit: hmm, this should be finding the signal panels: https://github.com/klauer/typhos/blob/45c6e5cc546674a1285886ddc7d7c54526304753/typhos/display.py#L373
Needs further investigating - perhaps in a follow-up PR?

Copy link
Member

Choose a reason for hiding this comment

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

In more words: the filters work, but they only apply to positioner rows that have already been expanded at least once, because otherwise the signal panel has never been created

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll copy my original comment now that I fully understand - "good catch - that needs addressing!" 😁

I think the linked code will have to be modified to tell the positioner widget (when it's ready) how to create the signal panel with the appropriate kind settings

Copy link
Member

Choose a reason for hiding this comment

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

fwiw I think this is a small thing and could be ignored and doubled-back on later
the main drawback of the status quo is that all the omitted signals appear for the first expansion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tangkong
Copy link
Contributor

This LGTM. The additional items mentioned make sense as follow up issues / PRs. I'm ready with my green stamp whenever.

Did we want to solicit more scientist/PoC feedback first? I'm relatively sure this will be well received, but maybe I'm out of touch

@klauer
Copy link
Contributor Author

klauer commented Aug 31, 2023

This LGTM. The additional items mentioned make sense as follow up issues / PRs. I'm ready with my green stamp whenever.

Zach has noted he's positive on this, so:

  • I'll do a couple fix-ups that are really required (removing device templates from this PR)
  • Then we merge
  • Then I'll open a pcdsdevices PR with changes for using these new templates
  • And maybe I'll address some of the concerns above as well in separate typhos PRs (for Zach/your approval)

Did we want to solicit more scientist/PoC feedback first? I'm relatively sure this will be well received, but maybe I'm out of touch

I think the best kind of feedback we can get is from them actually using the screens rather than nitpicking a screenshot. At least that's the quickest path to making everyone happi(er) with less effort - or so I think

@klauer
Copy link
Contributor Author

klauer commented Sep 1, 2023

OK, I made a bunch of issues. Feel free to add more context to those or rephrase them as desired @ZLLentz @tangkong

I'm going to merge this and update the other in-progress PRs

One step closer!

@klauer klauer merged commit 249468c into pcdshub:master Sep 1, 2023
7 of 9 checks passed
@klauer klauer deleted the enh_oneline_positioner branch September 1, 2023 17:44
@ZLLentz
Copy link
Member

ZLLentz commented Sep 6, 2023

@klauer should I proceed to update the pcdsdevices templates tomorrow?

@vespos
Copy link

vespos commented Sep 10, 2023

Did we test the layout on controls rooms machines to make sure it's not broken there?

@tangkong
Copy link
Contributor

I've tested on control room machines remotely (via ssh), but not in person. I assume the latter is what you are concerned about?

@ZLLentz
Copy link
Member

ZLLentz commented Sep 12, 2023

I did test this in TMO, anticipating issues, and made further changes to the template based on that testing.
It's worth testing again anyway.

@vespos
Copy link

vespos commented Sep 12, 2023

Yes exactly, I've had issues with my pydm screens where they did not look as intended on the CR machines.
I'll test it at xpp as well, using the code snippet in the PR description

@ZLLentz
Copy link
Member

ZLLentz commented Sep 12, 2023

Yeah, it's pretty annoying dealing with these sorts of scaling issues. We can either define fonts in terms of point-sizes, in which case they'll be readable on high-dpi displays at the risk of clipping, or we can define them in terms of pixel-sizes, in which case they'll often be hard to read on high-dpi displays but won't clip. A comprehensive solution isn't built into qt and so we find ourselves testing and retesting these (or not testing and then having bad displays)

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.

Add smaller positioner widget (row?)
4 participants