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


Python Entrada_con_unidades.setValue方法代码示例

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


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

示例1: CalculateDialog

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setValue [as 别名]
class CalculateDialog(QtWidgets.QDialog):
    """Dialog to calculate a specified point"""
    def __init__(self, parent=None):
        super(CalculateDialog, self).__init__(parent)
        title = QtWidgets.QApplication.translate(
            "pychemqt", "Calculate friction factor")
        self.setWindowTitle(title)
        layout = QtWidgets.QGridLayout(self)
        label = QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Method:"))
        layout.addWidget(label, 1, 0)
        self.metodos = QtWidgets.QComboBox()
        for f in f_list:
            line = f.__doc__.split("\n")[1]
            year = line.split(" ")[-1]
            name = line.split(" ")[-3]
            doc = name + " " + year
            self.metodos.addItem(doc)
        self.metodos.currentIndexChanged.connect(self.calculate)
        layout.addWidget(self.metodos, 1, 1, 1, 2)
        self.fanning = QtWidgets.QCheckBox(QtWidgets.QApplication.translate(
            "pychemqt", "Calculate fanning friction factor"))
        self.fanning.toggled.connect(self.calculate)
        layout.addWidget(self.fanning, 2, 0, 1, 3)

        layout.addWidget(QtWidgets.QLabel("Re"), 3, 1)
        self.Re = Entrada_con_unidades(float, tolerancia=4)
        self.Re.valueChanged.connect(self.calculate)
        layout.addWidget(self.Re, 3, 2)
        layout.addWidget(QtWidgets.QLabel("e/D"), 4, 1)
        self.eD = Entrada_con_unidades(float)
        self.eD.valueChanged.connect(self.calculate)
        layout.addWidget(self.eD, 4, 2)
        layout.addWidget(QtWidgets.QLabel("f"), 5, 1)
        self.f = Entrada_con_unidades(float, readOnly=True, decimales=8)
        layout.addWidget(self.f, 5, 2)

        self.buttonBox = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Close)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        layout.addWidget(self.buttonBox, 10, 1, 1, 2)

    def calculate(self, value):
        index = self.metodos.currentIndex()
        F = f_list[index]
        Re = self.Re.value
        eD = self.eD.value
        if Re and eD is not None:
            f = F(Re, eD)
            if self.fanning.isChecked():
                f /= 4
            self.f.setValue(f)
开发者ID:bkt92,项目名称:pychemqt,代码行数:55,代码来源:moody.py

示例2: CalculateDialog

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setValue [as 别名]
class CalculateDialog(QtWidgets.QDialog):
    """Dialog to calculate a specified point"""
    def __init__(self, parent=None):
        super(CalculateDialog, self).__init__(parent)
        title = QtWidgets.QApplication.translate(
            "pychemqt", "Calculate compressibility factor of natural gas")
        self.setWindowTitle(title)
        layout = QtWidgets.QGridLayout(self)
        label = QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Method:"))
        layout.addWidget(label, 1, 0)
        self.method = QtWidgets.QComboBox()
        for Z in Z_list:
            name = Z.__name__[2:].replace("_", "-")
            year = re.search("((\d+))", Z.__doc__).group(0)
            doc = "%s (%s)" % (name, year)
            self.method.addItem(doc)

        self.method.currentIndexChanged.connect(self.calculate)
        layout.addWidget(self.method, 1, 1, 1, 2)

        layout.addWidget(QtWidgets.QLabel("Tr"), 2, 1)
        self.Tr = Entrada_con_unidades(float, tolerancia=4)
        self.Tr.valueChanged.connect(self.calculate)
        layout.addWidget(self.Tr, 2, 2)
        layout.addWidget(QtWidgets.QLabel("Pr"), 3, 1)
        self.Pr = Entrada_con_unidades(float)
        self.Pr.valueChanged.connect(self.calculate)
        layout.addWidget(self.Pr, 3, 2)
        layout.addWidget(QtWidgets.QLabel("Z"), 4, 1)
        self.Z = Entrada_con_unidades(float, readOnly=True, decimales=8)
        layout.addWidget(self.Z, 4, 2)

        self.buttonBox = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Close)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        layout.addWidget(self.buttonBox, 10, 1, 1, 2)

    def calculate(self, value):
        index = self.method.currentIndex()
        Z = Z_list[index]
        Tr = self.Tr.value
        Pr = self.Pr.value
        if Pr and Tr is not None:
            z = Z(Tr, Pr)
            self.Z.setValue(z)
开发者ID:bkt92,项目名称:pychemqt,代码行数:49,代码来源:standing.py

示例3: UI_equipment

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

