Commit d619fef1 authored by Robert's avatar Robert Committed by ohmacht@zwei-g.de

-remember last requested position and only detour if current requested...

-remember last requested position and only detour if current requested position differs (in x or y, but not z)
parent 689a2b8d
......@@ -109,11 +109,14 @@ class WITecCOM(InstrumentComBase):
self.advancedInterface = False
self.doAutoFocus = False
self.logger = logger
self.lastRequestedXY = -1., -1.
def connect(self):
if not self.IBUCSAccess.RequestWriteAccess(True):
self.connected = False
return self.connected
self.lastRequestedXY = -1., -1.
IBUCSCore = win32com.client.CastTo(self.IBUCSAccess, 'IBUCSCore')
self.VersionInterface = IBUCSCore.GetSubSystemDefaultInterface("Status|Software|Application|ProgramVersion")
......@@ -314,12 +317,13 @@ class WITecCOM(InstrumentComBase):
@comErrorRepeater
def moveToAbsolutePosition(self, x, y, z=None, epsxy=0.11, epsz=0.011):
initpos = self.getPosition()
if initpos[0] - x > 0. + epsxy or initpos[1] - y > 0. + epsxy:
if self.lastRequestedXY[0] != x or self.lastRequestedXY[1] != y:
self.logger.info('moving near requested position')
self.moveToXY(x - 30., y - 30., epsxy)
self.logger.info('moving constant distance to measuring position')
self.logger.info('moving constant distance to measuring position')
self.moveToXY(x, y, epsxy)
self.lastRequestedXY = x, y
if z is not None:
self.moveZto(z, epsz)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment