first promissing implementation

This commit is contained in:
2024-11-21 14:49:10 +01:00
parent c0ded6f683
commit ec54867904

View File

@@ -61,6 +61,7 @@ debug code:
ssh root@$PPMAC
sendgetsends -1
cmdt.py -tpbg -p EXPMX1
'''
import logging
@@ -830,15 +831,23 @@ class ShapePath(MotionBase):
prg+=f' linear abs\n X{ox-px:g} Y{oy-py:g}\n' # start one position out of grid
else: #mode==6: #### pvt motion, hit and return using grid parameters
g=kwargs['grid']
nx,ny=g['count'] #total count of wells
#TODO: rework pt calculation
xx, yy=np.meshgrid(range(nx), range(ny))
xx=xx.T
yy=yy.T
pt=np.array([xx.reshape(-1), yy.reshape(-1)], dtype=np.float64).transpose() #*pitch
pt=np.tile(pt,(2,1)) # not yet perfect... but at least roughly ok
try:
trf=kwargs['trf']
except KeyError as e:
ox, oy=g['pos']
px, py=g['pitch']
self.mot_pts=pt*np.array(g['pitch'], np.float)+np.array(g['pos'], np.float)
else:
ox, oy=(0,0)
px, py=(1,1)
nx,ny=g['count'] #total count of wells
self.mot_pts=(np.hstack((pt, np.ones((pt.shape[0], 1))))*np.asmatrix(trf)).A # pt*trf
sx,sy=kwargs['ssz'] #section size (in wells)
tmx,tmy=kwargs['smv'] #time(in num of shots) to move to next section (horiz/vert)
swait=kwargs['smv'] #wait after <swait> section for motion trigger. swait=0:never wait
@@ -1276,7 +1285,6 @@ if __name__=='__main__':
sp.setup_motion(fnPrg=fn+'.prg',scale=1.,cnt=1,dwell=100,mode=5,grid=grid,tmove=tmove,twait=twait)
elif mode==6:
sp.setup_motion(fnPrg=fn+'.prg',scale=1.,cnt=1,dwell=100,mode=6,grid=grid,ssz=ssz,smv=smv,swait=swait)
_log.info('terurns just for testing');return
else:
raise(ValueError(f'unsupported mode:{mode}'))