Skip to content

Commit

Permalink
Fix EnableRotation property
Browse files Browse the repository at this point in the history
PathCircularHoleBase uses `EnableRotation` property
  • Loading branch information
Russ4262 committed Jul 3, 2019
1 parent 3203ace commit d5356d2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Mod/Path/PathScripts/PathHelix.py
Expand Up @@ -30,9 +30,18 @@
import PathScripts.PathOp as PathOp

from PathScripts.PathUtils import fmt
from PathScripts.PathUtils import findParentJob
from PySide import QtCore

__title__ = "Path Helix Drill Operation"
__author__ = "Lorenz Hüdepohl"
__url__ = "http://www.freecadweb.org"
__doc__ = "Class and implementation of Helix Drill operation"
__contributors__ = "russ4262 (Russell Johnson)"
__created__ = "2016"
__scriptVersion__ = "1a testing"
__lastModified__ = "2019-07-03 11:45 CST"


def translate(context, text, disambig=None):
return QtCore.QCoreApplication.translate(context, text, disambig)
Expand All @@ -55,6 +64,11 @@ def initCircularHoleOperation(self, obj):

obj.addProperty("App::PropertyLength", "StepOver", "Helix Drill", translate("PathHelix", "Radius increment (must be smaller than tool diameter)"))

# Rotation related properties
if not hasattr(obj, 'EnableRotation'):
obj.addProperty("App::PropertyEnumeration", "EnableRotation", "Rotation", QtCore.QT_TRANSLATE_NOOP("App::Property", "Enable rotation to gain access to pockets/areas not normal to Z axis."))
obj.EnableRotation = ['Off', 'A(x)', 'B(y)', 'A & B']

def circularHoleExecute(self, obj, holes):
'''circularHoleExecute(obj, holes) ... generate helix commands for each hole in holes'''
PathLog.track()
Expand Down Expand Up @@ -191,11 +205,20 @@ def opSetDefaultValues(self, obj, job):
obj.StartSide = "Inside"
obj.StepOver = 100

# Initial setting for EnableRotation is taken from Job SetupSheet
# User may override on per-operation basis as needed.
parentJob = findParentJob(obj) # PathUtils.findParentJob(obj)
if hasattr(parentJob.SetupSheet, 'SetupEnableRotation'):
obj.EnableRotation = parentJob.SetupSheet.SetupEnableRotation
else:
obj.EnableRotation = 'Off'

def SetupProperties():
setup = []
setup.append("Direction")
setup.append("StartSide")
setup.append("StepOver")
setup.append("EnableRotation")
return setup

def Create(name, obj = None):
Expand Down

0 comments on commit d5356d2

Please sign in to comment.