#.........这里部分代码省略.........
            20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding),
            15, 1, 1, 6)

        # Cost tab
        lyt = QtWidgets.QGridLayout(self.tabCostos)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Type")), 1, 1)
        self.tipoCoste = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_COST_TYPE:
            self.tipoCoste.addItem(txt)
        self.tipoCoste.currentIndexChanged.connect(
            partial(self.changeParamsCoste, "tipoCoste"))
        lyt.addWidget(self.tipoCoste, 1, 2)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Material")), 2, 1)
        self.materialCoste = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_COST_MATERIAL:
            self.materialCoste.addItem(txt)
        self.materialCoste.currentIndexChanged.connect(
            partial(self.changeParamsCoste, "P_dis"))
        lyt.addWidget(self.materialCoste, 2, 2)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding),
            3, 0, 1, 6)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Design Pressure")), 4, 1)
        self.Pdiseno = Entrada_con_unidades(Pressure)
        lyt.addWidget(self.Pdiseno, 4, 2, 1, 1)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding),
            5, 0, 1, 6)

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

        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding),
            8, 0, 1, 6)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding),
            10, 0, 1, 6)
        group = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Stimated Costs"))
        lyt.addWidget(group, 9, 1, 1, 5)
        layout = QtWidgets.QGridLayout(group)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Purchase Cost")), 0, 1)
        self.C_adq = Entrada_con_unidades(
            Currency, retornar=False, readOnly=True)
        layout.addWidget(self.C_adq, 0, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Installed Cost")), 1, 1)
        self.C_inst = Entrada_con_unidades(
            Currency, retornar=False, readOnly=True)
        self.C_inst.entrada.setReadOnly(True)
        layout.addWidget(self.C_inst, 1, 2)

        # Output Tab
        self.addSalida(QtWidgets.QApplication.translate("pychemqt", "Tubes"))
        self.addSalida(QtWidgets.QApplication.translate("pychemqt", "Shell"))

        if equipment:
            self.setEquipment(equipment)

    def selectMethods(self):
        """Show dialog for select calculation methods"""
        dialogo = Dialog_Methods(self.Equipment)
        if dialogo.exec_():
            self.Equipment(**dialogo.kwargs)

    def showMaterial(self):
        dialogo = Catalogo_Materiales_Dialog()
        if dialogo.exec_():
            pass

    def rellenarFouling(self, widget, txt):
        if txt:
            widget.setReadOnly(True)
            widget.setValue(Fouling_Factor_Shell_Tube_Exchanger[str(txt)])
        else:
            widget.setReadOnly(False)

    def finnedChanged(self, ind):
        self.buttonFin.setEnabled(ind)
        self.changeParams("finned", ind)

    def showFinTube(self):
        dialogo = Dialog_Finned()
        if dialogo.exec_():
            pass

    def rellenar(self):
        pass

    def calcularCostos(self):
        if self.todos_datos():
            self.Equipment.Coste(self.factorInstalacion.value(), 0, self.tipo.currentIndex(), self.material.currentIndex())
            self.C_adq.setValue(self.Equipment.C_adq.config())
            self.C_inst.setValue(self.Equipment.C_inst.config())
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:104,代码来源:UI_shellTube.py

示例4: UI_reacciones

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

#.........这里部分代码省略.........
        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])

        self.Estequiometria.setColumn(0, self.reaction.kwargs["coeficientes"])
#        self.Conversion.setColumn(0, self.reaction.estequiometria[-1::-1])
        self.blockSignals(False)

        self.status.setState(self.reaction.status, self.reaction.msg)
        self.Estequiometria.item(len(self.indices), 0).setText(str(self.reaction.error))
        if self.reaction.status:
            self.Formula.setText(self.reaction._txt())
            self.Hr.setValue(self.reaction.Hr)

    def KeqChanged(self):
        self.Keq.setReadOnly(not self.check_KFijo.isChecked())
        self.KEq_Dat.setEnabled(self.check_KEq.isChecked())
        self.KEq_Tab.setEnabled(self.check_KTabla.isChecked())
        self.botonTablaClear.setEnabled(self.check_KTabla.isChecked())
        self.botonTablaPlot.setEnabled(self.check_KTabla.isChecked())

    def Regresion(self):
        t=array(self.KEq_Tab.getColumn(0)[:-1])
        k=array(self.KEq_Tab.getColumn(1)[:-1])
        if len(t)>=4:
            if 4<=len(t)<8:
                inicio=r_[0, 0, 0, 0]
                f=lambda par, T: exp(par[0]+par[1]/T+par[2]*log(T)+par[3]*T)
                resto=lambda par, T, k: k-f(par, T)
            else:
                inicio=r_[0, 0, 0, 0, 0, 0, 0, 0]
                f=lambda par, T: exp(par[0]+par[1]/T+par[2]*log(T)+par[3]*T+par[4]*T**2+par[5]*T**3+par[6]*T**4+par[7]*T**5)
                resto=lambda par, T, k: k-f(par, T)

            ajuste=leastsq(resto,inicio,args=(t, k))
            kcalc=f(ajuste[0], t)
            error=(k-kcalc)/k*100
            self.KEq_Dat.setColumn(0, ajuste[0])
            self.KEq_Tab.setColumn(2, kcalc)
            self.KEq_Tab.setColumn(3, error)

            if ajuste[1] in [1, 2, 3, 4]:
                self.ajuste=ajuste[0]

    def Plot(self):
        if self.ajuste!=None:
            t=array(self.KEq_Tab.getColumn(0)[:-1])
            k=array(self.KEq_Tab.getColumn(1)[:-1])
            if 4<=len(t)<8:
                f=lambda par, T: exp(par[0]+par[1]/T+par[2]*log(T)+par[3]*T)
            else:
                f=lambda par, T: exp(par[0]+par[1]/T+par[2]*log(T)+par[3]*T+par[4]*T**2+par[5]*T**3+par[6]*T**4+par[7]*T**5)

            grafico=plot.Plot()
            grafico.data(t, k, 'ro', t, f(self.ajuste, t))
            grafico.exec_()
开发者ID:bkt92,项目名称:pychemqt,代码行数:104,代码来源:UI_reactor.py

示例5: View_Petro

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

#.........这里部分代码省略.........
        layout.addWidget(self.pour, 4, 8)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Aniline point")), 5, 7)
        self.aniline = Entrada_con_unidades(unidades.Temperature)
        layout.addWidget(self.aniline, 5, 8)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Freezing point")), 6, 7)
        self.freezing = Entrada_con_unidades(unidades.Temperature)
        layout.addWidget(self.freezing, 6, 8)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Cloud point")), 7, 7)
        self.cloud = Entrada_con_unidades(unidades.Temperature)
        layout.addWidget(self.cloud, 7, 8)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Smoke point")), 8, 7)
        self.smoke = Entrada_con_unidades(unidades.Length)
        layout.addWidget(self.smoke, 8, 8)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Flash point (open)")), 9, 7)
        self.flashOpen = Entrada_con_unidades(unidades.Temperature)
        layout.addWidget(self.flashOpen, 9, 8)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Flash point (closed)")), 10, 7)
        self.flashClosed = Entrada_con_unidades(unidades.Temperature)
        layout.addWidget(self.flashClosed, 10, 8)

        layout.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 15, 8)
        button = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Close)
        button.rejected.connect(self.reject)
        layout.addWidget(button, 16, 1, 1, 8)

        self.setReadOnly(True)
        if petroleo:
            self.rellenar(petroleo)

    def setReadOnly(self, bool):
        self.M.setReadOnly(bool)
        self.Tb.setReadOnly(bool)
        self.gravity.setReadOnly(bool)
        self.API.setReadOnly(bool)
        self.watson.setReadOnly(bool)

        self.Tc.setReadOnly(bool)
        self.Pc.setReadOnly(bool)
        self.Vc.setReadOnly(bool)
        self.Zc.setReadOnly(bool)
        self.f_acent.setReadOnly(bool)
        self.refractivity.setReadOnly(bool)
        self.CH.setReadOnly(bool)
        self.S.setReadOnly(bool)
        self.H.setReadOnly(bool)

        self.n.setReadOnly(bool)
        self.I.setReadOnly(bool)
        self.cetane.setReadOnly(bool)
        self.aniline.setReadOnly(bool)
        self.cloud.setReadOnly(bool)
        self.pour.setReadOnly(bool)
        self.freezing.setReadOnly(bool)
        self.smoke.setReadOnly(bool)
        self.v100.setReadOnly(bool)
        self.v210.setReadOnly(bool)
        self.VGC.setReadOnly(bool)
        self.flashOpen.setReadOnly(bool)
        self.flashClosed.setReadOnly(bool)

    def rellenar(self, petroleo):
        self.nombre.setText(petroleo.name)
        self.M.setValue(petroleo.M)
        self.Tb.setValue(petroleo.Tb)
        self.gravity.setValue(petroleo.SG)
        self.API.setValue(petroleo.API)
        self.watson.setValue(petroleo.Kw)

        self.Tc.setValue(petroleo.Tc)
        self.Pc.setValue(petroleo.Pc)
        self.Vc.setValue(petroleo.Vc)
        self.Zc.setValue(petroleo.Zc)
        self.f_acent.setValue(petroleo.f_acent)
        self.refractivity.setValue(petroleo.Ri)
        self.CH.setValue(petroleo.CH)
        self.S.setValue(petroleo.S)
        self.H.setValue(petroleo.H)

        self.n.setValue(petroleo.n)
        self.I.setValue(petroleo.I)
        self.cetane.setValue(petroleo.CetaneI)
        self.aniline.setValue(petroleo.AnilineP)
        self.cloud.setValue(petroleo.CloudP)
        self.pour.setValue(petroleo.PourP)
        self.freezing.setValue(petroleo.FreezingP)
        self.smoke.setValue(petroleo.SmokeP)
        self.v100.setValue(petroleo.v100)
        self.v210.setValue(petroleo.v210)
        # self.VGC.setValue(petroleo.VGC)
        if petroleo.hasCurve:
            self.flashOpen.setValue(petroleo.self.FlashPo)
            self.flashClosed.setValue(petroleo.self.FlashPc)
开发者ID:bkt92,项目名称:pychemqt,代码行数:104,代码来源:petro.py

