From 33636396819bc6023524cfcee45bf7073873e398 Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Thu, 26 Mar 2020 16:05:36 -0500 Subject: [PATCH] Path: Update GUI inputs for independent Waterline operation --- .../Resources/panels/PageOpWaterlineEdit.ui | 229 +++++++++++------- src/Mod/Path/PathScripts/PathWaterlineGui.py | 52 +++- 2 files changed, 185 insertions(+), 96 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpWaterlineEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpWaterlineEdit.ui index e9c94ac535..5e0edef1c9 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpWaterlineEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpWaterlineEdit.ui @@ -6,7 +6,7 @@ 0 0 - 400 + 350 400 @@ -43,37 +43,100 @@ - - - - mm - - - - - - - Cut Pattern - - - - - - - Sample interval - - - - - - - + - 9 + 8 + + + Stock + + + + + BaseBoundBox + + + + + + + + + 0 + 0 + + + + + + + + + 8 + + + + + Single-pass + + + + + Multi-pass + + + + + + + + + OCL Dropcutter + + + + + Experimental + + + + + + + + Optimize Linear Paths + + + + + + + + 0 + 0 + + + + Boundary Adjustment + + + + + + + + 8 + + + + + None + + Line @@ -96,62 +159,14 @@ - - - - Depth offset - - - - - - - - 9 - - - - - Stock - - - - - BaseBoundBox - - - - - - - - mm - - - - - - Optimize Linear Paths - - - - - - - BoundBox - - - - - - - Boundary Adjustment - - - - + + + 0 + 0 + + <html><head/><body><p>The amount by which the tool is laterally displaced on each cycle of the pattern, specified in percent of the tool diameter.</p><p>A step over of 100% results in no overlap between two different cycles.</p></body></html> @@ -169,13 +184,61 @@ - - + + + + Layer Mode + + + + + + + + 0 + 0 + + + + BoundBox + + + + + Step over + + + + mm + + + + + + + Cut Pattern + + + + + + + Sample interval + + + + + + + Algorithm + + + diff --git a/src/Mod/Path/PathScripts/PathWaterlineGui.py b/src/Mod/Path/PathScripts/PathWaterlineGui.py index ece048ecee..7a631efd11 100644 --- a/src/Mod/Path/PathScripts/PathWaterlineGui.py +++ b/src/Mod/Path/PathScripts/PathWaterlineGui.py @@ -46,24 +46,37 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): def getFields(self, obj): '''getFields(obj) ... transfers values from UI to obj's proprties''' - PathGui.updateInputField(obj, 'BoundaryAdjustment', self.form.boundaryAdjustment) - PathGui.updateInputField(obj, 'SampleInterval', self.form.sampleInterval) + self.updateToolController(obj, self.form.toolController) - if obj.StepOver != self.form.stepOver.value(): - obj.StepOver = self.form.stepOver.value() + if obj.Algorithm != str(self.form.algorithmSelect.currentText()): + obj.Algorithm = str(self.form.algorithmSelect.currentText()) if obj.BoundBox != str(self.form.boundBoxSelect.currentText()): obj.BoundBox = str(self.form.boundBoxSelect.currentText()) + if obj.LayerMode != str(self.form.layerMode.currentText()): + obj.LayerMode = str(self.form.layerMode.currentText()) + + if obj.CutPattern != str(self.form.cutPattern.currentText()): + obj.CutPattern = str(self.form.cutPattern.currentText()) + + PathGui.updateInputField(obj, 'BoundaryAdjustment', self.form.boundaryAdjustment) + + if obj.StepOver != self.form.stepOver.value(): + obj.StepOver = self.form.stepOver.value() + + PathGui.updateInputField(obj, 'SampleInterval', self.form.sampleInterval) + if obj.OptimizeLinearPaths != self.form.optimizeEnabled.isChecked(): obj.OptimizeLinearPaths = self.form.optimizeEnabled.isChecked() - self.updateToolController(obj, self.form.toolController) - def setFields(self, obj): '''setFields(obj) ... transfers obj's property values to UI''' self.setupToolController(obj, self.form.toolController) + self.selectInComboBox(obj.Algorithm, self.form.algorithmSelect) self.selectInComboBox(obj.BoundBox, self.form.boundBoxSelect) + self.selectInComboBox(obj.LayerMode, self.form.layerMode) + self.selectInComboBox(obj.CutPattern, self.form.cutPattern) self.form.boundaryAdjustment.setText(FreeCAD.Units.Quantity(obj.BoundaryAdjustment.Value, FreeCAD.Units.Length).UserString) self.form.stepOver.setValue(obj.StepOver) self.form.sampleInterval.setText(str(obj.SampleInterval)) @@ -77,7 +90,10 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): '''getSignalsForUpdate(obj) ... return list of signals for updating obj''' signals = [] signals.append(self.form.toolController.currentIndexChanged) + signals.append(self.form.algorithmSelect.currentIndexChanged) signals.append(self.form.boundBoxSelect.currentIndexChanged) + signals.append(self.form.layerMode.currentIndexChanged) + signals.append(self.form.cutPattern.currentIndexChanged) signals.append(self.form.boundaryAdjustment.editingFinished) signals.append(self.form.stepOver.editingFinished) signals.append(self.form.sampleInterval.editingFinished) @@ -86,15 +102,25 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): return signals def updateVisibility(self): - self.form.boundBoxSelect.setEnabled(True) - self.form.boundaryAdjustment.setEnabled(True) - self.form.stepOver.setEnabled(True) - self.form.sampleInterval.setEnabled(True) - self.form.optimizeEnabled.setEnabled(True) + if self.form.algorithmSelect.currentText() == 'OCL Dropcutter': + self.form.cutPattern.setEnabled(False) + self.form.boundaryAdjustment.setEnabled(False) + self.form.stepOver.setEnabled(False) + self.form.sampleInterval.setEnabled(True) + self.form.optimizeEnabled.setEnabled(True) + else: + self.form.cutPattern.setEnabled(True) + self.form.boundaryAdjustment.setEnabled(True) + if self.form.cutPattern.currentText() == 'None': + self.form.stepOver.setEnabled(False) + else: + self.form.stepOver.setEnabled(True) + self.form.sampleInterval.setEnabled(False) + self.form.optimizeEnabled.setEnabled(False) def registerSignalHandlers(self, obj): - # self.form.clearLayers.currentIndexChanged.connect(self.updateVisibility) - pass + self.form.algorithmSelect.currentIndexChanged.connect(self.updateVisibility) + self.form.cutPattern.currentIndexChanged.connect(self.updateVisibility) Command = PathOpGui.SetupOperation('Waterline',