Treat cancellation and other errors differently
This commit is contained in:
parent
9995e5b3bb
commit
a506625e40
1 changed files with 5 additions and 1 deletions
|
|
@ -207,9 +207,13 @@ class CameraStageMapper(Thing):
|
|||
result: dict = calibrate_backlash_1d(
|
||||
tracker, move, direction_array, logger=logger
|
||||
)
|
||||
except (InvocationCancelledError, MappingError) as e:
|
||||
except InvocationCancelledError as e:
|
||||
logger.info("User cancelled the camera stage mapping calibration")
|
||||
logger.info("Returning to starting position")
|
||||
stage.move_absolute(**starting_position, block_cancellation=True)
|
||||
except MappingError as e:
|
||||
logger.info("Returning to starting position due to failed calibration")
|
||||
stage.move_absolute(**starting_position, block_cancellation=True)
|
||||
raise e
|
||||
result["move_history"] = move.history
|
||||
result["image_resolution"] = hw.grab_image().shape[:2]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue