Skip to content

Commit 4b906fb

Browse files
authored
Merge pull request #114 from openUC2/mergemaster
Update motor.py
2 parents e70451e + 221d46e commit 4b906fb

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

uc2rest/motor.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -718,23 +718,26 @@ def stop_stage_scanning(self):
718718

719719

720720

721-
def start_stage_scanning(self, xstart=0, xstep=1000, nx=20, ystart=0, ystep=1000, ny=10, settle=5, illumination=(0,0,0,0), led=0):
722-
#{ "task":"/motor_act", "stagescan":{ "xstart":0, "xstep":1000, "nx":20, "ystart":0, "ystep":1000, "ny":10, "settle":5, "stopped":0 }}
723-
#{"task": "/motor_act", "stagescan": {"xStart": 0, "yStart": 0, "xStep": 500, "yStep": 500, "nX": 10, "nY": 10, "tPre": 50, "tPost": 50, "illumination": [0, 1, 0, 0], "led": 255}}
724-
#{"task": "/motor_act", "stagescan": {"xStart": 0, "yStart": 0, "xStep": 500, "yStep": 500, "nX": 10, "nY": 10, "tPre": 50, "tPost": 50, "illumination": [0, 255, 255, 0], "led": 0}}
721+
def start_stage_scanning(self, xstart=0, xstep=1000, nx=20, ystart=0, ystep=1000, ny=10, tsettle=5, tExposure=50, illumination=(0,0,0,0), led=0, speed=20000, acceleration=None):
722+
# {"task": "/motor_act", "stagescan": {"xStart": 0, "yStart": 0, "xStep": 500, "yStep": 500, "nX": 10, "nY": 10, "tPre": 50, "tPost": 50, "illumination": [0, 1, 0, 0], "led": 255}}
723+
if acceleration is None:
724+
acceleration = self.DEFAULT_ACCELERATION
725725
path = "/motor_act"
726726
payload = {
727727
"task": path,
728728
"stagescan": {
729-
"xstart": xstart,
730-
"xstep": xstep,
731-
"nx": nx,
732-
"ystart": ystart,
733-
"ystep": ystep,
734-
"ny": ny,
735-
"settle": settle,
729+
"xStart": xstart,
730+
"xStep": xstep,
731+
"nX": nx,
732+
"yStart": ystart,
733+
"yStep": ystep,
734+
"nY": ny,
735+
"tPre": tsettle,
736+
"tPost": tExposure,
736737
"illumination": illumination,
737738
"led": led,
739+
"accel": self.DEFAULT_ACCELERATION, # default acceleration
740+
"speed": speed, # default speed
738741
}
739742
}
740743
r = self._parent.post_json(path, payload)

0 commit comments

Comments
 (0)