diff --git a/python/shapepath.py b/python/shapepath.py index 3f028da..fb97d59 100755 --- a/python/shapepath.py +++ b/python/shapepath.py @@ -9,13 +9,13 @@ shape an optimal path with given points verbose bits: - 1 basic info - 2 plot sorting steps - 4 list program - 4 upload progress - 8 plot gather path - 16 plot pvt trajectory (before motion) - 32 print sync details + 0x01 basic info + 0x02 plot sorting steps + 0x04 list program + 0x08 upload progress + 0x10 plot gather path + 0x20 plot pvt trajectory (before motion) + 0x40 print sync details Gather motor order @@ -136,8 +136,8 @@ class DebugPlot: ax1=fig.add_subplot(2, 1, 1) ax2=fig.add_subplot(2, 1, 2) #ax.xaxis.set_ticks(t) - ax1.stem(t, pv[:,0], '-r') - ax2.stem(t, pv[:,1], '-g') + ax1.stem(t, pv[:,0], '-r',use_line_collection=True) + ax2.stem(t, pv[:,1], '-g',use_line_collection=True) ax1.plot(tt, ppx, '-r', label='x') ax2.plot(tt, ppy, '-g', label='y') @@ -483,7 +483,7 @@ class ShapePath(MotionBase): self.points=pts verb=self.verbose - if verb&2: + if verb&0x02: self.plot_points(pts) plt.show(block=False) @@ -508,7 +508,7 @@ class ShapePath(MotionBase): self.points=pts verb=self.verbose - if verb&2: + if verb&0x02: self.plot_points(pts) plt.show(block=False) @@ -614,7 +614,7 @@ class ShapePath(MotionBase): #print(idx) pts=pts[idx] - if verb&2: + if verb&0x02: DebugPlot.plot_points(pts) plt.show(block=False) self.points=pts @@ -667,7 +667,8 @@ class ShapePath(MotionBase): #gt.set_property(Period=acq_per) self.meta.update({'acq_per':acq_per,'address':address}) - def setup_coord_trf(self): + def setup_coord_trf(self,fx='X',fy='Y',cz='0'): + # FY:1, FX:2, ROT_Y:3, CX:4, CZ:5, if self.comm is None: return comm = self.comm gpascii = comm.gpascii @@ -683,6 +684,22 @@ class ShapePath(MotionBase): //#8->0 //#1..8j/ ''' + prg=f'''&1a +&1#3->0 +&1#4->0 +&1#6->0 +&1#7->0 +&0#3->0 +&0#4->0 +&0#6->0 +&0#7->0 +&1 +#1->{fy} +#2->{fx} +#5->{cz} +#1,2,5j/ +''' + gpascii.send_block(prg) def setup_motion(self,prgId=2,fnPrg=None,mode=0,**kwargs): @@ -702,6 +719,7 @@ class ShapePath(MotionBase): numPad : number of padding points to reduce aliasing (default=16) ''' prg=['close all buffers','open prog %d'%(prgId)] + verb=self.verbose comm=self.comm if comm is not None: gpascii=comm.gpascii @@ -745,8 +763,7 @@ class ShapePath(MotionBase): else: n=-numPad pv[ 1:-1,(2,3)] = v[:n]*scale - verb=self.verbose - if verb&16: + if verb&0x20: dp=DebugPlot(self);self.pvt=dp.plot_gen_pvt(pv) plt.show(block=False) @@ -781,7 +798,7 @@ class ShapePath(MotionBase): prg.append('close') #prg.append('&1\nb%dr\n'%prgId) - if self.verbose & 4: + if verb&0x04: for ln in prg: print(ln) @@ -790,7 +807,7 @@ class ShapePath(MotionBase): fh.write('\n'.join(prg)) fh.close() if comm is not None: - gpascii.send_block(prg) + gpascii.send_block(prg,verb&0x08) self.prg=prg diff --git a/src/triggerSync/triggerSync.c b/src/triggerSync/triggerSync.c index fafe8f2..097b626 100644 --- a/src/triggerSync/triggerSync.c +++ b/src/triggerSync/triggerSync.c @@ -40,7 +40,7 @@ static float timeOfs=0.f; //time ofset #define SIMFLAG1 (pshm->Coord[1].Q[11]) //#define SIMFLAG0 (pshm->P[10]) //#define SIMFLAG1 (pshm->P[11]) -//Power PMAC Software Reference Manual.pdf page 760 +//Power PMAC Software Reference Manual.pdf Gate3[i].Chan[j].Status -> page 919 UserFlag #define FLAG0 (gate3_1->Chan[0].Status&0x800) #define FLAG1 (gate3_1->Chan[1].Status&0x800)