further cleanup code
This commit is contained in:
@@ -61,16 +61,19 @@ _log=logging.getLogger(__name__)
|
||||
|
||||
import os, sys, time, re
|
||||
import numpy as np
|
||||
import matplotlib as mpl
|
||||
import matplotlib.pyplot as plt
|
||||
import subprocess as sprc
|
||||
|
||||
import socket
|
||||
hostname=socket.gethostname()
|
||||
if hostname=='ganymede':
|
||||
sys.path.insert(0, os.path.expanduser('~/Documents/prj/SwissFEL/PBTools/'))
|
||||
else:
|
||||
sys.path.insert(0, os.path.expanduser('/sf/cristallina/applications/SwissMX/PBTools/'))
|
||||
if __name__=="__main__":
|
||||
logging.basicConfig(level=logging.INFO, format='%(levelname)s:%(module)s:%(lineno)d:%(funcName)s:%(message)s')
|
||||
import socket
|
||||
if socket.gethostname()=='ganymede':
|
||||
base=os.path.abspath(os.path.dirname(__file__))
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(base,'../../../PBTools')))
|
||||
else:
|
||||
base=os.path.abspath(os.path.dirname(__file__))
|
||||
sys.path.insert(0, os.path.join(base,'PBTools'))
|
||||
sys.path.insert(0, os.path.join(base,'PBSwissMX/python'))
|
||||
#_log.info(sys.path)
|
||||
|
||||
from pbtools.misc.pp_comm import PPComm
|
||||
from pbtools.misc.gather import Gather
|
||||
@@ -610,6 +613,7 @@ class GenPath():
|
||||
|
||||
self.points=pts
|
||||
|
||||
|
||||
class ShapePath(MotionBase):
|
||||
'''
|
||||
member variables:
|
||||
@@ -915,76 +919,6 @@ enable plc 2
|
||||
'''
|
||||
comm.gpascii.send_block(syncPlc, verb&0x08)
|
||||
|
||||
# prg+=f'''\
|
||||
# linear abs
|
||||
# Motor[1].JogTa=-1 // closer to 0 harder acceleration
|
||||
# Motor[2].JogTa=-1
|
||||
# Motor[5].JogTa=-10
|
||||
# Coord[1].Ta=00000.1 // 455
|
||||
# Coord[1].Td=00000.1
|
||||
# Coord[1].Ts=0
|
||||
# jog1=-1080
|
||||
# dwell 50
|
||||
# jog1=-1200
|
||||
# dwell 50
|
||||
# jog1=-1080
|
||||
# dwell 50
|
||||
# jog1=-1200
|
||||
# dwell 50
|
||||
# //grid stop-and-go motion
|
||||
# L1=0 //slow loop x
|
||||
# L0=0 //fast loop y
|
||||
# while(L1<{nx})
|
||||
# {{
|
||||
# //send 1"A:move X%g Y%g",{ox}+L1*{px},{oy}+L0*{py}
|
||||
# X({ox}+L1*{px}) Y({oy}+L0*{py})
|
||||
# while(Sys.Udata[2]==Sys.Udata[1]){{}};Sys.Udata[2]=Sys.Udata[1] // wait motion trigger
|
||||
# L0+=1
|
||||
# while(L0<{ny}-1)
|
||||
# {{
|
||||
# //send 1"B:move X%g Y%g",{ox}+L1*{px},{oy}+L0*{py}
|
||||
# X({ox}+L1*{px}) Y({oy}+L0*{py})
|
||||
# while(Sys.Udata[2]==Sys.Udata[1]){{}};Sys.Udata[2]=Sys.Udata[1] // wait motion trigger
|
||||
# L0+=1
|
||||
# }}
|
||||
# if(L1>={nx}-1)
|
||||
# {{
|
||||
# break
|
||||
# }}
|
||||
# //send 1"C:move X%g Y%g",{ox}+L1*{px},{oy}+L0*{py}
|
||||
# X({ox}+L1*{px}) Y({oy}+L0*{py})
|
||||
# while(Sys.Udata[2]==Sys.Udata[1]){{}};Sys.Udata[2]=Sys.Udata[1] // wait motion trigger
|
||||
# L1+=1
|
||||
# //send 1"D:move X%g Y%g",{ox}+L1*{px},{oy}+L0*{py}
|
||||
# X({ox}+L1*{px}) Y({oy}+L0*{py})
|
||||
# while(Sys.Udata[2]==Sys.Udata[1]){{}};Sys.Udata[2]=Sys.Udata[1] // wait motion trigger
|
||||
# L0-=1
|
||||
# while(L0>=1)
|
||||
# {{
|
||||
# //send 1"E:move X%g Y%g",{ox}+L1*{px},{oy}+L0*{py}
|
||||
# X({ox}+L1*{px}) Y({oy}+L0*{py})
|
||||
# while(Sys.Udata[2]==Sys.Udata[1]){{}};Sys.Udata[2]=Sys.Udata[1] // wait motion trigger
|
||||
# L0-=1
|
||||
# }}
|
||||
# if(L1>={nx}-1)
|
||||
# {{
|
||||
# break
|
||||
# }}
|
||||
# //send 1"F:move X%g Y%g",{ox}+L1*{px},{oy}+L0*{py}
|
||||
# X({ox}+L1*{px}) Y({oy}+L0*{py})
|
||||
# while(Sys.Udata[2]==Sys.Udata[1]){{}};Sys.Udata[2]=Sys.Udata[1] // wait motion trigger
|
||||
# L1+=1
|
||||
# //send 1"G:move X%g Y%g",{ox}+L1*{px},{oy}+L0*{py}
|
||||
# X({ox}+L1*{px}) Y({oy}+L0*{py})
|
||||
# while(Sys.Udata[2]==Sys.Udata[1]){{}};Sys.Udata[2]=Sys.Udata[1] // wait motion trigger
|
||||
# L0+=1
|
||||
# }}
|
||||
# //send 1"H:move X%g Y%g",{ox}+L1*{px},{oy}+L0*{py}
|
||||
# X({ox}+L1*{px}) Y({oy}+L0*{py})
|
||||
#
|
||||
#'''
|
||||
|
||||
|
||||
prg+=f'''\
|
||||
pvt{tmove} abs
|
||||
//grid pvt motion
|
||||
|
||||
Reference in New Issue
Block a user