forked from mxcube/HardwareObjects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BeamlineConfiguration.py
62 lines (44 loc) · 1.5 KB
/
BeamlineConfiguration.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""
BeamlineConfiguration hardware object.
Contains static information about the beamline, and methods to retreive/handle
that information.
"""
from HardwareRepository.BaseHardwareObjects import HardwareObject
from queue_entry import QueueEntryContainer
__author__ = "Marcus Oskarsson"
__copyright__ = "Copyright 2012, ESRF"
__credits__ = ["My great coleagues", "The MxCuBE colaboration"]
__version__ = "0.1"
__maintainer__ = "Marcus Oskarsson"
__email__ = "[email protected]"
__status__ = "Beta"
class BeamlineConfiguration(HardwareObject):
def __init__(self, name):
HardwareObject.__init__(self, name)
def detector_has_shutterless(self):
"""
:returns: True if the detector is capable of shuterless.
:rtype: bool
"""
shutter_less = False
try:
shutter_less = self["BCM_PARS"]['detector'].\
getProperty('has_shutterless')
if shutter_less is None:
shutter_less = False
except:
shutter_less = False
return shutter_less
def tunable_wavelength(self):
"""
:returns: Returns True if the beamline has tunable wavelength.
:rtype: bool
"""
tw = False
try:
tw = self["BCM_PARS"].getProperty('tunable_wavelength')
if tw is None:
tw = False
except:
shutter_less = False
return tw