198 lines
5.9 KiB
Markdown
198 lines
5.9 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 /tmp/zamofing_t/
|
|
# add '--delete' if needed
|
|
rsync -vai ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX saresc-cons-03:$DST
|
|
rsync -vai ~/Documents/prj/SwissFEL/PBTools saresc-cons-03:$DST
|
|
|
|
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
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
----------------------------------- 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 !!!
|
|
|
|
```
|