Example #1
0
    def __init__(self, obj, asDialog):
        self.form = FreeCADGui.PySideUic.loadUi(
            ":/panels/DlgToolControllerEdit.ui")
        if not asDialog:
            self.form.buttonBox.hide()
        self.obj = obj

        self.vertFeed = PathGui.QuantitySpinBox(self.form.vertFeed, obj,
                                                'VertFeed')
        self.horizFeed = PathGui.QuantitySpinBox(self.form.horizFeed, obj,
                                                 'HorizFeed')
        self.vertRapid = PathGui.QuantitySpinBox(self.form.vertRapid, obj,
                                                 'VertRapid')
        self.horizRapid = PathGui.QuantitySpinBox(self.form.horizRapid, obj,
                                                  'HorizRapid')

        self.toolDiameter = PathGui.QuantitySpinBox(self.form.toolDiameter,
                                                    obj, 'Tool.Diameter')
        self.toolLengthOffset = PathGui.QuantitySpinBox(
            self.form.toolLengthOffset, obj, 'Tool.LengthOffset')
        self.toolFlatRadius = PathGui.QuantitySpinBox(self.form.toolFlatRadius,
                                                      obj, 'Tool.FlatRadius')
        self.toolCornerRadius = PathGui.QuantitySpinBox(
            self.form.toolCornerRadius, obj, 'Tool.CornerRadius')
        self.toolCuttingEdgeAngle = PathGui.QuantitySpinBox(
            self.form.toolCuttingEdgeAngle, obj, 'Tool.CuttingEdgeAngle')
        self.toolCuttingEdgeHeight = PathGui.QuantitySpinBox(
            self.form.toolCuttingEdgeHeight, obj, 'Tool.CuttingEdgeHeight')
    def __init__(self, obj, asDialog):
        self.form = FreeCADGui.PySideUic.loadUi(":/panels/DlgToolControllerEdit.ui")
        if not asDialog:
            self.form.buttonBox.hide()
        self.obj = obj

        comboToPropertyMap = [("spindleDirection", "SpindleDir")]
        enumTups = PathToolController.ToolController.propertyEnumerations(
            dataType="raw"
        )

        self.populateCombobox(self.form, enumTups, comboToPropertyMap)
        self.vertFeed = PathGui.QuantitySpinBox(self.form.vertFeed, obj, "VertFeed")
        self.horizFeed = PathGui.QuantitySpinBox(self.form.horizFeed, obj, "HorizFeed")
        self.vertRapid = PathGui.QuantitySpinBox(self.form.vertRapid, obj, "VertRapid")
        self.horizRapid = PathGui.QuantitySpinBox(
            self.form.horizRapid, obj, "HorizRapid"
        )

        if obj.Proxy.usesLegacyTool(obj):
            self.editor = PathToolEdit.ToolEditor(obj.Tool, self.form.toolEditor)
        else:
            self.editor = None
            self.form.toolBox.widget(1).hide()
            self.form.toolBox.removeItem(1)
Example #3
0
 def initPage(self, obj):
     self.peckDepthSpinBox = PathGui.QuantitySpinBox(
         self.form.peckDepth, obj, 'PeckDepth')
     self.peckRetractSpinBox = PathGui.QuantitySpinBox(
         self.form.peckRetractHeight, obj, 'RetractHeight')
     self.dwellTimeSpinBox = PathGui.QuantitySpinBox(
         self.form.dwellTime, obj, 'DwellTime')
 def initPage(self, obj):
     self.majorDia = PathGui.QuantitySpinBox(self.form.threadMajor, obj,
                                             "MajorDiameter")
     self.minorDia = PathGui.QuantitySpinBox(self.form.threadMinor, obj,
                                             "MinorDiameter")
     self.pitch = PathGui.QuantitySpinBox(self.form.threadPitch, obj,
                                          "Pitch")
    def getFields(self, obj):
        '''getFields(obj) ... transfers values from UI to obj's proprties'''
        # if obj.StartVertex != self.form.startVertex.value():
        #     obj.StartVertex = self.form.startVertex.value()
        PathGui.updateInputField(obj, 'DepthOffset', self.form.depthOffset)
        PathGui.updateInputField(obj, 'SampleInterval', self.form.sampleInterval)

        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.DropCutterDir != str(self.form.dropCutterDirSelect.currentText()):
            obj.DropCutterDir = str(self.form.dropCutterDirSelect.currentText())

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

        if obj.Optimize != self.form.optimizeEnabled.isChecked():
            obj.Optimize = self.form.optimizeEnabled.isChecked()

        self.updateToolController(obj, self.form.toolController)
Example #6
0
    def initPage(self, obj):

        if self.haveStartDepth():
            self.startDepth = PathGui.QuantitySpinBox(self.form.startDepth, obj, 'StartDepth')
        else:
            self.form.startDepth.hide()
            self.form.startDepthLabel.hide()
            self.form.startDepthSet.hide()

        if self.haveFinalDepth():
            self.finalDepth = PathGui.QuantitySpinBox(self.form.finalDepth, obj, 'FinalDepth')
        else:
            if self.haveStartDepth():
                self.form.finalDepth.setEnabled(False)
                self.form.finalDepth.setToolTip(translate('PathOp', 'FinalDepth cannot be modified for this operation.\nIf it is necessary to set the FinalDepth manually please select a different operation.'))
            else:
                self.form.finalDepth.hide()
                self.form.finalDepthLabel.hide()
            self.form.finalDepthSet.hide()

        if self.haveStepDown():
            self.stepDown = PathGui.QuantitySpinBox(self.form.stepDown, obj, 'StepDown')
        else:
            self.form.stepDown.hide()
            self.form.stepDownLabel.hide()

        if self.haveFinishDepth():
            self.finishDepth = PathGui.QuantitySpinBox(self.form.finishDepth, obj, 'FinishDepth')
        else:
            self.form.finishDepth.hide()
            self.form.finishDepthLabel.hide()
Example #7
0
    def getFields(self, obj):
        '''getFields(obj) ... transfers values from UI to obj's proprties'''
        PathGui.updateInputField(obj, 'OffsetExtra', self.form.extraOffset)
        if obj.UseComp != self.form.useCompensation.isChecked():
            obj.UseComp = self.form.useCompensation.isChecked()
        if obj.UseStartPoint != self.form.useStartPoint.isChecked():
            obj.UseStartPoint = self.form.useStartPoint.isChecked()
        if obj.Direction != str(self.form.direction.currentText()):
            obj.Direction = str(self.form.direction.currentText())
        if obj.EnableRotation != str(self.form.enableRotation.currentText()):
            obj.EnableRotation = str(self.form.enableRotation.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()):
                obj.Side = str(self.form.cutSide.currentText())

        if FeatureProcessing & self.profileFeatures():
            if obj.processHoles != self.form.processHoles.isChecked():
                obj.processHoles = self.form.processHoles.isChecked()
            if obj.processPerimeter != self.form.processPerimeter.isChecked():
                obj.processPerimeter = self.form.processPerimeter.isChecked()
            if obj.processCircles != self.form.processCircles.isChecked():
                obj.processCircles = self.form.processCircles.isChecked()
Example #8
0
    def getFields(self, obj):
        '''getFields(obj) ... transfers values from UI to obj's proprties'''
        self.updateToolController(obj, self.form.toolController)
        self.updateCoolant(obj, self.form.coolantController)

        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()
