File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
src/fastcs/transport/epics/pva
tests/transport/epics/pva Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -76,15 +76,20 @@ def _get_signal_infos(self) -> dict[str, _PviSignalInfo]:
7676 def _make_p4p_raw_value (self ) -> dict :
7777 p4p_raw_value = defaultdict (dict )
7878 for pv_leaf , signal_info in self ._get_signal_infos ().items ():
79- pvi_name , number = _pv_to_pvi_name (pv_leaf .rstrip (":PVI" ) or pv_leaf )
80- if number is not None :
79+ stripped_leaf = pv_leaf .rstrip (":PVI" )
80+ is_controller = stripped_leaf != pv_leaf
81+ pvi_name , number = _pv_to_pvi_name (stripped_leaf or pv_leaf )
82+ if is_controller and number is not None :
8183 if signal_info .access not in p4p_raw_value [pvi_name ]:
8284 p4p_raw_value [pvi_name ][signal_info .access ] = {}
8385 p4p_raw_value [pvi_name ][signal_info .access ][f"v{ number } " ] = (
8486 signal_info .pv
8587 )
86- else :
88+ elif is_controller :
8789 p4p_raw_value [pvi_name ][signal_info .access ] = signal_info .pv
90+ else :
91+ attr_pvi_name = f"{ pvi_name } { '' if number is None else number } "
92+ p4p_raw_value [attr_pvi_name ][signal_info .access ] = signal_info .pv
8893
8994 return p4p_raw_value
9095
Original file line number Diff line number Diff line change @@ -352,14 +352,10 @@ class SomeController(Controller):
352352 "value" : {
353353 "additional_child" : {"d" : f"{ pv_prefix } :AdditionalChild:PVI" },
354354 "another_child" : {"d" : f"{ pv_prefix } :AnotherChild:PVI" },
355- "another_attr" : {
356- "rw" : {
357- "v0" : f"{ pv_prefix } :AnotherAttr0" ,
358- "v1000" : f"{ pv_prefix } :AnotherAttr1000" ,
359- }
360- },
355+ "another_attr0" : {"rw" : f"{ pv_prefix } :AnotherAttr0" },
356+ "another_attr1000" : {"rw" : f"{ pv_prefix } :AnotherAttr1000" },
361357 "a_third_attr" : {"w" : f"{ pv_prefix } :AThirdAttr" },
362- "attr " : {"rw" : { "v1" : f"{ pv_prefix } :Attr1" } },
358+ "attr1 " : {"rw" : f"{ pv_prefix } :Attr1" },
363359 "child" : {
364360 "d" : {
365361 "v0" : f"{ pv_prefix } :Child0:PVI" ,
You can’t perform that action at this time.
0 commit comments