further cleanup code
This commit is contained in:
11
Readme.md
11
Readme.md
@@ -1,10 +1,13 @@
|
|||||||
Various motor documents
|
Various motor documents
|
||||||
-----------------------
|
-----------------------
|
||||||
- /home/zamofing_t/Documents/doc-ext/SwissFEL/ESB-MX-Stage
|
- /home/zamofing_t/Documents/doc-ext/SwissFEL/ESB-MX
|
||||||
|
|
||||||
|
|
||||||
23.09.24 Restructure repos
|
Repository structure and dependency (update:23.09.24)
|
||||||
--------------------------
|
-----------------------------------------------------
|
||||||
```
|
```
|
||||||
https://jira.psi.ch/browse/SFELPHOTON-1337
|
This repository contains PowerBrick documents and tool to generate trajectories and motion programs for SwissMX
|
||||||
|
|
||||||
|
for more info about SwissMX read:
|
||||||
|
psigithub git@git.psi.ch:grp-sf_cristallina/SwissMX.git --> ~/Documents/prj/SwissFEL/apps/SwissMX/Readme.md
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -28,10 +28,6 @@ Gather.Samples : number af gathered data samples
|
|||||||
import logging
|
import logging
|
||||||
_log=logging.getLogger(__name__)
|
_log=logging.getLogger(__name__)
|
||||||
import os,sys,time
|
import os,sys,time
|
||||||
sys.path.insert(0,os.path.expanduser('~/Documents/prj/SwissFEL/PBTools/'))
|
|
||||||
#import pbtools.misc.pp_comm as pp_comm -> pp_comm.PPComm
|
|
||||||
from pbtools.misc.pp_comm import PPComm
|
|
||||||
from pbtools.misc.gather import Gather
|
|
||||||
|
|
||||||
|
|
||||||
class MotionBase:
|
class MotionBase:
|
||||||
|
|||||||
@@ -61,16 +61,19 @@ _log=logging.getLogger(__name__)
|
|||||||
|
|
||||||
import os, sys, time, re
|
import os, sys, time, re
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import matplotlib as mpl
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import subprocess as sprc
|
|
||||||
|
|
||||||
import socket
|
if __name__=="__main__":
|
||||||
hostname=socket.gethostname()
|
logging.basicConfig(level=logging.INFO, format='%(levelname)s:%(module)s:%(lineno)d:%(funcName)s:%(message)s')
|
||||||
if hostname=='ganymede':
|
import socket
|
||||||
sys.path.insert(0, os.path.expanduser('~/Documents/prj/SwissFEL/PBTools/'))
|
if socket.gethostname()=='ganymede':
|
||||||
else:
|
base=os.path.abspath(os.path.dirname(__file__))
|
||||||
sys.path.insert(0, os.path.expanduser('/sf/cristallina/applications/SwissMX/PBTools/'))
|
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.pp_comm import PPComm
|
||||||
from pbtools.misc.gather import Gather
|
from pbtools.misc.gather import Gather
|
||||||
@@ -610,6 +613,7 @@ class GenPath():
|
|||||||
|
|
||||||
self.points=pts
|
self.points=pts
|
||||||
|
|
||||||
|
|
||||||
class ShapePath(MotionBase):
|
class ShapePath(MotionBase):
|
||||||
'''
|
'''
|
||||||
member variables:
|
member variables:
|
||||||
@@ -915,76 +919,6 @@ enable plc 2
|
|||||||
'''
|
'''
|
||||||
comm.gpascii.send_block(syncPlc, verb&0x08)
|
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'''\
|
prg+=f'''\
|
||||||
pvt{tmove} abs
|
pvt{tmove} abs
|
||||||
//grid pvt motion
|
//grid pvt motion
|
||||||
|
|||||||
Reference in New Issue
Block a user