Broke type conversion out into hooke.util.convert and expanded its use.
[hooke.git] / hooke / plugin / vclamp.py
index 5751d3808ee6f94c98b939e8ec856c65f750b9cd..2365122aaff8a278397e62439ff845cda15e1fb0 100644 (file)
@@ -246,7 +246,7 @@ selects the retracting curve.
             help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
-        data = params['curve'].data[int(params['block'])] # HACK, int() should be handled by ui
+        data = params['curve'].data[params['block']]
         # HACK? rely on params['curve'] being bound to the local hooke
         # playlist (i.e. not a copy, as you would get by passing a
         # curve through the queue).  Ugh.  Stupid queues.  As an
@@ -267,8 +267,8 @@ selects the retracting curve.
         new.info['surface detection parameters'] = ps
         new[:,-2] = z_data - surface_offset
         new[:,-1] = d_data - deflection_offset
-        data = params['curve'].data[int(params['block'])] # HACK, int() should be handled by ui
-        params['curve'].data[int(params['block'])] = new # HACK, int() should be handled by ui
+        data = params['curve'].data[params['block']]
+        params['curve'].data[params['block']] = new
 
     def find_contact_point(self, curve, z_data, d_data, outqueue=None):
         """Railyard for the `find_contact_point_*` family.
@@ -433,7 +433,7 @@ selects the retracting curve.
             help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
-        data = params['curve'].data[int(params['block'])] # HACK, int() should be handled by ui
+        data = params['curve'].data[params['block']]
         # HACK? rely on params['curve'] being bound to the local hooke
         # playlist (i.e. not a copy, as you would get by passing a
         # curve through the queue).  Ugh.  Stupid queues.  As an
@@ -445,7 +445,7 @@ selects the retracting curve.
         new.info['columns'].append('deflection (N)')
         d_data = data[:,data.info['columns'].index('surface adjusted deflection (m)')]
         new[:,-1] = d_data * data.info['spring constant (N/m)']
-        params['curve'].data[int(params['block'])] = new # HACK, int() should be handled by ui
+        params['curve'].data[params['block']] = new
 
 
 class generalvclampCommands(object):