示例6: Dialog_Finned

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setValue [as 别名]
class Dialog_Finned(QtGui.QDialog):
    """Dialog to define finned tube properties"""
    def __init__(self, kwarg=None, parent=None):
        super(Dialog_Finned, self).__init__(parent=parent)
        self.setWindowTitle(QtGui.QApplication.translate(
            "pychemqt", "Specify tube finned characteristics"))
        layout = QtGui.QGridLayout(self)
        self.listTube = QtGui.QComboBox()
        self.listTube.addItem("")
        layout.addWidget(self.listTube, 0, 1, 1, 2)

        layout.addItem(QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed,
                                         QtGui.QSizePolicy.Fixed), 1, 1, 1, 2)
        layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Material")), 2, 1)
        self.listMaterial = QtGui.QComboBox()
        self.listMaterial.addItem("")
        self.listMaterial.addItem(QtGui.QApplication.translate(
            "pychemqt", "Carbon Steel"))
        layout.addWidget(self.listMaterial, 2, 2)
        layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Thermal Conductivity")), 3, 1)
        self.kFin = Entrada_con_unidades(ThermalConductivity)
        layout.addWidget(self.kFin, 3, 2)
        layout.addItem(QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed,
                                         QtGui.QSizePolicy.Fixed), 4, 1, 1, 2)

        layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Root diameter")), 5, 1)
        self.RootD = Entrada_con_unidades(Length, "PipeDiameter")
        layout.addWidget(self.RootD, 5, 2)
        layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Fin Height")), 6, 1)
        self.hFin = Entrada_con_unidades(Length, "Thickness")
        layout.addWidget(self.hFin, 6, 2)
        layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Base Fin Thickness")), 7, 1)
        self.BaseThickness = Entrada_con_unidades(Length, "Thickness")
        layout.addWidget(self.BaseThickness, 7, 2)
        layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Top Fin Thickness")), 8, 1)
        self.TopThickness = Entrada_con_unidades(Length, "Thickness")
        layout.addWidget(self.TopThickness, 8, 2)
        layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate(
            "pychemqt", "Number of fins")), 9, 1)
        self.Nfin = Entrada_con_unidades(float, textounidad="fins/m")
        layout.addWidget(self.Nfin, 9, 2)

        self.buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Cancel |
                                                QtGui.QDialogButtonBox.Ok)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        layout.addWidget(self.buttonBox, 10, 1, 1, 2)

        for tuberia in finnedTube_database:
            self.listTube.addItem("%s %s" % (tuberia[0], tuberia[1]))
        self.listTube.currentIndexChanged.connect(self.rellenarData)
        self.listTube.currentIndexChanged.connect(self.setDisabled)

        if kwarg:
            self.hFin.setValue(kwarg["hFin"])
            self.BaseThickness.setValue(kwarg["thicknessBaseFin"])
            self.TopThickness.setValue(kwarg["thicknessTopFin"])
            self.kFin.setValue(kwarg["kFin"])
            self.Nfin.setValue(kwarg["nFin"])
            self.RootD.setValue(kwarg["rootDoFin"])

    def rellenarData(self, ind):
        tuberia = finnedTube_database[ind-1]
        if tuberia[0] == "HPT":
            self.Nfin.setValue(int(tuberia[1][:2]))
            self.BaseThickness.setValue(tuberia[12]/1000.)
            self.TopThickness.setValue(tuberia[12]/1000.)
            self.RootD.setValue(tuberia[6]/1000.)
            self.hFin.setValue(tuberia[13]/1000.)

    def setDisabled(self, bool):
        self.RootD.setReadOnly(bool)
        self.BaseThickness.setReadOnly(bool)
        self.TopThickness.setReadOnly(bool)
        self.Nfin.setReadOnly(bool)
        self.hFin.setReadOnly(bool)

    def kwarg(self):
        kwarg = {"hFin": self.hFin.value,
                 "thicknessBaseFin": self.BaseThickness.value,
                 "thicknessTopFin": self.TopThickness.value,
                 "kFin": self.kFin.value,
                 "nFin": self.Nfin.value,
                 "rootDoFin": self.RootD.value}
        return kwarg
开发者ID:edusegzy,项目名称:pychemqt,代码行数:93,代码来源:widget.py

示例7: UI_equipment

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setValue [as 别名]
class UI_equipment(UI_equip):
    """Diálogo de definición de tamices de sólidos"""
    Equipment=Screen()
    def __init__(self, equipment=None, parent=None):
        """
        equipment: instancia de equipo inicial
        """
        super(UI_equipment, self).__init__(Screen, entrada=False, parent=parent)

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

        #Pestaña calculo
        gridLayout_Calculo = QtWidgets.QGridLayout(self.tabCalculo)

        #Pestaña costos
        gridLayout_Costos = QtWidgets.QGridLayout(self.tabCostos)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Area:", None)), 1, 1, 1, 1)
        self.Area=Entrada_con_unidades(unidades.Area)
        self.Area.valueChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.Area, 1, 2, 1, 1)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),2,0,1,2)

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

        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),6,0,1,6)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),10,0,1,6)
        self.groupBox_Costos = QtWidgets.QGroupBox(QtWidgets.QApplication.translate("equipment", "Costos calculados", None))
        gridLayout_Costos.addWidget(self.groupBox_Costos,7,0,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.SalidaGas= UI_corriente.Ui_corriente(readOnly=True)
        self.SalidaSolido= UI_corriente.Ui_corriente(readOnly=True)
        self.Salida.addTab(self.SalidaGas,QtWidgets.QApplication.translate("equipment", "Gas filtrado", None))
        self.Salida.addTab(self.SalidaSolido,QtWidgets.QApplication.translate("equipment", "Sólidos recogidos", None))

        self.tabWidget.setCurrentIndex(0)


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

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

            self.rellenoSalida()

    def calcularCostos(self):
        if self.todos_datos():
            if self.tipo.currentIndex()==0:
                self.FireHeater.Coste(self.factorInstalacion.value(), 0, self.tipobox.currentIndex(), self.material.currentIndex())
            else:
                self.FireHeater.Coste(self.factorInstalacion.value(), 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,代码行数:69,代码来源:UI_screen.py

示例8: UI_equipment

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

#.........这里部分代码省略.........
        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)
        layout.addWidget(self.CF, 2, 8)

        lyt.addItem(QtWidgets.QSpacerItem(
            0, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            17, 1, 1, 6)

        # Cost tab
        lyt = QtWidgets.QGridLayout(self.tabCostos)
        lyt.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Material")), 2, 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, 2, 2)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 3, 0, 1, 6)
        lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Design Pressure")), 4, 1)
        self.P_dis = Entrada_con_unidades(Pressure)
        self.P_dis.valueChanged.connect(
            partial(self.changeParamsCoste, "P_dis"))
        lyt.addWidget(self.P_dis, 4, 2, 1, 1)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 5, 0, 1, 6)

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

        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 8, 0, 1, 6)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 10, 0, 1, 6)
        group = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Stimated Costs"))
        lyt.addWidget(group, 9, 1, 1, 5)
        layout = QtWidgets.QGridLayout(group)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Purchase Cost")), 0, 1)
        self.C_adq = Entrada_con_unidades(Currency, retornar=False)
        self.C_adq.setReadOnly(True)
        layout.addWidget(self.C_adq, 0, 2)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Installed Cost")), 1, 1)
        self.C_inst = Entrada_con_unidades(Currency, retornar=False)
        self.C_inst.setReadOnly(True)
        self.C_inst.entrada.setReadOnly(True)
        layout.addWidget(self.C_inst, 1, 2)

        # Output Tab
        self.addSalida(QtWidgets.QApplication.translate("pychemqt", "Tube"))
        self.addSalida(QtWidgets.QApplication.translate("pychemqt", "Annulli"))

        if equipment:
            self.setEquipment(equipment)

    def showMaterial(self):
        dialogo = Catalogo_Materiales_Dialog()
        if dialogo.exec_():
            material = dialogo.getMaterial()
            if material:
                self.rTube.setValue(material[2])
                self.DiTube.setValue(material[4])
                self.wTube.setValue(material[5])
                self.DeTube.setValue(material[6])

    def showFinTube(self):
        dialogo = Dialog_Finned(self.Equipment.kwargs)
        if dialogo.exec_():
            kwarg = dialogo.kwarg()
            self.calculo(**kwarg)
开发者ID:bkt92,项目名称:pychemqt,代码行数:104,代码来源:UI_hairpin.py

示例9: CostData

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setValue [as 别名]
class CostData(QtWidgets.QWidget):
    """Common widget to equipment with cost section
    It have property to easy access to properties:
        factor: install factor
        base: base index (January 1982)
        actual: current index
        values: a tuple with all properties, (factor, base,actual)
    """
    valueChanged = QtCore.pyqtSignal(str, float)

    def __init__(self, equipment, parent=None):
        """constructor
        equipment: equipment class where the widget have to be put, define
        indiceCostos as a index in costIndex"""
        super(CostData, self).__init__(parent)
        self.indice = equipment.indiceCostos
        factor = equipment.kwargs["f_install"]
        gridLayout = QtWidgets.QGridLayout(self)
        gridLayout.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding),
            1, 0, 1, 7)
        gridLayout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Instalation factor:")), 2, 0, 1, 1)
        self.factorInstalacion = Entrada_con_unidades(
            float, spinbox=True, decimales=1, step=0.1, width=50, value=factor)
        self.factorInstalacion.valueChanged.connect(partial(
            self.valueChanged.emit, "f_install"))
        gridLayout.addWidget(self.factorInstalacion, 2, 1, 1, 1)
        gridLayout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Base index:")), 2, 4, 1, 1)
        self.indiceBase = Entrada_con_unidades(
            float, readOnly=True, value=indiceBase[self.indice], decimales=1)
        gridLayout.addWidget(self.indiceBase, 2, 5, 1, 1)
        gridLayout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Current index:")), 3, 4, 1, 1)
        self.indiceActual = Entrada_con_unidades(
            float, readOnly=True, colorReadOnly="white",
            value=indiceActual[self.indice], decimales=1)
        gridLayout.addWidget(self.indiceActual, 3, 5, 1, 1)
        self.costIndex = QtWidgets.QToolButton()
        self.costIndex.setFixedSize(QtCore.QSize(24, 24))
        self.costIndex.clicked.connect(self.on_costIndex_clicked)
        self.costIndex.setText("...")
        self.costIndex.setVisible(False)
        gridLayout.addWidget(self.costIndex, 3, 5, 1, 1)
        gridLayout.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding),
            4, 0, 1, 7)

    def on_costIndex_clicked(self):
        """Show costIndes dialog to show/change"""
        dialog = Ui_CostIndex()
        if dialog.exec_():
            with open(config.conf_dir+"CostIndex.dat", "r") as archivo:
                self.indiceActual.setValue(
                    float(archivo.readlines()[self.indice][:-1]))
            self.valueChanged.emit("Current_index", self.indiceActual.value)

    def enterEvent(self, event):
        self.costIndex.setVisible(True)

    def leaveEvent(self, event):
        self.costIndex.setVisible(False)

    @property
    def factor(self):
        return self.factorInstalacion.value

    @property
    def base(self):
        return self.indiceBase.value

    @property
    def actual(self):
        return self.indiceActual.value

    @property
    def values(self):
        return self.factorInstalacion.value, self.indiceBase.value,\
            self.indiceActual.value

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

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

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

    def setValues(self, factor, base, actual):
        self.factorInstalacion.setValue(factor)
        self.indiceBase.setValue(base)
        self.indiceActual.setValue(actual)
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:96,代码来源:costIndex.py

