Commit 06c8ac1b authored by sumpfralle's avatar sumpfralle

added warning for ContourFollow strategy combined with non-cylindrical cutter shape

recued log level for GTK message windows from ERROR to WARN (i.e.: more obvious, but also more annoying warnings)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@977 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 1630be10
......@@ -1052,7 +1052,7 @@ class ProjectGui:
self.no_dialog = no_dialog
if not self.no_dialog:
# register a logging handler for displaying error messages
pycam.Utils.log.add_gtk_gui(self.window, logging.ERROR)
pycam.Utils.log.add_gtk_gui(self.window, logging.WARN)
# register a callback for the log window
pycam.Utils.log.add_hook(self.add_log_message)
self.window.show()
......
......@@ -25,6 +25,7 @@ from pycam.PathGenerators import DropCutter, PushCutter, EngraveCutter, \
from pycam.Geometry.utils import number
from pycam.PathProcessors import PathAccumulator, SimpleCutter, ZigZagCutter, \
PolygonCutter, ContourCutter
from pycam.Cutters.CylindricalCutter import CylindricalCutter
import pycam.Cutters
import pycam.Toolpath.SupportGrid
import pycam.Toolpath.MotionGrid
......@@ -239,10 +240,10 @@ def generate_toolpath(model, tool_settings=None,
if result is None:
return None
elif result:
warning = "The contour model contains colliding line groups. " \
+ "This is not allowed in combination with an " \
+ "engraving offset.\nA collision was detected at " \
+ "(%.2f, %.2f, %.2f)." % (result.x, result.y, result.z)
warning = "The contour model contains colliding line groups. " + \
"This can cause problems with an engraving offset.\n" + \
"A collision was detected at (%.2f, %.2f, %.2f)." % \
(result.x, result.y, result.z)
log.warning(warning)
else:
# no collisions and no user interruption
......@@ -425,6 +426,10 @@ def _get_pathgenerator_instance(trimesh_models, contour_model, cutter,
else:
return ("Invalid postprocessor (%s) for 'ContourFollow' - it " \
+ "should be: SimpleCutter") % str(pathprocessor)
if not isinstance(cutter, CylindricalCutter):
log.warn("The ContourFollow strategy only works reliably with " + \
"the cylindrical cutter shape. Maybe you should use " + \
"the alternative ContourPolygon strategy instead.")
return ContourFollow.ContourFollow(cutter, trimesh_models, processor,
physics=physics)
else:
......
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