Skip to content

Commit

Permalink
Fix properties writing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Bergh committed May 24, 2022
1 parent 107c682 commit 8c0bbd8
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions _TaskPanelCfdPhysicsSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,20 +238,19 @@ def accept(self):
storeIfChanged(self.obj, 'gy', getQuantity(self.form.gy))
storeIfChanged(self.obj, 'gz', getQuantity(self.form.gz))

FreeCADGui.doCommand("obj.SRFModelEnabled = {}".format(self.form.srfCheckBox.isChecked()))
FreeCADGui.doCommand("obj.SRFModelRPM = '{}'".format(getQuantity(self.form.inputSRFRPM)))
FreeCADGui.doCommand("obj.SRFModelCoR.x "
"= '{}'".format(self.form.inputSRFCoRx.property("quantity").Value))
FreeCADGui.doCommand("obj.SRFModelCoR.y "
"= '{}'".format(self.form.inputSRFCoRy.property("quantity").Value))
FreeCADGui.doCommand("obj.SRFModelCoR.z "
"= '{}'".format(self.form.inputSRFCoRz.property("quantity").Value))
FreeCADGui.doCommand("obj.SRFModelAxis.x "
"= '{}'".format(self.form.inputSRFAxisx.property("quantity").Value))
FreeCADGui.doCommand("obj.SRFModelAxis.y "
"= '{}'".format(self.form.inputSRFAxisy.property("quantity").Value))
FreeCADGui.doCommand("obj.SRFModelAxis.z "
"= '{}'".format(self.form.inputSRFAxisz.property("quantity").Value))
if self.form.srfCheckBox.isChecked():
storeIfChanged(self.obj, 'SRFModelEnabled', self.form.srfCheckBox.isChecked())
storeIfChanged(self.obj, 'SRFModelRPM', self.form.inputSRFRPM.text())
centre_of_rotation = FreeCAD.Vector(
self.form.inputSRFCoRx.property("quantity").Value,
self.form.inputSRFCoRy.property("quantity").Value,
self.form.inputSRFCoRz.property("quantity").Value)
storeIfChanged(self.obj, 'SRFModelCoR', centre_of_rotation)
model_axis = FreeCAD.Vector(
self.form.inputSRFAxisx.property("quantity").Value,
self.form.inputSRFAxisy.property("quantity").Value,
self.form.inputSRFAxisz.property("quantity").Value)
storeIfChanged(self.obj, 'SRFModelAxis', model_axis)

def reject(self):
doc = FreeCADGui.getDocument(self.obj.Document)
Expand Down

0 comments on commit 8c0bbd8

Please sign in to comment.