Flipped to explicit finite lock timeouts
This commit is contained in:
parent
832a9adbe3
commit
9cecb477cb
6 changed files with 35 additions and 30 deletions
|
|
@ -45,8 +45,8 @@ class MoveStageAPI(ActionView):
|
|||
|
||||
# Move if stage exists
|
||||
if microscope.stage:
|
||||
# Explicitally acquire lock
|
||||
with microscope.stage.lock:
|
||||
# Explicitally acquire lock with 1s timeout
|
||||
with microscope.stage.lock(timeout=1):
|
||||
microscope.stage.move_rel(position)
|
||||
else:
|
||||
logging.warning("Unable to move. No stage found.")
|
||||
|
|
@ -62,7 +62,9 @@ class ZeroStageAPI(ActionView):
|
|||
Does not move the stage, but rather makes the current position read as [0, 0, 0]
|
||||
"""
|
||||
microscope = find_component("org.openflexure.microscope")
|
||||
microscope.stage.zero_position()
|
||||
|
||||
with microscope.stage.lock(timeout=1):
|
||||
microscope.stage.zero_position()
|
||||
|
||||
# TODO: Make schema for microscope state
|
||||
return microscope.state["stage"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue