本文整理汇总了Python中code_saturne.Base.QtPage.ComboModel.disableItem方法的典型用法代码示例。如果您正苦于以下问题:Python ComboModel.disableItem方法的具体用法?Python ComboModel.disableItem怎么用?Python ComboModel.disableItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类code_saturne.Base.QtPage.ComboModel
的用法示例。
在下文中一共展示了ComboModel.disableItem方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SolutionVerifView
# 需要导入模块: from code_saturne.Base.QtPage import ComboModel [as 别名]
# 或者: from code_saturne.Base.QtPage.ComboModel import disableItem [as 别名]
#.........这里部分代码省略.........
opt_polygon = self.modelPolygon.dicoV2M[str(self.comboBoxPolygon.currentText())]
opt_polyhed = self.modelPolyhedra.dicoV2M[str(self.comboBoxPolyhedra.currentText())]
if opt_polygon != 'display': line.append(opt_polygon)
if opt_polyhed != 'display': line.append(opt_polyhed)
l = string.join(line, ',')
log.debug("slotOutputOptions-> OPTCHR = %s" % l)
self.out.setWriterOptions("-1",l)
self.out2.setWriterOptions("-1",l)
def __updateOptionsFormat(self, line):
"""
Update command-line options at each modification of
post processing format
"""
lst = line.split(',')
format = self.modelFMTCHR.dicoV2M[str(self.comboBoxFMTCHR.currentText())]
log.debug("__updateOptionsFormat-> FMTCHR = %s" % format)
log.debug("__updateOptionsFormat-> OPTCHR = %s" % line)
# update widgets from the options list
for opt in lst:
if opt == 'binary' or opt == 'text' :
self.modelFormat.setItem(str_model=opt)
if opt == 'discard_polygons' or opt == 'divide_polygons':
self.modelPolygon.setItem(str_model=opt)
if opt == 'discard_polyhedra' or opt == 'divide_polyhedra':
self.modelPolyhedra.setItem(str_model=opt)
if format == 'ensight':
if opt == 'big_endian':
self.checkBoxBigEndian.setChecked(True)
if 'discard_polygons' not in lst and 'divide_polygons' not in lst:
self.modelPolygon.setItem(str_model="display")
if 'discard_polyhedra' not in lst and 'divide_polyhedra' not in lst:
self.modelPolyhedra.setItem(str_model="display")
if 'big_endian' not in lst:
self.checkBoxBigEndian.setChecked(False)
# enable and disable options related to the format
self.modelPolygon.enableItem(str_model='discard_polygons')
self.modelPolygon.enableItem(str_model='divide_polygons')
self.modelPolyhedra.enableItem(str_model='discard_polyhedra')
self.modelPolyhedra.enableItem(str_model='divide_polyhedra')
self.comboBoxPolygon.setEnabled(True)
self.comboBoxPolyhedra.setEnabled(True)
if format != "ensight":
if format == "cgns":
self.modelPolyhedra.setItem(str_model='divide_polyhedra')
self.modelPolyhedra.disableItem(str_model='display')
elif format in ["catalyst", "ccm"]:
self.modelPolyhedra.setItem(str_model='display')
self.modelPolygon.setItem(str_model='display')
self.comboBoxPolygon.setEnabled(False)
self.comboBoxPolyhedra.setEnabled(False)
self.modelFormat.setItem(str_model="binary")
self.modelFormat.disableItem(str_model='text')
self.labelBigEndian.setEnabled(False)
self.checkBoxBigEndian.setEnabled(False)
else:
self.modelFormat.enableItem(str_model='text')
self.comboBoxFormat.setEnabled(True)
self.labelBigEndian.setEnabled(True)
self.checkBoxBigEndian.setEnabled(True)
def __setButtonEnabled(self):
"""
Block the QButton during the display of the dialog.
"""
try:
self.toolButtonBatch.setEnabled(not self.toolButtonBatch.isEnabled())
except:
pass
def slotMeshChecking(self):
"""
"""
self.__setButtonEnabled()
dialog = MeshQualityCriteriaLogDialogView(self.parent, self.case, self.case2)
dialog.show()
self.connect(dialog, SIGNAL("accepted()"), self.__setButtonEnabled)
self.connect(dialog, SIGNAL("rejected()"), self.__setButtonEnabled)
def tr(self, text):
"""
Translation
"""
return text
示例2: ElectricalView
# 需要导入模块: from code_saturne.Base.QtPage import ComboModel [as 别名]
# 或者: from code_saturne.Base.QtPage.ComboModel import disableItem [as 别名]
class ElectricalView(QWidget, Ui_ElectricalForm):
"""
"""
def __init__(self, parent, case, stbar):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_ElectricalForm.__init__(self)
self.setupUi(self)
self.case = case
self.stbar = stbar
self.case.undoStopGlobal()
self.model = ElectricalModel(self.case)
# Combo model
self.modelJoule = ComboModel(self.comboBoxJouleModel, 4, 1)
self.modelJoule.addItem(self.tr("AC/DC"), "AC/DC")
self.modelJoule.addItem(self.tr("three-phase"), "three-phase")
self.modelJoule.addItem(self.tr("AC/DC with Transformer coupling"), "AC/DC+Transformer")
self.modelJoule.addItem(self.tr("three-phase with Transformer coupling"), "three-phase+Transformer")
self.modelJoule.disableItem(str_model="AC/DC+Transformer")
self.modelJoule.disableItem(str_model="three-phase+Transformer")
self.modelScaling = ComboModel(self.comboBoxScalingModel, 3, 1)
self.modelScaling.addItem(self.tr("general case"), "general_case")
self.modelScaling.addItem(self.tr("plane define"), "plane_define")
self.modelScaling.addItem(self.tr("user define"), "user")
self.modelDirection = ComboModel(self.comboBoxDirection, 3, 1)
self.modelDirection.addItem(self.tr("X"), "X")
self.modelDirection.addItem(self.tr("Y"), "Y")
self.modelDirection.addItem(self.tr("Z"), "Z")
# Connections
self.connect(self.pushButtonPropertiesData, SIGNAL("pressed()"), self.__slotSearchPropertiesData)
self.connect(self.lineEditSRROM, SIGNAL("textChanged(const QString &)"), self.slotSRROM)
self.connect(self.lineEditPower, SIGNAL("textChanged(const QString &)"), self.slotPower)
self.connect(self.lineEditCurrent, SIGNAL("textChanged(const QString &)"), self.slotCurrent)
self.connect(self.checkBoxScaling, SIGNAL("clicked()"), self.slotScaling)
self.connect(self.comboBoxJouleModel, SIGNAL("activated(const QString&)"), self.slotJouleModel)
self.connect(self.comboBoxScalingModel, SIGNAL("activated(const QString&)"), self.slotScalingModel)
self.connect(self.comboBoxDirection, SIGNAL("clicked()"), self.slotDirection)
self.connect(self.lineEditPlaneDefinitionA, SIGNAL("textChanged(const QString &)"), self.slotPlaneDefA)
self.connect(self.lineEditPlaneDefinitionB, SIGNAL("textChanged(const QString &)"), self.slotPlaneDefB)
self.connect(self.lineEditPlaneDefinitionC, SIGNAL("textChanged(const QString &)"), self.slotPlaneDefC)
self.connect(self.lineEditPlaneDefinitionD, SIGNAL("textChanged(const QString &)"), self.slotPlaneDefD)
self.connect(self.lineEditEpsilon, SIGNAL("textChanged(const QString &)"), self.slotPlaneDefEpsilon)
# Validators
validatorSRROM = DoubleValidator(self.lineEditSRROM, min=0.0, max=1.0)
validatorSRROM.setExclusiveMin(False)
validatorPower = DoubleValidator(self.lineEditPower, min=0.0)
validatorPower.setExclusiveMin(False)
validatorCurrent = DoubleValidator(self.lineEditCurrent, min=0.0)
validatorCurrent.setExclusiveMin(False)
validatorDefinitionA = DoubleValidator(self.lineEditPlaneDefinitionA)
validatorDefinitionB = DoubleValidator(self.lineEditPlaneDefinitionB)
validatorDefinitionC = DoubleValidator(self.lineEditPlaneDefinitionC)
validatorDefinitionD = DoubleValidator(self.lineEditPlaneDefinitionD)
validatorEpsilon = DoubleValidator(self.lineEditEpsilon)
self.lineEditSRROM.setValidator(validatorSRROM)
self.lineEditPower.setValidator(validatorPower)
self.lineEditCurrent.setValidator(validatorCurrent)
self.lineEditPlaneDefinitionA.setValidator(validatorDefinitionA)
self.lineEditPlaneDefinitionB.setValidator(validatorDefinitionB)
self.lineEditPlaneDefinitionC.setValidator(validatorDefinitionC)
self.lineEditPlaneDefinitionD.setValidator(validatorDefinitionD)
self.lineEditEpsilon.setValidator(validatorEpsilon)
# Initialize widget
self.__initializeWidget()
self.case.undoStartGlobal()
@pyqtSignature("")
def __initializeWidget(self):
"""
Initialize widget
"""
name = self.model.getPropertiesDataFileName()
if name != None:
self.labelPropertiesFile.setText(str(name))
setGreenColor(self.pushButtonPropertiesData, False)
else:
setGreenColor(self.pushButtonPropertiesData, True)
srrom = self.model.getSRROM()
self.lineEditSRROM.setText(str(srrom))
self.groupBoxRecalage.hide()
if self.model.getScaling() == 'on':
self.checkBoxScaling.setChecked(True)
self.labelScalingModel.show()
self.comboBoxScalingModel.show()
#.........这里部分代码省略.........
示例3: LagrangianView
# 需要导入模块: from code_saturne.Base.QtPage import ComboModel [as 别名]
# 或者: from code_saturne.Base.QtPage.ComboModel import disableItem [as 别名]
class LagrangianView(QWidget, Ui_LagrangianForm):
"""
"""
def __init__(self, parent, case):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_LagrangianForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
self.model = LagrangianModel(self.case)
# Combo model
self.modelIILAGR = ComboModel(self.comboBoxIILAGR,3,1)
self.modelIILAGR.addItem(self.tr("One-way coupling"), "one_way")
self.modelIILAGR.addItem(self.tr("Two-way coupling"), "two_way")
self.modelIILAGR.addItem(self.tr("Frozen carrier flow"), "frozen")
self.modelIPHYLA = ComboModel(self.comboBoxIPHYLA,2,1)
self.modelIPHYLA.addItem(self.tr("No model"), 'off')
self.modelIPHYLA.addItem(self.tr("Heat transfer and evaporation"), 'thermal')
self.modelIPHYLA.addItem(self.tr("Pulverised coal model"), 'coal')
# Connections
self.connect(self.comboBoxIILAGR, SIGNAL("activated(const QString&)"), self.slotIILAGR)
self.connect(self.checkBoxISUILA, SIGNAL("clicked()"), self.slotISUILA)
self.connect(self.checkBoxISTTIO, SIGNAL("clicked()"), self.slotISTTIO)
self.connect(self.checkBoxINJCON, SIGNAL("clicked()"), self.slotINJCON)
self.connect(self.checkBoxIDEPST, SIGNAL("clicked()"), self.slotIDEPST)
self.connect(self.comboBoxIPHYLA, SIGNAL("activated(const QString&)"), self.slotIPHYLA)
self.connect(self.checkBoxITPVAR, SIGNAL("clicked()"), self.slotITPVAR)
self.connect(self.checkBoxIMPVAR, SIGNAL("clicked()"), self.slotIMPVAR)
self.connect(self.checkBoxIENCRA, SIGNAL("clicked()"), self.slotIENCRA)
#
self.connect(self.lineEditNSTITS, SIGNAL("textChanged(const QString &)"), self.slotNSTITS)
self.connect(self.checkBoxLTSDYN, SIGNAL("clicked()"), self.slotLTSDYN)
self.connect(self.checkBoxLTSMAS, SIGNAL("clicked()"), self.slotLTSMAS)
self.connect(self.checkBoxLTSTHE, SIGNAL("clicked()"), self.slotLTSTHE)
self.connect(self.toolButtonAdvanced, SIGNAL("clicked()"), self.slotAdvancedOptions)
# Validators
validatorNSTITS = IntValidator(self.lineEditNSTITS)
self.lineEditNSTITS.setValidator(validatorNSTITS)
# initialize Widgets
# # Update the lagrangian list with the calculation features
#
# for mdl in self.model.lagrangianCouplingMode():
# if mdl not in self.model.lagrangianStatus():
# self.modelIILAGR.disableItem(str_model=mdl)
from code_saturne.Pages.CoalCombustionModel import CoalCombustionModel
if CoalCombustionModel(self.case).getCoalCombustionModel() != 'off':
self.modelIILAGR.disableItem(str_model="one_way")
self.modelIILAGR.disableItem(str_model="two_way")
del CoalCombustionModel
model = self.model.getCouplingMode()
self.modelIILAGR.setItem(str_model=model)
self.slotIILAGR(self.modelIILAGR.dicoM2V[model])
status = self.model.getRestart()
if status == "on":
self.checkBoxISUILA.setChecked(True)
else:
self.checkBoxISUILA.setChecked(False)
status = self.model.getCarrierFlowStationary()
if status == "on":
self.checkBoxISTTIO.setChecked(True)
else:
self.checkBoxISTTIO.setChecked(False)
status = self.model.getContinuousInjection()
if status == "on":
self.checkBoxINJCON.setChecked(True)
else:
self.checkBoxINJCON.setChecked(False)
status = self.model.getDepositionSubmodel()
if status == "on":
self.checkBoxIDEPST.setChecked(True)
else:
self.checkBoxIDEPST.setChecked(False)
if ( model == "frozen" ):
self.labelISTTIO.setDisabled(True)
self.checkBoxISTTIO.setChecked(True)
self.checkBoxISTTIO.setDisabled(True)
status = self.model.getContinuousInjection()
if status == "on":
self.checkBoxINJCON.setChecked(True)
else:
#.........这里部分代码省略.........
示例4: NumericalParamGlobalView
# 需要导入模块: from code_saturne.Base.QtPage import ComboModel [as 别名]
# 或者: from code_saturne.Base.QtPage.ComboModel import disableItem [as 别名]
class NumericalParamGlobalView(QWidget, Ui_NumericalParamGlobalForm):
"""
"""
def __init__(self, parent, case, tree):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_NumericalParamGlobalForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
self.model = NumericalParamGlobalModel(self.case)
self.browser = tree
self.labelSRROM.hide()
self.lineEditSRROM.hide()
self.line_5.hide()
# Combo models
self.modelEXTRAG = ComboModel(self.comboBoxEXTRAG,2,1)
self.modelIMRGRA = ComboModel(self.comboBoxIMRGRA,5,1)
self.modelNTERUP = ComboModel(self.comboBoxNTERUP,3,1)
self.modelEXTRAG.addItem(self.tr("Neumann 1st order"), 'neumann')
self.modelEXTRAG.addItem(self.tr("Extrapolation"), 'extrapolation')
self.modelIMRGRA.addItem(self.tr("Iterative handling of non-orthogonalities"),'0')
self.modelIMRGRA.addItem(self.tr("Least squares method over neighboring cells"),'1')
self.modelIMRGRA.addItem(self.tr("Least squares method over extended cell neighborhood"),'2')
self.modelIMRGRA.addItem(self.tr("Least squares method over partial extended cell neighborhood"),'3')
self.modelIMRGRA.addItem(self.tr("Iterative method with least squares initialization"),'4')
self.modelNTERUP.addItem(self.tr("SIMPLE"), 'simple')
self.modelNTERUP.addItem(self.tr("SIMPLEC"),'simplec')
self.modelNTERUP.addItem(self.tr("PISO"),'piso')
self.comboBoxEXTRAG.setSizeAdjustPolicy(QComboBox.AdjustToContents)
self.comboBoxNTERUP.setSizeAdjustPolicy(QComboBox.AdjustToContents)
# Connections
self.connect(self.checkBoxIVISSE, SIGNAL("clicked()"), self.slotIVISSE)
self.connect(self.checkBoxIPUCOU, SIGNAL("clicked()"), self.slotIPUCOU)
self.connect(self.checkBoxICFGRP, SIGNAL("clicked()"), self.slotICFGRP)
self.connect(self.checkBoxImprovedPressure, SIGNAL("clicked()"), self.slotImprovedPressure)
self.connect(self.comboBoxEXTRAG, SIGNAL("activated(const QString&)"), self.slotEXTRAG)
self.connect(self.lineEditRELAXP, SIGNAL("textChanged(const QString &)"), self.slotRELAXP)
self.connect(self.comboBoxIMRGRA, SIGNAL("activated(const QString&)"), self.slotIMRGRA)
self.connect(self.lineEditSRROM, SIGNAL("textChanged(const QString &)"), self.slotSRROM)
self.connect(self.comboBoxNTERUP, SIGNAL("activated(const QString&)"), self.slotNTERUP)
self.connect(self.spinBoxNTERUP, SIGNAL("valueChanged(int)"), self.slotNTERUP2)
# Validators
validatorRELAXP = DoubleValidator(self.lineEditRELAXP, min=0., max=1.)
validatorRELAXP.setExclusiveMin(True)
validatorSRROM = DoubleValidator(self.lineEditSRROM, min=0., max=1.)
validatorSRROM.setExclusiveMin(True)
self.lineEditRELAXP.setValidator(validatorRELAXP)
self.lineEditSRROM.setValidator(validatorSRROM)
if self.model.getTransposedGradient() == 'on':
self.checkBoxIVISSE.setChecked(True)
else:
self.checkBoxIVISSE.setChecked(False)
if self.model.getVelocityPressureCoupling() == 'on':
self.checkBoxIPUCOU.setChecked(True)
else:
self.checkBoxIPUCOU.setChecked(False)
import code_saturne.Pages.FluidCharacteristicsModel as FluidCharacteristics
fluid = FluidCharacteristics.FluidCharacteristicsModel(self.case)
modl_atmo, modl_joul, modl_thermo, modl_gas, modl_coal, modl_comp = fluid.getThermoPhysicalModel()
if self.model.getHydrostaticPressure() == 'on':
self.checkBoxImprovedPressure.setChecked(True)
else:
self.checkBoxImprovedPressure.setChecked(False)
self.lineEditRELAXP.setText(str(self.model.getPressureRelaxation()))
self.modelEXTRAG.setItem(str_model=self.model.getWallPressureExtrapolation())
self.modelIMRGRA.setItem(str_model=str(self.model.getGradientReconstruction()))
if modl_joul != 'off' or modl_gas != 'off' or modl_coal != 'off':
self.labelSRROM.show()
self.lineEditSRROM.show()
self.lineEditSRROM.setText(str(self.model.getDensityRelaxation()))
self.line_5.show()
algo = self.model.getVelocityPressureAlgorithm()
status = SteadyManagementModel(self.case).getSteadyFlowManagement()
if status == 'on':
self.modelNTERUP.enableItem(str_model = 'simple')
self.modelNTERUP.disableItem(str_model = 'piso')
else:
self.modelNTERUP.disableItem(str_model = 'simple')
self.modelNTERUP.enableItem(str_model = 'piso')
#.........这里部分代码省略.........
示例5: BoundaryConditionsElectricalView
# 需要导入模块: from code_saturne.Base.QtPage import ComboModel [as 别名]
# 或者: from code_saturne.Base.QtPage.ComboModel import disableItem [as 别名]
class BoundaryConditionsElectricalView(QWidget, Ui_BoundaryConditionsElectricalForm):
"""
Boundary condifition for the velocity part
"""
def __init__(self, parent):
"""
Constructor.
"""
QWidget.__init__(self, parent)
Ui_BoundaryConditionsElectricalForm.__init__(self)
self.setupUi(self)
def setup(self, case):
"""
Setup the widget.
"""
self.__case = case
self.__boundary = None
self.__model = ElectricalModel(self.__case)
self.species_list = []
self.connect(self.lineEditValuePotElec, SIGNAL("textChanged(const QString &)"), self.slotPotElec)
self.connect(self.lineEditValuePotElecIm, SIGNAL("textChanged(const QString &)"), self.slotPotElecIm)
self.connect(self.lineEditValueSpecies, SIGNAL("textChanged(const QString &)"), self.slotSpecies)
self.connect(self.pushButtonPotVectorFormula, SIGNAL("clicked()"), self.slotPotVectorFormula)
self.connect(self.comboBoxTypePotElec, SIGNAL("activated(const QString&)"), self.slotPotElecChoice)
self.connect(self.comboBoxTypePotElecIm, SIGNAL("activated(const QString&)"), self.slotPotElecImChoice)
self.connect(self.comboBoxTypePotVector, SIGNAL("activated(const QString&)"), self.slotPotVectorChoice)
self.connect(self.comboBoxSpecies, SIGNAL("activated(const QString&)"), self.slotSpeciesChoice)
self.connect(self.comboBoxPotVector, SIGNAL("activated(const QString&)"), self.slotPotVectorComponentChoice)
## Validators
validatorPotElec = DoubleValidator(self.lineEditValuePotElec)
validatorPotElecIm = DoubleValidator(self.lineEditValuePotElecIm)
validatorSpecies = DoubleValidator(self.lineEditValueSpecies, min=0.)
self.lineEditValuePotElec.setValidator(validatorPotElec)
self.lineEditValuePotElecIm.setValidator(validatorPotElecIm)
self.lineEditValueSpecies.setValidator(validatorSpecies)
def __setBoundary(self, boundary):
"""
Set the current boundary
"""
self.__boundary = boundary
self.nature = boundary.getNature()
self.groupBoxPotElecIm.hide()
self.groupBoxPotVector.hide()
self.groupBoxMixture.hide()
self.modelPotElec = ComboModel(self.comboBoxTypePotElec, 1, 1)
self.modelPotElecIm = ComboModel(self.comboBoxTypePotElecIm, 1, 1)
self.modelPotVector = ComboModel(self.comboBoxTypePotVector, 1, 1)
self.modelPotElec.addItem(self.tr("Prescribed value"), 'dirichlet')
self.modelPotElec.addItem(self.tr("Prescribed value (user law)"), 'dirichlet_formula')
self.modelPotElec.addItem(self.tr("Prescribed flux"), 'neumann')
self.modelPotElec.addItem(self.tr("Prescribed flux (user law)"), 'neumann_formula')
if self.__model.getScaling() == 'on':
self.modelPotElec.addItem(self.tr("Implicit value (dpot)"), 'dirichlet_implicit')
#TODO
self.modelPotElec.disableItem(1)
self.modelPotElec.disableItem(3)
self.potElec = "elec_pot_r"
self.modelPotElecLabel = ComboModel(self.comboBoxPotElec,1,1)
self.modelPotElecLabel.addItem(self.tr(self.potElec),self.potElec)
self.modelPotElecLabel.setItem(str_model = self.potElec)
self.modelPotElecIm.addItem(self.tr("Prescribed value"), 'dirichlet')
self.modelPotElecIm.addItem(self.tr("Prescribed value (user law)"), 'dirichlet_formula')
self.modelPotElecIm.addItem(self.tr("Prescribed flux"), 'neumann')
self.modelPotElecIm.addItem(self.tr("Prescribed flux (user law)"), 'neumann_formula')
#TODO
self.modelPotElecIm.disableItem(1)
self.modelPotElecIm.disableItem(3)
self.potElecIm = 'elec_pot_i'
self.modelPotElecImLabel = ComboModel(self.comboBoxPotElecIm,1,1)
self.modelPotElecImLabel.addItem(self.tr(self.potElecIm),self.potElecIm)
self.modelPotElecImLabel.setItem(str_model = self.potElecIm)
self.modelPotVector.addItem(self.tr("Prescribed value (user law)"), 'dirichlet_formula')
self.modelPotVector.addItem(self.tr("Null flux"), 'neumann')
self.modelPotVector.addItem(self.tr("Implicit flux"), 'neumann_implicit')
self.modelPotVector.disableItem(0)
self.potVect = 'vec_potential_01'
self.modelPotVectLabel = ComboModel(self.comboBoxPotVector, 3, 1)
self.modelPotVectLabel.addItem(self.tr('vec_potential_01'), 'vec_potential_01')
self.modelPotVectLabel.addItem(self.tr('vec_potential_02'), 'vec_potential_02')
self.modelPotVectLabel.addItem(self.tr('vec_potential_03'), 'vec_potential_03')
self.modelPotVectLabel.setItem(str_model = self.potVect)
#.........这里部分代码省略.........
示例6: ThermalRadiationView
# 需要导入模块: from code_saturne.Base.QtPage import ComboModel [as 别名]
# 或者: from code_saturne.Base.QtPage.ComboModel import disableItem [as 别名]
class ThermalRadiationView(QWidget, Ui_ThermalRadiationForm):
"""
Class to open Thermal Scalar Transport Page.
"""
def __init__(self, parent, case, tree):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_ThermalRadiationForm.__init__(self)
self.setupUi(self)
self.browser = tree
self.case = case
self.case.undoStopGlobal()
self.mdl = ThermalRadiationModel(self.case)
# Combo models
self.modelRadModel = ComboModel(self.comboBoxRadModel, 3, 1)
self.modelDirection = ComboModel(self.comboBoxQuadrature, 8, 1)
self.modelAbsorption = ComboModel(self.comboBoxAbsorption, 3, 1)
self.modelRadModel.addItem("No radiative transfers", 'off')
self.modelRadModel.addItem("Discrete ordinates method", 'dom')
self.modelRadModel.addItem("P-1 Model", 'p-1')
self.modelDirection.addItem("24 directions (S4)", "1")
self.modelDirection.addItem("48 directions (S6)", "2")
self.modelDirection.addItem("80 directions (S8)", "3")
self.modelDirection.addItem("32 directions (T2)", "4")
self.modelDirection.addItem("128 directions (T4)", "5")
self.modelDirection.addItem("8n^2 directions (Tn)", "6")
self.modelDirection.addItem("120 directions (LC11)", "7")
self.modelDirection.addItem("48 directions (DCT020-2468)", "8")
# Connections
self.connect(self.comboBoxRadModel,
SIGNAL("activated(const QString&)"),
self.slotRadiativeTransfer)
self.connect(self.radioButtonOn,
SIGNAL("clicked()"),
self.slotStartRestart)
self.connect(self.radioButtonOff,
SIGNAL("clicked()"),
self.slotStartRestart)
self.connect(self.comboBoxQuadrature,
SIGNAL("activated(const QString&)"),
self.slotDirection)
self.connect(self.lineEditNdirec,
SIGNAL("textChanged(const QString &)"),
self.slotNdirec)
self.connect(self.comboBoxAbsorption,
SIGNAL("activated(const QString&)"),
self.slotTypeCoefficient)
self.connect(self.lineEditCoeff,
SIGNAL("textChanged(const QString &)"),
self.slotAbsorptionCoefficient)
self.connect(self.toolButtonAdvanced,
SIGNAL("clicked()"),
self.slotAdvancedOptions)
# Validator
validatorCoeff = DoubleValidator(self.lineEditCoeff, min=0.0)
self.lineEditCoeff.setValidator(validatorCoeff)
validatorNdir = IntValidator(self.lineEditNdirec, min=3)
self.lineEditNdirec.setValidator(validatorNdir)
self.modelAbsorption.addItem('constant', 'constant')
self.modelAbsorption.addItem('user subroutine (usray3)', 'variable')
self.modelAbsorption.addItem('user law', 'formula')
self.modelAbsorption.addItem('H2O and CO2 mixing (Modak)', 'modak')
from code_saturne.Pages.CoalCombustionModel import CoalCombustionModel
if CoalCombustionModel(self.case).getCoalCombustionModel() != "off":
self.modelAbsorption.disableItem(str_model='variable')
self.modelAbsorption.enableItem(str_model='modak')
else:
self.modelAbsorption.disableItem(str_model='modak')
self.modelAbsorption.enableItem(str_model='variable')
del CoalCombustionModel
self.modelAbsorption.disableItem(str_model='formula')
# Initialization
self.modelRadModel.setItem(str_model=self.mdl.getRadiativeModel())
self.slotRadiativeTransfer()
if self.mdl.getRestart() == 'on':
self.radioButtonOn.setChecked(True)
self.radioButtonOff.setChecked(False)
else:
self.radioButtonOn.setChecked(False)
self.radioButtonOff.setChecked(True)
#.........这里部分代码省略.........
示例7: ThermalScalarView
# 需要导入模块: from code_saturne.Base.QtPage import ComboModel [as 别名]
# 或者: from code_saturne.Base.QtPage.ComboModel import disableItem [as 别名]
class ThermalScalarView(QWidget, Ui_ThermalScalarForm):
"""
Class to open Thermal Scalar Transport Page.
"""
def __init__(self, parent, case, tree):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_ThermalScalarForm.__init__(self)
self.setupUi(self)
self.browser = tree
self.case = case
self.case.undoStopGlobal()
self.thermal = ThermalScalarModel(self.case)
# combo Model
self.modelThermal = ComboModel(self.comboBoxThermal, 4, 1)
self.modelThermal.addItem(self.tr("No thermal scalar"), 'off')
self.modelThermal.addItem(self.tr("Temperature (Celsius)"), 'temperature_celsius')
self.modelThermal.addItem(self.tr("Temperature (Kelvin)"), 'temperature_kelvin')
self.modelThermal.addItem(self.tr("Enthalpy (J/kg)"), 'enthalpy')
self.modelThermal.addItem(self.tr("Potential temperature"), 'potential_temperature')
self.modelThermal.addItem(self.tr("Liquid potential temperature"), 'liquid_potential_temperature')
self.modelThermal.addItem(self.tr("Total energy (J/kg)"), 'total_energy')
self.connect(self.comboBoxThermal, SIGNAL("activated(const QString&)"), self.slotThermalScalar)
# Update the thermal scalar list with the calculation features
for sca in self.thermal.thermalModel:
if sca not in self.thermal.thermalScalarModelsList():
self.modelThermal.disableItem(str_model=sca)
if ElectricalModel(self.case).getElectricalModel() != 'off':
self.comboBoxThermal.setEnabled(False)
if CoalCombustionModel(self.case).getCoalCombustionModel() != 'off':
self.comboBoxThermal.setEnabled(False)
if GasCombustionModel(self.case).getGasCombustionModel() != 'off':
self.comboBoxThermal.setEnabled(False)
if CompressibleModel(self.case).getCompressibleModel() != 'off':
self.comboBoxThermal.setEnabled(False)
else:
self.modelThermal.delItem(6)
if AtmosphericFlowsModel(self.case).getAtmosphericFlowsModel() != 'off':
self.comboBoxThermal.setEnabled(False)
else:
self.modelThermal.delItem(5)
self.modelThermal.delItem(4)
# Select the thermal scalar model
model = self.thermal.getThermalScalarModel()
self.modelThermal.setItem(str_model=model)
self.case.undoStartGlobal()
@pyqtSignature("const QString &")
def slotThermalScalar(self, text):
"""
Update the thermal scalar markup.
"""
th = self.modelThermal.dicoV2M[str(text)]
self.thermal.setThermalModel(th)
self.browser.configureTree(self.case)
def tr(self, text):
"""
Translation
"""
return text
示例8: TimeStepView
# 需要导入模块: from code_saturne.Base.QtPage import ComboModel [as 别名]
# 或者: from code_saturne.Base.QtPage.ComboModel import disableItem [as 别名]
class TimeStepView(QWidget, Ui_TimeStepForm):
"""
"""
def __init__(self, parent, case):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_TimeStepForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
self.mdl = TimeStepModel(self.case)
# Combo model
self.modelTimeOptions = ComboModel(self.comboBoxOptions,2,1)
self.modelTimeOptions.addItem(self.tr("Constant"), '0')
self.modelTimeOptions.addItem(self.tr("Variable"), '1')
# Connections
self.connect(self.comboBoxOptions, SIGNAL("activated(const QString&)"), self.slotTimePassing)
self.connect(self.lineEditDTREF, SIGNAL("textChanged(const QString &)"), self.slotTimeStep)
self.connect(self.lineEditNTMABS, SIGNAL("textChanged(const QString &)"), self.slotIter)
self.connect(self.lineEditCOUMAX, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionCOUMAX)
self.connect(self.lineEditFOUMAX, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionFOUMAX)
self.connect(self.lineEditCDTMIN, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionCDTMIN)
self.connect(self.lineEditCDTMAX, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionCDTMAX)
self.connect(self.lineEditVARRDT, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionVARRDT)
self.connect(self.checkBoxIPTLRO, SIGNAL("clicked()"), self.slotThermalTimeStep)
self.connect(self.checkBoxINPDT0, SIGNAL("clicked()"), self.slotZeroTimeStep)
# Validators
validatorDTREF = DoubleValidator(self.lineEditDTREF, min=0.0)
validatorDTREF.setExclusiveMin(True)
validatorNTMABS = IntValidator(self.lineEditNTMABS, min=1)
validatorCOUMAX = DoubleValidator(self.lineEditCOUMAX, min=0.0)
validatorCOUMAX.setExclusiveMin(True)
validatorFOUMAX = DoubleValidator(self.lineEditFOUMAX, min=0.0)
validatorFOUMAX.setExclusiveMin(True)
validatorCDTMIN = DoubleValidator(self.lineEditCDTMIN, min=0.0, max=1.0)
validatorCDTMIN.setExclusiveMin(True)
validatorCDTMAX = DoubleValidator(self.lineEditCDTMAX, min=1.0)
validatorVARRDT = DoubleValidator(self.lineEditVARRDT, min=0.0, max=1.0)
validatorVARRDT.setExclusiveMin(True)
self.lineEditDTREF.setValidator(validatorDTREF)
self.lineEditNTMABS.setValidator(validatorNTMABS)
self.lineEditCOUMAX.setValidator(validatorCOUMAX)
self.lineEditFOUMAX.setValidator(validatorFOUMAX)
self.lineEditCDTMIN.setValidator(validatorCDTMIN)
self.lineEditCDTMAX.setValidator(validatorCDTMAX)
self.lineEditVARRDT.setValidator(validatorVARRDT)
# Initialization
status = SteadyManagementModel(self.case).getSteadyFlowManagement()
if status == 'on':
self.comboBoxOptions.hide()
self.mdl.setTimePassing(2)
courant_max = self.mdl.getOptions('max_courant_num')
fourier_max = self.mdl.getOptions('max_fourier_num')
time_step_min_factor = self.mdl.getOptions('time_step_min_factor')
time_step_max_factor = self.mdl.getOptions('time_step_max_factor')
time_step_var = self.mdl.getOptions('time_step_var')
self.lineEditCOUMAX.setText(str(courant_max))
self.lineEditFOUMAX.setText(str(fourier_max))
self.lineEditCDTMIN.setText(str(time_step_min_factor))
self.lineEditCDTMAX.setText(str(time_step_max_factor))
self.lineEditVARRDT.setText(str(time_step_var))
self.groupBoxLabels.show()
else:
self.comboBoxOptions.show()
idtvar = self.mdl.getTimePassing()
self.modelTimeOptions.setItem(str_model=str(idtvar))
from code_saturne.Pages.TurbulenceModel import TurbulenceModel
model = TurbulenceModel(self.case).getTurbulenceModel()
del TurbulenceModel
if model in ('LES_Smagorinsky', 'LES_dynamique', 'LES_WALE'):
idtvar = 0
self.modelTimeOptions.setItem(str_model=str(idtvar))
self.modelTimeOptions.disableItem(str_model='0')
self.modelTimeOptions.disableItem(str_model='1')
text = self.comboBoxOptions.currentText()
self.slotTimePassing(text)
dtref = self.mdl.getTimeStep()
self.lineEditDTREF.setText(str(dtref))
#.........这里部分代码省略.........
示例9: TurbulenceView
# 需要导入模块: from code_saturne.Base.QtPage import ComboModel [as 别名]
# 或者: from code_saturne.Base.QtPage.ComboModel import disableItem [as 别名]
class TurbulenceView(QWidget, Ui_TurbulenceForm):
"""
Class to open Turbulence Page.
"""
def __init__(self, parent=None, case=None):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_TurbulenceForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
self.model = TurbulenceModel(self.case)
# Combo model
self.modelTurbModel = ComboModel(self.comboBoxTurbModel,10,1)
self.modelTurbModel.addItem(self.tr("No model (i.e. laminar flow)"), "off")
self.modelTurbModel.addItem(self.tr("Mixing length"), "mixing_length")
self.modelTurbModel.addItem(self.tr("k-epsilon"), "k-epsilon")
self.modelTurbModel.addItem(self.tr("k-epsilon Linear Production"), "k-epsilon-PL")
self.modelTurbModel.addItem(self.tr("Rij-epsilon LRR"), "Rij-epsilon")
self.modelTurbModel.addItem(self.tr("Rij-epsilon SSG"), "Rij-SSG")
self.modelTurbModel.addItem(self.tr("Rij-epsilon EBRSM"), "Rij-EBRSM")
self.modelTurbModel.addItem(self.tr("v2f BL-v2/k"), "v2f-BL-v2/k")
self.modelTurbModel.addItem(self.tr("k-omega SST"), "k-omega-SST")
self.modelTurbModel.addItem(self.tr("Spalart-Allmaras"), "Spalart-Allmaras")
self.modelTurbModel.addItem(self.tr("LES (Smagorinsky)"), "LES_Smagorinsky")
self.modelTurbModel.addItem(self.tr("LES (classical dynamic model)"), "LES_dynamique")
self.modelTurbModel.addItem(self.tr("LES (WALE)"), "LES_WALE")
# Connections
self.connect(self.comboBoxTurbModel, SIGNAL("activated(const QString&)"), self.slotTurbulenceModel)
self.connect(self.pushButtonAdvanced, SIGNAL("clicked()"), self.slotAdvancedOptions)
self.connect(self.lineEditLength, SIGNAL("textChanged(const QString &)"), self.slotLengthScale)
# Frames display
self.frameAdvanced.hide()
self.frameLength.hide()
# Validator
validator = DoubleValidator(self.lineEditLength, min=0.0)
validator.setExclusiveMin(True)
self.lineEditLength.setValidator(validator)
# Update the turbulence models list with the calculation features
for turb in self.model.turbulenceModels():
if turb not in self.model.turbulenceModelsList():
self.modelTurbModel.disableItem(str_model=turb)
# Select the turbulence model
model = self.model.getTurbulenceModel()
self.modelTurbModel.setItem(str_model=model)
self.slotTurbulenceModel(self.comboBoxTurbModel.currentText())
# Length scale
l_scale = self.model.getLengthScale()
self.lineEditLength.setText(str(l_scale))
self.case.undoStartGlobal()
@pyqtSignature("const QString&")
def slotLengthScale(self, text):
"""
Private slot.
Input XLOMLG.
"""
if self.sender().validator().state == QValidator.Acceptable:
l_scale = from_qvariant(text, float)
self.model.setLengthScale(l_scale)
@pyqtSignature("const QString&")
def slotTurbulenceModel(self, text):
"""
Private slot.
Input ITURB.
"""
model = self.modelTurbModel.dicoV2M[str(text)]
self.model.setTurbulenceModel(model)
self.frameAdvanced.hide()
self.frameLength.hide()
if model == 'mixing_length':
self.frameLength.show()
self.frameAdvanced.hide()
self.model.getLengthScale()
#.........这里部分代码省略.........