sign changes for collect

This commit is contained in:
2022-09-16 18:36:05 +02:00
parent 33ce6c99f3
commit a1ceef7de9
2 changed files with 47 additions and 3 deletions

View File

@@ -1114,7 +1114,10 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
else:
cz_motor=self.tweakers["base_z"]
cz=pln[0]*pTrk[0]+pln[1]*pTrk[1]+pln[2] #z=ax+by+c
cz_motor.move_abs(cz)
if cz:
cz_motor.move_abs(cz)
else:
_log.critical(f'{cz} {pTrk} {pln}')
_log.debug(f'cz={pln[0]:.4g}*{pTrk[0]:.4g}+{pln[1]:.4g}*{pTrk[1]:.4g}+{pln[2]:.4g}={cz}')
pass
elif mod&Qt.AltModifier:
@@ -1432,6 +1435,8 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
# Same but much faster !
m=np.hstack((p*pitch+pos,np.ones((p.shape[0],1))))
p=(np.asmatrix(m)*trf).A
p[:,0]*=-1 #X axis has inverted sign !
param['points']=p
# add up to 100 test fiducial
@@ -1450,6 +1455,7 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
n=int(p.shape[0]/100)+1
for i in range(0,p.shape[0],n):
fx,fy=p[i, :]/1000
fx=-fx #X axis has inverted sign !
l=.06
go=UsrGO.Fiducial((fx-l/2, fy-l/2), (l, l), i)
grp.addItem(go)
@@ -2086,7 +2092,11 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
sp.setup_sync(verbose=sp.verbose&0x40, timeOfs=0.05)
try:
p=geo._fitPlane
sp.setup_coord_trf(cz=f'{p[0]:+.18g}X{p[1]:+.18g}Y{p[2]:+.18g}') # reset to shape path system
#X has inverted sign !
#Z is in um -> therefore the offset must be multiplied with 1000!
#Z motor has opposite sign !!!
#sp.setup_coord_trf(cz=f'{-p[0]:+.18g}X{p[1]:+.18g}Y{p[2]*1000:+.18g}') # reset to shape path system
sp.setup_coord_trf(cz=f'{+p[0]:+.18g}X{-p[1]:+.18g}Y{-p[2]*1000:+.18g}') # reset to shape path system
except AttributeError:
_log.warning('no plane fitting done. z does not move')
sp.setup_coord_trf() # reset to shape path system