示例#1
0
    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__(Filter, entrada=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)

        #Pestaña costos
        gridLayout_Costos = QtWidgets.QGridLayout(self.tabCostos)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Tipo:", None)), 1, 0, 1, 1)
        self.tipo=QtWidgets.QComboBox()
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Rotary vacuum belt discharge", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Rotary vacuum drum scraper discharge", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Rotary vacuum disk", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Horizontal vacuum belt", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Pressure leaf", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Plate and frame", None))
        self.tipo.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.tipo, 1, 1, 1, 3)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.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(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,4)
        gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_Costos)
        gridLayout_5.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Adquisición:", None)),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(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Coste Instalación:", None)),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,QtWidgets.QApplication.translate("equipment", "Gas filtrado", None))
        self.Salida.addTab(self.SalidaSolido,QtWidgets.QApplication.translate("equipment", "Sólidos recogidos", None))

        self.tabWidget.setCurrentIndex(0)
示例#2
0
    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 = QtGui.QGridLayout(self.tabCalculo)

        #Pestaña costos
        gridLayout_Costos = QtGui.QGridLayout(self.tabCostos)
        gridLayout_Costos.addWidget(QtGui.QLabel(QtGui.QApplication.translate("equipment", "Area:", None, QtGui.QApplication.UnicodeUTF8)), 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(QtGui.QSpacerItem(20,20,QtGui.QSizePolicy.Fixed,QtGui.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(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,6)
        gridLayout_5 = QtGui.QGridLayout(self.groupBox_Costos)
        gridLayout_5.addWidget(QtGui.QLabel(QtGui.QApplication.translate("equipment", "Coste Adquisición:", None, QtGui.QApplication.UnicodeUTF8)),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(QtGui.QLabel(QtGui.QApplication.translate("equipment", "Coste Instalación:", None, QtGui.QApplication.UnicodeUTF8)),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,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)
示例#3
0
    def __init__(self, equipment=None, salidas=0, parent=None):
        """
        equipment: Initial equipment instance to model
        salidas: Stream Output number to equipment
        """
        super(UI_equipment, self).__init__(Divider,
                                           entrada=False,
                                           parent=parent)

        # Calculate tab
        lyt_Calc = QtGui.QGridLayout(self.tabCalculo)
        lyt_Calc.addWidget(
            QtGui.QLabel(QtGui.QApplication.translate("pychemqt",
                                                      "Separation")), 1, 1, 1,
            1)
        self.criterio = QtGui.QComboBox()
        for txt in self.Equipment.TEXT_CRITERIO:
            self.criterio.addItem(txt)
        self.criterio.currentIndexChanged.connect(self.criterio_Changed)
        lyt_Calc.addWidget(self.criterio, 1, 2, 1, 1)

        self.fracciones = Tabla(1, horizontalHeader=[True], stretch=False)
        self.fracciones.setItemDelegateForColumn(0, CellEditor(self))
        lyt_Calc.addWidget(self.fracciones, 2, 1, 1, 2)

        lyt_Calc.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("pychemqt", "Pressure lost")), 3,
            1, 1, 1)
        self.deltaP = Entrada_con_unidades(Pressure, value=0)
        self.deltaP.valueChanged.connect(partial(self.changeParams, "deltaP"))
        lyt_Calc.addWidget(self.deltaP, 3, 2, 1, 1)

        if equipment and salidas:
            equipment(salidas=salidas)
        elif equipment:
            salidas = equipment.kwargs["salidas"]
        else:
            self.Equipment = Divider(salidas=salidas)

        self.fracciones.setRowCount(salidas)
        for i in range(salidas):
            self.fracciones.setItem(0, i, QtGui.QTableWidgetItem(""))
            self.fracciones.item(0,
                                 i).setTextAlignment(QtCore.Qt.AlignRight
                                                     | QtCore.Qt.AlignVCenter)
            self.fracciones.setRowHeight(i, 20)
            widget = UI_corriente.Ui_corriente(readOnly=True)
            self.Salida.addTab(widget, str(i + 1))

        self.criterio_Changed(0)
        self.fracciones.editingFinished.connect(
            partial(self.changeParams, "split"))
        self.setEquipment(equipment)
示例#4
0
    def __init__(self, equipment=None, entradas=1, parent=None):
        """
        equipment: Initial equipment instance to model
        entradas: Stream Input number to equipment
        """
        super().__init__(Mixer, salida=False, parent=parent)

        # Input tab
        for i in range(entradas):
            entrada = UI_corriente.Ui_corriente()
            entrada.Changed.connect(partial(self.cambiarEntrada, i))
            self.Entrada.addTab(entrada, str(i + 1))

        # Calculate tab
        lyt_Calc = QtWidgets.QGridLayout(self.tabCalculo)
        lyt_Calc.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt",
                                                 "Output Pressure Method")), 1,
            1)
        self.criterio = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_METODO:
            self.criterio.addItem(txt)
        self.criterio.currentIndexChanged.connect(self.criterio_Changed)
        lyt_Calc.addWidget(self.criterio, 1, 2)

        lyt_Calc.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed,
                                  QtWidgets.QSizePolicy.Fixed), 2, 1, 1, 3)
        lyt_Calc.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt",
                                                 "Output Pressure")), 3, 1)
        self.Pout = Entrada_con_unidades(Pressure)
        self.Pout.valueChanged.connect(partial(self.changeParams, "Pout"))
        lyt_Calc.addWidget(self.Pout, 3, 2)
        lyt_Calc.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Expanding), 4, 1, 1, 3)

        self.criterio_Changed(0)

        if equipment:
            self.setEquipment(equipment)
        else:
            self.Equipment = Mixer(entradas=entradas)
