From: W. Trevor King Date: Mon, 30 Aug 2010 17:56:49 +0000 (-0400) Subject: Store a copy of params in CurveCommand._add_to_command_stack. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ff5770d43d76d7a96652cd887b30a66d87afd5a9;p=hooke.git Store a copy of params in CurveCommand._add_to_command_stack. We may modify the parameter dict later during the command's execution, and we want future runs via the command stack to replicate the first run from the raw initial parameters. If you don't do this, you'll get errors like $ ./bin/hk.py -c 'load_playlist test/data/vclamp_picoforce/playlist' -c 'start_command_capture' -c 'zero_surface_contact_point --block approach' -c 'zero_surface_contact_point --block retract' -c 'stop_command_capture' -c 'apply_command_stack_to_playlist --enable-evaluate' -c 'flat_filter_playlist --block retract --min_points 1' Success ... Failure Expected a list of Peaks, not : surface distance (m) not in retract (['z piezo (m)', 'deflection (m)', 'surface distance (m) (m)', 'surface deflection (m) (m)']):... where the units '(m)' were appended twice, once during the initial command run, and again during the reload's command stack exectution. --- diff --git a/hooke/plugin/curve.py b/hooke/plugin/curve.py index 5df5629..b287ee4 100644 --- a/hooke/plugin/curve.py +++ b/hooke/plugin/curve.py @@ -137,7 +137,7 @@ class CurveCommand (Command): pass # no need to place duplicate calls on the stack. else: curve.command_stack.append(CommandMessage( - self.name, params)) + self.name, dict(params))) class BlockCommand (CurveCommand):