Commit a6a399cf authored by sumpfralle's avatar sumpfralle

fix visual drill progress updates again

change default safety heigth to 25 (before: 5)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@595 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 26a25e8b
...@@ -715,7 +715,10 @@ def draw_complete_model_view(settings): ...@@ -715,7 +715,10 @@ def draw_complete_model_view(settings):
GL.glColor3f(*settings.get("color_support_grid")) GL.glColor3f(*settings.get("color_support_grid"))
settings.get("support_grid").to_OpenGL() settings.get("support_grid").to_OpenGL()
# draw the toolpath # draw the toolpath
if settings.get("show_toolpath"): # don't do it, if a new toolpath is just being calculated
if settings.get("show_toolpath") \
and not (settings.get("show_drill_progress") \
and (not settings.get("toolpath_in_progress") is None)):
for toolpath_obj in settings.get("toolpath"): for toolpath_obj in settings.get("toolpath"):
if toolpath_obj.visible: if toolpath_obj.visible:
draw_toolpath(toolpath_obj.get_path(), draw_toolpath(toolpath_obj.get_path(),
...@@ -727,6 +730,12 @@ def draw_complete_model_view(settings): ...@@ -727,6 +730,12 @@ def draw_complete_model_view(settings):
if not cutter is None: if not cutter is None:
GL.glColor3f(*settings.get("color_cutter")) GL.glColor3f(*settings.get("color_cutter"))
cutter.to_OpenGL() cutter.to_OpenGL()
# also show the toolpath that is currently being calculated
toolpath_in_progress = settings.get("toolpath_in_progress")
if not toolpath_in_progress is None:
draw_toolpath(toolpath_in_progress,
settings.get("color_toolpath_cut"),
settings.get("color_toolpath_return"))
@keep_gl_mode @keep_gl_mode
@keep_matrix @keep_matrix
......
...@@ -860,8 +860,8 @@ class ProjectGui: ...@@ -860,8 +860,8 @@ class ProjectGui:
location = pycam.Utils.get_external_program_location(key) location = pycam.Utils.get_external_program_location(key)
if not location: if not location:
log.error("Failed to locate the external program '%s'. " % key \ log.error("Failed to locate the external program '%s'. " % key \
+ "Please install the program and try again.\nOr maybe" \ + "Please install the program and try again.\n" \
+ "you need to specify the location manually.") + "Or maybe you need to specify the location manually.")
else: else:
# store the new setting # store the new setting
self.settings.set("external_program_%s" % key, location) self.settings.set("external_program_%s" % key, location)
...@@ -2398,9 +2398,12 @@ class ProjectGui: ...@@ -2398,9 +2398,12 @@ class ProjectGui:
self.last_update = time.time() self.last_update = time.time()
self.max_fps = max_fps self.max_fps = max_fps
self.func = func self.func = func
def update(self, text=None, percent=None, tool_position=None): def update(self, text=None, percent=None, tool_position=None,
toolpath=None):
if not tool_position is None: if not tool_position is None:
parent.cutter.moveto(tool_position) parent.cutter.moveto(tool_position)
if not toolpath is None:
parent.settings.set("toolpath_in_progress", toolpath)
if (time.time() - self.last_update) > 1.0/self.max_fps: if (time.time() - self.last_update) > 1.0/self.max_fps:
self.last_update = time.time() self.last_update = time.time()
if self.func: if self.func:
...@@ -2437,6 +2440,8 @@ class ProjectGui: ...@@ -2437,6 +2440,8 @@ class ProjectGui:
return False return False
log.info("Toolpath generation time: %f" % (time.time() - start_time)) log.info("Toolpath generation time: %f" % (time.time() - start_time))
# don't show the new toolpath anymore
self.settings.set("toolpath_in_progress", None)
if toolpath is None: if toolpath is None:
# user interruption # user interruption
......
...@@ -174,7 +174,7 @@ tool_radius: 0.5 ...@@ -174,7 +174,7 @@ tool_radius: 0.5
[ProcessDefault] [ProcessDefault]
path_direction: x path_direction: x
safety_height: 5 safety_height: 25
engrave_offset: 0.0 engrave_offset: 0.0
[Process0] [Process0]
......
...@@ -141,7 +141,8 @@ class DropCutter: ...@@ -141,7 +141,8 @@ class DropCutter:
# "draw_callback" returns true, if the user requested to quit # "draw_callback" returns true, if the user requested to quit
# via the GUI. # via the GUI.
# The progress counter may return True, if cancel was requested. # The progress counter may return True, if cancel was requested.
if (draw_callback and draw_callback(tool_position=p)) \ if (draw_callback and draw_callback(tool_position=p,
toolpath=self.pa.paths)) \
or (progress_counter.increment()): or (progress_counter.increment()):
quit_requested = True quit_requested = True
break break
......
...@@ -156,7 +156,7 @@ class EngraveCutter: ...@@ -156,7 +156,7 @@ class EngraveCutter:
pa.append(p) pa.append(p)
self.cutter.moveto(p) self.cutter.moveto(p)
if draw_callback: if draw_callback:
draw_callback(tool_position=p) draw_callback(tool_position=p, toolpath=pa.paths)
def GenerateToolPathLineDrop(self, pa, line, minz, maxz, horiz_step, def GenerateToolPathLineDrop(self, pa, line, minz, maxz, horiz_step,
...@@ -201,7 +201,8 @@ class EngraveCutter: ...@@ -201,7 +201,8 @@ class EngraveCutter:
self.cutter.moveto(p) self.cutter.moveto(p)
# "draw_callback" returns true, if the user requested quitting via # "draw_callback" returns true, if the user requested quitting via
# the GUI. # the GUI.
if draw_callback and draw_callback(tool_position=p): if draw_callback \
and draw_callback(tool_position=p, toolpath=pa.paths):
break break
pa.end_scanline() pa.end_scanline()
pa.end_direction() pa.end_direction()
......
...@@ -141,7 +141,7 @@ class PushCutter: ...@@ -141,7 +141,7 @@ class PushCutter:
self.pa.append(p) self.pa.append(p)
self.cutter.moveto(p) self.cutter.moveto(p)
if draw_callback: if draw_callback:
draw_callback(tool_position=p) draw_callback(tool_position=p, toolpath=self.pa.paths)
self.pa.end_scanline() self.pa.end_scanline()
# update the progress counter # update the progress counter
......
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