Example #9
0
    def getFields(self, obj):
        '''getFields(obj) ... transfers values from UI to obj's proprties'''
        PathGui.updateInputField(obj, 'DepthOffset', self.form.depthOffset)
        PathGui.updateInputField(obj, 'SampleInterval',
                                 self.form.sampleInterval)

        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.DropCutterDir != str(
                self.form.dropCutterDirSelect.currentText()):
            obj.DropCutterDir = str(
                self.form.dropCutterDirSelect.currentText())

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

        if obj.OptimizeLinearPaths != self.form.optimizeEnabled.isChecked():
            obj.OptimizeLinearPaths = self.form.optimizeEnabled.isChecked()

        self.updateToolController(obj, self.form.toolController)
        self.updateCoolant(obj, self.form.coolantController)
    def getFields(self, obj):
        '''getFields(obj) ... transfers values from UI to obj's proprties'''
        if obj.CutMode != str(self.form.cutMode.currentText()):
            obj.CutMode = str(self.form.cutMode.currentText())
        if obj.StepOver != self.form.stepOverPercent.value():
            obj.StepOver = self.form.stepOverPercent.value()
        if obj.OffsetPattern != str(self.form.offsetPattern.currentText()):
            obj.OffsetPattern = str(self.form.offsetPattern.currentText())

        PathGui.updateInputField(obj, 'ExtraOffset', self.form.extraOffset)
        self.updateToolController(obj, self.form.toolController)
        self.updateZigZagAngle(obj)

        if obj.UseStartPoint != self.form.useStartPoint.isChecked():
            obj.UseStartPoint = self.form.useStartPoint.isChecked()

        if FeatureOutline & self.pocketFeatures():
            if obj.UseOutline != self.form.useOutline.isChecked():
                obj.UseOutline = self.form.useOutline.isChecked()

        self.updateMinTravel(obj)

        if FeatureFacing & self.pocketFeatures():
            if obj.BoundaryShape != str(self.form.boundaryShape.currentText()):
                obj.BoundaryShape = str(self.form.boundaryShape.currentText())
Example #11
0
    def getFields(self, obj):
        """getFields(obj) ... transfers values from UI to obj's proprties"""
        if obj.CutMode != str(self.form.cutMode.currentData()):
            obj.CutMode = str(self.form.cutMode.currentData())
        if obj.StepOver != self.form.stepOverPercent.value():
            obj.StepOver = self.form.stepOverPercent.value()
        if obj.OffsetPattern != str(self.form.offsetPattern.currentData()):
            obj.OffsetPattern = str(self.form.offsetPattern.currentData())

        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():
            obj.UseStartPoint = self.form.useStartPoint.isChecked()

        if FeatureOutline & self.pocketFeatures():
            if obj.UseOutline != self.form.useOutline.isChecked():
                obj.UseOutline = self.form.useOutline.isChecked()

        self.updateMinTravel(obj)

        if FeatureFacing & self.pocketFeatures():
            print(obj.BoundaryShape)
            print(self.form.boundaryShape.currentText())
            print(self.form.boundaryShape.currentData())
            if obj.BoundaryShape != str(self.form.boundaryShape.currentData()):
                obj.BoundaryShape = str(self.form.boundaryShape.currentData())
            if obj.ClearEdges != self.form.clearEdges.isChecked():
                obj.ClearEdges = self.form.clearEdges.isChecked()
    def initPage(self, obj):
        self.majorDia = PathGui.QuantitySpinBox(self.form.threadMajor, obj, 'MajorDiameter') # pylint: disable=attribute-defined-outside-init
        self.minorDia = PathGui.QuantitySpinBox(self.form.threadMinor, obj, 'MinorDiameter') # pylint: disable=attribute-defined-outside-init
        self.pitch    = PathGui.QuantitySpinBox(self.form.threadPitch, obj, 'Pitch') # pylint: disable=attribute-defined-outside-init

        setupCombo(self.form.threadOrientation, obj.Proxy.ThreadOrientations)
        setupCombo(self.form.threadType, obj.Proxy.ThreadTypes)
        setupCombo(self.form.opDirection, obj.Proxy.Directions)
Example #13
0
 def initPage(self, obj):
     self.peckDepthSpinBox = PathGui.QuantitySpinBox(
         self.form.peckDepth, obj, "PeckDepth")
     self.peckRetractSpinBox = PathGui.QuantitySpinBox(
         self.form.peckRetractHeight, obj, "RetractHeight")
     self.dwellTimeSpinBox = PathGui.QuantitySpinBox(
         self.form.dwellTime, obj, "DwellTime")
     self.form.chipBreakEnabled.setEnabled(False)
