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]:
76
76
def _make_p4p_raw_value (self ) -> dict :
77
77
p4p_raw_value = defaultdict (dict )
78
78
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 :
81
83
if signal_info .access not in p4p_raw_value [pvi_name ]:
82
84
p4p_raw_value [pvi_name ][signal_info .access ] = {}
83
85
p4p_raw_value [pvi_name ][signal_info .access ][f"v{ number } " ] = (
84
86
signal_info .pv
85
87
)
86
- else :
88
+ elif is_controller :
87
89
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
88
93
89
94
return p4p_raw_value
90
95
Original file line number Diff line number Diff line change @@ -352,14 +352,10 @@ class SomeController(Controller):
352
352
"value" : {
353
353
"additional_child" : {"d" : f"{ pv_prefix } :AdditionalChild:PVI" },
354
354
"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" },
361
357
"a_third_attr" : {"w" : f"{ pv_prefix } :AThirdAttr" },
362
- "attr " : {"rw" : { "v1" : f"{ pv_prefix } :Attr1" } },
358
+ "attr1 " : {"rw" : f"{ pv_prefix } :Attr1" },
363
359
"child" : {
364
360
"d" : {
365
361
"v0" : f"{ pv_prefix } :Child0:PVI" ,
You can’t perform that action at this time.
0 commit comments