Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

fix: lsmeas use name instead of channel label #1663

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
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
15 changes: 14 additions & 1 deletion src/sardana/macroserver/macros/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"""This is the lists macro module"""


from taurus.core.tango.tangovalidator import TangoAttributeNameValidator
__all__ = ["ls0d", "ls1d", "ls2d", "lsa", "lscom", "lsct", "lsctrl",
"lsctrllib", "lsdef", "lsexp", "lsi", "lsior", "lsm", "lsmeas",
"lsp", "lspc", "lspm", "lsmac", "lsmaclib", "lstg"]
Expand Down Expand Up @@ -270,6 +271,8 @@ class lsmeas(_lsobj):
width = -1, -1, -1, 60
align = HCenter, Right, Right, Left

validator = TangoAttributeNameValidator()

def prepare(self, filter, **opts):
try:
self.mnt_grp = self.getEnv('ActiveMntGrp').lower() or None
Expand All @@ -281,7 +284,17 @@ def obj2Row(self, o):
active = '*'
else:
active = ' '
return active, o.name, o.getTimerName(), ", ".join(o.getChannelLabels())

channels = []
for ch in o.getChannels():
if '_controller_name' in ch:
name = self.getExpChannel(ch['full_name']).name
else:
name = self.validator.getNames(ch['full_name'])[1]

channels.append(name)

return active, o.name, o.getTimerName(), ', '.join(channels)


class lsmac(_lsobj):
Expand Down