Skip to content

Commit

Permalink
fix: lsmeas use name instead of channel label
Browse files Browse the repository at this point in the history
When a element is renamed using renameelem the macro
lsmeas still shows the previous name (label) sardana-org#1053.

We propose to adquire and show the name of the
elements of the measurement group from the full name
(i.e: ct1, ct2, sys/tg_test/1/ampli).

closes sardana-org#1053.
  • Loading branch information
catunlock committed Jul 15, 2021
1 parent 0307007 commit d28b661
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 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,19 @@ 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)

#", ".join(o.getChannelAlias())


class lsmac(_lsobj):
Expand Down

0 comments on commit d28b661

Please sign in to comment.