From 4ea842d09df176fd292b25e2d6f6fb9e44f1a048 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 12 Jul 2012 17:57:10 -0400 Subject: [PATCH] Show stepper position when commenting about steps in or out. --- pyafm/afm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.26.2