示例10: Isolinea

# 需要导入模块: from UI.widgets import Entrada_con_unidades [as 别名]
# 或者: from UI.widgets.Entrada_con_unidades import setValue [as 别名]
class Isolinea(QtWidgets.QDialog):
    """Widget for isoline configuration for mEoS plot tools"""
    def __init__(self, unit, ConfSection, config, section="MEOS", parent=None):
        """Constructor
            unit: subclass of unidad to define the isoline type
            ConfSection: title of isoline
            config: config of pychemqt project
        """
        super(Isolinea, self).__init__(parent)
        self.ConfSection = ConfSection
        self.magnitud = unit.__name__
        self.unidad = unit
        self.section = section
        layout = QtWidgets.QGridLayout(self)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Start")), 1, 1)
        self.inicio = Entrada_con_unidades(unit)
        layout.addWidget(self.inicio, 1, 2, 1, 3)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Fin")), 2, 1)
        self.fin = Entrada_con_unidades(unit)
        layout.addWidget(self.fin, 2, 2, 1, 3)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Intervalo")), 3, 1)
        if unit.__name__ == "Temperature":
            self.intervalo = Entrada_con_unidades(unidades.DeltaT)
        elif unit.__name__ == "Pressure":
            self.intervalo = Entrada_con_unidades(unidades.DeltaP)
        else:
            self.intervalo = Entrada_con_unidades(unit)
        layout.addWidget(self.intervalo, 3, 2, 1, 3)
        self.Personalizar = QtWidgets.QCheckBox(
            QtWidgets.QApplication.translate("pychemqt", "Customize"))
        layout.addWidget(self.Personalizar, 4, 1, 1, 4)
        self.Lista = QtWidgets.QLineEdit()
        layout.addWidget(self.Lista, 5, 1, 1, 4)
        self.Personalizar.toggled.connect(self.inicio.setDisabled)
        self.Personalizar.toggled.connect(self.fin.setDisabled)
        self.Personalizar.toggled.connect(self.intervalo.setDisabled)
        self.Personalizar.toggled.connect(self.Lista.setEnabled)
        layout.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            6, 1, 1, 4)
        if unit.__name__ != "float" and section != "Psychr":
            self.Critica = QtWidgets.QCheckBox(
                QtWidgets.QApplication.translate(
                    "pychemqt", "Include critic point line"))
            layout.addWidget(self.Critica, 7, 1, 1, 4)
        layout.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            8, 1, 1, 4)

        self.lineconfig = LineConfig(
            ConfSection,
            QtWidgets.QApplication.translate("pychemqt", "Line Style"))
        layout.addWidget(self.lineconfig, 9, 1, 1, 4)

        layout.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            10, 1)
        self.label = QtWidgets.QCheckBox(
            QtWidgets.QApplication.translate("pychemqt", "Label"))
        layout.addWidget(self.label, 11, 1)
        self.variable = QtWidgets.QCheckBox(
            QtWidgets.QApplication.translate("pychemqt", "Variable in Label"))
        layout.addWidget(self.variable, 12, 1, 1, 4)
        self.unit = QtWidgets.QCheckBox(
            QtWidgets.QApplication.translate("pychemqt", "Units in Label"))
        layout.addWidget(self.unit, 13, 1, 1, 4)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Position")), 14, 1)
        self.label5 = Entrada_con_unidades(int, value=0, width=25, frame=False,
                                           readOnly=True)
        self.label5.setFixedWidth(30)
        layout.addWidget(self.label5, 14, 2)
        self.Posicion = QtWidgets.QSlider(QtCore.Qt.Horizontal)
        self.Posicion.valueChanged.connect(self.label5.setValue)
        layout.addWidget(self.Posicion, 14, 3, 1, 2)
        layout.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 15, 4)

        if config.has_section(section):
            self.inicio.setValue(config.getfloat(section, ConfSection+'Start'))
            self.fin.setValue(config.getfloat(section, ConfSection+'End'))
            self.intervalo.setValue(
                config.getfloat(section, ConfSection+'Step'))
            self.Personalizar.setChecked(
                config.getboolean(section, ConfSection+'Custom'))
            if config.get(section, ConfSection+'List') != "":
                T = []
                for i in config.get(section, ConfSection+'List').split(','):
                    if unit.__name__ == "float":
                        T.append(representacion(float(i)))
                    else:
                        T.append(representacion(unit(float(i)).config()))
                self.Lista.setText(",".join(T))
            if unit.__name__ != "float" and section != "Psychr":
                self.Critica.setChecked(
                    config.getboolean(section, ConfSection+'Critic'))
#.........这里部分代码省略.........
开发者ID:bkt92,项目名称:pychemqt,代码行数:103,代码来源:prefMEOS.py

示例11: UI_equipment

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

