diff --git a/openflexure_microscope/api/v2/views/actions/__init__.py b/openflexure_microscope/api/v2/views/actions/__init__.py index 8a740316..9a5e08d2 100644 --- a/openflexure_microscope/api/v2/views/actions/__init__.py +++ b/openflexure_microscope/api/v2/views/actions/__init__.py @@ -40,8 +40,8 @@ _actions = { "conditions": True, }, "setStage": { - "rule" : "/stage/set/", - "view_class": stage.SetStageAPI, + "rule" : "/stage/type/", + "view_class": stage.StageTypeAPI, "conditions": True, }, "shutdown": { diff --git a/openflexure_microscope/api/v2/views/actions/stage.py b/openflexure_microscope/api/v2/views/actions/stage.py index d037cc9c..c805d7e9 100644 --- a/openflexure_microscope/api/v2/views/actions/stage.py +++ b/openflexure_microscope/api/v2/views/actions/stage.py @@ -66,7 +66,7 @@ class ZeroStageAPI(ActionView): # TODO: Make schema for microscope state return microscope.state["stage"] -class SetStageAPI(ActionView): +class StageTypeAPI(ActionView): args = { "stage_type": fields.String(missing = None, example = "SangaStage", description = "The stage geometry [SangaStage, SangaDeltaStage]") } @@ -78,5 +78,12 @@ class SetStageAPI(ActionView): microscope.set_stage(stage_type=args.get("stage_type")) # TODO: Make schema for microscope state - return microscope.state["stage"] + return microscope.configuration["stage"]["type"] + + def get(self): + """ + Get the stage geometry. + """ + microscope = find_component("org.openflexure.microscope") + return microscope.configuration["stage"]["type"]