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


Python Entrada_con_unidades.clear方法代码示例

本文整理汇总了Python中UI.widgets.Entrada_con_unidades.clear方法的典型用法代码示例。如果您正苦于以下问题:Python Entrada_con_unidades.clear方法的具体用法?Python Entrada_con_unidades.clear怎么用?Python Entrada_con_unidades.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UI.widgets.Entrada_con_unidades的用法示例。


在下文中一共展示了Entrada_con_unidades.clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: UI_equipment

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import clear [as 别名]
class UI_equipment(parents.UI_equip):
    """Diálogo de definición de molinos trituradores de sólidos"""

    def __init__(self, entrada=None, parent=None):
        """entrada: Parametro opcional de clase corriente que indica la corriente de entrada en kla tubería"""
        super(UI_equipment, self).__init__(Grinder, entrada=False, salida=False, parent=parent)
        self.entrada=entrada

        #Pestaña entrada
        self.Entrada= UI_corriente.Ui_corriente(entrada)
        self.Entrada.Changed.connect(self.cambiar_entrada)
        self.tabWidget.insertTab(0, self.Entrada, QtWidgets.QApplication.translate("equipment", "Entrada", None))

        #Pestaña calculo
        gridLayout_Calculo = QtWidgets.QGridLayout(self.tabCalculo)
        gridLayout_Calculo.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Índice de trabajo de bond:", None)), 1, 0, 1, 1)
        self.Material=QtWidgets.QComboBox()
        self.Material.addItem(QtWidgets.QApplication.translate("equipment", "Definido por el usuario", None))
        for key in sorted(BondIndex.keys()):
            self.Material.addItem(key)
        self.Material.currentIndexChanged[str].connect(self.cambiarBondWordIndex)
        gridLayout_Calculo.addWidget(self.Material, 1, 1, 1, 1)
        self.BondWorkIndex=Entrada_con_unidades(float)
        gridLayout_Calculo.addWidget(self.BondWorkIndex, 1, 2, 1, 1)
        gridLayout_Calculo.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),10,0,1,5)

        #Pestaña costos
        gridLayout_Costos = QtWidgets.QGridLayout(self.tabCostos)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Tipo:", None)), 1, 1, 1, 1)
        self.tipo=QtWidgets.QComboBox()
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "De cono", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Giratorio", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Dentado", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "De martillo", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "De bolas", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Pulverizador", None))
        self.tipo.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.tipo, 1, 2, 1, 1)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),2,1,1,2)

        self.Costos=costIndex.CostData(1.3, 2)
        self.Costos.valueChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.Costos,4,1,2,5)

        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),6,1,1,6)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),10,1,1,6)
        self.groupBox_Costos = QtWidgets.QGroupBox(QtWidgets.QApplication.translate("equipment", "Costos calculados", None))
        gridLayout_Costos.addWidget(self.groupBox_Costos,7,1,1,6)
        gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_Costos)
        gridLayout_5.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Adquisición:", None)),0,1,1,1)
        self.C_adq=Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True)
        gridLayout_5.addWidget(self.C_adq,0,2,1,1)
        gridLayout_5.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Instalación:", None)),1,1,1,1)
        self.C_inst=Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True)
        gridLayout_5.addWidget(self.C_inst,1,2,1,1)

        #Pestaña salida
        self.Salida= UI_corriente.Ui_corriente(readOnly=True)
        self.tabWidget.insertTab(3, self.Salida,QtWidgets.QApplication.translate("equipment", "Salida", None))

        self.tabWidget.setCurrentIndex(0)


    def cambiarBondWordIndex(self, txt):
        try:
            value=BondIndex[str(txt)]
        except KeyError:
            self.BondWorkIndex.setReadOnly(False)
            self.BondWorkIndex.clear()
        else:
            self.BondWorkIndex.setValue(value)
            self.BondWorkIndex.setReadOnly(True)

    def cambiar_entrada(self, corriente):
        selfentrada=corriente
        self.calculo()

    def calculo(self):
        if self.todos_datos():

            self.rellenoSalida()

    def rellenoSalida(self):
        pass

    def todos_datos(self):
        pass

    def calcularCostos(self, factor=None, indiceBase=None, indiceActual=None):
        if self.todos_datos():
            if not factor: factor=self.Costos.factor
            if not indiceBase: indiceBase=self.Costos.Base
            if not indiceActual: indiceActual=self.Costos.Actual
            if self.tipo.currentIndex()==0:
                self.FireHeater.Coste(factor, indiceBase, indiceActual, 0, self.tipobox.currentIndex(), self.material.currentIndex())
            else:
                self.FireHeater.Coste(factor, indiceBase, indiceActual, 1, self.tipocilindrico.currentIndex(), self.material.currentIndex())
            self.C_adq.setValue(self.FireHeater.C_adq.config())
            self.C_inst.setValue(self.FireHeater.C_inst.config())
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:101,代码来源:UI_grinder.py

示例2: UI_equipment

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import clear [as 别名]

#.........这里部分代码省略.........
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Centrifuge type")), 2, 1)
        self.tipo_centrifuga = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_CENTRIFUGA:
            self.tipo_centrifuga.addItem(txt)
        self.tipo_centrifuga.currentIndexChanged.connect(
            partial(self.changeParamsCoste, "tipo_centrifuga"))
        lyt.addWidget(self.tipo_centrifuga, 2, 2)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Material")), 3, 1)
        self.material = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_MATERIAL:
            self.material.addItem(txt)
        self.material.currentIndexChanged.connect(
            partial(self.changeParamsCoste, "material"))
        lyt.addWidget(self.material, 3, 2)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Motor type")), 4, 1)
        self.motor = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_MOTOR:
            self.motor.addItem(txt)
        self.motor.currentIndexChanged.connect(
            partial(self.changeParamsCoste, "motor"))
        lyt.addWidget(self.motor, 4, 2)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Motor RPM")), 5, 1)
        self.rpm = QtWidgets.QComboBox(self.tabCostos)
        for txt in self.Equipment.TEXT_RPM:
            self.rpm.addItem(txt)
        self.rpm.currentIndexChanged.connect(
            partial(self.changeParamsCoste, "rpm"))
        lyt.addWidget(self.rpm, 5, 2)

        self.Costos = CostData(self.Equipment)
        self.Costos.valueChanged.connect(self.changeParamsCoste)
        lyt.addWidget(self.Costos, 6, 1, 2, 4)

        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 7, 1, 1, 4)
        group = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Stimated costs"))
        lyt.addWidget(group, 8, 1, 1, 4)
        layout = QtWidgets.QGridLayout(group)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Pump")), 0, 0)
        self.C_bomba = Entrada_con_unidades(Currency, retornar=False)
        self.C_bomba.setReadOnly(True)
        layout.addWidget(self.C_bomba, 0, 1)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Motor")), 1, 0)
        self.C_motor = Entrada_con_unidades(Currency, retornar=False)
        self.C_bomba.setReadOnly(True)
        layout.addWidget(self.C_motor, 1, 1)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Purchase cost")), 0, 4)
        self.C_adq = Entrada_con_unidades(Currency, retornar=False)
        self.C_adq.setReadOnly(True)
        layout.addWidget(self.C_adq, 0, 5)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Installed cost")), 1, 4)
        self.C_inst = Entrada_con_unidades(Currency, retornar=False)
        self.C_inst.setReadOnly(True)
        layout.addWidget(self.C_inst, 1, 5)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Fixed,
            QtWidgets.QSizePolicy.Fixed), 9, 1, 1, 4)

        if equipment:
            self.setEquipment(equipment)

    def cambiar_data(self, parametro, valor):
        if parametro == "Pout":
            self.Carga.clear()
            self.deltaP.clear()
        elif parametro == "deltaP":
            self.Pout.clear()
            self.Carga.clear()
        else:
            self.Pout.clear()
            self.deltaP.clear()
        self.changeParams(parametro, valor)

    def bomba_currentIndexChanged(self, int):
        self.tipo_centrifuga.setDisabled(int)
        self.changeParamsCoste("tipo_bomba", int)

    def usarCurvaToggled(self, int):
        self.groupBox_Curva.setEnabled(int)
        self.rendimiento.setReadOnly(int)
        self.changeParams("usarCurva", int)

    def bottonCurva_clicked(self):
        dialog = bombaCurva.Ui_bombaCurva(
            self.Equipment.kwargs["curvaCaracteristica"], self)
        if dialog.exec_():
            self.curva = dialog.curva
            self.diametro.setValue(dialog.curva[0])
            self.velocidad.setValue(dialog.curva[1])
            self.changeParams("curvaCaracteristica", dialog.curva)
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:104,代码来源:UI_pump.py

