Navigation Menu

Skip to content

Commit

Permalink
Removed 'Use Tip Length' and added 'Extra Offset' in Drilling OP
Browse files Browse the repository at this point in the history
  • Loading branch information
Schildkroet committed Mar 9, 2020
1 parent 4234048 commit 16c33fd
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 16 deletions.
34 changes: 26 additions & 8 deletions src/Mod/Path/Gui/Resources/panels/PageOpDrillingEdit.ui
Expand Up @@ -63,13 +63,6 @@
<item row="1" column="0">
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="7" column="1">
<widget class="QCheckBox" name="useTipLength">
<property name="text">
<string>Use Tip Length</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QLabel" name="dwellTimelabel">
<property name="enabled">
Expand Down Expand Up @@ -135,6 +128,32 @@
</property>
</widget>
</item>
<item row="7" column="4">
<widget class="QLabel" name="Offsetlabel">
<property name="text">
<string>Extra Offset</string>
</property>
</widget>
</item>
<item row="7" column="6">
<widget class="QComboBox" name="ExtraOffset">
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Tip Length</string>
</property>
</item>
<item>
<property name="text">
<string>2x Tip Length</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -164,7 +183,6 @@
<tabstop>toolController</tabstop>
<tabstop>peckEnabled</tabstop>
<tabstop>dwellEnabled</tabstop>
<tabstop>useTipLength</tabstop>
</tabstops>
<resources/>
<connections/>
Expand Down
7 changes: 6 additions & 1 deletion src/Mod/Path/PathScripts/PathDrilling.py
Expand Up @@ -75,6 +75,8 @@ def initCircularHoleOperation(self, obj):
obj.addProperty("App::PropertyEnumeration", "ReturnLevel", "Drill", QtCore.QT_TRANSLATE_NOOP("App::Property", "Controls how tool retracts Default=G99"))
obj.ReturnLevel = ['G99', 'G98'] # Canned Cycle Return Level
obj.addProperty("App::PropertyDistance", "RetractHeight", "Drill", QtCore.QT_TRANSLATE_NOOP("App::Property", "The height where feed starts and height during retract tool when path is finished while in a peck operation"))
obj.addProperty("App::PropertyEnumeration", "ExtraOffset", "Drill", QtCore.QT_TRANSLATE_NOOP("App::Property", "How far the drill depth is extended"))
obj.ExtraOffset = ['None', 'Tip Length', '2x Tip Length'] # Canned Cycle Return Level

# Rotation related properties
if not hasattr(obj, 'EnableRotation'):
Expand Down Expand Up @@ -103,8 +105,10 @@ def circularHoleExecute(self, obj, holes):
self.commandlist.append(Path.Command('G0', {'Z': obj.ClearanceHeight.Value, 'F': self.vertRapid}))

tiplength = 0.0
if obj.AddTipLength:
if obj.ExtraOffset == 'Tip Length':
tiplength = PathUtils.drillTipLength(self.tool)
elif obj.ExtraOffset == '2x Tip Length':
tiplength = PathUtils.drillTipLength(self.tool) * 2

holes = PathUtils.sort_jobs(holes, ['x', 'y'])
self.commandlist.append(Path.Command('G90'))
Expand Down Expand Up @@ -218,6 +222,7 @@ def SetupProperties():
setup.append("DwellEnabled")
setup.append("AddTipLength")
setup.append("ReturnLevel")
setup.append("ExtraDepth")
setup.append("RetractHeight")
setup.append("EnableRotation")
setup.append("ReverseDirection")
Expand Down
11 changes: 4 additions & 7 deletions src/Mod/Path/PathScripts/PathDrillingGui.py
Expand Up @@ -97,8 +97,8 @@ def getFields(self, obj):
obj.DwellEnabled = self.form.dwellEnabled.isChecked()
if obj.PeckEnabled != self.form.peckEnabled.isChecked():
obj.PeckEnabled = self.form.peckEnabled.isChecked()
if obj.AddTipLength != self.form.useTipLength.isChecked():
obj.AddTipLength = self.form.useTipLength.isChecked()
if obj.ExtraOffset != str(self.form.ExtraOffset.currentText()):
obj.ExtraOffset = str(self.form.ExtraOffset.currentText())

self.updateToolController(obj, self.form.toolController)
self.updateCoolant(obj, self.form.coolantController)
Expand All @@ -118,10 +118,7 @@ def setFields(self, obj):
else:
self.form.peckEnabled.setCheckState(QtCore.Qt.Unchecked)

if obj.AddTipLength:
self.form.useTipLength.setCheckState(QtCore.Qt.Checked)
else:
self.form.useTipLength.setCheckState(QtCore.Qt.Unchecked)
self.selectInComboBox(obj.ExtraOffset, self.form.ExtraOffset)

self.setupToolController(obj, self.form.toolController)
self.setupCoolant(obj, self.form.coolantController)
Expand All @@ -136,10 +133,10 @@ def getSignalsForUpdate(self, obj):
signals.append(self.form.dwellTime.editingFinished)
signals.append(self.form.dwellEnabled.stateChanged)
signals.append(self.form.peckEnabled.stateChanged)
signals.append(self.form.useTipLength.stateChanged)
signals.append(self.form.toolController.currentIndexChanged)
signals.append(self.form.coolantController.currentIndexChanged)
signals.append(self.form.coolantController.currentIndexChanged)
signals.append(self.form.ExtraOffset.currentIndexChanged)

return signals

Expand Down

0 comments on commit 16c33fd

Please sign in to comment.