Skip to content

Commit

Permalink
Cleaned up after merge and fixed button panel requiring a write_widget
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Feb 19, 2024
1 parent 187d910 commit 79bb0ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
17 changes: 12 additions & 5 deletions schemas/pvi.device.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
"title": "Labels",
"type": "array"
},
"number_of_bits": {
"default": 8,
"description": "Number of bits to display",
"exclusiveMinimum": 0,
"title": "Number Of Bits",
"type": "integer"
},
"type": {
"const": "BitField",
"default": "BitField",
Expand Down Expand Up @@ -339,11 +346,6 @@
"additionalProperties": false,
"description": "Progress bar from lower to upper limit of a float PV",
"properties": {
"type": {
"const": "ProgressBar",
"default": "ProgressBar",
"title": "Type"
},
"use_pv_limits": {
"default": false,
"description": "Use PV limits, if True then maximum and minumum are ignored",
Expand All @@ -363,6 +365,11 @@
"exclusiveMinimum": 0.0,
"title": "Maximum",
"type": "number"
},
"type": {
"const": "ProgressBar",
"default": "ProgressBar",
"title": "Type"
}
},
"title": "ProgressBar",
Expand Down
2 changes: 1 addition & 1 deletion src/pvi/_format/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def generate_component_formatters(
for action, value in c.write_widget.actions.items()
]
# If this is a SignalRW, recreate the readback with a SignalR
if isinstance(c, SignalRW):
if isinstance(c, SignalRW) and c.read_widget is not None:
row_components += [
SignalR(name=c.name, read_pv=c.read_pv, read_widget=c.read_widget)
]
Expand Down
3 changes: 0 additions & 3 deletions src/pvi/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class BitField(ReadWidget):
class ProgressBar(ReadWidget):
"""Progress bar from lower to upper limit of a float PV"""

type: Literal["ProgressBar"] = "ProgressBar"
use_pv_limits: bool = Field(
default=False,
description="Use PV limits, if True then maximum and minumum are ignored",
Expand Down Expand Up @@ -167,8 +166,6 @@ class ButtonPanel(WriteWidget):
"""

type: Literal["ButtonPanel"] = "ButtonPanel"

actions: Dict[str, str] = Field(default={"Go": "1"}, description="PV poker buttons")


Expand Down
2 changes: 1 addition & 1 deletion tests/format/output/pva_table.bob
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<display version="2.0.0">
<name>Display</name>
<x>0</x>
<y>0</y>
<y use_class="true">0</y>
<width>226</width>
<height>234</height>
<grid_step_x>4</grid_step_x>
Expand Down

0 comments on commit 79bb0ba

Please sign in to comment.