示例3: UI_equipment

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import clear [as 别名]
class UI_equipment(UI_equip):
    """Generic heat exchanger equipment edition dialog"""
    Equipment = Heat_Exchanger()

    def __init__(self, equipment=None, parent=None):
        """
        equipment: Initial equipment instance to model
        """
        super().__init__(Heat_Exchanger, entrada=False, salida=False,
                         parent=parent)

        # Calculate tab
        lyt = QtWidgets.QGridLayout(self.tabCalculo)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Output temperature")), 1, 1)
        self.Tout = Entrada_con_unidades(Temperature)
        self.Tout.valueChanged.connect(partial(self.changeParams, "Tout"))
        lyt.addWidget(self.Tout, 1, 2)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Temperature increase")), 2, 1)
        self.DeltaT = Entrada_con_unidades(DeltaT)
        self.DeltaT.valueChanged.connect(partial(self.changeParams, "DeltaT"))
        lyt.addWidget(self.DeltaT, 2, 2)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Heat Duty")), 3, 1)
        self.Heat = Entrada_con_unidades(Power)
        self.Heat.valueChanged.connect(partial(self.changeParams, "Heat"))
        lyt.addWidget(self.Heat, 3, 2)
        group = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Heat Transfer"))
        lyt.addWidget(group, 4, 1, 1, 2)
        lyt1 = QtWidgets.QGridLayout(group)
        lyt1.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Area")), 1, 1)
        self.A = Entrada_con_unidades(Area)
        self.A.valueChanged.connect(partial(self.changeParams, "A"))
        lyt1.addWidget(self.A, 1, 2)
        lyt1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Heat Transfer Coefficient")), 2, 1)
        self.U = Entrada_con_unidades(HeatTransfCoef)
        self.U.valueChanged.connect(partial(self.changeParams, "U"))
        lyt1.addWidget(self.U, 2, 2)
        lyt1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "External Temperature")), 3, 1)
        self.Text = Entrada_con_unidades(Temperature)
        self.Text.valueChanged.connect(partial(self.changeParams, "Text"))
        lyt1.addWidget(self.Text, 3, 2)

        lyt.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            5, 0, 1, 3)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Pressure loss")), 6, 1)
        self.DeltaP = Entrada_con_unidades(DeltaP, value=0)
        self.DeltaP.valueChanged.connect(partial(self.changeParams, "DeltaP"))
        lyt.addWidget(self.DeltaP, 6, 2)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 7, 0, 1, 3)

        group = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Results"))
        lyt.addWidget(group, 8, 1, 1, 5)
        layout = QtWidgets.QGridLayout(group)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Heat Duty")), 0, 1)
        self.HeatCalc = Entrada_con_unidades(Power, retornar=False)
        self.HeatCalc.setReadOnly(True)
        layout.addWidget(self.HeatCalc, 0, 2)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Output Temperature")), 1, 1)
        self.ToutCalc = Entrada_con_unidades(Temperature, retornar=False)
        self.ToutCalc.setReadOnly(True)
        layout.addWidget(self.ToutCalc, 1, 2)

        lyt.addItem(QtWidgets.QSpacerItem(
            0, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            9, 0, 1, 3)

        if equipment:
            self.setEquipment(equipment)

    def changeParams(self, parametro, valor):
        if parametro == "Tout":
            self.Heat.clear()
            self.DeltaT.clear()
        elif parametro == "DeltaT":
            self.Heat.clear()
            self.Tout.clear()
        elif parametro == "Heat":
            self.DeltaT.clear()
            self.Tout.clear()
        self.calculo(**{parametro: valor})
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:95,代码来源:UI_heatExchanger.py

示例4: Ui_Contribution

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import clear [as 别名]
class Ui_Contribution(newComponent):
    """Dialog to define hypotethical new component with several group
    contribucion methods"""
    ViewDetails = View_Contribution

    def __init__(self, metodo, parent=None):
        """Metodo: name of group contribution method:
            Joback
            Constantinou-Gani
            Wilson-Jasperson
            Marrero-Pardillo
            Elliott
            Ambrose
        """
        super(Ui_Contribution, self).__init__(parent)
        self.setWindowTitle(QtGui.QApplication.translate(
            "pychemqt", "Select the component group for method") +" "+ metodo)

        self.grupo = []
        self.indices = []
        self.contribucion = []
        self.metodo = metodo
        layout = QtGui.QGridLayout(self)
        self.Grupos = QtGui.QTableWidget()
        self.Grupos.verticalHeader().hide()
        self.Grupos.setRowCount(0)
        self.Grupos.setColumnCount(2)
        self.Grupos.setHorizontalHeaderItem(0, QtGui.QTableWidgetItem("Nk"))
        self.Grupos.setHorizontalHeaderItem(1, QtGui.QTableWidgetItem(
            QtGui.QApplication.translate("pychemqt", "Group")))
        self.Grupos.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.Grupos.setSortingEnabled(True)
        self.Grupos.horizontalHeader().setStretchLastSection(True)
        self.Grupos.setColumnWidth(0, 50)
        self.Grupos.setItemDelegateForColumn(0, SpinEditor(self))
        self.Grupos.cellChanged.connect(self.cellChanged)
        self.Grupos.setEditTriggers(QtGui.QAbstractItemView.AllEditTriggers)
        layout.addWidget(self.Grupos, 0, 0, 3, 3)

        self.Formula = QtGui.QLabel()
        font = QtGui.QFont()
        font.setPointSize(12)
        self.Formula.setFont(font)
        self.Formula.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
        self.Formula.setFixedHeight(50)
        layout.addWidget(self.Formula, 0, 3)
        self.botonBorrar = QtGui.QPushButton(QtGui.QIcon(QtGui.QPixmap(
            os.environ["pychemqt"]+"/images/button/editDelete.png")),
            QtGui.QApplication.translate("pychemqt", "Delete"))
        self.botonBorrar.clicked.connect(self.borrar)
        layout.addWidget(self.botonBorrar, 1, 3)
        self.botonClear = QtGui.QPushButton(QtGui.QIcon(QtGui.QPixmap(
            os.environ["pychemqt"]+"/images/button/clear.png")),
            QtGui.QApplication.translate("pychemqt", "Clear"))
        self.botonClear.clicked.connect(self.clear)
        layout.addWidget(self.botonClear, 2, 3)

        self.line = QtGui.QFrame()
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        layout.addWidget(self.line, 3, 0, 1, 4)

        self.TablaContribuciones = QtGui.QListWidget()
        self.TablaContribuciones.currentItemChanged.connect(self.selectedChanged)
        self.TablaContribuciones.itemDoubleClicked.connect(self.add)
        layout.addWidget(self.TablaContribuciones, 4, 0, 7, 3)
        self.botonAdd = QtGui.QPushButton(QtGui.QIcon(QtGui.QPixmap(
            os.environ["pychemqt"]+"/images/button/add.png")),
            QtGui.QApplication.translate("pychemqt", "Add"))
        self.botonAdd.setDisabled(True)
        self.botonAdd.clicked.connect(self.add)
        layout.addWidget(self.botonAdd, 4, 3)
        layout.addItem(QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding,
                                         QtGui.QSizePolicy.Expanding), 5, 1, 1, 1)

        # Show widget for specific method
        if metodo in ["Constantinou", "Wilson"]:
            self.Order1 = QtGui.QRadioButton(
                QtGui.QApplication.translate("pychemqt", "1st order"))
            self.Order1.setChecked(True)
            self.Order1.toggled.connect(self.Order)
            layout.addWidget(self.Order1, 6, 3)
            self.Order2 = QtGui.QRadioButton(
                QtGui.QApplication.translate("pychemqt", "2nd order"))
            layout.addWidget(self.Order2, 7, 3)

        if metodo == "Wilson":
            layout.addWidget(QtGui.QLabel(
                QtGui.QApplication.translate("pychemqt", "Rings")), 8, 3)
            self.anillos = QtGui.QSpinBox()
            self.anillos.valueChanged.connect(partial(self.changeParams, "ring"))
            layout.addWidget(self.anillos, 9, 3)

        if metodo == "Marrero":
            layout.addWidget(QtGui.QLabel(
                QtGui.QApplication.translate("pychemqt", "Atoms")), 8, 3)
            self.Atomos = QtGui.QSpinBox()
            self.Atomos.valueChanged.connect(partial(self.changeParams, "atomos"))
            layout.addWidget(self.Atomos, 9, 3)

#.........这里部分代码省略.........
开发者ID:edusegzy,项目名称:pychemqt,代码行数:103,代码来源:newComponent.py


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