fixing coordinate transformation
This commit is contained in:
28
swissmx.py
28
swissmx.py
@@ -887,10 +887,7 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
|
||||
app=QApplication.instance()
|
||||
bl=app._backlight
|
||||
# any move of backlight requires post sample tube out
|
||||
try:
|
||||
self.assert_post_tube_position(pos="out")
|
||||
except:
|
||||
self.move_post_tube("out")
|
||||
self.move_post_tube("out")
|
||||
bl.move(pos)
|
||||
|
||||
def get_tweaker(self, rec, mtype=0, **kwargs):
|
||||
@@ -995,7 +992,7 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
|
||||
else:
|
||||
_log.warning(f'{e},{w},{pv}')
|
||||
sim=app._args.sim
|
||||
assert(sim&0x10,'assuming simulated motors')
|
||||
assert sim&0x10,'assuming simulated motors'
|
||||
|
||||
|
||||
def build_group_faststage(self, toolbox):
|
||||
@@ -2290,9 +2287,10 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
sp.meta['sync_flag']=dt_misc['sync_flag']
|
||||
|
||||
#pv-monitor-func: stop monitors
|
||||
pv_mon_lst=app._pv_mon_lst
|
||||
for pv in pv_mon_lst:
|
||||
pv.auto_monitor=False
|
||||
if not cfg.value(AppCfg.GBL_MISC)['live_on_collect']:
|
||||
pv_mon_lst=app._pv_mon_lst
|
||||
for pv in pv_mon_lst:
|
||||
pv.auto_monitor=False
|
||||
|
||||
with pg.ProgressDialog('Progress', 0, 100) as dlg:
|
||||
dlg.setWindowModality(Qt.WindowModal)
|
||||
@@ -2320,7 +2318,7 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
# X has inverted sign !
|
||||
# Z is in um -> therefore the offset must be multiplied with 1000 ! Z motor has opposite sign !
|
||||
#cz=f'{+p[0]:+.18g}X{-p[1]:+.18g}Y{-p[2]*1000:+.18g}'
|
||||
t=p*np.array((1,-1,-1000))
|
||||
t=p*np.array((-1,-1,-1000))
|
||||
cz=f'{t[0]:+.18g}X{t[1]:+.18g}Y{t[2]:+.18g}'
|
||||
else:
|
||||
trf=kwargs['trf'] # grid-coord -> motor-um
|
||||
@@ -2329,7 +2327,7 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
trf2=np.asmatrix(np.identity(3))
|
||||
trf2[:, :2]=trf
|
||||
#p1=(0,0,1)*trf2 # =matrix([[-2376.8, 1376.8, 1. ]]) um
|
||||
trf3=np.matrix( ((p[0],0,0),(-p[1],0,0),(-1000*p[2],0,1)) )
|
||||
trf3=np.matrix( ((-p[0],0,0),(-p[1],0,0),(-1000*p[2],0,1)) )
|
||||
#(0, 0, 1)*trf2*trf3
|
||||
t=(trf2*trf3)[:,0].A.ravel()
|
||||
cz=f'{t[0]:+.18g}X{t[1]:+.18g}Y{t[2]:+.18g}'
|
||||
@@ -2358,8 +2356,9 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
|
||||
if dlg.wasCanceled():
|
||||
# pv-monitor-func: start monitors
|
||||
for pv in pv_mon_lst:
|
||||
pv.auto_monitor=True
|
||||
if not cfg.value(AppCfg.GBL_MISC)['live_on_collect']:
|
||||
for pv in pv_mon_lst:
|
||||
pv.auto_monitor=True
|
||||
return
|
||||
dlg.setLabelText("Homing and get ready");dlg+=5
|
||||
sp.homing() # homing if needed
|
||||
@@ -2401,8 +2400,9 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
|
||||
shutter.close()
|
||||
# pv-monitor-func: start monitors
|
||||
for pv in pv_mon_lst:
|
||||
pv.auto_monitor=True
|
||||
if not cfg.value(AppCfg.GBL_MISC)['live_on_collect']:
|
||||
for pv in pv_mon_lst:
|
||||
pv.auto_monitor=True
|
||||
|
||||
def esc_run_steps(self, steps, title, esc_state):
|
||||
self._esc_state ="busy"
|
||||
|
||||
Reference in New Issue
Block a user