本文整理汇总了Python中code_saturne.Base.QtPage.ComboModel类的典型用法代码示例。如果您正苦于以下问题:Python ComboModel类的具体用法?Python ComboModel怎么用?Python ComboModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ComboModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent, case, default):
"""
Constructor
"""
QDialog.__init__(self, parent)
Ui_ThermalRadiationAdvancedDialogForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
self.setWindowTitle(self.tr("Advanced options"))
self.default = default
self.result = self.default.copy()
# Combo models
self.modelTSRay = ComboModel(self.comboBoxTSRay, 3, 1)
self.modelPrintT = ComboModel(self.comboBoxPrintT, 3, 1)
self.modelPrintL = ComboModel(self.comboBoxPrintL, 3, 1)
self.modelTSRay.addItem('0', '0')
self.modelTSRay.addItem('1', '1')
self.modelTSRay.addItem('2', '2')
self.modelPrintT.addItem('0', '0')
self.modelPrintT.addItem('1', '1')
self.modelPrintT.addItem('2', '2')
self.modelPrintL.addItem('0', '0')
self.modelPrintL.addItem('1', '1')
self.modelPrintL.addItem('2', '2')
self.frequ = self.default['frequency']
self.tsr = self.default['idiver']
self.printTemp = self.default['tempP']
self.printLum = self.default['intensity']
model = self.default['model']
# Initialization
self.lineEditFreq.setText(str(self.frequ))
self.modelTSRay.setItem(str_model=str(self.tsr))
self.modelPrintT.setItem(str_model=str(self.printTemp))
self.modelPrintL.setItem(str_model=str(self.printLum))
if model == 'dom':
self.labelPrintL.show()
self.comboBoxPrintL.show()
else:
self.labelPrintL.hide()
self.comboBoxPrintL.hide()
# Validator
validatorFreq = IntValidator(self.lineEditFreq, min=1)
self.lineEditFreq.setValidator(validatorFreq)
self.case.undoStartGlobal()
示例2: __init__
def __init__(self, parent, case, default):
"""
Constructor
"""
QDialog.__init__(self, parent)
Ui_TurbulenceAdvancedOptionsDialogForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
if default['model'] in ('k-epsilon', 'k-epsilon-PL'):
title = self.tr("Options for k-epsilon model")
elif default['model'] in ('Rij-epsilon', 'Rij-SSG', 'Rij-EBRSM'):
title = self.tr("Options for Rij-epsilon model")
elif default['model'] == 'k-omega-SST':
title = self.tr("Options for k-omega-SST model")
elif default['model'] == 'v2f-BL-v2/k':
title = self.tr("Options for v2f-BL-v2/k model")
elif default['model'] == 'Spalart-Allmaras':
title = self.tr("Options for Spalart-Allmaras model")
self.setWindowTitle(title)
self.default = default
self.result = self.default.copy()
self.checkBoxGravity.setEnabled(True)
self.comboBoxScales.setEnabled(True)
if default['model'] == 'v2f-BL-v2/k' or \
default['model'] == 'Rij-EBRSM':
self.modelScales = ComboModel(self.comboBoxScales, 1, 1)
self.modelScales.addItem(self.tr("One scale model"), '0')
self.comboBoxScales.setEnabled(False)
elif default['model'] == 'Spalart-Allmaras':
self.modelScales = ComboModel(self.comboBoxScales, 1, 1)
self.modelScales.addItem(self.tr("One scale model"), '0')
self.comboBoxScales.setEnabled(False)
else:
# Combo
self.modelScales = ComboModel(self.comboBoxScales, 3, 1)
self.modelScales.addItem(self.tr("One scale model"), '0')
self.modelScales.addItem(self.tr("Two scale model"), '1')
self.modelScales.addItem(self.tr("Scalable wall function"), '2')
# Initialization of wall function model
self.modelScales.setItem(str_model=str(self.result['scale_model']))
# Initialization of gravity terms
if self.result['gravity_terms'] == 'on':
self.checkBoxGravity.setChecked(True)
else:
self.checkBoxGravity.setChecked(False)
self.case.undoStartGlobal()
示例3: setup
def setup(self, case):
"""
Setup the widget
"""
self.__case = case
self.__boundary = None
self.__case.undoStopGlobal()
self.__model = MobileMeshModel(self.__case)
self.__comboModel = ComboModel(self.comboMobilBoundary, 6, 1)
self.__comboModel.addItem(self.tr("Fixed boundary"), "fixed_boundary")
self.__comboModel.addItem(self.tr("Sliding boundary"), "sliding_boundary")
self.__comboModel.addItem(self.tr("Internal coupling"), "internal_coupling")
self.__comboModel.addItem(self.tr("External coupling"), "external_coupling")
self.__comboModel.addItem(self.tr("Fixed velocity"), "fixed_velocity")
self.__comboModel.addItem(self.tr("Fixed displacement"), "fixed_displacement")
self.connect(self.comboMobilBoundary,
SIGNAL("activated(const QString&)"),
self.__slotCombo)
self.connect(self.pushButtonMobilBoundary,
SIGNAL("clicked(bool)"),
self.__slotFormula)
self.__case.undoStartGlobal()
示例4: setup
def setup(self, case):
"""
Setup the widget
"""
self.__case = case
self.__boundary = None
self.__case.undoStopGlobal()
self.mdl = CompressibleModel(self.__case)
# Connections
self.connect(self.comboBoxTypeOutlet, SIGNAL("activated(const QString&)"), self.slotOutletType)
self.connect(self.lineEditPressure, SIGNAL("textChanged(const QString &)"), self.slotPressureValue)
# Combo models
self.modelTypeOutlet = ComboModel(self.comboBoxTypeOutlet, 2, 1)
self.modelTypeOutlet.addItem(self.tr("supersonic outlet"), 'supersonic_outlet')
self.modelTypeOutlet.addItem(self.tr("subsonic outlet"), 'subsonic_outlet')
# Validators
validatorP = DoubleValidator(self.lineEditPressure, min = 0.0)
# Apply validators
self.lineEditPressure.setValidator(validatorP)
self.__case.undoStartGlobal()
示例5: setup
def setup(self, case):
"""
Setup the widget
"""
self.__case = case
self.__boundary = None
self.__case.undoStopGlobal()
self.connect(self.comboBoxTurbulence, SIGNAL("activated(const QString&)"), self.__slotChoiceTurbulence)
self.__modelTurbulence = ComboModel(self.comboBoxTurbulence, 2, 1)
self.__modelTurbulence.addItem(self.tr("Calculation by hydraulic diameter"), 'hydraulic_diameter')
self.__modelTurbulence.addItem(self.tr("Calculation by turbulent intensity"), 'turbulent_intensity')
self.__modelTurbulence.addItem(self.tr("Calculation by formula"), 'formula')
self.connect(self.lineEditDiameter, SIGNAL("textChanged(const QString &)"), self.__slotDiam)
self.connect(self.lineEditIntensity, SIGNAL("textChanged(const QString &)"), self.__slotIntensity)
self.connect(self.lineEditDiameterIntens, SIGNAL("textChanged(const QString &)"), self.__slotDiam)
self.connect(self.pushButtonTurb, SIGNAL("clicked()"), self.__slotTurbulenceFormula)
validatorDiam = DoubleValidator(self.lineEditDiameter, min=0.)
validatorDiam.setExclusiveMin(True)
validatorIntensity = DoubleValidator(self.lineEditIntensity, min=0.)
self.lineEditDiameter.setValidator(validatorDiam)
self.lineEditDiameterIntens.setValidator(validatorDiam)
self.lineEditIntensity.setValidator(validatorIntensity)
self.__case.undoStartGlobal()
示例6: setup
def setup(self, case):
"""
Setup the widget
"""
self.__case = case
self.__boundary = None
self.__case.undoStopGlobal()
# Create the Page layout.
# Combo
self.modelRadiative = ComboModel(self.comboBoxRadiative,3,1)
self.modelRadiative.addItem(self.tr("Gray or black wall\n"\
" and profile of fixed internal temperature"), 'itpimp')
self.modelRadiative.addItem(self.tr("Gray or black wall\n"\
" and profile of fixed external temperature"), 'ipgrno')
self.modelRadiative.addItem(self.tr("Gray or black wall\n"\
" and flux of fixed conduction"), 'ifgrno')
# Validator
validatorZone = IntValidator(self.lineEditZone, min=0)
validatorZone.setExclusiveMin(True)
self.lineEditZone.setValidator(validatorZone)
# Connections
self.connect(self.comboBoxRadiative,
SIGNAL("activated(const QString&)"),
self.slotRadiativeChoice)
self.connect(self.lineEditZone,
SIGNAL("textChanged(const QString &)"),
self.slotZone)
self.__case.undoStartGlobal()
示例7: __init__
def __init__(self, parent, case):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_DarcyForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
self.mdl = DarcyModel(self.case)
# ComboBox
self.modelPermeability = ComboModel(self.comboBoxPermeability,2,1)
self.modelDiffusion = ComboModel(self.comboBoxDiffusion,2,1)
self.modelFlowType = ComboModel(self.comboBoxFlowType,2,1)
self.modelCriterion = ComboModel(self.comboBoxCriterion,2,1)
self.lineEditGx.setValidator(DoubleValidator(self.lineEditGx))
self.lineEditGy.setValidator(DoubleValidator(self.lineEditGy))
self.lineEditGz.setValidator(DoubleValidator(self.lineEditGz))
self.modelPermeability.addItem(self.tr("isotropic"), 'isotropic')
self.modelPermeability.addItem(self.tr("anisotropic"), 'anisotropic')
self.modelDiffusion.addItem(self.tr("isotropic"), 'isotropic')
self.modelDiffusion.addItem(self.tr("anisotropic"), 'anisotropic')
self.modelFlowType.addItem(self.tr("steady"), 'steady')
self.modelFlowType.addItem(self.tr("unsteady"), 'unsteady')
self.modelCriterion.addItem(self.tr("over pressure"), 'pressure')
self.modelCriterion.addItem(self.tr("over velocity"), 'velocity')
# Connections
self.connect(self.comboBoxPermeability, SIGNAL("activated(const QString&)"), self.slotPermeabilityType)
self.connect(self.comboBoxDiffusion, SIGNAL("activated(const QString&)"), self.slotDiffusionType)
self.connect(self.comboBoxFlowType, SIGNAL("activated(const QString&)"), self.slotFlowType)
self.connect(self.comboBoxCriterion, SIGNAL("activated(const QString&)"), self.slotCriterion)
self.connect(self.checkBoxGravity, SIGNAL("clicked()"), self.slotGravity)
self.connect(self.lineEditGx, SIGNAL("textChanged(const QString &)"), self.slotGravityX)
self.connect(self.lineEditGy, SIGNAL("textChanged(const QString &)"), self.slotGravityY)
self.connect(self.lineEditGz, SIGNAL("textChanged(const QString &)"), self.slotGravityZ)
self.initializeWidget()
self.case.undoStartGlobal()
示例8: createEditor
def createEditor(self, parent, option, index):
editor = QComboBox(parent)
self.combo_mdl = ComboModel(editor,1,1)
nature = index.model()._data[index.row()][1]
self.dico = index.model().dicoM2V[nature]
for k, v in list(self.dico.items()):
self.combo_mdl.addItem(v, k)
editor.installEventFilter(self)
editor.setMinimumWidth(100)
return editor
示例9: ParticleBoundaryInteractionDelegate
class ParticleBoundaryInteractionDelegate(QItemDelegate):
"""
Use of a combo box in the table.
"""
def __init__(self, parent):
super(ParticleBoundaryInteractionDelegate, self).__init__(parent)
self.parent = parent
def createEditor(self, parent, option, index):
editor = QComboBox(parent)
self.combo_mdl = ComboModel(editor,1,1)
nature = index.model()._data[index.row()][1]
self.dico = index.model().dicoM2V[nature]
for k, v in list(self.dico.items()):
self.combo_mdl.addItem(v, k)
editor.installEventFilter(self)
editor.setMinimumWidth(100)
return editor
def setEditorData(self, comboBox, index):
row = index.row()
col = index.column()
str_model = index.model()._data[row][col]
self.combo_mdl.setItem(str_model=str_model)
def setModelData(self, comboBox, model, index):
txt = str(comboBox.currentText())
value = self.combo_mdl.dicoV2M[txt]
selectionModel = self.parent.selectionModel()
for idx in selectionModel.selectedIndexes():
if idx.column() == index.column():
model.setData(idx, to_qvariant(value), Qt.DisplayRole)
def tr(self, text):
return text
示例10: VarianceDelegate
class VarianceDelegate(QItemDelegate):
"""
Use of a combo box in the table.
"""
def __init__(self, parent):
super(VarianceDelegate, self).__init__(parent)
self.parent = parent
def createEditor(self, parent, option, index):
editor = QComboBox(parent)
self.modelCombo = ComboModel(editor, 1, 1)
editor.installEventFilter(self)
return editor
def setEditorData(self, editor, index):
l1 = index.model().mdl.getScalarNameList()
for label in index.model().mdl.getThermalScalarName():
l1.append(label)
for s in index.model().mdl.getScalarsVarianceList():
if s in l1: l1.remove(s)
for s in l1:
self.modelCombo.addItem(s, s)
def setModelData(self, comboBox, model, index):
txt = str(comboBox.currentText())
value = self.modelCombo.dicoV2M[txt]
model.setData(index, to_qvariant(value), Qt.DisplayRole)
def tr(self, text):
"""
Translation
"""
return text
示例11: __init__
def __init__(self, parent, case):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_GasCombustionForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
self.mdl = GasCombustionModel(self.case)
# Set models and number of elements for combo boxes
self.modelGasCombustionOption = ComboModel(self.comboBoxGasCombustionOption,1,1)
# Connections
self.connect(self.comboBoxGasCombustionOption, SIGNAL("activated(const QString&)"), self.slotGasCombustionOption)
self.connect(self.pushButtonThermochemistryData, SIGNAL("pressed()"), self.__slotSearchThermochemistryData)
# Initialize Widgets
model = self.mdl.getGasCombustionModel()
if model == 'd3p':
self.modelGasCombustionOption.addItem(self.tr("adiabatic model"), "adiabatic")
self.modelGasCombustionOption.addItem(self.tr("non adiabatic model"), "extended")
elif model == 'ebu':
self.modelGasCombustionOption.addItem(self.tr("reference Spalding model"), "spalding")
self.modelGasCombustionOption.addItem(self.tr("extended model with enthalpy source term"), "enthalpy_st")
self.modelGasCombustionOption.addItem(self.tr("extended model with mixture fraction transport"), "mixture_st")
self.modelGasCombustionOption.addItem(self.tr("extended model with enthalpy and mixture fraction transport"), "enthalpy_mixture_st")
elif model == 'lwp':
self.modelGasCombustionOption.addItem(self.tr("reference two-peak model with adiabatic condition"), "2-peak_adiabatic")
self.modelGasCombustionOption.addItem(self.tr("reference two-peak model with enthalpy source term"), "2-peak_enthalpy")
self.modelGasCombustionOption.addItem(self.tr("reference three-peak model with adiabatic condition"), "3-peak_adiabatic")
self.modelGasCombustionOption.addItem(self.tr("reference three-peak model with enthalpy source term"), "3-peak_enthalpy")
self.modelGasCombustionOption.addItem(self.tr("reference four-peak model with adiabatic condition"), "4-peak_adiabatic")
self.modelGasCombustionOption.addItem(self.tr("reference four-peak model with enthalpy source term"), "4-peak_enthalpy")
option = self.mdl.getGasCombustionOption()
self.modelGasCombustionOption.setItem(str_model= option)
name = self.mdl.getThermoChemistryDataFileName()
if name != None:
self.labelThermochemistryFile.setText(str(name))
setGreenColor(self.pushButtonThermochemistryData, False)
else:
setGreenColor(self.pushButtonThermochemistryData, True)
self.case.undoStartGlobal()
示例12: __init__
def __init__(self, parent):
"""
Constructor
"""
QDialog.__init__(self, parent)
Ui_BatchRunningAdvancedOptionsDialogForm.__init__(self)
self.setupUi(self)
self.setWindowTitle(self.tr("Advanced options"))
self.parent = parent
# Combo models
self.modelCSOUT1 = ComboModel(self.comboBox_6, 2, 1)
self.modelCSOUT2 = ComboModel(self.comboBox_7, 3, 1)
# Combo items
self.modelCSOUT1.addItem(self.tr("to standard output"), 'stdout')
self.modelCSOUT1.addItem(self.tr("to listing"), 'listing')
self.modelCSOUT2.addItem(self.tr("no output"), 'null')
self.modelCSOUT2.addItem(self.tr("to standard output"), 'stdout')
self.modelCSOUT2.addItem(self.tr("to listing_n<p>"), 'listing')
# Connections
self.connect(self.toolButton_2, SIGNAL("clicked()"), self.slotSearchFile)
self.connect(self.lineEdit_3, SIGNAL("textChanged(const QString &)"), self.slotValgrind)
self.connect(self.comboBox_6, SIGNAL("activated(const QString&)"), self.slotLogType)
self.connect(self.comboBox_7, SIGNAL("activated(const QString&)"), self.slotLogType)
# Previous values
self.valgrind = self.parent.mdl.getString('valgrind')
if self.valgrind is not None:
self.lineEdit_3.setText(str(self.valgrind))
self.setLogType()
示例13: __init__
def __init__(self, parent, case):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_PorosityForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
self.mdl = PorosityModel(self.case)
# Create the Page layout.
# Model and QTreeView for Head Losses
self.modelPorosity = StandardItemModelPorosity()
self.treeView.setModel(self.modelPorosity)
# Combo model
self.modelPorosityType = ComboModel(self.comboBoxType, 2, 1)
self.modelPorosityType.addItem(self.tr("isotropic"), 'isotropic')
self.modelPorosityType.addItem(self.tr("anisotropic"), 'anisotropic')
# Connections
self.connect(self.treeView, SIGNAL("clicked(const QModelIndex &)"), self.slotSelectPorosityZones)
self.connect(self.comboBoxType, SIGNAL("activated(const QString&)"), self.slotPorosity)
self.connect(self.pushButtonPorosity, SIGNAL("clicked()"), self.slotFormulaPorosity)
# Initialize Widgets
self.entriesNumber = -1
d = self.mdl.getNameAndLocalizationZone()
liste=[]
liste=list(d.items())
t=[]
for t in liste :
NamLoc=t[1]
Lab=t[0 ]
self.modelPorosity.insertItem(Lab, NamLoc[0],NamLoc[1])
self.forgetStandardWindows()
self.case.undoStartGlobal()
示例14: __init__
def __init__(self, parent, case, browser):
"""
Constructor
"""
QWidget.__init__(self, parent)
Ui_MobileMeshForm.__init__(self)
self.setupUi(self)
self.case = case
self.case.undoStopGlobal()
self.mdl = MobileMeshModel(self.case)
self.browser = browser
# Combo model VISCOSITY
self.modelVISCOSITY = ComboModel(self.comboBoxVISCOSITY,2,1)
self.modelVISCOSITY.addItem(self.tr("isotropic"), 'isotrop')
self.modelVISCOSITY.addItem(self.tr("orthotropic"), 'orthotrop')
# Connections
self.connect(self.groupBoxALE, SIGNAL("clicked(bool)"), self.slotMethod)
self.connect(self.lineEditNALINF, SIGNAL("textChanged(const QString &)"), self.slotNalinf)
self.connect(self.comboBoxVISCOSITY, SIGNAL("activated(const QString&)"), self.slotViscosityType)
self.connect(self.pushButtonFormula, SIGNAL("clicked(bool)"), self.slotFormula)
# Validators
validatorNALINF = IntValidator(self.lineEditNALINF, min=0)
self.lineEditNALINF.setValidator(validatorNALINF)
if self.mdl.getMethod() == 'on':
self.groupBoxALE.setChecked(True)
checked = True
else:
self.groupBoxALE.setChecked(False)
checked = False
self.slotMethod(checked)
# Enable / disable formula state
setGreenColor(self.pushButtonFormula, False)
self.case.undoStartGlobal()
示例15: GGDHDelegate
class GGDHDelegate(QItemDelegate):
"""
Use of a combo box in the table.
"""
def __init__(self, parent, case):
super(GGDHDelegate, self).__init__(parent)
self.parent = parent
self.case = case
def createEditor(self, parent, option, index):
editor = QComboBox(parent)
self.modelCombo = ComboModel(editor, 1, 1)
editor.installEventFilter(self)
return editor
def setEditorData(self, editor, index):
self.modelCombo.addItem(self.tr("SGDH"), "SGDH")
if TurbulenceModel(self.case).getTurbulenceModel() == "Rij-epsilon" or \
TurbulenceModel(self.case).getTurbulenceModel() == "Rij-SSG" or \
TurbulenceModel(self.case).getTurbulenceModel() == "Rij-EBRSM":
self.modelCombo.addItem(self.tr("GGDH"), "GGDH")
self.modelCombo.addItem(self.tr("AFM"), "AFM")
self.modelCombo.addItem(self.tr("DFM"), "DFM")
def setModelData(self, comboBox, model, index):
txt = str(comboBox.currentText())
value = self.modelCombo.dicoV2M[txt]
model.setData(index, to_qvariant(value), Qt.DisplayRole)
def tr(self, text):
"""
Translation
"""
return text