From: W. Trevor King Date: Thu, 12 Jul 2012 21:57:10 +0000 (-0400) Subject: Show stepper position when commenting about steps in or out. X-Git-Tag: v0.4~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4ea842d09df176fd292b25e2d6f6fb9e44f1a048;p=pyafm.git Show stepper position when commenting about steps in or out. --- diff --git a/pyafm/afm.py b/pyafm/afm.py index b7adcfb..bda92d5 100644 --- a/pyafm/afm.py +++ b/pyafm/afm.py @@ -375,8 +375,8 @@ class AFM (object): _LOG.debug('fine tune the stepper position') while pos_m < -stepper_tolerance: # step back if we need to - _LOG.debug('step back') self.stepper.single_step(-1) + _LOG.debug('step back to {}'.format(self.stepper.position)) try: pos = self.piezo.get_surface_position( axis_name=self.config['main-axis'], @@ -389,8 +389,8 @@ class AFM (object): _LOG.debug('located surface at stepper %d, piezo %d (%g m)' % (self.stepper.position, pos, pos_m)) while pos_m > stepper_tolerance: # step forward if we need to - _LOG.debug('step forward') self.stepper.single_step(1) + _LOG.debug('step forward to {}'.format(self.stepper.position)) try: pos = self.piezo.get_surface_position( axis_name=self.config['main-axis'], @@ -446,6 +446,7 @@ class AFM (object): except _SurfaceError, e: _LOG.info(e) self.stepper.single_step(-1) # step out + _LOG.debug('stepped back to {}'.format(self.stepper.position)) _LOG.debug('giving up on finding the surface') _LOG.warn(e) raise e