From 9942d90f09d9cfae7dbb7a96facec86701c04a10 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernard=20S=C3=A9cher=C3=83?= Date: Fri, 26 Feb 2021 13:20:07 +0100 Subject: [PATCH] update GUI: display only one model pannel --- CoreFlows/gui/ui/MainCFWidget.py | 47 +++++++++++ CoreFlows/gui/ui/MainCFWidget.ui | 132 ++++++++++++++++++++++++++----- 2 files changed, 161 insertions(+), 18 deletions(-) diff --git a/CoreFlows/gui/ui/MainCFWidget.py b/CoreFlows/gui/ui/MainCFWidget.py index 64a5dcf..6b3fcf4 100755 --- a/CoreFlows/gui/ui/MainCFWidget.py +++ b/CoreFlows/gui/ui/MainCFWidget.py @@ -11,6 +11,13 @@ class MainCFWidget(QtWidgets.QTabWidget): QtWidgets.QTabWidget.__init__(self) loadUi(completeResPath("MainCFWidget.ui"), self) self._python_dump = [] + self.models = [] + for i in range(6): + self.models += [self.widget(2+i)] + for i in range(5): + self.removeTab(3) +# for i in range(5): +# self.insertTab(3+i,self.models[i],"Physical model") def scanWidgets(self): print(self.tabModel) @@ -264,3 +271,43 @@ class MainCFWidget(QtWidgets.QTabWidget): myProblem.terminate() # TODO use a helper object here. + + def onSinglePhaseSelected(self,isChecked): + if(isChecked): + print("SinglePhaseSelected") + self.removeTab(2) + self.insertTab(2,self.models[0],"Physical model") + + + def onDriftModelSelected(self,isChecked): + if(isChecked): + print("DriftModelSelected") + self.removeTab(2) + self.insertTab(2,self.models[1],"Physical model") + + def onTransportSelected(self,isChecked): + if(isChecked): + print("TransportSelected") + self.removeTab(2) + self.insertTab(2,self.models[5],"Physical model") + + + def onIsothermal2FluidSelected(self,isChecked): + if(isChecked): + print("Isothermal2FluidSelected") + self.removeTab(2) + self.insertTab(2,self.models[3],"Physical model") + + def onDiffusionSelected(self,isChecked): + if(isChecked): + print("DiffusionSelected") + self.removeTab(2) + self.insertTab(2,self.models[4],"Physical model") + + + def on5Eq2FluidSelected(self,isChecked): + if(isChecked): + print("5Eq2FluidSelected") + self.removeTab(2) + self.insertTab(2,self.models[2],"Physical model") + diff --git a/CoreFlows/gui/ui/MainCFWidget.ui b/CoreFlows/gui/ui/MainCFWidget.ui index 74e86f6..d422867 100755 --- a/CoreFlows/gui/ui/MainCFWidget.ui +++ b/CoreFlows/gui/ui/MainCFWidget.ui @@ -12751,12 +12751,12 @@ setEnabled(bool) - 618 - 212 + 610 + 237 - 858 - 377 + 110 + 65 @@ -12767,12 +12767,12 @@ setEnabled(bool) - 482 - 212 + 476 + 237 - 608 - 377 + 110 + 65 @@ -12783,12 +12783,12 @@ setEnabled(bool) - 346 - 212 + 342 + 237 - 358 - 377 + 110 + 65 @@ -12799,12 +12799,12 @@ setEnabled(bool) - 183 - 249 + 100 + 65 - 604 - 370 + 780 + 235 @@ -12815,8 +12815,8 @@ onLaunchSimu() - 989 - 753 + 349 + 80 918 @@ -12824,6 +12824,102 @@ + + DriftModel_RadioButton + toggled(bool) + TabWidget + onDriftModelSelected(bool) + + + 647 + 465 + + + 610 + 425 + + + + + SinglePhase_RadioButton + toggled(bool) + TabWidget + onSinglePhaseSelected(bool) + + + 522 + 390 + + + 610 + 425 + + + + + TransportEquation_RadioButton + toggled(bool) + TabWidget + onTransportSelected(bool) + + + 522 + 294 + + + 610 + 425 + + + + + DiffusionEquation_RadioButton + toggled(bool) + TabWidget + onDiffusionSelected(bool) + + + 522 + 330 + + + 610 + 425 + + + + + IsothermalTwoFluid_RadioButton + toggled(bool) + TabWidget + onIsothermal2FluidSelected(bool) + + + 522 + 486 + + + 610 + 425 + + + + + FiveEqsTwoFluid_RadioButton + toggled(bool) + TabWidget + on5Eq2FluidSelected(bool) + + + 522 + 522 + + + 610 + 425 + + + onTransportSelected(bool) -- 2.39.2