Commit 7d253508 authored by sumpfralle's avatar sumpfralle

call the multiprocessing handler with a callback function -> faster GUI


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@950 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent c0ec5abd
......@@ -298,7 +298,7 @@ class ContourFollow:
args = [(follow_model, self.cutter, self._up_vector, t, z)
for t in triangles if not id(t) in self._processed_triangles]
results_iter = run_in_parallel(_process_one_triangle, args,
unordered=True)
unordered=True, callback=progress_counter.update)
for result, ignore_triangle_id_list in results_iter:
if ignore_triangle_id_list:
self._processed_triangles.extend(ignore_triangle_id_list)
......
......@@ -109,7 +109,8 @@ class DropCutter:
xy_coords = [(pos.x, pos.y) for pos in one_grid_line]
args.append((xy_coords, minz, maxz, self.model, self.cutter,
self.physics))
for points in run_in_parallel(_process_one_grid_line, args):
for points in run_in_parallel(_process_one_grid_line, args,
callback=progress_counter.update):
self.pa.new_scanline()
if draw_callback and draw_callback(text="DropCutter: processing " \
+ "line %d/%d" % (current_line + 1, num_of_lines)):
......
......@@ -140,7 +140,8 @@ class PushCutter:
p1, p2 = line
args.append((p1, p2, depth, models, self.cutter, self.physics))
for points in run_in_parallel(_process_one_line, args):
for points in run_in_parallel(_process_one_line, args,
callback=progress_counter.update):
if points:
self.pa.new_scanline()
for p in points:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment