pcdshub / engineering_tools

A repository of scripts, configuration useful for the PCDS team
Other
4 stars 27 forks source link

ENH: set the default pydm protocol to ca, the most-used protocol #173

Closed ZLLentz closed 9 months ago

ZLLentz commented 9 months ago

Description

PyDM has an environment variable, PYDM_DEFAULT_PROTOCOL, that allows you to set a default protocol to use. This PR sets the default protocol to ca (channel access (EPICS)), which is the most used protocol, allowing us to omit it when building out our screens. This also makes the conversion from edm to pydm smoother.

Motivation and Context

When setting up a pydm channel, you're expected to provide a protocol in the form of a pseudo-url:

ca://MY:PVNAME

If, instead, you just use:

MY:PVNAME

You'll get the following error:

Channel MY:PVNAME did not specify a valid protocol and no default protocol is defined. This channel will receive no data. To specify a default protocol, set the PYDM_DEFAULT_PROTOCOL environment variable.

How Has This Been Tested?

Setting this environment variable helped @patoppermann 's screen load properly (converted from edm)

Where Has This Been Documented?

n/a

ZLLentz commented 9 months ago

Do we even use other channel types?...

I have occasionally used loc:// and have considered but decided against using calc://. pva:// exists and has been used as well, but not by me.