示例#5
0
    def __init__(self, equipment=None, parent=None):
        """
        equipment: Initial equipment instance to model
        """
        super().__init__(Scrubber, parent=parent)

        # Input tab
        self.entradaGas = UI_corriente.Ui_corriente(psychro=True)
        self.entradaGas.Changed.connect(
            partial(self.changeParams, "entradaGas"))
        self.Entrada.addTab(
            self.entradaGas,
            QtWidgets.QApplication.translate("equipment", "Gas"))
        self.entradaLiquido = UI_corriente.Ui_corriente()
        self.entradaLiquido.Changed.connect(
            partial(self.changeParams, "entradaLiquido"))
        self.Entrada.addTab(
            self.entradaLiquido,
            QtWidgets.QApplication.translate("pychemqt", "Liquid"))

        # Calculate tab
        gridLayout_Calculo = QtWidgets.QGridLayout(self.tabCalculo)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt", "Mode")), 1, 1)
        self.tipo_calculo = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_TIPO:
            self.tipo_calculo.addItem(txt)
        self.tipo_calculo.currentIndexChanged.connect(
            self.on_tipoCalculo_currentIndexChanged)
        gridLayout_Calculo.addWidget(self.tipo_calculo, 1, 2, 1, 5)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt", "Method")), 2, 1)
        self.modelo_rendimiento = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_MODEL:
            self.modelo_rendimiento.addItem(txt)
        self.modelo_rendimiento.currentIndexChanged.connect(
            self.on_modeloRendimiento_currentIndexChanged)
        gridLayout_Calculo.addWidget(self.modelo_rendimiento, 2, 2, 1, 5)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt", "ΔP method")), 3,
            1)
        self.modelo_DeltaP = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_MODEL_DELTAP:
            self.modelo_DeltaP.addItem(txt)
        self.modelo_DeltaP.currentIndexChanged.connect(
            self.on_modeloDeltaP_currentIndexChanged)
        gridLayout_Calculo.addWidget(self.modelo_DeltaP, 3, 2, 1, 5)

        gridLayout_Calculo.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed,
                                  QtWidgets.QSizePolicy.Fixed), 4, 1, 1, 6)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt", "Diameter")), 5,
            1)
        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)
示例#6
0
    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__(Tank, 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)


        #Pestaña costos
        gridLayout_Costos = QtWidgets.QGridLayout(self.tabCostos)
        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)
