Skip to content

Commit

Permalink
ENH: add channelValue prop for multistate widget which mirrors curren…
Browse files Browse the repository at this point in the history
…t value of widget's connected channel
  • Loading branch information
nstelter-slac committed Nov 3, 2023
1 parent fcf3d3b commit 412657e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pydm/widgets/byte.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,28 @@ def paintEvent(self, event: QPaintEvent) -> None:
self._painter.drawEllipse(QPoint(w // 2, h // 2), r, r)
self._painter.end()

# color state setters/getters
@Property(int)
def currentValue(self) -> int:
"""
The color for when widget is in state 0
Returns
-------
int
"""
return self._curr_state

@currentValue.setter
def currentValue(self, new_state: int) -> None:
"""
The color for when widget is in state 0
Parameters
----------
new_color : int
"""
if new_state != self._curr_state:
self._curr_state = new_state

# color state setters/getters
@Property(QColor)
def state0Color(self) -> QColor:
Expand Down

0 comments on commit 412657e

Please sign in to comment.