-
Notifications
You must be signed in to change notification settings - Fork 52
list of Channel names in active Measurement Group #1688
Comments
Hi @kklmn, The All the following ways work for me: from pprint import pprint
from taurus import Device
from sardana.taurus.core.tango.sardana import registerExtensions
registerExtensions()
door = Device("door/zreszela/1")
exp_conf = door.getExperimentConfiguration()
pprint(exp_conf)
mnt_grp = Device(exp_conf["ActiveMntGrp"])
# this contains all channels' configuration parameters
channels = mnt_grp.getChannels()
pprint(channels)
# this contains channels enabled configuration only
enabled = mnt_grp.getEnabled()
pprint(enabled) If you just need the channel names, then maybe the last method is the easiest to you to process later one. Also, you can avoid getting the whole experiment configuration by directly getting the from pprint import pprint
from taurus import Device
from sardana.taurus.core.tango.sardana import registerExtensions
registerExtensions()
door = Device("door/zreszela/1")
mnt_grp = Device(door.getEnvironment("ActiveMntGrp"))
# this contains all channels' configuration parameters
channels = mnt_grp.getChannels()
pprint(channels)
# this contains channels' enabled configuration only
enabled = mnt_grp.getEnabled()
pprint(enabled) Hope this helps:) |
I just realized that yesterday I posted twice the same code snippet. I just corrected it directly in #1688 (comment). |
Thank you @reszelaz! Unfortunately, something is different in our (MAX IV) world.
Then I try I print dir(mntGrp) with this output: This device is then something else. Does it look familiar to you? This output I get from within a GUI application instantiated by Taurus. If I start a python session, get a door device (and it is TangoDdevice(Balder/Door/01)) then door.getEnvironment() or door.getExperimentConfiguration() result in AttributeError, as in OP. Could it be version problem? |
Hi! I was missing registerExtensions(), sorry for this! With it, I can do getEnvironment() and door.getExperimentConfiguration() and even can do mntGrp.getChannels(). But only in a separate python session. In a Taurus application, mntGrp.getChannels() throws AttributeError. Taurus application seem to do a similar magic command but in the other direction, like unregisterExtensions(). |
Thanks for the further feedback. This is a bug in |
Hello,
I want to get the subj to display it in a qt gui. I see the method getExperimentConfiguration() of BaseDoor that would probably give it.
But in our beamline's door this method does not exist:
Probably, the Turus Extention's door is something different from the beamline's door, Cthulhu knows why...
In going with the taurus door:
import taurus
door = taurus.Device('Balder/Door/01')
both
door.getExperimentConfiguration()
anddoor.getExperimentConfigurationObj()
result inAttributeError: configurationChanged (For more detailed information type: python_error)
where
configurationChanged
is a qt signal. So the methods do not work, which I consider a bug.How would you get the subj, with or without taurus?
Thanks!
The text was updated successfully, but these errors were encountered: