Commit 68221da6 authored by sumpfralle's avatar sumpfralle

fixed tool progress visalization that was broken recently


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@336 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 834891fb
......@@ -1542,7 +1542,9 @@ class ProjectGui:
self.last_update = time.time()
self.max_fps = max_fps
self.func = func
def update(self, text=None, percent=None):
def update(self, text=None, percent=None, tool_position=None):
if not tool_position is None:
parent.cutter.moveto(tool_position)
parent.update_progress_bar(text, percent)
if (time.time() - self.last_update) > 1.0/self.max_fps:
self.last_update = time.time()
......@@ -1604,6 +1606,7 @@ class ProjectGui:
"radius": tool_settings["tool_radius"],
"torus_radius": tool_settings["torus_radius"],
}
self.cutter = pycam.Cutters.get_tool_from_settings(tool_dict)
# run the toolpath generation
toolpath = pycam.Toolpath.Generator.generate_toolpath(self.model,
tool_dict, bounds=bounds,
......
......@@ -128,7 +128,7 @@ class DropCutter:
for next_point in points:
pa.append(next_point)
self.cutter.moveto(next_point)
if draw_callback and draw_callback():
if draw_callback and draw_callback(tool_position=next_point):
finished_line = True
dims[0].shift(d0)
......
......@@ -211,7 +211,7 @@ class PushCutter:
if points:
self.cutter.moveto(points[-1])
if draw_callback:
draw_callback()
draw_callback(tool_position=points[-1])
self.pa.end_scanline()
if dx > 0:
......@@ -398,7 +398,7 @@ class PushCutter:
self.cutter.moveto(begin)
self.cutter.moveto(end)
if draw_callback:
draw_callback()
draw_callback(tool_position=end)
if DEBUG_PUSHCUTTER3:
self.svg.stroke("red' stroke-width='0.1")
self.svg.AddLine(begin.x, z-0.1, end.x, z-0.1)
......
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