major fixes in coordinate systems

This commit is contained in:
2022-09-02 15:30:14 +02:00
parent 45e8ab680f
commit 6e3e1cd8ab
3 changed files with 34 additions and 13 deletions

View File

@@ -1363,6 +1363,8 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
grp=self._goTracked
cldLst=grp.childItems()
for go in cldLst:
if type(go)==UsrGO.Fiducial:
continue
if type(go)!=UsrGO.FixTargetFrame:
_log.warning(f'for now: ONLY FixTargetFrame are supported ->skipped:{go}')
continue
@@ -1383,24 +1385,36 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
# p[i,:]=(trf*t).A.ravel()
# Same but much faster !
m=np.hstack((p*pitch+pos,np.ones((p.shape[0],1))))
p=(trf*np.asmatrix(m).T).T.A
#p=(trf*np.asmatrix(m).T).T.A
p=(np.asmatrix(m)*trf).A
# add up to 100 test fiducial
vb=self.vb
grp=self._goTracked
mft=self._moduleFixTarget
try:
tmpGoLst=self._goTmp
except AttributeError:
tmpGoLst=self._goTmp=[]
else:
for go in tmpGoLst:
vb.removeItem(go)
tmpGoLst.clear()
n=int(p.shape[0]/100)+1
for i in range(0,p.shape[0],n):
fx,fy=p[i, :]/1000
l=.06
go=UsrGO.Fiducial((fx-l/2, fy-l/2), (l, l), i)
grp.addItem(go)
mft._tree.setData(grp.childItems())
tmpGoLst.append(go)
mft._tree.setData(grp.childItems())
print('DEBUG: first point:')
print(p[0,:])
print('DEBUG: difference from point to point:')
print(np.diff(p, axis=0))
#self.daq_collect(**param)
#_log.debug(f'first point:{p[0,:]}')
#_log.debug(f'step to 2nd point:{p[1,:]-p[0,:]}')
#print('DEBUG: difference from point to point:')
#print(np.diff(p, axis=0))
self.daq_collect(**param)
elif task == TASK_GRID:
self.re_connect_collect_button(
@@ -1874,7 +1888,7 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
go.setSize(sz)
j=0
elif type(go)==UsrGO.Fiducial:
elif type(go)==UsrGO.Fiducial and go.size()[0]==0.12:
ptFitTrf[j]=go.pos()+go.size()/2
ptFitPlane[i]=go.ctr()
i+=1;j+=1