Skip to content

Commit

Permalink
Fixes for PathSurface.
Browse files Browse the repository at this point in the history
Correctly remember settings.
  • Loading branch information
sliptonic authored and yorikvanhavre committed Jun 1, 2016
1 parent 4f99078 commit 4568a4e
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions src/Mod/Path/PathScripts/PathSurface.py
Expand Up @@ -418,12 +418,15 @@ def getFields(self):
self.obj.StartDepth = self.form.startDepth.text()
if hasattr(self.obj, "FinalDepth"):
self.obj.FinalDepth = self.form.finalDepth.text()
if hasattr(self.obj, "FinishDepth"):
self.obj.FinishDepth = self.form.finishDepth.text()
if hasattr(self.obj, "StepDown"):
self.obj.StepDown = self.form.stepDown.value()

if hasattr(self.obj, "SafeHeight"):
self.obj.SafeHeight = self.form.safeHeight.text()
if hasattr(self.obj, "ClearanceHeight"):
self.obj.ClearanceHeight = self.form.clearanceHeight.text()
if hasattr(self.obj, "StepDown"):
self.obj.StepDown = self.form.stepDown.value()
if hasattr(self.obj, "Algorithm"):
self.obj.Algorithm = str(
self.form.algorithmSelect.currentText())
Expand All @@ -433,12 +436,20 @@ def getFields(self):
def setFields(self):
self.form.startDepth.setText(str(self.obj.StartDepth.Value))
self.form.finalDepth.setText(str(self.obj.FinalDepth.Value))
self.form.finishDepth.setText(str(self.obj.FinishDepth.Value))
self.form.stepDown.setValue(self.obj.StepDown)

self.form.safeHeight.setText(str(self.obj.SafeHeight.Value))
self.form.clearanceHeight.setText(str(self.obj.ClearanceHeight.Value))

for i in self.obj.Base:
self.form.baseList.addItem(i[0].Name)

index = self.form.algorithmSelect.findText(
self.obj.Algorithm, QtCore.Qt.MatchFixedString)
if index >= 0:
self.form.algorithmSelect.setCurrentIndex(index)

def open(self):
self.s = SelObserver()
# install the function mode resident
Expand Down Expand Up @@ -517,17 +528,26 @@ def getStandardButtons(self):
def setupUi(self):

# Connect Signals and Slots
self.form.startDepth.editingFinished.connect(self.getFields)
self.form.finalDepth.editingFinished.connect(self.getFields)
self.form.safeHeight.editingFinished.connect(self.getFields)
self.form.clearanceHeight.editingFinished.connect(self.getFields)

#Base Geometry
self.form.addBase.clicked.connect(self.addBase)
self.form.deleteBase.clicked.connect(self.deleteBase)
self.form.reorderBase.clicked.connect(self.reorderBase)

self.form.baseList.itemSelectionChanged.connect(self.itemActivated)

# Depths
self.form.startDepth.editingFinished.connect(self.getFields)
self.form.finalDepth.editingFinished.connect(self.getFields)
self.form.finishDepth.editingFinished.connect(self.getFields)
self.form.stepDown.editingFinished.connect(self.getFields)

# Heights
self.form.safeHeight.editingFinished.connect(self.getFields)
self.form.clearanceHeight.editingFinished.connect(self.getFields)

# Operation
self.form.algorithmSelect.currentIndexChanged.connect(self.getFields)

sel = FreeCADGui.Selection.getSelectionEx()
self.setFields()

Expand Down

0 comments on commit 4568a4e

Please sign in to comment.