Moved API from action to property view
This commit is contained in:
parent
e886e9db28
commit
86d866c5f9
5 changed files with 30 additions and 23 deletions
|
|
@ -39,11 +39,6 @@ _actions = {
|
|||
"view_class": stage.ZeroStageAPI,
|
||||
"conditions": True,
|
||||
},
|
||||
"setStage": {
|
||||
"rule" : "/stage/type/",
|
||||
"view_class": stage.StageTypeAPI,
|
||||
"conditions": True,
|
||||
},
|
||||
"shutdown": {
|
||||
"rule": "/system/shutdown/",
|
||||
"view_class": system.ShutdownAPI,
|
||||
|
|
|
|||
|
|
@ -66,22 +66,4 @@ class ZeroStageAPI(ActionView):
|
|||
# TODO: Make schema for microscope state
|
||||
return microscope.state["stage"]
|
||||
|
||||
class StageTypeAPI(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"))
|
||||
return {"stage_type": microscope.configuration["stage"]["type"]}
|
||||
|
||||
def get(self):
|
||||
"""
|
||||
Get the stage geometry.
|
||||
"""
|
||||
microscope = find_component("org.openflexure.microscope")
|
||||
return {"stage_type": microscope.configuration["stage"]["type"]}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue