Add a task panel page for controlling turning diameters
This commit is contained in:
@@ -99,6 +99,7 @@
|
||||
<file>panels/PageBaseHoleGeometryEdit.ui</file>
|
||||
<file>panels/PageBaseLocationEdit.ui</file>
|
||||
<file>panels/PageDepthsEdit.ui</file>
|
||||
<file>panels/PageDiametersEdit.ui</file>
|
||||
<file>panels/PageHeightsEdit.ui</file>
|
||||
<file>panels/PageOpCustomEdit.ui</file>
|
||||
<file>panels/PageOpDeburrEdit.ui</file>
|
||||
|
||||
136
src/Mod/Path/Gui/Resources/panels/PageDiametersEdit.ui
Normal file
136
src/Mod/Path/Gui/Resources/panels/PageDiametersEdit.ui
Normal file
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>345</width>
|
||||
<height>235</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="Gui::QuantitySpinBox" name="minDiameter">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Start Depth of the operation. The highest point in Z-axis the operation needs to process.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Gui::QuantitySpinBox" name="maxDiameter">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The depth of the operation which corresponds to the lowest value in Z-axis the operation needs to process.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="finalDepthSet">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Transfer the Z value of the selected feature as the Final Depth for the operation.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/button_left.svg</normaloff>:/icons/button_left.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="startDepthSet">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Transfer the Z value of the selected feature as the Start Depth for the operation.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../../Gui/Icons/resource.qrc">
|
||||
<normaloff>:/icons/button_left.svg</normaloff>:/icons/button_left.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="startDepthLabel">
|
||||
<property name="text">
|
||||
<string>Min Diameter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="finalDepthLabel">
|
||||
<property name="text">
|
||||
<string>Max Diameter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::QuantitySpinBox</class>
|
||||
<extends>QDoubleSpinBox</extends>
|
||||
<header>Gui/QuantitySpinBox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>minDiameter</tabstop>
|
||||
<tabstop>maxDiameter</tabstop>
|
||||
<tabstop>startDepthSet</tabstop>
|
||||
<tabstop>finalDepthSet</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../../../../Gui/Icons/resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -64,6 +64,7 @@ FeatureBaseFaces = 0x0400 # Base
|
||||
FeatureBasePanels = 0x0800 # Base
|
||||
FeatureLocations = 0x1000 # Locations
|
||||
FeatureCoolant = 0x2000 # Coolant
|
||||
FeatureDiameters = 0x4000 # Turning Diameters
|
||||
|
||||
FeatureBaseGeometry = FeatureBaseVertexes | FeatureBaseFaces | FeatureBaseEdges | FeatureBasePanels
|
||||
|
||||
@@ -91,6 +92,7 @@ class ObjectOp(object):
|
||||
FeatureBasePanels ... Base geometry support for Arch.Panels
|
||||
FeatureLocations ... Base location support
|
||||
FeatureCoolant ... Support for operation coolant
|
||||
FeatureDiameters ... Support for turning operation diameters
|
||||
|
||||
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(),
|
||||
@@ -169,6 +171,10 @@ class ObjectOp(object):
|
||||
obj.addProperty("App::PropertyVectorDistance", "StartPoint", "Start Point", QtCore.QT_TRANSLATE_NOOP("PathOp", "The start point of this path"))
|
||||
obj.addProperty("App::PropertyBool", "UseStartPoint", "Start Point", QtCore.QT_TRANSLATE_NOOP("PathOp", "Make True, if specifying a Start Point"))
|
||||
|
||||
if FeatureDiameters & features:
|
||||
obj.addProperty("App::PropertyDistance", "MinDiameter", "Diameter", QtCore.QT_TRANSLATE_NOOP("PathOp", "Lower limit of the turning diameter"))
|
||||
obj.addProperty("App::PropertyDistance", "MaxDiameter", "Diameter", QtCore.QT_TRANSLATE_NOOP("PathOp", "Upper limit of the turning diameter."))
|
||||
|
||||
# members being set later
|
||||
self.commandlist = None
|
||||
self.horizFeed = None
|
||||
@@ -352,6 +358,10 @@ class ObjectOp(object):
|
||||
if not self.applyExpression(obj, 'ClearanceHeight', job.SetupSheet.ClearanceHeightExpression):
|
||||
obj.ClearanceHeight = '5 mm'
|
||||
|
||||
if FeatureDiameters & features:
|
||||
obj.MinDiameter = '0 mm'
|
||||
obj.MaxDiameter = '0 mm'
|
||||
|
||||
if FeatureStartPoint & features:
|
||||
obj.UseStartPoint = False
|
||||
|
||||
|
||||
@@ -928,6 +928,43 @@ class TaskPanelDepthsPage(TaskPanelPage):
|
||||
self.form.startDepthSet.setEnabled(False)
|
||||
self.form.finalDepthSet.setEnabled(False)
|
||||
|
||||
class TaskPanelDiametersPage(TaskPanelPage):
|
||||
'''Page controller for diameters.'''
|
||||
|
||||
def __init__(self, obj, features):
|
||||
super(TaskPanelDiametersPage, self).__init__(obj, features)
|
||||
|
||||
# members initialized later
|
||||
self.clearanceHeight = None
|
||||
self.safeHeight = None
|
||||
|
||||
def getForm(self):
|
||||
return FreeCADGui.PySideUic.loadUi(":/panels/PageDiametersEdit.ui")
|
||||
|
||||
def initPage(self, obj):
|
||||
self.minDiameter = PathGui.QuantitySpinBox(self.form.minDiameter, obj, 'MinDiameter')
|
||||
self.maxDiameter = PathGui.QuantitySpinBox(self.form.maxDiameter, obj, 'MaxDiameter')
|
||||
|
||||
def getTitle(self, obj):
|
||||
return translate("Path", "Diameters")
|
||||
|
||||
def getFields(self, obj):
|
||||
self.minDiameter.updateProperty()
|
||||
self.maxDiameter.updateProperty()
|
||||
|
||||
def setFields(self, obj):
|
||||
self.minDiameter.updateSpinBox()
|
||||
self.maxDiameter.updateSpinBox()
|
||||
|
||||
def getSignalsForUpdate(self, obj):
|
||||
signals = []
|
||||
signals.append(self.form.minDiameter.editingFinished)
|
||||
signals.append(self.form.maxDiameter.editingFinished)
|
||||
return signals
|
||||
|
||||
def pageUpdateData(self, obj, prop):
|
||||
if prop in ['MinDiameter', 'MaxDiameter']:
|
||||
self.setFields(obj)
|
||||
|
||||
class TaskPanel(object):
|
||||
'''
|
||||
@@ -953,6 +990,8 @@ class TaskPanel(object):
|
||||
self.finalDepth = None
|
||||
self.stepDown = None
|
||||
self.buttonBox = None
|
||||
self.minDiameter = None
|
||||
self.maxDiameter = None
|
||||
|
||||
features = obj.Proxy.opFeatures(obj)
|
||||
opPage.features = features
|
||||
@@ -980,7 +1019,13 @@ class TaskPanel(object):
|
||||
self.featurePages.append(opPage.taskPanelHeightsPage(obj, features))
|
||||
else:
|
||||
self.featurePages.append(TaskPanelHeightsPage(obj, features))
|
||||
|
||||
|
||||
if PathOp.FeatureDiameters & features:
|
||||
if hasattr(opPage, 'taskPanelDiametersPage'):
|
||||
self.featurePages.append(opPage.taskPanelDiametersPage(obj, features))
|
||||
else:
|
||||
self.featurePages.append(TaskPanelDiametersPage(obj, features))
|
||||
|
||||
self.featurePages.append(opPage)
|
||||
|
||||
for page in self.featurePages:
|
||||
|
||||
Reference in New Issue
Block a user