Bases: KPFFunction
Start the agitator motion and wait the appropriate startup time before
returning.
ARGS:
None
Source code in kpf/spectrograph/StartAgitator.py
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 | class StartAgitator(KPFFunction):
'''Start the agitator motion and wait the appropriate startup time before
returning.
ARGS:
=====
None
'''
@classmethod
def pre_condition(cls, args):
pass
@classmethod
def perform(cls, args):
AGITATOR = ktl.cache('kpfmot', 'AGITATOR')
if AGITATOR.read() == 'Running':
log.debug('Agitator is running')
else:
startup = cfg.getfloat('times', 'agitator_startup_time', fallback=0.325)
log.debug('Starting agitator motion')
try:
AGITATOR.write('Run')
except Exception as e:
log.warning('Write to kpfmot.AGITATOR failed')
log.debug(e)
log.warning('Retrying')
time.sleep(1)
AGITATOR.write('Run')
time.sleep(startup)
@classmethod
def post_condition(cls, args):
startup = cfg.getfloat('times', 'agitator_startup_time', fallback=0.325)
AGITATOR = ktl.cache('kpfmot', 'AGITATOR')
if AGITATOR.waitFor('== "Running"', timeout=5*startup) is not True:
raise FailedToReachDestination(AGITATOR.read(), 'Running')
|