Expand description
PV access for bobview.
Widgets ask a PvManager for a Pv by name and read its latest
PvState each frame. The manager owns a tokio runtime on which one task
per PV talks to the backend chosen by the name’s prefix:
| prefix | backend |
|---|---|
ca:// | Channel Access (the default) |
pva:// | PV Access |
loc:// | local PVs held in this process |
sim:// | simulated signals (sine, ramp, noise …) |
=, eq:// | formulas over other PVs |
In a browser (wasm32) there is no runtime: sim:// runs on the page’s
event loop, and ca:// and pva:// PVs come over a PV Web Socket
([set_pvws]).
Structs§
- Image
- A 2D image, row-major with x varying fastest.
- Pv
- A handle to a live PV. Cheap to clone.
- PvManager
- Creates and shares PV subscriptions.
- PvName
- A parsed PV name such as
ca://X,loc://x<VDouble>(3)orsim://sine(0, 10, 0.1). - PvState
- Everything known about a PV at one moment.
Enums§
- Image
Data - Image samples in their native type.
- Scheme
- Which backend serves a PV.
- Severity
- EPICS alarm severity.
- Value
- A PV’s value, reduced to the few shapes a display needs.
Functions§
- formula_
inputs - The PVs a formula’s text names (
a+bfor the formula=a+b), each once, in order; none when it does not parse. A PV whose name is computed is left out, though the PVs its name is computed from are not. - long_
string - The text held in a char array, as Phoebus’s
getLongStringreads it: the bytes up to the first NUL (or all of them), as UTF-8. - long_
string_ bytes textas a char array holding a long string: its UTF-8 bytes and a terminating NUL, cut to fitmaxelements (the PV’s element count, if known) with the NUL kept, and never inside a multi-byte character.- same_
origin - Whether two URLs are on one server (see
url_origin). - split_
array - The elements of an array typed as text, in the
[1, 2, 3]form that arrays are shown in, or just separated by spaces or commas. - split_
strings - The elements of a string array typed as text, as Phoebus’s
StringListreads it:["a b", "c"], with\"for a quote inside a quoted item, or unquoted items separated by commas. - url_
origin - The origin of an absolute URL:
scheme://host[:port]in lowercase, without user info or a default port, and with a websocket’s scheme as the page’s (wsashttp,wssashttps), so a socket and a page on one server have one origin.Nonefor anything else, including a URL with a backslash, a control character or white space: a browser reads those otherwise (\is/to it, sows://evil\@server/is a socket toevil).
Type Aliases§
- Listen
Fn - Listener
- Called with a PV’s new state on each change, from the thread making it,
for as long as the caller keeps the
Arc(seePv::listen). - Notifier
- Called whenever any PV changes, so a UI can schedule a repaint.