scanlib.txm_pv
¶
Classes for interactions between the TXM class and the real TXM.
- TxmPV
- A descriptor for the process variables used by the microscopes.
Functions:
TxmPV (pv_name[, dtype, permit_required, ...]) |
A descriptor representing a process variable in the EPICS system. |
permit_required (real_func[, return_value]) |
Decorates a method so it can only open with a permit. |
-
class
scanlib.txm_pv.
TxmPV
(pv_name, dtype=None, permit_required=False, wait=True, as_string=False)[source]¶ Bases:
object
A descriptor representing a process variable in the EPICS system.
This allows accessing process variables as if they were object attributes. If the descriptor owner (ie. TXM) is not attached, this descriptor performs like a regular attribute. Optionally, this can also be done for objects that have no shutter permit.
-
put_complete
¶ bool – If False, there is a pending put operation.
Parameters: - pv_name (str) – The name of the process variable to connect to as defined in the EPICS system.
- dtype (optional) – If given, the values returned by PV.get will be
typecast. Example:
dtype=int
will returnint(PV[pv].get())
. - permit_required (bool, optional) – If truthy, data will only be sent if the owner has_permit attribute is true. Reading of process variable is still enabled either way.
- wait (bool, optional) – If truthy, setting this descriptor will block until the operation succeeds.
- as_string (bool, optional) – If truthy, the string representation of the process variable will be given, otherwise the raw bytes will be returned for character array variables.
-
put_complete
= True
-
-
scanlib.txm_pv.
permit_required
(real_func, return_value=None)[source]¶ Decorates a method so it can only open with a permit.
This method decorator ensures that the decorated method can only be called on an object that has a shutter permit. If it doesn’t, then an exceptions is raised.
Parameters: real_func – The function or method to decorate.