@@ -28,7 +28,10 @@ class EpicsIOCOptions:
2828
2929
3030class EpicsIOC :
31- def __init__ (self , pv_prefix : str , mapping : Mapping ):
31+ def __init__ (
32+ self , pv_prefix : str , mapping : Mapping , options : EpicsIOCOptions | None = None
33+ ):
34+ self .options = options or EpicsIOCOptions ()
3235 _add_pvi_info (f"{ pv_prefix } :PVI" )
3336 _add_sub_controller_pvi_info (pv_prefix , mapping .controller )
3437
@@ -39,15 +42,12 @@ def run(
3942 self ,
4043 dispatcher : AsyncioDispatcher ,
4144 context : dict [str , Any ],
42- options : EpicsIOCOptions | None = None ,
4345 ) -> None :
44- if options is None :
45- options = EpicsIOCOptions ()
46-
4746 builder .LoadDatabase ()
4847 softioc .iocInit (dispatcher )
4948
50- softioc .interactive_ioc (context )
49+ if self .options .terminal :
50+ softioc .interactive_ioc (context )
5151
5252
5353def _add_pvi_info (
@@ -218,6 +218,7 @@ async def async_write_display(value: T):
218218 record = _get_output_record (
219219 f"{ pv_prefix } :{ pv_name } " , attribute , on_update = on_update
220220 )
221+
221222 _add_attr_pvi_info (record , pv_prefix , attr_name , "w" )
222223
223224 attribute .set_write_display_callback (async_write_display )
0 commit comments