We need to know where we are before we can move somewhere
smoothly.
- >>> pos = _base.convert_volts_to_bits(p.config['axes'][0]['channel'], 0)
+ >>> pos = _base.convert_volts_to_bits(p.config.select_config(
+ ... 'axes', 'z')['channel'], 0)
>>> p.jump('z', pos)
Usually `.move_to_pos_or_def` is used to approach the surface, but
into the deflection input channel.
>>> target_pos = _base.convert_volts_to_bits(
- ... p.config['axes'][0]['channel'], 2)
+ ... p.config.select_config('axes', 'channel'), 2)
>>> step = int((target_pos - pos)/5)
- >>> target_def = _base.convert_volts_to_bits(p.config['inputs'][0], 3)
+ >>> target_def = _base.convert_volts_to_bits(
+ ... p.config.select_config('inputs', 'deflection'), 3)
>>> data = p.move_to_pos_or_def('z', target_pos, target_def, step=step,
... return_data=True)
>>> p.last_output == {'z': int(target_pos)}
>>> p.jump('z', pos)
>>> target_def = _base.convert_volts_to_bits(
- ... p.config['inputs'][0], 1)
+ ... p.config.select_config('inputs', 'deflection'), 1)
>>> data = p.move_to_pos_or_def('z', target_pos, target_def, step=step,
... return_data=True)
>>> print (p.last_output['z'] < int(target_pos))