Skip to content

Commit

Permalink
Merge pull request NSLS-II#99 from jrmlhermitte/bec_zmq
Browse files Browse the repository at this point in the history
Added bec_zmq
  • Loading branch information
danielballan committed Jun 19, 2018
2 parents 20b2f00 + 86cd6a0 commit 37cd930
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bluesky-zmq.yml
Expand Up @@ -18,3 +18,9 @@
http_proxy: http://proxy:8888
https_proxy: http://proxy:8888
no_proxy: cs.nsls2.local,127.0.0.1,localhost

# note: you need the zmq_hosts, zmq_proxy_out and beamline_user
# variables set for all hosts specified
- hosts: bec_zmq
roles:
- role: bec_zmq
6 changes: 6 additions & 0 deletions production
Expand Up @@ -318,7 +318,10 @@ extra_packages=""
### FXI ###

[18-ID:vars]
beamline_user=xf18id
current_env_tag="2018-2.1"
zmq_host=xf18id-ca1
zmq_proxy_out=5578

[18-ID-collection]
xf18id-ws[1:2].cs.nsls2.local
Expand Down Expand Up @@ -693,3 +696,6 @@ xf21id1-srv1.cs.nsls2.local
xf28id-ca1
xf28id1-ca1
xf18id-ca1

[bec_zmq:children]
18-ID
3 changes: 3 additions & 0 deletions roles/bec_zmq/tasks/main.yml
@@ -0,0 +1,3 @@
- name: copy bec_zmq
template: src=bec_zmq.j2 dest=/usr/local/bin/bec_zmq owner=root group=root mode=0755
become: true
17 changes: 17 additions & 0 deletions roles/bec_zmq/templates/bec_zmq.j2
@@ -0,0 +1,17 @@
#!/opt/conda_envs/collection-{{ current_env_tag }}/bin/python
import matplotlib.pyplot as plt
plt.ion()

from bluesky.callbacks.zmq import RemoteDispatcher
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.utils import install_qt_kicker

bec = BestEffortCallback()

host = "{{ zmq_host }}"
port = "{{ zmq_proxy_out }}"
rd = RemoteDispatcher((host, port))
rd.subscribe(bec)
install_qt_kicker(loop=rd.loop)

rd.start()

0 comments on commit 37cd930

Please sign in to comment.