示例#7
0
    def __init__(self, entrada=None, parent=None):
        """entrada: Parametro opcional de clase corriente que indica la corriente de entrada"""
        super(UI_equipment, self).__init__(Baghouse,
                                           entrada=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 definición rendimientos
        self.Rendimientos = QtWidgets.QTableWidget(1, 2)
        self.Rendimientos.setItemDelegateForColumn(1, CellEditor(self))
        self.Rendimientos.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.Rendimientos.verticalHeader().hide()
        self.Rendimientos.setEditTriggers(
            QtWidgets.QAbstractItemView.AllEditTriggers)
        if self.entrada:
            self.rellenarTablaRendimientos()
        self.rendimientos = []
        self.Rendimientos.cellChanged.connect(self.cambiarRendimientos)
        self.tabWidget.insertTab(
            1, self.Rendimientos,
            QtWidgets.QApplication.translate("equipment", "Rendimientos",
                                             None))

        #Cálculo
        gridLayout_Calculo = QtWidgets.QGridLayout(self.tabCalculo)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Tipo de cálculo:", None)), 1,
            1, 1, 1)
        self.TipoCalculo = QtWidgets.QComboBox()
        self.TipoCalculo.addItem(
            QtWidgets.QApplication.translate("equipment",
                                             "Calcular caída de presión",
                                             None))
        self.TipoCalculo.addItem(
            QtWidgets.QApplication.translate("equipment",
                                             "Calcular tiempo de filtración",
                                             None))
        self.TipoCalculo.addItem(
            QtWidgets.QApplication.translate("equipment",
                                             "Calcular número de filtros",
                                             None))
        self.TipoCalculo.currentIndexChanged.connect(self.tipoCalculoCambiado)
        gridLayout_Calculo.addWidget(self.TipoCalculo, 1, 2, 1, 4)
        gridLayout_Calculo.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed,
                                  QtWidgets.QSizePolicy.Fixed), 2, 1, 1, 6)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment", "Nº de filtros:",
                                                 None)), 3, 1, 1, 1)
        self.numFiltros = Entrada_con_unidades(int,
                                               spinbox=True,
                                               step=1,
                                               width=50,
                                               resaltado=True,
                                               min=1,
                                               start=1)
        self.numFiltros.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.numFiltros, 3, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Tiempo de filtración:",
                                                 None)), 4, 1, 1, 1)
        self.tiempo = Entrada_con_unidades(unidades.Time, resaltado=True)
        self.tiempo.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.tiempo, 4, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Pérdida de presión:", None)),
            5, 1, 1, 1)
        self.deltaP = Entrada_con_unidades(unidades.Pressure,
                                           retornar=False,
                                           readOnly=True)
        self.deltaP.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.deltaP, 5, 2, 1, 1)
        gridLayout_Calculo.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed,
                                  QtWidgets.QSizePolicy.Fixed), 6, 1, 1, 6)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Membranas por filtro:",
                                                 None)), 7, 1, 1, 1)
        self.MembranaCelda = Entrada_con_unidades(int,
                                                  spinbox=True,
                                                  step=1,
                                                  width=70,
                                                  value=78,
                                                  min=1)
        self.MembranaCelda.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.MembranaCelda, 7, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Diametro de membrana:",
                                                 None)), 8, 1, 1, 1)
        self.Diametro = Entrada_con_unidades(unidades.Length,
                                             value=unidades.Length(0.5, "ft"))
        self.Diametro.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.Diametro, 8, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Area por membrana:", None)),
            9, 1, 1, 1)
        self.Area = Entrada_con_unidades(unidades.Area,
                                         value=unidades.Area(16, "ft2"))
        self.Area.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.Area, 9, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Resistencia filtro:", None)),
            7, 4, 1, 1)
        self.resistenciaFiltro = Entrada_con_unidades(float,
                                                      spinbox=True,
                                                      step=0.01,
                                                      width=70,
                                                      value=0.84,
                                                      min=0)
        self.resistenciaFiltro.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.resistenciaFiltro, 7, 5, 1, 1)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Resistencia torta:", None)),
            8, 4, 1, 1)
        self.resistenciaTorta = Entrada_con_unidades(float,
                                                     spinbox=True,
                                                     step=0.01,
                                                     width=70,
                                                     value=0.1,
                                                     min=0)
        self.resistenciaTorta.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.resistenciaTorta, 8, 5, 1, 1)
        gridLayout_Calculo.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Filtros en limpieza:",
                                                 None)), 9, 4, 1, 1)
        self.Limpieza = Entrada_con_unidades(int,
                                             spinbox=True,
                                             step=1,
                                             width=70,
                                             value=1,
                                             min=0)
        self.Limpieza.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.Limpieza, 9, 5, 1, 1)
        gridLayout_Calculo.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Expanding), 10, 1, 1,
            6)

        self.groupBox_Calculo = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("equipment", "Datos calculados",
                                             None))
        gridLayout_Calculo.addWidget(self.groupBox_Calculo, 11, 1, 1, 5)
        self.gridLayout_1 = QtWidgets.QGridLayout(self.groupBox_Calculo)
        self.gridLayout_1.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "V<sub>gas</sub>:", None)), 0,
            1, 1, 1)
        self.Vgas = Entrada_con_unidades(unidades.Speed,
                                         retornar=False,
                                         readOnly=True)
        self.gridLayout_1.addWidget(self.Vgas, 0, 2, 1, 1)
        self.gridLayout_1.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment", "Rendimiento:",
                                                 None)), 1, 1, 1, 1)
        self.rendimientoCalculado = Entrada_con_unidades(float, readOnly=True)
        self.gridLayout_1.addWidget(self.rendimientoCalculado, 1, 2, 1, 1)
        self.gridLayout_1.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment", "Superficie:",
                                                 None)), 2, 1, 1, 1)
        self.superficie = Entrada_con_unidades(unidades.Area, readOnly=True)
        self.gridLayout_1.addWidget(self.superficie, 2, 2, 1, 1)
        gridLayout_Calculo.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Expanding), 12, 1, 1,
            6)

        #Salidas
        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)
