Skip to content

Commit

Permalink
lgtm cleanup
Browse files Browse the repository at this point in the history
fix contradictory tooltip
  • Loading branch information
sliptonic committed Oct 7, 2020
1 parent 55c1506 commit 6f941c3
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 49 deletions.
105 changes: 105 additions & 0 deletions src/Mod/Path/Gui/Resources/panels/AxisMapEdit.ui
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TaskPanel</class>
<widget class="QWidget" name="TaskPanel">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>376</width>
<height>387</height>
</rect>
</property>
<property name="windowTitle">
<string>AxisMap Dressup</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>275</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblRadius">
<property name="text">
<string>Radius</string>
</property>
</widget>
</item>
<item row="0" column="2" colspan="2">
<widget class="Gui::QuantitySpinBox" name="radius">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The radius of the wrapped axis&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblAxisMapInput">
<property name="text">
<string>Axis Mapping</string>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<widget class="QComboBox" name="axisMapInput">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The input mapping axis. Coordinates of the first axis will be mapped to the second.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>X-&gt;A</string>
</property>
</item>
<item>
<property name="text">
<string>Y-&gt;A</string>
</property>
</item>
<item>
<property name="text">
<string>X-&gt;B</string>
</property>
</item>
<item>
<property name="text">
<string>Y-&gt;B</string>
</property>
</item>
<item>
<property name="text">
<string>X-&gt;C</string>
</property>
</item>
<item>
<property name="text">
<string>Y-&gt;C</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
33 changes: 10 additions & 23 deletions src/Mod/Path/PathScripts/PathSurface.py
Expand Up @@ -157,7 +157,7 @@ def opPropertyDefinitions(self):
("App::PropertyDistance", "InternalFeaturesAdjustment", "Selected Geometry Settings",
QtCore.QT_TRANSLATE_NOOP("App::Property", "Positive values push the cutter toward, or into, the feature. Negative values retract the cutter away from the feature.")),
("App::PropertyBool", "InternalFeaturesCut", "Selected Geometry Settings",
QtCore.QT_TRANSLATE_NOOP("App::Property", "Ignore internal feature areas within a larger selected face.")),
QtCore.QT_TRANSLATE_NOOP("App::Property", "Cut internal feature areas within a larger selected face.")),

("App::PropertyEnumeration", "BoundBox", "Clearing Options",
QtCore.QT_TRANSLATE_NOOP("App::Property", "Select the overall boundary for the operation.")),
Expand Down Expand Up @@ -249,8 +249,8 @@ def opPropertyDefaults(self, obj, job):
'AvoidLastX_Faces': 0,
'PatternCenterCustom': FreeCAD.Vector(0.0, 0.0, 0.0),
'GapThreshold': 0.005,
'AngularDeflection': 0.25, # AngularDeflection is unused
# Reasonable compromise between speed & precision
'AngularDeflection': 0.25, # AngularDeflection is unused
# Reasonable compromise between speed & precision
'LinearDeflection': 0.001,
# For debugging
'ShowTempObjects': False
Expand Down Expand Up @@ -341,7 +341,6 @@ def opApplyPropertyDefaults(self, obj, job, propList):
if isinstance(val, int) or isinstance(val, float):
setVal = True
if setVal:
propVal = getattr(prop, 'Value')
setattr(prop, 'Value', val)
else:
setattr(obj, n, val)
Expand Down Expand Up @@ -625,7 +624,6 @@ def opExecute(self, obj):
self.commandlist.extend(CMDS)
else:
PathLog.error('Failed to pre-process model and/or selected face(s).')


# ###### CLOSING COMMANDS FOR OPERATION ######

Expand Down Expand Up @@ -973,7 +971,6 @@ def _planarPerformOclScan(self, obj, pdc, pathGeom, offsetPoints=False):
return SCANS

def _planarDropCutScan(self, pdc, A, B):
#PNTS = list()
(x1, y1) = A
(x2, y2) = B
path = ocl.Path() # create an empty path object
Expand All @@ -988,7 +985,6 @@ def _planarDropCutScan(self, pdc, A, B):
return PNTS # pdc.getCLPoints()

def _planarCircularDropCutScan(self, pdc, Arc, cMode):
PNTS = list()
path = ocl.Path() # create an empty path object
(sp, ep, cp) = Arc

