Skip to content

Commit

Permalink
Added GUI support to PathDeburr for directions selection
Browse files Browse the repository at this point in the history
Updated comments
  • Loading branch information
Schildkroet committed Feb 19, 2020
1 parent 66c1bfd commit f750c73
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui
Expand Up @@ -29,34 +29,48 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Tool Controller</string>
</property>
</widget>
</item>
<item row="0" column="1">
<item row="2" column="1">
<widget class="QComboBox" name="toolController">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The tool and its settings to be used for this operation.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Coolant Mode</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="3" column="1">
<widget class="QComboBox" name="coolantController">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The tool and its settings to be used for this operation.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Direction</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="direction">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The direction of the operation (CW or CCW).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
9 changes: 9 additions & 0 deletions src/Mod/Path/PathScripts/PathDeburr.py
Expand Up @@ -32,6 +32,15 @@

from PySide import QtCore

__title__ = "Path Deburr Operation"
__author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__doc__ = "Deburr operation."
__contributors__ = "Schildkroet"
__created__ = "2018"
__scriptVersion__ = "1.1"
__lastModified__ = "2020-02-19"

PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
#PathLog.trackModule(PathLog.thisModule())

Expand Down
11 changes: 11 additions & 0 deletions src/Mod/Path/PathScripts/PathDeburrGui.py
Expand Up @@ -35,6 +35,10 @@
__author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__doc__ = "Deburr operation page controller and command implementation."
__contributors__ = "Schildkroet"
__created__ = "2018"
__scriptVersion__ = "1.1"
__lastModified__ = "2020-02-19"

LOGLEVEL = False

Expand Down Expand Up @@ -64,6 +68,8 @@ def initPage(self, obj):
iconRound.addFile(':/icons/edge-join-round.svg', state=QtGui.QIcon.On)
self.form.joinMiter.setIcon(iconMiter)
self.form.joinRound.setIcon(iconRound)
self.form.direction.addItem('CW')
self.form.direction.addItem('CCW')

def getFields(self, obj):
PathGui.updateInputField(obj, 'Width', self.form.value_W)
Expand All @@ -72,6 +78,9 @@ def getFields(self, obj):
obj.Join = 'Round'
elif self.form.joinMiter.isChecked():
obj.Join = 'Miter'

if obj.Direction != str(self.form.direction.currentText()):
obj.Direction = str(self.form.direction.currentText())

self.updateToolController(obj, self.form.toolController)
self.updateCoolant(obj, self.form.coolantController)
Expand All @@ -84,6 +93,7 @@ def setFields(self, obj):
self.form.joinRound.setChecked('Round' == obj.Join)
self.form.joinMiter.setChecked('Miter' == obj.Join)
self.form.joinFrame.hide()
self.selectInComboBox(obj.Direction, self.form.direction)

def updateWidth(self):
PathGui.updateInputField(self.obj, 'Width', self.form.value_W)
Expand All @@ -96,6 +106,7 @@ def getSignalsForUpdate(self, obj):
signals.append(self.form.joinMiter.clicked)
signals.append(self.form.joinRound.clicked)
signals.append(self.form.coolantController.currentIndexChanged)
signals.append(self.form.direction.currentIndexChanged)
return signals

def registerSignalHandlers(self, obj):
Expand Down

0 comments on commit f750c73

Please sign in to comment.