Loading openflexure_microscope/api/v2/views/actions/__init__.py +5 −0 Original line number Diff line number Diff line Loading @@ -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, Loading openflexure_microscope/api/v2/views/actions/stage.py +15 −0 Original line number Diff line number Diff line Loading @@ -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
openflexure_microscope/api/v2/views/actions/__init__.py +5 −0 Original line number Diff line number Diff line Loading @@ -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, Loading
openflexure_microscope/api/v2/views/actions/stage.py +15 −0 Original line number Diff line number Diff line Loading @@ -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"]