added YAG button to gui and YAG reference positions to preferences
This commit is contained in:
1 parent
644c23ac50
commit
ed41dcf49e
2 files changed
+14
-1
No files matched your search
+6
-1
@@ -448,8 +448,10 @@ verbose bits:
|
||||
{'name':AppCfg.DFT_POS_GONIO, 'title':'gonio reference positions', 'type':'group', 'expanded':False, 'children':[
|
||||
{'name':'pos_mount', 'title':'Mount position', 'value':dft_pos_gonio.get('pos_mount'), 'type':'str' },
|
||||
{'name':'pos_align', 'title':'Align position', 'value':dft_pos_gonio.get('pos_align'), 'type':'str' },
|
||||
{'name':'pos_yag', 'title':'YAG position', 'value':dft_pos_gonio.get('pos_yag',(0.,0.,0.,0.,0.)), 'type':'str' },
|
||||
{'name':'set_mount', 'title':'use current position as "mount"', 'type':'action'},
|
||||
{'name':'set_align', 'title':'use current position as "align"', 'type':'action'},
|
||||
{'name':'set_yag', 'title':'use current position as "yag"', 'type':'action'},
|
||||
]},
|
||||
{'name':'Delta Tau Parameters', 'type':'group','expanded':False, 'children':[
|
||||
{'name':AppCfg.DT_HOST, 'title':'host name (host[:port:port_gather])','value':dt_host, 'type':'str'},
|
||||
@@ -550,6 +552,7 @@ verbose bits:
|
||||
p.param(AppCfg.DFT_POS_DET, 'set_safe' ).sigActivated.connect(lambda x: self.cb_use_cur_pos_as(AppCfg.DFT_POS_DET, 'safe'))
|
||||
p.param(AppCfg.DFT_POS_GONIO,'set_mount').sigActivated.connect(lambda x: self.cb_use_cur_pos_as(AppCfg.DFT_POS_GONIO,'mount'))
|
||||
p.param(AppCfg.DFT_POS_GONIO,'set_align').sigActivated.connect(lambda x: self.cb_use_cur_pos_as(AppCfg.DFT_POS_GONIO,'align'))
|
||||
p.param(AppCfg.DFT_POS_GONIO,'set_yag').sigActivated.connect(lambda x: self.cb_use_cur_pos_as(AppCfg.DFT_POS_GONIO,'yag'))
|
||||
#p.param('Save/Restore functionality', 'Save State').sigActivated.connect(self.cb_save)
|
||||
#p.param('Save/Restore functionality', 'Restore State').sigActivated.connect(self.cb_restore)
|
||||
|
||||
@@ -631,7 +634,7 @@ verbose bits:
|
||||
d={x.name(): x.value() for x in parent.children() if x.type()!='action'}
|
||||
cfg.setValue(par_nm,d)
|
||||
elif par_nm == AppCfg.DFT_POS_GONIO:
|
||||
k=parent.children()[:-2]
|
||||
k=parent.children()[:-3]
|
||||
d=dict(map(lambda x:(x.name(),tuple(map(float,x.value().strip('[]()').split(', ')))), k))
|
||||
cfg.setValue(par_nm,d)
|
||||
elif par_nm==AppCfg.GBL_DEV_PREFIX:
|
||||
@@ -697,6 +700,8 @@ verbose bits:
|
||||
idx=0
|
||||
elif pos=='align':
|
||||
idx=1
|
||||
elif pos=='yag':
|
||||
idx=2
|
||||
val=tuple(map(lambda k: twk[k].get_val(),('fast_x','fast_y','base_x','base_y','base_z')))
|
||||
cld[idx].setValue(json.dumps(val, cls=MyJsonEncoder))
|
||||
return
|
||||
|
||||
@@ -556,6 +556,11 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
|
||||
action.triggered.connect(self.cb_testcode)
|
||||
self.toolBar.addAction(action)
|
||||
|
||||
action = QAction(icon, "Move to\nYAG", self)
|
||||
action.setToolTip("Move goniometer stages to the configured YAG position.")
|
||||
action.triggered.connect(self.cb_move_yag)
|
||||
self.toolBar.addAction(action)
|
||||
|
||||
self.toolBar.addWidget(qutilities.horiz_spacer())
|
||||
|
||||
icon = qtawesome.icon("material.sync")
|
||||
@@ -1752,6 +1757,9 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
self._moduleFixTarget._tree.setData(grp.childItems())
|
||||
pass
|
||||
|
||||
def cb_move_yag(self):
|
||||
self.move_gonio("yag")
|
||||
|
||||
def cb_testcode(self):
|
||||
app=QApplication.instance()
|
||||
cfg=app._cfg
|
||||
|
||||
Reference in new issue
Block a user