Example #14
0
    def updateZigZagAngle(self, obj, setModel=True):
        if obj.OffsetPattern in ['Offset', 'Spiral']:
            self.form.zigZagAngle.setEnabled(False)
        else:
            self.form.zigZagAngle.setEnabled(True)

        if setModel:
            PathGui.updateInputField(obj, 'ZigZagAngle', self.form.zigZagAngle)
Example #15
0
 def getFields(self, obj):
     '''getFields(obj) ... transfers values from UI to obj's proprties'''
     self.updateToolController(obj, self.form.toolController)
     PathGui.updateInputField(obj, 'Xoffset', self.form.Xoffset)
     PathGui.updateInputField(obj, 'Yoffset', self.form.Yoffset)
     obj.PointCountX = self.form.PointCountX.value()
     obj.PointCountY = self.form.PointCountY.value()
     obj.OutputFileName = str(self.form.OutputFileName.text())
Example #16
0
    def updateZigZagAngle(self, obj, setModel=True):
        if obj.OffsetPattern in ["Offset", "Spiral"]:
            self.form.zigZagAngle.setEnabled(False)
        else:
            self.form.zigZagAngle.setEnabled(True)

        if setModel:
            PathGui.updateInputField(obj, "ZigZagAngle", self.form.zigZagAngle)
    def updateZigZagAngle(self, obj, setModel=True):
        if obj.OffsetPattern in ['Offset', 'Spiral']:
            self.form.zigZagAngle.setEnabled(False)
        else:
            self.form.zigZagAngle.setEnabled(True)

        if setModel:
            PathGui.updateInputField(obj, 'ZigZagAngle', self.form.zigZagAngle)
Example #18
0
 def initPage(self, obj):
     # pylint: disable=attribute-defined-outside-init
     self.peckDepthSpinBox = PathGui.QuantitySpinBox(
         self.form.peckDepth, obj, 'PeckDepth')
     self.peckRetractSpinBox = PathGui.QuantitySpinBox(
         self.form.peckRetractHeight, obj, 'RetractHeight')
     self.dwellTimeSpinBox = PathGui.QuantitySpinBox(
         self.form.dwellTime, obj, 'DwellTime')
Example #19
0
    def getFields(self, obj):
        '''getFields(obj) ... transfers values from UI to obj's proprties'''
        self.updateToolController(obj, self.form.toolController)
        self.updateCoolant(obj, self.form.coolantController)

        if obj.BoundBox != str(self.form.boundBoxSelect.currentText()):
            obj.BoundBox = str(self.form.boundBoxSelect.currentText())

        if obj.ScanType != str(self.form.scanType.currentText()):
            obj.ScanType = str(self.form.scanType.currentText())

        if obj.LayerMode != str(self.form.layerMode.currentText()):
            obj.LayerMode = str(self.form.layerMode.currentText())

        """
        The following method of getting values from the UI form
            allows for translations of combobox options in the UI.
        The requirement is that the enumeration lists must
            be in the same order in both the opPropertyEnumerations() method
            and the UI panel QComboBox list.
        Another step to ensure synchronization of the two lists is to
            populate the list dynamically in this Gui module in `initPage()`
            using the property enumerations list when loading the UI panel.
            This type of dynamic combobox population is done for the
            Tool Controller selection.
        """
        val = self.propEnums['CutPattern'][self.form.cutPattern.currentIndex()]
        if obj.CutPattern != val:
            obj.CutPattern = val

        val = self.propEnums['ProfileEdges'][self.form.profileEdges.currentIndex()]
        if obj.ProfileEdges != val:
            obj.ProfileEdges = val

        if obj.AvoidLastX_Faces != self.form.avoidLastX_Faces.value():
            obj.AvoidLastX_Faces = self.form.avoidLastX_Faces.value()

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

        if obj.DropCutterDir != str(self.form.dropCutterDirSelect.currentText()):
            obj.DropCutterDir = str(self.form.dropCutterDirSelect.currentText())

        PathGui.updateInputField(obj, 'DepthOffset', self.form.depthOffset)

        if obj.StepOver != self.form.stepOver.value():
            obj.StepOver = self.form.stepOver.value()

        PathGui.updateInputField(obj, 'SampleInterval', self.form.sampleInterval)

        if obj.UseStartPoint != self.form.useStartPoint.isChecked():
            obj.UseStartPoint = self.form.useStartPoint.isChecked()

        if obj.OptimizeLinearPaths != self.form.optimizeEnabled.isChecked():
            obj.OptimizeLinearPaths = self.form.optimizeEnabled.isChecked()

        if obj.OptimizeStepOverTransitions != self.form.optimizeStepOverTransitions.isChecked():
            obj.OptimizeStepOverTransitions = self.form.optimizeStepOverTransitions.isChecked()
    def getFields(self, obj):
        PathGui.updateInputField(obj, 'Width', self.form.value_W)
        PathGui.updateInputField(obj, 'ExtraDepth', self.form.value_h)
        if self.form.joinRound.isChecked():
            obj.Join = 'Round'
        elif self.form.joinMiter.isChecked():
            obj.Join = 'Miter'

        self.updateToolController(obj, self.form.toolController)