#.........这里部分代码省略.........
        self.materialPisos.addItem(QtWidgets.QApplication.translate("equipment", "Titanio", None))
        self.materialPisos.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_1.addWidget(self.materialPisos, 2, 2, 1, 1)
        gridLayout_1.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),3,1,1,2)
        gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Diametro:", None)), 4, 1, 1, 1)
        self.diametroPisos=Entrada_con_unidades(unidades.Length)
        gridLayout_1.addWidget(self.diametroPisos,4,2,1,1)
        gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Número:", None)), 5, 1, 1, 1)
        self.NumeroPisos=Entrada_con_unidades(int, spinbox=True, min=1, step=1, width=50)
        gridLayout_1.addWidget(self.NumeroPisos,5,2,1,1)
        gridLayout_1.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),6,1,1,2)

        self.groupBox_relleno = QtWidgets.QGroupBox(QtWidgets.QApplication.translate("equipment", "Torre de relleno", None))
        gridLayout_Costos.addWidget(self.groupBox_relleno,1, 4, 4, 2)
        gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_relleno)
        gridLayout_2.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Volumen:", None)), 1, 1, 1, 1)
        self.VolumenRelleno=Entrada_con_unidades(unidades.Volume, "VolLiq")
        gridLayout_2.addWidget(self.VolumenRelleno,1,2,1,1)
        gridLayout_2.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste unitario:", None)),2,1,1,1)
        self.C_unit_relleno=Entrada_con_unidades(unidades.Currency, retornar=False, textounidad="%s / %s" % (unidades.Currency(None).text(), unidades.Volume(None).text("VolLiq")))
        gridLayout_2.addWidget(self.C_unit_relleno,2,2,1,1)
        gridLayout_2.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),3,1,1,2)

        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Diametro:", None)),5,1,1,1)
        self.Dc=Entrada_con_unidades(unidades.Length)
        gridLayout_Costos.addWidget(self.Dc,5,2,1,2)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Altura:", None)), 6, 1, 1, 1)
        self.Hc=Entrada_con_unidades(unidades.Length)
        gridLayout_Costos.addWidget(self.Hc,6,2,1,2)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Espesor (Tapa):", None)), 7, 1, 1, 1)
        self.EspesorSuperior=Entrada_con_unidades(unidades.Length, "Thickness")
        gridLayout_Costos.addWidget(self.EspesorSuperior,7,2,1,2)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Espesor (Fondo):", None)), 8, 1, 1, 1)
        self.EspesorInferior=Entrada_con_unidades(unidades.Length, "Thickness")
        gridLayout_Costos.addWidget(self.EspesorInferior,8,2,1,2)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Densidad:", None)), 9, 1, 1, 1)
        self.EspesorInferior=Entrada_con_unidades(unidades.Density, "DenLiq")
        gridLayout_Costos.addWidget(self.EspesorInferior,9,2,1,2)

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

        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),12,1,1,6)

        self.groupBox_Costos = QtWidgets.QGroupBox(QtWidgets.QApplication.translate("equipment", "Costos calculados", None))
        gridLayout_Costos.addWidget(self.groupBox_Costos,13,1,1,5)
        gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_Costos)
        gridLayout_5.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Pisos:", None)),0,1,1,1)
        self.C_pisos=Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True)
        gridLayout_5.addWidget(self.C_pisos,0,2,1,1)
        gridLayout_5.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Carcasa:", None)),1,1,1,1)
        self.C_carcasa=Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True)
        gridLayout_5.addWidget(self.C_carcasa,1,2,1,1)
        gridLayout_5.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Accesorios:", None)),2,1,1,1)
        self.C_accesorios=Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True)
        gridLayout_5.addWidget(self.C_accesorios,2,2,1,1)
        gridLayout_5.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Columna:", None)),0,4,1,1)
        self.C_columna=Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True)
        gridLayout_5.addWidget(self.C_columna,0,5,1,1)
        gridLayout_5.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Adquisición:", None)),1,4,1,1)
        self.C_adq=Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True)
        gridLayout_5.addWidget(self.C_adq,1,5,1,1)
        gridLayout_5.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Instalación:", None)),2,4,1,1)
        self.C_inst=Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True)
        gridLayout_5.addWidget(self.C_inst,2,5,1,1)


#        #Pestaña salida
#        self.pSalida = QtGui.QTabWidget()
#        self.tabWidget.addTab(self.pSalida,QtGui.QApplication.translate("equipment", "Salida", None, QtGui.QApplication.UnicodeUTF8))


        self.mostrarSubclasificacion(0)


    def mostrarSubclasificacion(self, ind):
        self.groupBox_Pisos.setVisible(not ind)
        self.groupBox_relleno.setVisible(ind)

    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):
        if self.todos_datos():
            self.ShellTube.Coste(self.factorInstalacion.value(), 0, self.tipo.currentIndex(), self.material.currentIndex())
            self.C_adq.setValue(self.ShellTube.C_adq.config())
            self.C_inst.setValue(self.ShellTube.C_inst.config())
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:104,代码来源:UI_tower.py

示例12: UI_equipment

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

