Adaptive translation cleanup
This commit is contained in:
@@ -105,6 +105,7 @@
|
||||
<file>panels/PageDepthsEdit.ui</file>
|
||||
<file>panels/PageDiametersEdit.ui</file>
|
||||
<file>panels/PageHeightsEdit.ui</file>
|
||||
<file>panels/PageOpAdaptiveEdit.ui</file>
|
||||
<file>panels/PageOpCustomEdit.ui</file>
|
||||
<file>panels/PageOpDeburrEdit.ui</file>
|
||||
<file>panels/PageOpDrillingEdit.ui</file>
|
||||
|
||||
276
src/Mod/Path/Gui/Resources/panels/PageOpAdaptiveEdit.ui
Normal file
276
src/Mod/Path/Gui/Resources/panels/PageOpAdaptiveEdit.ui
Normal file
@@ -0,0 +1,276 @@
|
||||
<?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>437</width>
|
||||
<height>764</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Tool Controller</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="ToolController"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Coolant</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="coolantController"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="15" column="1">
|
||||
<widget class="QDoubleSpinBox" name="LiftDistance">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>How much to lift the tool up during the rapid linking moves over cleared regions.</p><p>If linking path is not clear tool is raised to clearence height.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Lift Distance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<widget class="QDoubleSpinBox" name="HelixDiameterLimit">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>If &gt;0 it limits the helix ramp diameter</p><p>otherwise the 75 percent of tool diameter is used</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Helix Ramp Angle</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QDoubleSpinBox" name="HelixConeAngle">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Angle of the helix entry cone</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="19" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Stock to Leave</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Cut Region</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="Side">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Cut inside or outside of the selected shapes</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Step Over Percent</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="24" column="0">
|
||||
<widget class="QCheckBox" name="useOutline">
|
||||
<property name="text">
|
||||
<string>Use Outline</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="1">
|
||||
<widget class="QDoubleSpinBox" name="KeepToolDownRatio">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Max length of keep-tool-down linking path compared to direct distance between points.</p><p>If exceeded link will be done by raising the tool to clearence height.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Helix Max Diameter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Helix Cone Angle</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Keep Tool Down Ratio</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="19" column="1">
|
||||
<widget class="QDoubleSpinBox" name="StockToLeave">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>How much material to leave (i.e. for finishing operation)</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="0">
|
||||
<widget class="QCheckBox" name="ForceInsideOut">
|
||||
<property name="text">
|
||||
<string>Force Clearing Inside-out</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Operation Type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QDoubleSpinBox" name="HelixAngle">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Angle of the helix ramp entry</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="0">
|
||||
<widget class="QCheckBox" name="FinishingProfile">
|
||||
<property name="text">
|
||||
<string>Finishing Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="OperationType">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Type of adaptive operation</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="2">
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="threadFitLabel">
|
||||
<property name="text">
|
||||
<string>Accuracy vs Performance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="Tolerance">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Influences calculation performance vs stability and accuracy</p></body></html></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="sliderPosition">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickInterval">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="StepOver">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Optimal value for tool stepover</p></body></html></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="StopButton">
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<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>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,142 +22,41 @@
|
||||
# ***************************************************************************
|
||||
|
||||
import PathScripts.PathOpGui as PathOpGui
|
||||
from PySide import QtCore, QtGui
|
||||
from PySide import QtCore
|
||||
import PathScripts.PathAdaptive as PathAdaptive
|
||||
import PathScripts.PathFeatureExtensionsGui as PathFeatureExtensionsGui
|
||||
import FreeCADGui
|
||||
|
||||
|
||||
class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
def initPage(self, obj):
|
||||
self.setTitle("Adaptive path operation")
|
||||
|
||||
def getForm(self):
|
||||
form = QtGui.QWidget()
|
||||
layout = QtGui.QVBoxLayout()
|
||||
formLayout = QtGui.QFormLayout()
|
||||
"""getForm() ... return UI"""
|
||||
|
||||
# tool controller
|
||||
form.ToolController = QtGui.QComboBox()
|
||||
formLayout.addRow(QtGui.QLabel("Tool Controller"), form.ToolController)
|
||||
form = FreeCADGui.PySideUic.loadUi(":/panels/PageOpAdaptiveEdit.ui")
|
||||
comboToPropertyMap = [("Side", "Side"), ("OperationType", "OperationType")]
|
||||
|
||||
# Coolant controller
|
||||
form.coolantController = QtGui.QComboBox()
|
||||
formLayout.addRow(QtGui.QLabel("Coolant Mode"), form.coolantController)
|
||||
enumTups = PathAdaptive.PathAdaptive.propertyEnumerations(dataType="raw")
|
||||
|
||||
# cut region
|
||||
form.Side = QtGui.QComboBox()
|
||||
form.Side.addItem("Inside")
|
||||
form.Side.addItem("Outside")
|
||||
form.Side.setToolTip("Cut inside or outside of the selected shapes")
|
||||
formLayout.addRow(QtGui.QLabel("Cut Region"), form.Side)
|
||||
|
||||
# operation type
|
||||
form.OperationType = QtGui.QComboBox()
|
||||
form.OperationType.addItem("Clearing")
|
||||
form.OperationType.addItem("Profiling")
|
||||
form.OperationType.setToolTip("Type of adaptive operation")
|
||||
formLayout.addRow(QtGui.QLabel("Operation Type"), form.OperationType)
|
||||
|
||||
# step over
|
||||
form.StepOver = QtGui.QSpinBox()
|
||||
form.StepOver.setMinimum(15)
|
||||
form.StepOver.setMaximum(75)
|
||||
form.StepOver.setSingleStep(1)
|
||||
form.StepOver.setValue(25)
|
||||
form.StepOver.setToolTip("Optimal value for tool stepover")
|
||||
formLayout.addRow(QtGui.QLabel("Step Over Percent"), form.StepOver)
|
||||
|
||||
# tolerance
|
||||
form.Tolerance = QtGui.QSlider(QtCore.Qt.Horizontal)
|
||||
form.Tolerance.setMinimum(5)
|
||||
form.Tolerance.setMaximum(15)
|
||||
form.Tolerance.setTickInterval(1)
|
||||
form.Tolerance.setValue(10)
|
||||
form.Tolerance.setTickPosition(QtGui.QSlider.TicksBelow)
|
||||
form.Tolerance.setToolTip("Influences calculation performance vs stability and accuracy.")
|
||||
formLayout.addRow(QtGui.QLabel("Accuracy vs Performance"), form.Tolerance)
|
||||
|
||||
# helix angle
|
||||
form.HelixAngle = QtGui.QDoubleSpinBox()
|
||||
form.HelixAngle.setMinimum(1)
|
||||
form.HelixAngle.setMaximum(89)
|
||||
form.HelixAngle.setSingleStep(1)
|
||||
form.HelixAngle.setValue(5)
|
||||
form.HelixAngle.setToolTip("Angle of the helix ramp entry")
|
||||
formLayout.addRow(QtGui.QLabel("Helix Ramp Angle"), form.HelixAngle)
|
||||
|
||||
# helix cone angle
|
||||
form.HelixConeAngle = QtGui.QDoubleSpinBox()
|
||||
form.HelixConeAngle.setMinimum(0)
|
||||
form.HelixConeAngle.setMaximum(6)
|
||||
form.HelixConeAngle.setSingleStep(1)
|
||||
form.HelixConeAngle.setValue(0)
|
||||
form.HelixConeAngle.setToolTip("Angle of the helix entry cone")
|
||||
formLayout.addRow(QtGui.QLabel("Helix Cone Angle"), form.HelixConeAngle)
|
||||
|
||||
# helix diam. limit
|
||||
form.HelixDiameterLimit = QtGui.QDoubleSpinBox()
|
||||
form.HelixDiameterLimit.setMinimum(0.0)
|
||||
form.HelixDiameterLimit.setMaximum(90)
|
||||
form.HelixDiameterLimit.setSingleStep(0.1)
|
||||
form.HelixDiameterLimit.setValue(0)
|
||||
form.HelixDiameterLimit.setToolTip("If >0 it limits the helix ramp diameter\notherwise the 75 percent of tool diameter is used as helix diameter")
|
||||
formLayout.addRow(QtGui.QLabel("Helix Max Diameter"), form.HelixDiameterLimit)
|
||||
|
||||
# lift distance
|
||||
form.LiftDistance = QtGui.QDoubleSpinBox()
|
||||
form.LiftDistance.setMinimum(0.0)
|
||||
form.LiftDistance.setMaximum(1000)
|
||||
form.LiftDistance.setSingleStep(0.1)
|
||||
form.LiftDistance.setValue(1.0)
|
||||
form.LiftDistance.setToolTip("How much to lift the tool up during the rapid linking moves over cleared regions.\nIf linking path is not clear tool is raised to clearence height.")
|
||||
formLayout.addRow(QtGui.QLabel("Lift Distance"), form.LiftDistance)
|
||||
|
||||
# KeepToolDownRatio
|
||||
form.KeepToolDownRatio = QtGui.QDoubleSpinBox()
|
||||
form.KeepToolDownRatio.setMinimum(1.0)
|
||||
form.KeepToolDownRatio.setMaximum(10)
|
||||
form.KeepToolDownRatio.setSingleStep(1)
|
||||
form.KeepToolDownRatio.setValue(3.0)
|
||||
form.KeepToolDownRatio.setToolTip("Max length of keep-tool-down linking path compared to direct distance between points.\nIf exceeded link will be done by raising the tool to clearence height.")
|
||||
formLayout.addRow(QtGui.QLabel("Keep Tool Down Ratio"), form.KeepToolDownRatio)
|
||||
|
||||
# stock to leave
|
||||
form.StockToLeave = QtGui.QDoubleSpinBox()
|
||||
form.StockToLeave.setMinimum(0.0)
|
||||
form.StockToLeave.setMaximum(1000)
|
||||
form.StockToLeave.setSingleStep(0.1)
|
||||
form.StockToLeave.setValue(0)
|
||||
form.StockToLeave.setToolTip("How much material to leave (i.e. for finishing operation)")
|
||||
formLayout.addRow(QtGui.QLabel("Stock to Leave"), form.StockToLeave)
|
||||
|
||||
# Force inside out
|
||||
form.ForceInsideOut = QtGui.QCheckBox()
|
||||
form.ForceInsideOut.setChecked(True)
|
||||
formLayout.addRow(QtGui.QLabel("Force Clearing Inside-Out"), form.ForceInsideOut)
|
||||
|
||||
# Finishing profile
|
||||
form.FinishingProfile = QtGui.QCheckBox()
|
||||
form.FinishingProfile.setChecked(True)
|
||||
formLayout.addRow(QtGui.QLabel("Finishing Profile"), form.FinishingProfile)
|
||||
|
||||
# Use outline checkbox
|
||||
form.useOutline = QtGui.QCheckBox()
|
||||
form.useOutline.setChecked(False)
|
||||
formLayout.addRow(QtGui.QLabel("Use outline"), form.useOutline)
|
||||
|
||||
layout.addLayout(formLayout)
|
||||
|
||||
# stop button
|
||||
form.StopButton = QtGui.QPushButton("Stop")
|
||||
form.StopButton.setCheckable(True)
|
||||
layout.addWidget(form.StopButton)
|
||||
|
||||
form.setLayout(layout)
|
||||
self.populateCombobox(form, enumTups, comboToPropertyMap)
|
||||
return form
|
||||
|
||||
def populateCombobox(self, form, enumTups, comboBoxesPropertyMap):
|
||||
"""fillComboboxes(form, comboBoxesPropertyMap) ... populate comboboxes with translated enumerations
|
||||
** comboBoxesPropertyMap will be unnecessary if UI files use strict combobox naming protocol.
|
||||
Args:
|
||||
form = UI form
|
||||
enumTups = list of (translated_text, data_string) tuples
|
||||
comboBoxesPropertyMap = list of (translated_text, data_string) tuples
|
||||
"""
|
||||
# Load appropriate enumerations in each combobox
|
||||
for cb, prop in comboBoxesPropertyMap:
|
||||
box = getattr(form, cb) # Get the combobox
|
||||
box.clear() # clear the combobox
|
||||
for text, data in enumTups[prop]: # load enumerations
|
||||
box.addItem(text, data)
|
||||
|
||||
def getSignalsForUpdate(self, obj):
|
||||
'''getSignalsForUpdate(obj) ... return list of signals for updating obj'''
|
||||
"""getSignalsForUpdate(obj) ... return list of signals for updating obj"""
|
||||
signals = []
|
||||
# signals.append(self.form.button.clicked)
|
||||
signals.append(self.form.Side.currentIndexChanged)
|
||||
@@ -189,10 +88,10 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
self.form.HelixConeAngle.setValue(obj.HelixConeAngle)
|
||||
self.form.HelixDiameterLimit.setValue(obj.HelixDiameterLimit)
|
||||
self.form.LiftDistance.setValue(obj.LiftDistance)
|
||||
if hasattr(obj, 'KeepToolDownRatio'):
|
||||
if hasattr(obj, "KeepToolDownRatio"):
|
||||
self.form.KeepToolDownRatio.setValue(obj.KeepToolDownRatio)
|
||||
|
||||
if hasattr(obj, 'StockToLeave'):
|
||||
if hasattr(obj, "StockToLeave"):
|
||||
self.form.StockToLeave.setValue(obj.StockToLeave)
|
||||
|
||||
# self.form.ProcessHoles.setChecked(obj.ProcessHoles)
|
||||
@@ -202,17 +101,17 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
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
|
||||
obj.setEditorMode('StopProcessing', 2) # hide this property
|
||||
obj.setEditorMode('Stopped', 2) # hide this property
|
||||
obj.setEditorMode("AdaptiveInputState", 2) # hide this property
|
||||
obj.setEditorMode("AdaptiveOutputState", 2) # hide this property
|
||||
obj.setEditorMode("StopProcessing", 2) # hide this property
|
||||
obj.setEditorMode("Stopped", 2) # hide this property
|
||||
|
||||
def getFields(self, obj):
|
||||
if obj.Side != str(self.form.Side.currentText()):
|
||||
obj.Side = str(self.form.Side.currentText())
|
||||
if obj.Side != str(self.form.Side.currentData()):
|
||||
obj.Side = str(self.form.Side.currentData())
|
||||
|
||||
if obj.OperationType != str(self.form.OperationType.currentText()):
|
||||
obj.OperationType = str(self.form.OperationType.currentText())
|
||||
if obj.OperationType != str(self.form.OperationType.currentData()):
|
||||
obj.OperationType = str(self.form.OperationType.currentData())
|
||||
|
||||
obj.StepOver = self.form.StepOver.value()
|
||||
obj.Tolerance = 1.0 * self.form.Tolerance.value() / 100.0
|
||||
@@ -221,37 +120,41 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
obj.HelixDiameterLimit = self.form.HelixDiameterLimit.value()
|
||||
obj.LiftDistance = self.form.LiftDistance.value()
|
||||
|
||||
if hasattr(obj, 'KeepToolDownRatio'):
|
||||
if hasattr(obj, "KeepToolDownRatio"):
|
||||
obj.KeepToolDownRatio = self.form.KeepToolDownRatio.value()
|
||||
|
||||
if hasattr(obj, 'StockToLeave'):
|
||||
if hasattr(obj, "StockToLeave"):
|
||||
obj.StockToLeave = self.form.StockToLeave.value()
|
||||
|
||||
obj.ForceInsideOut = self.form.ForceInsideOut.isChecked()
|
||||
obj.FinishingProfile = self.form.FinishingProfile.isChecked()
|
||||
obj.UseOutline = self.form.useOutline.isChecked()
|
||||
obj.Stopped = self.form.StopButton.isChecked()
|
||||
if(obj.Stopped):
|
||||
if obj.Stopped:
|
||||
self.form.StopButton.setChecked(False) # reset the button
|
||||
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
|
||||
obj.setEditorMode('Stopped', 2) # hide this property
|
||||
obj.setEditorMode("AdaptiveInputState", 2) # hide this property
|
||||
obj.setEditorMode("AdaptiveOutputState", 2) # hide this property
|
||||
obj.setEditorMode("StopProcessing", 2) # hide this property
|
||||
obj.setEditorMode("Stopped", 2) # hide this property
|
||||
|
||||
def taskPanelBaseLocationPage(self, obj, features):
|
||||
if not hasattr(self, 'extensionsPanel'):
|
||||
self.extensionsPanel = PathFeatureExtensionsGui.TaskPanelExtensionPage(obj, features) # pylint: disable=attribute-defined-outside-init
|
||||
if not hasattr(self, "extensionsPanel"):
|
||||
self.extensionsPanel = PathFeatureExtensionsGui.TaskPanelExtensionPage(
|
||||
obj, features
|
||||
) # pylint: disable=attribute-defined-outside-init
|
||||
return self.extensionsPanel
|
||||
|
||||
|
||||
Command = PathOpGui.SetupOperation('Adaptive',
|
||||
PathAdaptive.Create,
|
||||
TaskPanelOpPage,
|
||||
'Path_Adaptive',
|
||||
QtCore.QT_TRANSLATE_NOOP("Path_Adaptive", "Adaptive"),
|
||||
QtCore.QT_TRANSLATE_NOOP("Path_Adaptive", "Adaptive clearing and profiling"),
|
||||
PathAdaptive.SetupProperties)
|
||||
Command = PathOpGui.SetupOperation(
|
||||
"Adaptive",
|
||||
PathAdaptive.Create,
|
||||
TaskPanelOpPage,
|
||||
"Path_Adaptive",
|
||||
QtCore.QT_TRANSLATE_NOOP("Path_Adaptive", "Adaptive"),
|
||||
QtCore.QT_TRANSLATE_NOOP("Path_Adaptive", "Adaptive clearing and profiling"),
|
||||
PathAdaptive.SetupProperties,
|
||||
)
|
||||
|
||||
@@ -24,37 +24,46 @@ import FreeCADGui
|
||||
import PathScripts.PathPreferences as PathPreferences
|
||||
import PySide
|
||||
|
||||
# Qt translation handling
|
||||
def translate(context, text, disambig=None):
|
||||
return PySide.QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
class AdvancedPreferencesPage:
|
||||
def __init__(self, parent=None):
|
||||
self.form = FreeCADGui.PySideUic.loadUi(':preferences/Advanced.ui')
|
||||
self.form = FreeCADGui.PySideUic.loadUi(":preferences/Advanced.ui")
|
||||
self.form.WarningSuppressAllSpeeds.stateChanged.connect(self.updateSelection)
|
||||
self.form.EnableAdvancedOCLFeatures.stateChanged.connect(self.updateSelection)
|
||||
|
||||
def saveSettings(self):
|
||||
PathPreferences.setPreferencesAdvanced(
|
||||
self.form.EnableAdvancedOCLFeatures.isChecked(),
|
||||
self.form.WarningSuppressAllSpeeds.isChecked(),
|
||||
self.form.WarningSuppressRapidSpeeds.isChecked(),
|
||||
self.form.WarningSuppressSelectionMode.isChecked(),
|
||||
self.form.WarningSuppressOpenCamLib.isChecked())
|
||||
self.form.EnableAdvancedOCLFeatures.isChecked(),
|
||||
self.form.WarningSuppressAllSpeeds.isChecked(),
|
||||
self.form.WarningSuppressRapidSpeeds.isChecked(),
|
||||
self.form.WarningSuppressSelectionMode.isChecked(),
|
||||
self.form.WarningSuppressOpenCamLib.isChecked(),
|
||||
)
|
||||
|
||||
def loadSettings(self):
|
||||
self.form.WarningSuppressAllSpeeds.setChecked(PathPreferences.suppressAllSpeedsWarning())
|
||||
self.form.WarningSuppressRapidSpeeds.setChecked(PathPreferences.suppressRapidSpeedsWarning(False))
|
||||
self.form.WarningSuppressSelectionMode.setChecked(PathPreferences.suppressSelectionModeWarning())
|
||||
self.form.EnableAdvancedOCLFeatures.setChecked(PathPreferences.advancedOCLFeaturesEnabled())
|
||||
self.form.WarningSuppressOpenCamLib.setChecked(PathPreferences.suppressOpenCamLibWarning())
|
||||
self.form.WarningSuppressAllSpeeds.setChecked(
|
||||
PathPreferences.suppressAllSpeedsWarning()
|
||||
)
|
||||
self.form.WarningSuppressRapidSpeeds.setChecked(
|
||||
PathPreferences.suppressRapidSpeedsWarning(False)
|
||||
)
|
||||
self.form.WarningSuppressSelectionMode.setChecked(
|
||||
PathPreferences.suppressSelectionModeWarning()
|
||||
)
|
||||
self.form.EnableAdvancedOCLFeatures.setChecked(
|
||||
PathPreferences.advancedOCLFeaturesEnabled()
|
||||
)
|
||||
self.form.WarningSuppressOpenCamLib.setChecked(
|
||||
PathPreferences.suppressOpenCamLibWarning()
|
||||
)
|
||||
self.updateSelection()
|
||||
|
||||
def updateSelection(self, state=None):
|
||||
self.form.WarningSuppressOpenCamLib.setEnabled(self.form.EnableAdvancedOCLFeatures.isChecked())
|
||||
self.form.WarningSuppressOpenCamLib.setEnabled(
|
||||
self.form.EnableAdvancedOCLFeatures.isChecked()
|
||||
)
|
||||
if self.form.WarningSuppressAllSpeeds.isChecked():
|
||||
self.form.WarningSuppressRapidSpeeds.setChecked(True)
|
||||
self.form.WarningSuppressRapidSpeeds.setEnabled(False)
|
||||
else:
|
||||
self.form.WarningSuppressRapidSpeeds.setEnabled(True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user