From aeec1c8c884758e4ab0e83c817e83659f5bee0d7 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Mon, 12 Jun 2017 09:12:49 -0500 Subject: [PATCH] Path: added a hidden property to store the areaparams Useful for debugging. --- src/Mod/Path/PathScripts/PathContour.py | 6 ++++++ src/Mod/Path/PathScripts/PathMillFace.py | 5 +++++ src/Mod/Path/PathScripts/PathPocket.py | 5 +++++ src/Mod/Path/PathScripts/PathProfile.py | 6 ++++++ src/Mod/Path/PathScripts/PathProfileEdges.py | 6 ++++++ 5 files changed, 28 insertions(+) diff --git a/src/Mod/Path/PathScripts/PathContour.py b/src/Mod/Path/PathScripts/PathContour.py index 3c1ab1870d..1acc1399e1 100644 --- a/src/Mod/Path/PathScripts/PathContour.py +++ b/src/Mod/Path/PathScripts/PathContour.py @@ -83,6 +83,10 @@ class ObjectContour: obj.addProperty("App::PropertyDistance", "OffsetExtra", "Contour", QtCore.QT_TRANSLATE_NOOP("App::Property", "Extra value to stay away from final Contour- good for roughing toolpath")) + # Debug Parameters + obj.addProperty("App::PropertyString", "AreaParams", "Debug", QtCore.QT_TRANSLATE_NOOP("App::Property", "parameters used by PathArea")) + obj.setEditorMode('AreaParams', 2) # hide + obj.Proxy = self self.endVector = None @@ -147,6 +151,8 @@ class ObjectContour: PathLog.debug('depths: {}'.format(depthparams.get_depths())) profile.setParams(**profileparams) + obj.AreaParams = str(profile.getParams()) + PathLog.debug("Contour with params: {}".format(profile.getParams())) sections = profile.makeSections(mode=0, project=True, heights=depthparams.get_depths()) shapelist = [sec.getShape() for sec in sections] diff --git a/src/Mod/Path/PathScripts/PathMillFace.py b/src/Mod/Path/PathScripts/PathMillFace.py index 8c224aeb1c..cc232db931 100644 --- a/src/Mod/Path/PathScripts/PathMillFace.py +++ b/src/Mod/Path/PathScripts/PathMillFace.py @@ -89,6 +89,10 @@ class ObjectFace: obj.addProperty("App::PropertyVector", "StartPoint", "Start Point", QtCore.QT_TRANSLATE_NOOP("App::Property", "The start point of this path")) obj.addProperty("App::PropertyBool", "UseStartPoint", "Start Point", QtCore.QT_TRANSLATE_NOOP("App::Property", "make True, if specifying a Start Point")) + # Debug Parameters + obj.addProperty("App::PropertyString", "AreaParams", "Debug", QtCore.QT_TRANSLATE_NOOP("App::Property", "parameters used by PathArea")) + obj.setEditorMode('AreaParams', 2) # hide + obj.Proxy = self def onChanged(self, obj, prop): @@ -189,6 +193,7 @@ class ObjectFace: user_depths=None) boundary.setParams(**pocketparams) + obj.AreaParams = str(boundary.getParams()) sections = boundary.makeSections(mode=0, project=False, heights=depthparams.get_depths()) shapelist = [sec.getShape() for sec in sections] diff --git a/src/Mod/Path/PathScripts/PathPocket.py b/src/Mod/Path/PathScripts/PathPocket.py index f891d564ee..c0d75b5962 100644 --- a/src/Mod/Path/PathScripts/PathPocket.py +++ b/src/Mod/Path/PathScripts/PathPocket.py @@ -81,6 +81,10 @@ class ObjectPocket: obj.addProperty("App::PropertyVector", "StartPoint", "Start Point", QtCore.QT_TRANSLATE_NOOP("App::Property", "The start point of this path")) obj.addProperty("App::PropertyBool", "UseStartPoint", "Start Point", QtCore.QT_TRANSLATE_NOOP("App::Property", "make True, if specifying a Start Point")) + # Debug Parameters + obj.addProperty("App::PropertyString", "AreaParams", "Debug", QtCore.QT_TRANSLATE_NOOP("App::Property", "parameters used by PathArea")) + obj.setEditorMode('AreaParams', 2) # hide + obj.Proxy = self def onChanged(self, obj, prop): @@ -185,6 +189,7 @@ class ObjectPocket: pocketparams['PocketMode'] = Pattern.index(obj.OffsetPattern) + 1 pocket.setParams(**pocketparams) + obj.AreaParams = str(pocket.getParams()) PathLog.debug("Pocketing with params: {}".format(pocket.getParams())) depthparams = depth_params( diff --git a/src/Mod/Path/PathScripts/PathProfile.py b/src/Mod/Path/PathScripts/PathProfile.py index d45f284814..318b19e90f 100644 --- a/src/Mod/Path/PathScripts/PathProfile.py +++ b/src/Mod/Path/PathScripts/PathProfile.py @@ -85,6 +85,10 @@ class ObjectProfile: obj.addProperty("App::PropertyBool", "processPerimeter", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Profile the outline")) obj.addProperty("App::PropertyBool", "processCircles", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Profile round holes")) + # Debug Parameters + obj.addProperty("App::PropertyString", "AreaParams", "Debug", QtCore.QT_TRANSLATE_NOOP("App::Property", "parameters used by PathArea")) + obj.setEditorMode('AreaParams', 2) # hide + obj.Proxy = self def __getstate__(self): @@ -164,6 +168,8 @@ class ObjectProfile: profileparams['Offset'] = offsetval profile.setParams(**profileparams) + obj.AreaParams = str(profile.getParams()) + # PathLog.debug("About to profile with params: {}".format(profileparams)) PathLog.debug("About to profile with params: {}".format(profile.getParams())) diff --git a/src/Mod/Path/PathScripts/PathProfileEdges.py b/src/Mod/Path/PathScripts/PathProfileEdges.py index f58d502913..9731de825d 100644 --- a/src/Mod/Path/PathScripts/PathProfileEdges.py +++ b/src/Mod/Path/PathScripts/PathProfileEdges.py @@ -84,6 +84,10 @@ class ObjectProfile: obj.addProperty("App::PropertyDistance", "OffsetExtra", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Extra value to stay away from final profile- good for roughing toolpath")) + # Debug Parameters + obj.addProperty("App::PropertyString", "AreaParams", "Debug", QtCore.QT_TRANSLATE_NOOP("App::Property", "parameters used by PathArea")) + obj.setEditorMode('AreaParams', 2) # hide + obj.Proxy = self def __getstate__(self): @@ -155,6 +159,8 @@ class ObjectProfile: profile.setParams(**profileparams) # PathLog.debug("About to profile with params: {}".format(profileparams)) + obj.AreaParams = str(profile.getParams()) + PathLog.debug("About to profile with params: {}".format(profile.getParams())) depthparams = depth_params(