本文整理匯總了Python中code_saturne.Base.QtPage.ComboModel.delItem方法的典型用法代碼示例。如果您正苦於以下問題:Python ComboModel.delItem方法的具體用法?Python ComboModel.delItem怎麽用?Python ComboModel.delItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類code_saturne.Base.QtPage.ComboModel
的用法示例。
在下文中一共展示了ComboModel.delItem方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: FluidCharacteristicsView
# 需要導入模塊: from code_saturne.Base.QtPage import ComboModel [as 別名]
# 或者: from code_saturne.Base.QtPage.ComboModel import delItem [as 別名]
#.........這裏部分代碼省略.........
__combo.setEnabled(True)
c = self.mdl.getPropertyMode(tag)
if c == 'variable':
__button.setEnabled(True)
else:
__button.setEnabled(False)
self.groupBoxViscv0.show()
else:
if tag == 'specific_heat':
self.groupBoxCp.setTitle('Specific heat')
self.case.undoStartGlobal()
def updateTypeChoice(self):
"""
add/suppress thermo tables for each proprties
"""
for tag, symbol in self.lst:
__model = getattr(self, "model" + symbol)
if self.mdl.getMaterials() == "user_material":
__model.disableItem(str_model='thermal_law')
else:
__model.enableItem(str_model='thermal_law')
c = self.mdl.getPropertyMode(tag)
__model.setItem(str_model=c)
def updateMethod(self):
"""
update method list with material choice
"""
for nb in range(len(self.modelMethod.getItems())):
self.modelMethod.delItem(0)
self.comboBoxPhas.hide()
self.labelPhas.hide()
if self.mdl.getMaterials() == "user_material":
self.modelMethod.addItem(self.tr('user properties'), 'user_properties')
else :
if EOS == 1:
material = self.mdl.getMaterials()
self.ava.setMethods(material)
fls = self.ava.whichMethods()
for fli in fls:
self.modelMethod.addItem(self.tr(fli),fli)
if self.mdl.getMethod() != "freesteam":
self.comboBoxPhas.show()
self.labelPhas.show()
if self.freesteam == 1 and self.mdl.getMaterials() == "Water":
self.modelMethod.addItem(self.tr("freesteam"), "freesteam")
# update comboBoxMethod
method = self.mdl.getMethod()
self.modelMethod.setItem(str_model=method)
self.updateReference()
def updateReference(self):
"""
update Reference with material, method and field nature choice
"""
# update lineEditReference
self.lineEditReference.setText(self.mdl.getReference())
示例2: ThermalScalarView
# 需要導入模塊: from code_saturne.Base.QtPage import ComboModel [as 別名]
# 或者: from code_saturne.Base.QtPage.ComboModel import delItem [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