def __init__(self, petroleo=None, parent=None): super(View_Petro, self).__init__(parent) self.setWindowTitle(QtWidgets.QApplication.translate( "pychemqt", "Petrol assay characteristics")) layout = QtWidgets.QGridLayout(self) self.nombre = QtWidgets.QLabel() layout.addWidget(self.nombre, 1, 1, 1, 5) label = QtWidgets.QLabel("M") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Molecular Weight")) layout.addWidget(label, 2, 1) self.M = Entrada_con_unidades(float, textounidad="g/mol") layout.addWidget(self.M, 2, 2) label = QtWidgets.QLabel("Tb") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Boiling Temperature")) layout.addWidget(label, 3, 1) self.Tb = Entrada_con_unidades(unidades.Temperature) layout.addWidget(self.Tb, 3, 2) label = QtWidgets.QLabel("SG") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Specific gravity at 60ºF")) layout.addWidget(label, 4, 1) self.gravity = Entrada_con_unidades(float) layout.addWidget(self.gravity, 4, 2) label = QtWidgets.QLabel("API") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "API Specific gravity")) layout.addWidget(label, 5, 1) self.API = Entrada_con_unidades(float) layout.addWidget(self.API, 5, 2) label = QtWidgets.QLabel("Kw") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Watson characterization factor")) layout.addWidget(label, 6, 1) self.watson = Entrada_con_unidades(float) layout.addWidget(self.watson, 6, 2) label = QtWidgets.QLabel("n") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Refractive Index")) layout.addWidget(label, 7, 1) self.n = Entrada_con_unidades(float) layout.addWidget(self.n, 7, 2) label = QtWidgets.QLabel("I") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Huang parameter")) layout.addWidget(label, 8, 1) self.I = Entrada_con_unidades(float) layout.addWidget(self.I, 8, 2) label = QtWidgets.QLabel("ν<sub>100F</sub>") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Kinematic viscosity at 100ºF")) layout.addWidget(label, 9, 1) self.v100 = Entrada_con_unidades(unidades.Diffusivity) layout.addWidget(self.v100, 9, 2) label = QtWidgets.QLabel("ν<sub>210F</sub>") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Kinematic viscosity at 210ºF")) layout.addWidget(label, 10, 1) self.v210 = Entrada_con_unidades(unidades.Diffusivity) layout.addWidget(self.v210, 10, 2) layout.addWidget(QtWidgets.QLabel("Tc"), 2, 4) self.Tc = Entrada_con_unidades(unidades.Temperature) layout.addWidget(self.Tc, 2, 5) layout.addWidget(QtWidgets.QLabel("Pc"), 3, 4) self.Pc = Entrada_con_unidades(unidades.Pressure) layout.addWidget(self.Pc, 3, 5) layout.addWidget(QtWidgets.QLabel("Vc"), 4, 4) self.Vc = Entrada_con_unidades(unidades.SpecificVolume) layout.addWidget(self.Vc, 4, 5) layout.addWidget(QtWidgets.QLabel("Zc"), 5, 4) self.Zc = Entrada_con_unidades(float) layout.addWidget(self.Zc, 5, 5) label = QtWidgets.QLabel("ω") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Acentric factor")) layout.addWidget(label, 6, 4) self.f_acent = Entrada_con_unidades(float) layout.addWidget(self.f_acent, 6, 5) label = QtWidgets.QLabel("m") label.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Refractivity Intercept")) layout.addWidget(label, 7, 4) self.refractivity = Entrada_con_unidades(float) layout.addWidget(self.refractivity, 7, 5) layout.addWidget(QtWidgets.QLabel("CH"), 8, 4) self.CH = Entrada_con_unidades(float) layout.addWidget(self.CH, 8, 5) layout.addWidget(QtWidgets.QLabel("%S"), 9, 4) self.S = Entrada_con_unidades(float) layout.addWidget(self.S, 9, 5) layout.addWidget(QtWidgets.QLabel("%H"), 10, 4) self.H = Entrada_con_unidades(float) layout.addWidget(self.H, 10, 5) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "VGC")), 2, 7) self.VGC = Entrada_con_unidades(float) layout.addWidget(self.VGC, 2, 8) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Cetane index")), 3, 7) self.cetane = Entrada_con_unidades(float) layout.addWidget(self.cetane, 3, 8) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Pour point")), 4, 7) self.pour = Entrada_con_unidades(unidades.Temperature) 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 __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)
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')) self.inicio.setDisabled(self.Personalizar.isChecked()) self.fin.setDisabled(self.Personalizar.isChecked()) self.intervalo.setDisabled(self.Personalizar.isChecked()) self.Lista.setEnabled(self.Personalizar.isChecked()) self.label.setChecked( config.getboolean(section, ConfSection+'Label')) self.variable.setChecked( config.getboolean(section, ConfSection+'Variable')) self.unit.setChecked( config.getboolean(section, ConfSection+'Units')) self.Posicion.setValue( config.getint(section, ConfSection+'Position')) self.lineconfig.setConfig(config, section)
def __init__(self, metodo, parent=None): """Metodo: name of group contribution method: Joback, Constantinou, Wilson, Marrero, Elliott, Ambrose, Klincewicz """ super(Ui_Contribution, self).__init__(parent) # Initialization variables self.grupo = [] self.indices = [] self.contribucion = [] func = {} for f in _methods: func[f.__name__] = f self.unknown = func[metodo]() title = self.unknown.__title__ title += " " + QtWidgets.QApplication.translate( "pychemqt", "new component definition") self.setWindowTitle(title) lyt = QtWidgets.QVBoxLayout(self) widget = QtWidgets.QWidget() layout = QtWidgets.QGridLayout(widget) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Name")), 1, 0) self.nombre = QtWidgets.QLineEdit() self.nombre.textChanged.connect(partial(self.changeParams, "name")) layout.addWidget(self.nombre, 1, 1, 1, 3) self.Group = QtWidgets.QTableWidget() self.Group.verticalHeader().hide() self.Group.setRowCount(0) self.Group.setColumnCount(2) self.Group.setHorizontalHeaderItem(0, QtWidgets.QTableWidgetItem("Nk")) self.Group.setHorizontalHeaderItem( 1, QtWidgets.QTableWidgetItem( QtWidgets.QApplication.translate("pychemqt", "Group"))) self.Group.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.Group.setSortingEnabled(True) self.Group.horizontalHeader().setStretchLastSection(True) self.Group.setColumnWidth(0, 50) self.Group.setItemDelegateForColumn(0, SpinEditor(self)) self.Group.cellChanged.connect(self.cellChanged) self.Group.setEditTriggers(QtWidgets.QAbstractItemView.AllEditTriggers) layout.addWidget(self.Group, 2, 0, 3, 3) self.Formula = QtWidgets.QLabel() font = QtGui.QFont() font.setPointSize(12) self.Formula.setFont(font) self.Formula.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter) self.Formula.setFixedHeight(50) layout.addWidget(self.Formula, 2, 3) self.btnDelete = QtWidgets.QPushButton( QtGui.QIcon( QtGui.QPixmap( os.path.join(IMAGE_PATH, "button", "editDelete.png"))), QtWidgets.QApplication.translate("pychemqt", "Delete")) self.btnDelete.clicked.connect(self.borrar) layout.addWidget(self.btnDelete, 3, 3) self.btnClear = QtWidgets.QPushButton( QtGui.QIcon( QtGui.QPixmap(os.path.join(IMAGE_PATH, "button", "clear.png"))), QtWidgets.QApplication.translate("pychemqt", "Clear")) self.btnClear.clicked.connect(self.clear) layout.addWidget(self.btnClear, 4, 3) self.line = QtWidgets.QFrame() self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) layout.addWidget(self.line, 5, 0, 1, 4) self.groupContributions = QtWidgets.QListWidget() self.groupContributions.currentItemChanged.connect(self.selectChanged) self.groupContributions.itemDoubleClicked.connect(self.add) layout.addWidget(self.groupContributions, 6, 0, 6, 3) self.btnAdd = QtWidgets.QPushButton( QtGui.QIcon( QtGui.QPixmap(os.path.join(IMAGE_PATH, "button", "add.png"))), QtWidgets.QApplication.translate("pychemqt", "Add")) self.btnAdd.setDisabled(True) self.btnAdd.clicked.connect(self.add) layout.addWidget(self.btnAdd, 6, 3) layout.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 7, 1) # Show selection for method with several order contributions if self.unknown.SecondOrder: self.Order1 = QtWidgets.QRadioButton( QtWidgets.QApplication.translate("pychemqt", "1st order")) self.Order1.setChecked(True) self.Order1.toggled.connect(self.Order) layout.addWidget(self.Order1, 9, 3) self.Order2 = QtWidgets.QRadioButton( QtWidgets.QApplication.translate("pychemqt", "2nd order")) self.Order2.toggled.connect(self.Order) layout.addWidget(self.Order2, 10, 3) if self.unknown.ThirdOrder: self.Order3 = QtWidgets.QRadioButton( QtWidgets.QApplication.translate("pychemqt", "3rd order")) layout.addWidget(self.Order3, 11, 3) self.Order3.toggled.connect(self.Order) layout.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 12, 1) labelTb = QtWidgets.QLabel("Tb") labelTb.setToolTip( QtWidgets.QApplication.translate( "pychemqt", "Experimental Boiling Temperature")) layout.addWidget(labelTb, 13, 0) self.Tb = Entrada_con_unidades(Temperature) self.Tb.valueChanged.connect(partial(self.changeParams, "Tb")) layout.addWidget(self.Tb, 13, 1) labelM = QtWidgets.QLabel("M") labelM.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Molecular Weight")) layout.addWidget(labelM, 14, 0) self.M = Entrada_con_unidades(float, textounidad="g/mol") self.M.valueChanged.connect(partial(self.changeParams, "M")) layout.addWidget(self.M, 14, 1) label = QtWidgets.QLabel("SG") label.setToolTip( QtWidgets.QApplication.translate( "pychemqt", "Experimental Specific Gravity at 60ºF")) layout.addWidget(label, 15, 0) self.SG = Entrada_con_unidades(float) self.SG.valueChanged.connect(partial(self.changeParams, "SG")) layout.addWidget(self.SG, 15, 1) lyt.addWidget(widget) # Show widget for specific method if metodo == "Constantinou": # Disable Tb as input parameter labelTb.setEnabled(False) self.Tb.setEnabled(False) elif metodo == "Wilson": self.Tb.setResaltado(True) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Rings")), 16, 0) self.ring = QtWidgets.QSpinBox() self.ring.setFixedWidth(80) self.ring.valueChanged.connect(partial(self.changeParams, "ring")) layout.addWidget(self.ring, 16, 1) elif metodo == "Elliott": self.M.setResaltado(True) elif metodo == "Ambrose": self.Tb.setResaltado(True) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Platt number")), 16, 0) self.plat = QtWidgets.QSpinBox() self.plat.setFixedWidth(80) tr = "The Platt number is the number of pairs of carbon atoms " tr += "which are separated by three carbon-carbon bonds and is an " tr += "indicator of the degree of branching in the molecule. The " tr += "Platt number of an n-alkane is equal to the number of " tr += "carbons minus three" self.plat.setToolTip( QtWidgets.QApplication.translate("pychemqt", tr)) self.plat.valueChanged.connect(partial(self.changeParams, "platt")) layout.addWidget(self.plat, 16, 1) elif metodo == "Klincewicz": self.Tb.setResaltado(True) self.nogroupKlincewicz = QtWidgets.QCheckBox( QtWidgets.QApplication.translate( "pychemqt", "Use the simple no group contribution method")) self.nogroupKlincewicz.toggled.connect(self.nogroupCheckToggled) layout.addWidget(self.nogroupKlincewicz, 16, 0, 1, 4) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Atoms")), 17, 0) self.atoms = QtWidgets.QSpinBox() self.atoms.setFixedWidth(80) self.atoms.valueChanged.connect(partial(self.changeParams, "atoms")) layout.addWidget(self.atoms, 17, 1) newComponent.loadUI(self) for i, nombre in enumerate(self.unknown.coeff["txt"]): self.groupContributions.addItem(nombre[0]) if self.unknown.SecondOrder: self.Order() if metodo == "Klincewicz": self.nogroupCheckToggled(False)
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,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", "Tipo:", None, QtGui.QApplication.UnicodeUTF8)), 1, 1, 1, 1) self.tipo=QtGui.QComboBox() self.tipo.addItem(QtGui.QApplication.translate("equipment", "Proceso inorgánico", None, QtGui.QApplication.UnicodeUTF8)) self.tipo.addItem(QtGui.QApplication.translate("equipment", "Proceso orgánico", None, QtGui.QApplication.UnicodeUTF8)) self.tipo.currentIndexChanged.connect(self.mostrarSubclasificacion) self.tipo.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.tipo, 1, 2, 1, 1) gridLayout_Costos.addWidget(QtGui.QLabel(QtGui.QApplication.translate("equipment", "Material:", None, QtGui.QApplication.UnicodeUTF8)), 2, 1, 1, 1) self.materialInorganico=QtGui.QComboBox() self.materialInorganico.addItem(QtGui.QApplication.translate("equipment", "Acero al carbón", None, QtGui.QApplication.UnicodeUTF8)) self.materialInorganico.addItem(QtGui.QApplication.translate("equipment", "Acero inoxidable 316", None, QtGui.QApplication.UnicodeUTF8)) self.materialInorganico.addItem(QtGui.QApplication.translate("equipment", "Monel", None, QtGui.QApplication.UnicodeUTF8)) self.materialInorganico.addItem(QtGui.QApplication.translate("equipment", "Níquel", None, QtGui.QApplication.UnicodeUTF8)) self.materialInorganico.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.materialInorganico, 2, 2, 1, 1) gridLayout_Costos.addItem(QtGui.QSpacerItem(20,20,QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Fixed),3,0,1,2) self.materialOrganico=QtGui.QComboBox() self.materialOrganico.addItem(QtGui.QApplication.translate("equipment", "Acero al carbón", None, QtGui.QApplication.UnicodeUTF8)) self.materialOrganico.addItem(QtGui.QApplication.translate("equipment", "Acero inoxidable 316", None, QtGui.QApplication.UnicodeUTF8)) self.materialOrganico.addItem(QtGui.QApplication.translate("equipment", "Monel", None, QtGui.QApplication.UnicodeUTF8)) self.materialOrganico.addItem(QtGui.QApplication.translate("equipment", "Níquel", None, QtGui.QApplication.UnicodeUTF8)) self.materialOrganico.addItem(QtGui.QApplication.translate("equipment", "Hastelloy", None, QtGui.QApplication.UnicodeUTF8)) self.materialOrganico.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.materialOrganico, 2, 2, 1, 1) gridLayout_Costos.addItem(QtGui.QSpacerItem(10,10,QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Fixed),3,0,1,6) gridLayout_Costos.addWidget(QtGui.QLabel(QtGui.QApplication.translate("equipment", "Caudal calculado:", None, QtGui.QApplication.UnicodeUTF8)), 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(QtGui.QLabel(QtGui.QApplication.translate("equipment", "Caudal de diseño:", None, QtGui.QApplication.UnicodeUTF8)), 5, 1, 1, 1) self.caudaldiseno=Entrada_con_unidades(unidades.MassFlow) gridLayout_Costos.addWidget(self.caudaldiseno,5,2,1,1) gridLayout_Costos.addItem(QtGui.QSpacerItem(10,10,QtGui.QSizePolicy.Fixed,QtGui.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(QtGui.QSpacerItem(20,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding),9,0,1,6) gridLayout_Costos.addItem(QtGui.QSpacerItem(20,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding),11,0,1,6) self.groupBox_Costos = QtGui.QGroupBox(QtGui.QApplication.translate("equipment", "Costos calculados", None, QtGui.QApplication.UnicodeUTF8)) gridLayout_Costos.addWidget(self.groupBox_Costos,10,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) self.tabWidget.setCurrentIndex(0) self.mostrarSubclasificacion(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))
def __init__(self, equipment=None, parent=None): """ equipment: Initial equipment instance to model """ super(UI_equipment, self).__init__(Dryer, parent=parent) # Input tab self.addEntrada(QtGui.QApplication.translate("pychemqt", "Humid Solid"), "entradaSolido") self.addEntrada(QtGui.QApplication.translate("pychemqt", "Air"), "entradaAire", psychro=True) # Calculate tab lyt = QtGui.QGridLayout(self.tabCalculo) lyt.addWidget(QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Mode")), 1, 1) self.mode = QtGui.QComboBox() for txt in self.Equipment.TEXT_MODE: self.mode.addItem(txt) self.mode.currentIndexChanged.connect( partial(self.changeParams, "mode")) lyt.addWidget(self.mode, 1, 2, 1, 4) lyt.addItem(QtGui.QSpacerItem( 20, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 2, 1, 1, 6) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Air Relative Humidity")), 3, 1) self.HumedadAire = Entrada_con_unidades(float, max=1, spinbox=True, step=0.01) self.HumedadAire.valueChanged.connect(partial(self.changeParams, "HR")) lyt.addWidget(self.HumedadAire, 3, 2) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Product moisture fraction")), 4, 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( partial(self.changeParams, "HumedadResidual")) lyt.addWidget(self.HumedadSolido, 4, 2) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Output Solid Temperature")), 5, 1) self.temperatura = Entrada_con_unidades(unidades.Temperature) self.temperatura.valueChanged.connect( partial(self.changeParams, "TemperaturaSolid")) lyt.addWidget(self.temperatura, 5, 2) lyt.addWidget(QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Heat Duty")), 6, 1) self.Heat = Entrada_con_unidades(unidades.Power) self.Heat.valueChanged.connect(partial(self.changeParams, "Heat")) lyt.addWidget(self.Heat, 6, 2) lyt.addWidget(QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Pressure Drop")), 7, 1) self.DeltaP = Entrada_con_unidades(unidades.Pressure) self.DeltaP.valueChanged.connect(partial(self.changeParams, "DeltaP")) lyt.addWidget(self.DeltaP, 7, 2) lyt.addItem(QtGui.QSpacerItem( 20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 8, 1, 1, 6) group = QtGui.QGroupBox( QtGui.QApplication.translate("pychemqt", "Results")) lyt.addWidget(group, 9, 1, 1, 5) layout = QtGui.QGridLayout(group) layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Output Temperature")), 1, 1) self.temperaturaCalculada = Entrada_con_unidades(unidades.Temperature, retornar=False, readOnly=True) layout.addWidget(self.temperaturaCalculada, 1, 2) layout.addWidget(QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Air Flow")), 2, 1) self.caudalVolumetrico = Entrada_con_unidades(unidades.VolFlow, "QGas", retornar=False, readOnly=True) layout.addWidget(self.caudalVolumetrico, 2, 2) layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Output Air Relative Humidity")), 3, 1) self.HumedadCalculada = Entrada_con_unidades(float, readOnly=True, textounidad="%") layout.addWidget(self.HumedadCalculada, 3, 2) lyt.addItem(QtGui.QSpacerItem( 20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 11, 1, 1, 6) # Output Tab self.addSalida(QtGui.QApplication.translate("pychemqt", "Air"), psychro=True) self.addSalida(QtGui.QApplication.translate("pychemqt", "Dry solid")) if equipment: self.setEquipment(equipment)
def __init__(self, parent=None): super(Definicion_Petro, self).__init__(parent) self.setWindowTitle( QtGui.QApplication.translate("pychemqt", "Petrol component definition")) layout = QtGui.QGridLayout(self) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Name")), 1, 1) self.nombre = QtGui.QLineEdit() self.nombre.textChanged.connect(partial(self.changeParams, "name")) layout.addWidget(self.nombre, 1, 2, 1, 4) layout.addItem( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 2, 1, 1, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Boiling point")), 3, 1) self.Tb = Entrada_con_unidades(Temperature) self.Tb.valueChanged.connect(partial(self.changeParams, "Tb")) layout.addWidget(self.Tb, 3, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Molecular Weight")), 4, 1) self.M = Entrada_con_unidades(float, textounidad="g/mol") self.M.valueChanged.connect(partial(self.changeParams, "M")) layout.addWidget(self.M, 4, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Specific Gravity")), 5, 1) self.SG = Entrada_con_unidades(float) self.SG.valueChanged.connect(partial(self.changeParams, "SG")) layout.addWidget(self.SG, 5, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "API gravity")), 6, 1) self.API = Entrada_con_unidades(float) self.API.valueChanged.connect(partial(self.changeParams, "API")) layout.addWidget(self.API, 6, 2) layout.addWidget(QtGui.QLabel("K watson:"), 7, 1) self.Kw = Entrada_con_unidades(float) self.Kw.valueChanged.connect(partial(self.changeParams, "Kw")) layout.addWidget(self.Kw, 7, 2) layout.addWidget(QtGui.QLabel("C/H:"), 8, 1) self.CH = Entrada_con_unidades(float) self.CH.valueChanged.connect(partial(self.changeParams, "CH")) layout.addWidget(self.CH, 8, 2) layout.addWidget(QtGui.QLabel(u"ν<sub>100F</sub>:"), 9, 1) self.v100 = Entrada_con_unidades(Diffusivity) self.v100.valueChanged.connect(partial(self.changeParams, "v100")) layout.addWidget(self.v100, 9, 2) layout.addWidget(QtGui.QLabel(u"ν<sub>210F</sub>:"), 10, 1) self.v210 = Entrada_con_unidades(Diffusivity) self.v210.valueChanged.connect(partial(self.changeParams, "v210")) layout.addWidget(self.v210, 10, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Refraction index")), 11, 1) self.n = Entrada_con_unidades(float) self.n.valueChanged.connect(partial(self.changeParams, "n")) layout.addWidget(self.n, 11, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Huang parameter")), 12, 1) self.I = Entrada_con_unidades(float) self.I.valueChanged.connect(partial(self.changeParams, "I")) layout.addWidget(self.I, 12, 2) layout.addWidget(QtGui.QLabel("%S"), 13, 1) self.S = Entrada_con_unidades(float, spinbox=True, step=1.0, max=100) self.S.valueChanged.connect(partial(self.changeParams, "S")) layout.addWidget(self.S, 13, 2) layout.addWidget(QtGui.QLabel("%H"), 14, 1) self.H = Entrada_con_unidades(float, spinbox=True, step=1.0, max=100) self.H.valueChanged.connect(partial(self.changeParams, "H")) layout.addWidget(self.H, 14, 2) layout.addWidget(QtGui.QLabel("%N"), 15, 1) self.N = Entrada_con_unidades(float, spinbox=True, step=1.0, max=100) self.N.valueChanged.connect(partial(self.changeParams, "N")) layout.addWidget(self.N, 15, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Carbons number")), 19, 1) self.carbonos = Entrada_con_unidades(int, width=50, spinbox=True, step=1, start=7, min=5, max=100) self.N.valueChanged.connect(partial(self.changeParams, "Nc")) layout.addWidget(self.carbonos, 19, 2) layout.addItem( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 3, 3, 15, 1) self.checkCurva = QtGui.QCheckBox( QtGui.QApplication.translate("pychemqt", "Define destillation curve")) layout.addWidget(self.checkCurva, 3, 4, 1, 2) self.tipoCurva = QtGui.QComboBox() self.tipoCurva.addItem("ASTM D86") self.tipoCurva.addItem("TBP") self.tipoCurva.addItem("EFV") self.tipoCurva.addItem("ASTM D1186") self.tipoCurva.addItem("ASTM D2887 (SD)") self.tipoCurva.setEnabled(False) layout.addWidget(self.tipoCurva, 4, 4, 1, 2) self.textoPresion = QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Pressure")) self.textoPresion.setEnabled(False) layout.addWidget(self.textoPresion, 5, 4) self.presion = Entrada_con_unidades(Pressure, value=101325.) self.presion.setEnabled(False) self.presion.valueChanged.connect(partial(self.changeParams, "P_dist")) layout.addWidget(self.presion, 5, 5) self.curvaDestilacion = Tabla( 2, filas=1, horizontalHeader=["%dist", "Tb, " + Temperature.text()], verticalHeader=False, dinamica=True) self.curvaDestilacion.setEnabled(False) self.curvaDestilacion.editingFinished.connect(self.changeCurva) layout.addWidget(self.curvaDestilacion, 6, 4, 13, 2) self.checkBlend = QtGui.QCheckBox( QtGui.QApplication.translate("pychemqt", "Blend if its necessary")) layout.addWidget(self.checkBlend, 19, 4, 1, 2) self.checkCurva.toggled.connect(self.tipoCurva.setEnabled) self.checkCurva.toggled.connect(self.presion.setEnabled) self.checkCurva.toggled.connect(self.textoPresion.setEnabled) self.checkCurva.toggled.connect(self.curvaDestilacion.setEnabled) layout.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 20, 1, 1, 2) self.checkCrudo = QtGui.QCheckBox( QtGui.QApplication.translate("pychemqt", "Use petrol fraction from list")) self.checkCrudo.toggled.connect(self.changeUnknown) layout.addWidget(self.checkCrudo, 21, 1, 1, 2) self.crudo = QtGui.QComboBox() self.crudo.setEnabled(False) self.crudo.addItem("") for i in crudo[1:]: self.crudo.addItem("%s (%s) API: %s %S: %s" % (i[0], i[1], i[3], i[4])) # i[0]+" ("+i[1]+")"+" API: "+str(i[3])+" %S: "+str(i[4])) self.crudo.currentIndexChanged.connect( partial(self.changeParams, "indice")) layout.addWidget(self.crudo, 23, 1, 1, 5) layout.addWidget(QtGui.QLabel("Pseudo C+"), 24, 1) self.Cplus = Entrada_con_unidades(int, width=50, spinbox=True, step=1, min=6) self.Cplus.valueChanged.connect(partial(self.changeParams, "Cplus")) layout.addWidget(self.Cplus, 24, 2) self.checkCrudo.toggled.connect(self.crudo.setEnabled) self.checkCrudo.toggled.connect(self.Cplus.setEnabled) layout.addItem( QtGui.QSpacerItem(5, 5, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 29, 1, 1, 2) newComponent.loadUI(self) self.Petroleo = Petroleo() self.Crudo = Crudo()
def __init__(self, metodo, parent=None): """Metodo: name of group contribution method: Joback Constantinou-Gani Wilson-Jasperson Marrero-Pardillo Elliott Ambrose """ super(Ui_Contribution, self).__init__(parent) self.setWindowTitle( QtGui.QApplication.translate( "pychemqt", "Select the component group for method") + " " + metodo) self.grupo = [] self.indices = [] self.contribucion = [] self.metodo = metodo layout = QtGui.QGridLayout(self) self.Grupos = QtGui.QTableWidget() self.Grupos.verticalHeader().hide() self.Grupos.setRowCount(0) self.Grupos.setColumnCount(2) self.Grupos.setHorizontalHeaderItem(0, QtGui.QTableWidgetItem("Nk")) self.Grupos.setHorizontalHeaderItem( 1, QtGui.QTableWidgetItem( QtGui.QApplication.translate("pychemqt", "Group"))) self.Grupos.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.Grupos.setSortingEnabled(True) self.Grupos.horizontalHeader().setStretchLastSection(True) self.Grupos.setColumnWidth(0, 50) self.Grupos.setItemDelegateForColumn(0, SpinEditor(self)) self.Grupos.cellChanged.connect(self.cellChanged) self.Grupos.setEditTriggers(QtGui.QAbstractItemView.AllEditTriggers) layout.addWidget(self.Grupos, 0, 0, 3, 3) self.Formula = QtGui.QLabel() font = QtGui.QFont() font.setPointSize(12) self.Formula.setFont(font) self.Formula.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter) self.Formula.setFixedHeight(50) layout.addWidget(self.Formula, 0, 3) self.botonBorrar = QtGui.QPushButton( QtGui.QIcon( QtGui.QPixmap(os.environ["pychemqt"] + "/images/button/editDelete.png")), QtGui.QApplication.translate("pychemqt", "Delete")) self.botonBorrar.clicked.connect(self.borrar) layout.addWidget(self.botonBorrar, 1, 3) self.botonClear = QtGui.QPushButton( QtGui.QIcon( QtGui.QPixmap(os.environ["pychemqt"] + "/images/button/clear.png")), QtGui.QApplication.translate("pychemqt", "Clear")) self.botonClear.clicked.connect(self.clear) layout.addWidget(self.botonClear, 2, 3) self.line = QtGui.QFrame() self.line.setFrameShape(QtGui.QFrame.HLine) self.line.setFrameShadow(QtGui.QFrame.Sunken) layout.addWidget(self.line, 3, 0, 1, 4) self.TablaContribuciones = QtGui.QListWidget() self.TablaContribuciones.currentItemChanged.connect( self.selectedChanged) self.TablaContribuciones.itemDoubleClicked.connect(self.add) layout.addWidget(self.TablaContribuciones, 4, 0, 7, 3) self.botonAdd = QtGui.QPushButton( QtGui.QIcon( QtGui.QPixmap(os.environ["pychemqt"] + "/images/button/add.png")), QtGui.QApplication.translate("pychemqt", "Add")) self.botonAdd.setDisabled(True) self.botonAdd.clicked.connect(self.add) layout.addWidget(self.botonAdd, 4, 3) layout.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 5, 1, 1, 1) # Show widget for specific method if metodo in ["Constantinou", "Wilson"]: self.Order1 = QtGui.QRadioButton( QtGui.QApplication.translate("pychemqt", "1st order")) self.Order1.setChecked(True) self.Order1.toggled.connect(self.Order) layout.addWidget(self.Order1, 6, 3) self.Order2 = QtGui.QRadioButton( QtGui.QApplication.translate("pychemqt", "2nd order")) layout.addWidget(self.Order2, 7, 3) if metodo == "Wilson": layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Rings")), 8, 3) self.anillos = QtGui.QSpinBox() self.anillos.valueChanged.connect( partial(self.changeParams, "ring")) layout.addWidget(self.anillos, 9, 3) if metodo == "Marrero": layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Atoms")), 8, 3) self.Atomos = QtGui.QSpinBox() self.Atomos.valueChanged.connect( partial(self.changeParams, "atomos")) layout.addWidget(self.Atomos, 9, 3) if metodo == "Ambrose": layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Platt number")), 8, 3) self.Platt = QtGui.QSpinBox() self.Platt.setToolTip( QtGui.QApplication.translate( "pychemqt", "The Platt number is the number of pairs of carbon \ atoms which are separated \nby three carbon-carbon bonds and \ is an indicator of the degree of branching in the molecule.\n\ The Platt number of an n-alkane is equal to the number of \ carbons minus three")) self.Platt.valueChanged.connect(partial(self.changeParams, "platt")) layout.addWidget(self.Platt, 9, 3) layout.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 10, 1, 1, 1) layout.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 11, 0, 1, 4) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Name")), 12, 0) self.nombre = QtGui.QLineEdit() self.nombre.textChanged.connect(partial(self.changeParams, "name")) layout.addWidget(self.nombre, 12, 1, 1, 3) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Molecular Weight")), 13, 0) self.M = Entrada_con_unidades(float, textounidad="g/mol") self.M.valueChanged.connect(partial(self.changeParams, "M")) layout.addWidget(self.M, 13, 1) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Boiling point")), 14, 0) self.Tb = Entrada_con_unidades(Temperature) self.Tb.valueChanged.connect(partial(self.changeParams, "Tb")) layout.addWidget(self.Tb, 14, 1) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Specific Gravity")), 15, 0) self.SG = Entrada_con_unidades(float) self.SG.valueChanged.connect(partial(self.changeParams, "SG")) layout.addWidget(self.SG, 15, 1) newComponent.loadUI(self) func = { "Constantinou": Constantinou_Gani, "Wilson": Wilson_Jasperson, "Joback": Joback, "Ambrose": Ambrose, "Elliott": Elliott, "Marrero": Marrero_Pardillo } self.unknown = func[self.metodo]() for i, nombre in enumerate(self.unknown.coeff["txt"]): self.TablaContribuciones.addItem(nombre[0]) if metodo in ["Constantinou", "Wilson"]: self.Order()
def __init__(self, state=None, readOnly=False, parent=None): """ constructor optional state parameter to assign initial psychrometric state """ super(PsychroInput, self).__init__(parent) self.state = PsychroState(P=101325) layout = QtWidgets.QGridLayout(self) self.checkPresion = QtWidgets.QRadioButton( QtWidgets.QApplication.translate("pychemqt", "Pressure")) layout.addWidget(self.checkPresion, 1, 1, 1, 1) self.P = Entrada_con_unidades(Pressure, value=101325) self.P.valueChanged.connect(self.changePressure) layout.addWidget(self.P, 1, 2, 1, 1) self.checkAltitud = QtWidgets.QRadioButton( QtWidgets.QApplication.translate("pychemqt", "Altitude")) layout.addWidget(self.checkAltitud, 2, 1, 1, 1) self.z = Entrada_con_unidades(Length, value=0) self.checkPresion.toggled.connect(self.P.setEnabled) self.checkAltitud.toggled.connect(self.z.setEnabled) self.z.valueChanged.connect(self.changeAltitude) self.checkPresion.setChecked(True) self.z.setEnabled(False) layout.addWidget(self.z, 2, 2, 1, 1) layout.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 3, 1, 1, 2) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Select point")), 4, 1, 1, 2) self.variables = QtWidgets.QComboBox() for txt in PsyState.TEXT_MODE: self.variables.addItem(txt) self.variables.currentIndexChanged.connect(self.updateInputs) layout.addWidget(self.variables, 5, 1, 1, 2) layout.addWidget(QtWidgets.QLabel("Tdb:"), 6, 1, 1, 1) self.tdb = Entrada_con_unidades(Temperature) self.tdb.valueChanged.connect(partial(self.updateKwargs, "tdb")) layout.addWidget(self.tdb, 6, 2, 1, 1) layout.addWidget(QtWidgets.QLabel("Twb:"), 7, 1, 1, 1) self.twb = Entrada_con_unidades(Temperature) self.twb.valueChanged.connect(partial(self.updateKwargs, "twb")) layout.addWidget(self.twb, 7, 2, 1, 1) layout.addWidget(QtWidgets.QLabel("Tdp:"), 8, 1, 1, 1) self.tdp = Entrada_con_unidades(Temperature) self.tdp.valueChanged.connect(partial(self.updateKwargs, "tdp")) layout.addWidget(self.tdp, 8, 2, 1, 1) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Humidity Ratio:")), 9, 1, 1, 1) self.w = Entrada_con_unidades(float, textounidad="kgw/kgda") self.w.valueChanged.connect(partial(self.updateKwargs, "w")) layout.addWidget(self.w, 9, 2, 1, 1) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Relative humidity:")), 10, 1, 1, 1) self.HR = Entrada_con_unidades(float, textounidad="%") self.HR.valueChanged.connect(partial(self.updateKwargs, "HR")) layout.addWidget(self.HR, 10, 2, 1, 1) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Volume")), 11, 1, 1, 1) self.v = Entrada_con_unidades(SpecificVolume) self.v.valueChanged.connect(partial(self.updateKwargs, "v")) layout.addWidget(self.v, 11, 2, 1, 1) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Enthalpy")), 12, 1, 1, 1) self.h = Entrada_con_unidades(Enthalpy) self.h.valueChanged.connect(partial(self.updateKwargs, "h")) layout.addWidget(self.h, 12, 2, 1, 1) layout.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 13, 1, 1, 2) self.setReadOnly(readOnly) self.updateInputs(0) if state: self.setState(state)
def __init__(self, equipment=None, parent=None): """ equipment: Initial equipment instance to model """ super(UI_equipment, self).__init__(Shell_Tube, parent=parent) # Input tab self.addEntrada(QtWidgets.QApplication.translate("pychemqt", "Tubes"), "entradaTubo") self.addEntrada(QtWidgets.QApplication.translate("pychemqt", "Shell"), "entradaCarcasa") # Model tab tab = QtWidgets.QWidget() self.tabWidget.insertTab( 1, tab, QtWidgets.QApplication.translate("pychemqt", "Model")) lyt = QtWidgets.QGridLayout(tab) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Class")), 2, 1) self.class_ = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_CLASS: self.class_.addItem(txt) self.class_.currentIndexChanged.connect( partial(self.changeParams, "class_")) lyt.addWidget(self.class_, 2, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Front end head")), 3, 1) self.frontHead = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_FRONTHEAD: self.frontHead.addItem(txt) self.frontHead.currentIndexChanged.connect( partial(self.changeParams, "frontHead")) lyt.addWidget(self.frontHead, 3, 2, 1, 3) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Shell type")), 4, 1) self.shell = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_SHELL: self.shell.addItem(txt) self.shell.currentIndexChanged.connect( partial(self.changeParams, "shell")) lyt.addWidget(self.shell, 4, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Rear end head")), 5, 1) self.rearHead = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_REARHEAD: self.rearHead.addItem(txt) self.rearHead.currentIndexChanged.connect( partial(self.changeParams, "rearHead")) lyt.addWidget(self.rearHead, 5, 2, 1, 2) lyt.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 6, 1, 1, 6) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Orientation")), 7, 1) self.orientacion = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_ORIENTATION: self.orientacion.addItem(txt) self.orientacion.currentIndexChanged.connect( partial(self.changeParams, "orientation")) lyt.addWidget(self.orientacion, 7, 2) botonMetodos = QtWidgets.QPushButton( QtWidgets.QApplication.translate("pychemqt", "Calculation methods")) botonMetodos.clicked.connect(self.selectMethods) lyt.addWidget(botonMetodos, 9, 1) lyt.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 6) # Tubes tab tab = QtWidgets.QWidget() self.tabWidget.insertTab( 2, tab, QtWidgets.QApplication.translate("pychemqt", "Tubes")) lyt = QtWidgets.QGridLayout(tab) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Number of tubes")), 1, 1) self.NTubes = Entrada_con_unidades(int, width=60, spinbox=True, step=1) self.NTubes.valueChanged.connect(partial(self.changeParams, "NTube")) lyt.addWidget(self.NTubes, 1, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Number of tube passes")), 2, 1) self.NPases = Entrada_con_unidades(int, width=60, spinbox=True, step=1) self.NPases.valueChanged.connect(partial(self.changeParams, "NPases")) lyt.addWidget(self.NPases, 2, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Tube length")), 3, 1) self.LTube = Entrada_con_unidades(Length) self.LTube.valueChanged.connect(partial(self.changeParams, "LTube")) lyt.addWidget(self.LTube, 3, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Tube external diameter")), 4, 1) self.DeTube = Entrada_con_unidades(Length, "pipeDiameter") self.DeTube.valueChanged.connect(partial(self.changeParams, "DeTube")) lyt.addWidget(self.DeTube, 4, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Tube thickness")), 5, 1) self.wTube = Entrada_con_unidades(Length, "Thickness") self.wTube.valueChanged.connect(partial(self.changeParams, "wTube")) lyt.addWidget(self.wTube, 5, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Tube roughness")), 6, 1) self.rTube = Entrada_con_unidades(Length, "Thickness") self.rTube.valueChanged.connect(partial(self.changeParams, "rTube")) lyt.addWidget(self.rTube, 6, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Thermal conductivity")), 7, 1) self.kTube = Entrada_con_unidades(ThermalConductivity) self.kTube.valueChanged.connect(partial(self.changeParams, "kTube")) lyt.addWidget(self.kTube, 7, 2) self.buttonPipe = QtWidgets.QPushButton( QtWidgets.QApplication.translate("pychemqt", "Pipe Database")) self.buttonPipe.clicked.connect(self.showMaterial) lyt.addWidget(self.buttonPipe, 4, 4, 4, 1) lyt.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 8, 1, 1, 6) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Tube pattern")), 9, 1) self.distribucionTube = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_DISTRIBUTION_TUBE: self.distribucionTube.addItem(txt) self.distribucionTube.currentIndexChanged.connect( partial(self.changeParams, "distribucionTube")) lyt.addWidget(self.distribucionTube, 9, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Tube pitch")), 10, 1) self.pitch = Entrada_con_unidades(Length) self.pitch.valueChanged.connect(partial(self.changeParams, "pitch")) lyt.addWidget(self.pitch, 10, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Fin Tube")), 11, 1) self.buttonFin = QtWidgets.QPushButton( QtWidgets.QApplication.translate("pychemqt", "Finned Pipe Database")) self.buttonFin.setEnabled(False) self.buttonFin.clicked.connect(self.showFinTube) lyt.addWidget(self.buttonFin, 11, 4, 1, 1) self.finned = QtWidgets.QComboBox() self.finned.addItem( QtWidgets.QApplication.translate("pychemqt", "Bared tube")) self.finned.addItem( QtWidgets.QApplication.translate("pychemqt", "Finned tube")) self.finned.currentIndexChanged.connect(self.finnedChanged) lyt.addWidget(self.finned, 11, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Fouling")), 12, 1) self.tubeFouling = FoulingWidget() self.tubeFouling.valueChanged.connect( partial(self.changeParams, "tubeFouling")) lyt.addWidget(self.tubeFouling, 12, 2, 1, 3) lyt.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 15, 1, 1, 6) # Shell tab tab = QtWidgets.QWidget() self.tabWidget.insertTab( 3, tab, QtWidgets.QApplication.translate("pychemqt", "Shell")) lyt = QtWidgets.QGridLayout(tab) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Exchangers in paralell")), 1, 1) self.paralelo = Entrada_con_unidades(int, width=60) self.paralelo.valueChanged.connect( partial(self.changeParams, "parallel")) lyt.addWidget(self.paralelo, 1, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Exchangers in serie")), 2, 1) self.serie = Entrada_con_unidades(int, width=60) self.serie.valueChanged.connect(partial(self.changeParams, "serie")) lyt.addWidget(self.serie, 2, 2) lyt.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 3, 1, 1, 6) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Shell Diameter")), 4, 1) self.DShell = Entrada_con_unidades(Length) self.DShell.valueChanged.connect(partial(self.changeParams, "DShell")) lyt.addWidget(self.DShell, 4, 2) lyt.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 5, 1, 1, 6) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Shell Material")), 6, 1) self.materialShell = QtWidgets.QComboBox() lyt.addWidget(self.materialShell, 6, 2) lyt.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 7, 1, 1, 6) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Fouling")), 8, 1) self.shellFouling = FoulingWidget() self.shellFouling.valueChanged.connect( partial(self.changeParams, "shellFouling")) lyt.addWidget(self.shellFouling, 8, 2, 1, 2) lyt.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 9, 1, 1, 6) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Sealing Strips")), 10, 1) self.sealingStrips = Entrada_con_unidades(float) self.sealingStrips.valueChanged.connect( partial(self.changeParams, "sealingStrips")) lyt.addWidget(self.sealingStrips, 10, 2) group = QtWidgets.QGroupBox( QtWidgets.QApplication.translate("pychemqt", "Clearances")) lyt.addWidget(group, 11, 1, 1, 6) lyt = QtWidgets.QGridLayout(group) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Tube to baffle hole")), 1, 1) self.ClearanceTubeBaffle = Entrada_con_unidades(Length, "Thickness") self.ClearanceTubeBaffle.valueChanged.connect( partial(self.changeParams, "clearanceTubeBaffle")) lyt.addWidget(self.ClearanceTubeBaffle, 1, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Shell to baffle")), 2, 1) self.ClearanceShellBaffle = Entrada_con_unidades(Length, "Thickness") self.ClearanceShellBaffle.valueChanged.connect( partial(self.changeParams, "clearanceShellBaffle")) lyt.addWidget(self.ClearanceShellBaffle, 2, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Shell to bundle")), 3, 1) self.ClearanceShellBundle = Entrada_con_unidades(Length, "Thickness") self.ClearanceShellBundle.valueChanged.connect( partial(self.changeParams, "clearanceShellBundle")) lyt.addWidget(self.ClearanceShellBundle, 3, 2) lyt.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 15, 1, 1, 6) # Fitting tab tab = QtWidgets.QWidget() self.tabWidget.insertTab( 4, tab, QtWidgets.QApplication.translate("pychemqt", "Baffle")) lyt = QtWidgets.QGridLayout(tab) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Baffle type")), 1, 1) self.baffleType = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_BAFFLE_TYPE: self.baffleType.addItem(txt) self.baffleType.currentIndexChanged.connect( partial(self.changeParams, "baffleType")) lyt.addWidget(self.baffleType, 1, 2) lyt.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 2, 1, 1, 6) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Inlet spacing")), 3, 1) self.baffleSpacingIn = Entrada_con_unidades(Length) self.baffleSpacingIn.valueChanged.connect( partial(self.changeParams, "baffleSpacingIn")) lyt.addWidget(self.baffleSpacingIn, 3, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Outlet spacing")), 3, 4) self.baffleSpacingOut = Entrada_con_unidades(Length) self.baffleSpacingOut.valueChanged.connect( partial(self.changeParams, "baffleSpacingOut")) lyt.addWidget(self.baffleSpacingOut, 3, 5) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Baffle spacing")), 4, 1) self.baffleSpacing = Entrada_con_unidades(Length) self.baffleSpacing.valueChanged.connect( partial(self.changeParams, "baffleSpacing")) lyt.addWidget(self.baffleSpacing, 4, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Baffle thickness")), 5, 1) self.baffleThickness = Entrada_con_unidades(Length, "Thickness") self.baffleThickness.valueChanged.connect( partial(self.changeParams, "baffleThickness")) lyt.addWidget(self.baffleThickness, 5, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Orientation")), 6, 1) self.baffleOrientation = QtWidgets.QComboBox() self.baffleOrientation.addItem( QtWidgets.QApplication.translate("pychemqt", "Horizontal")) self.baffleOrientation.addItem( QtWidgets.QApplication.translate("pychemqt", "Vertical")) self.baffleOrientation.currentIndexChanged.connect( partial(self.changeParams, "baffleOrientation")) lyt.addWidget(self.baffleOrientation, 6, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Cut percent")), 7, 1) self.baffleCut = Entrada_con_unidades(float, textounidad="%") self.baffleCut.valueChanged.connect( partial(self.changeParams, "baffleCut")) lyt.addWidget(self.baffleCut, 7, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Cut base")), 7, 4) self.baffleCutBase = QtWidgets.QComboBox() self.baffleCutBase.addItem( QtWidgets.QApplication.translate("pychemqt", "Diameter")) self.baffleCutBase.addItem( QtWidgets.QApplication.translate("pychemqt", "Area")) self.baffleCutBase.currentIndexChanged.connect( partial(self.changeParams, "baffleCutBase")) lyt.addWidget(self.baffleCutBase, 7, 5) lyt.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 1, 3, 6, 1) lyt.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 8, 1, 1, 6) group = QtWidgets.QGroupBox( QtWidgets.QApplication.translate("pychemqt", "Nozzles")) lyt.addWidget(group, 9, 1, 1, 6) layout = QtWidgets.QGridLayout(group) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Shellside")), 0, 2) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Tubeside")), 0, 3) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Input diameter")), 1, 1) self.nozzleInShellsideDiameter = Entrada_con_unidades( Length, "PipeDiameter") self.nozzleInShellsideDiameter.valueChanged.connect( partial(self.changeParams, "nozzleInShellsideDiameter")) layout.addWidget(self.nozzleInShellsideDiameter, 1, 2) self.nozzleInTubesideDiameter = Entrada_con_unidades( Length, "PipeDiameter") self.nozzleInTubesideDiameter.valueChanged.connect( partial(self.changeParams, "nozzleInTubesideDiameter")) layout.addWidget(self.nozzleInTubesideDiameter, 1, 3) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Output diameter")), 2, 1) self.nozzleOutShellsideDiameter = Entrada_con_unidades( Length, "PipeDiameter") self.nozzleOutShellsideDiameter.valueChanged.connect( partial(self.changeParams, "nozzleOutShellsideDiameter")) layout.addWidget(self.nozzleOutShellsideDiameter, 2, 2) self.nozzleOutTubesideDiameter = Entrada_con_unidades( Length, "PipeDiameter") self.nozzleOutTubesideDiameter.valueChanged.connect( partial(self.changeParams, "nozzleOutTubesideDiameter")) layout.addWidget(self.nozzleOutTubesideDiameter, 2, 3) layout.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed), 1, 4, 2, 1) lyt.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 15, 1, 1, 6) # Calculate tab lyt = QtWidgets.QGridLayout(self.tabCalculo) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Calculation Mode")), 1, 1) self.modo = QtWidgets.QComboBox() self.modo.addItem( QtWidgets.QApplication.translate("pychemqt", "Rating")) self.modo.addItem( QtWidgets.QApplication.translate("pychemqt", "Design")) lyt.addWidget(self.modo, 1, 2) lyt.addItem( QtWidgets.QSpacerItem(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 __init__(self, equipment=None, parent=None): """ equipment: Initial equipment instance to model """ super(UI_equipment, self).__init__(Heat_Exchanger, entrada=False, salida=False, parent=parent) # Calculate tab lyt = QtGui.QGridLayout(self.tabCalculo) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Output temperature")), 1, 1) self.Tout = Entrada_con_unidades(Temperature) self.Tout.valueChanged.connect(partial(self.changeParams, "Tout")) lyt.addWidget(self.Tout, 1, 2) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Temperature increase")), 2, 1) self.DeltaT = Entrada_con_unidades(DeltaT) self.DeltaT.valueChanged.connect(partial(self.changeParams, "DeltaT")) lyt.addWidget(self.DeltaT, 2, 2) lyt.addWidget(QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Heat Duty")), 3, 1) self.Heat = Entrada_con_unidades(Power) self.Heat.valueChanged.connect(partial(self.changeParams, "Heat")) lyt.addWidget(self.Heat, 3, 2) group = QtGui.QGroupBox( QtGui.QApplication.translate("pychemqt", "Heat Transfer")) lyt.addWidget(group, 4, 1, 1, 2) lyt = QtGui.QGridLayout(group) lyt.addWidget(QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Area")), 1, 1) self.A = Entrada_con_unidades(Area) self.A.valueChanged.connect(partial(self.changeParams, "A")) lyt.addWidget(self.A, 1, 2) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Heat Transfer Coefficient")), 2, 1) self.U = Entrada_con_unidades(HeatTransfCoef) self.U.valueChanged.connect(partial(self.changeParams, "U")) lyt.addWidget(self.U, 2, 2) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "External Temperature")), 3, 1) self.Text = Entrada_con_unidades(Temperature) self.Text.valueChanged.connect(partial(self.changeParams, "Text")) lyt.addWidget(self.Text, 3, 2) lyt.addItem(QtGui.QSpacerItem( 10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 5, 0, 1, 3) lyt.addWidget(QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Pressure loss")), 6, 1) self.DeltaP = Entrada_con_unidades(DeltaP, value=0) self.DeltaP.valueChanged.connect(partial(self.changeParams, "DeltaP")) lyt.addWidget(self.DeltaP, 6, 2) lyt.addItem(QtGui.QSpacerItem( 20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 7, 0, 1, 3) group = QtGui.QGroupBox( QtGui.QApplication.translate("pychemqt", "Results")) lyt.addWidget(group, 8, 1, 1, 5) layout = QtGui.QGridLayout(group) layout.addWidget(QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Heat Duty")), 0, 1) self.HeatCalc = Entrada_con_unidades(Power, retornar=False) self.HeatCalc.setReadOnly(True) layout.addWidget(self.HeatCalc, 0, 2) layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Output Temperature")), 1, 1) self.ToutCalc = Entrada_con_unidades(Temperature, retornar=False) self.ToutCalc.setReadOnly(True) layout.addWidget(self.ToutCalc, 1, 2) lyt.addItem(QtGui.QSpacerItem( 0, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 9, 0, 1, 3) if equipment: self.setEquipment(equipment)
def __init__(self, pen=None, parent=None): super(ConfLine, self).__init__(parent) lyt = QtWidgets.QVBoxLayout(self) lyt1 = QtWidgets.QHBoxLayout() lyt1.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Line"))) self.ColorButtonLine = ColorSelector() self.ColorButtonLine.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Default line color")) lyt1.addWidget(self.ColorButtonLine) self.width = Entrada_con_unidades(float, width=50, decimales=1, spinbox=True, step=0.1, textounidad="px") self.width.entrada.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Line Width")) lyt1.addWidget(self.width) lyt.addLayout(lyt1) lyt2 = QtWidgets.QHBoxLayout() lyt2.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Join"))) self.mitterLimit = Entrada_con_unidades(float, width=50, decimales=1, spinbox=True, step=0.1) self.mitterLimit.entrada.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Mitter Limit")) lyt2.addWidget(self.mitterLimit) toolJoinMitter = QtWidgets.QToolButton() toolJoinMitter.setIcon( QtGui.QIcon( QtGui.QPixmap(os.environ["CheProcess"] + os.path.join( "images", "button", "stroke-join-miter.png")))) toolJoinMitter.setIconSize(QtCore.QSize(24, 24)) toolJoinMitter.setCheckable(True) toolJoinMitter.setToolTip( QtWidgets.QApplication.translate( "pychemqt", "Join mitter: The triangular notch between the two lines is not " "filled")) lyt2.addWidget(toolJoinMitter) toolJoinBevel = QtWidgets.QToolButton() toolJoinBevel.setIcon( QtGui.QIcon( QtGui.QPixmap(os.environ["CheProcess"] + os.path.join( "images", "button", "stroke-join-bevel.png")))) toolJoinBevel.setIconSize(QtCore.QSize(24, 24)) toolJoinBevel.setCheckable(True) toolJoinBevel.setToolTip( QtWidgets.QApplication.translate( "pychemqt", "Join bevel: The triangular notch between the two lines is " "filled")) lyt2.addWidget(toolJoinBevel) toolJoinRound = QtWidgets.QToolButton() toolJoinRound.setIcon( QtGui.QIcon( QtGui.QPixmap(os.environ["CheProcess"] + os.path.join( "images", "button", "stroke-join-round.png")))) toolJoinRound.setIconSize(QtCore.QSize(24, 24)) toolJoinRound.setCheckable(True) toolJoinRound.setToolTip( QtWidgets.QApplication.translate( "pychemqt", "Join round: A circular arc between the two lines is filled")) lyt2.addWidget(toolJoinRound) self.groupJoint = QtWidgets.QButtonGroup() self.groupJoint.addButton(toolJoinMitter) self.groupJoint.addButton(toolJoinBevel) self.groupJoint.addButton(toolJoinRound) self.groupJoint.buttonClicked["int"].connect(self.mitterlimitEnabled) lyt.addLayout(lyt2) lyt3 = QtWidgets.QHBoxLayout() lyt3.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Cap"))) toolCapFlat = QtWidgets.QToolButton() toolCapFlat.setIcon( QtGui.QIcon( QtGui.QPixmap( os.environ["CheProcess"] + os.path.join("images", "button", "stroke-cap-butt.png")))) toolCapFlat.setIconSize(QtCore.QSize(24, 24)) toolCapFlat.setCheckable(True) toolCapFlat.setToolTip( QtWidgets.QApplication.translate( "pychemqt", "Flat Cap: A square line end that does not cover the end point of " "the line")) lyt3.addWidget(toolCapFlat) toolCapRound = QtWidgets.QToolButton() toolCapRound.setIcon( QtGui.QIcon( QtGui.QPixmap( os.environ["CheProcess"] + os.path.join("images", "button", "stroke-cap-round.png")))) toolCapRound.setIconSize(QtCore.QSize(24, 24)) toolCapRound.setCheckable(True) toolCapRound.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Round Cap: A rounded line end")) lyt3.addWidget(toolCapRound) toolCapSquare = QtWidgets.QToolButton() toolCapSquare.setIcon( QtGui.QIcon( QtGui.QPixmap(os.environ["CheProcess"] + os.path.join( "images", "button", "stroke-cap-square.png")))) toolCapSquare.setIconSize(QtCore.QSize(24, 24)) toolCapSquare.setCheckable(True) toolCapSquare.setToolTip( QtWidgets.QApplication.translate( "pychemqt", "Square Cap: A square line end that covers the end point and " "extends beyond it by half the line width")) lyt3.addWidget(toolCapSquare) self.groupCap = QtWidgets.QButtonGroup() self.groupCap.addButton(toolCapFlat) self.groupCap.addButton(toolCapRound) self.groupCap.addButton(toolCapSquare) lyt.addLayout(lyt3) lyt4 = QtWidgets.QHBoxLayout() lyt4.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Dash"))) self.guion = PFDLineCombo() lyt4.addWidget(self.guion) self.dashOffset = Entrada_con_unidades(float, width=50, decimales=1, spinbox=True, step=0.1) self.dashOffset.entrada.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Dash offset")) lyt4.addWidget(self.dashOffset) lyt.addLayout(lyt4) lyt.addItem( QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)) if pen: self.ColorButtonLine.setColor(pen.color().name()) self.groupJoint.button( (self.join.index(pen.joinStyle()) + 2) * -1).setChecked(True) self.mitterLimit.setValue(pen.miterLimit()) self.groupCap.button( (self.cap.index(pen.capStyle()) + 2) * -1).setChecked(True) self.guion.setCurrentIndex(self.line.index(pen.style())) self.dashOffset.setValue(pen.dashOffset()) self.width.setValue(pen.widthF())
def __init__(self, entrada=None, parent=None): """entrada: Parametro opcional de clase corriente que indica la corriente de entrada en kla tubería""" super(UI_equipment, self).__init__(Grinder, entrada=False, salida=False, parent=parent) self.entrada = entrada #Pestaña entrada self.Entrada = UI_corriente.Ui_corriente(entrada) self.Entrada.Changed.connect(self.cambiar_entrada) self.tabWidget.insertTab( 0, self.Entrada, QtWidgets.QApplication.translate("equipment", "Entrada", None)) #Pestaña calculo gridLayout_Calculo = QtWidgets.QGridLayout(self.tabCalculo) gridLayout_Calculo.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("equipment", "Índice de trabajo de bond:", None)), 1, 0, 1, 1) self.Material = QtWidgets.QComboBox() self.Material.addItem( QtWidgets.QApplication.translate("equipment", "Definido por el usuario", None)) for key in sorted(BondIndex.keys()): self.Material.addItem(key) self.Material.currentIndexChanged[str].connect( self.cambiarBondWordIndex) gridLayout_Calculo.addWidget(self.Material, 1, 1, 1, 1) self.BondWorkIndex = Entrada_con_unidades(float) gridLayout_Calculo.addWidget(self.BondWorkIndex, 1, 2, 1, 1) gridLayout_Calculo.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 10, 0, 1, 5) #Pestaña costos gridLayout_Costos = QtWidgets.QGridLayout(self.tabCostos) gridLayout_Costos.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("equipment", "Tipo:", None)), 1, 1, 1, 1) self.tipo = QtWidgets.QComboBox() self.tipo.addItem( QtWidgets.QApplication.translate("equipment", "De cono", None)) self.tipo.addItem( QtWidgets.QApplication.translate("equipment", "Giratorio", None)) self.tipo.addItem( QtWidgets.QApplication.translate("equipment", "Dentado", None)) self.tipo.addItem( QtWidgets.QApplication.translate("equipment", "De martillo", None)) self.tipo.addItem( QtWidgets.QApplication.translate("equipment", "De bolas", None)) self.tipo.addItem( QtWidgets.QApplication.translate("equipment", "Pulverizador", None)) self.tipo.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.tipo, 1, 2, 1, 1) gridLayout_Costos.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 2, 1, 1, 2) self.Costos = costIndex.CostData(1.3, 2) self.Costos.valueChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.Costos, 4, 1, 2, 5) gridLayout_Costos.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 6, 1, 1, 6) gridLayout_Costos.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 6) self.groupBox_Costos = QtWidgets.QGroupBox( QtWidgets.QApplication.translate("equipment", "Costos calculados", None)) gridLayout_Costos.addWidget(self.groupBox_Costos, 7, 1, 1, 6) gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_Costos) gridLayout_5.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("equipment", "Coste Adquisición:", None)), 0, 1, 1, 1) self.C_adq = Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True) gridLayout_5.addWidget(self.C_adq, 0, 2, 1, 1) gridLayout_5.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("equipment", "Coste Instalación:", None)), 1, 1, 1, 1) self.C_inst = Entrada_con_unidades(unidades.Currency, retornar=False, readOnly=True) gridLayout_5.addWidget(self.C_inst, 1, 2, 1, 1) #Pestaña salida self.Salida = UI_corriente.Ui_corriente(readOnly=True) self.tabWidget.insertTab( 3, self.Salida, QtWidgets.QApplication.translate("equipment", "Salida", None)) self.tabWidget.setCurrentIndex(0)
def __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)
def __init__(self, equipment=None, parent=None): """ equipment: Initial equipment instance to model """ super(UI_equipment, self).__init__(Compressor, entrada=False, salida=False, parent=parent) # Calculate tab lyt_Calc = QtGui.QGridLayout(self.tabCalculo) lyt_Calc.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Method:")), 1, 1) self.metodo = QtGui.QComboBox() for txt in self.Equipment.TEXT_METODO: self.metodo.addItem(txt) # self.metodo.addItem(QtGui.QApplication.translate("pychemqt", "Especificar curva de funcionamiento")) self.metodo.currentIndexChanged.connect( self.on_tipoCalculo_currentIndexChanged) lyt_Calc.addWidget(self.metodo, 1, 2, 1, 2) lyt_Calc.addItem(QtGui.QSpacerItem( 40, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 2, 0, 1, 4) lyt_Calc.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Thermodynamic:")), 3, 1) self.termodinamica = QtGui.QComboBox() for txt in self.Equipment.TEXT_TERMODINAMICA: self.termodinamica.addItem(txt) self.termodinamica.currentIndexChanged.connect( partial(self.changeParams, "termodinamica")) lyt_Calc.addWidget(self.termodinamica, 3, 2, 1, 2) lyt_Calc.addItem(QtGui.QSpacerItem( 40, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 4, 0, 1, 4) lyt_Calc.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Out Pressure")), 5, 1) self.Pout = Entrada_con_unidades(Pressure) self.Pout.valueChanged.connect(partial(self.changeParams, "Pout")) lyt_Calc.addWidget(self.Pout, 5, 2) lyt_Calc.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Pressure ratio")), 6, 1) self.razon = Entrada_con_unidades(float) self.razon.valueChanged.connect(partial(self.changeParams, "razon")) lyt_Calc.addWidget(self.razon, 6, 2) lyt_Calc.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Efficiency")), 7, 1) self.rendimiento = Entrada_con_unidades(float) self.rendimiento.valueChanged.connect( partial(self.changeParams, "rendimiento")) lyt_Calc.addWidget(self.rendimiento, 7, 2) lyt_Calc.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Actual Power")), 8, 1) self.trabajo = Entrada_con_unidades(Power) self.trabajo.valueChanged.connect(partial(self.changeParams, "trabajo")) lyt_Calc.addWidget(self.trabajo, 8, 2) lyt_Calc.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Stages")), 9, 1) self.etapas = Entrada_con_unidades(int, spinbox=True, min=1, value=1, step=1) self.etapas.valueChanged.connect(partial(self.changeParams, "etapas")) lyt_Calc.addWidget(self.etapas, 9, 2) lyt_Calc.setRowStretch(10, 1) group = QtGui.QGroupBox() group.setTitle(QtGui.QApplication.translate("pychemqt", "Results")) lyt_Calc.addWidget(group, 12, 1, 1, 2) lyt = QtGui.QGridLayout(group) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Power")), 1, 1) self.power = Entrada_con_unidades(Power, retornar=False, readOnly=True) lyt.addWidget(self.power, 1, 2) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Cp/Cv ratio")), 2, 1) self.cp_cv = Entrada_con_unidades(float, retornar=False, readOnly=True) lyt.addWidget(self.cp_cv, 2, 2) lyt.setColumnStretch(3, 1) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Pressure ratio")), 1, 4) self.razonCalculada = Entrada_con_unidades(float, readOnly=True) lyt.addWidget(self.razonCalculada, 1, 5) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Efficiency")), 2, 4) self.rendimientoCalculado = Entrada_con_unidades(float, readOnly=True) lyt.addWidget(self.rendimientoCalculado, 2, 5) # Cost tab lyt_Cost = QtGui.QGridLayout(self.tabCostos) lyt_Cost.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Compressor:")), 1, 1) self.compresor = QtGui.QComboBox() for txt in self.Equipment.TEXT_COMPRESOR: self.compresor.addItem(txt) self.compresor.currentIndexChanged.connect( partial(self.changeParamsCoste, "compresor")) lyt_Cost.addWidget(self.compresor, 1, 2) lyt_Cost.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Driver:")), 2, 1) self.transmision = QtGui.QComboBox() for txt in self.Equipment.TEXT_TRANSMISION: self.transmision.addItem(txt) self.transmision.currentIndexChanged.connect( partial(self.changeParamsCoste, "transmision")) lyt_Cost.addWidget(self.transmision, 2, 2) lyt_Cost.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Motor:")), 3, 1) self.motor = QtGui.QComboBox() for txt in self.Equipment.TEXT_MOTOR: self.motor.addItem(txt) self.motor.currentIndexChanged.connect( partial(self.changeParamsCoste, "motor")) lyt_Cost.addWidget(self.motor, 3, 2) lyt_Cost.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "RPM:")), 4, 1) self.rpm = QtGui.QComboBox() for txt in self.Equipment.TEXT_RPM: self.rpm.addItem(txt) self.rpm.currentIndexChanged.connect( partial(self.changeParamsCoste, "rpm")) lyt_Cost.addWidget(self.rpm, 4, 2) lyt_Cost.addItem(QtGui.QSpacerItem( 40, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Maximum), 5, 1, 1, 6) self.Costos = CostData(self.Equipment) self.Costos.valueChanged.connect(self.changeParamsCoste) lyt_Cost.addWidget(self.Costos, 6, 1, 1, 3) lyt_Cost.addItem(QtGui.QSpacerItem( 20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 8, 1, 1, 6) lyt_Cost.addItem(QtGui.QSpacerItem( 20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 10, 1, 1, 6) group = QtGui.QGroupBox() group.setTitle(QtGui.QApplication.translate("pychemqt", "Stimated Costs")) lyt_Cost.addWidget(group, 9, 1, 1, 5) lyt = QtGui.QGridLayout(group) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Compressor")), 0, 0) self.C_comp = Entrada_con_unidades(Currency, retornar=False, tolerancia=8, decimales=2) self.C_comp.setReadOnly(True) lyt.addWidget(self.C_comp, 0, 1) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Drive")), 1, 0) self.C_trans = Entrada_con_unidades(Currency, retornar=False, tolerancia=8, decimales=2) self.C_trans.setReadOnly(True) lyt.addWidget(self.C_trans, 1, 1) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Motor")), 2, 0) self.C_motor = Entrada_con_unidades(Currency, retornar=False, tolerancia=8, decimales=2) self.C_motor.setReadOnly(True) lyt.addWidget(self.C_motor, 2, 1) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Purchase cost")), 0, 4) self.C_adq = Entrada_con_unidades(Currency, retornar=False, tolerancia=8, decimales=2) self.C_adq.setReadOnly(True) lyt.addWidget(self.C_adq, 0, 5) lyt.addWidget(QtGui.QLabel(QtGui.QApplication.translate( "pychemqt", "Installed cost")), 1, 4) self.C_inst = Entrada_con_unidades(Currency, retornar=False, tolerancia=8, decimales=2) self.C_inst.setReadOnly(True) lyt.addWidget(self.C_inst, 1, 5) self.on_tipoCalculo_currentIndexChanged(0) if equipment: self.setEquipment(equipment)
def __init__(self, equipment=None, parent=None): """ equipment: Initial equipment instance to model """ super().__init__(ElectricPrecipitator, entrada=False, parent=parent) # Calculate tab lyt_Calc = QtWidgets.QGridLayout(self.tabCalculo) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Mode")), 1, 1) self.metodo = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_TIPO: self.metodo.addItem(txt) self.metodo.currentIndexChanged.connect(self.tipoCalculoCambiado) lyt_Calc.addWidget(self.metodo, 1, 2, 1, 4) lyt_Calc.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 2, 1, 1, 6) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Area")), 3, 1) self.area = Entrada_con_unidades(Area, resaltado=True) self.area.valueChanged.connect(partial(self.changeParams, "area")) lyt_Calc.addWidget(self.area, 3, 2) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Allowable efficiency")), 4, 1) self.rendimientoAdmisible = Entrada_con_unidades(float, readOnly=True) self.rendimientoAdmisible.valueChanged.connect( partial(self.changeParams, "rendimientoAdmisible")) lyt_Calc.addWidget(self.rendimientoAdmisible, 4, 2) lyt_Calc.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 5, 1, 1, 6) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Dielectric constant")), 6, 1) self.epsilon = Entrada_con_unidades(float) self.epsilon.valueChanged.connect(partial(self.changeParams, "epsilon")) lyt_Calc.addWidget(self.epsilon, 6, 2) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Charging field")), 7, 1) self.potencialCarga = Entrada_con_unidades(PotencialElectric) self.potencialCarga.valueChanged.connect( partial(self.changeParams, "potencialCarga")) lyt_Calc.addWidget(self.potencialCarga, 7, 2) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Collecting field")), 8, 1) self.potencialDescarga = Entrada_con_unidades(PotencialElectric) self.potencialDescarga.valueChanged.connect( partial(self.changeParams, "potencialDescarga")) lyt_Calc.addWidget(self.potencialDescarga, 8, 2) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Pressure drop")), 9, 1) self.deltaP = Entrada_con_unidades(DeltaP) self.deltaP.valueChanged.connect(partial(self.changeParams, "deltaP")) lyt_Calc.addWidget(self.deltaP, 9, 2) lyt_Calc.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 6) groupbox = QtWidgets.QGroupBox( QtWidgets.QApplication.translate("pychemqt", "Result")) lyt_Calc.addWidget(groupbox, 11, 1, 1, 5) lyt = QtWidgets.QGridLayout(groupbox) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Area")), 0, 1) self.areaCalculada = Entrada_con_unidades(Area, retornar=False) self.areaCalculada.setReadOnly(True) lyt.addWidget(self.areaCalculada, 0, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Efficiency")), 1, 1) self.rendimiento = Entrada_con_unidades(float, readOnly=True) lyt.addWidget(self.rendimiento, 1, 2) lyt_Calc.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 12, 1, 1, 6) # Output tab self.addSalida( QtWidgets.QApplication.translate("pychemqt", "Filtered gas")) self.addSalida( QtWidgets.QApplication.translate("pychemqt", "Collected solids")) if equipment: self.setEquipment(equipment)
def __init__(self, config=None, parent=None): """config: instance with project config to set initial values""" super(Ui_ReferenceState, self).__init__(parent) self.setWindowTitle(QtWidgets.QApplication.translate( "pychemqt", "Select reference state")) layout = QtWidgets.QGridLayout(self) self.OTO = QtWidgets.QRadioButton(QtWidgets.QApplication.translate( "pychemqt", "OTO, h,s=0 at 298K and 1 atm")) layout.addWidget(self.OTO, 0, 1, 1, 7) self.NBP = QtWidgets.QRadioButton(QtWidgets.QApplication.translate( "pychemqt", "NBP, h,s=0 saturated liquid at Tb")) layout.addWidget(self.NBP, 1, 1, 1, 7) self.IIR = QtWidgets.QRadioButton(QtWidgets.QApplication.translate( "pychemqt", "IIR, h=200,s=1 saturated liquid at 273K")) layout.addWidget(self.IIR, 2, 1, 1, 7) self.ASHRAE = QtWidgets.QRadioButton(QtWidgets.QApplication.translate( "pychemqt", "ASHRAE, h,s=0 saturated liquid at 243K")) layout.addWidget(self.ASHRAE, 3, 1, 1, 7) self.personalizado = QtWidgets.QRadioButton( QtWidgets.QApplication.translate("pychemqt", "Custom")) self.personalizado.toggled.connect(self.setEnabled) layout.addWidget(self.personalizado, 4, 1, 1, 7) layout.addItem(QtWidgets.QSpacerItem( 10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 5, 1) layout.addWidget(QtWidgets.QLabel("T:"), 5, 2) self.T = Entrada_con_unidades(unidades.Temperature, value=298.15) layout.addWidget(self.T, 5, 3) layout.addWidget(QtWidgets.QLabel("P:"), 6, 2) self.P = Entrada_con_unidades(unidades.Pressure, value=101325) layout.addWidget(self.P, 6, 3) layout.addItem(QtWidgets.QSpacerItem( 10, 10, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed), 5, 4, 2, 1) layout.addWidget(QtWidgets.QLabel("h:"), 5, 5) self.h = Entrada_con_unidades(unidades.Enthalpy, value=0) layout.addWidget(self.h, 5, 6) layout.addWidget(QtWidgets.QLabel("s:"), 6, 5) self.s = Entrada_con_unidades(unidades.SpecificHeat, value=0) layout.addWidget(self.s, 6, 6) layout.addItem(QtWidgets.QSpacerItem( 10, 10, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 7, 7) buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel) buttonBox.accepted.connect(self.accept) buttonBox.rejected.connect(self.reject) layout.addWidget(buttonBox, 8, 1, 1, 7) if config and config.has_option("MEoS", "reference"): self.setEnabled(False) if config.get("MEoS", "reference") == "OTO": self.OTO.setChecked(True) elif config.get("MEoS", "reference") == "NBP": self.NBP.setChecked(True) elif config.get("MEoS", "reference") == "IIR": self.IIR.setChecked(True) elif config.get("MEoS", "reference") == "ASHRAE": self.ASHRAE.setChecked(True) else: self.personalizado.setChecked(True) self.setEnabled(True) self.T.setValue(config.getfloat("MEoS", "T")) self.P.setValue(config.getfloat("MEoS", "P")) self.h.setValue(config.getfloat("MEoS", "h")) self.s.setValue(config.getfloat("MEoS", "s")) else: self.OTO.setChecked(True) self.setEnabled(False)
def __init__(self, parent=None): super(Standing_Katz, self).__init__(parent) self.setWindowTitle(self.title) layout = QtWidgets.QGridLayout(self) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Method:")), 1, 1) self.metodos = QtWidgets.QComboBox() self.metodos.addItem("Hall Yarborough") self.metodos.addItem("Dranchuk Abu-Kassem") self.metodos.addItem("Dranchuk Purvis Robinson") self.metodos.addItem("Beggs Brill") self.metodos.addItem("Sarem") self.metodos.addItem("Gopal") self.metodos.addItem("Papay") self.metodos.currentIndexChanged.connect(self.plot_Z) layout.addWidget(self.metodos, 1, 2) layout.addItem( QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed), 1, 3) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Pr<sub>min</sub>")), 1, 4) self.Prmin = Entrada_con_unidades(float, spinbox=True, value=0.0, width=60, decimales=1, step=0.1) layout.addWidget(self.Prmin, 1, 5) layout.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Pr<sub>max</sub>")), 1, 6) self.Prmax = Entrada_con_unidades(float, spinbox=True, value=8.0, width=60, decimales=1, step=0.1) layout.addWidget(self.Prmax, 1, 7) layout.addWidget( QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Tr")), 1, 8) self.Tr = QtWidgets.QLineEdit(", ".join( str(i) for i in [ 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35, 1.4, 1.45, 1.5, 1.6, 1.7, 1.8, 1.9, 2., 2.2, 2.4, 2.6, 2.8, 3. ])) self.Tr.setMinimumWidth(400) layout.addWidget(self.Tr, 1, 9) self.diagrama = mpl(self, dpi=90) layout.addWidget(self.diagrama, 2, 1, 1, 9) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Close) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox, 5, 1, 1, 6) self.plot_Z(0)
def __init__(self, kwarg=None, parent=None): super(Dialog_Finned, self).__init__(parent=parent) self.setWindowTitle(QtWidgets.QApplication.translate( "pychemqt", "Specify tube finned characteristics")) layout = QtWidgets.QGridLayout(self) self.listTube = QtWidgets.QComboBox() self.listTube.addItem("") layout.addWidget(self.listTube, 0, 1, 1, 2) layout.addItem(QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 1, 1, 1, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Material")), 2, 1) self.listMaterial = QtWidgets.QComboBox() self.listMaterial.addItem("") self.listMaterial.addItem(QtWidgets.QApplication.translate( "pychemqt", "Carbon Steel")) layout.addWidget(self.listMaterial, 2, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Thermal Conductivity")), 3, 1) self.kFin = Entrada_con_unidades(ThermalConductivity) layout.addWidget(self.kFin, 3, 2) layout.addItem(QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 4, 1, 1, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Root diameter")), 5, 1) self.RootD = Entrada_con_unidades(Length, "PipeDiameter") layout.addWidget(self.RootD, 5, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Fin Height")), 6, 1) self.hFin = Entrada_con_unidades(Length, "Thickness") layout.addWidget(self.hFin, 6, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Base Fin Thickness")), 7, 1) self.BaseThickness = Entrada_con_unidades(Length, "Thickness") layout.addWidget(self.BaseThickness, 7, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Top Fin Thickness")), 8, 1) self.TopThickness = Entrada_con_unidades(Length, "Thickness") layout.addWidget(self.TopThickness, 8, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.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 = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Cancel | QtWidgets.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 __init__(self, equipment=None, parent=None): """ equipment: Initial equipment instance to model """ super(UI_equipment, self).__init__(ColumnFUG, entrada=False, parent=parent) # Calculate tab lyt = QtGui.QGridLayout(self.tabCalculo) lyt.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Feed tray")), 2, 0) self.feed = QtGui.QComboBox() for txt in self.Equipment.TEXT_FEED: self.feed.addItem(txt) self.feed.currentIndexChanged.connect( partial(self.changeParams, "feed")) lyt.addWidget(self.feed, 2, 1) lyt.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Condenser")), 3, 0) self.condenser = QtGui.QComboBox() for txt in self.Equipment.TEXT_CONDENSER: self.condenser.addItem(txt) self.condenser.currentIndexChanged.connect( partial(self.changeParams, "condenser")) lyt.addWidget(self.condenser, 3, 1) lyt.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 4, 0, 1, 5) group = QtGui.QGroupBox( QtGui.QApplication.translate("pychemqt", "Key Components specification")) lyt.addWidget(group, 5, 0, 1, 5) layout = QtGui.QGridLayout(group) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Light")), 1, 1) self.LK = QtGui.QComboBox() layout.addWidget(self.LK, 1, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Split in destilate")), 1, 4) self.LKsplit = Entrada_con_unidades(float, spinbox=True, max=1.) self.LKsplit.valueChanged.connect(partial(self.changeParams, "LKsplit")) layout.addWidget(self.LKsplit, 1, 5) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Heavy")), 2, 1) self.HK = QtGui.QComboBox() layout.addWidget(self.HK, 2, 2) layout.addItem( QtGui.QSpacerItem(40, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 2, 3) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Spit in residue")), 2, 4) self.HKsplit = Entrada_con_unidades(float, spinbox=True, max=1.) self.HKsplit.valueChanged.connect(partial(self.changeParams, "HKsplit")) layout.addWidget(self.HKsplit, 2, 5) indices, nombres, M = getComponents() for i, nombre in enumerate(nombres): self.LK.addItem("%i - %s" % (i + 1, nombre)) self.HK.addItem("%i - %s" % (i + 1, nombre)) self.LK.setCurrentIndex(-1) self.HK.setCurrentIndex(-1) self.LK.currentIndexChanged.connect(partial(self.changeParams, "LK")) self.HK.currentIndexChanged.connect(partial(self.changeParams, "HK")) lyt.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 6, 0, 1, 5) lyt.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Reflux ratio")), 7, 0) self.R = Entrada_con_unidades(float) self.R.valueChanged.connect(partial(self.changeParams, "R")) lyt.addWidget(self.R, 7, 1) lyt.addWidget(QtGui.QLabel("R/Rmin"), 8, 0) self.R_Rmin = Entrada_con_unidades(float) self.R_Rmin.valueChanged.connect(partial(self.changeParams, "R_Rmin")) lyt.addWidget(self.R_Rmin, 8, 1) lyt.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Design Pressure")), 7, 3) self.Pd = Entrada_con_unidades(Pressure) self.Pd.valueChanged.connect(partial(self.changeParams, "Pd")) lyt.addWidget(self.Pd, 7, 4) lyt.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Pressure loss")), 8, 3) self.DeltaP = Entrada_con_unidades(Pressure) self.DeltaP.valueChanged.connect(partial(self.changeParams, "DeltaP")) lyt.addWidget(self.DeltaP, 8, 4) lyt.addItem( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 9, 0, 1, 5) self.buttonMcCabe = QtGui.QPushButton( QtGui.QApplication.translate("pychemqt", "McCabe-Thiele")) self.buttonMcCabe.clicked.connect(self.mcCabe) lyt.addWidget(self.buttonMcCabe, 10, 0) groupBox_Calculo = QtGui.QGroupBox( QtGui.QApplication.translate("pychemqt", "Results")) lyt.addWidget(groupBox_Calculo, 11, 0, 1, 5) layout = QtGui.QGridLayout(groupBox_Calculo) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Condenser Duty")), 0, 1) self.DutyCondenser = Entrada_con_unidades(Power, retornar=False) self.DutyCondenser.setReadOnly(True) layout.addWidget(self.DutyCondenser, 0, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Reboiler Duty")), 1, 1) self.DutyReboiler = Entrada_con_unidades(Power, retornar=False) self.DutyReboiler.setReadOnly(True) layout.addWidget(self.DutyReboiler, 1, 2) layout.addWidget(QtGui.QLabel("Rmin"), 2, 1) self.Rmin = Entrada_con_unidades(float, readOnly=True) layout.addWidget(self.Rmin, 2, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Reflux ratio")), 3, 1) self.RCalculada = Entrada_con_unidades(float, readOnly=True) layout.addWidget(self.RCalculada, 3, 2) layout.addWidget(QtGui.QLabel("Nmin"), 0, 4) self.Nmin = Entrada_con_unidades(float, readOnly=True) layout.addWidget(self.Nmin, 0, 5) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Stages")), 1, 4) self.NTray = Entrada_con_unidades(float, readOnly=True) layout.addWidget(self.NTray, 1, 5) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Feed stage")), 2, 4) self.N_feed = Entrada_con_unidades(float, readOnly=True) layout.addWidget(self.N_feed, 2, 5) # Cost tab lyt = QtGui.QGridLayout(self.tabCostos) lyt.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Process")), 1, 1) self.proceso = QtGui.QComboBox() for txt in self.Equipment.TEXT_PROCESS: self.proceso.addItem(txt) self.proceso.currentIndexChanged.connect( partial(self.changeParamsCoste, "proceso")) lyt.addWidget(self.proceso, 1, 2) lyt.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Column tipe")), 2, 1) self.tipo = QtGui.QComboBox() for txt in self.Equipment.TEXT_COLUMN: self.tipo.addItem(txt) self.tipo.currentIndexChanged.connect(self.mostrarSubclasificacion) lyt.addWidget(self.tipo, 2, 2) lyt.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Material")), 3, 1) self.material = QtGui.QComboBox() for txt in self.Equipment.TEXT_MATERIAL: self.material.addItem(txt) self.material.currentIndexChanged.connect( partial(self.changeParamsCoste, "material_columna")) lyt.addWidget(self.material, 3, 2) lyt.addItem( QtGui.QSpacerItem(30, 30, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 1, 3, 5, 1) self.groupBox_Pisos = QtGui.QGroupBox( QtGui.QApplication.translate("pychemqt", "Tray column")) lyt.addWidget(self.groupBox_Pisos, 1, 4, 4, 2) layout = QtGui.QGridLayout(self.groupBox_Pisos) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Tray type")), 1, 1) self.tipoPisos = QtGui.QComboBox() for txt in self.Equipment.TEXT_TRAY: self.tipoPisos.addItem(txt) self.tipoPisos.currentIndexChanged.connect( partial(self.changeParamsCoste, "tipo_pisos")) layout.addWidget(self.tipoPisos, 1, 2) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Material")), 2, 1) self.materialPisos = QtGui.QComboBox() for txt in self.Equipment.TEXT_MATERIAL: self.materialPisos.addItem(txt) self.materialPisos.currentIndexChanged.connect( partial(self.changeParamsCoste, "material_pisos")) layout.addWidget(self.materialPisos, 2, 2) layout.addItem( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 3, 1, 1, 2) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Diameter")), 4, 1) self.diametroPisos = Entrada_con_unidades(Length) layout.addWidget(self.diametroPisos, 4, 2) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Stages")), 5, 1) self.NumeroPisos = Entrada_con_unidades(int, spinbox=True, min=1, step=1, width=50) layout.addWidget(self.NumeroPisos, 5, 2) layout.addItem( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 6, 1, 1, 2) self.groupBox_relleno = QtGui.QGroupBox( QtGui.QApplication.translate("pychemqt", "Packed column")) lyt.addWidget(self.groupBox_relleno, 1, 4, 4, 2) layout = QtGui.QGridLayout(self.groupBox_relleno) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Volume")), 1, 1) self.VolumenRelleno = Entrada_con_unidades(Volume, "VolLiq") layout.addWidget(self.VolumenRelleno, 1, 2) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Unit Cost")), 2, 1) texto = "%s / %s" % (Currency(None).text(), Volume(None).text("VolLiq")) self.C_unit_relleno = Entrada_con_unidades(Currency, retornar=False, textounidad=texto) layout.addWidget(self.C_unit_relleno, 2, 2) layout.addItem( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 3, 1, 1, 2) lyt.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Diameter")), 5, 1) self.Dc = Entrada_con_unidades(Length) lyt.addWidget(self.Dc, 5, 2, 1, 2) lyt.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Height")), 6, 1) self.Hc = Entrada_con_unidades(Length) lyt.addWidget(self.Hc, 6, 2, 1, 2) lyt.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Thickness (top)")), 6, 4) self.EspesorSuperior = Entrada_con_unidades(Length, "Thickness") lyt.addWidget(self.EspesorSuperior, 6, 5, 1, 2) lyt.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Thickness (bottom)")), 7, 4) self.EspesorInferior = Entrada_con_unidades(Length, "Thickness") lyt.addWidget(self.EspesorInferior, 7, 5, 1, 2) lyt.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Density")), 7, 1) self.EspesorInferior = Entrada_con_unidades(Density, "DenLiq") lyt.addWidget(self.EspesorInferior, 7, 2, 1, 2) self.Costos = CostData(self.Equipment) self.Costos.valueChanged.connect(self.changeParamsCoste) lyt.addWidget(self.Costos, 10, 1, 2, 5) lyt.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 12, 1, 1, 6) self.groupBox_Costos = QtGui.QGroupBox( QtGui.QApplication.translate("pychemqt", "Stimated costs")) lyt.addWidget(self.groupBox_Costos, 13, 1, 1, 5) layout = QtGui.QGridLayout(self.groupBox_Costos) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Tray cost")), 0, 1) self.C_pisos = Entrada_con_unidades(Currency, retornar=False) self.C_pisos.setReadOnly(True) layout.addWidget(self.C_pisos, 0, 2) layout.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Shell cost")), 1, 1) self.C_carcasa = Entrada_con_unidades(Currency, retornar=False) self.C_carcasa.setReadOnly(True) layout.addWidget(self.C_carcasa, 1, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Platform and ladder")), 2, 1) self.C_accesorios = Entrada_con_unidades(Currency, retornar=False) self.C_accesorios.setReadOnly(True) layout.addWidget(self.C_accesorios, 2, 2) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Column cost")), 0, 4) self.C_columna = Entrada_con_unidades(Currency, retornar=False) self.C_columna.setReadOnly(True) layout.addWidget(self.C_columna, 0, 5) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Purchase costs")), 1, 4) self.C_adq = Entrada_con_unidades(Currency, retornar=False) self.C_adq.setReadOnly(True) layout.addWidget(self.C_adq, 1, 5) layout.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Installed costs")), 2, 4) self.C_inst = Entrada_con_unidades(Currency, retornar=False) self.C_inst.setReadOnly(True) layout.addWidget(self.C_inst, 2, 5) # Output tab self.addSalida(QtGui.QApplication.translate("pychemqt", "Destilate")) self.addSalida(QtGui.QApplication.translate("pychemqt", "Residue")) self.mostrarSubclasificacion(0) if equipment: self.setEquipment(equipment)
def __init__(self, equipment=None, parent=None): """ equipment: Initial equipment instance to model """ super().__init__(GravityChamber, entrada=False, parent=parent) # Calculate tab lyt_Calc = QtWidgets.QGridLayout(self.tabCalculo) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Mode")), 1, 1, 1, 1) self.metodo = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_TIPO: self.metodo.addItem(txt) self.metodo.currentIndexChanged.connect(self.tipoCalculoCambiado) lyt_Calc.addWidget(self.metodo, 1, 2, 1, 4) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Model")), 2, 1, 1, 1) self.modelo = QtWidgets.QComboBox() for txt in self.Equipment.TEXT_MODEL: self.modelo.addItem(txt) self.modelo.currentIndexChanged.connect( partial(self.changeParams, "modelo")) lyt_Calc.addWidget(self.modelo, 2, 2, 1, 1) lyt_Calc.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 3, 1, 1, 6) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Width")), 4, 1, 1, 1) self.W = Entrada_con_unidades(Length) self.W.valueChanged.connect(partial(self.changeParams, "W")) lyt_Calc.addWidget(self.W, 4, 2, 1, 1) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Height")), 5, 1, 1, 1) self.H = Entrada_con_unidades(Length) self.H.valueChanged.connect(partial(self.changeParams, "H")) lyt_Calc.addWidget(self.H, 5, 2, 1, 1) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Length")), 6, 1, 1, 1) self.L = Entrada_con_unidades(Length) self.L.valueChanged.connect(partial(self.changeParams, "L")) lyt_Calc.addWidget(self.L, 6, 2, 1, 1) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Allowable efficiency")), 7, 1, 1, 1) self.rendimientoAdmisible = Entrada_con_unidades(float, spinbox=True, max=1) self.rendimientoAdmisible.valueChanged.connect( partial(self.changeParams, "rendimientoAdmisible")) lyt_Calc.addWidget(self.rendimientoAdmisible, 7, 2, 1, 1) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Allowable speed")), 8, 1, 1, 1) self.velocidadAdmisible = Entrada_con_unidades(Speed) self.velocidadAdmisible.valueChanged.connect( partial(self.changeParams, "velocidadAdmisible")) lyt_Calc.addWidget(self.velocidadAdmisible, 8, 2, 1, 1) lyt_Calc.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Pressure loss")), 9, 1, 1, 1) self.deltaP = Entrada_con_unidades(DeltaP) self.deltaP.valueChanged.connect(partial(self.changeParams, "deltaP")) lyt_Calc.addWidget(self.deltaP, 9, 2, 1, 1) lyt_Calc.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 6) group_Calc = QtWidgets.QGroupBox( QtWidgets.QApplication.translate("pychemqt", "Results")) lyt_Calc.addWidget(group_Calc, 11, 1, 1, 5) lyt = QtWidgets.QGridLayout(group_Calc) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Flow")), 0, 1) self.Q = Entrada_con_unidades(VolFlow, "QGas", retornar=False) self.Q.setReadOnly(True) lyt.addWidget(self.Q, 0, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "V<sub>gas</sub>")), 1, 1) self.Vgas = Entrada_con_unidades(Speed, retornar=False, readOnly=True) lyt.addWidget(self.Vgas, 1, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Efficiency")), 2, 1) self.rendimiento = Entrada_con_unidades(float, retornar=False) self.rendimiento.setReadOnly(True) lyt.addWidget(self.rendimiento, 2, 2) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Height")), 0, 4) self.HCalc = Entrada_con_unidades(Length, retornar=False) self.HCalc.setReadOnly(True) lyt.addWidget(self.HCalc, 0, 5) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Width")), 1, 4) self.WCalc = Entrada_con_unidades(Length, retornar=False) self.WCalc.setReadOnly(True) lyt.addWidget(self.WCalc, 1, 5) lyt.addWidget( QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Length")), 2, 4) self.LCalc = Entrada_con_unidades(Length, retornar=False) self.LCalc.setReadOnly(True) lyt.addWidget(self.LCalc, 2, 5) lyt_Calc.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 12, 1, 1, 6) # Output tab self.addSalida( QtWidgets.QApplication.translate("pychemqt", "Filtered gas")) self.addSalida( QtWidgets.QApplication.translate("pychemqt", "Collected solids")) self.tipoCalculoCambiado(0) if equipment: self.setEquipment(equipment)
def __init__(self, cmp=None, parent=None): """Constructor cmp: optional new component to show the properties""" super(View_Contribution, self).__init__(parent) self.setWindowTitle( QtWidgets.QApplication.translate( "pychemqt", "Group Contribution new component")) layout = QtWidgets.QGridLayout(self) self.nombre = QtWidgets.QLabel() layout.addWidget(self.nombre, 1, 1, 1, 5) label = QtWidgets.QLabel("M") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Molecular Weight")) layout.addWidget(label, 2, 1) self.M = Entrada_con_unidades(float, textounidad="g/mol") layout.addWidget(self.M, 2, 2) label = QtWidgets.QLabel("Tb") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Boiling Temperature")) layout.addWidget(label, 3, 1) self.Tb = Entrada_con_unidades(Temperature) layout.addWidget(self.Tb, 3, 2) label = QtWidgets.QLabel("Tm") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Melting Temperature")) layout.addWidget(label, 4, 1) self.Tf = Entrada_con_unidades(Temperature) layout.addWidget(self.Tf, 4, 2) layout.addWidget(QtWidgets.QLabel("Tc"), 5, 1) self.Tc = Entrada_con_unidades(Temperature) layout.addWidget(self.Tc, 5, 2) layout.addWidget(QtWidgets.QLabel("Pc"), 6, 1) self.Pc = Entrada_con_unidades(Pressure) layout.addWidget(self.Pc, 6, 2) layout.addWidget(QtWidgets.QLabel("Vc"), 7, 1) self.Vc = Entrada_con_unidades(SpecificVolume) layout.addWidget(self.Vc, 7, 2) label = QtWidgets.QLabel("ΔHf") label.setToolTip( QtWidgets.QApplication.translate( "pychemqt", "Enthalpy of formation of ideal gas")) layout.addWidget(label, 8, 1) self.Hf = Entrada_con_unidades(Enthalpy) layout.addWidget(self.Hf, 8, 2) label = QtWidgets.QLabel("ΔGf") label.setToolTip( QtWidgets.QApplication.translate( "pychemqt", "Gibbs free energy of formation of ideal gas")) layout.addWidget(label, 9, 1) self.Gf = Entrada_con_unidades(Enthalpy) layout.addWidget(self.Gf, 9, 2) label = QtWidgets.QLabel("ΔHf") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Enthalpy of fusion")) layout.addWidget(label, 2, 4) self.Hm = Entrada_con_unidades(Enthalpy) layout.addWidget(self.Hm, 2, 5) label = QtWidgets.QLabel("ΔHv") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Enthalpy of vaporization")) layout.addWidget(label, 3, 4) self.Hv = Entrada_con_unidades(Enthalpy) layout.addWidget(self.Hv, 3, 5) layout.addWidget(QtWidgets.QLabel("Cpa"), 4, 4) self.cpa = Entrada_con_unidades(float) layout.addWidget(self.cpa, 4, 5) layout.addWidget(QtWidgets.QLabel("Cpb"), 5, 4) self.cpb = Entrada_con_unidades(float) layout.addWidget(self.cpb, 5, 5) layout.addWidget(QtWidgets.QLabel("Cpc"), 6, 4) self.cpc = Entrada_con_unidades(float) layout.addWidget(self.cpc, 6, 5) layout.addWidget(QtWidgets.QLabel("Cpd"), 7, 4) self.cpd = Entrada_con_unidades(float) layout.addWidget(self.cpd, 7, 5) layout.addWidget(QtWidgets.QLabel("μa"), 8, 4) self.mua = Entrada_con_unidades(float) layout.addWidget(self.mua, 8, 5) layout.addWidget(QtWidgets.QLabel("μb"), 9, 4) self.mub = Entrada_con_unidades(float) layout.addWidget(self.mub, 9, 5) label = QtWidgets.QLabel("SG") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Specific gravity at 60ºF")) layout.addWidget(label, 2, 7) self.gravity = Entrada_con_unidades(float) layout.addWidget(self.gravity, 2, 8) label = QtWidgets.QLabel("API") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "API Specific gravity")) layout.addWidget(label, 3, 7) self.API = Entrada_con_unidades(float) layout.addWidget(self.API, 3, 8) label = QtWidgets.QLabel("Kw") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Watson characterization factor")) layout.addWidget(label, 4, 7) self.watson = Entrada_con_unidades(float) layout.addWidget(self.watson, 4, 8) label = QtWidgets.QLabel("w") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Acentric factor")) layout.addWidget(label, 5, 7) self.f_acent = Entrada_con_unidades(float) layout.addWidget(self.f_acent, 5, 8) label = QtWidgets.QLabel("Ra") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Rackett constant")) layout.addWidget(label, 6, 7) self.rackett = Entrada_con_unidades(float) layout.addWidget(self.rackett, 6, 8) label = QtWidgets.QLabel("Vliq") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Volume Liquid Constant")) layout.addWidget(label, 7, 7) self.Vliq = Entrada_con_unidades(float) layout.addWidget(self.Vliq, 7, 8) label = QtWidgets.QLabel("Sol") label.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Solubility Parameter")) layout.addWidget(label, 8, 7) self.Parametro_solubilidad = Entrada_con_unidades(SolubilityParameter) layout.addWidget(self.Parametro_solubilidad, 8, 8) layout.addItem( QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 15, 8) btn = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Close) btn.rejected.connect(self.accept) layout.addWidget(btn, 16, 1, 1, 8) self.setReadOnly(True) if cmp: self.rellenar(cmp)
def __init__(self, reaccion=None, parent=None): super(UI_reacciones, self).__init__(parent) self.evaluate=Evaluate() self.evaluate.finished.connect(self.rellenar) self.indices, self.nombres, M=getComponents() gridLayout = QtWidgets.QGridLayout(self) lyt=QtWidgets.QHBoxLayout() lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Key component"))) self.key=QtWidgets.QComboBox() for i, nombre in enumerate(self.nombres): self.key.addItem("%i - %s" %(i+1, nombre)) self.key.currentIndexChanged.connect(partial(self.changeParams, "key")) lyt.addWidget(self.key) lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Fixed)) gridLayout.addLayout(lyt,1,1,1,5) lyt=QtWidgets.QHBoxLayout() lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Phase"))) self.fase=QtWidgets.QComboBox() for txt in reaction.Reaction.TEXT_PHASE: self.fase.addItem(txt) self.fase.currentIndexChanged.connect(partial(self.changeParams, "fase")) lyt.addWidget(self.fase) self.Formula=QtWidgets.QLabel() self.Formula.setAlignment(QtCore.Qt.AlignCenter) self.Formula.setSizePolicy(QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Fixed) lyt.addWidget(self.Formula) gridLayout.addLayout(lyt,2,1,1,5) lyt=QtWidgets.QVBoxLayout() title=self.nombres[:] title.append("") self.Estequiometria=Tabla(1, verticalHeaderLabels=title, horizontalHeader=[QtWidgets.QApplication.translate("pychemqt", "Coefficients")], filas=len(self.indices)) self.Estequiometria.setFixedHeight(22*len(self.indices)+22+4+22) lyt.addWidget(self.Estequiometria) self.Estequiometria.addRow() brush=QtGui.QBrush(QtGui.QColor("#eaeaea")) self.Estequiometria.item(len(self.indices), 0).setBackground(brush) self.Estequiometria.item(len(self.indices), 0).setFlags(QtCore.Qt.NoItemFlags) self.Estequiometria.cellChanged.connect(self.reaccionCambiada) lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Expanding)) gridLayout.addLayout(lyt,3,1,1,2) lyt=QtWidgets.QGridLayout() lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),1,1) self.formula=QtWidgets.QCheckBox(QtWidgets.QApplication.translate("pychemqt", "Use name in formula")) self.formula.toggled.connect(partial(self.changeParams, "formula")) lyt.addWidget(self.formula,1,2,1,2) self.customHr=QtWidgets.QCheckBox("ΔHr "+QtWidgets.QApplication.translate("pychemqt", "user specified")) self.customHr.toggled.connect(self.changeHr) lyt.addWidget(self.customHr,2,2,1,2) lyt.addWidget(QtWidgets.QLabel("ΔHr<sup>o</sup>"),3,2) self.Hr=Entrada_con_unidades(unidades.MolarEnthalpy, readOnly=True) self.Hr.valueChanged.connect(partial(self.changeParams, "Hr")) lyt.addWidget(self.Hr,3,3) lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Expanding)) gridLayout.addLayout(lyt,3,3,1,2) gridLayout.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),4,2) lyt=QtWidgets.QHBoxLayout() lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Type"))) self.tipo=QtWidgets.QComboBox() for txt in reaction.Reaction.TEXT_TYPE: self.tipo.addItem(txt) self.tipo.currentIndexChanged.connect(partial(self.changeParams, "tipo")) lyt.addWidget(self.tipo) lyt.addItem(QtWidgets.QSpacerItem(20,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed)) lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Concentration"))) self.base=QtWidgets.QComboBox() for txt in reaction.Reaction.TEXT_BASE: self.base.addItem(txt) self.base.currentIndexChanged.connect(partial(self.changeParams, "base")) lyt.addWidget(self.base) lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Fixed)) gridLayout.addLayout(lyt,5,1,1,5) self.stacked = QtWidgets.QStackedWidget() self.tipo.currentIndexChanged.connect(self.stacked.setCurrentIndex) gridLayout.addWidget(self.stacked,6,1,1,5) gridLayout.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),7,1,1,5) widget=QtWidgets.QWidget() self.stacked.addWidget(widget) lyt=QtWidgets.QGridLayout(widget) lyt.addWidget(QtWidgets.QLabel("<h3>"+QtWidgets.QApplication.translate("pychemqt", "Estequiometric reaction")+"</h3>"),1,1,1,4) self.Conversion=Tabla(1, verticalHeaderModel="C", filas=3) self.Conversion.setConnected() self.Conversion.setFixedWidth(100) lyt.addWidget(self.Conversion,2,1,3,1) mathTex = r"$Conversion = C_o + C_1T + C_2T^2 + \cdots + C_nT^n$" label = QLabelMath(mathTex) lyt.addWidget(label,2,2,1,3) lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Temperature unit")),3,2) self.unidadesTemperatura=QtWidgets.QComboBox() for i in unidades.Temperature.__text__: self.unidadesTemperatura.addItem(i) lyt.addWidget(self.unidadesTemperatura,3,3) lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),4,4) lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),5,1,1,5) widget=QtWidgets.QWidget() self.stacked.addWidget(widget) lyt=QtWidgets.QGridLayout(widget) self.check_KFijo=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Fixed")) self.check_KFijo.toggled.connect(self.KeqChanged) lyt.addWidget(self.check_KFijo,1,1,1,2) lyt.addWidget(QtWidgets.QLabel("K<sub>eq</sub>"),1,3) self.Keq=Entrada_con_unidades(float) lyt.addWidget(self.Keq,1,4) mathTex = r"$aA + bB \rightleftharpoons cC + dD \therefore " mathTex += r"K_{eq} = \frac{[C]^c [D]^d}{[A]^a [B]^b}$" label = QLabelMath(mathTex) lyt.addWidget(label,1,5,1,4) self.check_KEq=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Equation")) self.check_KEq.toggled.connect(self.KeqChanged) lyt.addWidget(self.check_KEq,2,1,1,2) self.check_KTabla=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Table")) self.check_KTabla.toggled.connect(self.KeqChanged) lyt.addWidget(self.check_KTabla,2,5,1,2) self.KEq_Dat=Tabla(1, verticalHeaderLabels=["A", "B", "C", "D", "E", "F", "G", "H"], filas=8) self.KEq_Dat.setFixedHeight(22*8+4) self.KEq_Dat.setFixedWidth(120) lyt.addWidget(self.KEq_Dat,3,3,1,2) self.KEq_Tab=Tabla(4, horizontalHeader=["T, K", "Keq", "Kcalc", "%Error"], verticalHeader=False, columnReadOnly=[False, False, True, True]) self.KEq_Tab.setSizePolicy(QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding) self.KEq_Tab.setFixedWidth(400) self.KEq_Tab.setConnected() self.KEq_Tab.rowFinished.connect(self.Regresion) self.KEq_Tab.setAlternatingRowColors(False) lyt.addWidget(self.KEq_Tab,3,5,1,4) lyt.addWidget(QtWidgets.QLabel("r²"),4,5) self.r2=Entrada_con_unidades(float, readOnly=True) lyt.addWidget(self.r2,4,6) self.botonTablaPlot=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/plot.png")), QtWidgets.QApplication.translate("pychemqt", "Plot")) self.botonTablaPlot.clicked.connect(self.Plot) lyt.addWidget(self.botonTablaPlot,4,7) self.botonTablaClear=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/clear.png")), QtWidgets.QApplication.translate("pychemqt", "Clear")) self.botonTablaClear.clicked.connect(self.KEq_Tab.clear) lyt.addWidget(self.botonTablaClear,4,8) mathTex = r"$\lnK_eq = A+B/T+C\lnT+DT+ET^2+FT^3+GT^4+HT^5$" label=QLabelMath(mathTex) lyt.addWidget(label,5,1,1,8) self.checkGibbs=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "From Gibbs free energy minimization")) lyt.addWidget(self.checkGibbs,6,1,1,4) self.check_KFijo.setChecked(True) widget=QtWidgets.QWidget() self.stacked.addWidget(widget) lyt=QtWidgets.QGridLayout(widget) widget=QtWidgets.QWidget() self.stacked.addWidget(widget) lyt=QtWidgets.QGridLayout(widget) self.status=Status() gridLayout.addWidget(self.status, 10,1) self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) gridLayout.addWidget(self.buttonBox,10,2,1,4) if reaccion: self.setReaction(reaccion)
def __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)
def __init__(self, equipment=None, parent=None): """entrada: Parametro opcional de clase corriente que indica la corriente de entrada en el reactor""" super(UI_equipment, self).__init__(Reactor, entrada=False, salida=False, parent=parent) #Pestaña reacciones self.Reacciones= widgetReacciones() self.Reacciones.changed.connect(self.calculo) self.tabWidget.insertTab(1, self.Reacciones, QtWidgets.QApplication.translate("pychemqt", "Reactions")) #Pestaña calculo gridLayout_Calculo = QtWidgets.QGridLayout(self.tabCalculo) gridLayout_Calculo.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Pressure")),2,0,1,1) self.P=Entrada_con_unidades(unidades.Pressure) self.P.valueChanged.connect(self.calculo) gridLayout_Calculo.addWidget(self.P,2,1,1,1) gridLayout_Calculo.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Pressure drop")),3,0,1,1) self.DeltaP=Entrada_con_unidades(unidades.Pressure) self.DeltaP.valueChanged.connect(self.calculo) gridLayout_Calculo.addWidget(self.DeltaP,3,1,1,1) gridLayout_Calculo.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),4,0,1,5) lyt=QtWidgets.QHBoxLayout() lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Type"))) self.tipo=QtWidgets.QComboBox() self.tipo.addItem(QtWidgets.QApplication.translate("pychemqt", "CSTR, continuous stirred-tank")) self.tipo.addItem(QtWidgets.QApplication.translate("pychemqt", "PFR, plug flow")) self.tipo.currentIndexChanged.connect(self.tipoCambiado) lyt.addWidget(self.tipo) lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Fixed)) gridLayout_Calculo.addLayout(lyt,5,0,1,5) gridLayout_Calculo.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),6,0,1,5) groupbox=QtWidgets.QGroupBox(QtWidgets.QApplication.translate("pychemqt", "Thermal mode")) layout=QtWidgets.QGridLayout(groupbox) self.checkAdiabatico=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Adiabatic")) self.checkAdiabatico.toggled.connect(self.heatChanged) layout.addWidget(self.checkAdiabatico, 1, 1, 1, 1) self.checkIsotermico=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Isothermal")) self.checkIsotermico.toggled.connect(self.heatChanged) layout.addWidget(self.checkIsotermico, 2, 1, 1, 1) self.checkFlux=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Heat duty")) self.checkFlux.toggled.connect(self.heatChanged) layout.addWidget(self.checkFlux, 3, 1, 1, 1) self.checkIntercambio=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "Heat transfer")) self.checkIntercambio.toggled.connect(self.heatChanged) layout.addWidget(self.checkIntercambio, 4, 1, 1, 1) self.checkPerfil=QtWidgets.QRadioButton(QtWidgets.QApplication.translate("pychemqt", "PFR temperature profile")) self.checkPerfil.toggled.connect(self.heatChanged) layout.addWidget(self.checkPerfil, 5, 1, 1, 1) self.T=Entrada_con_unidades(unidades.Temperature) self.T.valueChanged.connect(self.calculo) layout.addWidget(self.T, 2, 2, 1, 2) self.Q=Entrada_con_unidades(unidades.Power) self.Q.valueChanged.connect(self.calculo) layout.addWidget(self.Q, 3, 2, 1, 2) self.T_ext=Entrada_con_unidades(unidades.Temperature) self.T_ext.valueChanged.connect(self.calculo) layout.addWidget(self.T_ext,4,2,1,2) self.U=Entrada_con_unidades(unidades.HeatTransfCoef) self.U.valueChanged.connect(self.calculo) layout.addWidget(self.U,4,4) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Flow")),4,5) self.direccion=QtWidgets.QComboBox() self.direccion.addItem(QtWidgets.QApplication.translate("pychemqt", "Countercurrent")) self.direccion.addItem(QtWidgets.QApplication.translate("pychemqt", "Cocurrent")) layout.addWidget(self.direccion,4,6) self.botonPerfil=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/table.png")), QtWidgets.QApplication.translate("pychemqt", "Add Profile")) self.botonPerfil.clicked.connect(self.editorPerfil) layout.addWidget(self.botonPerfil,5,2,1,1) gridLayout_Calculo.addWidget(groupbox, 7, 0, 1, 5) self.groupBox_Diseno= QtWidgets.QGroupBox(QtWidgets.QApplication.translate("pychemqt", "Design")) gridLayout_Calculo.addWidget(self.groupBox_Diseno,8,0,1,5) lyt = QtWidgets.QGridLayout(self.groupBox_Diseno) lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Mode")),1,1) self.modo=QtWidgets.QComboBox() self.modo.addItem(QtWidgets.QApplication.translate("pychemqt", "Rating: calculate conversión")) self.modo.addItem(QtWidgets.QApplication.translate("pychemqt", "Design, calculate volumen")) self.modo.currentIndexChanged.connect(self.calculo) lyt.addWidget(self.modo,1,2,1,3) lyt.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Fixed),1,5) lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Reactor Volume")),2,1) self.V=Entrada_con_unidades(unidades.Volume, "VolLiq") lyt.addWidget(self.V,2,2) lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Key Component")),3,1) self.key=QtWidgets.QComboBox() # for i, nombre in enumerate(self.nombres): # self.key.addItem("%i - %s" %(i+1, nombre)) lyt.addWidget(self.key,3,2) lyt.addItem(QtWidgets.QSpacerItem(20,10,QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed),3,3) lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Conversion")),3,4) self.conversion=Entrada_con_unidades(float, max=1) lyt.addWidget(self.conversion,3,5) gridLayout_Calculo.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),10,0,1,5) groupBox_Calculo = QtWidgets.QGroupBox(QtWidgets.QApplication.translate("pychemqt", "Results")) gridLayout_Calculo.addWidget(groupBox_Calculo,11,0,1,5) gridLayout_1 = QtWidgets.QGridLayout(groupBox_Calculo) gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "T output")),0,1,1,1) self.TCalc=Entrada_con_unidades(unidades.Temperature, retornar=False, readOnly=True) gridLayout_1.addWidget(self.TCalc,0,2,1,1) gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Heat")),1,1,1,1) self.HeatCalc=Entrada_con_unidades(unidades.Power, retornar=False, readOnly=True) gridLayout_1.addWidget(self.HeatCalc,1,2,1,1) gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Conversion")),0,4) self.conversionCalc=Entrada_con_unidades(float, readOnly=True) gridLayout_1.addWidget(self.conversionCalc,0,5) gridLayout_1.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("pychemqt", "Reactor Volume")),1,4) self.VCalc=Entrada_con_unidades(unidades.Volume, "VolLiq", readOnly=True) gridLayout_1.addWidget(self.VCalc,1,5) self.checkAdiabatico.setChecked(True) self.tipoCambiado(0)
def __init__(self, equipment=None, parent=None): """ equipment: Initial equipment instance to model """ super(UI_equipment, self).__init__(Turbine, entrada=False, salida=False, parent=parent) # Calculate tab lyt_Calc = QtGui.QGridLayout(self.tabCalculo) lyt_Calc.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Method:")), 1, 1) self.metodo = QtGui.QComboBox() for txt in self.Equipment.TEXT_METODO: self.metodo.addItem(txt) # self.metodo.addItem(QtGui.QApplication.translate("pychemqt", "Especificar curva de funcionamiento")) self.metodo.currentIndexChanged.connect( self.on_tipoCalculo_currentIndexChanged) lyt_Calc.addWidget(self.metodo, 1, 2, 1, 2) lyt_Calc.addItem( QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 2, 0, 1, 4) lyt_Calc.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Thermodynamic:")), 3, 1) self.termodinamica = QtGui.QComboBox() for txt in self.Equipment.TEXT_TERMODINAMICA: self.termodinamica.addItem(txt) self.termodinamica.currentIndexChanged.connect( partial(self.changeParams, "termodinamica")) lyt_Calc.addWidget(self.termodinamica, 3, 2, 1, 2) lyt_Calc.addItem( QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 4, 0, 1, 4) lyt_Calc.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Out Pressure")), 5, 1) self.Pout = Entrada_con_unidades(Pressure) self.Pout.valueChanged.connect(partial(self.changeParams, "Pout")) lyt_Calc.addWidget(self.Pout, 5, 2) lyt_Calc.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Pressure ratio")), 6, 1) self.razon = Entrada_con_unidades(float) self.razon.valueChanged.connect(partial(self.changeParams, "razon")) lyt_Calc.addWidget(self.razon, 6, 2) lyt_Calc.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Efficiency")), 7, 1) self.rendimiento = Entrada_con_unidades(float) self.rendimiento.valueChanged.connect( partial(self.changeParams, "rendimiento")) lyt_Calc.addWidget(self.rendimiento, 7, 2) lyt_Calc.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Actual Power")), 8, 1) self.trabajo = Entrada_con_unidades(Power) self.trabajo.valueChanged.connect(partial(self.changeParams, "trabajo")) lyt_Calc.addWidget(self.trabajo, 8, 2) lyt_Calc.setRowStretch(10, 1) group = QtGui.QGroupBox() group.setTitle(QtGui.QApplication.translate("pychemqt", "Results")) lyt_Calc.addWidget(group, 12, 1, 1, 2) lyt = QtGui.QGridLayout(group) lyt.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Power")), 1, 1) self.power = Entrada_con_unidades(Power, retornar=False, readOnly=True) lyt.addWidget(self.power, 1, 2) lyt.addWidget(QtGui.QLabel("Cp/Cv"), 2, 1) self.cp_cv = Entrada_con_unidades(float, retornar=False, readOnly=True) lyt.addWidget(self.cp_cv, 2, 2) lyt.setColumnStretch(3, 1) lyt.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Pressure ratio")), 1, 4) self.razonCalculada = Entrada_con_unidades(float, readOnly=True) lyt.addWidget(self.razonCalculada, 1, 5) lyt.addWidget( QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Efficiency")), 2, 4) self.rendimientoCalculado = Entrada_con_unidades(float, readOnly=True) lyt.addWidget(self.rendimientoCalculado, 2, 5) # Cost tab lyt_Cost = QtGui.QGridLayout(self.tabCostos) self.Costos = CostData(self.Equipment) self.Costos.valueChanged.connect(self.changeParamsCoste) lyt_Cost.addWidget(self.Costos, 1, 0, 1, 2) lyt_Cost.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 2, 0, 1, 2) group = QtGui.QGroupBox( QtGui.QApplication.translate("pychemqt", "Stimated Costs")) lyt_Cost.addWidget(group, 3, 0, 1, 2) lyt = QtGui.QGridLayout(group) lyt.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Purchase cost")), 0, 1) self.C_adq = Entrada_con_unidades(Currency, retornar=False, tolerancia=8, decimales=2, readOnly=True) lyt.addWidget(self.C_adq, 0, 2) lyt.addWidget( QtGui.QLabel( QtGui.QApplication.translate("pychemqt", "Installed cost")), 1, 1) self.C_inst = Entrada_con_unidades(Currency, retornar=False, tolerancia=8, decimales=2, readOnly=True) lyt.addWidget(self.C_inst, 1, 2) lyt_Cost.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 4, 0, 1, 2) self.on_tipoCalculo_currentIndexChanged(0) if equipment: self.setEquipment(equipment)
def __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__(Tower, parent=parent) self.entrada = entrada # #Pestaña entrada # self.Entrada= UI_corriente.Ui_corriente(entrada) # self.Entrada.Changed.connect(self.cambiar_entrada) # self.tabWidget.addTab(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", "Proceso:", None, QtGui.QApplication.UnicodeUTF8)), 1, 1, 1, 1) self.proceso = QtGui.QComboBox() self.proceso.addItem( QtGui.QApplication.translate("equipment", "Destilación", None, QtGui.QApplication.UnicodeUTF8)) self.proceso.addItem( QtGui.QApplication.translate("equipment", "Absorción", None, QtGui.QApplication.UnicodeUTF8)) self.proceso.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.proceso, 1, 2, 1, 1) gridLayout_Costos.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Tipo de columna:", None, QtGui.QApplication.UnicodeUTF8)), 2, 1, 1, 1) self.tipo = QtGui.QComboBox() self.tipo.addItem( QtGui.QApplication.translate("equipment", "De pisos", None, QtGui.QApplication.UnicodeUTF8)) self.tipo.addItem( QtGui.QApplication.translate("equipment", "De relleno", None, QtGui.QApplication.UnicodeUTF8)) self.tipo.currentIndexChanged.connect(self.mostrarSubclasificacion) self.tipo.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.tipo, 2, 2, 1, 1) gridLayout_Costos.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Material:", None, QtGui.QApplication.UnicodeUTF8)), 3, 1, 1, 1) self.material = QtGui.QComboBox() self.material.addItem( QtGui.QApplication.translate("equipment", "Acero al carbon", None, QtGui.QApplication.UnicodeUTF8)) self.material.addItem( QtGui.QApplication.translate("equipment", "Acero inoxidable 304", None, QtGui.QApplication.UnicodeUTF8)) self.material.addItem( QtGui.QApplication.translate("equipment", "Acero inoxidable 316", None, QtGui.QApplication.UnicodeUTF8)) self.material.addItem( QtGui.QApplication.translate("equipment", "Carpenter 20CB-3", None, QtGui.QApplication.UnicodeUTF8)) self.material.addItem( QtGui.QApplication.translate("equipment", "Niquel 200", None, QtGui.QApplication.UnicodeUTF8)) self.material.addItem( QtGui.QApplication.translate("equipment", "Monel 400", None, QtGui.QApplication.UnicodeUTF8)) self.material.addItem( QtGui.QApplication.translate("equipment", "Inconel 600", None, QtGui.QApplication.UnicodeUTF8)) self.material.addItem( QtGui.QApplication.translate("equipment", "Incoloy 825", None, QtGui.QApplication.UnicodeUTF8)) self.material.addItem( QtGui.QApplication.translate("equipment", "Titanio", None, QtGui.QApplication.UnicodeUTF8)) self.material.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.material, 3, 2, 1, 1) gridLayout_Costos.addItem( QtGui.QSpacerItem(30, 30, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 1, 3, 5, 1) self.groupBox_Pisos = QtGui.QGroupBox( QtGui.QApplication.translate("equipment", "Torre de pisos", None, QtGui.QApplication.UnicodeUTF8)) gridLayout_Costos.addWidget(self.groupBox_Pisos, 1, 4, 4, 2) gridLayout_1 = QtGui.QGridLayout(self.groupBox_Pisos) gridLayout_1.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Tipo:", None, QtGui.QApplication.UnicodeUTF8)), 1, 1, 1, 1) self.tipoPisos = QtGui.QComboBox() self.tipoPisos.addItem( QtGui.QApplication.translate("equipment", "De válvula", None, QtGui.QApplication.UnicodeUTF8)) self.tipoPisos.addItem( QtGui.QApplication.translate("equipment", "De rejilla", None, QtGui.QApplication.UnicodeUTF8)) self.tipoPisos.addItem( QtGui.QApplication.translate("equipment", "De borboteo", None, QtGui.QApplication.UnicodeUTF8)) self.tipoPisos.addItem( QtGui.QApplication.translate("equipment", "De tamiz", None, QtGui.QApplication.UnicodeUTF8)) self.tipoPisos.currentIndexChanged.connect(self.calcularCostos) gridLayout_1.addWidget(self.tipoPisos, 1, 2, 1, 1) gridLayout_1.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Material:", None, QtGui.QApplication.UnicodeUTF8)), 2, 1, 1, 1) self.materialPisos = QtGui.QComboBox() self.materialPisos.addItem( QtGui.QApplication.translate("equipment", "Acero al carbon", None, QtGui.QApplication.UnicodeUTF8)) self.materialPisos.addItem( QtGui.QApplication.translate("equipment", "Acero inoxidable 304", None, QtGui.QApplication.UnicodeUTF8)) self.materialPisos.addItem( QtGui.QApplication.translate("equipment", "Acero inoxidable 316", None, QtGui.QApplication.UnicodeUTF8)) self.materialPisos.addItem( QtGui.QApplication.translate("equipment", "Carpenter 20CB-3", None, QtGui.QApplication.UnicodeUTF8)) self.materialPisos.addItem( QtGui.QApplication.translate("equipment", "Niquel 200", None, QtGui.QApplication.UnicodeUTF8)) self.materialPisos.addItem( QtGui.QApplication.translate("equipment", "Monel 400", None, QtGui.QApplication.UnicodeUTF8)) self.materialPisos.addItem( QtGui.QApplication.translate("equipment", "Inconel 600", None, QtGui.QApplication.UnicodeUTF8)) self.materialPisos.addItem( QtGui.QApplication.translate("equipment", "Incoloy 825", None, QtGui.QApplication.UnicodeUTF8)) self.materialPisos.addItem( QtGui.QApplication.translate("equipment", "Titanio", None, QtGui.QApplication.UnicodeUTF8)) self.materialPisos.currentIndexChanged.connect(self.calcularCostos) gridLayout_1.addWidget(self.materialPisos, 2, 2, 1, 1) gridLayout_1.addItem( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 3, 1, 1, 2) gridLayout_1.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Diametro:", None, QtGui.QApplication.UnicodeUTF8)), 4, 1, 1, 1) self.diametroPisos = Entrada_con_unidades(unidades.Length) gridLayout_1.addWidget(self.diametroPisos, 4, 2, 1, 1) gridLayout_1.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Número:", None, QtGui.QApplication.UnicodeUTF8)), 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( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 6, 1, 1, 2) self.groupBox_relleno = QtGui.QGroupBox( QtGui.QApplication.translate("equipment", "Torre de relleno", None, QtGui.QApplication.UnicodeUTF8)) gridLayout_Costos.addWidget(self.groupBox_relleno, 1, 4, 4, 2) gridLayout_2 = QtGui.QGridLayout(self.groupBox_relleno) gridLayout_2.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Volumen:", None, QtGui.QApplication.UnicodeUTF8)), 1, 1, 1, 1) self.VolumenRelleno = Entrada_con_unidades(unidades.Volume, "VolLiq") gridLayout_2.addWidget(self.VolumenRelleno, 1, 2, 1, 1) gridLayout_2.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Coste unitario:", None, QtGui.QApplication.UnicodeUTF8)), 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( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 3, 1, 1, 2) gridLayout_Costos.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Diametro:", None, QtGui.QApplication.UnicodeUTF8)), 5, 1, 1, 1) self.Dc = Entrada_con_unidades(unidades.Length) gridLayout_Costos.addWidget(self.Dc, 5, 2, 1, 2) gridLayout_Costos.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Altura:", None, QtGui.QApplication.UnicodeUTF8)), 6, 1, 1, 1) self.Hc = Entrada_con_unidades(unidades.Length) gridLayout_Costos.addWidget(self.Hc, 6, 2, 1, 2) gridLayout_Costos.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Espesor (Tapa):", None, QtGui.QApplication.UnicodeUTF8)), 7, 1, 1, 1) self.EspesorSuperior = Entrada_con_unidades(unidades.Length, "Thickness") gridLayout_Costos.addWidget(self.EspesorSuperior, 7, 2, 1, 2) gridLayout_Costos.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Espesor (Fondo):", None, QtGui.QApplication.UnicodeUTF8)), 8, 1, 1, 1) self.EspesorInferior = Entrada_con_unidades(unidades.Length, "Thickness") gridLayout_Costos.addWidget(self.EspesorInferior, 8, 2, 1, 2) gridLayout_Costos.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Densidad:", None, QtGui.QApplication.UnicodeUTF8)), 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( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 12, 1, 1, 6) self.groupBox_Costos = QtGui.QGroupBox( QtGui.QApplication.translate("equipment", "Costos calculados", None, QtGui.QApplication.UnicodeUTF8)) gridLayout_Costos.addWidget(self.groupBox_Costos, 13, 1, 1, 5) gridLayout_5 = QtGui.QGridLayout(self.groupBox_Costos) gridLayout_5.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Coste Pisos:", None, QtGui.QApplication.UnicodeUTF8)), 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( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Coste Carcasa:", None, QtGui.QApplication.UnicodeUTF8)), 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( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Coste Accesorios:", None, QtGui.QApplication.UnicodeUTF8)), 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( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Coste Columna:", None, QtGui.QApplication.UnicodeUTF8)), 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( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Coste Adquisición:", None, QtGui.QApplication.UnicodeUTF8)), 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( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Coste Instalación:", None, QtGui.QApplication.UnicodeUTF8)), 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 __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, 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", "Tipo:", None, QtGui.QApplication.UnicodeUTF8)), 1, 1) self.tipo = QtGui.QComboBox() self.tipo.addItem( QtGui.QApplication.translate("equipment", "Recirculación externa forzada", None, QtGui.QApplication.UnicodeUTF8)) self.tipo.addItem( QtGui.QApplication.translate("equipment", "Internos de tubo forzado", None, QtGui.QApplication.UnicodeUTF8)) self.tipo.addItem( QtGui.QApplication.translate("equipment", "Discontinuos a vacío", None, QtGui.QApplication.UnicodeUTF8)) self.tipo.currentIndexChanged.connect(self.mostrarSubclasificacion) self.tipo.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.tipo, 1, 2, 1, 3) gridLayout_Costos.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Material:", None, QtGui.QApplication.UnicodeUTF8)), 2, 1) self.materialvacio = QtGui.QComboBox() self.materialvacio.addItem( QtGui.QApplication.translate("equipment", "Acero dulce", None, QtGui.QApplication.UnicodeUTF8)) self.materialvacio.addItem( QtGui.QApplication.translate("equipment", "Acero recubierto de caucho", None, QtGui.QApplication.UnicodeUTF8)) self.materialvacio.addItem( QtGui.QApplication.translate("equipment", "Acero inoxidable 304", None, QtGui.QApplication.UnicodeUTF8)) self.materialvacio.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.materialvacio, 2, 2, 1, 3) self.materialotros = QtGui.QComboBox() self.materialotros.addItem( QtGui.QApplication.translate("equipment", "Acero dulce", None, QtGui.QApplication.UnicodeUTF8)) self.materialotros.addItem( QtGui.QApplication.translate("equipment", "Acero inoxidable 304", None, QtGui.QApplication.UnicodeUTF8)) self.materialotros.currentIndexChanged.connect(self.calcularCostos) gridLayout_Costos.addWidget(self.materialotros, 2, 2, 1, 3) gridLayout_Costos.addWidget( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Volumen:", None, QtGui.QApplication.UnicodeUTF8)), 4, 4) self.Volumen = Entrada_con_unidades(unidades.Volume, "VolLiq", width=80) gridLayout_Costos.addWidget(self.Volumen, 4, 5, 1, 1) gridLayout_Costos.addItem( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed), 3, 0, 1, 6) self.label4 = QtGui.QLabel() self.label4.setText( QtGui.QApplication.translate("equipment", "Caudal calculado:", None, QtGui.QApplication.UnicodeUTF8)) 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( QtGui.QLabel( QtGui.QApplication.translate("equipment", "Caudal de diseño:", None, QtGui.QApplication.UnicodeUTF8)), 5, 1) self.caudaldiseno = Entrada_con_unidades(unidades.MassFlow) gridLayout_Costos.addWidget(self.caudaldiseno, 5, 2, 1, 1) gridLayout_Costos.addItem( QtGui.QSpacerItem(10, 10, QtGui.QSizePolicy.Fixed, QtGui.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( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 11, 0, 1, 6) gridLayout_Costos.addItem( QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding), 9, 0, 1, 6) self.groupBox_Costos = QtGui.QGroupBox( QtGui.QApplication.translate("equipment", "Costos calculados", None, QtGui.QApplication.UnicodeUTF8)) gridLayout_Costos.addWidget(self.groupBox_Costos, 10, 1, 1, 5) 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) self.tabWidget.setCurrentIndex(0) self.mostrarSubclasificacion(0)
def __init__(self, parent=None): super(Definicion_Petro, self).__init__(parent) self.setWindowTitle(QtWidgets.QApplication.translate( "pychemqt", "Petrol component definition")) layout = QtWidgets.QVBoxLayout(self) self.toolBox = QtWidgets.QTabWidget() self.toolBox.setTabPosition(QtWidgets.QTabWidget.South) layout.addWidget(self.toolBox) # Distillation data definition distilationPage = QtWidgets.QWidget() self.toolBox.addTab( distilationPage, QtWidgets.QApplication.translate("pychemqt", "Distillation data")) lyt = QtWidgets.QGridLayout(distilationPage) # Widget with curve functionality curveWidget = QtWidgets.QWidget() lytcurve = QtWidgets.QGridLayout(curveWidget) lytcurve.addWidget(QtWidgets.QLabel("Curve type"), 1, 1) self.tipoCurva = QtWidgets.QComboBox() for method in Petroleo.CURVE_TYPE: self.tipoCurva.addItem(method) self.tipoCurva.currentIndexChanged.connect(self.curveIndexChanged) lytcurve.addWidget(self.tipoCurva, 1, 2) self.curvaDestilacion = InputTableWidget(2) self.curvaDestilacion.tabla.horizontalHeader().show() self.curvaDestilacion.tabla.rowFinished.connect(self.checkStatusCurve) lytcurve.addWidget(self.curvaDestilacion, 2, 1, 3, 3) self.regresionButton = QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap( os.path.join(IMAGE_PATH, "button", "fit.png"))), QtWidgets.QApplication.translate("pychemqt", "Regression")) self.regresionButton.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Calculate missing required values from a curve fit")) self.regresionButton.clicked.connect(self.regresionCurve) lytcurve.addWidget(self.regresionButton, 2, 3) self.finishButton = QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap( os.path.join(IMAGE_PATH, "button", "arrow-right.png"))), QtWidgets.QApplication.translate("pychemqt", "Finish")) self.finishButton.clicked.connect(self.finishCurva) lytcurve.addWidget(self.finishButton, 5, 3) lytcurve.addWidget(QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Pressure")), 5, 1) self.presion = Entrada_con_unidades(Pressure, value=101325.) self.presion.valueChanged.connect(partial( self.changeParams, "P_curve")) lytcurve.addWidget(self.presion, 5, 2) lytcurve.addItem(QtWidgets.QSpacerItem( 20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 6, 4) # Widget with crude functionality crudeWidget = QtWidgets.QWidget() lytcrude = QtWidgets.QGridLayout(crudeWidget) self.crudo = QtWidgets.QComboBox() self.crudo.addItem("") query = "SELECT name, location, API, sulfur FROM CrudeOil" sql.databank.execute(query) for name, location, API, sulfur in sql.databank: self.crudo.addItem("%s (%s) API: %s %s: %s" % ( name, location, API, "%S", sulfur)) self.crudo.currentIndexChanged.connect(partial( self.changeParams, "index")) lytcrude.addWidget(self.crudo, 1, 1, 1, 2) lytcrude.addWidget(QtWidgets.QLabel("Pseudo C+"), 2, 1) self.Cplus = Entrada_con_unidades(int, width=50) self.Cplus.valueChanged.connect(partial(self.changeParams, "Cplus")) lytcrude.addWidget(self.Cplus, 2, 2) self.checkCurva = QtWidgets.QRadioButton( QtWidgets.QApplication.translate( "pychemqt", "Define destillation curve")) self.checkCurva.toggled.connect(curveWidget.setEnabled) curveWidget.setEnabled(False) lyt.addWidget(self.checkCurva, 1, 1, 1, 2) lyt.addWidget(curveWidget, 2, 1, 1, 2) lyt.addItem(QtWidgets.QSpacerItem( 20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 3, 1) self.checkCrudo = QtWidgets.QRadioButton( QtWidgets.QApplication.translate( "pychemqt", "Use petrol fraction from list")) self.checkCrudo.toggled.connect(self.changeUnknown) self.checkCrudo.toggled.connect(crudeWidget.setEnabled) crudeWidget.setEnabled(False) lyt.addWidget(self.checkCrudo, 4, 1, 1, 2) lyt.addWidget(crudeWidget, 5, 1, 1, 2) lyt.addItem(QtWidgets.QSpacerItem( 20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 6, 1, 1, 2) self.checkBlend = QtWidgets.QCheckBox(QtWidgets.QApplication.translate( "pychemqt", "Blend if its necessary")) lyt.addWidget(self.checkBlend, 7, 1, 1, 2) self.cutButton = QtWidgets.QPushButton( QtWidgets.QApplication.translate("pychemqt", "Define cut ranges")) self.cutButton.setEnabled(False) self.cutButton.clicked.connect(self.showCutRange) lyt.addWidget(self.cutButton, 7, 2) self.checkBlend.toggled.connect(self.cutButton.setEnabled) lyt.addItem(QtWidgets.QSpacerItem( 5, 5, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding), 8, 1) # Definition with bulk properties definitionPage = QtWidgets.QWidget() self.toolBox.addTab( definitionPage, QtWidgets.QApplication.translate("pychemqt", "Bulk Definition")) lyt = QtWidgets.QGridLayout(definitionPage) txt = QtWidgets.QLabel("Tb") txt.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Boiling point")) lyt.addWidget(txt, 1, 1) self.Tb = Entrada_con_unidades(Temperature) self.Tb.valueChanged.connect(partial(self.changeParams, "Tb")) lyt.addWidget(self.Tb, 1, 2) txt = QtWidgets.QLabel("M") txt.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Molecular weight")) lyt.addWidget(txt, 2, 1) self.M = Entrada_con_unidades(float, textounidad="g/mol") self.M.valueChanged.connect(partial(self.changeParams, "M")) lyt.addWidget(self.M, 2, 2) txt = QtWidgets.QLabel("SG") txt.setToolTip( QtWidgets.QApplication.translate("pychemqt", "Specific Gravity")) lyt.addWidget(txt, 3, 1) self.SG = Entrada_con_unidades(float) self.SG.valueChanged.connect(partial(self.changeParams, "SG")) lyt.addWidget(self.SG, 3, 2) txt = QtWidgets.QLabel("API") txt.setToolTip( QtWidgets.QApplication.translate("pychemqt", "API Gravity")) lyt.addWidget(txt, 4, 1) self.API = Entrada_con_unidades(float) self.API.valueChanged.connect(partial(self.changeParams, "API")) lyt.addWidget(self.API, 4, 2) txt = QtWidgets.QLabel("Kw") txt.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Watson characterization factor")) lyt.addWidget(txt, 5, 1) self.Kw = Entrada_con_unidades(float) self.Kw.valueChanged.connect(partial(self.changeParams, "Kw")) lyt.addWidget(self.Kw, 5, 2) lyt.addWidget(QtWidgets.QLabel("C/H"), 6, 1) self.CH = Entrada_con_unidades(float) self.CH.valueChanged.connect(partial(self.changeParams, "CH")) lyt.addWidget(self.CH, 6, 2) txt = QtWidgets.QLabel("ν<sub>100F</sub>") txt.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Kinematic viscosity at 100ºF")) lyt.addWidget(txt, 7, 1) self.v100 = Entrada_con_unidades(Diffusivity) self.v100.valueChanged.connect(partial(self.changeParams, "v100")) lyt.addWidget(self.v100, 7, 2) txt = QtWidgets.QLabel("ν<sub>210F</sub>") txt.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Kinematic viscosity at 210ºF")) lyt.addWidget(txt, 8, 1) self.v210 = Entrada_con_unidades(Diffusivity) self.v210.valueChanged.connect(partial(self.changeParams, "v210")) lyt.addWidget(self.v210, 8, 2) txt = QtWidgets.QLabel("n") txt.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Refractive index")) lyt.addWidget(txt, 9, 1) self.n = Entrada_con_unidades(float) self.n.valueChanged.connect(partial(self.changeParams, "n")) lyt.addWidget(self.n, 9, 2) txt = QtWidgets.QLabel("I") txt.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Huang Parameter")) lyt.addWidget(txt, 10, 1) self.I = Entrada_con_unidades(float) self.I.valueChanged.connect(partial(self.changeParams, "I")) lyt.addWidget(self.I, 10, 2) lyt.addWidget(QtWidgets.QLabel("%S"), 11, 1) self.S = Entrada_con_unidades(float, spinbox=True, step=1.0, max=100) self.S.valueChanged.connect(partial(self.changeParams, "S")) lyt.addWidget(self.S, 11, 2) lyt.addWidget(QtWidgets.QLabel("%H"), 12, 1) self.H = Entrada_con_unidades(float, spinbox=True, step=1.0, max=100) self.H.valueChanged.connect(partial(self.changeParams, "H")) lyt.addWidget(self.H, 12, 2) lyt.addWidget(QtWidgets.QLabel("%N"), 13, 1) self.N = Entrada_con_unidades(float, spinbox=True, step=1.0, max=100) self.N.valueChanged.connect(partial(self.changeParams, "N")) lyt.addWidget(self.N, 13, 2) lyt.addItem(QtWidgets.QSpacerItem( 10, 10, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed), 14, 1, 1, 2) lyt.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "Alternate definition, poor accuracy")), 15, 1, 1, 2) txt = QtWidgets.QLabel("Nc") txt.setToolTip(QtWidgets.QApplication.translate( "pychemqt", "Carbon number")) lyt.addWidget(txt, 16, 1) self.Nc = Entrada_con_unidades(int, width=50) self.Nc.valueChanged.connect(partial(self.changeParams, "Nc")) lyt.addWidget(self.Nc, 16, 2) # Configuration configPage = prefPetro.Widget(Preferences) self.toolBox.addTab( configPage, QtGui.QIcon(IMAGE_PATH + "button/configure.png"), QtWidgets.QApplication.translate("pychemqt", "Configuration")) # Initialization section newComponent.loadUI(self) self.curveParameters = None # Fitting parameter for distillation curve self.Petroleo = Petroleo() self.Crudo = Crudo() self.curveIndexChanged(0) self.checkStatusCurve()