示例#8
0
    def __init__(self, entrada=None, parent=None):
        """entrada: Parametro opcional de clase corriente que indica la corriente de entrada en el equipo"""
        super(UI_equipment, self).__init__(Crystallizer, entrada=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)

        #Pestaña costos
        gridLayout_Costos = QtWidgets.QGridLayout(self.tabCostos)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Tipo:", None)), 1, 1)
        self.tipo=QtWidgets.QComboBox()
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Recirculación externa forzada", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Internos de tubo forzado", None))
        self.tipo.addItem(QtWidgets.QApplication.translate("equipment", "Discontinuos a vacío", None))
        self.tipo.currentIndexChanged.connect(self.mostrarSubclasificacion)
        self.tipo.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.tipo, 1, 2, 1, 3)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Material:", None)), 2, 1)
        self.materialvacio=QtWidgets.QComboBox()
        self.materialvacio.addItem(QtWidgets.QApplication.translate("equipment", "Acero dulce", None))
        self.materialvacio.addItem(QtWidgets.QApplication.translate("equipment", "Acero recubierto de caucho", None))
        self.materialvacio.addItem(QtWidgets.QApplication.translate("equipment", "Acero inoxidable 304", None))
        self.materialvacio.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.materialvacio, 2, 2, 1, 3)
        self.materialotros=QtWidgets.QComboBox()
        self.materialotros.addItem(QtWidgets.QApplication.translate("equipment", "Acero dulce", None))
        self.materialotros.addItem(QtWidgets.QApplication.translate("equipment", "Acero inoxidable 304", None))
        self.materialotros.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.materialotros, 2, 2, 1, 3)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Volumen:", None)), 4, 4)
        self.Volumen=Entrada_con_unidades(unidades.Volume, "VolLiq", width=80)
        gridLayout_Costos.addWidget(self.Volumen,4,5,1,1)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),3,0,1,6)
        self.label4=QtWidgets.QLabel()
        self.label4.setText(QtWidgets.QApplication.translate("equipment", "Caudal calculado:", None))
        gridLayout_Costos.addWidget(self.label4, 4, 1, 1, 1)
        self.caudalcalculado=Entrada_con_unidades(unidades.MassFlow, readOnly=True, retornar=False)
        gridLayout_Costos.addWidget(self.caudalcalculado,4,2,1,1)
        gridLayout_Costos.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Caudal de diseño:", None)), 5, 1)
        self.caudaldiseno=Entrada_con_unidades(unidades.MassFlow)
        gridLayout_Costos.addWidget(self.caudaldiseno,5,2,1,1)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),6,0,1,6)

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

        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),11,0,1,6)
        gridLayout_Costos.addItem(QtWidgets.QSpacerItem(20,20,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),9,0,1,6)
        self.groupBox_Costos = QtWidgets.QGroupBox(QtWidgets.QApplication.translate("equipment", "Costos calculados", None))
        gridLayout_Costos.addWidget(self.groupBox_Costos,10,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)
        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)

        self.tabWidget.setCurrentIndex(0)
        self.mostrarSubclasificacion(0)
