Commit 81ca2c9c authored by Samuel McDermott's avatar Samuel McDermott
Browse files

Add a get route for the stage type and rename

parent 79f31044
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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": {
+9 −2
Original line number Diff line number Diff line
@@ -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"]