Enable stage coordinate zeroing
This commit is contained in:
parent
2f4959885c
commit
3db99fee2f
6 changed files with 43 additions and 1 deletions
|
|
@ -37,6 +37,11 @@ _actions = {
|
|||
"view_class": stage.MoveStageAPI,
|
||||
"conditions": True,
|
||||
},
|
||||
"zeroStage": {
|
||||
"rule": "/stage/zero/",
|
||||
"view_class": stage.ZeroStageAPI,
|
||||
"conditions": True,
|
||||
},
|
||||
"shutdown": {
|
||||
"rule": "/system/shutdown/",
|
||||
"view_class": system.ShutdownAPI,
|
||||
|
|
|
|||
|
|
@ -56,3 +56,22 @@ class MoveStageAPI(MicroscopeView):
|
|||
logging.warning("Unable to move. No stage found.")
|
||||
|
||||
return jsonify(self.microscope.status["stage"]["position"])
|
||||
|
||||
|
||||
class ZeroStageAPI(MicroscopeView):
|
||||
"""
|
||||
Zero stage coordinates
|
||||
"""
|
||||
|
||||
def post(self):
|
||||
"""
|
||||
Set the current position to zero
|
||||
|
||||
.. :quickref: Actions; Zero stage
|
||||
|
||||
:reqheader Accept: application/json
|
||||
|
||||
"""
|
||||
self.microscope.stage.zero_position()
|
||||
|
||||
return jsonify(self.microscope.status["stage"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue