325 lines
9.7 KiB
Markdown
325 lines
9.7 KiB
Markdown
pyqtgraph examples
|
|
------------------
|
|
```
|
|
ipython3
|
|
import pyqtgraph.examples
|
|
pyqtgraph.examples.run()
|
|
|
|
```
|
|
|
|
EPICS simulator
|
|
---------------
|
|
```
|
|
This provides very dummy images and motor(to be done) records
|
|
|
|
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/EpicsSim/iocBoot/iocSwissMxSim
|
|
./st.cmd
|
|
```
|
|
|
|
simulate camera (with EPICS simulator)
|
|
--------------------------------------
|
|
```
|
|
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/SwissMX
|
|
EPICS_CA_ADDR_LIST=localhost
|
|
./simCam.py
|
|
```
|
|
|
|
test camera display
|
|
-------------------
|
|
```
|
|
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/SwissMX
|
|
EPICS_CA_ADDR_LIST=localhost
|
|
./camera.py -u -b SwissMxSim
|
|
```
|
|
|
|
test at ESC
|
|
-----------
|
|
```
|
|
https://git.psi.ch/SwissMX/swissmx_cristallina/-/wikis/Instructions%20on%20how%20to%20use%20software
|
|
|
|
P=ESB_MX/python/SwissMX/
|
|
ssh saresc-cons-02 mkdir -p /tmp/zamofing_t/$P
|
|
rsync -vai ~/Documents/prj/SwissFEL/epics_ioc_modules/$P saresc-cons-02:/tmp/zamofing_t/$P
|
|
cd /tmp/zamofing_t/ESB_MX/python/SwissMX
|
|
/opt/gfa/python-3.7/2018.12/bin/python camera.py -u 1 -p SARES30-CAMS156-SMX-OAV
|
|
|
|
/opt/gfa/python-3.7/2018.12/bin/python swissmx.py
|
|
|
|
|
|
caqtdm -macro 'NAME=SARES30-CAMS156-SMX-OAV,CAMNAME=SARES30-CAMS156-SMX-OAV' /sf/controls/config/qt/Camera/CameraExpert_RF.ui
|
|
|
|
```
|
|
|
|
try revive Zac code
|
|
-------------------
|
|
```
|
|
cd /tmp/; git clone https://github.com/malcolmreynolds/transformations.git
|
|
cd /tmp/transformations.git
|
|
-> modify __init__.py -> .transformation (add dot)
|
|
setup.py install --user
|
|
|
|
|
|
cd /tmp/; git clone https://github.com/spyder-ide/qtawesome.git
|
|
cd /tmp/qtawesome
|
|
|
|
#To have epics channels we must be connected to the ESC network
|
|
EPICS_CA_ADDR_LIST='129.129.244.255 sf-saresc-cagw.psi.ch:5062 sf-saresc-cagw.psi.ch:5066'
|
|
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/oldRepos/app/src
|
|
python swissmx.py
|
|
```
|
|
|
|
pyqtgraph examples
|
|
------------------
|
|
```
|
|
import pyqtgraph.examples
|
|
pyqtgraph.examples.run()
|
|
```
|
|
|
|
|
|
Deploy stuff (22.8.22) quick and dirty (21.9.22 rewworked)
|
|
----------------------------------------------------------
|
|
```
|
|
DST=/sf/cristallina/applications/mx/zamofing_t/
|
|
|
|
ssh saresc-cons-03 mkdir $DST
|
|
# add '--delete' if needed
|
|
rsync -vai ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX saresc-cons-03:$DST -n
|
|
rsync -vai ~/Documents/prj/SwissFEL/PBTools saresc-cons-03:$DST -n
|
|
ssh saresc-cons-03 saresc-cons-03 chmod -R go+w $DST/ESB_MX/python/SwissMX
|
|
|
|
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX/
|
|
/opt/gfa/python-3.8/latest/bin/pip install qtawesome --user
|
|
/opt/gfa/python-3.8/latest/bin/pip install opencv-python
|
|
/opt/gfa/python-3.8/latest/bin/python swissmx.py
|
|
|
|
rsync -vai gac-cristall@saresc-cons-03:~/.config/PSI/SwissMX.conf /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/SwissMX/
|
|
|
|
cd $DST
|
|
/opt/gfa/python-3.8/latest/bin/python -m pdb swissmx.py
|
|
rsync -vai saresc-cons-03:/tmp/image*.png ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/SwissMX/scratch/
|
|
/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/SwissMX/scratch/autofocus2
|
|
```
|
|
|
|
16.9.22 remote Deltatau test:
|
|
-----------------------------
|
|
```
|
|
(s.a. /home/zamofing_t/Documents/prj/SwissFEL/PBTools/pbtools/gather/PBGatherPlot.py
|
|
|
|
PPMAC=SAR-CPPM-EXPMX1
|
|
rsync -va ~/Documents/prj/SwissFEL/PBTools/pbtools/gather/gather_server root@$PPMAC:/tmp/
|
|
|
|
ssh root@$PPMAC
|
|
LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/gather_server
|
|
ssh -L 10001:localhost:22 root@$PPMAC 'uname -a'
|
|
ssh -L 10002:localhost:2332 root@$PPMAC 'uname -a'
|
|
Deltatau host in config:
|
|
localhost:10001:10002 (instead SAR-CPPM-EXPMX1)
|
|
|
|
ssh gac-cristall@saresc-cons-03
|
|
pw: ValToira_2021
|
|
```
|
|
|
|
4.10.22 final test:
|
|
-------------------
|
|
```
|
|
zamofing_t@ganymede:~$ ssh gac-cristall@saresc-cons-03
|
|
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX/
|
|
# conda env list
|
|
conda activate crmx38
|
|
python swissmx.py
|
|
|
|
|
|
ssh gac-cristall@saresc-cons-03 ls /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX
|
|
|
|
|
|
git@git.psi.ch:epics_ioc_modules/ESB_MX.git
|
|
|
|
|
|
git remote add sf-cristallina gac-cristall@saresc-cons-03:/sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX
|
|
|
|
git fetch sf-cristallina
|
|
|
|
# do local changes and commit stuff
|
|
git push sf-cristallina
|
|
|
|
```
|
|
|
|
22.6.23 deployment and tests
|
|
----------------------------
|
|
```
|
|
ssh zamofing_t@saresc-cons-03
|
|
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX
|
|
git remote add psihttp https://git.psi.ch/epics_ioc_modules/ESB_MX.git
|
|
|
|
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX
|
|
git remote add psihttp https://git.psi.ch/zamofing_t/SwissMX.git
|
|
|
|
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX
|
|
chmod -R g+w *
|
|
|
|
|
|
switch to production deployment:
|
|
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX
|
|
git checkout prod
|
|
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX
|
|
git checkout prod
|
|
|
|
switch to latest test environment:
|
|
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX
|
|
git checkout master
|
|
cd /sf/cristallina/applications/mx/zamofing_t/ESB_MX/python/SwissMX
|
|
git checkout master
|
|
```
|
|
|
|
|
|
----------------------------------- SCRATCH -----------------------------------
|
|
|
|
-0.952
|
|
pp_comm.py_:
|
|
@property
|
|
def fast_gather(self):
|
|
tries to connect to port and to query_types(), if fails starts the fast gather process.
|
|
|
|
triggerSync.c:
|
|
root@:/opt/ppmac# LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/triggerSync
|
|
|
|
usage:
|
|
/tmp/triggerSync pt2ptTime timeOfs mode
|
|
|
|
pt2ptTime: time in ms (float value) from point to point == frequency if FEL
|
|
timeOfs: time offset in ms (float value) for motion relative to the FEL timing
|
|
|
|
The program changes the speed of motion
|
|
pshm->Coord[1].DesTimeBase= (default serverPeriod= 0.2?)
|
|
|
|
SIMFLAG0 (pshm->Coord[1].Q[10]) -> start trigger
|
|
SIMFLAG1 (pshm->Coord[1].Q[11]) -> FEL pulse trigger
|
|
//Power PMAC Software Reference Manual.pdf Gate3[i].Chan[j].Status -> page 919 UserFlag
|
|
#define FLAG0 (gate3_1->Chan[0].Status&0x800) -> start trigger
|
|
#define FLAG1 (gate3_1->Chan[1].Status&0x800) -> FEL pulse trigger
|
|
|
|
|
|
mode:
|
|
bit0:1: sync mode
|
|
bit1:2: simulate start trigger
|
|
bit2:4: simulate frame trigger
|
|
bit3:8: verbose
|
|
|
|
simulate start trigger:
|
|
set pshm->Coord[1].Q[10]=1 to simulate a Jungfrau aquire start
|
|
|
|
simulate frame trigger
|
|
is output to pshm->Coord[1].Q[11]
|
|
1: synchronize real frame and start triggers
|
|
3: synchronize real frame and simulated start triggers
|
|
6: simulated frame and start triggers (no sync)
|
|
7: synchronize simulated frame and start triggers
|
|
|
|
in simulate mode:
|
|
set pshm->Coord[1].Q[10]=1 to simulate a Jungfrau aquire start
|
|
set pshm->Coord[1].Q[10]=2 to stop simulate trigger generation
|
|
Coord[1].Q[11] is the simulated frame trigger
|
|
|
|
in synchronize mode
|
|
Coord[1].Q[0]=-2 : trigsync_func start, Wait for 'arm' trigger
|
|
Coord[1].Q[0]=-1 : got 'arm' trigger, wait frame trigger
|
|
Coord[1].Q[0]= 0 : got frame trigger 0
|
|
Coord[1].Q[0] is incremented at each trigger
|
|
sync task ends when Gather.Enable==0
|
|
|
|
|
|
|
|
|
|
// /tmp/triggerSync 40 11 trigger all 40 ms, simulated start, use real frame triggers, verbose
|
|
// /tmp/triggerSync 40 14 trigger all 40 ms, simulated start and frame triggers, no sync, verbose
|
|
// /tmp/triggerSync 40 15 trigger all 40 ms, simulated start and frame triggers, with sync, verbose
|
|
// /tmp/triggerSync 40 7 trigger all 40 ms, simulated start and frame triggers, with sync, minimal verbose
|
|
|
|
|
|
78x78 points =6084pts a 10ms =60 sec. -> 70 sec.
|
|
-> we are at 100 Hz !!!
|
|
|
|
remote ssh tunnel + start gather_server
|
|
---------------------------------------
|
|
```
|
|
PPMAC=SAR-CPPM-EXPMX1
|
|
rsync -va ~/Documents/prj/SwissFEL/PBTools/pbtools/gather/gather_server root@$PPMAC:/tmp/
|
|
lsof -i -n | grep '127.0.0.1:1000'
|
|
ssh -L 10001:localhost:22 root@$PPMAC 'uname -a'
|
|
ssh -L 10002:localhost:2332 root@$PPMAC 'uname -a'
|
|
ssh root@$PPMAC
|
|
LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/gather_server
|
|
```
|
|
cleanup /tmp/
|
|
-------------
|
|
```
|
|
PPMAC=SAR-CPPM-EXPMX1
|
|
ssh root@$PPMAC rm /tmp/gather_server /tmp/triggerSync
|
|
ssh root@$PPMAC ls -l /tmp
|
|
```
|
|
start debug tools
|
|
-----------------
|
|
```
|
|
PPMAC=SAR-CPPM-EXPMX1
|
|
PBInspect --host=$PPMAC&
|
|
gpasciiCommander --host $PPMAC -i
|
|
ssh root@$PPMAC
|
|
ssh root@$PPMAC rm /tmp/gather_server /tmp/triggerSync
|
|
ssh root@$PPMAC ls -l /tmp
|
|
```
|
|
restart IOC
|
|
-----------
|
|
```
|
|
ssh saresc-cons-03
|
|
PPMAC=SAR-CPPM-EXPMX1
|
|
telnet $PPMAC 50001
|
|
Ctrl-X
|
|
dbgf SAR-CPPM-EXPMX1:MOD_VER
|
|
caget SAR-CPPM-EXPMX1:MOD_VER
|
|
```
|
|
checking versions
|
|
-----------------
|
|
```
|
|
git: 7a968aac967
|
|
asyn 427.0.2
|
|
motorBase alpha_220518
|
|
asynMotor alpha_220518
|
|
powerPmac alpha_220518
|
|
PB_COMMON 2.0.1
|
|
gpasciiCommander 0.9.0
|
|
ESB_MX 0.0.2
|
|
```
|
|
zamofing_t@ganymede:~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX$
|
|
git loggraph -10
|
|
* 7a968aa 2022-09-20 (HEAD -> master, tag: latest, tag: 0.0.2, psigithub/master) change speeds and directions [Thierry Zamofing]
|
|
* 00588f8 2022-09-16 minor changes [Thierry Zamofing]
|
|
* d52a6ce 2022-08-30 minor changes [Thierry Zamofing]
|
|
* f47e111 2022-05-20 (tag: 0.0.1) add DET_Z motor [Thierry Zamofing]
|
|
* 8e5b15e 2022-05-20 wip [Thierry Zamofing]
|
|
* 399282c 2019-03-20 enhance triggering [Thierry Zamofing]
|
|
* eda8caf 2019-03-19 wip [Thierry Zamofing]
|
|
* 0c45705 2019-03-08 optimize [Thierry Zamofing]
|
|
* c962ebd 2019-03-06 documentation [Thierry Zamofing]
|
|
git reset --hard 399282c
|
|
rmake -e LIBVERSION=42.42.42 uninstall install
|
|
-> restart IOC
|
|
ssh root@$PPMAC rm /tmp/triggerSync
|
|
cd python
|
|
git dt latest -- shapepath.py
|
|
./shapepath.py --host=localhost:10001:10002
|
|
removing test verion
|
|
ssh sf-lc7 ls -l /ioc/modules/ESB_MX/
|
|
ssh sf-lc7 rm -rf /ioc/modules/ESB_MX/42.42.42
|
|
IOC locations
|
|
-------------
|
|
```
|
|
~/Documents/prj/SwissFEL/epics_ioc_boot_sf/ESC_all/ESB_MX_PowerBrick
|
|
They are just using the new alphy driver. That should have no impact on the motion config.
|
|
```
|
|
test shapepath
|
|
--------------
|
|
```
|
|
cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX
|
|
./shapepath.py --host=localhost:10001:10002
|
|
```
|