Added OneOf to stage type schema
This commit is contained in:
parent
ba9c77d5c3
commit
4521913f1b
1 changed files with 10 additions and 6 deletions
|
|
@ -7,20 +7,24 @@ import logging
|
||||||
class StageTypeProperty(PropertyView):
|
class StageTypeProperty(PropertyView):
|
||||||
"""The type of the stage"""
|
"""The type of the stage"""
|
||||||
|
|
||||||
|
schema = fields.String(
|
||||||
|
missing=None,
|
||||||
|
example="SangaStage",
|
||||||
|
OneOf=["SangaStage", "SangaDeltaStage"],
|
||||||
|
description="The translation stage geometry",
|
||||||
|
)
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
"""
|
"""
|
||||||
Get the stage geometry.
|
Get the stage geometry.
|
||||||
"""
|
"""
|
||||||
microscope = find_component("org.openflexure.microscope")
|
microscope = find_component("org.openflexure.microscope")
|
||||||
return microscope.configuration['stage']['type']
|
return microscope.configuration["stage"]["type"]
|
||||||
|
|
||||||
schema = fields.String(missing=None, example="SangaStage", description="The stage geometry [SangaStage, SangaDeltaStage]")
|
def put(self, stage_type):
|
||||||
|
|
||||||
def put(self,stage_type):
|
|
||||||
"""
|
"""
|
||||||
Set the stage geometry.
|
Set the stage geometry.
|
||||||
"""
|
"""
|
||||||
microscope = find_component("org.openflexure.microscope")
|
microscope = find_component("org.openflexure.microscope")
|
||||||
microscope.set_stage(stage_type=stage_type)
|
microscope.set_stage(stage_type=stage_type)
|
||||||
return microscope.configuration["stage"]["type"]
|
return microscope.configuration["stage"]["type"]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue