当前位置: 首页>>代码示例>>Python>>正文


Python ComboModel.delItem方法代码示例

本文整理汇总了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())
开发者ID:paulochon8616,项目名称:CS4.0-EDL,代码行数:70,代码来源:FluidCharacteristicsView.py

示例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
开发者ID:paulochon8616,项目名称:CS4.0-EDL,代码行数:85,代码来源:ThermalScalarView.py


注:本文中的code_saturne.Base.QtPage.ComboModel.delItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。