Expand Down Expand Up @@ -1038,7 +1034,6 @@ def _planarDropCutSingle(self, JOB, obj, pdc, safePDC, depthparams, SCANDATA):
PRTS = SCANDATA[so]
lenPRTS = len(PRTS)
first = PRTS[0][0] # first point of arc/line stepover group
start = PRTS[0][0] # will change with each line/arc segment
last = None
cmds.append(Path.Command('N (Begin step {}.)'.format(so), {}))

Expand Down Expand Up @@ -1068,7 +1063,6 @@ def _planarDropCutSingle(self, JOB, obj, pdc, safePDC, depthparams, SCANDATA):
tolrnc))
else:
cmds.append(Path.Command('N (part {}.)'.format(i + 1), {}))
start = prt[0]
last = prt[lenPrt - 1]
if so == peIdx or peIdx == -1:
cmds.extend(self._planarSinglepassProcess(obj, prt))
Expand Down Expand Up @@ -1129,18 +1123,15 @@ def _planarDropCutMulti(self, JOB, obj, pdc, safePDC, depthparams, SCANDATA):
peIdx = lenSCANDATA - 1

# Process each layer in depthparams
prvLyrFirst = None
prvLyrLast = None
lastPrvStpLast = None
for lyr in range(0, lenDP):
odd = True # ZigZag directional switch
lyrHasCmds = False
actvSteps = 0
LYR = list()
prvStpFirst = None
if lyr > 0:
if prvStpLast is not None:
lastPrvStpLast = prvStpLast
# if lyr > 0:
# if prvStpLast is not None:
# lastPrvStpLast = prvStpLast
prvStpLast = None
lyrDep = depthparams[lyr]
PathLog.debug('Multi-pass lyrDep: {}'.format(round(lyrDep, 4)))
Expand Down Expand Up @@ -1244,7 +1235,6 @@ def _planarDropCutMulti(self, JOB, obj, pdc, safePDC, depthparams, SCANDATA):
if prtsHasCmds is True:
stepHasCmds = True
actvSteps += 1
prvStpFirst = first
stpOvrCmds.extend(transCmds)
stpOvrCmds.append(Path.Command('N (Begin step {}.)'.format(so), {}))
stpOvrCmds.append(Path.Command('G0', {'X': first.x, 'Y': first.y, 'F': self.horizRapid}))
Expand All @@ -1253,7 +1243,6 @@ def _planarDropCutMulti(self, JOB, obj, pdc, safePDC, depthparams, SCANDATA):

# Layer transition at first active step over in current layer
if actvSteps == 1:
prvLyrFirst = first
LYR.append(Path.Command('N (Layer {} begins)'.format(lyr), {}))
if lyr > 0:
LYR.append(Path.Command('N (Layer transition)', {}))
Expand All @@ -1267,7 +1256,6 @@ def _planarDropCutMulti(self, JOB, obj, pdc, safePDC, depthparams, SCANDATA):

# Close layer, saving commands, if any
if lyrHasCmds is True:
prvLyrLast = last
GCODE.extend(LYR) # save line commands
GCODE.append(Path.Command('N (End of layer {})'.format(lyr), {}))

Expand Down Expand Up @@ -1366,13 +1354,13 @@ def _planarMultipassProcess(self, obj, PNTS, lMax):
prcs = False
if onHold is False:
onHold = True
output.append( Path.Command('N (Start hold)', {}) )
output.append( Path.Command('G0', {'Z': clrScnLn, 'F': self.vertRapid}) )
output.append(Path.Command('N (Start hold)', {}))
output.append(Path.Command('G0', {'Z': clrScnLn, 'F': self.vertRapid}))
else:
if onHold is True:
onHold = False
output.append( Path.Command('N (End hold)', {}) )
output.append( Path.Command('G0', {'X': pnt.x, 'Y': pnt.y, 'F': self.horizRapid}) )
output.append(Path.Command('N (End hold)', {}))
output.append(Path.Command('G0', {'X': pnt.x, 'Y': pnt.y, 'F': self.horizRapid}))

# Process point
if prcs is True:
Expand Down Expand Up @@ -1541,7 +1529,6 @@ def _planarGetPDC(self, stl, finalDep, SampleInterval, cutter):
pdc.setSampling(SampleInterval) # set sampling size
return pdc


# Main rotational scan functions
def _processRotationalOp(self, JOB, obj, mdlIdx, compoundFaces=None):
PathLog.debug('_processRotationalOp(self, JOB, obj, mdlIdx, compoundFaces=None)')
Expand Down

0 comments on commit 6f941c3

Please sign in to comment.