Example #21
0
    def getFields(self, obj):
        PathGui.updateInputField(obj, 'Width', self.form.value_W)
        PathGui.updateInputField(obj, 'ExtraDepth', self.form.value_h)
        if self.form.joinRound.isChecked():
            obj.Join = 'Round'
        elif self.form.joinMiter.isChecked():
            obj.Join = 'Miter'

        self.updateToolController(obj, self.form.toolController)
Example #22
0
 def initPage(self, obj):
     self.majorDia = PathGui.QuantitySpinBox(
         self.form.threadMajor, obj, "MajorDiameter"
     )  # pylint: disable=attribute-defined-outside-init
     self.minorDia = PathGui.QuantitySpinBox(
         self.form.threadMinor, obj, "MinorDiameter"
     )  # pylint: disable=attribute-defined-outside-init
     self.pitch = PathGui.QuantitySpinBox(
         self.form.threadPitch, obj, "Pitch"
     )  # pylint: disable=attribute-defined-outside-init
Example #23
0
 def setupUi(self):
     self.clearanceHeightOffs = PathGui.QuantitySpinBox(
         self.form.setupClearanceHeightOffs, self.obj,
         'ClearanceHeightOffset')
     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.setFields()
Example #24
0
 def initPage(self, obj):
     '''initPage(obj) ... Is called after getForm() to initiate the task panel.'''
     debugMsg('initPage()')
     # pylint: disable=attribute-defined-outside-init
     self.CATS = [None, None]
     self.propEnums = PathSlot.ObjectSlot.opPropertyEnumerations(False)
     self.ENUMS = dict()
     self.setTitle("Slot - " + obj.Label)
     # retrieve property enumerations
     # Requirements due to Gui::QuantitySpinBox class use in UI panel
     self.geo1Extension = PathGui.QuantitySpinBox(self.form.geo1Extension, obj, 'ExtendPathStart')
     self.geo2Extension = PathGui.QuantitySpinBox(self.form.geo2Extension, obj, 'ExtendPathEnd')
 def setupUi(self):
     self.clearanceHeightOffs = PathGui.QuantitySpinBox(
         self.form.setupClearanceHeightOffs, self.obj,
         "ClearanceHeightOffset")
     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()
Example #26
0
    def __init__(self, obj, asDialog):
        self.form = FreeCADGui.PySideUic.loadUi(":/panels/DlgToolControllerEdit.ui")
        if not asDialog:
            self.form.buttonBox.hide()
        self.obj = obj

        self.vertFeed = PathGui.QuantitySpinBox(self.form.vertFeed, obj, 'VertFeed')
        self.horizFeed = PathGui.QuantitySpinBox(self.form.horizFeed, obj, 'HorizFeed')
        self.vertRapid = PathGui.QuantitySpinBox(self.form.vertRapid, obj, 'VertRapid')
        self.horizRapid = PathGui.QuantitySpinBox(self.form.horizRapid, obj, 'HorizRapid')

        self.editor = PathToolEdit.ToolEditor(obj.Tool, self.form.toolEditor)
