From f750c7398c09418c8c32c0aef83853d7e0068ce4 Mon Sep 17 00:00:00 2001 From: Patrick Felixberger Date: Wed, 19 Feb 2020 18:35:23 +0100 Subject: [PATCH 1/4] Added GUI support to PathDeburr for directions selection Updated comments --- .../Gui/Resources/panels/PageOpDeburrEdit.ui | 22 +++++++++++++++---- src/Mod/Path/PathScripts/PathDeburr.py | 9 ++++++++ src/Mod/Path/PathScripts/PathDeburrGui.py | 11 ++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui index 888d5aa4d4..d875a47b61 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui @@ -29,34 +29,48 @@ QFrame::Raised - + Tool Controller - + <html><head/><body><p>The tool and its settings to be used for this operation.</p></body></html> - + Coolant Mode - + <html><head/><body><p>The tool and its settings to be used for this operation.</p></body></html> + + + + Direction + + + + + + + <html><head/><body><p>The direction of the operation (CW or CCW).</p></body></html> + + + diff --git a/src/Mod/Path/PathScripts/PathDeburr.py b/src/Mod/Path/PathScripts/PathDeburr.py index 8c28d802c8..00a1db6908 100644 --- a/src/Mod/Path/PathScripts/PathDeburr.py +++ b/src/Mod/Path/PathScripts/PathDeburr.py @@ -32,6 +32,15 @@ import math 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()) diff --git a/src/Mod/Path/PathScripts/PathDeburrGui.py b/src/Mod/Path/PathScripts/PathDeburrGui.py index 45c146f53d..d7f46f3980 100644 --- a/src/Mod/Path/PathScripts/PathDeburrGui.py +++ b/src/Mod/Path/PathScripts/PathDeburrGui.py @@ -35,6 +35,10 @@ __title__ = "Path Deburr Operation UI" __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 @@ -64,6 +68,8 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): 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) @@ -72,6 +78,9 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): 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) @@ -84,6 +93,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): 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) @@ -96,6 +106,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): 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): From 461624e18333e7c0b1cafbae396dd5a8ce2228a6 Mon Sep 17 00:00:00 2001 From: Patrick Felixberger Date: Thu, 20 Feb 2020 16:59:50 +0100 Subject: [PATCH 2/4] Rearranged deburr GUI --- .../Gui/Resources/panels/PageOpDeburrEdit.ui | 103 ++++++++++++++---- src/Mod/Path/PathScripts/PathDeburrGui.py | 4 +- 2 files changed, 83 insertions(+), 24 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui index d875a47b61..452e6ab7e3 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui @@ -6,14 +6,14 @@ 0 0 - 375 - 303 + 399 + 333 Form - + @@ -29,52 +29,38 @@ QFrame::Raised - + Tool Controller - + <html><head/><body><p>The tool and its settings to be used for this operation.</p></body></html> - + Coolant Mode - + <html><head/><body><p>The tool and its settings to be used for this operation.</p></body></html> - - - - Direction - - - - - - - <html><head/><body><p>The direction of the operation (CW or CCW).</p></body></html> - - - - + @@ -250,6 +236,79 @@ + + + + + 9 + + + 9 + + + 9 + + + 9 + + + 8 + + + + + <html><head/><body><p>The direction in which the profile is performed, clockwise or counter clockwise.</p></body></html> + + + CW + + + 0 + + + + CW + + + + + CCW + + + + + + + + + 0 + 0 + + + + Direction + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 30 + 20 + + + + + + + diff --git a/src/Mod/Path/PathScripts/PathDeburrGui.py b/src/Mod/Path/PathScripts/PathDeburrGui.py index d7f46f3980..f4b52f78b0 100644 --- a/src/Mod/Path/PathScripts/PathDeburrGui.py +++ b/src/Mod/Path/PathScripts/PathDeburrGui.py @@ -68,8 +68,8 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): 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') + #self.form.direction.addItem('CW') + #self.form.direction.addItem('CCW') def getFields(self, obj): PathGui.updateInputField(obj, 'Width', self.form.value_W) From 3a3620006416d9d6654512beb23c1404f0e067a8 Mon Sep 17 00:00:00 2001 From: Patrick Felixberger Date: Wed, 26 Feb 2020 19:52:53 +0100 Subject: [PATCH 3/4] Removed version info --- src/Mod/Path/PathScripts/PathDeburrGui.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDeburrGui.py b/src/Mod/Path/PathScripts/PathDeburrGui.py index f4b52f78b0..ed25c644fa 100644 --- a/src/Mod/Path/PathScripts/PathDeburrGui.py +++ b/src/Mod/Path/PathScripts/PathDeburrGui.py @@ -32,13 +32,9 @@ import PathScripts.PathOpGui as PathOpGui from PySide import QtCore, QtGui __title__ = "Path Deburr Operation UI" -__author__ = "sliptonic (Brad Collette)" +__author__ = "sliptonic (Brad Collette), Schildkroet" __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 @@ -68,8 +64,6 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): 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) From e4e4d9fecdc8fb1d810a00da9babc14aa7d1df12 Mon Sep 17 00:00:00 2001 From: Patrick Felixberger Date: Wed, 26 Feb 2020 19:56:18 +0100 Subject: [PATCH 4/4] Removed version info 2 --- src/Mod/Path/PathScripts/PathDeburr.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDeburr.py b/src/Mod/Path/PathScripts/PathDeburr.py index 00a1db6908..46ba0f58ee 100644 --- a/src/Mod/Path/PathScripts/PathDeburr.py +++ b/src/Mod/Path/PathScripts/PathDeburr.py @@ -33,13 +33,9 @@ import math from PySide import QtCore __title__ = "Path Deburr Operation" -__author__ = "sliptonic (Brad Collette)" +__author__ = "sliptonic (Brad Collette), Schildkroet" __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())