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

Added state print to list macros (lsm, lsmeas etc.) #1612

Open
wants to merge 1 commit 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
19 changes: 12 additions & 7 deletions src/sardana/macroserver/macros/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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):
Expand Down