Example #27
0
    def __init__(self, obj):
        self.obj = obj
        self.form = FreeCADGui.PySideUic.loadUi(":/panels/DragKnifeEdit.ui")
        self.filterAngle = PathGui.QuantitySpinBox(self.form.filterAngle, obj,
                                                   'filterAngle')
        self.offsetDistance = PathGui.QuantitySpinBox(self.form.offsetDistance,
                                                      obj, 'offset')
        self.pivotHeight = PathGui.QuantitySpinBox(self.form.pivotHeight, obj,
                                                   'pivotheight')

        FreeCAD.ActiveDocument.openTransaction(
            translate("Path_DressupDragKnife", "Edit Dragknife Dress-up"))
Example #28
0
    def getFields(self, obj):
        PathGui.updateInputField(obj, "Width", self.form.value_W)
        PathGui.updateInputField(obj, "ExtraDepth", self.form.value_h)
        if self.form.joinRound.isChecked():
            obj.Join = "Round"
        elif self.form.joinMiter.isChecked():
            obj.Join = "Miter"

        if obj.Direction != str(self.form.direction.currentData()):
            obj.Direction = str(self.form.direction.currentData())

        self.updateToolController(obj, self.form.toolController)
        self.updateCoolant(obj, self.form.coolantController)
Example #29
0
 def getForm(self):
     """getForm() ... returns UI"""
     form = FreeCADGui.PySideUic.loadUi(":/panels/PageOpWaterlineEdit.ui")
     comboToPropertyMap = [
         ("algorithmSelect", "Algorithm"),
         ("boundBoxSelect", "BoundBox"),
         ("layerMode", "LayerMode"),
         ("cutPattern", "CutPattern"),
     ]
     enumTups = PathWaterline.ObjectWaterline.propertyEnumerations(
         dataType="raw")
     PathGui.populateCombobox(form, enumTups, comboToPropertyMap)
     return form
Example #30
0
    def getFields(self, obj):
        """getFields(obj) ... transfers values from UI to obj's proprties"""
        PathLog.track()
        if obj.Direction != str(self.form.direction.currentData()):
            obj.Direction = str(self.form.direction.currentData())
        if obj.StartSide != str(self.form.startSide.currentData()):
            obj.StartSide = str(self.form.startSide.currentData())
        if obj.StepOver != self.form.stepOverPercent.value():
            obj.StepOver = self.form.stepOverPercent.value()
        PathGui.updateInputField(obj, "OffsetExtra", self.form.extraOffset)

        self.updateToolController(obj, self.form.toolController)
        self.updateCoolant(obj, self.form.coolantController)
Example #31
0
    def getFields(self, obj):
        PathGui.updateInputField(obj, 'Width', self.form.value_W)
        PathGui.updateInputField(obj, 'ExtraDepth', self.form.value_h)
        if self.form.joinRound.isChecked():
            obj.Join = 'Round'
        elif self.form.joinMiter.isChecked():
            obj.Join = 'Miter'

        if obj.Direction != str(self.form.direction.currentText()):
            obj.Direction = str(self.form.direction.currentText())

        self.updateToolController(obj, self.form.toolController)
        self.updateCoolant(obj, self.form.coolantController)
Example #32
0
    def getFields(self, obj):
        '''getFields(obj) ... transfers values from UI to obj's proprties'''
        PathLog.track()

        PathGui.updateInputField(obj, 'StepOver', self.form.stepOver)

        obj.FinishPasses = self.form.finishPasses.value()
        obj.StockToLeave = self.form.stockToLeave.value()

        if obj.AllowGrooving != self.form.allowGrooving.isChecked():
            obj.AllowGrooving = self.form.allowGrooving.isChecked()

        self.updateToolController(obj, self.form.toolController)
        self.updateCoolant(obj, self.form.coolantController)
