Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RF PVs' position on configuration tree #714

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pyqt-apps/siriushla/widgets/pvnames_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,26 @@ def _add_item(self, item):
# parent.addChild(new_item)
parent = new_item
parent_key = item_key
elif pvname.startswith('RA'):
sec = 'BO' if pvname.startswith('RA-RaBO') else 'SI'
dic_ = {'sec': sec, 'dis': 'RF', 'dev': 'LLRF'}
for p in self._pnames:
key = dic_.get(p, 'LLRF')
if key:
item_key = parent_key + key
# item = self._item_map.symbol(item_key)
item = self._item_map[item_key] \
if item_key in self._item_map else None
if item is not None:
parent = item
else:
new_item = QTreeItem([key], parent)
new_item.setCheckState(0, Qt.Unchecked)
# self._item_map.add_symbol(item_key, new_item)
self._item_map[item_key] = new_item
# parent.addChild(new_item)
parent = new_item
parent_key = item_key
elif isinstance(pvname, SiriusPVName):
# Parse it with SiriusPVName
pvname = SiriusPVName(pvname)
Expand Down
Loading