#.........这里部分代码省略.........
            )
        )
        self.tipo.addItem(
            QtGui.QApplication.translate(
                "equipment", "Rotary vacuum drum scraper discharge", None, QtGui.QApplication.UnicodeUTF8
            )
        )
        self.tipo.addItem(
            QtGui.QApplication.translate("equipment", "Rotary vacuum disk", None, QtGui.QApplication.UnicodeUTF8)
        )
        self.tipo.addItem(
            QtGui.QApplication.translate("equipment", "Horizontal vacuum belt", None, QtGui.QApplication.UnicodeUTF8)
        )
        self.tipo.addItem(
            QtGui.QApplication.translate("equipment", "Pressure leaf", None, QtGui.QApplication.UnicodeUTF8)
        )
        self.tipo.addItem(
            QtGui.QApplication.translate("equipment", "Plate and frame", None, QtGui.QApplication.UnicodeUTF8)
        )
        self.tipo.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.tipo, 1, 1, 1, 3)
        gridLayout_Costos.addItem(
            QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 2, 0, 1, 2
        )

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

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

        # Pestaña salida
        self.SalidaGas = UI_corriente.Ui_corriente(readOnly=True)
        self.SalidaSolido = UI_corriente.Ui_corriente(readOnly=True)
        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):
        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):
        if self.todos_datos():
            if self.tipo.currentIndex() == 0:
                self.FireHeater.Coste(
                    self.factorInstalacion.value(), 0, self.tipobox.currentIndex(), self.material.currentIndex()
                )
            else:
                self.FireHeater.Coste(
                    self.factorInstalacion.value(), 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:edusegzy,项目名称:pychemqt,代码行数:104,代码来源:UI_filter.py

示例13: UI_equipment

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

示例14: UI_equipment

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

#.........这里部分代码省略.........
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Material:", None)), 1, 1, 1, 1)
        self.material=QtWidgets.QComboBox()
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Acero al carbon", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Acero inoxidable 316", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Acero inoxidable 304", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Acero inoxidable 347", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Niquel", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Monel", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Inconel", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Zirconio", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Titanio", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Ladrillo y caucho o ladrillo y acero recubierto de poliester", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Caucho o acero recubierto de plomo", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Poliester reforzado con fiberglass", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Aluminio", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Cobre", None))
        self.material.addItem(QtWidgets.QApplication.translate("equipment", "Hormigón", None))
        self.material.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.material, 1, 2, 1, 4)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Densidad:", None)), 2, 4, 1, 1)
        self.Densidad=Entrada_con_unidades(unidades.Density, "DenLiq")
        gridLayout_Costos.addWidget(self.Densidad,2,5,1,1)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Diametro:", None)), 2, 1, 1, 1)
        self.Diametro=Entrada_con_unidades(unidades.Length)
        gridLayout_Costos.addWidget(self.Diametro,2,2,1,1)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Longitud:", None)), 3, 1, 1, 1)
        self.Longitud=Entrada_con_unidades(unidades.Length)
        gridLayout_Costos.addWidget(self.Longitud,3,2,1,1)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Espesor:", None)), 4, 1, 1, 1)
        self.Espesor=Entrada_con_unidades(unidades.Length, "Thickness")
        gridLayout_Costos.addWidget(self.Espesor,4,2,1,1)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Cabeza:", None)), 5, 1, 1, 1)
        self.Cabeza=QtWidgets.QComboBox()
        self.Cabeza.addItem(QtWidgets.QApplication.translate("equipment", "Elipsoidal", None))
        self.Cabeza.addItem(QtWidgets.QApplication.translate("equipment", "Semiesférico", None))
        self.Cabeza.addItem(QtWidgets.QApplication.translate("equipment", "Bumped", None))
        self.Cabeza.addItem(QtWidgets.QApplication.translate("equipment", "Liso", None))
        self.Cabeza.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.Cabeza, 5, 2, 1, 1)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Espesor (cabeza):", None)), 6, 1, 1, 1)
        self.EspesorCabeza=Entrada_con_unidades(unidades.Length, "Thickness")
        gridLayout_Costos.addWidget(self.EspesorCabeza,6,2,1,1)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Longitud reborde recto:", None)), 7, 1, 1, 1)
        self.LongitudReborde=Entrada_con_unidades(unidades.Length)
        gridLayout_Costos.addWidget(self.LongitudReborde,7,2,1,1)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Volumen:", None)), 6, 4, 1, 1)
        self.Volumen=Entrada_con_unidades(unidades.Volume, "VolLiq", readOnly=True)
        gridLayout_Costos.addWidget(self.Volumen,6,5,1,1)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Peso:", None)), 7, 4, 1, 1)
        self.Peso=Entrada_con_unidades(unidades.Mass, readOnly=True)
        gridLayout_Costos.addWidget(self.Peso,7,5,1,1)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),2,3,6,1)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),8,0,1,6)

        self.Costos=costIndex.CostData(1.7, 3)
        self.Costos.valueChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.Costos,9,1,2,5)

        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),11,0,1,6)
        self.groupBox_Costos = QtWidgets.QGroupBox(QtWidgets.QApplication.translate("equipment", "Costos calculados", None))
        gridLayout_Costos.addWidget(self.groupBox_Costos,12,1,1,5)
        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, tolerancia=8, decimales=2)
        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, tolerancia=8, decimales=2)
        gridLayout_5.addWidget(self.C_inst,1,2,1,1)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),13,0,1,6)

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

        self.tabWidget.setCurrentIndex(0)


    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):
        if self.todos_datos():
            if self.tipo.currentIndex()==0:
                self.FireHeater.Coste(self.factorInstalacion.value(), 0, self.tipobox.currentIndex(), self.material.currentIndex())
            else:
                self.FireHeater.Coste(self.factorInstalacion.value(), 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,代码行数:104,代码来源:UI_tank.py


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