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

Basic version of multi-state LED indicator widget #1044

Merged
merged 9 commits into from
Dec 12, 2023

Conversation

nstelter-slac
Copy link
Collaborator

@nstelter-slac nstelter-slac commented Oct 24, 2023

Add basic version of widget.

could expand out later with:
-submenu for easier selection of state colors
-options for rendering different shapes/visual
-accepting >1 PVs
-allow configurable # states besides just 16

@nstelter-slac nstelter-slac changed the title multistate widget Basic version of multistate widget Oct 24, 2023
@nstelter-slac nstelter-slac changed the title Basic version of multistate widget Basic version of multi-state LED indicator widget Oct 24, 2023
@nstelter-slac nstelter-slac marked this pull request as ready for review October 24, 2023 20:14
@nstelter-slac nstelter-slac linked an issue Oct 24, 2023 that may be closed by this pull request
@YektaY
Copy link
Collaborator

YektaY commented Oct 24, 2023

I think since this is a new widget, it will be need to be included in the documentation


# color state setters/getters
@Property(QColor)
def state0Color(self) -> QColor:
Copy link
Collaborator

Choose a reason for hiding this comment

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

A random thought, for your consideration...

Seeing this sort of stuff makes me wonder if having a channelValue Qt property that mirrors the current value of the channel might be something to explore.

I mention that because you can use Qt stylesheets / qss to have property selectors and change any bit of styling as you please, rather than just being limited to color (even if that is technically sufficient for what's being asked here).
So you could imagine:

PyDMMultiStateIndicator[currentValue="1"] #something {
    qproperty-penColor: black;
    qproperty-setsomething: foobar;
}

We use this method in our vacuum screen widgets, by the way (ref)

Copy link
Collaborator

@jbellister-slac jbellister-slac 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, works as expected, controllable via designer, code, and stylesheet

@jbellister-slac jbellister-slac merged commit ed63318 into slaclab:master Dec 12, 2023
13 checks passed
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.

ENH: Add multi-state LED indicator widget
4 participants