Skip to content

Commit

Permalink
Path: Add Cut Pattern selection to task panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Russ4262 committed Mar 31, 2020
1 parent 3720b57 commit 11db955
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 98 deletions.
227 changes: 129 additions & 98 deletions src/Mod/Path/Gui/Resources/panels/PageOpSurfaceEdit.ui
Expand Up @@ -24,7 +24,7 @@
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="toolController_label">
<property name="text">
<string>ToolController</string>
</property>
Expand All @@ -38,7 +38,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="coolantController_label">
<property name="text">
<string>Coolant Mode</string>
</property>
Expand All @@ -57,7 +57,35 @@
<item row="1" column="0">
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="7" column="1" colspan="2">
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="scanType">
<item>
<property name="text">
<string>Planar</string>
</property>
</item>
<item>
<property name="text">
<string>Rotational</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QComboBox" name="layerMode">
<item>
<property name="text">
<string>Single-pass</string>
</property>
</item>
<item>
<property name="text">
<string>Multi-pass</string>
</property>
</item>
</widget>
</item>
<item row="8" column="1" colspan="2">
<widget class="QSpinBox" name="stepOver">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The amount by which the tool is laterally displaced on each cycle of the pattern, specified in percent of the tool diameter.&lt;/p&gt;&lt;p&gt;A step over of 100% results in no overlap between two different cycles.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -76,10 +104,17 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="boundBoxSelect_label">
<item row="8" column="0">
<widget class="QLabel" name="stepOver_label">
<property name="text">
<string>BoundBox</string>
<string>Step over</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="sampleInterval_label">
<property name="text">
<string>Sample interval</string>
</property>
</widget>
</item>
Expand All @@ -90,83 +125,107 @@
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="optimizeEnabled">
<property name="text">
<string>Optimize Linear Paths</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="depthOffset_label">
<widget class="QLabel" name="dropCutterDirSelect_label">
<property name="text">
<string>Depth offset</string>
<string>Drop Cutter Direction</string>
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="Gui::InputField" name="sampleInterval" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
<item row="4" column="0">
<widget class="QLabel" name="boundBoxExtraOffset_label">
<property name="text">
<string>BoundBox extra offset X, Y</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="sampleInterval_label">
<item row="12" column="0">
<widget class="QCheckBox" name="useStartPoint">
<property name="text">
<string>Sample interval</string>
<string>Use Start Point</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QComboBox" name="dropCutterDirSelect">
<item>
<property name="text">
<string>X</string>
</property>
</item>
<item>
<property name="text">
<string>Y</string>
</property>
</item>
<item row="1" column="0">
<widget class="QLabel" name="scanType_label">
<property name="text">
<string>Scan Type</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="stepOver_label">
<item row="0" column="0">
<widget class="QLabel" name="boundBoxSelect_label">
<property name="text">
<string>Step over</string>
<string>BoundBox</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="scanType">
<item row="7" column="1" colspan="2">
<widget class="Gui::InputField" name="depthOffset" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<property name="text">
<string>Planar</string>
</property>
<widget class="Gui::InputField" name="boundBoxExtraOffsetX" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item>
<property name="text">
<string>Rotational</string>
</property>
<widget class="Gui::InputField" name="boundBoxExtraOffsetY" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="10" column="1" colspan="2">
<widget class="Gui::InputField" name="sampleInterval" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QComboBox" name="layerMode">
<item row="7" column="0">
<widget class="QLabel" name="depthOffset_label">
<property name="text">
<string>Depth offset</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="QComboBox" name="dropCutterDirSelect">
<item>
<property name="text">
<string>Single-pass</string>
<string>X</string>
</property>
</item>
<item>
<property name="text">
<string>Multi-pass</string>
<string>Y</string>
</property>
</item>
</widget>
</item>
<item row="11" column="1">
<widget class="QCheckBox" name="optimizeEnabled">
<property name="text">
<string>Optimize Linear Paths</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="boundBoxSelect">
<item>
Expand All @@ -181,70 +240,42 @@
</item>
</widget>
</item>
<item row="12" column="1">
<item row="13" column="1">
<widget class="QCheckBox" name="optimizeStepOverTransitions">
<property name="text">
<string>Optimize StepOver Transitions</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="Gui::InputField" name="depthOffset" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="scanType_label">
<item row="3" column="0">
<widget class="QLabel" name="cutPattern_label">
<property name="text">
<string>Scan Type</string>
<string>Cut Pattern</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<widget class="QComboBox" name="cutPattern">
<item>
<widget class="Gui::InputField" name="boundBoxExtraOffsetX" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
<property name="text">
<string>Line</string>
</property>
</item>
<item>
<widget class="Gui::InputField" name="boundBoxExtraOffsetY" native="true">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
</widget>
<property name="text">
<string>ZigZag</string>
</property>
</item>
<item>
<property name="text">
<string>Circular</string>
</property>
</item>
<item>
<property name="text">
<string>CircularZigZag</string>
</property>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QLabel" name="dropCutterDirSelect_label">
<property name="text">
<string>Drop Cutter Direction</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="boundBoxExtraOffset_label">
<property name="text">
<string>BoundBox extra offset X, Y</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QCheckBox" name="useStartPoint">
<property name="text">
<string>Use Start Point</string>
</property>
</widget>
</item>
</layout>
Expand Down
7 changes: 7 additions & 0 deletions src/Mod/Path/PathScripts/PathSurfaceGui.py
Expand Up @@ -67,6 +67,9 @@ def getFields(self, obj):
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())

