Skip to content

Commit

Permalink
Fix UI panel selections
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Bergh committed May 30, 2022
1 parent 91bdf16 commit d36966e
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions _TaskPanelCfdPhysicsSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'SpalartAllmarasIDDES']
LES_MODELS = ['kEqn', 'Smagorinsky', 'WALE']


class _TaskPanelCfdPhysicsSelection:
def __init__(self, obj):
FreeCADGui.Selection.clearSelection()
Expand All @@ -65,6 +66,15 @@ def __init__(self, obj):

def load(self):

self.form.radioButtonSteady.toggled.connect(self.updateUI)
self.form.radioButtonTransient.toggled.connect(self.updateUI)
self.form.radioButtonSinglePhase.toggled.connect(self.updateUI)
self.form.radioButtonFreeSurface.toggled.connect(self.updateUI)
self.form.radioButtonIncompressible.toggled.connect(self.updateUI)
self.form.radioButtonCompressible.toggled.connect(self.updateUI)
self.form.checkBoxHighMach.toggled.connect(self.updateUI)
self.form.srfCheckBox.toggled.connect(self.updateUI)

# Time
if self.obj.Time == 'Steady':
self.form.radioButtonSteady.toggle()
Expand Down Expand Up @@ -149,10 +159,13 @@ def updateUI(self):
(self.form.radioButtonCompressible.isChecked() and not self.form.checkBoxHighMach.isChecked()))

# SRF model
srf_capable = (self.form.srfCheckBox.isChecked() and self.form.radioButtonSteady.isChecked()
and not self.form.radioButtonCompressible.isChecked())
self.form.srfFrame.setEnabled(srf_capable)
self.form.srfCheckBox.setChecked(srf_capable)
srf_capable = (self.form.radioButtonSteady.isChecked() and not self.form.radioButtonCompressible.isChecked())
srf_should_be_unchecked = (self.form.radioButtonCompressible.isChecked() or self.form.radioButtonTransient.isChecked()
or self.form.radioButtonFreeSurface.isChecked())
self.form.srfCheckBox.setEnabled(srf_capable)
if srf_should_be_unchecked:
self.form.srfCheckBox.setChecked(False)
self.form.srfFrame.setEnabled(self.form.srfCheckBox.isChecked())

# Free surface
if self.form.radioButtonFreeSurface.isChecked():
Expand Down

0 comments on commit d36966e

Please sign in to comment.