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


Python Entrada_con_unidades.setReadOnly方法代码示例

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


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

示例1: UI_equipment

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setReadOnly [as 别名]
class UI_equipment(UI_equip):
    """Electric precipitator equipment edition dialog"""
    Equipment = ElectricPrecipitator()

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

        # Calculate tab
        lyt_Calc = QtWidgets.QGridLayout(self.tabCalculo)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Mode")), 1, 1)
        self.metodo = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_TIPO:
            self.metodo.addItem(txt)
        self.metodo.currentIndexChanged.connect(self.tipoCalculoCambiado)
        lyt_Calc.addWidget(self.metodo, 1, 2, 1, 4)
        lyt_Calc.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            2, 1, 1, 6)

        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Area")), 3, 1)
        self.area = Entrada_con_unidades(Area, resaltado=True)
        self.area.valueChanged.connect(partial(self.changeParams, "area"))
        lyt_Calc.addWidget(self.area, 3, 2)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Allowable efficiency")), 4, 1)
        self.rendimientoAdmisible = Entrada_con_unidades(float,  readOnly=True)
        self.rendimientoAdmisible.valueChanged.connect(
            partial(self.changeParams, "rendimientoAdmisible"))
        lyt_Calc.addWidget(self.rendimientoAdmisible, 4, 2)
        lyt_Calc.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            5, 1, 1, 6)

        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Dielectric constant")), 6, 1)
        self.epsilon = Entrada_con_unidades(float)
        self.epsilon.valueChanged.connect(
            partial(self.changeParams, "epsilon"))
        lyt_Calc.addWidget(self.epsilon, 6, 2)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Charging field")), 7, 1)
        self.potencialCarga = Entrada_con_unidades(PotencialElectric)
        self.potencialCarga.valueChanged.connect(
            partial(self.changeParams, "potencialCarga"))
        lyt_Calc.addWidget(self.potencialCarga, 7, 2)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Collecting field")), 8, 1)
        self.potencialDescarga = Entrada_con_unidades(PotencialElectric)
        self.potencialDescarga.valueChanged.connect(
            partial(self.changeParams, "potencialDescarga"))
        lyt_Calc.addWidget(self.potencialDescarga, 8, 2)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Pressure drop")), 9, 1)
        self.deltaP = Entrada_con_unidades(DeltaP)
        self.deltaP.valueChanged.connect(partial(self.changeParams, "deltaP"))
        lyt_Calc.addWidget(self.deltaP, 9, 2)
        lyt_Calc.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 6)

        groupbox = QtWidgets.QGroupBox(QtWidgets.QApplication.translate(
            "pychemqt", "Result"))
        lyt_Calc.addWidget(groupbox, 11, 1, 1, 5)
        lyt = QtWidgets.QGridLayout(groupbox)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Area")), 0, 1)
        self.areaCalculada = Entrada_con_unidades(Area, retornar=False)
        self.areaCalculada.setReadOnly(True)
        lyt.addWidget(self.areaCalculada, 0, 2)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Efficiency")), 1, 1)
        self.rendimiento = Entrada_con_unidades(float, readOnly=True)
        lyt.addWidget(self.rendimiento, 1, 2)
        lyt_Calc.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 12, 1, 1, 6)

        # Output tab
        self.addSalida(
            QtWidgets.QApplication.translate("pychemqt", "Filtered gas"))
        self.addSalida(
            QtWidgets.QApplication.translate("pychemqt", "Collected solids"))

        if equipment:
            self.setEquipment(equipment)

    def tipoCalculoCambiado(self, tipo_calculo):
        self.area.setReadOnly(tipo_calculo)
        self.area.setResaltado(not tipo_calculo)
        self.rendimientoAdmisible.setReadOnly(not tipo_calculo)
        self.rendimientoAdmisible.setResaltado(tipo_calculo)
        self.changeParams("metodo", tipo_calculo)
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:99,代码来源:UI_electricPrecipitator.py

示例2: UI_equipment

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

#.........这里部分代码省略.........
        self.checkAdiabatico.toggled.connect(self.heatChanged)
        layout.addWidget(self.checkAdiabatico, 1, 1, 1, 1)
        self.checkIsotermico=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Isothermal"))
        self.checkIsotermico.toggled.connect(self.heatChanged)
        layout.addWidget(self.checkIsotermico, 2, 1, 1, 1)
        self.checkFlux=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Heat duty"))
        self.checkFlux.toggled.connect(self.heatChanged)
        layout.addWidget(self.checkFlux, 3, 1, 1, 1)
        self.checkIntercambio=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Heat transfer"))
        self.checkIntercambio.toggled.connect(self.heatChanged)
        layout.addWidget(self.checkIntercambio, 4, 1, 1, 1)
        self.checkPerfil=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "PFR temperature profile"))
        self.checkPerfil.toggled.connect(self.heatChanged)
        layout.addWidget(self.checkPerfil, 5, 1, 1, 1)
        self.T=Entrada_con_unidades(unidades.Temperature)
        self.T.valueChanged.connect(self.calculo)
        layout.addWidget(self.T, 2, 2, 1, 2)
        self.Q=Entrada_con_unidades(unidades.Power)
        self.Q.valueChanged.connect(self.calculo)
        layout.addWidget(self.Q, 3, 2, 1, 2)
        self.T_ext=Entrada_con_unidades(unidades.Temperature)
        self.T_ext.valueChanged.connect(self.calculo)
        layout.addWidget(self.T_ext,4,2,1,2)
        self.U=Entrada_con_unidades(unidades.HeatTransfCoef)
        self.U.valueChanged.connect(self.calculo)
        layout.addWidget(self.U,4,4)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Flow")),4,5)
        self.direccion=QtWidgets.QComboBox()
        self.direccion.addItem(QtWidgets.QApplication.translate("pychemqt", "Countercurrent"))
        self.direccion.addItem(QtWidgets.QApplication.translate("pychemqt", "Cocurrent"))
        layout.addWidget(self.direccion,4,6)
        self.botonPerfil=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/table.png")), QtWidgets.QApplication.translate("pychemqt", "Add Profile"))
        self.botonPerfil.clicked.connect(self.editorPerfil)
        layout.addWidget(self.botonPerfil,5,2,1,1)
        gridLayout_Calculo.addWidget(groupbox, 7, 0, 1, 5)

        self.groupBox_Diseno= QtWidgets.QGroupBox(QtWidgets.QApplication.translate("pychemqt", "Design"))
        gridLayout_Calculo.addWidget(self.groupBox_Diseno,8,0,1,5)
        lyt = QtWidgets.QGridLayout(self.groupBox_Diseno)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Mode")),1,1)
        self.modo=QtWidgets.QComboBox()
        self.modo.addItem(QtWidgets.QApplication.translate("pychemqt", "Rating: calculate conversión"))
        self.modo.addItem(QtWidgets.QApplication.translate("pychemqt", "Design, calculate volumen"))
        self.modo.currentIndexChanged.connect(self.calculo)
        lyt.addWidget(self.modo,1,2,1,3)
        lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Fixed),1,5)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Reactor Volume")),2,1)
        self.V=Entrada_con_unidades(unidades.Volume, "VolLiq")
        lyt.addWidget(self.V,2,2)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Key Component")),3,1)
        self.key=QtWidgets.QComboBox()
#        for i, nombre in enumerate(self.nombres):
#            self.key.addItem("%i - %s" %(i+1, nombre))
        lyt.addWidget(self.key,3,2)
        lyt.addItem(QtWidgets.QSpacerItem(20,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),3,3)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Conversion")),3,4)
        self.conversion=Entrada_con_unidades(float, max=1)
        lyt.addWidget(self.conversion,3,5)

        gridLayout_Calculo.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),10,0,1,5)

        groupBox_Calculo = QtWidgets.QGroupBox(QtWidgets.QApplication.translate("pychemqt", "Results"))
        gridLayout_Calculo.addWidget(groupBox_Calculo,11,0,1,5)
        gridLayout_1 = QtWidgets.QGridLayout(groupBox_Calculo)
        gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "T output")),0,1,1,1)
        self.TCalc=Entrada_con_unidades(unidades.Temperature, retornar=False, readOnly=True)
        gridLayout_1.addWidget(self.TCalc,0,2,1,1)
        gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Heat")),1,1,1,1)
        self.HeatCalc=Entrada_con_unidades(unidades.Power, retornar=False, readOnly=True)
        gridLayout_1.addWidget(self.HeatCalc,1,2,1,1)

        gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Conversion")),0,4)
        self.conversionCalc=Entrada_con_unidades(float, readOnly=True)
        gridLayout_1.addWidget(self.conversionCalc,0,5)
        gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Reactor Volume")),1,4)
        self.VCalc=Entrada_con_unidades(unidades.Volume, "VolLiq", readOnly=True)
        gridLayout_1.addWidget(self.VCalc,1,5)

        self.checkAdiabatico.setChecked(True)
        self.tipoCambiado(0)


    def heatChanged(self):
        self.T.setReadOnly(not self.checkIsotermico.isChecked())
        self.Q.setReadOnly(not self.checkFlux.isChecked())
        self.T_ext.setReadOnly(not self.checkIntercambio.isChecked())
        self.U.setReadOnly(not self.checkIntercambio.isChecked())
        self.direccion.setEnabled(self.checkIntercambio.isChecked() and self.tipo.currentIndex())
        self.botonPerfil.setEnabled(self.checkPerfil.isChecked())

    def tipoCambiado(self, ind):
        self.checkPerfil.setEnabled(ind)
        self.direccion.setEnabled(self.checkIntercambio.isChecked() and ind)
        self.calculo()


    def editorPerfil(self):
        dialog=inputTable.InputTableDialog(2, data=self.profile_T, title=QtWidgets.QApplication.translate("pychemqt", "Temperature profile"), horizontalHeader=["x", "T, "+unidades.Temperature(None).text()])
        if dialog.exec_():
            self.profile_T=dialog.data
开发者ID:bkt92,项目名称:pychemqt,代码行数:104,代码来源:UI_reactor.py

示例3: UI_equipment

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

#.........这里部分代码省略.........
        self.motor.currentIndexChanged.connect(
            partial(self.changeParamsCoste, "motor"))
        lyt_Cost.addWidget(self.motor, 3, 2)
        lyt_Cost.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "RPM:")), 4, 1)
        self.rpm = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_RPM:
            self.rpm.addItem(txt)
        self.rpm.currentIndexChanged.connect(
            partial(self.changeParamsCoste, "rpm"))
        lyt_Cost.addWidget(self.rpm, 4, 2)
        lyt_Cost.addItem(QtWidgets.QSpacerItem(
            40, 20, QtWidgets.QSizePolicy.Fixed,
            QtWidgets.QSizePolicy.Maximum), 5, 1, 1, 6)

        self.Costos = CostData(self.Equipment)
        self.Costos.valueChanged.connect(self.changeParamsCoste)
        lyt_Cost.addWidget(self.Costos, 6, 1, 1, 3)

        lyt_Cost.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 8, 1, 1, 6)
        lyt_Cost.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 6)
        group = QtWidgets.QGroupBox()
        group.setTitle(
            QtWidgets.QApplication.translate("pychemqt", "Stimated Costs"))
        lyt_Cost.addWidget(group, 9, 1, 1, 5)
        lyt = QtWidgets.QGridLayout(group)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Compressor")), 0, 0)
        self.C_comp = Entrada_con_unidades(Currency, retornar=False)
        self.C_comp.setReadOnly(True)
        lyt.addWidget(self.C_comp, 0, 1)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Drive")), 1, 0)
        self.C_trans = Entrada_con_unidades(Currency, retornar=False)
        self.C_trans.setReadOnly(True)
        lyt.addWidget(self.C_trans, 1, 1)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Motor")), 2, 0)
        self.C_motor = Entrada_con_unidades(Currency, retornar=False)
        self.C_motor.setReadOnly(True)
        lyt.addWidget(self.C_motor, 2, 1)
        lyt.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)
        lyt.addWidget(self.C_adq, 0, 5)
        lyt.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)
        lyt.addWidget(self.C_inst, 1, 5)

        self.on_tipoCalculo_currentIndexChanged(0)
        if equipment:
            self.setEquipment(equipment)

    def on_tipoCalculo_currentIndexChanged(self, int):
        """Enabled or disabled widget for data entry to calculate"""
        if int == 0:
            self.trabajo.setReadOnly(True)
            self.razon.setReadOnly(True)
            self.Pout.setReadOnly(False)
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:70,代码来源:UI_compressor.py

示例4: UI_equipment

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

#.........这里部分代码省略.........
        lyt.addWidget(self.razonCalculada, 1, 5)
        lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Efficiency")), 2, 4)
        self.rendimientoCalculado = Entrada_con_unidades(float, readOnly=True)
        lyt.addWidget(self.rendimientoCalculado, 2, 5)

        # Cost tab
        lyt_Cost = QtGui.QGridLayout(self.tabCostos)
        self.Costos = CostData(self.Equipment)
        self.Costos.valueChanged.connect(self.changeParamsCoste)
        lyt_Cost.addWidget(self.Costos, 1, 0, 1, 2)

        lyt_Cost.addItem(QtGui.QSpacerItem(
            20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding),
            2, 0, 1, 2)
        group = QtGui.QGroupBox(QtGui.QApplication.translate("pychemqt",
                                                             "Stimated Costs"))
        lyt_Cost.addWidget(group, 3, 0, 1, 2)
        lyt = QtGui.QGridLayout(group)
        lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Purchase cost")), 0, 1)
        self.C_adq = Entrada_con_unidades(Currency, retornar=False, tolerancia=8,
                                          decimales=2, readOnly=True)
        lyt.addWidget(self.C_adq, 0, 2)
        lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Installed cost")), 1, 1)
        self.C_inst = Entrada_con_unidades(Currency, retornar=False, tolerancia=8,
                                           decimales=2, readOnly=True)
        lyt.addWidget(self.C_inst, 1, 2)
        lyt_Cost.addItem(QtGui.QSpacerItem(
            20, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed),
            4, 0, 1, 2)

        self.on_tipoCalculo_currentIndexChanged(0)
        if equipment:
            self.setEquipment(equipment)

    def on_tipoCalculo_currentIndexChanged(self, int):
        """Enabled or disabled widget for data entry to calculate"""
        if int == 0:
            self.trabajo.setReadOnly(True)
            self.razon.setReadOnly(True)
            self.Pout.setReadOnly(False)
            self.rendimiento.setReadOnly(False)
            self.Pout.setResaltado(True)
            self.rendimiento.setResaltado(True)
            self.razon.setResaltado(False)
            self.trabajo.setResaltado(False)
        elif int == 1:
            self.Pout.setReadOnly(True)
            self.razon.setReadOnly(False)
            self.trabajo.setReadOnly(True)
            self.rendimiento.setReadOnly(False)
            self.Pout.setResaltado(False)
            self.rendimiento.setResaltado(True)
            self.razon.setResaltado(True)
            self.trabajo.setResaltado(False)
        elif int == 2:
            self.trabajo.setReadOnly(False)
            self.Pout.setReadOnly(True)
            self.razon.setReadOnly(True)
            self.rendimiento.setReadOnly(False)
            self.Pout.setResaltado(False)
            self.rendimiento.setResaltado(True)
            self.razon.setResaltado(False)
            self.trabajo.setResaltado(True)
        elif int == 3:
            self.rendimiento.setReadOnly(True)
            self.razon.setReadOnly(True)
            self.trabajo.setReadOnly(False)
            self.Pout.setReadOnly(False)
            self.Pout.setResaltado(True)
            self.rendimiento.setResaltado(False)
            self.razon.setResaltado(False)
            self.trabajo.setResaltado(True)
        elif int == 4:
            self.rendimiento.setReadOnly(True)
            self.razon.setReadOnly(False)
            self.trabajo.setReadOnly(False)
            self.Pout.setReadOnly(True)
            self.Pout.setResaltado(False)
            self.rendimiento.setResaltado(False)
            self.razon.setResaltado(True)
            self.trabajo.setResaltado(True)
        else:
            self.rendimiento.setReadOnly(False)
            self.razon.setReadOnly(False)
            self.trabajo.setReadOnly(False)
            self.Pout.setReadOnly(False)
            self.Pout.setResaltado(True)
            self.rendimiento.setResaltado(True)
            self.razon.setResaltado(True)
            self.trabajo.setResaltado(True)

        self.changeParams("metodo", int)

    def rellenar(self):
        UI_equip.rellenar(self)
        if self.Equipment.status == 1 and self.metodo.currentIndex() == 5:
                self.entrada.setCorriente(self.Equipment.entrada)
开发者ID:edusegzy,项目名称:pychemqt,代码行数:104,代码来源:UI_turbine.py

示例5: UI_reacciones

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

#.........这里部分代码省略.........

        self.checkGibbs=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "From Gibbs free energy minimization"))
        lyt.addWidget(self.checkGibbs,6,1,1,4)

        self.check_KFijo.setChecked(True)


        widget=QtWidgets.QWidget()
        self.stacked.addWidget(widget)
        lyt=QtWidgets.QGridLayout(widget)

        widget=QtWidgets.QWidget()
        self.stacked.addWidget(widget)
        lyt=QtWidgets.QGridLayout(widget)

        self.status=Status()
        gridLayout.addWidget(self.status, 10,1)
        self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        gridLayout.addWidget(self.buttonBox,10,2,1,4)

        if reaccion:
            self.setReaction(reaccion)

    def changeParams(self, parametro, valor):
        self.calculo(**{parametro: valor})

    def calculo(self, **kwargs):
        self.status.setState(4)
        self.evaluate.start(self.reaction, kwargs)

    def changeHr(self, bool):
        self.Hr.setReadOnly(not bool)
        self.changeParams("customHr", bool)

    def reaccionCambiada(self):
        kwargs={"componentes": self.indices,
                    "coeficientes": self.Estequiometria.getColumn(0)[:-1]}
        self.calculo(**kwargs)

    def setReaction(self, reaction):
        self.reaction=reaction
        self.rellenar()

#        if self.Estequiometria.getValue(0, self.Base.currentIndex()):
#            reaccion=reaction.Reaction(self.indices, self.Estequiometria.getColumn(0), base=self.Base.currentIndex(), estequiometria=[0, 0, 0.5], formulas=self.checkFormula.isChecked(), calor=self.checkCalorEspecificado.isChecked(), Hr=self.Hr.value, tipo=self.tipo.currentIndex(), conversion=self.Conversion.getColumn(0)[-1::-1])
#            self.Balance.setValue(reaccion.error)
#            if reaccion.state:
#                self.Formula.setText(reaccion._txt(self.checkFormula.isChecked()))
#                self.Hr.setValue(reaccion.Hr)
#            else:
#                self.Formula.clear()
#                self.Hr.clear()
#            self.botonAdd.setEnabled(reaccion.state and not self.botonEdit.isChecked())
#            self.reaccion=reaccion

    def rellenar(self):
        self.blockSignals(True)
        for variable in self.reaction.kwargsValue:
            self.__getattribute__(variable).setValue(self.reaction.kwargs[variable])
        for combo in self.reaction.kwargsList:
            self.__getattribute__(combo).setCurrentIndex(self.reaction.kwargs[combo])
        for check in self.reaction.kwargsCheck:
            self.__getattribute__(check).setChecked(self.reaction.kwargs[check])
开发者ID:bkt92,项目名称:pychemqt,代码行数:69,代码来源:UI_reactor.py

示例6: UI_equipment

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

#.........这里部分代码省略.........
            "pychemqt", "Output annulli temperature")), 6, 1)
        self.annulliTout = Entrada_con_unidades(Temperature)
        self.annulliTout.valueChanged.connect(
            partial(self.changeParams, "annulliTout"))
        lyt.addWidget(self.annulliTout, 6, 2)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Output inside quality")), 5, 4)
        self.tubeXout = Entrada_con_unidades(float)
        self.tubeXout.valueChanged.connect(
            partial(self.changeParams, "tubeXout"))
        lyt.addWidget(self.tubeXout, 5, 5)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Output annulli quality")), 6, 4)
        self.annulliXout = Entrada_con_unidades(float)
        self.annulliXout.valueChanged.connect(
            partial(self.changeParams, "annulliXout"))
        lyt.addWidget(self.annulliXout, 6, 5)

        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 15, 1, 1, 6)

        group = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Results"))
        lyt.addWidget(group, 16, 1, 1, 6)
        layout = QtWidgets.QGridLayout(group)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Heat Duty")), 0, 1)
        self.Q = Entrada_con_unidades(Power, retornar=False, readOnly=True)
        layout.addWidget(self.Q, 0, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Tout Tube")), 1, 1)
        self.ToutTube = Entrada_con_unidades(Temperature, retornar=False)
        self.ToutTube.setReadOnly(True)
        layout.addWidget(self.ToutTube, 1, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Tout Tube")), 2, 1)
        self.ToutAnnulli = Entrada_con_unidades(Temperature, retornar=False)
        self.ToutAnnulli.setReadOnly(True)
        layout.addWidget(self.ToutAnnulli, 2, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "U")), 0, 4)
        self.U = Entrada_con_unidades(HeatTransfCoef, retornar=False)
        self.U.setReadOnly(True)
        layout.addWidget(self.U, 0, 5)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Area")), 1, 4)
        self.A = Entrada_con_unidades(Area, retornar=False, readOnly=True)
        layout.addWidget(self.A, 1, 5)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Lenght")), 2, 4)
        self.L = Entrada_con_unidades(Length, retornar=False, readOnly=True)
        layout.addWidget(self.L, 2, 5)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "DeltaP Tube")), 0, 7)
        self.deltaPTube = Entrada_con_unidades(DeltaP, retornar=False)
        self.deltaPTube.setReadOnly(True)
        layout.addWidget(self.deltaPTube, 0, 8)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "DeltaP Annulli")), 1, 7)
        self.deltaPAnnulli = Entrada_con_unidades(DeltaP, retornar=False)
        self.deltaPAnnulli.setReadOnly(True)
        layout.addWidget(self.deltaPAnnulli, 1, 8)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "CF")), 2, 7)
        self.CF = Entrada_con_unidades(float, retornar=False, readOnly=True)
开发者ID:bkt92,项目名称:pychemqt,代码行数:70,代码来源:UI_hairpin.py

示例7: FoulingWidget

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

#.........这里部分代码省略.........
            "Crude oil salt 120C<T<175C, 1.2<v": 0.000705,
            "Crude oil dry 175C<T<230C, v<0.6": 0.000705,
            "Crude oil salt 175C<T<230C, v<0.6": 0.001057,
            "Crude oil dry 175C<T<230C, 0.6<v<1.2": 0.000528,
            "Crude oil salt 175C<T<230C, 0.6<v<1.2": 0.000881,
            "Crude oil dry 175C<T<230C, 1.2<v": 0.000528,
            "Crude oil salt 175C<T<230C, 1.2<v": 0.000881,
            "Crude oil dry T>230C, v<0.6": 0.000881,
            "Crude oil salt T>230C, v<0.6": 0.001233,
            "Crude oil dry T>230C, 0.6<v<1.2": 0.000705,
            "Crude oil salt T>230C, 0.6<v<1.2": 0.001057,
            "Crude oil dry T>230C, 1.2<v": 0.000705,
            "Crude oil salt T>230C, 1.2<v": 0.001057,
            "Gasoline": 0.000352,
            "Naphtha and light distillates": 0.00044,
            "Kerosene": 0.00044,
            "Light gas oil": 0.00044,
            "Heavy gas oil": 0.00067,
            "Heavy fuel oils": 0.00105},
        u"Refinery Asphalt": {
            "Vacuum tower bottoms": 0.001761,
            "Atmosphere tower bottoms": 0.001233},
        u"Refinery Cracking and caking": {
            "Overhead vapors": 0.000352,
            "Light cycle oil": 0.00044,
            "Heavy cycle oil": 0.00061,
            "Light coker gas oil": 0.00061,
            "Heavy coker gas oil": 0.00079,
            "Bottoms slurry oil": 0.000528,
            "Light liquid products": 0.000176},
        u"Refinery Reforming": {
            "Reformer charge": 0.000264,
            "Reformer effluent": 0.000264,
            "Hydrocracker charge and effluent": 0.000352,
            "Recycle gas": 0.000176,
            "Overhead vapors": 0.000176,
            "Liquid product >50 API": 0.000176,
            "Liquid product 30-50 API": 0.000352},
        u"Refinery Light Ends": {
            "Overhead vapors and gases": 0.000176,
            "Liquid products": 0.000176,
            "Absorption oils": 0.00044,
            "Alkylation trace acid streams": 0.000352,
            "Reboiler streams": 0.00044},
        u"Refinery Lube oil": {
            "Feed stock": 0.000352,
            "Solvent feed mix": 0.000352,
            "Solvent": 0.000176,
            "Extract": 0.000528,
            "Rafftnate": 0.000176,
            "Asphalt": 0.000881,
            "Wax slurries": 0.000528,
            "Refined lube oil": 0.000176},
        u"Refinery Visbreaker": {
            "Overhead vapor": 0.000528,
            "Visbreaker bottoms": 0.001761},
        u"Refinery Naphtha Hydrotreater": {
            "Feed": 0.000528,
            "Effluent": 0.000352,
            "Naphfthas": 0.000352,
            "Overhead vapors": 0.000264},
        u"Refinery Catalytic": {
            "Charge": 0.00079,
            "Effluent": 0.000352,
            "H.T. separator": 0.000352,
            "Stripper charge": 0.000528,
            "Liquid products": 0.000352},
        u"Refinery HF Alky": {
            "Alkylate, deprop. bottons, main fract": 0.000528,
            "Other": 0.000352}}

    def __init__(self, parent=None):
        super(FoulingWidget, self).__init__(parent)
        layout = QtGui.QHBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        self.list = QtGui.QComboBox()
        self.list.addItem("")
        layout.addWidget(self.list)
        self.value = Entrada_con_unidades(Fouling, decimales=6)
        self.value.valueChanged.connect(self.valueChanged.emit)
        layout.addWidget(self.value)

        for tipo in sorted(self.Fouling_Factor):
            self.list.insertSeparator(self.list.count()+1)
            for componente in sorted(self.Fouling_Factor[tipo]):
                self.list.addItem(" - ".join([tipo, componente]))
        self.list.currentIndexChanged["QString"].connect(self.rellenar)

    def setValue(self, value):
        self.value.setValue(value)

    def rellenar(self, txt):
        if txt:
            tipo, componente = txt.split(" - ")
            value = self.Fouling_Factor[str(tipo)][str(componente)]
            self.value.setReadOnly(True)
            self.value.setValue(value)
            self.valueChanged.emit(value)
        else:
            self.value.setReadOnly(False)
开发者ID:edusegzy,项目名称:pychemqt,代码行数:104,代码来源:widget.py

示例8: UI_equipment

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

#.........这里部分代码省略.........
        self.diametro = Entrada_con_unidades(Length)
        self.diametro.valueChanged.connect(
            partial(self.changeParams, "diametro"))
        gridLayout_Calculo.addWidget(self.diametro, 5, 2)
        gridLayout_Calculo.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Efficiency")), 6, 1)
        self.rendimientoAdmisible = Entrada_con_unidades(float, spinbox=True)
        self.rendimientoAdmisible.valueChanged.connect(
            partial(self.changeParams, "rendimientoAdmisible"))
        gridLayout_Calculo.addWidget(self.rendimientoAdmisible, 6, 2)

        self.groupJohnstone = QtWidgets.QWidget()
        gridLayout_Calculo.addWidget(self.groupJohnstone, 7, 1, 1, 2)
        JohnstoneLayout = QtWidgets.QHBoxLayout(self.groupJohnstone)
        JohnstoneLayout.setSpacing(0)
        JohnstoneLayout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Ventury Constant")))
        self.k = Entrada_con_unidades(float, spinbox=True)
        self.k.valueChanged.connect(partial(self.changeParams, "k"))
        JohnstoneLayout.addWidget(self.k)

        self.groupCalvert = QtWidgets.QWidget()
        gridLayout_Calculo.addWidget(self.groupCalvert, 7, 1, 1, 2)
        CalvertLayout = QtWidgets.QHBoxLayout(self.groupCalvert)
        CalvertLayout.setSpacing(0)
        CalvertLayout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "f parameter")))
        self.f = Entrada_con_unidades(float, spinbox=True)
        self.f.valueChanged.connect(partial(self.changeParams, "f"))
        CalvertLayout.addWidget(self.f)

        self.groupLt = QtWidgets.QWidget()
        gridLayout_Calculo.addWidget(self.groupLt, 5, 4, 1, 2)
        LtLayout = QtWidgets.QHBoxLayout(self.groupLt)
        LtLayout.setSpacing(0)
        LtLayout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Length throat")))
        self.Lt = Entrada_con_unidades(Length)
        self.Lt.valueChanged.connect(partial(self.changeParams, "Lt"))
        LtLayout.addWidget(self.Lt)

        gridLayout_Calculo.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 8, 1, 1, 6)
        self.groupBox_Calculo = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Results"))
        gridLayout_Calculo.addWidget(self.groupBox_Calculo, 9, 1, 1, 5)
        gridLayout_1 = QtWidgets.QGridLayout(self.groupBox_Calculo)
        gridLayout_1.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Efficiency")), 1, 1)
        self.rendimiento = Entrada_con_unidades(
            float, retornar=False, readOnly=True)
        gridLayout_1.addWidget(self.rendimiento, 1, 2)
        gridLayout_1.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "DeltaP")), 2, 1)
        self.deltaP = Entrada_con_unidades(
            DeltaP, retornar=False, readOnly=True)
        gridLayout_1.addWidget(self.deltaP, 2, 2)

        gridLayout_Calculo.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 11, 1, 1, 6)

        # Output Tab
        self.SalidaGas = UI_corriente.Ui_corriente(readOnly=True, psychro=True)
        self.Salida.addTab(
            self.SalidaGas,
            QtWidgets.QApplication.translate("pychemqt", "Clean Gas"))
        self.SalidaLiquido = UI_corriente.Ui_corriente(readOnly=True)
        self.Salida.addTab(
            self.SalidaLiquido,
            QtWidgets.QApplication.translate("pychemqt", "Liquid"))

        self.on_tipoCalculo_currentIndexChanged(0)
        self.on_modeloRendimiento_currentIndexChanged(0)
        self.on_modeloDeltaP_currentIndexChanged(0)
        if equipment:
            self.setEquipment(equipment)

    def on_tipoCalculo_currentIndexChanged(self, modelo):
        self.rendimientoAdmisible.setEnabled(modelo)
        self.rendimientoAdmisible.setReadOnly(not modelo)
        self.diametro.setEnabled(not modelo)
        self.diametro.setReadOnly(modelo)
        self.changeParams("tipo_calculo", modelo)

    def on_modeloRendimiento_currentIndexChanged(self, modelo):
        self.groupJohnstone.setVisible(False)
        self.groupCalvert.setVisible(False)
        if modelo == 0:
            self.groupJohnstone.setVisible(True)
        elif modelo == 1:
            self.groupCalvert.setVisible(True)
        self.changeParams("modelo_rendimiento", modelo)

    def on_modeloDeltaP_currentIndexChanged(self, modelo):
        self.groupLt.setVisible(False)
        if modelo in (3, 4):
            self.groupLt.setVisible(True)
        self.changeParams("modelo_DeltaP", modelo)
开发者ID:bkt92,项目名称:pychemqt,代码行数:104,代码来源:UI_scrubber.py

示例9: UI_equipment

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setReadOnly [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

示例10: UI_equipment

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

#.........这里部分代码省略.........
        self.R = Entrada_con_unidades(float)
        self.R.valueChanged.connect(partial(self.changeParams, "R"))
        lyt.addWidget(self.R, 7, 1)
        lyt.addWidget(QtWidgets.QLabel("R/Rmin"), 8, 0)
        self.R_Rmin = Entrada_con_unidades(float)
        self.R_Rmin.valueChanged.connect(partial(self.changeParams, "R_Rmin"))
        lyt.addWidget(self.R_Rmin, 8, 1)

        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Design Pressure")), 7, 3)
        self.Pd = Entrada_con_unidades(Pressure)
        self.Pd.valueChanged.connect(partial(self.changeParams, "Pd"))
        lyt.addWidget(self.Pd, 7, 4)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Pressure loss")), 8, 3)
        self.DeltaP = Entrada_con_unidades(Pressure)
        self.DeltaP.valueChanged.connect(partial(self.changeParams, "DeltaP"))
        lyt.addWidget(self.DeltaP, 8, 4)
        lyt.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding),
            9, 0, 1, 5)
        self.buttonMcCabe = QtWidgets.QPushButton(
            QtWidgets.QApplication.translate("pychemqt", "McCabe-Thiele"))
        self.buttonMcCabe.clicked.connect(self.mcCabe)
        lyt.addWidget(self.buttonMcCabe, 10, 0)

        groupBox_Calculo = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Results"))
        lyt.addWidget(groupBox_Calculo, 11, 0, 1, 5)
        layout = QtWidgets.QGridLayout(groupBox_Calculo)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Condenser Duty")), 0, 1)
        self.DutyCondenser = Entrada_con_unidades(Power, retornar=False)
        self.DutyCondenser.setReadOnly(True)
        layout.addWidget(self.DutyCondenser, 0, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Reboiler Duty")), 1, 1)
        self.DutyReboiler = Entrada_con_unidades(Power, retornar=False)
        self.DutyReboiler.setReadOnly(True)
        layout.addWidget(self.DutyReboiler, 1, 2)
        layout.addWidget(QtWidgets.QLabel("Rmin"), 2, 1)
        self.Rmin = Entrada_con_unidades(float, readOnly=True)
        layout.addWidget(self.Rmin, 2, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Reflux ratio")), 3, 1)
        self.RCalculada = Entrada_con_unidades(float, readOnly=True)
        layout.addWidget(self.RCalculada, 3, 2)

        layout.addWidget(QtWidgets.QLabel("Nmin"), 0, 4)
        self.Nmin = Entrada_con_unidades(float, readOnly=True)
        layout.addWidget(self.Nmin, 0, 5)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Stages")), 1, 4)
        self.NTray = Entrada_con_unidades(float, readOnly=True)
        layout.addWidget(self.NTray, 1, 5)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Feed stage")), 2, 4)
        self.N_feed = Entrada_con_unidades(float, readOnly=True)
        layout.addWidget(self.N_feed, 2, 5)

        # Cost tab
        lyt = QtWidgets.QGridLayout(self.tabCostos)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Process")), 1, 1)
        self.proceso = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_PROCESS:
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:70,代码来源:UI_columnFUG.py

示例11: UI_equipment

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

#.........这里部分代码省略.........
        image = QtGui.QLabel()
        path = os.environ["pychemqt"] + "/images/equip/ciclon.gif"
        image.setPixmap(QtGui.QPixmap(path))
        image.setScaledContents(True)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        image.setSizePolicy(sizePolicy)
        lyt_Calc.addWidget(image, 0, 8, 12, 1)

        # Cost tab
        lyt_Cost = QtGui.QGridLayout(self.tabCostos)
        lyt_Cost.addWidget(QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Model")), 1, 1)
        self.tipo_costo = QtGui.QComboBox()
        for txt in self.Equipment.TEXT_COST:
            self.tipo_costo.addItem(txt)
        self.tipo_costo.currentIndexChanged.connect(partial(self.changeParamsCoste, "tipo_costo"))
        lyt_Cost.addWidget(self.tipo_costo, 1, 2)
        lyt_Cost.addItem(QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed), 1, 3)

        self.Costos = CostData(self.Equipment)
        self.Costos.valueChanged.connect(self.changeParamsCoste)
        lyt_Cost.addWidget(self.Costos, 3, 1, 1, 3)
        lyt_Cost.addItem(
            QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 4, 1, 1, 3
        )

        group = QtGui.QGroupBox(QtGui.QApplication.translate("pychemqt", "Stimated Costs"))
        lyt_Cost.addWidget(group, 5, 1, 1, 3)
        lyt = QtGui.QGridLayout(group)
        lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Number")), 0, 0)
        self.num_ciclonesCoste = Entrada_con_unidades(int, readOnly=True)
        lyt.addWidget(self.num_ciclonesCoste, 0, 1, 1, 3)
        lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Volumetric Flow")), 1, 0)
        self.Q = Entrada_con_unidades(VolFlow, "QGas", retornar=False)
        self.Q.setReadOnly(True)
        lyt.addWidget(self.Q, 1, 1)
        lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Purchase cost")), 0, 3)
        self.C_adq = Entrada_con_unidades(Currency, retornar=False, decimales=2, tolerancia=8)
        self.C_adq.setReadOnly(True)
        lyt.addWidget(self.C_adq, 0, 4)
        lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Installed cost")), 1, 3)
        self.C_inst = Entrada_con_unidades(Currency, retornar=False, decimales=2, tolerancia=8)
        self.C_inst.setReadOnly(True)
        lyt.addWidget(self.C_inst, 1, 4)

        # Output tab
        self.addSalida(QtGui.QApplication.translate("pychemqt", "Filtered gas"))
        self.addSalida(QtGui.QApplication.translate("pychemqt", "Collected solids"))

        self.on_tipoCalculo_currentIndexChanged(0)
        self.modeloEficiencia_Changed(0)
        if equipment:
            self.setEquipment(equipment)

    def on_tipoCalculo_currentIndexChanged(self, int):
        """Habilita o desabilita los datos requeridos para el cálculo"""
        if int and self.modelo_ciclon.count() == 9:
            self.modelo_ciclon.removeItem(8)
        elif not int and self.modelo_ciclon.count() == 8:
            self.modelo_ciclon.addItem(QtGui.QApplication.translate("pychemqt", "Custom"))

        self.Dc.setReadOnly(int)
        self.Dc.setResaltado(not int)
        self.num_ciclones.setReadOnly(int)
        self.num_ciclones.setResaltado(not int)
        self.rendimientoAdmisible.setReadOnly(not int)
        self.rendimientoAdmisible.setResaltado(int)
开发者ID:edusegzy,项目名称:pychemqt,代码行数:70,代码来源:UI_ciclon.py

示例12: UI_equipment

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setReadOnly [as 别名]
class UI_equipment(UI_equip):
    """Gravity chamber equipment edition dialog"""
    Equipment = GravityChamber()

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

        # Calculate tab
        lyt_Calc = QtWidgets.QGridLayout(self.tabCalculo)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Mode")), 1, 1, 1, 1)
        self.metodo = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_TIPO:
            self.metodo.addItem(txt)
        self.metodo.currentIndexChanged.connect(self.tipoCalculoCambiado)
        lyt_Calc.addWidget(self.metodo, 1, 2, 1, 4)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Model")), 2, 1, 1, 1)
        self.modelo = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_MODEL:
            self.modelo.addItem(txt)
        self.modelo.currentIndexChanged.connect(partial(self.changeParams,
                                                        "modelo"))
        lyt_Calc.addWidget(self.modelo, 2, 2, 1, 1)
        lyt_Calc.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            3, 1, 1, 6)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Width")), 4, 1, 1, 1)
        self.W = Entrada_con_unidades(Length)
        self.W.valueChanged.connect(partial(self.changeParams, "W"))
        lyt_Calc.addWidget(self.W, 4, 2, 1, 1)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Height")), 5, 1, 1, 1)
        self.H = Entrada_con_unidades(Length)
        self.H.valueChanged.connect(partial(self.changeParams, "H"))
        lyt_Calc.addWidget(self.H, 5, 2, 1, 1)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Length")), 6, 1, 1, 1)
        self.L = Entrada_con_unidades(Length)
        self.L.valueChanged.connect(partial(self.changeParams, "L"))
        lyt_Calc.addWidget(self.L, 6, 2, 1, 1)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Allowable efficiency")), 7, 1, 1, 1)
        self.rendimientoAdmisible = Entrada_con_unidades(
            float, spinbox=True, max=1)
        self.rendimientoAdmisible.valueChanged.connect(
            partial(self.changeParams, "rendimientoAdmisible"))
        lyt_Calc.addWidget(self.rendimientoAdmisible, 7, 2, 1, 1)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Allowable speed")), 8, 1, 1, 1)
        self.velocidadAdmisible = Entrada_con_unidades(Speed)
        self.velocidadAdmisible.valueChanged.connect(
            partial(self.changeParams, "velocidadAdmisible"))
        lyt_Calc.addWidget(self.velocidadAdmisible, 8, 2, 1, 1)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Pressure loss")), 9, 1, 1, 1)
        self.deltaP = Entrada_con_unidades(DeltaP)
        self.deltaP.valueChanged.connect(partial(self.changeParams, "deltaP"))
        lyt_Calc.addWidget(self.deltaP, 9, 2, 1, 1)

        lyt_Calc.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 6)
        group_Calc = QtWidgets.QGroupBox(QtWidgets.QApplication.translate(
            "pychemqt", "Results"))
        lyt_Calc.addWidget(group_Calc, 11, 1, 1, 5)
        lyt = QtWidgets.QGridLayout(group_Calc)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Flow")), 0, 1)
        self.Q = Entrada_con_unidades(VolFlow, "QGas", retornar=False)
        self.Q.setReadOnly(True)
        lyt.addWidget(self.Q, 0, 2)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "V<sub>gas</sub>")), 1, 1)
        self.Vgas = Entrada_con_unidades(Speed, retornar=False, readOnly=True)
        lyt.addWidget(self.Vgas, 1, 2)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Efficiency")), 2, 1)
        self.rendimiento = Entrada_con_unidades(float, retornar=False)
        self.rendimiento.setReadOnly(True)
        lyt.addWidget(self.rendimiento, 2, 2)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Height")), 0, 4)
        self.HCalc = Entrada_con_unidades(Length, retornar=False)
        self.HCalc.setReadOnly(True)
        lyt.addWidget(self.HCalc, 0, 5)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Width")), 1, 4)
        self.WCalc = Entrada_con_unidades(Length, retornar=False)
        self.WCalc.setReadOnly(True)
        lyt.addWidget(self.WCalc, 1, 5)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Length")), 2, 4)
        self.LCalc = Entrada_con_unidades(Length, retornar=False)
        self.LCalc.setReadOnly(True)
        lyt.addWidget(self.LCalc, 2, 5)
#.........这里部分代码省略.........
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:103,代码来源:UI_gravityChamber.py

示例13: UI_equipment

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

    def __init__(self, equipment=None, parent=None):
        """
        equipment: Initial equipment instance to model
        """
        super().__init__(Pump, entrada=False, salida=False, parent=parent)
        self.curva = [0, 0, []]

        # Calculate tab
        lyt = QtWidgets.QGridLayout(self.tabCalculo)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Output Pressure")), 1, 1)
        self.Pout = Entrada_con_unidades(Pressure)
        self.Pout.valueChanged.connect(partial(self.cambiar_data, "Pout"))
        lyt.addWidget(self.Pout, 1, 2)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Pressure increase")), 2, 1)
        self.deltaP = Entrada_con_unidades(Pressure)
        self.deltaP.valueChanged.connect(partial(self.cambiar_data, "deltaP"))
        lyt.addWidget(self.deltaP, 2, 2)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Head")), 3, 1)
        self.Carga = Entrada_con_unidades(Length, "Head")
        self.Carga.valueChanged.connect(partial(self.cambiar_data, "Carga"))
        lyt.addWidget(self.Carga, 3, 2)
        lyt.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            4, 1, 1, 2)
        self.usarCurva = QtWidgets.QCheckBox(
            QtWidgets.QApplication.translate("pychemqt", "Pump curve"))
        self.usarCurva.toggled.connect(self.usarCurvaToggled)
        lyt.addWidget(self.usarCurva, 5, 1, 2, 2)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Efficiency")), 7, 1)
        self.rendimiento = Entrada_con_unidades(float, min=0, max=1,
                                                spinbox=True, step=0.01)
        self.rendimiento.valueChanged.connect(
            partial(self.cambiar_data, "rendimiento"))
        lyt.addWidget(self.rendimiento, 7, 2)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 8, 1, 1, 6)

        self.groupBox_Curva = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Pump curve"))
        self.groupBox_Curva.setEnabled(False)
        lyt.addWidget(self.groupBox_Curva, 5, 4, 3, 1)
        layout = QtWidgets.QGridLayout(self.groupBox_Curva)

        self.bottonCurva = QtWidgets.QPushButton(
            QtWidgets.QApplication.translate("pychemqt", "Curve"))
        self.bottonCurva.clicked.connect(self.bottonCurva_clicked)
        layout.addWidget(self.bottonCurva, 1, 1, 1, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Variable")), 2, 1)
        self.incognita = QtWidgets.QComboBox(self.tabCalculo)
        self.incognita.setToolTip(QtWidgets.QApplication.translate(
            "pychemqt",
            "If use curve, it can calculate the head or the flowrate, in that \
case it override flow of input stream"))
        self.incognita.addItem(
            QtWidgets.QApplication.translate("pychemqt", "Output pressure"))
        self.incognita.addItem(
            QtWidgets.QApplication.translate("pychemqt", "Flowrate"))
        self.incognita.currentIndexChanged.connect(
            partial(self.cambiar_data, "incognita"))
        layout.addWidget(self.incognita, 2, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Diameter")), 3, 1)
        self.diametro = Entrada_con_unidades(
            float, spinbox=True, step=0.1, suffix='"')
        self.diametro.valueChanged.connect(
            partial(self.cambiar_data, "diametro"))
        layout.addWidget(self.diametro, 3, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "RPM")), 4, 1)
        self.velocidad = Entrada_con_unidades(int, spinbox=True, step=1)
        self.velocidad.valueChanged.connect(
            partial(self.cambiar_data, "velocidad"))
        layout.addWidget(self.velocidad, 4, 2)

        group = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Results"))
        layout = QtWidgets.QGridLayout(group)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Power")), 0, 0)
        self.power = Entrada_con_unidades(Power, retornar=False, readOnly=True)
        layout.addWidget(self.power, 0, 1)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Output Pressure")), 0, 4)
        self.PoutCalculada = Entrada_con_unidades(Pressure, retornar=False)
        self.PoutCalculada.setReadOnly(True)
        layout.addWidget(self.PoutCalculada, 0, 5)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Flowrate")), 1, 0)
        self.volflow = Entrada_con_unidades(VolFlow, "QLiq", retornar=False)
        self.volflow.setReadOnly(True)
#.........这里部分代码省略.........
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:103,代码来源:UI_pump.py

示例14: UI_equipment

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

#.........这里部分代码省略.........
        self.Salida.addTab(self.SalidaGas,QtGui.QApplication.translate("equipment", "Gas filtrado", None, QtGui.QApplication.UnicodeUTF8))
        self.Salida.addTab(self.SalidaSolido,QtGui.QApplication.translate("equipment", "Sólidos recogidos", None, QtGui.QApplication.UnicodeUTF8))

        self.tabWidget.setCurrentIndex(0)


    def cambiar_entrada(self, corriente):
        self.entrada=corriente
        self.rellenarTablaRendimientos()
        self.calculo()

    def rellenarTablaRendimientos(self):
        self.Rendimientos.clearContents()
        self.Rendimientos.setRowCount(len(self.entrada.solido.distribucion))
        self.Rendimientos.setHorizontalHeaderLabels([QtGui.QApplication.translate("equipment", "Diámetro, µm", None, QtGui.QApplication.UnicodeUTF8), QtGui.QApplication.translate("equipment", "Rendimiento", None, QtGui.QApplication.UnicodeUTF8)])
        for i in range(len(self.entrada.solido.distribucion)):
            self.Rendimientos.setRowHeight(i, 22)
            self.Rendimientos.setItem(i, 0, QtGui.QTableWidgetItem(representacion(1e6*self.entrada.solido.diametros[i])))
            self.Rendimientos.item(i, 0).setTextAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignVCenter)
            self.Rendimientos.item(i, 0).setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEnabled)
            self.Rendimientos.setItem(i, 1, QtGui.QTableWidgetItem(""))
            self.Rendimientos.item(i, 1).setTextAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignVCenter)

    def cambiarRendimientos(self, fila, columna):
        numero=float(self.Rendimientos.item(fila, columna).text())
        if numero<0 or numero >1:
            self.Rendimientos.item(fila, columna).setText("")
        else:
            if self.rendimientos==[]:
                self.rendimientos=[0]*self.Rendimientos.rowCount()
            self.rendimientos[fila]=numero

    def todos_datos(self):
        if self.TipoCalculo.currentIndex()==0:
            todos_datos=self.numFiltros.value and self.tiempo.value
        elif self.TipoCalculo.currentIndex()==1:
            todos_datos=self.numFiltros.value and self.deltaP.value
        else:
            todos_datos=self.tiempo.value and self.deltaP.value
        return todos_datos and self.Entrada.todos_datos()

    def calculo(self):
        if self.todos_datos():
            if self.Limpieza.value==self.numFiltros.value:
                self.status.setState(5, QtGui.QApplication.translate("equipment", "Todos los filtros en limpieza", None, QtGui.QApplication.UnicodeUTF8))
            else:
                self.status.setState(4)
                self.Equipment(entrada=self.entrada, metodo=self.TipoCalculo.currentIndex(), num_filtros=self.numFiltros.value, tiempo=self.tiempo.value, deltaP=self.deltaP.value.atm, resistenciaFiltro=self.resistenciaFiltro.value, resistenciaTorta=self.resistenciaTorta.value, limpieza=self.Limpieza.value, membranasFiltro=self.MembranaCelda.value, diametroMembrana=self.Diametro.value, areaMembrana=self.Area.value, rendimientos=self.rendimientos)
                self.rellenoSalida()
                if self.rendimientos==[]:
                    self.status.setState(3, QtGui.QApplication.translate("equipment", "Usando rendimiento por defecto", None, QtGui.QApplication.UnicodeUTF8))
                else:
                    self.status.setState(1)

    def rellenoSalida(self):
        if self.TipoCalculo.currentIndex()==0:
            self.deltaP.setValue(self.Equipment.deltaP)
        elif self.TipoCalculo.currentIndex()==1:
            self.tiempo.setValue(self.Equipment.tiempo)
        else:
            self.numFiltros.setValue(self.Equipment.num_filtros)

        self.Vgas.setValue(self.Equipment.Vgas)
        self.rendimientoCalculado.setValue(self.Equipment.rendimiento)
        self.superficie.setValue(self.Equipment.floorArea)
        self.SalidaGas.rellenar(self.Equipment.SalidaAire)
        self.SalidaSolido.rellenar(self.Equipment.SalidaSolido)


    def tipoCalculoCambiado(self, tipo_calculo):
        if tipo_calculo==0:
            self.numFiltros.setReadOnly(False)
            self.numFiltros.setRetornar(True)
            self.numFiltros.setResaltado(True)
            self.tiempo.setReadOnly(False)
            self.tiempo.setRetornar(True)
            self.tiempo.setResaltado(True)
            self.deltaP.setReadOnly(True)
            self.deltaP.setRetornar(False)
            self.deltaP.setResaltado(False)
        elif tipo_calculo==1:
            self.numFiltros.setReadOnly(False)
            self.numFiltros.setRetornar(True)
            self.numFiltros.setResaltado(True)
            self.tiempo.setReadOnly(True)
            self.tiempo.setRetornar(False)
            self.tiempo.setResaltado(False)
            self.deltaP.setReadOnly(False)
            self.deltaP.setRetornar(True)
            self.deltaP.setResaltado(True)
        else:
            self.numFiltros.setReadOnly(True)
            self.numFiltros.setRetornar(False)
            self.numFiltros.setResaltado(False)
            self.tiempo.setReadOnly(False)
            self.tiempo.setRetornar(True)
            self.tiempo.setResaltado(True)
            self.deltaP.setReadOnly(False)
            self.deltaP.setRetornar(True)
            self.deltaP.setResaltado(True)
开发者ID:edusegzy,项目名称:pychemqt,代码行数:104,代码来源:UI_vacuum.py

示例15: UI_equipment

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setReadOnly [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


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