Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Baton IOC #72

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

ENH: Baton IOC #72

wants to merge 8 commits into from

Conversation

tacaswell
Copy link
Member

This is the companion PR to
bluesky/bluesky#1246

Adds:

  • updates configure_base for bluesky changes
  • a Baton caproto IOC and matching ohpyd object with the hooks to
    interact with bluesky
  • a read only version of the ophyd object to back a typhon window
from nslsii import configure_base
from nslsii.baton import Baton
from ophyd.sim import *


b = Baton('XF31ID:', name='b')

names = configure_base(get_ipython().user_ns, 'temp', baton=b)
import os
os.environ['PYDM_EPICS_LIB'] = 'caproto'
from nslsii.baton import BatonDisplay

from qtpy.QtWidgets import QApplication
import typhon
app = QApplication.instance() or QApplication(['bluesky'])

bd = BatonDisplay('XF31ID:', name='b')
suite = typhon.TyphonSuite.from_device(bd)
suite.show()

app.exec_()

@prjemian
Copy link

prjemian commented Aug 21, 2019 via email

@tacaswell
Copy link
Member Author

I am a former track runner and orchestra player so I am either thinking the relay baton or a conductors baton.

It's the thing that means you are in charge 😉

@prjemian
Copy link

Got it. So in the context of how Bluesky is used, the process in posession of the figurative baton is the only one authorized to control the hardware on the instrument (beam line, whatever). Any other bluesky process must be passive and not command the hardware to change. Right?

@prjemian
Copy link

@prjemian
Copy link

Later in that file is the use of the baton: https://github.com/APS-2BM-MIC/ipython-user2bmb/blob/master/profile_2bmb/startup/20-signals.py#L52-L95

Basically, if has baton, attach to hardware, else attach to simulators.

@tacaswell
Copy link
Member Author

@prjemian Yes, same idea. That looks like that is an end-station / instrument deconfliction tool, this is to prevent a second RE on the same instrument from starting up and if it get stolen (which being EPICS is something we can not actually protect against), prevents an existing RE from running.

Could you push https://github.com/APS-2BM-MIC/ipython-user2bmb/blob/9b7f7b134d0173cfd3a3398b79146cf7478071d2/profile_2bmb/startup/18-suspenders.py#L8-L58 upstream to bluesky? That looks generically useful.

@prjemian
Copy link

prjemian commented Aug 22, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants