wip
This commit is contained in:
@@ -224,6 +224,7 @@ class ShapePath(MotionBase):
|
||||
except KeyError:
|
||||
print('missing pt2pt_time, use default=100ms')
|
||||
pt2pt_time=100.
|
||||
self.meta['pt2pt_time']=pt2pt_time
|
||||
try:
|
||||
cnt=kwargs['cnt'] #move path multiple times
|
||||
except KeyError:
|
||||
@@ -523,6 +524,13 @@ if __name__=='__main__':
|
||||
# '%(levelname)-8s %(message)s'),
|
||||
# datefmt='%m-%d %H:%M',
|
||||
# )
|
||||
def trigger(wait=.5):
|
||||
import CaChannel
|
||||
time.sleep(wait)
|
||||
pvTrigger = CaChannel.CaChannel('SAR-CVME-TIFALL5-EVG0:SoftEvt-EvtCode-SP.VAL')
|
||||
pvTrigger.searchw()
|
||||
pvTrigger.putw(254)
|
||||
|
||||
|
||||
def run_test(args):
|
||||
#args.host=None
|
||||
@@ -532,6 +540,19 @@ if __name__=='__main__':
|
||||
comm = PPComm(host=args.host)
|
||||
gather = Gather(comm)
|
||||
sp = ShapePath(comm, gather, args.verbose)
|
||||
# Gather.MaxLines=116508
|
||||
# ts=0.2ms
|
||||
# max_num_points=(MaxLines*ts-1000ms)/(+acq_per*pt2pt_time*ts)
|
||||
# pt2pt_time acq_per maxpts
|
||||
# 40ms 1 555
|
||||
# 40ms 2 1135
|
||||
# 40ms 3 1715
|
||||
# 40ms 4 2295
|
||||
# 10ms 1 2220
|
||||
# 10ms 2 4540
|
||||
# 10ms 3 6860
|
||||
# 10ms 4 9180
|
||||
|
||||
#sp.gen_swissmx_points(width=1000,ofs=(-500,0))
|
||||
#sp.gen_swissfel_points(width=1000,ofs=(-500,0))
|
||||
#fn='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/PBMotionAnalyzer/records/mode1'
|
||||
@@ -563,15 +584,17 @@ if __name__=='__main__':
|
||||
#sp.gen_grid_points(w=100,h=100,pitch=50,rnd=.2)
|
||||
|
||||
|
||||
#setup_gather(self, acq_per=1)
|
||||
#setup_gather(self, acq_per=1) #Gather.MaxLines=116508 580pts
|
||||
sp.setup_gather(acq_per=2)
|
||||
#setup_sync(self, crdId=1, prgId=2, plcId=2, mode=0, **kwargs):
|
||||
sp.setup_sync() #no sync at all
|
||||
#sp.setup_sync() #no sync at all
|
||||
#sp.setup_sync(mode=1) #sync with timing system (PLC)
|
||||
#sp.setup_sync(mode=2) #sync with timing system (PROG)
|
||||
sp.setup_sync(mode=2) #sync with timing system (PROG)
|
||||
|
||||
#sp.gen_grid_points(w=2,h=2,pitch=50,rnd=.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
|
||||
sp.gen_swissmx_points(width=1000,ofs=(-500,0));sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40,acq_per=1)
|
||||
#sp.gen_swissmx_points(width=1000,ofs=(-500,0));sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40,acq_per=1)
|
||||
sp.gen_grid_points(w=30,h=30,pitch=50,rnd=.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
|
||||
#sp.gen_grid_points(w=200,h=200,pitch=50,rnd=.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
|
||||
|
||||
#sp.gen_grid_points(w=2,h=20,pitch=50,rnd=0);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
|
||||
#sp.gen_rand_points(n=500, scale=1000);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
|
||||
@@ -586,6 +609,7 @@ if __name__=='__main__':
|
||||
|
||||
#>>>run gather and plot trajectory<<<
|
||||
sp.run()
|
||||
trigger(0.5)
|
||||
sp.gather_upload(fnRec=fn+'.npz')
|
||||
sp.plot_gather()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user