Add API to set the stage
This commit is contained in:
parent
a1f27b0091
commit
79f3104409
2 changed files with 20 additions and 0 deletions
|
|
@ -39,6 +39,11 @@ _actions = {
|
|||
"view_class": stage.ZeroStageAPI,
|
||||
"conditions": True,
|
||||
},
|
||||
"setStage": {
|
||||
"rule" : "/stage/set/",
|
||||
"view_class": stage.SetStageAPI,
|
||||
"conditions": True,
|
||||
},
|
||||
"shutdown": {
|
||||
"rule": "/system/shutdown/",
|
||||
"view_class": system.ShutdownAPI,
|
||||
|
|
|
|||
|
|
@ -65,3 +65,18 @@ class ZeroStageAPI(ActionView):
|
|||
|
||||
# TODO: Make schema for microscope state
|
||||
return microscope.state["stage"]
|
||||
|
||||
class SetStageAPI(ActionView):
|
||||
args = {
|
||||
"stage_type": fields.String(missing = None, example = "SangaStage", description = "The stage geometry [SangaStage, SangaDeltaStage]")
|
||||
}
|
||||
def post(self,args):
|
||||
"""
|
||||
Set the stage geometry.
|
||||
"""
|
||||
microscope = find_component("org.openflexure.microscope")
|
||||
microscope.set_stage(stage_type=args.get("stage_type"))
|
||||
|
||||
# TODO: Make schema for microscope state
|
||||
return microscope.state["stage"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue