From 5cf63ae2dea00292b5675503ec4c2f9e1d002987 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sat, 19 Aug 2017 14:37:39 -0700 Subject: [PATCH] Refactored pocket and facing to use the same base class; added min travel and keep tool down to the interface - latter one is hidden since it currently doesn't seem to work. --- src/Mod/Path/CMakeLists.txt | 1 + .../Resources/panels/PageOpPocketFullEdit.ui | 58 ++++----- src/Mod/Path/PathScripts/PathMillFace.py | 92 +++------------ src/Mod/Path/PathScripts/PathPocket.py | 60 ++-------- src/Mod/Path/PathScripts/PathPocketBase.py | 111 ++++++++++++++++++ src/Mod/Path/PathScripts/PathPocketBaseGui.py | 69 +++++++---- src/Mod/Path/PathScripts/PathProfileBase.py | 14 +-- 7 files changed, 215 insertions(+), 190 deletions(-) create mode 100644 src/Mod/Path/PathScripts/PathPocketBase.py diff --git a/src/Mod/Path/CMakeLists.txt b/src/Mod/Path/CMakeLists.txt index 098221bdb7..4a649ea424 100644 --- a/src/Mod/Path/CMakeLists.txt +++ b/src/Mod/Path/CMakeLists.txt @@ -55,6 +55,7 @@ SET(PathScripts_SRCS PathScripts/PathOpGui.py PathScripts/PathPlane.py PathScripts/PathPocket.py + PathScripts/PathPocketBase.py PathScripts/PathPocketBaseGui.py PathScripts/PathPocketGui.py PathScripts/PathPost.py diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui index eaa7f70b5e..44e608d392 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui @@ -7,7 +7,7 @@ 0 0 398 - 454 + 513 @@ -67,20 +67,6 @@ - - - - Pass Extension - - - - - - - <html><head/><body><p>Specify by how much the facing operation should be extended beyond the shape boundaries defined by above selection.</p></body></html> - - - @@ -100,7 +86,7 @@ - <html><head/><body><p>The cutting mode assumes that the cut on one side of the tool bit represents the resulting part and the other side is either already milled away or will be removed later on.</p><p><br/></p><p>Keeping that in mind climb mode is called when the tool bit is moved into the cut on each rotation, wheras in conventional mode the tool bits rotation and the tools lateral movement are in the same direction.</p></body></html> + <html><head/><body><p>The cutting mode assumes that the cut on one side of the tool bit represents the resulting part and the other side is either already milled away or will be removed later on.</p><p>Keeping that in mind climb mode is called when the tool bit is moved into the cut on each rotation, wheras in conventional mode the tool bits rotation and the tools lateral movement are in the same direction.</p></body></html> @@ -166,14 +152,14 @@ - ZigZag Angle + Angle - <html><head/><body><p>Angle in degrees for the zig-zag pattern. Ignored otherwise.</p></body></html> + <html><head/><body><p>Angle in which the pattern is applied.</p></body></html> @@ -187,7 +173,7 @@ - <html><head/><body><p>The amount by which the tool is laterally displaced on each cycle of the pattern, specified in percent of the tool diameter.</p><p><br/></p><p>A step over of 100% results in no overlap between two different cycles.</p></body></html> + <html><head/><body><p>The amount by which the tool is laterally displaced on each cycle of the pattern, specified in percent of the tool diameter.</p><p>A step over of 100% results in no overlap between two different cycles.</p></body></html> 1 @@ -203,26 +189,26 @@ - - - - - - - - + + Material Allowance - + <html><head/><body><p>The amount of material that should be left by this operation in relation to the target shape.</p></body></html> + + + + + + @@ -233,11 +219,25 @@ + + + + Keep tool down + + + + + + + Min Travel + + + - + Qt::Vertical diff --git a/src/Mod/Path/PathScripts/PathMillFace.py b/src/Mod/Path/PathScripts/PathMillFace.py index c761691eed..935b10d763 100644 --- a/src/Mod/Path/PathScripts/PathMillFace.py +++ b/src/Mod/Path/PathScripts/PathMillFace.py @@ -26,26 +26,11 @@ from __future__ import print_function import FreeCAD import Part -import PathScripts.PathAreaOp as PathAreaOp import PathScripts.PathLog as PathLog -import PathScripts.PathOp as PathOp +import PathScripts.PathPocketBase as PathPocketBase import PathScripts.PathUtils as PathUtils -from PySide import QtCore, QtGui - -if True: - PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) - PathLog.trackModule(PathLog.thisModule()) -else: - PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) - -if FreeCAD.GuiUp: - import FreeCADGui - - -# Qt tanslation handling -def translate(context, text, disambig=None): - return QtCore.QCoreApplication.translate(context, text, disambig) +from PySide import QtCore __title__ = "Path Mill Face Operation" __author__ = "sliptonic (Brad Collette)" @@ -53,31 +38,27 @@ __url__ = "http://www.freecadweb.org" __doc__ = "Class and implementation of Mill Facing operation." -class ObjectFace(PathAreaOp.ObjectOp): +if True: + PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) + PathLog.trackModule(PathLog.thisModule()) +else: + PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) + + +# Qt tanslation handling +def translate(context, text, disambig=None): + return QtCore.QCoreApplication.translate(context, text, disambig) + +class ObjectFace(PathPocketBase.ObjectPocket): '''Proxy object for Mill Facing operation.''' - def areaOpFeatures(self, obj): - '''areaOpFeatures(obj) ... mill facing uses FinishDepth and is based on faces.''' - return PathOp.FeatureBaseFaces | PathOp.FeatureFinishDepth - - def initAreaOp(self, obj): - '''initAreaOp(obj) ... create operation specific properties''' - # Face Properties - obj.addProperty("App::PropertyEnumeration", "CutMode", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "The direction that the toolpath should go around the part ClockWise CW or CounterClockWise CCW")) - obj.CutMode = ['Climb', 'Conventional'] - obj.addProperty("App::PropertyDistance", "PassExtension", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "How far the cutter should extend past the boundary")) - obj.addProperty("App::PropertyEnumeration", "StartAt", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Start Faceing at center or boundary")) - obj.StartAt = ['Center', 'Edge'] - obj.addProperty("App::PropertyPercent", "StepOver", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Percent of cutter diameter to step over on each pass")) - obj.addProperty("App::PropertyBool", "KeepToolDown", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Attempts to avoid unnecessary retractions.")) - obj.addProperty("App::PropertyBool", "ZigUnidirectional", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Lifts tool at the end of each pass to respect cut mode.")) - obj.addProperty("App::PropertyBool", "UseZigZag", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Use Zig Zag pattern to clear area.")) - obj.addProperty("App::PropertyFloat", "ZigZagAngle", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Angle of the zigzag pattern")) + def initPocketOp(self, obj): + '''initPocketOp(obj) ... create facing specific properties''' obj.addProperty("App::PropertyEnumeration", "BoundaryShape", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Shape to use for calculating Boundary")) obj.BoundaryShape = ['Perimeter', 'Boundbox'] - obj.addProperty("App::PropertyEnumeration", "OffsetPattern", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "clearing pattern to use")) - obj.OffsetPattern = ['ZigZag', 'Offset', 'Spiral', 'ZigZagOffset', 'Line', 'Grid', 'Triangle'] + def pocketInvertExtraOffset(self): + return True def areaOpOnChanged(self, obj, prop): '''areaOpOnChanged(obj, prop) ... facing specific depths calculation.''' @@ -95,43 +76,6 @@ class ObjectFace(PathAreaOp.ObjectOp): obj.StartDepth = d.safe_height obj.FinalDepth = d.start_depth - def areaOpUseProjection(self, obj): - '''areaOpUseProjection(obj) ... return False''' - return False - - def areaOpAreaParams(self, obj, isHole): - '''areaOpAreaPrams(obj, isHole) ... return dictionary with mill facing area parameters''' - params = {} - params['Fill'] = 0 - params['Coplanar'] = 0 - params['PocketMode'] = 1 - params['SectionCount'] = -1 - params['Angle'] = obj.ZigZagAngle - params['FromCenter'] = (obj.StartAt == "Center") - params['PocketStepover'] = (self.radius * 2) * (float(obj.StepOver)/100) - params['PocketExtraOffset'] = 0 - obj.PassExtension.Value - - Pattern = ['ZigZag', 'Offset', 'Spiral', 'ZigZagOffset', 'Line', 'Grid', 'Triangle'] - params['PocketMode'] = Pattern.index(obj.OffsetPattern) + 1 - - params['ToolRadius'] = self.radius - - return params - - def areaOpPathParams(self, obj, isHole): - '''areaOpPathPrams(obj, isHole) ... return dictionary with mill facing path parameters''' - params = {} - params['feedrate'] = self.horizFeed - params['feedrate_v'] = self.vertFeed - params['verbose'] = True - params['resume_height'] = obj.StepDown - params['retraction'] = obj.ClearanceHeight.Value - - if obj.UseStartPoint and obj.StartPoint is not None: - params['start'] = obj.StartPoint - - return params - def areaOpShapes(self, obj): '''areaOpShapes(obj) ... return top face''' # Facing is done either against base objects diff --git a/src/Mod/Path/PathScripts/PathPocket.py b/src/Mod/Path/PathScripts/PathPocket.py index 08cb153e48..0e95c6e960 100644 --- a/src/Mod/Path/PathScripts/PathPocket.py +++ b/src/Mod/Path/PathScripts/PathPocket.py @@ -24,11 +24,10 @@ import FreeCAD import Part -import PathScripts.PathAreaOp as PathAreaOp import PathScripts.PathLog as PathLog -import PathScripts.PathOp as PathOp +import PathScripts.PathPocketBase as PathPocketBase +import PathScripts.PathUtils as PathUtils -from PathScripts import PathUtils from PySide import QtCore __doc__ = "Class and implementation of the Pocket operation." @@ -44,61 +43,16 @@ def translate(context, text, disambig=None): return QtCore.QCoreApplication.translate(context, text, disambig) -class ObjectPocket(PathAreaOp.ObjectOp): +class ObjectPocket(PathPocketBase.ObjectPocket): '''Proxy object for Pocket operation.''' - def areaOpFeatures(self, obj): - '''areaOpFeatures(obj) ... Pockets have a FinishDepth and work on Faces''' - return PathOp.FeatureBaseFaces | PathOp.FeatureFinishDepth + def initPocketOp(self, obj): + '''initPocketOp(obj) ... setup receiver''' + pass - def initAreaOp(self, obj): - '''initAreaOp(obj) ... create pocket specific properties.''' - PathLog.track() - - # Pocket Properties - obj.addProperty("App::PropertyEnumeration", "CutMode", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "The direction that the toolpath should go around the part ClockWise CW or CounterClockWise CCW")) - obj.CutMode = ['Climb', 'Conventional'] - obj.addProperty("App::PropertyDistance", "MaterialAllowance", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Amount of material to leave")) - obj.addProperty("App::PropertyEnumeration", "StartAt", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Start pocketing at center or boundary")) - obj.StartAt = ['Center', 'Edge'] - obj.addProperty("App::PropertyPercent", "StepOver", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Percent of cutter diameter to step over on each pass")) - obj.addProperty("App::PropertyFloat", "ZigZagAngle", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Angle of the zigzag pattern")) - obj.addProperty("App::PropertyEnumeration", "OffsetPattern", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "clearing pattern to use")) - obj.OffsetPattern = ['ZigZag', 'Offset', 'Spiral', 'ZigZagOffset', 'Line', 'Grid', 'Triangle'] - obj.addProperty("App::PropertyBool", "MinTravel", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Use 3D Sorting of Path")) - - def areaOpUseProjection(self, obj): - '''areaOpUseProjection(obj) ... return False''' + def pocketInvertExtraOffset(self): return False - def areaOpAreaParams(self, obj, isHole): - '''areaOpAreaParams(obj, isHole) ... return dictionary with pocket's area parameters''' - params = {} - params['Fill'] = 0 - params['Coplanar'] = 0 - params['PocketMode'] = 1 - params['SectionCount'] = -1 - params['Angle'] = obj.ZigZagAngle - params['FromCenter'] = (obj.StartAt == "Center") - params['PocketStepover'] = (self.radius * 2) * (float(obj.StepOver)/100) - params['PocketExtraOffset'] = obj.MaterialAllowance.Value - params['ToolRadius'] = self.radius - - Pattern = ['ZigZag', 'Offset', 'Spiral', 'ZigZagOffset', 'Line', 'Grid', 'Triangle'] - params['PocketMode'] = Pattern.index(obj.OffsetPattern) + 1 - return params - - def areaOpPathParams(self, obj, isHole): - '''areaOpAreaParams(obj, isHole) ... return dictionary with pocket's path parameters''' - params = {} - - # if MinTravel is turned on, set path sorting to 3DSort - # 3DSort shouldn't be used without a valid start point. Can cause - # tool crash without it. - if obj.MinTravel and obj.UseStartPoint and obj.StartPoint is not None: - params['sort_mode'] = 2 - return params - def areaOpShapes(self, obj): '''areaOpShapes(obj) ... return shapes representing the solids to be removed.''' PathLog.track() diff --git a/src/Mod/Path/PathScripts/PathPocketBase.py b/src/Mod/Path/PathScripts/PathPocketBase.py new file mode 100644 index 0000000000..23957c0c5a --- /dev/null +++ b/src/Mod/Path/PathScripts/PathPocketBase.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- + +# *************************************************************************** +# * * +# * Copyright (c) 2017 sliptonic * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +import PathScripts.PathAreaOp as PathAreaOp +import PathScripts.PathLog as PathLog +import PathScripts.PathOp as PathOp + +from PySide import QtCore + +__title__ = "Base Path Pocket Operation" +__author__ = "sliptonic (Brad Collette)" +__url__ = "http://www.freecadweb.org" +__doc__ = "Base class and implementation for Path pocket operations." + +if True: + PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) + PathLog.trackModule(PathLog.thisModule()) +else: + PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) + +# Qt tanslation handling +def translate(context, text, disambig=None): + return QtCore.QCoreApplication.translate(context, text, disambig) + +class ObjectPocket(PathAreaOp.ObjectOp): + '''Base class for proxy objects of all pocket operations.''' + + def areaOpFeatures(self, obj): + '''areaOpFeatures(obj) ... Pockets have a FinishDepth and work on Faces''' + return PathOp.FeatureBaseFaces | PathOp.FeatureFinishDepth + + def initAreaOp(self, obj): + '''initAreaOp(obj) ... create pocket specific properties. + Do not overwrite, implement initPocketOp(obj) instead.''' + PathLog.track() + + # Pocket Properties + obj.addProperty("App::PropertyEnumeration", "CutMode", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "The direction that the toolpath should go around the part ClockWise CW or CounterClockWise CCW")) + obj.CutMode = ['Climb', 'Conventional'] + obj.addProperty("App::PropertyDistance", "ExtraOffset", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Extra offset to apply to the operation. Direction is operation dependent.")) + obj.addProperty("App::PropertyEnumeration", "StartAt", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Start pocketing at center or boundary")) + obj.StartAt = ['Center', 'Edge'] + obj.addProperty("App::PropertyPercent", "StepOver", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Percent of cutter diameter to step over on each pass")) + obj.addProperty("App::PropertyFloat", "ZigZagAngle", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Angle of the zigzag pattern")) + obj.addProperty("App::PropertyEnumeration", "OffsetPattern", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "clearing pattern to use")) + obj.OffsetPattern = ['ZigZag', 'Offset', 'Spiral', 'ZigZagOffset', 'Line', 'Grid', 'Triangle'] + obj.addProperty("App::PropertyBool", "MinTravel", "Pocket", QtCore.QT_TRANSLATE_NOOP("App::Property", "Use 3D Sorting of Path")) + obj.addProperty("App::PropertyBool", "KeepToolDown", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Attempts to avoid unnecessary retractions.")) + + self.initPocketOp(obj) + + def areaOpRetractTool(self, obj): + PathLog.debug("retracting tool: %d" % (not obj.KeepToolDown)) + return not obj.KeepToolDown + + def areaOpUseProjection(self, obj): + '''areaOpUseProjection(obj) ... return False''' + return False + + def areaOpAreaParams(self, obj, isHole): + '''areaOpAreaParams(obj, isHole) ... return dictionary with pocket's area parameters''' + params = {} + params['Fill'] = 0 + params['Coplanar'] = 0 + params['PocketMode'] = 1 + params['SectionCount'] = -1 + params['Angle'] = obj.ZigZagAngle + params['FromCenter'] = (obj.StartAt == "Center") + params['PocketStepover'] = (self.radius * 2) * (float(obj.StepOver)/100) + extraOffset = obj.ExtraOffset.Value + if self.pocketInvertExtraOffset(): + extraOffset = 0 - extraOffset + params['PocketExtraOffset'] = extraOffset + params['ToolRadius'] = self.radius + + Pattern = ['ZigZag', 'Offset', 'Spiral', 'ZigZagOffset', 'Line', 'Grid', 'Triangle'] + params['PocketMode'] = Pattern.index(obj.OffsetPattern) + 1 + return params + + def areaOpPathParams(self, obj, isHole): + '''areaOpAreaParams(obj, isHole) ... return dictionary with pocket's path parameters''' + params = {} + + # if MinTravel is turned on, set path sorting to 3DSort + # 3DSort shouldn't be used without a valid start point. Can cause + # tool crash without it. + if obj.MinTravel and obj.UseStartPoint and obj.StartPoint is not None: + params['sort_mode'] = 2 + return params + diff --git a/src/Mod/Path/PathScripts/PathPocketBaseGui.py b/src/Mod/Path/PathScripts/PathPocketBaseGui.py index 7d19f99b33..279cedc415 100644 --- a/src/Mod/Path/PathScripts/PathPocketBaseGui.py +++ b/src/Mod/Path/PathScripts/PathPocketBaseGui.py @@ -60,14 +60,37 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): '''getForm() ... returns UI, adapted to the resutls from pocketFeatures()''' form = FreeCADGui.PySideUic.loadUi(":/panels/PageOpPocketFullEdit.ui") - if not FeaturePocket & self.pocketFeatures(): - form.pocketWidget.hide() - - if not FeatureFacing & self.pocketFeatures(): + if FeatureFacing & self.pocketFeatures(): + form.extraOffsetLabel.setText(translate("PathPocket", "Pass Extension")) + form.extraOffset.setToolTip(translate("PathPocket", "The distance the facing operation will extend beyond the boundary shape.")) + else: form.facingWidget.hide() + if True: + # currently doesn't have an effect + form.keepToolDown.hide() + return form + def updateMinTravel(self, obj, setModel=True): + if obj.UseStartPoint: + self.form.minTravel.setEnabled(True) + else: + self.form.minTravel.setChecked(False) + self.form.minTravel.setEnabled(False) + + if setModel and obj.MinTravel != self.form.minTravel.isChecked(): + obj.MinTravel = self.form.minTravel.isChecked() + + def updateZigZagAngle(self, obj, setModel=True): + if obj.OffsetPattern in ['Offset', 'Spiral']: + self.form.zigZagAngle.setEnabled(False) + else: + self.form.zigZagAngle.setEnabled(True) + + if setModel: + self.updateInputField(obj, 'ZigZagAngle', self.form.zigZagAngle) + def getFields(self, obj): '''getFields(obj) ... transfers values from UI to obj's proprties''' if obj.CutMode != str(self.form.cutMode.currentText()): @@ -76,35 +99,40 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): obj.StepOver = self.form.stepOverPercent.value() if obj.OffsetPattern != str(self.form.offsetPattern.currentText()): obj.OffsetPattern = str(self.form.offsetPattern.currentText()) - self.updateInputField(obj, 'ZigZagAngle', self.form.zigZagAngle) + self.updateInputField(obj, 'ExtraOffset', self.form.extraOffset) self.updateToolController(obj, self.form.toolController) + self.updateZigZagAngle(obj) - if FeaturePocket & self.pocketFeatures(): - self.updateInputField(obj, 'MaterialAllowance', self.form.extraOffset) - if obj.UseStartPoint != self.form.useStartPoint.isChecked(): - obj.UseStartPoint = self.form.useStartPoint.isChecked() + if obj.UseStartPoint != self.form.useStartPoint.isChecked(): + obj.UseStartPoint = self.form.useStartPoint.isChecked() + if obj.KeepToolDown != self.form.keepToolDown.isChecked(): + obj.KeepToolDown = self.form.keepToolDown.isChecked() + + self.updateMinTravel(obj) if FeatureFacing & self.pocketFeatures(): - self.updateInputField(obj, 'PassExtension', self.form.passExtension) if obj.BoundaryShape != str(self.form.boundaryShape.currentText()): obj.BoundaryShape = str(self.form.boundaryShape.currentText()) def setFields(self, obj): '''setFields(obj) ... transfers obj's property values to UI''' - self.form.zigZagAngle.setText(FreeCAD.Units.Quantity(obj.ZigZagAngle, FreeCAD.Units.Angle).UserString) self.form.stepOverPercent.setValue(obj.StepOver) + self.form.extraOffset.setText(FreeCAD.Units.Quantity(obj.ExtraOffset.Value, FreeCAD.Units.Length).UserString) + self.form.useStartPoint.setChecked(obj.UseStartPoint) + self.form.keepToolDown.setChecked(obj.KeepToolDown) + + self.form.zigZagAngle.setText(FreeCAD.Units.Quantity(obj.ZigZagAngle, FreeCAD.Units.Angle).UserString) + self.updateZigZagAngle(obj, False) + + self.form.minTravel.setChecked(obj.MinTravel) + self.updateMinTravel(obj, False) self.selectInComboBox(obj.OffsetPattern, self.form.offsetPattern) self.selectInComboBox(obj.CutMode, self.form.cutMode) self.setupToolController(obj, self.form.toolController) - if FeaturePocket & self.pocketFeatures(): - self.form.useStartPoint.setChecked(obj.UseStartPoint) - self.form.extraOffset.setText(FreeCAD.Units.Quantity(obj.MaterialAllowance.Value, FreeCAD.Units.Length).UserString) - if FeatureFacing & self.pocketFeatures(): - self.form.passExtension.setText(FreeCAD.Units.Quantity(obj.PassExtension.Value, FreeCAD.Units.Length).UserString) self.selectInComboBox(obj.BoundaryShape, self.form.boundaryShape) def getSignalsForUpdate(self, obj): @@ -116,13 +144,12 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): signals.append(self.form.stepOverPercent.editingFinished) signals.append(self.form.zigZagAngle.editingFinished) signals.append(self.form.toolController.currentIndexChanged) - - if FeaturePocket & self.pocketFeatures(): - signals.append(self.form.extraOffset.editingFinished) - signals.append(self.form.useStartPoint.clicked) + signals.append(self.form.extraOffset.editingFinished) + signals.append(self.form.useStartPoint.clicked) + signals.append(self.form.keepToolDown.clicked) + signals.append(self.form.minTravel.clicked) if FeatureFacing & self.pocketFeatures(): signals.append(self.form.boundaryShape.currentIndexChanged) - signals.append(self.form.passExtension.editingFinished) return signals diff --git a/src/Mod/Path/PathScripts/PathProfileBase.py b/src/Mod/Path/PathScripts/PathProfileBase.py index 6c61877013..7d7024142a 100644 --- a/src/Mod/Path/PathScripts/PathProfileBase.py +++ b/src/Mod/Path/PathScripts/PathProfileBase.py @@ -29,7 +29,7 @@ import PathScripts.PathOp as PathOp from PySide import QtCore -__title__ = "Path Contour Operation" +__title__ = "Base Path Profile Operation" __author__ = "sliptonic (Brad Collette)" __url__ = "http://www.freecadweb.org" __doc__ = "Base class and implementation for Path profile operations." @@ -40,22 +40,10 @@ if False: else: PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) -if FreeCAD.GuiUp: - import FreeCADGui - from PySide import QtGui - - # Qt tanslation handling def translate(context, text, disambig=None): return QtCore.QCoreApplication.translate(context, text, disambig) -__title__ = "Path Profile Operation" -__author__ = "sliptonic (Brad Collette)" -__url__ = "http://www.freecadweb.org" -__doc__ = "Base class and properties for all profile operations." - -"""Path Profile object and FreeCAD command for operating on sets of features""" - class ObjectProfile(PathAreaOp.ObjectOp): '''Base class for proxy objects of all profile operations.'''