From 709a5852de79e0395fbeff3a72c4a0c2726f507c Mon Sep 17 00:00:00 2001 From: Abdullah Date: Mon, 14 Jun 2021 17:03:10 +0200 Subject: [PATCH] added state to list macros --- src/sardana/macroserver/macros/lists.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/sardana/macroserver/macros/lists.py b/src/sardana/macroserver/macros/lists.py index a3f2cd886..ea29a334d 100644 --- a/src/sardana/macroserver/macros/lists.py +++ b/src/sardana/macroserver/macros/lists.py @@ -110,9 +110,9 @@ class _lsobj(_ls): subtype = Macro.All - cols = 'Name', 'Type', 'Controller', 'Axis' # , 'State' - width = -1, -1, -1, -1 # , -1 - align = Right, Right, Right, Right # , Right + cols = 'Name', 'State', 'Type', 'Controller', 'Axis' + width = -1, -1, -1, -1, -1 + align = Right, Right, Right, Right, Right show_overwritten_msg = False @@ -133,6 +133,8 @@ def obj2Row(self, o, cols=None): value = "[*] " + value if self.show_overwritten_msg is False: self.show_overwritten_msg = True + elif col == 'state': + value = o.stateObj.read().rvalue.name else: value = getattr(o, col) if value is None: @@ -266,9 +268,9 @@ class lsmeas(_lsobj): type = Type.MeasurementGroup - cols = 'Active', 'Name', 'Timer', 'Experim. channels' - width = -1, -1, -1, 60 - align = HCenter, Right, Right, Left + cols = 'Active', 'Name', 'State', 'Timer', 'Experim. channels' + width = -1, -1, -1, -1, 60 + align = HCenter, Right, Right, Right, Left def prepare(self, filter, **opts): try: @@ -281,7 +283,10 @@ def obj2Row(self, o): active = '*' else: active = ' ' - return active, o.name, o.getTimerName(), ", ".join(o.getChannelLabels()) + state = o.stateObj.read().rvalue.name + timer = o.getTimerName() + channels = ", ".join(o.getChannelLabels()) + return active, o.name, state, timer, channels class lsmac(_lsobj):