Example #33
0
    def getForm(self):
        """getForm() ... returns UI"""
        form = FreeCADGui.PySideUic.loadUi(":/panels/PageOpSurfaceEdit.ui")
        comboToPropertyMap = [
            ("boundBoxSelect", "BoundBox"),
            ("scanType", "ScanType"),
            ("cutPattern", "CutPattern"),
            ("profileEdges", "ProfileEdges"),
            ("layerMode", "LayerMode"),
            ("dropCutterDirSelect", "DropCutterDir"),
        ]
        enumTups = PathSurface.ObjectSurface.propertyEnumerations(dataType="raw")
        PathGui.populateCombobox(form, enumTups, comboToPropertyMap)

        return form
Example #34
0
 def initPage(self, obj):
     """initPage(obj) ... Is called after getForm() to initiate the task panel."""
     debugMsg("initPage()")
     self.CATS = [None, None]
     self.propEnums = PathSlot.ObjectSlot.propertyEnumerations(dataType="raw")
     self.ENUMS = dict()
     self.setTitle("Slot - " + obj.Label)
     # retrieve property enumerations
     # Requirements due to Gui::QuantitySpinBox class use in UI panel
     self.geo1Extension = PathGui.QuantitySpinBox(
         self.form.geo1Extension, obj, "ExtendPathStart"
     )
     self.geo2Extension = PathGui.QuantitySpinBox(
         self.form.geo2Extension, obj, "ExtendPathEnd"
     )
    def getFields(self, obj):
        '''getFields(obj) ... transfers values from UI to obj's proprties'''
        PathGui.updateInputField(obj, 'OffsetExtra', self.form.extraOffset)
        if obj.UseComp != self.form.useCompensation.isChecked():
            obj.UseComp = self.form.useCompensation.isChecked()
        if obj.UseStartPoint != self.form.useStartPoint.isChecked():
            obj.UseStartPoint = self.form.useStartPoint.isChecked()
        if obj.Direction != str(self.form.direction.currentText()):
            obj.Direction = str(self.form.direction.currentText())

        self.updateToolController(obj, self.form.toolController)

        if FeatureSide & self.profileFeatures():
            if obj.Side != str(self.form.cutSide.currentText()):
                obj.Side = str(self.form.cutSide.currentText())

        if FeatureProcessing & self.profileFeatures():
            if obj.processHoles != self.form.processHoles.isChecked():
                obj.processHoles = self.form.processHoles.isChecked()
            if obj.processPerimeter != self.form.processPerimeter.isChecked():
                obj.processPerimeter = self.form.processPerimeter.isChecked()
            if obj.processCircles != self.form.processCircles.isChecked():
                obj.processCircles = self.form.processCircles.isChecked()
Example #36
0
    def getFields(self, obj):
        '''setFields(obj) ... update obj's properties with values from the UI'''
        PathLog.track()
        PathGui.updateInputField(obj, 'PeckDepth', self.form.peckDepth)
        PathGui.updateInputField(obj, 'RetractHeight', self.form.retractHeight)
        PathGui.updateInputField(obj, 'DwellTime', self.form.dwellTime)

        if obj.DwellEnabled != self.form.dwellEnabled.isChecked():
            obj.DwellEnabled = self.form.dwellEnabled.isChecked()
        if obj.PeckEnabled != self.form.peckEnabled.isChecked():
            obj.PeckEnabled = self.form.peckEnabled.isChecked()
        if obj.AddTipLength != self.form.useTipLength.isChecked():
            obj.AddTipLength = self.form.useTipLength.isChecked()

        self.updateToolController(obj, self.form.toolController)
 def updateExpression(name, widget):
     value = str(widget.text())
     val = PathGui.getProperty(self.obj, name)
     if val != value:
         PathGui.setProperty(self.obj, name, value)
 def updateWidth(self):
     PathGui.updateInputField(self.obj, 'Width', self.form.value_W)
 def updateExtraDepth(self):
     PathGui.updateInputField(self.obj, 'ExtraDepth', self.form.value_h)