示例#9
0
    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__(Centrifuge,
                                           entrada=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)

        #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", "Proceso inorgánico",
                                             None))
        self.tipo.addItem(
            QtWidgets.QApplication.translate("equipment", "Proceso orgánico",
                                             None))
        self.tipo.currentIndexChanged.connect(self.mostrarSubclasificacion)
        self.tipo.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.tipo, 1, 2, 1, 1)
        gridLayout_Costos.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment", "Material:",
                                                 None)), 2, 1, 1, 1)
        self.materialInorganico = QtWidgets.QComboBox()
        self.materialInorganico.addItem(
            QtWidgets.QApplication.translate("equipment", "Acero al carbón",
                                             None))
        self.materialInorganico.addItem(
            QtWidgets.QApplication.translate("equipment",
                                             "Acero inoxidable 316", None))
        self.materialInorganico.addItem(
            QtWidgets.QApplication.translate("equipment", "Monel", None))
        self.materialInorganico.addItem(
            QtWidgets.QApplication.translate("equipment", "Níquel", None))
        self.materialInorganico.currentIndexChanged.connect(
            self.calcularCostos)
        gridLayout_Costos.addWidget(self.materialInorganico, 2, 2, 1, 1)
        gridLayout_Costos.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed,
                                  QtWidgets.QSizePolicy.Fixed), 3, 0, 1, 2)
        self.materialOrganico = QtWidgets.QComboBox()
        self.materialOrganico.addItem(
            QtWidgets.QApplication.translate("equipment", "Acero al carbón",
                                             None))
        self.materialOrganico.addItem(
            QtWidgets.QApplication.translate("equipment",
                                             "Acero inoxidable 316", None))
        self.materialOrganico.addItem(
            QtWidgets.QApplication.translate("equipment", "Monel", None))
        self.materialOrganico.addItem(
            QtWidgets.QApplication.translate("equipment", "Níquel", None))
        self.materialOrganico.addItem(
            QtWidgets.QApplication.translate("equipment", "Hastelloy", None))
        self.materialOrganico.currentIndexChanged.connect(self.calcularCostos)
        gridLayout_Costos.addWidget(self.materialOrganico, 2, 2, 1, 1)
        gridLayout_Costos.addItem(
            QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed,
                                  QtWidgets.QSizePolicy.Fixed), 3, 0, 1, 6)
        gridLayout_Costos.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Caudal calculado:", None)),
            4, 1, 1, 1)
        self.caudalcalculado = Entrada_con_unidades(unidades.MassFlow,
                                                    readOnly=True,
                                                    retornar=False)
        gridLayout_Costos.addWidget(self.caudalcalculado, 4, 2, 1, 1)
        gridLayout_Costos.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("equipment",
                                                 "Caudal de diseño:", None)),
            5, 1, 1, 1)
        self.caudaldiseno = Entrada_con_unidades(unidades.MassFlow)
        gridLayout_Costos.addWidget(self.caudaldiseno, 5, 2, 1, 1)
        gridLayout_Costos.addItem(
            QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed,
                                  QtWidgets.QSizePolicy.Fixed), 6, 0, 1, 6)

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

        gridLayout_Costos.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Expanding), 9, 0, 1, 6)
        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, 10, 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)

        self.tabWidget.setCurrentIndex(0)
        self.mostrarSubclasificacion(0)
示例#10
0
    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)