obj.DropCutterExtraOffset.x = FreeCAD.Units.Quantity(self.form.boundBoxExtraOffsetX.text()).Value
obj.DropCutterExtraOffset.y = FreeCAD.Units.Quantity(self.form.boundBoxExtraOffsetY.text()).Value

Expand All @@ -92,6 +95,7 @@ def setFields(self, obj):
self.selectInComboBox(obj.BoundBox, self.form.boundBoxSelect)
self.selectInComboBox(obj.ScanType, self.form.scanType)
self.selectInComboBox(obj.LayerMode, self.form.layerMode)
self.selectInComboBox(obj.CutPattern, self.form.cutPattern)
self.form.boundBoxExtraOffsetX.setText(str(obj.DropCutterExtraOffset.x))
self.form.boundBoxExtraOffsetY.setText(str(obj.DropCutterExtraOffset.y))
self.selectInComboBox(obj.DropCutterDir, self.form.dropCutterDirSelect)
Expand Down Expand Up @@ -122,6 +126,7 @@ def getSignalsForUpdate(self, obj):
signals.append(self.form.boundBoxSelect.currentIndexChanged)
signals.append(self.form.scanType.currentIndexChanged)
signals.append(self.form.layerMode.currentIndexChanged)
signals.append(self.form.cutPattern.currentIndexChanged)
signals.append(self.form.boundBoxExtraOffsetX.editingFinished)
signals.append(self.form.boundBoxExtraOffsetY.editingFinished)
signals.append(self.form.dropCutterDirSelect.currentIndexChanged)
Expand All @@ -136,10 +141,12 @@ def getSignalsForUpdate(self, obj):

def updateVisibility(self):
if self.form.scanType.currentText() == "Planar":
self.form.cutPattern.setEnabled(True)
self.form.boundBoxExtraOffsetX.setEnabled(False)
self.form.boundBoxExtraOffsetY.setEnabled(False)
self.form.dropCutterDirSelect.setEnabled(False)
else:
self.form.cutPattern.setEnabled(False)
self.form.boundBoxExtraOffsetX.setEnabled(True)
self.form.boundBoxExtraOffsetY.setEnabled(True)
self.form.dropCutterDirSelect.setEnabled(True)
Expand Down

0 comments on commit 11db955

Please sign in to comment.