SFELPHOTON-1337: SwissMX split/ cleanup/move repositories
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,4 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
|
PBSwissMX/
|
||||||
|
PBTools/
|
||||||
|
simCamImg/
|
||||||
|
|||||||
35
Makefile
Normal file
35
Makefile
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
.PHONY: dbg uninstall init update
|
||||||
|
.DEFAULT_GOAL := update
|
||||||
|
|
||||||
|
REMOTE=$(USER)@saresc-vcons-01
|
||||||
|
APP=/sf/cristallina/applications
|
||||||
|
BIN=/sf/cristallina/bin
|
||||||
|
SRC=$(shell pwd)
|
||||||
|
|
||||||
|
|
||||||
|
dbg:
|
||||||
|
@echo REMOTE $(REMOTE)
|
||||||
|
@echo APP $(APP)
|
||||||
|
@echo BIN $(BIN)
|
||||||
|
@echo SRC $(SRC)
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
ssh $(REMOTE) 'rm -rf $(APP)/SwissMX $(BIN)/swissmx'
|
||||||
|
|
||||||
|
init:
|
||||||
|
-ssh $(REMOTE) 'git clone -o psigithub git@git.psi.ch:grp-sf_cristallina/SwissMX.git $(APP)/SwissMX'
|
||||||
|
-ssh $(REMOTE) 'git clone -o psigithub git@git.psi.ch:grp-sf_cristallina/PBSwissMX.git $(APP)/SwissMX/PBSwissMX'
|
||||||
|
-ssh $(REMOTE) 'git clone -o psigithub git@git.psi.ch:epics_support_apps/PBTools.git $(APP)/SwissMX/PBTools'
|
||||||
|
-ssh $(REMOTE) 'git clone -o psigithub git@git.psi.ch:epics_support_apps/ppmac.git $(APP)/SwissMX/PBTools/ppmac'
|
||||||
|
-rsync -vai simCamImg $(REMOTE):$(APP)/SwissMX/
|
||||||
|
# -rsync -vai ../../PBTools $(REMOTE):$(APP)/SwissMX/
|
||||||
|
# -ssh $(REMOTE) 'git clone -o psigithub git@git.psi.ch:epics_support_apps/PBTools.git $(APP)/PBTools'
|
||||||
|
# ssh $(REMOTE) 'pip3.6 install --user pandas zmq qtawesome'
|
||||||
|
# ssh $(REMOTE) '/opt/gfa/python-3.8/latest/bin/pip install --user pandas zmq qtawesome'
|
||||||
|
# ssh $(REMOTE) 'pip3.6 install --prefix /sf/cristallina/applications/SwissMX/module pandas zmq qtawesome'
|
||||||
|
# ssh $(REMOTE) '/opt/gfa/python-3.8/latest/bin/pip install --prefix /sf/cristallina/applications/SwissMX/module pandas zmq qtawesome'
|
||||||
|
|
||||||
|
update:
|
||||||
|
ssh $(REMOTE) 'cd $(APP)/SwissMX && git fetch psigithub && git reset psigithub/master --hard'
|
||||||
|
ssh $(REMOTE) 'cd $(APP)/SwissMX/PBSwissMX && git fetch psigithub && git reset psigithub/master --hard'
|
||||||
|
ssh $(REMOTE) 'cp $(APP)/SwissMX/exec.sh $(BIN)/swissmx'
|
||||||
@@ -5,7 +5,10 @@ from os.path import join
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
try:
|
||||||
|
import pandas as pd
|
||||||
|
except ImportError as e:
|
||||||
|
print (f'{e} import failed')
|
||||||
#import transformations as tfs
|
#import transformations as tfs
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt, QFileInfo, pyqtSignal, pyqtSlot
|
from PyQt5.QtCore import Qt, QFileInfo, pyqtSignal, pyqtSlot
|
||||||
|
|||||||
61
Readme.md
61
Readme.md
@@ -1,9 +1,32 @@
|
|||||||
|
Repository structure and dependency (update:23.09.24)
|
||||||
|
-----------------------------------------------------
|
||||||
|
```
|
||||||
|
https://jira.psi.ch/browse/SFELPHOTON-1337
|
||||||
|
|
||||||
|
psigithub git@git.psi.ch:grp-sf_cristallina/SwissMX.git --> ~/Documents/prj/SwissFEL/apps/SwissMX
|
||||||
|
Main python user interface fro SwissMX
|
||||||
|
|
||||||
|
psigithub git@git.psi.ch:grp-sf_cristallina/PBSwissMX.git --> ~/Documents/prj/SwissFEL/apps/PBSwissMX
|
||||||
|
PowerBrick documents and tool to generate trajectories and motion programs for SwissMX
|
||||||
|
|
||||||
|
psigithub git@git.psi.ch:epics_support_apps/PBTools.git --> ~/Documents/prj/SwissFEL/PBTools
|
||||||
|
packages needed by PBSwissMX for low level communication to PowerBrick
|
||||||
|
|
||||||
|
psigithub git@git.psi.ch:epics_support_apps/ppmac.git --> ~/Documents/prj/SwissFEL/PBTools/ppmac
|
||||||
|
packages needed by PBTools for lowest level communication to PowerBrick
|
||||||
|
|
||||||
|
additional module 'slic' is needed, which is provided by Sven and covers the JungFrau acquisition framefork
|
||||||
|
```
|
||||||
|
|
||||||
deployment and tests (update: 18.01.24)
|
deployment and tests (update: 18.01.24)
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
#initial full deployment:
|
||||||
|
git commit-amend && git push psigithub -f && make uninstall init update
|
||||||
|
|
||||||
|
|
||||||
Document to start SwissMX in cristallina environment:
|
Document to start SwissMX in cristallina environment:
|
||||||
https://docs.google.com/document/d/1yEmV_DbRBKQKVCoovjXriNgSjNEBaz50WA0l3yA5jtg/edit#heading=h.z9io692b8tow
|
https://docs.google.com/document/d/1yEmV_DbRBKQKVCoovjXriNgSjNEBaz50WA0l3yA5jtg/edit#heading=h.z9io692b8tow
|
||||||
|
|
||||||
```
|
```
|
||||||
***************************
|
***************************
|
||||||
* push local stuff to git *
|
* push local stuff to git *
|
||||||
@@ -22,13 +45,14 @@ git push psigithub
|
|||||||
*************************************
|
*************************************
|
||||||
ssh zamofing_t@saresc-cons-03
|
ssh zamofing_t@saresc-cons-03
|
||||||
|
|
||||||
#PRELIMINARY:
|
#first time only:
|
||||||
#cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX
|
cd /sf/cristallina/applications/
|
||||||
#git remote add psigithub git@git.psi.ch:epics_ioc_modules/ESB_MX.git
|
git clone -o psigithub git@git.psi.ch:grp-sf_cristallina/SwissMX.git
|
||||||
#cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX
|
git clone -o psigithub git@git.psi.ch:grp-sf_cristallina/SwissMX_PB.git
|
||||||
#git remote add psigithub git@git.psi.ch:zamofing_t/SwissMX.git
|
rsync -vain ~/Documents/prj/SwissFEL/apps/SwissMX/simCamImg saresc-cons-03:/sf/cristallina/applications/SwissMX/
|
||||||
|
cd /sf/cristallina/applications/SwissMX
|
||||||
|
|
||||||
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX &&\
|
cd /sf/cristallina/applications/SwissMX &&\
|
||||||
git checkout master &&\
|
git checkout master &&\
|
||||||
git stash push &&\
|
git stash push &&\
|
||||||
git fetch psigithub master &&\
|
git fetch psigithub master &&\
|
||||||
@@ -36,19 +60,28 @@ git reset psigithub/master --hard &&\
|
|||||||
git stash pop
|
git stash pop
|
||||||
#git pull psigithub --ff-only master
|
#git pull psigithub --ff-only master
|
||||||
|
|
||||||
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX &&\
|
cd /sf/cristallina/applications/SwissMX_PB &&\
|
||||||
git checkout master &&\
|
git checkout master &&\
|
||||||
git stash push &&\
|
git stash push &&\
|
||||||
git fetch psigithub master &&\
|
git fetch psigithub master &&\
|
||||||
git reset psigithub/master --hard &&\
|
git reset psigithub/master --hard &&\
|
||||||
git stash pop && chmod -R g+w *
|
git stash pop
|
||||||
#git pull psigithub --ff-only master
|
#git pull psigithub --ff-only master
|
||||||
|
|
||||||
*******************
|
*******************
|
||||||
* run application *
|
* run application *
|
||||||
*******************
|
*******************
|
||||||
|
additionally needed packages on an RH8 system:
|
||||||
|
pip install --user pandas zmq qtawesome
|
||||||
|
mkdir -p /sf/cristallina/applications/python3.6-packages
|
||||||
|
pip3.6 install --prefix /sf/cristallina/applications/SwissMX pandas zmq qtawesome
|
||||||
|
|
||||||
|
cd /sf/cristallina/applications/SwissMX
|
||||||
|
/opt/gfa/python-3.8/latest/bin/python swissmx.py
|
||||||
|
|
||||||
|
|
||||||
ssh gac-cristall@saresc-cons-03 (pw:ValToira_2021)
|
ssh gac-cristall@saresc-cons-03 (pw:ValToira_2021)
|
||||||
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX/
|
cd /sf/cristallina/applications/SwissMX/
|
||||||
# conda env list
|
# conda env list
|
||||||
conda activate crmx38
|
conda activate crmx38
|
||||||
python swissmx.py --sim 0xc0
|
python swissmx.py --sim 0xc0
|
||||||
@@ -383,9 +416,11 @@ MXMotion.py -> setup_sync()
|
|||||||
s.a. ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/Readme.md -> EVR
|
s.a. ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/Readme.md -> EVR
|
||||||
```
|
```
|
||||||
|
|
||||||
|
23.9.24 spitting/moving repositories
|
||||||
|
------------------------------------
|
||||||
|
```
|
||||||
|
https://jira.psi.ch/browse/SFELPHOTON-1337: SwissMX split/ cleanup/move repositories
|
||||||
|
```
|
||||||
|
|
||||||
----------------------------------- SCRATCH -----------------------------------
|
----------------------------------- SCRATCH -----------------------------------
|
||||||
|
|
||||||
|
|||||||
13
exec.sh
Executable file
13
exec.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# this file is copied by the Makefile to /sf/cristallina/bin/swissmx
|
||||||
|
# Check if Python version is less than 3.6
|
||||||
|
if python -c 'import sys; exit(1) if sys.version_info[0] < 3 or sys.version_info[1] < 6 else exit(0)'
|
||||||
|
then
|
||||||
|
BIN=python
|
||||||
|
else
|
||||||
|
BIN=/opt/gfa/python-3.8/latest/bin/python
|
||||||
|
fi
|
||||||
|
APP=/sf/cristallina/applications/SwissMX/swissmx.py
|
||||||
|
cd ${APP%/*}
|
||||||
|
echo $BIN $APP $*
|
||||||
|
$BIN $APP $*
|
||||||
@@ -45,7 +45,7 @@ all = 0xff
|
|||||||
|
|
||||||
class IlluminationControl(object):
|
class IlluminationControl(object):
|
||||||
|
|
||||||
def __init__(self,hostname: str="129.129.221.92",port: int=1003):
|
def __init__(self,hostname: str="129.129.221.71",port: int=1003):
|
||||||
if hostname is None: #simulated mode
|
if hostname is None: #simulated mode
|
||||||
self._sim={'stat':0}
|
self._sim={'stat':0}
|
||||||
_log.info('simulated mode:{}'.format(self._sim))
|
_log.info('simulated mode:{}'.format(self._sim))
|
||||||
@@ -59,7 +59,10 @@ class IlluminationControl(object):
|
|||||||
# connect to XT-PICO
|
# connect to XT-PICO
|
||||||
self._socket=s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
self._socket=s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
s.settimeout(1)
|
s.settimeout(1)
|
||||||
s.connect((self._hostname, self._port))
|
try:
|
||||||
|
s.connect((self._hostname, self._port))
|
||||||
|
except socket.timeout as e:
|
||||||
|
_log.error(f"{e} can't connect to: {self._hostname}:{self._port}")
|
||||||
|
|
||||||
def disconnect(self):
|
def disconnect(self):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,20 +1,24 @@
|
|||||||
import logging
|
import logging,sys,os,socket
|
||||||
|
|
||||||
from math import ceil
|
from math import ceil
|
||||||
_log=logging.getLogger(__name__)
|
_log=logging.getLogger(__name__)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
logging.basicConfig(level=logging.DEBUG,format='%(name)s:%(levelname)s:%(module)s:%(lineno)d:%(funcName)s:%(message)s ')
|
logging.basicConfig(level=logging.DEBUG,format='%(name)s:%(levelname)s:%(module)s:%(lineno)d:%(funcName)s:%(message)s ')
|
||||||
logging.getLogger('matplotlib').setLevel(logging.INFO)
|
logging.getLogger('matplotlib').setLevel(logging.INFO)
|
||||||
|
|
||||||
import sys,os,socket
|
if socket.gethostname()=='ganymede':
|
||||||
sys.path.insert(0, os.path.expanduser('..'))
|
sys.path.insert(0, os.path.expanduser('~/Documents/prj/SwissFEL/PBTools'))
|
||||||
hostname=socket.gethostname()
|
else:
|
||||||
if hostname=='ganymede':
|
sys.path.insert(0, '/sf/cristallina/applications/SwissMX/PBTools')
|
||||||
sys.path.insert(0, os.path.expanduser('~/Documents/prj/SwissFEL/PBTools/'))
|
sys.path.insert(0, '/sf/cristallina/applications/SwissMX/PBSwissMX/python')
|
||||||
else:
|
#_log.info(sys.path)
|
||||||
sys.path.insert(0, os.path.expanduser('/sf/cristallina/applications/mx/zamofing_t/PBTools/'))
|
elif socket.gethostname()!='ganymede':
|
||||||
|
#TODO: cleanup slic installation location
|
||||||
sys.path.insert(0, os.path.expanduser('/sf/cristallina/applications/mx/slic'))
|
sys.path.insert(0, os.path.expanduser('/sf/cristallina/applications/mx/slic'))
|
||||||
#("/photonics/home/gac-cristall/Documents/swissmx_cristallina/slic/"))
|
#sys.path.insert(0, os.path.expanduser('/sf/cristallina/applications/slic/slic-package'))
|
||||||
#from slic.core.acquisition import SFAcquisition
|
|
||||||
|
|
||||||
|
|
||||||
from PyQt5.QtWidgets import (QApplication,)
|
from PyQt5.QtWidgets import (QApplication,)
|
||||||
from app_config import AppCfg #settings, option, toggle_option
|
from app_config import AppCfg #settings, option, toggle_option
|
||||||
|
|||||||
22
swissmx.py
22
swissmx.py
@@ -90,18 +90,14 @@ logging.basicConfig(level=logging.INFO, format='%(levelname)s:%(module)s:%(linen
|
|||||||
#logging.getLogger('pbtools.misc.pp_comm').setLevel(logging.INFO)
|
#logging.getLogger('pbtools.misc.pp_comm').setLevel(logging.INFO)
|
||||||
_log = logging.getLogger("swissmx")
|
_log = logging.getLogger("swissmx")
|
||||||
|
|
||||||
class col:
|
if __name__=="__main__":
|
||||||
d = '\033[0m' #default
|
import sys,socket
|
||||||
r = '\033[31m' #red
|
if socket.gethostname()=='ganymede':
|
||||||
g = '\033[32m' #green
|
sys.path.insert(0, os.path.expanduser('~/Documents/prj/SwissFEL/PBTools'))
|
||||||
y = '\033[33m' #yellow
|
else:
|
||||||
rr= '\033[91m' #red(bright)
|
sys.path.insert(0, '/sf/cristallina/applications/SwissMX/PBTools')
|
||||||
gg= '\033[92m' #green(bright)
|
sys.path.insert(0, '/sf/cristallina/applications/SwissMX/PBSwissMX/python')
|
||||||
yy= '\033[93m' #yellow(bright)
|
#_log.info(sys.path)
|
||||||
b = '\033[1m' #bold
|
|
||||||
u = '\033[4m' #underline
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
class timestamp():
|
class timestamp():
|
||||||
@@ -2670,8 +2666,6 @@ if __name__=="__main__":
|
|||||||
#use EPICS if connected to ESC network
|
#use EPICS if connected to ESC network
|
||||||
os.environ['EPICS_CA_ADDR_LIST'] ='129.129.244.255 sf-saresc-cagw.psi.ch:5062 sf-saresc-cagw.psi.ch:5066'
|
os.environ['EPICS_CA_ADDR_LIST'] ='129.129.244.255 sf-saresc-cagw.psi.ch:5062 sf-saresc-cagw.psi.ch:5066'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#(h, t)=os.path.split(sys.argv[0]);cmd='\n '+(t if len(h)>20 else sys.argv[0])+' '
|
#(h, t)=os.path.split(sys.argv[0]);cmd='\n '+(t if len(h)>20 else sys.argv[0])+' '
|
||||||
#exampleCmd=('', '-m0xf -v0')
|
#exampleCmd=('', '-m0xf -v0')
|
||||||
epilog=__doc__ #+'\nExamples:'+''.join(map(lambda s:cmd+s, exampleCmd))+'\n'
|
epilog=__doc__ #+'\nExamples:'+''.join(map(lambda s:cmd+s, exampleCmd))+'\n'
|
||||||
|
|||||||
Reference in New Issue
Block a user