示例#11
0
    def __init__(self, entradaSolido=None, entradaAire=None, parent=None):
        """entrada: Parametro opcional de clase corriente que indica la corriente de entrada"""
        super(UI_equipment, self).__init__(Dryer, parent=parent)
        self.entradaSolido = entradaSolido
        self.entradaAire = entradaAire
        self.Equipment = Dryer()

        #Pestaña entrada
        self.EntradaSolido = UI_corriente.Ui_corriente(self.entradaSolido)
        self.EntradaSolido.Changed.connect(self.cambiar_entrada)
        self.Entrada.addTab(
            self.EntradaSolido,
            QtGui.QApplication.translate("equipment", "Solido", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.EntradaAire = UI_corriente.Ui_psychrometry(self.entradaAire)
        self.EntradaAire.Changed.connect(self.cambiar_aire)
        self.Entrada.addTab(
            self.EntradaAire,
            QtGui.QApplication.translate("equipment", "Aire", None,
                                         QtGui.QApplication.UnicodeUTF8))

        #Pestaña calculo
        gridLayout_Calculo = QtGui.QGridLayout(self.tabCalculo)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment", "Tipo de cálculo:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            1, 1)
        self.TipoCalculo = QtGui.QComboBox()
        self.TipoCalculo.addItem(
            QtGui.QApplication.translate(
                "equipment",
                "Cálculo, conocido el flujo de vapor, calcular las corrientes de salida",
                None, QtGui.QApplication.UnicodeUTF8))
        self.TipoCalculo.addItem(
            QtGui.QApplication.translate(
                "equipment", "Diseño, calcular el flujo de aire necesario",
                None, QtGui.QApplication.UnicodeUTF8))
        self.TipoCalculo.currentIndexChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.TipoCalculo, 1, 2, 1, 4)
        gridLayout_Calculo.addItem(
            QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Fixed,
                              QtGui.QSizePolicy.Fixed), 2, 1, 1, 6)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Humedad relativa en el aire:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            3, 1, 1, 1)
        self.HumedadAire = Entrada_con_unidades(float,
                                                max=1,
                                                spinbox=True,
                                                step=0.01)
        self.HumedadAire.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.HumedadAire, 3, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Humedad residual del sólido:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            4, 1, 1, 1)
        self.HumedadSolido = Entrada_con_unidades(
            float,
            max=1.,
            spinbox=True,
            step=0.01,
            textounidad=unidades.Mass(None).text() + "/" +
            unidades.Mass(None).text())
        self.HumedadSolido.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.HumedadSolido, 4, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate(
                    "equipment", "Temperatura del sólido a la salida:", None,
                    QtGui.QApplication.UnicodeUTF8)), 5, 1, 1, 1)
        self.temperatura = Entrada_con_unidades(unidades.Temperature)
        self.temperatura.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.temperatura, 5, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Intercambio de calor:", None,
                                             QtGui.QApplication.UnicodeUTF8)),
            6, 1, 1, 1)
        self.Heat = Entrada_con_unidades(unidades.Power)
        self.Heat.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.Heat, 6, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Pérdida de presión:", None,
                                             QtGui.QApplication.UnicodeUTF8)),
            7, 1, 1, 1)
        self.DeltaP = Entrada_con_unidades(unidades.Pressure)
        self.DeltaP.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.DeltaP, 7, 2, 1, 1)

        gridLayout_Calculo.addItem(
            QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Expanding), 8, 1, 1, 6)
        self.groupBox_Calculo = QtGui.QGroupBox(
            QtGui.QApplication.translate("equipment", "Datos calculados", None,
                                         QtGui.QApplication.UnicodeUTF8))
        gridLayout_Calculo.addWidget(self.groupBox_Calculo, 9, 1, 1, 5)
        gridLayout_1 = QtGui.QGridLayout(self.groupBox_Calculo)
        gridLayout_1.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Temperatura a la salida:", None,
                                             QtGui.QApplication.UnicodeUTF8)),
            1, 1, 1, 1)
        self.temperaturaCalculada = Entrada_con_unidades(unidades.Temperature,
                                                         retornar=False,
                                                         readOnly=True)
        gridLayout_1.addWidget(self.temperaturaCalculada, 1, 2, 1, 1)
        gridLayout_1.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment", "Caudal de aire:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            2, 1)
        self.caudalVolumetrico = Entrada_con_unidades(unidades.VolFlow,
                                                      "QGas",
                                                      retornar=False,
                                                      readOnly=True)
        gridLayout_1.addWidget(self.caudalVolumetrico, 2, 2, 1, 1)
        gridLayout_1.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment", "Humedad del aire:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            3, 1)
        self.HumedadCalculada = Entrada_con_unidades(float,
                                                     readOnly=True,
                                                     textounidad="%")
        gridLayout_1.addWidget(self.HumedadCalculada, 3, 2, 1, 1)

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

        #Pestaña salida
        self.SalidaSolido = UI_corriente.Ui_corriente(readOnly=True)
        self.Salida.addTab(
            self.SalidaSolido,
            QtGui.QApplication.translate("equipment", "Sólido secado", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.SalidaAire = UI_corriente.Ui_psychrometry(readOnly=True)
        self.Salida.addTab(
            self.SalidaAire,
            QtGui.QApplication.translate("equipment", "Aire", None,
                                         QtGui.QApplication.UnicodeUTF8))
示例#12
0
 def addEntrada(self, title, key, **kw):
     widget = UI_corriente.Ui_corriente(**kw)
     widget.Changed.connect(partial(self.changeParams, key))
     self.Entrada.addTab(widget, title)
示例#13
0
 def addSalida(self, title, **kw):
     widget = UI_corriente.Ui_corriente(readOnly=True, **kw)
     self.Salida.addTab(widget, title)
示例#14
0
    def __init__(self,
                 equipment,
                 entrada=True,
                 salida=True,
                 calculo=True,
                 parent=None):
        """
        equipment: name of equipment to model
        entrada: boolean to create or not the input tab
        salida: boolean to create or not the input tab
            - True para equipos con varias entradas/salidas, create de tab,
              the child must define the UI_corriente
            - False para equipos con una, create UI_corriente
            - None: Not create nothing
        calculo: boolean to create or not the calcule tab
        """
        super(UI_equip, self).__init__(parent)
        self.setWindowTitle(equipment.title)
        icono = os.environ["pychemqt"] + \
            "/images/equipment/%s.png" % equipment.__name__.lower()
        self.setWindowIcon(QtGui.QIcon(QtGui.QPixmap(icono)))
        self.evaluate = Evaluate()
        self.evaluate.finished.connect(self.rellenar)

        layout = QtGui.QGridLayout(self)
        self.tabWidget = QtGui.QTabWidget()
        layout.addWidget(self.tabWidget, 0, 0, 1, 3)
        self.status = Status()
        layout.addWidget(self.status, 1, 0, 1, 1)
        self.checkIgnorar = QtGui.QCheckBox()
        self.checkIgnorar.setText(
            QtGui.QApplication.translate("pychemqt", "Ignore"))
        self.checkIgnorar.toggled.connect(self.ignorar)
        layout.addWidget(self.checkIgnorar, 1, 1, 1, 1)
        self.buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Cancel
                                                | QtGui.QDialogButtonBox.Ok
                                                | QtGui.QDialogButtonBox.Help)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        self.buttonBox.helpRequested.connect(self.ayuda)
        layout.addWidget(self.buttonBox, 1, 2, 1, 1)

        if not equipment.help:
            self.buttonBox.button(
                QtGui.QDialogButtonBox.Help).setVisible(False)

        # Input tab
        if entrada:
            self.Entrada = QtGui.QTabWidget()
            self.tabWidget.addTab(
                self.Entrada,
                QtGui.QIcon(os.environ["pychemqt"] +
                            "/images/equipment/in.svg"),
                QtGui.QApplication.translate("pychemqt", "Input"))
        elif entrada is None:
            pass
        else:
            self.Entrada = UI_corriente.Ui_corriente()
            self.Entrada.Changed.connect(partial(self.changeParams, "entrada"))
            self.tabWidget.addTab(
                self.Entrada,
                QtGui.QIcon(os.environ["pychemqt"] +
                            "/images/equipment/in.svg"),
                QtGui.QApplication.translate("pychemqt", "Input"))

        # Calcule tab
        if calculo:
            self.tabCalculo = QtGui.QWidget()
            self.tabWidget.addTab(
                self.tabCalculo,
                QtGui.QIcon(os.environ["pychemqt"] +
                            "/images/button/calculator.png"),
                QtGui.QApplication.translate("pychemqt", "Calculation"))

        # Cost tab
        if equipment.indiceCostos is not None:
            self.tabCostos = QtGui.QWidget()
            self.tabWidget.addTab(
                self.tabCostos,
                QtGui.QIcon(os.environ["pychemqt"] +
                            "/images/button/currency.png"),
                QtGui.QApplication.translate("pychemqt", "Cost"))

        # Output tab
        if salida:
            self.Salida = QtGui.QTabWidget()
            self.tabWidget.addTab(
                self.Salida,
                QtGui.QIcon(os.environ["pychemqt"] +
                            "/images/equipment/out.svg"),
                QtGui.QApplication.translate("pychemqt", "Output"))
        elif salida is None:
            pass
        else:
            self.Salida = UI_corriente.Ui_corriente(readOnly=True)
            self.tabWidget.addTab(
                self.Salida,
                QtGui.QIcon(os.environ["pychemqt"] +
                            "/images/equipment/out.svg"),
                QtGui.QApplication.translate("pychemqt", "Output"))

        # Notes tab
        self.tabNotas = texteditor.TextEditor()
        self.tabWidget.addTab(
            self.tabNotas,
            QtGui.QIcon(os.environ["pychemqt"] + "/images/button/editor.png"),
            QtGui.QApplication.translate("pychemqt", "Notes"))
        self.tabNotas.notas.textChanged.connect(self.cambiar_notas)