From ce65794a109410882440fc17a9d8ae883e7827fb Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Sat, 21 Nov 2020 23:08:32 -0600 Subject: [PATCH] Path: Clean up comments and simplify one code block --- src/Mod/Path/PathScripts/PathCircularHoleBase.py | 12 ++---------- src/Mod/Path/PathScripts/PathDrilling.py | 13 ++++--------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathCircularHoleBase.py b/src/Mod/Path/PathScripts/PathCircularHoleBase.py index 37e4a87848..66a0441048 100644 --- a/src/Mod/Path/PathScripts/PathCircularHoleBase.py +++ b/src/Mod/Path/PathScripts/PathCircularHoleBase.py @@ -19,12 +19,6 @@ # * USA * # * * # *************************************************************************** -# * * -# * Additional modifications and contributions beginning 2019 * -# * Focus: 4th-axis integration * -# * by Russell Johnson * -# * * -# *************************************************************************** import FreeCAD import PathScripts.PathLog as PathLog @@ -50,9 +44,6 @@ __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecadweb.org" __doc__ = "Base class an implementation for operations on circular holes." __contributors__ = "russ4262 (Russell Johnson)" -__created__ = "2017" -__scriptVersion__ = "2b" -__lastModified__ = "2020-02-13 17:11 CST" # Qt translation handling @@ -339,7 +330,8 @@ class ObjectOp(PathOp.ObjectOp): 'angle': angle, 'axis': axis, 'trgtDep': obj.FinalDepth.Value, 'stkTop': stock.Shape.BoundBox.ZMax}) - # haveLocations are populated from Base Locations tab as (x,y) coordinates + # haveLocations are populated from user-provided (x, y) coordinates + # provided by the user in the Base Locations tab of the Task Editor window if haveLocations(self, obj): for location in obj.Locations: # holes.append({'x': location.x, 'y': location.y, 'r': 0, 'angle': 0.0, 'axis': 'X', 'holeBtm': obj.FinalDepth.Value}) diff --git a/src/Mod/Path/PathScripts/PathDrilling.py b/src/Mod/Path/PathScripts/PathDrilling.py index dcd95705f7..a646479e8b 100644 --- a/src/Mod/Path/PathScripts/PathDrilling.py +++ b/src/Mod/Path/PathScripts/PathDrilling.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2014 Yorik van Havre * -# * Copyright (c) 2020 russ4262 (Russell Johnson) * # * Copyright (c) 2020 Schildkroet * # * * # * This program is free software; you can redistribute it and/or modify * @@ -21,12 +20,6 @@ # * USA * # * * # *************************************************************************** -# * * -# * Additional modifications and contributions beginning 2019 * -# * Focus: 4th-axis integration * -# * by Russell Johnson * -# * * -# *************************************************************************** from __future__ import print_function @@ -43,6 +36,8 @@ __title__ = "Path Drilling Operation" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecadweb.org" __doc__ = "Path Drilling operation." +__contributors__ = "russ4262 (Russell Johnson)" + PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) # PathLog.trackModule(PathLog.thisModule()) @@ -198,8 +193,8 @@ class ObjectDrilling(PathCircularHoleBase.ObjectOp): # Initial setting for EnableRotation is taken from Job SetupSheet # User may override on per-operation basis as needed. - if hasattr(parentJob.SetupSheet, 'SetupEnableRotation'): - obj.EnableRotation = parentJob.SetupSheet.SetupEnableRotation + if hasattr(job.SetupSheet, 'SetupEnableRotation'): + obj.EnableRotation = job.SetupSheet.SetupEnableRotation else: obj.EnableRotation = 'Off'