Skip to content

Commit 9e96afa

Browse files
authored
Merge pull request #115 from openUC2/mergemaster
adding focusscanning
2 parents bad9867 + e4f936f commit 9e96afa

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

uc2rest/motor.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,38 @@ def setIsCoreXY(self, isCoreXY = False):
142142
def setMotorAxisOrder(self, order=[0,1,2,3]):
143143
self.motorAxisOrder = order
144144

145+
# { "task": "/motor_act", "focusscan": { "zStart": 0, "zStep": 50, "nZ": 20, "tPre": 80, "tTrig": 20, "tPost": 0, "led": 0, "illumination": [0, 255, 0, 0], "speed": 20000, "acceleration": 1000000, "qid": 42 }}
146+
def startFocusScanning(self, zStart=0, zStep=50, nZ=20, tPre=80, tTrig=20, tPost=0, led=0, illumination=[0, 255, 0, 0], speed=20000, acceleration=1000000, qid=42):
147+
path = "/motor_act"
148+
payload = {
149+
"task": path,
150+
"focusscan": {
151+
"zStart": zStart,
152+
"zStep": zStep,
153+
"nZ": nZ,
154+
"tPre": tPre,
155+
"tTrig": tTrig,
156+
"tPost": tPost,
157+
"led": led,
158+
"illumination": illumination,
159+
"speed": speed,
160+
"acceleration": acceleration,
161+
"qid": qid
162+
}
163+
}
164+
r = self._parent.post_json(path, payload)
165+
return r
166+
167+
def stopFocusScanning(self):
168+
path = "/motor_act"
169+
payload = {
170+
"task": path,
171+
"focusscan": {
172+
"stopped": 1
173+
}
174+
}
175+
r = self._parent.post_json(path, payload)
176+
return r
145177
'''################################################################################################################################################
146178
HIGH-LEVEL Functions that rely on basic REST-API functions
147179
################################################################################################################################################'''

0 commit comments

Comments
 (0)