@@ -172,22 +172,26 @@ async def async_record_set(value: T):
172172
173173
174174def _get_input_record (pv : str , attribute : AttrR ) -> RecordWrapper :
175+ attribute_fields = {}
176+ if attribute .description is not None :
177+ attribute_fields .update ({"DESC" : attribute .description })
178+
175179 if attr_is_enum (attribute ):
176180 assert attribute .allowed_values is not None and all (
177181 isinstance (v , str ) for v in attribute .allowed_values
178182 )
179183 state_keys = dict (zip (MBB_STATE_FIELDS , attribute .allowed_values , strict = False ))
180- return builder .mbbIn (pv , ** state_keys )
184+ return builder .mbbIn (pv , ** state_keys , ** attribute_fields )
181185
182186 match attribute .datatype :
183187 case Bool (znam , onam ):
184- return builder .boolIn (pv , ZNAM = znam , ONAM = onam )
188+ return builder .boolIn (pv , ZNAM = znam , ONAM = onam , ** attribute_fields )
185189 case Int ():
186- return builder .longIn (pv )
190+ return builder .longIn (pv , ** attribute_fields )
187191 case Float (prec ):
188- return builder .aIn (pv , PREC = prec )
192+ return builder .aIn (pv , PREC = prec , ** attribute_fields )
189193 case String ():
190- return builder .longStringIn (pv )
194+ return builder .longStringIn (pv , ** attribute_fields )
191195 case _:
192196 raise FastCSException (
193197 f"Unsupported type { type (attribute .datatype )} : { attribute .datatype } "
@@ -224,12 +228,15 @@ async def async_write_display(value: T):
224228
225229
226230def _get_output_record (pv : str , attribute : AttrW , on_update : Callable ) -> Any :
231+ attribute_fields = {}
232+ if attribute .description is not None :
233+ attribute_fields .update ({"DESC" : attribute .description })
227234 if attr_is_enum (attribute ):
228235 assert attribute .allowed_values is not None and all (
229236 isinstance (v , str ) for v in attribute .allowed_values
230237 )
231238 state_keys = dict (zip (MBB_STATE_FIELDS , attribute .allowed_values , strict = False ))
232- return builder .mbbOut (pv , always_update = True , on_update = on_update , ** state_keys )
239+ return builder .mbbOut (pv , always_update = True , on_update = on_update , ** state_keys , ** attribute_fields )
233240
234241 match attribute .datatype :
235242 case Bool (znam , onam ):
@@ -241,11 +248,11 @@ def _get_output_record(pv: str, attribute: AttrW, on_update: Callable) -> Any:
241248 on_update = on_update ,
242249 )
243250 case Int ():
244- return builder .longOut (pv , always_update = True , on_update = on_update )
251+ return builder .longOut (pv , always_update = True , on_update = on_update , ** attribute_fields )
245252 case Float (prec ):
246- return builder .aOut (pv , always_update = True , on_update = on_update , PREC = prec )
253+ return builder .aOut (pv , always_update = True , on_update = on_update , PREC = prec , ** attribute_fields )
247254 case String ():
248- return builder .longStringOut (pv , always_update = True , on_update = on_update )
255+ return builder .longStringOut (pv , always_update = True , on_update = on_update , ** attribute_fields )
249256 case _:
250257 raise FastCSException (
251258 f"Unsupported type { type (attribute .datatype )} : { attribute .datatype } "
0 commit comments