From: W. Trevor King Date: Tue, 27 Sep 2011 20:22:58 +0000 (-0400) Subject: Update config arguments to bit/volt/meter conversion functions. X-Git-Tag: v0.4~52 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5c2f8e31ec03a44d304223116a3d0ce32ff279e4;p=pyafm.git Update config arguments to bit/volt/meter conversion functions. --- diff --git a/pyafm/afm.py b/pyafm/afm.py index 8ae61fa..b03ad05 100644 --- a/pyafm/afm.py +++ b/pyafm/afm.py @@ -81,8 +81,8 @@ class AFM (object): axis = self.piezo.axis_by_name(self.axis_name) - zero = _convert_volts_to_bits(axis.axis_channel_config, 0) - target_def = _convert_volts_to_bits(axis.axis_channel_config, setpoint) + zero = _convert_volts_to_bits(axis.config['channel'], 0) + target_def = _convert_volts_to_bits(axis.config['channel'], setpoint) _LOG.debug('zero the %s piezo output' % self.axis_name) self.piezo.jump(axis_name=self.axis_name, position=zero) @@ -100,8 +100,7 @@ class AFM (object): pos = self._stepper_approach_again( target_deflection=target_def, far=far) - pos_m = _convert_bits_to_meters( - axis.axis_channel_config, axis.axis_config, pos) + pos_m = _convert_bits_to_meters(axis.config, pos) _LOG.debug('located surface at stepper %d, piezo %d (%g m)' % (self.stepper.position, pos, pos_m)) @@ -115,8 +114,7 @@ class AFM (object): except _FlatFit, e: _LOG.debug(e) continue - pos_m = _convert_bits_to_meters( - axis.axis_channel_config, axis.axis_config, pos) + pos_m = _convert_bits_to_meters(axis.config, pos) _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 @@ -128,16 +126,14 @@ class AFM (object): except _FlatFit, e: _LOG.debug(e) continue - pos_m = _convert_bits_to_meters( - axis.axis_channel_config, axis.axis_config, pos) + pos_m = _convert_bits_to_meters(axis.config, pos) _LOG.debug('located surface at stepper %d, piezo %d (%g m)' % (self.stepper.position, pos, pos_m)) _LOG.debug('adjust the %s piezo to place us just onto the surface' % self.axis_name) target_m = pos_m + depth - target = _convert_meters_to_bits( - axis.axis_channel_config, axis.axis_config, target_m) + target = _convert_meters_to_bits(axis.config, target_m) self.piezo.jump(self.axis_name, target) _LOG.debug(