Remove unused actions in capture
This commit is contained in:
parent
4271c28045
commit
35e1d6cdee
1 changed files with 1 additions and 25 deletions
|
|
@ -52,30 +52,6 @@ class CaptureThing(Thing):
|
|||
f"Acquired {jpeg_path} in {acquisition_duration}s then {saving_duration}s saving to disk"
|
||||
)
|
||||
|
||||
@thing_action
|
||||
def capture_jpeg(self, filename: str, cam: CamDep, logger: InvocationLogger):
|
||||
"""Capture a JPEG (from a JPEGBlob) to disk"""
|
||||
for capture_attempts in range(5):
|
||||
try:
|
||||
jpeg = cam.capture_jpeg(resolution="main", wait=5)
|
||||
jpeg.save(filename)
|
||||
return
|
||||
except TimeoutError:
|
||||
logger.warning(
|
||||
f"Attempt {capture_attempts + 1} to capture image timed out. Do you have enough RAM?"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
raise CaptureError("An error occurred while capturing after 5 attempts")
|
||||
|
||||
@thing_action
|
||||
def stop_streaming(self, cam: CamDep):
|
||||
cam.stop_streaming()
|
||||
|
||||
@thing_action
|
||||
def restart_stream(self, cam: CamDep):
|
||||
cam.restart_stream()
|
||||
|
||||
@thing_action
|
||||
def _capture_image(
|
||||
self,
|
||||
|
|
@ -85,7 +61,7 @@ class CaptureThing(Thing):
|
|||
):
|
||||
"""Capture an image in memory and return it with metadata
|
||||
CaptureError raised if the capture fails for any reason
|
||||
returns tuple with numpy array of image data, and dict of metadata
|
||||
returns tuple with PIL Image, and dict of metadata
|
||||
"""
|
||||
for capture_attempts in range(5):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue