Skip to content

Commit

Permalink
Added duration of generator (~exposure time) to 60 second timeout for…
Browse files Browse the repository at this point in the history
… HDF writer part to enable longer exposures
  • Loading branch information
Benjamin Bradnick committed Aug 21, 2018
1 parent aba14e6 commit d80616c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion malcolm/modules/ADCore/parts/hdfwriterpart.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def configure(self, context, completed_steps, steps_to_do, part_info, params):
file_dir, "%s-layout.xml" % self.params.mri)
with open(self.layout_filename, "w") as f:
f.write(xml)
# Store the duration of the generator for checking for timeout
self.generator_duration = params.generator.duration
# We want the HDF writer to flush this often:
flush_time = 1 # seconds
# (In particular this means that HDF files can be read cleanly by
Expand Down Expand Up @@ -213,7 +215,7 @@ def run(self, context, update_completed_steps):
self.update_completed_steps, update_completed_steps)
# TODO: what happens if we miss the last frame?
child.when_value_matches(
"uniqueId", self.done_when_reaches, event_timeout=FRAME_TIMEOUT)
"uniqueId", self.done_when_reaches, event_timeout=FRAME_TIMEOUT+self.generator_duration)

@RunnableController.PostRunReady
def post_run_ready(self, context):
Expand Down

0 comments on commit d80616c

Please sign in to comment.