Skip to main content

Variety of useful extensions for caproto IOCs.

Project description

Caproto Apps

Tests

Implementations of select EPICS-compatible records in caproto.

Currently the only app available is the Alive app.

Installation

pip install caproto-apps

Alive

The AliveGroup provides equivalent functionality to the EPICS alive record and is compatible with existing alive daemons.

It is intended to be added to an existing PVGroup using caproto's SubGroup wrapper:

from caprotoapps import AliveGroup

class MyIOC(PVGroup):
    alive = SubGroup(
        AliveGroup,
        prefix="alive",
        remote_host="xapps2.xray.aps.anl.gov",
        remote_port=5678,  # Optional, 5678 is the default port
        ioc_name="my_ioc", # If omitted, will use the parent IOC prefix
    )

if __name__ == "__main__":
    # Start the IOC as normal for caproto
    ...

An alive daemon can request environmental variables from the alive group. Many of the default environmental variables in the EPICS alive record are specific to EPICS (e.g. EPICS_BASE) and so are not included as default environmental variables in this AliveGroup.

Presently, the default environmental variables are:

  1. ENGINEER
  2. LOCATION
  3. GROUP
  4. STY
  5. PREFIX

Neither caproto nor caproto-apps sets the value of these environmental variables, so it is left up to the launcher for the parent IOC (e.g. in a systemd unit). Additional default environmental variables can be added (or replaced) by subclassing the AliveGroup:

from caprotoapps.alive import AliveGroup, envvar_default_property

class MyAliveGroup(AliveGroup):
    # Replace ``ENGINEER`` with ``SCIENTIST``
    evd1 = envvar_default_property(1, "SCIENTIST")
    # Add a new variable, "STATUS"
    evd6 = envvar_default_property(1, "STATUS")

Building the Project for PyPI

(venv) $ python -m build
(venv) $ twine check dist/*
(venv) $ twine upload -r testpypi dist/*
(venv) $ twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

caproto-apps-0.0.2.tar.gz (10.4 kB view hashes)

Uploaded Source

Built Distribution

caproto_apps-0.0.2-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page