From 91bdf1652d6f74bb543c81f781dda7d53a2ff2b8 Mon Sep 17 00:00:00 2001 From: Jonathan Bergh Date: Sat, 28 May 2022 17:12:42 +1200 Subject: [PATCH] Update task panel for new BCs --- _TaskPanelCfdFluidBoundary.py | 42 ++++++++++++++++------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/_TaskPanelCfdFluidBoundary.py b/_TaskPanelCfdFluidBoundary.py index 560e933b..211e98e9 100644 --- a/_TaskPanelCfdFluidBoundary.py +++ b/_TaskPanelCfdFluidBoundary.py @@ -414,8 +414,7 @@ def accept(self): storeIfChanged(self.obj, 'MassFlowRate', getQuantity(self.form.inputMassFlowRate)) storeIfChanged(self.obj, 'VolFlowRate', getQuantity(self.form.inputVolFlowRate)) - FreeCADGui.doCommand("bc.RelativeToFrame " - "= {}".format(self.form.cb_relative_srf.isChecked())) + storeIfChanged(self.obj, 'RelativeToFrame', self.form.cb_relative_srf.isChecked()) # Pressure storeIfChanged(self.obj, 'Pressure', getQuantity(self.form.inputPressure)) @@ -429,27 +428,24 @@ def accept(self): storeIfChanged(self.obj, 'HeatTransferCoeff', getQuantity(self.form.inputHeatTransferCoeff)) # Periodic - FreeCADGui.doCommand("bc.RotationalPeriodic " - "= {}".format(self.form.rb_rotational_periodic.isChecked())) - FreeCADGui.doCommand("bc.PeriodicCentreOfRotation.x " - "= {}".format(self.form.input_corx.property("quantity").Value)) - FreeCADGui.doCommand("bc.PeriodicCentreOfRotation.y " - "= {}".format(self.form.input_cory.property("quantity").Value)) - FreeCADGui.doCommand("bc.PeriodicCentreOfRotation.z " - "= {}".format(self.form.input_corz.property("quantity").Value)) - FreeCADGui.doCommand("bc.PeriodicCentreOfRotationAxis.x " - "= {}".format(self.form.input_axisx.property("quantity").Value)) - FreeCADGui.doCommand("bc.PeriodicCentreOfRotationAxis.y " - "= {}".format(self.form.input_axisy.property("quantity").Value)) - FreeCADGui.doCommand("bc.PeriodicCentreOfRotationAxis.z " - "= {}".format(self.form.input_axisz.property("quantity").Value)) - - FreeCADGui.doCommand("bc.PeriodicSeparationVector.x " - "= {}".format(self.form.input_sepx.property("quantity").Value)) - FreeCADGui.doCommand("bc.PeriodicSeparationVector.y " - "= {}".format(self.form.input_sepy.property("quantity").Value)) - FreeCADGui.doCommand("bc.PeriodicSeparationVector.z " - "= {}".format(self.form.input_sepz.property("quantity").Value)) + storeIfChanged(self.obj, 'RotationalPeriodic', self.form.rb_rotational_periodic.isChecked()) + centre_of_rotation = FreeCAD.Vector( + self.form.input_corx.property("quantity").Value, + self.form.input_cory.property("quantity").Value, + self.form.input_corz.property("quantity").Value) + storeIfChanged(self.obj, 'PeriodicCentreOfRotation', centre_of_rotation) + + rotation_axis = FreeCAD.Vector( + self.form.input_axisx.propertx("quantity").Value, + self.form.input_axisx.property("quantity").Value, + self.form.input_axisx.propertz("quantity").Value) + storeIfChanged(self.obj, 'PeriodicCentreOfRotationAxis', rotation_axis) + + separation_vector = FreeCAD.Vector( + self.form.input_sepx.property("quantity").Value, + self.form.input_sepy.property("quantity").Value, + self.form.input_sepz.property("quantity").Value) + storeIfChanged(self.obj, 'PeriodicSeparationVector', separation_vector) # Turbulence if self.turb_model in CfdFluidBoundary.TURBULENT_INLET_SPEC: