@@ -82,26 +82,32 @@ def _get_write_widget(datatype: DataType) -> WriteWidget:
82
82
@classmethod
83
83
def _get_attribute_component (cls , attr_path : str , name : str , attribute : Attribute ):
84
84
pv = cls ._get_pv (attr_path , name )
85
- name = name .title ().replace ("_" , " " )
85
+ name = name .title ().replace ("_" , "" )
86
86
87
87
match attribute :
88
88
case AttrRW ():
89
89
read_widget = cls ._get_read_widget (attribute .datatype )
90
90
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
+ )
92
98
case AttrR ():
93
99
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 )
95
101
case AttrW ():
96
102
write_widget = cls ._get_write_widget (attribute .datatype )
97
- return SignalW (name , pv , TextWrite ())
103
+ return SignalW (name = name , pv = pv , widget = TextWrite ())
98
104
99
105
@classmethod
100
106
def _get_command_component (cls , attr_path : str , name : str ):
101
107
pv = cls ._get_pv (attr_path , name )
102
- name = name .title ().replace ("_" , " " )
108
+ name = name .title ().replace ("_" , "" )
103
109
104
- return SignalX (name , pv , value = 1 )
110
+ return SignalX (name = name , pv = pv , value = "1" )
105
111
106
112
def create_gui (self , options : EpicsGUIOptions | None = None ) -> None :
107
113
if options is None :
@@ -122,13 +128,13 @@ def create_gui(self, options: EpicsGUIOptions | None = None) -> None:
122
128
for sub_controller_mapping in sub_controller_mappings :
123
129
components .append (
124
130
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 ),
128
134
)
129
135
)
130
136
131
- device = Device ("Simple Device" , children = components )
137
+ device = Device (label = "Simple Device" , children = components )
132
138
133
139
formatter .format (device , "MY-DEVICE-PREFIX" , options .output_path )
134
140
@@ -166,6 +172,6 @@ def extract_mapping_components(self, mapping: SingleMapping) -> list[Component]:
166
172
components .append (signal )
167
173
168
174
for name , children in groups .items ():
169
- components .append (Group (name , Grid (), children ))
175
+ components .append (Group (name = name , layout = Grid (), children = children ))
170
176
171
177
return components
0 commit comments