From 8b0e244ed4b001efec378d6598c44cda8713f338 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 19:32:09 +0100 Subject: [PATCH 1/9] Add a coolant feature to the base PathOP --- src/Mod/Path/PathScripts/PathOp.py | 19 +++++++++++++++++-- src/Mod/Path/PathScripts/PathOpGui.py | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathOp.py b/src/Mod/Path/PathScripts/PathOp.py index a7cf6d71c8..ae84503f46 100644 --- a/src/Mod/Path/PathScripts/PathOp.py +++ b/src/Mod/Path/PathScripts/PathOp.py @@ -63,8 +63,9 @@ FeatureBaseEdges = 0x0200 # Base FeatureBaseFaces = 0x0400 # Base FeatureBasePanels = 0x0800 # Base FeatureLocations = 0x1000 # Locations +FeatureCoolant = 0x2000 # Coolant -FeatureBaseGeometry = FeatureBaseVertexes | FeatureBaseFaces | FeatureBaseEdges | FeatureBasePanels +FeatureBaseGeometry = FeatureBaseVertexes | FeatureBaseFaces | FeatureBaseEdges | FeatureBasePanels | FeatureCoolant class ObjectOp(object): @@ -89,6 +90,7 @@ class ObjectOp(object): FeatureBaseFaces ... Base geometry support for faces FeatureBasePanels ... Base geometry support for Arch.Panels FeatureLocations ... Base location support + FeatureCoolant ... Support for operation coolant The base class handles all base API and forwards calls to subclasses with an op prefix. For instance, an op is not expected to overwrite onChanged(), @@ -135,6 +137,9 @@ class ObjectOp(object): obj.addProperty("App::PropertyLink", "ToolController", "Path", QtCore.QT_TRANSLATE_NOOP("PathOp", "The tool controller that will be used to calculate the path")) self.addOpValues(obj, ['tooldia']) + if FeatureCoolant & features: + obj.addProperty("App::PropertyString", "CoolantMode", "Path", QtCore.QT_TRANSLATE_NOOP("PathOp", "Coolant mode for this operation")) + if FeatureDepths & features: obj.addProperty("App::PropertyDistance", "StartDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("PathOp", "Starting Depth of Tool- first cut depth in Z")) obj.addProperty("App::PropertyDistance", "FinalDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("PathOp", "Final Depth of Tool- lowest value in Z")) @@ -208,6 +213,9 @@ class ObjectOp(object): if FeatureTool & features and not hasattr(obj, 'OpToolDiameter'): self.addOpValues(obj, ['tooldia']) + if FeatureCoolant & features and not hasattr(obj, 'CoolantMode'): + obj.addProperty("App::PropertyString", "CoolantMode", "Path", QtCore.QT_TRANSLATE_NOOP("PathOp", "Coolant option for this operation")) + if FeatureDepths & features and not hasattr(obj, 'OpStartDepth'): self.addOpValues(obj, ['start', 'final']) if FeatureNoFinalDepth & features: @@ -238,7 +246,7 @@ class ObjectOp(object): The default implementation returns "FeatureTool | FeatureDeptsh | FeatureHeights | FeatureStartPoint" Should be overwritten by subclasses.''' # pylint: disable=unused-argument - return FeatureTool | FeatureDepths | FeatureHeights | FeatureStartPoint | FeatureBaseGeometry | FeatureFinishDepth + return FeatureTool | FeatureDepths | FeatureHeights | FeatureStartPoint | FeatureBaseGeometry | FeatureFinishDepth | FeatureCoolant def initOperation(self, obj): '''initOperation(obj) ... implement to create additional properties. @@ -316,6 +324,9 @@ class ObjectOp(object): return None obj.OpToolDiameter = obj.ToolController.Tool.Diameter + if FeatureCoolant & features: + obj.CoolantMode = job.SetupSheet.CoolantMode + if FeatureDepths & features: if self.applyExpression(obj, 'StartDepth', job.SetupSheet.StartDepthExpression): obj.OpStartDepth = 1.0 @@ -472,6 +483,10 @@ class ObjectOp(object): if not self._setBaseAndStock(obj): return + if FeatureCoolant & self.opFeatures(obj): + if not hasattr(obj, 'CoolantMode'): + FreeCAD.Console.PrintError("No coolant property found. Please recreate operation.") + if FeatureTool & self.opFeatures(obj): tc = obj.ToolController if tc is None or tc.ToolNumber == 0: diff --git a/src/Mod/Path/PathScripts/PathOpGui.py b/src/Mod/Path/PathScripts/PathOpGui.py index c350c68e87..19bd611a17 100644 --- a/src/Mod/Path/PathScripts/PathOpGui.py +++ b/src/Mod/Path/PathScripts/PathOpGui.py @@ -369,6 +369,24 @@ class TaskPanelPage(object): if obj.ToolController != tc: obj.ToolController = tc + def setupCoolant(self, obj, combo): + '''setupCoolant(obj, combo) ... helper function to setup obj's Coolant option.''' + job = PathUtils.findParentJob(obj) + options = job.SetupSheet.CoolantModes + combo.blockSignals(True) + combo.clear() + combo.addItems(options) + combo.blockSignals(False) + + if hasattr(obj, 'CoolantMode'): + self.selectInComboBox(obj.CoolantMode, combo) + + def updateCoolant(self, obj, combo): + '''updateCoolant(obj, combo) ... helper function to update obj's Coolant property if a different one has been selected in the combo box.''' + option = combo.currentText() + if hasattr(obj, 'CoolantMode'): + if obj.CoolantMode != option: + obj.CoolantMode = option class TaskPanelBaseGeometryPage(TaskPanelPage): '''Page controller for the base geometry.''' From bdcccc08b11acb64c183085ec1204d59490a76fd Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 19:33:36 +0100 Subject: [PATCH 2/9] Add coolant feature to Ops --- src/Mod/Path/PathScripts/PathAdaptive.py | 2 +- src/Mod/Path/PathScripts/PathAreaOp.py | 2 +- src/Mod/Path/PathScripts/PathCircularHoleBase.py | 4 ++-- src/Mod/Path/PathScripts/PathDeburr.py | 2 +- src/Mod/Path/PathScripts/PathDrilling.py | 2 +- src/Mod/Path/PathScripts/PathEngrave.py | 2 +- src/Mod/Path/PathScripts/PathSurface.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathAdaptive.py b/src/Mod/Path/PathScripts/PathAdaptive.py index dfe00989be..75814b66cd 100644 --- a/src/Mod/Path/PathScripts/PathAdaptive.py +++ b/src/Mod/Path/PathScripts/PathAdaptive.py @@ -468,7 +468,7 @@ class PathAdaptive(PathOp.ObjectOp): '''opFeatures(obj) ... returns the OR'ed list of features used and supported by the operation. The default implementation returns "FeatureTool | FeatureDepths | FeatureHeights | FeatureStartPoint" Should be overwritten by subclasses.''' - return PathOp.FeatureTool | PathOp.FeatureBaseEdges | PathOp.FeatureDepths | PathOp.FeatureFinishDepth | PathOp.FeatureStepDown | PathOp.FeatureHeights | PathOp.FeatureBaseGeometry + return PathOp.FeatureTool | PathOp.FeatureBaseEdges | PathOp.FeatureDepths | PathOp.FeatureFinishDepth | PathOp.FeatureStepDown | PathOp.FeatureHeights | PathOp.FeatureBaseGeometry | PathOp.FeatureCoolant def initOperation(self, obj): '''initOperation(obj) ... implement to create additional properties. diff --git a/src/Mod/Path/PathScripts/PathAreaOp.py b/src/Mod/Path/PathScripts/PathAreaOp.py index d7d16cd8e3..95e36c395a 100644 --- a/src/Mod/Path/PathScripts/PathAreaOp.py +++ b/src/Mod/Path/PathScripts/PathAreaOp.py @@ -79,7 +79,7 @@ class ObjectOp(PathOp.ObjectOp): The standard feature list is OR'ed with the return value of areaOpFeatures(). Do not overwrite, implement areaOpFeatures(obj) instead.''' # return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureStepDown | PathOp.FeatureHeights | PathOp.FeatureStartPoint | self.areaOpFeatures(obj) | PathOp.FeatureRotation - return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureStepDown | PathOp.FeatureHeights | PathOp.FeatureStartPoint | self.areaOpFeatures(obj) + return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureStepDown | PathOp.FeatureHeights | PathOp.FeatureStartPoint | self.areaOpFeatures(obj) | PathOp.FeatureCoolant def areaOpFeatures(self, obj): '''areaOpFeatures(obj) ... overwrite to add operation specific features. diff --git a/src/Mod/Path/PathScripts/PathCircularHoleBase.py b/src/Mod/Path/PathScripts/PathCircularHoleBase.py index 8ab4e85d4a..21c52ba5a5 100644 --- a/src/Mod/Path/PathScripts/PathCircularHoleBase.py +++ b/src/Mod/Path/PathScripts/PathCircularHoleBase.py @@ -80,7 +80,7 @@ class ObjectOp(PathOp.ObjectOp): def opFeatures(self, obj): '''opFeatures(obj) ... calls circularHoleFeatures(obj) and ORs in the standard features required for processing circular holes. Do not overwrite, implement circularHoleFeatures(obj) instead''' - return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureHeights | PathOp.FeatureBaseFaces | self.circularHoleFeatures(obj) + return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureHeights | PathOp.FeatureBaseFaces | self.circularHoleFeatures(obj) | PathOp.FeatureCoolant def circularHoleFeatures(self, obj): '''circularHoleFeatures(obj) ... overwrite to add operations specific features. @@ -143,7 +143,7 @@ class ObjectOp(PathOp.ObjectOp): return shape.Curve.Radius * 2 if shape.ShapeType == 'Face': - for i in range(len(shape.Edges)): + for i in range(len(shape.Edges)): if (type(shape.Edges[i].Curve) == Part.Circle and shape.Edges[i].Curve.Radius * 2 < shape.BoundBox.XLength*1.1 and shape.Edges[i].Curve.Radius * 2 > shape.BoundBox.XLength*0.9): diff --git a/src/Mod/Path/PathScripts/PathDeburr.py b/src/Mod/Path/PathScripts/PathDeburr.py index c1a640da52..347e5c5bf7 100644 --- a/src/Mod/Path/PathScripts/PathDeburr.py +++ b/src/Mod/Path/PathScripts/PathDeburr.py @@ -65,7 +65,7 @@ class ObjectDeburr(PathEngraveBase.ObjectOp): '''Proxy class for Deburr operation.''' def opFeatures(self, obj): - return PathOp.FeatureTool | PathOp.FeatureHeights | PathOp.FeatureStepDown | PathOp.FeatureBaseEdges | PathOp.FeatureBaseFaces + return PathOp.FeatureTool | PathOp.FeatureHeights | PathOp.FeatureStepDown | PathOp.FeatureBaseEdges | PathOp.FeatureBaseFaces | PathOp.FeatureCoolant def initOperation(self, obj): PathLog.track(obj.Label) diff --git a/src/Mod/Path/PathScripts/PathDrilling.py b/src/Mod/Path/PathScripts/PathDrilling.py index 8ab8b713c9..ce370aa191 100644 --- a/src/Mod/Path/PathScripts/PathDrilling.py +++ b/src/Mod/Path/PathScripts/PathDrilling.py @@ -68,7 +68,7 @@ class ObjectDrilling(PathCircularHoleBase.ObjectOp): def circularHoleFeatures(self, obj): '''circularHoleFeatures(obj) ... drilling works on anything, turn on all Base geometries and Locations.''' # return PathOp.FeatureBaseGeometry | PathOp.FeatureLocations | PathOp.FeatureRotation - return PathOp.FeatureBaseGeometry | PathOp.FeatureLocations + return PathOp.FeatureBaseGeometry | PathOp.FeatureLocations | PathOp.FeatureCoolant def initCircularHoleOperation(self, obj): '''initCircularHoleOperation(obj) ... add drilling specific properties to obj.''' diff --git a/src/Mod/Path/PathScripts/PathEngrave.py b/src/Mod/Path/PathScripts/PathEngrave.py index 92ec48059d..b10662ae38 100644 --- a/src/Mod/Path/PathScripts/PathEngrave.py +++ b/src/Mod/Path/PathScripts/PathEngrave.py @@ -58,7 +58,7 @@ class ObjectEngrave(PathEngraveBase.ObjectOp): def opFeatures(self, obj): '''opFeatures(obj) ... return all standard features and edges based geomtries''' - return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureHeights | PathOp.FeatureStepDown | PathOp.FeatureBaseEdges + return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureHeights | PathOp.FeatureStepDown | PathOp.FeatureBaseEdges | PathOp.FeatureCoolant def setupAdditionalProperties(self, obj): if not hasattr(obj, 'BaseShapes'): diff --git a/src/Mod/Path/PathScripts/PathSurface.py b/src/Mod/Path/PathScripts/PathSurface.py index 007214fc3e..f1536bdd81 100644 --- a/src/Mod/Path/PathScripts/PathSurface.py +++ b/src/Mod/Path/PathScripts/PathSurface.py @@ -117,7 +117,7 @@ class ObjectSurface(PathOp.ObjectOp): def opFeatures(self, obj): '''opFeatures(obj) ... return all standard features and edges based geomtries''' - return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureHeights | PathOp.FeatureStepDown + return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureHeights | PathOp.FeatureStepDown | PathOp.FeatureCoolant def initOperation(self, obj): '''initPocketOp(obj) ... create facing specific properties''' From 2996b815ae40b05eb5d871bc66ba9429bcddd780 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 19:36:04 +0100 Subject: [PATCH 3/9] Handle selecting the coolant mode in the forms --- src/Mod/Path/PathScripts/PathAdaptiveGui.py | 12 ++++++++++++ src/Mod/Path/PathScripts/PathDeburrGui.py | 3 +++ src/Mod/Path/PathScripts/PathDrillingGui.py | 5 +++++ src/Mod/Path/PathScripts/PathEngraveGui.py | 3 +++ src/Mod/Path/PathScripts/PathHelixGui.py | 3 +++ src/Mod/Path/PathScripts/PathPocketBaseGui.py | 3 +++ src/Mod/Path/PathScripts/PathPocketShapeGui.py | 3 --- src/Mod/Path/PathScripts/PathProfileBaseGui.py | 4 ++++ src/Mod/Path/PathScripts/PathSurfaceGui.py | 3 +++ 9 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathAdaptiveGui.py b/src/Mod/Path/PathScripts/PathAdaptiveGui.py index 9f96913722..447a0d3dfa 100644 --- a/src/Mod/Path/PathScripts/PathAdaptiveGui.py +++ b/src/Mod/Path/PathScripts/PathAdaptiveGui.py @@ -40,6 +40,15 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): hlayout.addWidget(form.ToolController) layout.addLayout(hlayout) + + # Coolant controller + hlayout = QtGui.QHBoxLayout() + form.coolantController = QtGui.QComboBox() + form.coolantControllerLabel = QtGui.QLabel("Coolant Mode") + hlayout.addWidget(form.coolantControllerLabel) + hlayout.addWidget(form.coolantController) + layout.addLayout(hlayout) + # cut region formLayout = QtGui.QFormLayout() form.Side = QtGui.QComboBox() @@ -148,6 +157,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): signals.append(self.form.LiftDistance.valueChanged) signals.append(self.form.KeepToolDownRatio.valueChanged) signals.append(self.form.StockToLeave.valueChanged) + signals.append(self.form.coolantController.currentIndexChanged) # signals.append(self.form.ProcessHoles.stateChanged) signals.append(self.form.ForceInsideOut.stateChanged) @@ -171,6 +181,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): # self.form.ProcessHoles.setChecked(obj.ProcessHoles) self.form.ForceInsideOut.setChecked(obj.ForceInsideOut) self.setupToolController(obj, self.form.ToolController) + self.setupCoolant(obj, self.form.coolantController) self.form.StopButton.setChecked(obj.Stopped) obj.setEditorMode('AdaptiveInputState', 2) # hide this property obj.setEditorMode('AdaptiveOutputState', 2) # hide this property @@ -203,6 +214,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): obj.StopProcessing = True self.updateToolController(obj, self.form.ToolController) + self.updateCoolant(obj, self.form.coolantController) obj.setEditorMode('AdaptiveInputState', 2) # hide this property obj.setEditorMode('AdaptiveOutputState', 2) # hide this property obj.setEditorMode('StopProcessing', 2) # hide this property diff --git a/src/Mod/Path/PathScripts/PathDeburrGui.py b/src/Mod/Path/PathScripts/PathDeburrGui.py index fd812f3149..45c146f53d 100644 --- a/src/Mod/Path/PathScripts/PathDeburrGui.py +++ b/src/Mod/Path/PathScripts/PathDeburrGui.py @@ -74,11 +74,13 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): obj.Join = 'Miter' self.updateToolController(obj, self.form.toolController) + self.updateCoolant(obj, self.form.coolantController) def setFields(self, obj): self.form.value_W.setText(FreeCAD.Units.Quantity(obj.Width.Value, FreeCAD.Units.Length).UserString) self.form.value_h.setText(FreeCAD.Units.Quantity(obj.ExtraDepth.Value, FreeCAD.Units.Length).UserString) self.setupToolController(obj, self.form.toolController) + self.setupCoolant(obj, self.form.coolantController) self.form.joinRound.setChecked('Round' == obj.Join) self.form.joinMiter.setChecked('Miter' == obj.Join) self.form.joinFrame.hide() @@ -93,6 +95,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): signals = [] signals.append(self.form.joinMiter.clicked) signals.append(self.form.joinRound.clicked) + signals.append(self.form.coolantController.currentIndexChanged) return signals def registerSignalHandlers(self, obj): diff --git a/src/Mod/Path/PathScripts/PathDrillingGui.py b/src/Mod/Path/PathScripts/PathDrillingGui.py index a8eacaf961..11504c4bc6 100644 --- a/src/Mod/Path/PathScripts/PathDrillingGui.py +++ b/src/Mod/Path/PathScripts/PathDrillingGui.py @@ -99,6 +99,7 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage): obj.AddTipLength = self.form.useTipLength.isChecked() self.updateToolController(obj, self.form.toolController) + self.updateCoolant(obj, self.form.coolantController) def setFields(self, obj): '''setFields(obj) ... update UI with obj properties' values''' @@ -121,6 +122,8 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage): self.form.useTipLength.setCheckState(QtCore.Qt.Unchecked) self.setupToolController(obj, self.form.toolController) + self.setupCoolant(obj, self.form.coolantController) + def getSignalsForUpdate(self, obj): '''getSignalsForUpdate(obj) ... return list of signals which cause the receiver to update the model''' @@ -133,6 +136,8 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage): 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) return signals diff --git a/src/Mod/Path/PathScripts/PathEngraveGui.py b/src/Mod/Path/PathScripts/PathEngraveGui.py index fea4881416..ea525524ab 100644 --- a/src/Mod/Path/PathScripts/PathEngraveGui.py +++ b/src/Mod/Path/PathScripts/PathEngraveGui.py @@ -121,17 +121,20 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): if obj.StartVertex != self.form.startVertex.value(): obj.StartVertex = self.form.startVertex.value() self.updateToolController(obj, self.form.toolController) + self.updateCoolant(obj, self.form.coolantController) def setFields(self, obj): '''setFields(obj) ... transfers obj's property values to UI''' self.form.startVertex.setValue(obj.StartVertex) self.setupToolController(obj, self.form.toolController) + self.setupCoolant(obj, self.form.coolantController) def getSignalsForUpdate(self, obj): '''getSignalsForUpdate(obj) ... return list of signals for updating obj''' signals = [] signals.append(self.form.startVertex.editingFinished) signals.append(self.form.toolController.currentIndexChanged) + signals.append(self.form.coolantController.currentIndexChanged) return signals def taskPanelBaseGeometryPage(self, obj, features): diff --git a/src/Mod/Path/PathScripts/PathHelixGui.py b/src/Mod/Path/PathScripts/PathHelixGui.py index 9069e91a8b..02ac143d64 100644 --- a/src/Mod/Path/PathScripts/PathHelixGui.py +++ b/src/Mod/Path/PathScripts/PathHelixGui.py @@ -60,6 +60,7 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage): obj.StepOver = self.form.stepOverPercent.value() self.updateToolController(obj, self.form.toolController) + self.updateCoolant(obj, self.form.coolantController) def setFields(self, obj): '''setFields(obj) ... transfers obj's property values to UI''' @@ -70,6 +71,7 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage): self.selectInComboBox(obj.StartSide, self.form.startSide) self.setupToolController(obj, self.form.toolController) + self.setupCoolant(obj, self.form.coolantController) def getSignalsForUpdate(self, obj): '''getSignalsForUpdate(obj) ... return list of signals for updating obj''' @@ -79,6 +81,7 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage): signals.append(self.form.direction.currentIndexChanged) signals.append(self.form.startSide.currentIndexChanged) signals.append(self.form.toolController.currentIndexChanged) + signals.append(self.form.coolantController.currentIndexChanged) return signals diff --git a/src/Mod/Path/PathScripts/PathPocketBaseGui.py b/src/Mod/Path/PathScripts/PathPocketBaseGui.py index 158d64da28..809bff2dc1 100644 --- a/src/Mod/Path/PathScripts/PathPocketBaseGui.py +++ b/src/Mod/Path/PathScripts/PathPocketBaseGui.py @@ -106,6 +106,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): PathGui.updateInputField(obj, 'ExtraOffset', self.form.extraOffset) self.updateToolController(obj, self.form.toolController) + self.updateCoolant(obj, self.form.coolantController) self.updateZigZagAngle(obj) if obj.UseStartPoint != self.form.useStartPoint.isChecked(): @@ -138,6 +139,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): self.selectInComboBox(obj.OffsetPattern, self.form.offsetPattern) self.selectInComboBox(obj.CutMode, self.form.cutMode) self.setupToolController(obj, self.form.toolController) + self.setupCoolant(obj, self.form.coolantController) if FeatureFacing & self.pocketFeatures(): self.selectInComboBox(obj.BoundaryShape, self.form.boundaryShape) @@ -155,6 +157,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): signals.append(self.form.useStartPoint.clicked) signals.append(self.form.useOutline.clicked) signals.append(self.form.minTravel.clicked) + signals.append(self.form.coolantController.currentIndexChanged) if FeatureFacing & self.pocketFeatures(): signals.append(self.form.boundaryShape.currentIndexChanged) diff --git a/src/Mod/Path/PathScripts/PathPocketShapeGui.py b/src/Mod/Path/PathScripts/PathPocketShapeGui.py index 11d6b70bd2..0ce7d2575f 100644 --- a/src/Mod/Path/PathScripts/PathPocketShapeGui.py +++ b/src/Mod/Path/PathScripts/PathPocketShapeGui.py @@ -475,9 +475,6 @@ class TaskPanelOpPage(PathPocketBaseGui.TaskPanelOpPage): self.extensionsPanel = TaskPanelExtensionPage(obj, features) # pylint: disable=attribute-defined-outside-init return self.extensionsPanel - def pageRegisterSignalHandlers(self): - pass - Command = PathOpGui.SetupOperation('Pocket Shape', PathPocketShape.Create, TaskPanelOpPage, diff --git a/src/Mod/Path/PathScripts/PathProfileBaseGui.py b/src/Mod/Path/PathScripts/PathProfileBaseGui.py index aec4c34329..22cdcd7699 100644 --- a/src/Mod/Path/PathScripts/PathProfileBaseGui.py +++ b/src/Mod/Path/PathScripts/PathProfileBaseGui.py @@ -80,6 +80,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): obj.Direction = str(self.form.direction.currentText()) self.updateToolController(obj, self.form.toolController) + self.updateCoolant(obj, self.form.coolantController) if FeatureSide & self.profileFeatures(): if obj.Side != str(self.form.cutSide.currentText()): @@ -101,6 +102,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): self.selectInComboBox(obj.Direction, self.form.direction) self.setupToolController(obj, self.form.toolController) + self.setupCoolant(obj, self.form.coolantController) if FeatureSide & self.profileFeatures(): self.selectInComboBox(obj.Side, self.form.cutSide) @@ -117,6 +119,8 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): signals.append(self.form.useCompensation.clicked) signals.append(self.form.useStartPoint.clicked) signals.append(self.form.extraOffset.editingFinished) + signals.append(self.form.toolController.currentIndexChanged) + signals.append(self.form.coolantController.currentIndexChanged) if FeatureSide & self.profileFeatures(): signals.append(self.form.cutSide.currentIndexChanged) diff --git a/src/Mod/Path/PathScripts/PathSurfaceGui.py b/src/Mod/Path/PathScripts/PathSurfaceGui.py index 1e66ab95ff..0f69922998 100644 --- a/src/Mod/Path/PathScripts/PathSurfaceGui.py +++ b/src/Mod/Path/PathScripts/PathSurfaceGui.py @@ -67,6 +67,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): obj.Optimize = self.form.optimizeEnabled.isChecked() self.updateToolController(obj, self.form.toolController) + self.updateCoolant(obj, self.form.coolantController) def setFields(self, obj): '''setFields(obj) ... transfers obj's property values to UI''' @@ -86,6 +87,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): self.form.optimizeEnabled.setCheckState(QtCore.Qt.Unchecked) self.setupToolController(obj, self.form.toolController) + self.setupCoolant(obj, self.form.coolantController) def getSignalsForUpdate(self, obj): '''getSignalsForUpdate(obj) ... return list of signals for updating obj''' @@ -100,6 +102,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): signals.append(self.form.stepOver.editingFinished) signals.append(self.form.depthOffset.editingFinished) signals.append(self.form.optimizeEnabled.stateChanged) + signals.append(self.form.coolantController.currentIndexChanged) return signals From 3f5836254bb545f2fa3e8e207c5a59faab69085c Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 19:37:00 +0100 Subject: [PATCH 4/9] Add a coolant mode combobox to the op ui --- .../Gui/Resources/panels/PageOpDeburrEdit.ui | 111 +++++++++++------- .../Resources/panels/PageOpDrillingEdit.ui | 30 +++-- .../Gui/Resources/panels/PageOpEngraveEdit.ui | 30 +++-- .../Gui/Resources/panels/PageOpHelixEdit.ui | 30 +++-- .../Resources/panels/PageOpPocketFullEdit.ui | 46 +++++--- .../Resources/panels/PageOpProfileFullEdit.ui | 32 +++-- .../Path/Gui/Resources/panels/SurfaceEdit.ui | 44 ++++--- 7 files changed, 213 insertions(+), 110 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui index 86058a8039..888d5aa4d4 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui @@ -6,15 +6,15 @@ 0 0 - 390 - 291 + 375 + 303 Form - - + + @@ -28,28 +28,42 @@ 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> + + + - + - - + + @@ -171,36 +185,53 @@ - - - - - 0 - 0 - - - - - 150 - 150 - - - - - 150 - 150 - - - - TextLabel - - - true - - - Qt::AlignCenter - - + + + + + + + 0 + 0 + + + + + 150 + 150 + + + + + 150 + 150 + + + + TextLabel + + + true + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpDrillingEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpDrillingEdit.ui index b1ad210bb3..3d2d7191e8 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpDrillingEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpDrillingEdit.ui @@ -7,14 +7,14 @@ 0 0 572 - 299 + 419 Form - - + + @@ -28,25 +28,39 @@ QFrame::Raised - - + + ToolController - + <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> + + + - + @@ -124,7 +138,7 @@ - + Qt::Vertical diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpEngraveEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpEngraveEdit.ui index 6a184de3aa..28ca2833de 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpEngraveEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpEngraveEdit.ui @@ -7,14 +7,14 @@ 0 0 400 - 140 + 258 Form - - + + QFrame::StyledPanel @@ -23,12 +23,6 @@ QFrame::Raised - - 0 - - - 0 - @@ -43,10 +37,24 @@ + + + + Coolant Mode + + + + + + + <html><head/><body><p>The tool and its settings to be used for this operation.</p></body></html> + + + - + @@ -69,7 +77,7 @@ - + Qt::Vertical diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpHelixEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpHelixEdit.ui index 58451b4600..5658602b78 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpHelixEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpHelixEdit.ui @@ -7,14 +7,14 @@ 0 0 400 - 229 + 365 Form - - + + QFrame::StyledPanel @@ -22,25 +22,39 @@ QFrame::Raised - - + + Tool Controller - + <html><head/><body><p>The tool and its settings to be used for this operation.</p></body></html> + + + + Coolant + + + + + + + <html><head/><body><p>The tool and its settings to be used for this operation.</p></body></html> + + + - + @@ -120,7 +134,7 @@ - + Qt::Vertical diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui index d2048c522d..00f822df6e 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui @@ -13,8 +13,8 @@ Form - - + + QFrame::StyledPanel @@ -22,34 +22,41 @@ 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> + + + - + - - - - Boundary Shape - - - @@ -72,10 +79,17 @@ + + + + Boundary Shape + + + - + @@ -211,7 +225,7 @@ - + @@ -244,7 +258,7 @@ - + Qt::Vertical diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpProfileFullEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpProfileFullEdit.ui index 821b84709c..dba10c387d 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpProfileFullEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpProfileFullEdit.ui @@ -7,14 +7,14 @@ 0 0 446 - 342 + 597 Form - - + + QFrame::StyledPanel @@ -22,25 +22,39 @@ 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> + + + - + @@ -114,7 +128,7 @@ - + @@ -170,7 +184,7 @@ - + Qt::Vertical diff --git a/src/Mod/Path/Gui/Resources/panels/SurfaceEdit.ui b/src/Mod/Path/Gui/Resources/panels/SurfaceEdit.ui index 80e84d85b7..483110fc2f 100644 --- a/src/Mod/Path/Gui/Resources/panels/SurfaceEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/SurfaceEdit.ui @@ -23,7 +23,7 @@ - 3 + 0 @@ -34,7 +34,7 @@ 0 0 345 - 385 + 373 @@ -112,7 +112,7 @@ 0 0 345 - 385 + 373 @@ -187,7 +187,7 @@ 0 0 345 - 385 + 373 @@ -237,7 +237,7 @@ 0 0 345 - 385 + 373 @@ -247,8 +247,8 @@ Operation - - + + QFrame::StyledPanel @@ -256,27 +256,35 @@ QFrame::Raised - - - 0 - - - 0 - - + + ToolController - + + + + + Coolant Mode + + + + + + + <html><head/><body><p>The tool and its settings to be used for this operation.</p></body></html> + + + - + QFrame::StyledPanel @@ -309,7 +317,7 @@ - + Qt::Vertical From 32509136ee5437e0b6d273343ebb335980b2b982 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 19:38:45 +0100 Subject: [PATCH 5/9] Handle setting the coolant mode on the setupsheet --- src/Mod/Path/PathScripts/PathSetupSheet.py | 29 +++++++++++++++++-- src/Mod/Path/PathScripts/PathSetupSheetGui.py | 13 +++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathSetupSheet.py b/src/Mod/Path/PathScripts/PathSetupSheet.py index 3363914c0f..434aebf39b 100644 --- a/src/Mod/Path/PathScripts/PathSetupSheet.py +++ b/src/Mod/Path/PathScripts/PathSetupSheet.py @@ -52,6 +52,7 @@ class Template: HorizRapid = 'HorizRapid' VertRapid = 'VertRapid' + CoolantMode = 'CoolantMode' SafeHeightOffset = 'SafeHeightOffset' SafeHeightExpression = 'SafeHeightExpression' ClearanceHeightOffset = 'ClearanceHeightOffset' @@ -60,7 +61,7 @@ class Template: FinalDepthExpression = 'FinalDepthExpression' StepDownExpression = 'StepDownExpression' - All = [HorizRapid, VertRapid, SafeHeightOffset, SafeHeightExpression, ClearanceHeightOffset, ClearanceHeightExpression, StartDepthExpression, FinalDepthExpression, StepDownExpression] + All = [HorizRapid, VertRapid, CoolantMode, SafeHeightOffset, SafeHeightExpression, ClearanceHeightOffset, ClearanceHeightExpression, StartDepthExpression, FinalDepthExpression, StepDownExpression] def _traverseTemplateAttributes(attrs, codec): @@ -86,7 +87,7 @@ class SetupSheet: TemplateReference = '${SetupSheet}' DefaultSafeHeightOffset = '3 mm' - DefaultClearanceHeightOffset = '5 mm' + DefaultClearanceHeightOffset = '5 mm' DefaultSafeHeightExpression = "OpStockZMax+${SetupSheet}.SafeHeightOffset" DefaultClearanceHeightExpression = "OpStockZMax+${SetupSheet}.ClearanceHeightOffset" @@ -94,11 +95,16 @@ class SetupSheet: DefaultFinalDepthExpression = 'OpFinalDepth' DefaultStepDownExpression = 'OpToolDiameter' + DefaultCoolantModes = ['None', 'Flood', 'Mist'] + def __init__(self, obj): self.obj = obj obj.addProperty('App::PropertySpeed', 'VertRapid', 'ToolController', translate('PathSetupSheet', 'Default speed for horizontal rapid moves.')) obj.addProperty('App::PropertySpeed', 'HorizRapid', 'ToolController', translate('PathSetupSheet', 'Default speed for vertical rapid moves.')) + obj.addProperty('App::PropertyStringList', 'CoolantModes', 'CoolantMode', translate('PathSetupSheet', 'Coolant Modes')) + obj.addProperty('App::PropertyEnumeration', 'CoolantMode', 'CoolantMode', translate('PathSetupSheet', 'Default coolant mode.')) + obj.addProperty('App::PropertyLength', 'SafeHeightOffset', 'OperationHeights', translate('PathSetupSheet', 'The usage of this field depends on SafeHeightExpression - by default its value is added to StartDepth and used for SafeHeight of an operation.')) obj.addProperty('App::PropertyString', 'SafeHeightExpression', 'OperationHeights', translate('PathSetupSheet', 'Expression set for the SafeHeight of new operations.')) obj.addProperty('App::PropertyLength', 'ClearanceHeightOffset', 'OperationHeights', translate('PathSetupSheet', 'The usage of this field depends on ClearanceHeightExpression - by default is value is added to StartDepth and used for ClearanceHeight of an operation.')) @@ -117,6 +123,9 @@ class SetupSheet: obj.FinalDepthExpression = self.decodeAttributeString(self.DefaultFinalDepthExpression) obj.StepDownExpression = self.decodeAttributeString(self.DefaultStepDownExpression) + obj.CoolantModes = self.DefaultCoolantModes + obj.CoolantMode = self.DefaultCoolantModes + obj.Proxy = self def __getstate__(self): @@ -171,7 +180,7 @@ class SetupSheet: prop.setupProperty(self.obj, propertyName, propertyGroup, prop.valueFromString(value)) - def templateAttributes(self, includeRapids=True, includeHeights=True, includeDepths=True, includeOps=None): + def templateAttributes(self, includeRapids=True, includeCoolantMode=True, includeHeights=True, includeDepths=True, includeOps=None): '''templateAttributes(includeRapids, includeHeights, includeDepths) ... answers a dictionary with the default values.''' attrs = {} @@ -179,6 +188,9 @@ class SetupSheet: attrs[Template.VertRapid] = self.obj.VertRapid.UserString attrs[Template.HorizRapid] = self.obj.HorizRapid.UserString + if includeCoolantMode: + attrs[Template.CoolantMode] = self.obj.CoolantMode.UserString + if includeHeights: attrs[Template.SafeHeightOffset] = self.obj.SafeHeightOffset.UserString attrs[Template.SafeHeightExpression] = self.obj.SafeHeightExpression @@ -265,6 +277,17 @@ class SetupSheet: PathLog.info("SetupSheet has no support for {}".format(opName)) #traceback.print_exc() + def onDocumentRestored(self, obj): + + if not hasattr(obj, 'CoolantModes'): + obj.addProperty('App::PropertyStringList', 'CoolantModes', 'CoolantMode', translate('PathSetupSheet', 'Coolant Modes')) + obj.CoolantModes = self.DefaultCoolantModes + + + if not hasattr(obj, 'CoolantMode'): + obj.addProperty('App::PropertyEnumeration', 'CoolantMode', 'CoolantMode', translate('PathSetupSheet', 'Default coolant mode.')) + obj.CoolantMode = self.DefaultCoolantModes + def Create(name = 'SetupSheet'): obj = FreeCAD.ActiveDocument.addObject('App::FeaturePython', name) obj.Proxy = SetupSheet(obj) diff --git a/src/Mod/Path/PathScripts/PathSetupSheetGui.py b/src/Mod/Path/PathScripts/PathSetupSheetGui.py index 44bbb4a140..1537f870c2 100644 --- a/src/Mod/Path/PathScripts/PathSetupSheetGui.py +++ b/src/Mod/Path/PathScripts/PathSetupSheetGui.py @@ -295,6 +295,7 @@ class GlobalEditor(object): self.safeHeightOffs = None self.rapidHorizontal = None self.rapidVertical = None + #self.coolantMode = None def reject(self): pass @@ -318,6 +319,16 @@ class GlobalEditor(object): self.safeHeightOffs.updateProperty() self.rapidVertical.updateProperty() self.rapidHorizontal.updateProperty() + #self.coolantMode.updateProperty() + self.obj.CoolantMode = self.form.setupCoolantMode.currentText() + + def selectInComboBox(self, name, combo): + '''selectInComboBox(name, combo) ... helper function to select a specific value in a combo box.''' + index = combo.findText(name, QtCore.Qt.MatchFixedString) + if index >= 0: + combo.blockSignals(True) + combo.setCurrentIndex(index) + combo.blockSignals(False) def updateUI(self): PathLog.track() @@ -330,6 +341,7 @@ class GlobalEditor(object): self.safeHeightOffs.updateSpinBox() self.rapidVertical.updateSpinBox() self.rapidHorizontal.updateSpinBox() + self.selectInComboBox(self.obj.CoolantMode, self.form.setupCoolantMode) def updateModel(self, recomp = True): PathLog.track() @@ -346,6 +358,7 @@ class GlobalEditor(object): self.safeHeightOffs = PathGui.QuantitySpinBox(self.form.setupSafeHeightOffs, self.obj, 'SafeHeightOffset') self.rapidHorizontal = PathGui.QuantitySpinBox(self.form.setupRapidHorizontal, self.obj, 'HorizRapid') self.rapidVertical = PathGui.QuantitySpinBox(self.form.setupRapidVertical, self.obj, 'VertRapid') + self.form.setupCoolantMode.addItems(self.obj.CoolantModes) self.setFields() class TaskPanel: From 0002090aa15890430647822af9c40220ffc57218 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 19:39:17 +0100 Subject: [PATCH 6/9] Handle setting the coolant mode on the job ui --- src/Mod/Path/Gui/Resources/panels/PathEdit.ui | 63 +++++++++++++------ .../Path/Gui/Resources/panels/SetupGlobal.ui | 39 ++++++++++++ 2 files changed, 83 insertions(+), 19 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PathEdit.ui b/src/Mod/Path/Gui/Resources/panels/PathEdit.ui index 004759a8b2..cde0e5e336 100644 --- a/src/Mod/Path/Gui/Resources/panels/PathEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PathEdit.ui @@ -6,8 +6,8 @@ 0 0 - 478 - 1310 + 451 + 705 @@ -31,8 +31,8 @@ 0 0 - 458 - 1201 + 429 + 588 @@ -112,8 +112,8 @@ 0 0 - 458 - 1201 + 98 + 28 @@ -244,6 +244,12 @@ 0 + + + 0 + 0 + + <html><head/><body><p><span style=" font-style:italic;">Work Coordinate Systems</span> also called <span style=" font-style:italic;">Work Offsets</span>, <span style=" font-style:italic;">Fixture Offsets</span>, or <span style=" font-style:italic;">Fixtures </span>are useful for building efficient production jobs where the same part is done many times on the machine.</p><p>FreeCAD has no knowledge of where a particular coordinate system exists within the machine coordinate system so adding additional coordinate systems to your job will have no visual change within your job. It will, however, change your gcode output. The exact way in which the output is affected is controlled by the 'order by' setting.</p></body></html> @@ -418,15 +424,15 @@ - 0 + 1 0 0 - 458 - 1201 + 354 + 979 @@ -989,15 +995,15 @@ 0 0 - 204 - 266 + 429 + 588 Default Values - - + + Depths @@ -1048,7 +1054,7 @@ - + Heights @@ -1119,7 +1125,26 @@ - + + + + Coolant + + + + + + Coolant Mode + + + + + + + + + + Qt::Vertical @@ -1153,8 +1178,8 @@ 0 0 - 458 - 1201 + 429 + 588 @@ -1253,8 +1278,8 @@ 0 0 - 115 - 94 + 137 + 114 diff --git a/src/Mod/Path/Gui/Resources/panels/SetupGlobal.ui b/src/Mod/Path/Gui/Resources/panels/SetupGlobal.ui index 822d909472..7ead531275 100644 --- a/src/Mod/Path/Gui/Resources/panels/SetupGlobal.ui +++ b/src/Mod/Path/Gui/Resources/panels/SetupGlobal.ui @@ -230,6 +230,45 @@ + + + Coolant + + + + + + Coolant Mode + + + + + + Coolant Default: + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 570 + + + + + + From 0484141a57ca006e24476f8bf1ab3786b2f6f028 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 19:39:49 +0100 Subject: [PATCH 7/9] Add coolant to the linuxcnc_post --- .../Path/PathScripts/post/linuxcnc_post.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Mod/Path/PathScripts/post/linuxcnc_post.py b/src/Mod/Path/PathScripts/post/linuxcnc_post.py index 01007e04ce..450048c748 100644 --- a/src/Mod/Path/PathScripts/post/linuxcnc_post.py +++ b/src/Mod/Path/PathScripts/post/linuxcnc_post.py @@ -205,6 +205,18 @@ def export(objectslist, filename, argstring): for line in PRE_OPERATION.splitlines(True): gcode += linenumber() + line + # turn coolant on if required + if hasattr(obj, "CoolantMode"): + coolantMode = obj.CoolantMode + if OUTPUT_COMMENTS: + if not coolantMode == 'None': + gcode += linenumber() + '(Coolant On:' + coolantMode + ')\n' + if coolantMode == 'Flood': + gcode += linenumber() + 'M8' + '\n' + if coolantMode == 'Mist': + gcode += linenumber() + 'M7' + '\n' + + # process the operation gcode gcode += parse(obj) # do the post_op @@ -213,6 +225,14 @@ def export(objectslist, filename, argstring): for line in POST_OPERATION.splitlines(True): gcode += linenumber() + line + # turn coolant off if required + if hasattr(obj, "CoolantMode"): + coolantMode = obj.CoolantMode + if not coolantMode == 'None': + if OUTPUT_COMMENTS: + gcode += linenumber() + '(Coolant Off:' + coolantMode + ')\n' + gcode += linenumber() +'M9' + '\n' + # do the post_amble if OUTPUT_COMMENTS: gcode += "(begin postamble)\n" From 4e5b0bc5d8e05bdd67ebf2feaa188ea432bb4e89 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 20:00:37 +0100 Subject: [PATCH 8/9] Change the coolant label on the setupsheet ... to be consistent with the rest of the forms. --- src/Mod/Path/Gui/Resources/panels/SetupGlobal.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Path/Gui/Resources/panels/SetupGlobal.ui b/src/Mod/Path/Gui/Resources/panels/SetupGlobal.ui index 7ead531275..412c6e69b7 100644 --- a/src/Mod/Path/Gui/Resources/panels/SetupGlobal.ui +++ b/src/Mod/Path/Gui/Resources/panels/SetupGlobal.ui @@ -244,7 +244,7 @@ - Coolant Default: + Coolant Mode From 09a1be0894953f5d72346448e5bd38d9ca314a3a Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 20:17:57 +0100 Subject: [PATCH 9/9] Update the adaptive form so the widgets align. --- src/Mod/Path/PathScripts/PathAdaptiveGui.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathAdaptiveGui.py b/src/Mod/Path/PathScripts/PathAdaptiveGui.py index 447a0d3dfa..6f218a0949 100644 --- a/src/Mod/Path/PathScripts/PathAdaptiveGui.py +++ b/src/Mod/Path/PathScripts/PathAdaptiveGui.py @@ -31,26 +31,17 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): def getForm(self): form = QtGui.QWidget() layout = QtGui.QVBoxLayout() + formLayout = QtGui.QFormLayout() # tool controller - hlayout = QtGui.QHBoxLayout() form.ToolController = QtGui.QComboBox() - form.ToolControllerLabel = QtGui.QLabel("Tool Controller") - hlayout.addWidget(form.ToolControllerLabel) - hlayout.addWidget(form.ToolController) - layout.addLayout(hlayout) - + formLayout.addRow(QtGui.QLabel("Tool Controller"), form.ToolController) # Coolant controller - hlayout = QtGui.QHBoxLayout() form.coolantController = QtGui.QComboBox() - form.coolantControllerLabel = QtGui.QLabel("Coolant Mode") - hlayout.addWidget(form.coolantControllerLabel) - hlayout.addWidget(form.coolantController) - layout.addLayout(hlayout) + formLayout.addRow(QtGui.QLabel("Coolant Mode"), form.coolantController) # cut region - formLayout = QtGui.QFormLayout() form.Side = QtGui.QComboBox() form.Side.addItem("Inside") form.Side.addItem("Outside")