Skip to content

Commit a0944fb

Browse files
committed
Update to pvi 0.7.1
There are ongoing breaking changes to pvi, so pin to minor version. Bugfix version bumps are OK.
1 parent 1ae295a commit a0944fb

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description = "Control system agnostic framework for building Device support in
1414
dependencies = [
1515
"numpy",
1616
"pydantic",
17-
"pvi",
17+
"pvi~=0.7.1",
1818
"softioc",
1919
] # Add project dependencies here, e.g. ["click", "numpy"]
2020
dynamic = ["version"]

src/fastcs/backends/epics/gui.py

+17-11
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,32 @@ def _get_write_widget(datatype: DataType) -> WriteWidget:
8282
@classmethod
8383
def _get_attribute_component(cls, attr_path: str, name: str, attribute: Attribute):
8484
pv = cls._get_pv(attr_path, name)
85-
name = name.title().replace("_", " ")
85+
name = name.title().replace("_", "")
8686

8787
match attribute:
8888
case AttrRW():
8989
read_widget = cls._get_read_widget(attribute.datatype)
9090
write_widget = cls._get_write_widget(attribute.datatype)
91-
return SignalRW(name, pv, write_widget, pv + "_RBV", read_widget)
91+
return SignalRW(
92+
name=name,
93+
pv=pv,
94+
widget=write_widget,
95+
read_pv=pv + "_RBV",
96+
read_widget=read_widget,
97+
)
9298
case AttrR():
9399
read_widget = cls._get_read_widget(attribute.datatype)
94-
return SignalR(name, pv, read_widget)
100+
return SignalR(name=name, pv=pv, widget=read_widget)
95101
case AttrW():
96102
write_widget = cls._get_write_widget(attribute.datatype)
97-
return SignalW(name, pv, TextWrite())
103+
return SignalW(name=name, pv=pv, widget=TextWrite())
98104

99105
@classmethod
100106
def _get_command_component(cls, attr_path: str, name: str):
101107
pv = cls._get_pv(attr_path, name)
102-
name = name.title().replace("_", " ")
108+
name = name.title().replace("_", "")
103109

104-
return SignalX(name, pv, value=1)
110+
return SignalX(name=name, pv=pv, value="1")
105111

106112
def create_gui(self, options: EpicsGUIOptions | None = None) -> None:
107113
if options is None:
@@ -122,13 +128,13 @@ def create_gui(self, options: EpicsGUIOptions | None = None) -> None:
122128
for sub_controller_mapping in sub_controller_mappings:
123129
components.append(
124130
Group(
125-
sub_controller_mapping.controller.path,
126-
SubScreen(),
127-
self.extract_mapping_components(sub_controller_mapping),
131+
name=sub_controller_mapping.controller.path,
132+
layout=SubScreen(),
133+
children=self.extract_mapping_components(sub_controller_mapping),
128134
)
129135
)
130136

131-
device = Device("Simple Device", children=components)
137+
device = Device(label="Simple Device", children=components)
132138

133139
formatter.format(device, "MY-DEVICE-PREFIX", options.output_path)
134140

@@ -166,6 +172,6 @@ def extract_mapping_components(self, mapping: SingleMapping) -> list[Component]:
166172
components.append(signal)
167173

168174
for name, children in groups.items():
169-
components.append(Group(name, Grid(), children))
175+
components.append(Group(name=name, layout=Grid(), children=children))
170176

171177
return components

0 commit comments

Comments
 (0)