Microscope capture objects now just handle on-disk data

This commit is contained in:
Joel Collins 2019-09-16 16:35:32 +01:00
parent a832dfb2f1
commit dc794d4df8
10 changed files with 125 additions and 311 deletions

View file

@ -59,15 +59,15 @@ class MyPluginClass(MicroscopePlugin):
for _ in range(n_images):
# Create a data stream to capture to
capture_data = self.microscope.camera.new_image(
write_to_file=True, temporary=False
output = self.microscope.camera.new_image(
temporary=False
)
# Capture a still image from the Pi camera, into the data stream
self.microscope.camera.capture(capture_data, use_video_port=True)
self.microscope.camera.capture(output.file, use_video_port=True)
# Append the capture data to our list
capture_array.append(capture_data)
capture_array.append(output)
# Wait for 1 minute
time.sleep(60)

View file

@ -103,17 +103,16 @@ For example, a timelapse plugin may look like:
for _ in range(n_images):
# Create a data stream to capture to
capture_data = self.microscope.camera.new_image(
write_to_file=True,
output = self.microscope.camera.new_image(
temporary=False)
# Capture a still image from the Pi camera, into the data stream
self.microscope.camera.capture(
capture_data,
output.file,
use_video_port=True)
# Append the capture data to our list
capture_array.append(capture_data)
capture_array.append(output)
# Wait for 1 minute
time.sleep(60)