P.T. question: how to get a list of all existing motors in beamline config (not session) ?
Question from crocodile tomographer: how to get a list of ALL existing motors in beamline config (not session) ?
proposition of lsconfig()
:
obj_dict = dict()
for name in config.names_list:
c=config.get_config(name).get('class')
# print(f"{name}: {c}")
if c is None and config.get_config(name).plugin == "emotion":
c = "Motor"
try:
obj_dict[c].append(name)
except KeyError:
obj_dict[c] = list()
obj_dict[c].append(name)
for cc in obj_dict.keys():
print(f"{cc}: ")
obj_str = " "
while obj_dict[cc]:
obj_str += obj_dict[cc].pop() + " "
if len(obj_str ) > 60:
print(obj_str)
obj_str = " "
print(obj_str)
print()
example of result:
MeasurementGroup:
demo_counters MG_tomo MG_sim MG_gauss MG_align
MultiplePositions:
beamstop att1
Motor:
wl_mono u42c u42b spec_m3 ser0 pzth_enc pzth psho pshg
psf psb out1 motor7 motor6 mono mm7 mm6 mm5 mm4 mm3
mm2 mm1 mech1 mc2 mc1_enc mc1 mbv4mot m5 m4 m3 m2 m1
kbvo kbvg kbho kbhg kb1 ice2 ice1 hpz_rx hpz_off_2
hpz_off_1 hppstc2 hppstc1 gal fsh e_mono dummy2 dummy1
controller_setting3 controller_setting2 controller_setting1
calc_mot blade_up blade_front blade_down blade_back
bend_u bend_d
SimulationCounter:
sim_ct_calib_gauss3 sim_ct_calib_gauss2 sim_ct_calib_gauss
sim_ct_5 sim_ct_4 sim_ct_3 sim_ct_2 sim_ct_1 ct1
Session:
tutu ttt mmm lll kbtest demo cyril
simulation_diode:
simulated_diode3 simulated_diode2 simulated_diode1
savoie diot
EMH:
em
mockup:
simotors simcity kb_simot ene_mono
FalconX:
fx21
Lima:
id21bv1
keithley428:
k3 k2 k1
Keithley3706:
k37dcm
slits:
prim_slits kb_vslits kb_hslits
MachInfo:
mama
Mechonics:
mecho30
mini:
miminamed
MeanCalcCounterController:
my_cc_controller
SimulatedMCA:
simul_mca
tango_attr_as_counter:
wagoid21