This commit is contained in:
2018-10-12 17:14:41 +02:00
parent 6f17d94008
commit 8de2127c82

View File

@@ -145,7 +145,6 @@ class ShapePath(MotionBase):
acq_per : acquire period: acquire data all acq_per servo loops (default=1) acq_per : acquire period: acquire data all acq_per servo loops (default=1)
pt2pt_time : time to move from one point to the next point pt2pt_time : time to move from one point to the next point
''' '''
host='SAR-CPPM-EXPMX1'
prg=[] prg=[]
acq_per=kwargs.get('acq_per',1) acq_per=kwargs.get('acq_per',1)
gather={"MaxSamples":1000000, "Period":acq_per} gather={"MaxSamples":1000000, "Period":acq_per}
@@ -274,23 +273,24 @@ class ShapePath(MotionBase):
fh=open(fnPrg,'w') fh=open(fnPrg,'w')
fh.write('\n'.join(prg)) fh.write('\n'.join(prg))
fh.close() fh.close()
if host is not None: if self.host is not None:
cmd ='gpasciiCommander --host '+host+' '+ fnPrg cmd ='gpasciiCommander --host '+self.host+' '+ fnPrg
print(cmd) print(cmd)
p = sprc.Popen(cmd, shell=True)#, stdout=sprc.PIPE, stderr=sprc.STDOUT) p = sprc.Popen(cmd, shell=True)#, stdout=sprc.PIPE, stderr=sprc.STDOUT)
#res=p.stdout.readlines(); print res #res=p.stdout.readlines(); print res
retval = p.wait() retval = p.wait()
#gather -u /var/ftp/gather/out.txt
cmd ='PBGatherPlot -m24 -v7 --host '+host
print(cmd)
p = sprc.Popen(cmd, shell=True)#, stdout=sprc.PIPE, stderr=sprc.STDOUT)
retval = p.wait()
self.prg=prg self.prg=prg
def gather_upload(self,fnRec=None): def gather_upload(self,fnRec=None):
pts=self.points # X,Y array #gather -u /var/ftp/gather/out.txt
cmd ='PBGatherPlot -m24 -v7 --host '+self.host
print(cmd)
p = sprc.Popen(cmd, shell=True)#, stdout=sprc.PIPE, stderr=sprc.STDOUT)
retval = p.wait()
fnLoc='/tmp/gather.txt' fnLoc='/tmp/gather.txt'
self.rec =rec = np.genfromtxt(fnLoc, delimiter=' ') self.rec =rec = np.genfromtxt(fnLoc, delimiter=' ')
pts=self.points
#rec=Motor[1].ActPos,Motor[2].ActPos,Motor[3].ActPos,Motor[1].DesPos,Motor[2].DesPos,Motor[3].DesPos #rec=Motor[1].ActPos,Motor[2].ActPos,Motor[3].ActPos,Motor[1].DesPos,Motor[2].DesPos,Motor[3].DesPos
#res=rot.ActPos,x.ActPos,y.ActPos,rot.DesPos,x.DesPos,y.DesPos #res=rot.ActPos,x.ActPos,y.ActPos,rot.DesPos,x.DesPos,y.DesPos
#idx 0 1 2 3 4 5 #idx 0 1 2 3 4 5
@@ -405,6 +405,7 @@ if __name__=='__main__':
comm = PPComm(host=args.host) comm = PPComm(host=args.host)
gather = Gather(comm) gather = Gather(comm)
sp = ShapePath(comm, gather, args.verbose) sp = ShapePath(comm, gather, args.verbose)
sp.host=args.host #temporary
fn='/tmp/shapepath' fn='/tmp/shapepath'
# fn='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/data/'+time.strftime('%y-%m-%d-%H_%M_%S') # fn='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/data/'+time.strftime('%y-%m-%d-%H_%M_%S')