Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
 def __init__(self, parent=None):
     super(Moody, self).__init__(parent)
     self.showMaximized()
     self.setWindowTitle(self.title)
     layout=QtGui.QGridLayout(self)
     layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Method:")),1,1)
     self.metodos=QtGui.QComboBox()
     self.metodos.addItem("Colebrook")
     self.metodos.addItem("Chen (1979")
     self.metodos.addItem("Romeo (2002)")
     self.metodos.addItem("Goudar-Sonnad")
     self.metodos.addItem("Manadilli (1997)")
     self.metodos.addItem("Serghides")
     self.metodos.addItem("Churchill (1977)")
     self.metodos.addItem("Zigrang-Sylvester (1982)")
     self.metodos.addItem("Swamee-Jain (1976)")        
     
     self.metodos.currentIndexChanged.connect(self.cambiar)
     layout.addWidget(self.metodos,1,2)
     layout.setColumnStretch(3, 1)
     self.diagrama = mpl(self, dpi=90)
     layout.addWidget(self.diagrama,2,1,1,4)
     self.diagrama.fig.text(0.95, 0.4, QtGui.QApplication.translate("pychemqt", "Relative roughness")+", "+r"$r=\frac{\epsilon}{D}$", rotation=90, size='14')
     
     self.buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Close)
     self.buttonBox.rejected.connect(self.reject)
     layout.addWidget(self.buttonBox, 3, 1, 1, 4)
     
     self.cambiar(0)
Exemplo n.º 3
0
 def __init__(self, indices=None, nombres=None, x=None, y=None, parent=None):
     super(Binary_distillation, self).__init__(parent)
     self.setWindowTitle(self.title)
     layout=QtGui.QGridLayout(self)
     layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate("equipment", "Component 1:")),1,1)
     self.Comp1=QtGui.QComboBox()
     layout.addWidget(self.Comp1,1,2)
     layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate("equipment", "Component 2:")),1,4)
     self.Comp2=QtGui.QComboBox()
     layout.addWidget(self.Comp2,1,5)
     
     self.indices=indices
     self.nombres=nombres
     for i, nombre in enumerate(nombres):
         self.Comp1.addItem("%i - %s" %(i+1, nombre))
         self.Comp2.addItem("%i - %s" %(i+1, nombre))
     self.Comp2.setCurrentIndex(1)
     tab=QtGui.QTabWidget()
     layout.addWidget(tab,2,1,1,5)
     self.plot=mpl()
     tab.addTab(self.plot, QtGui.QApplication.translate("equipment", "Plot"))
     self.tabla=Tabla(2, horizontalHeader=["x", "y"], stretch=False, readOnly=True)
     tab.addTab(self.tabla, QtGui.QApplication.translate("equipment", "Table"))
     
     self.Comp1.currentIndexChanged.connect(self.calculo)
     self.Comp2.currentIndexChanged.connect(self.calculo)
     
     if x and y:
         self.rellenar(x, y)
     else:
         self.calculo()
Exemplo n.º 4
0
    def __init__(self, parent=None):
        super(Standing_Katz, self).__init__(parent)
        self.setWindowTitle(self.title)
        layout=QtGui.QGridLayout(self)
        layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Method:")),1,1)
        self.metodos=QtGui.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(QtGui.QSpacerItem(10,10,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Fixed),1, 3)
        layout.addWidget(QtGui.QLabel(QtGui.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(QtGui.QLabel(QtGui.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(QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Tr")),1, 8)
        self.Tr=QtGui.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 = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Close)
        self.buttonBox.rejected.connect(self.reject)
        layout.addWidget(self.buttonBox, 5, 1, 1, 6)

        self.plot_Z(0)
Exemplo n.º 5
0
    def __init__(self, indices=None, nombres=None, x=None, y=None, parent=None):
        super(Binary_distillation, self).__init__(parent)
        self.setWindowTitle(self.title)
        layout=QtWidgets.QGridLayout(self)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Component 1:")),1,1)
        self.Comp1=QtWidgets.QComboBox()
        layout.addWidget(self.Comp1,1,2)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate("equipment", "Component 2:")),1,4)
        self.Comp2=QtWidgets.QComboBox()
        layout.addWidget(self.Comp2,1,5)

        self.indices=indices
        self.nombres=nombres
        for i, nombre in enumerate(nombres):
            self.Comp1.addItem("%i - %s" %(i+1, nombre))
            self.Comp2.addItem("%i - %s" %(i+1, nombre))
        self.Comp2.setCurrentIndex(1)
        tab=QtWidgets.QTabWidget()
        layout.addWidget(tab,2,1,1,5)
        self.plot=mpl()
        tab.addTab(self.plot, QtWidgets.QApplication.translate("equipment", "Plot"))
        self.tabla=Tabla(2, horizontalHeader=["x", "y"], stretch=False, readOnly=True)
        tab.addTab(self.tabla, QtWidgets.QApplication.translate("equipment", "Table"))

        self.Comp1.currentIndexChanged.connect(self.calculo)
        self.Comp2.currentIndexChanged.connect(self.calculo)

        if x and y:
            self.rellenar(x, y)
        else:
            self.calculo()
Exemplo n.º 6
0
    def __init__(self, parent=None):
        super(Fi, self).__init__(parent)
        self.setWindowTitle(self.title)
        layout=QtGui.QGridLayout(self)
        layout.addWidget(QtGui.QLabel(QtGui.QApplication.translate("pychemqt", "Flow Arrangement")), 1, 1)
        self.flow=QtGui.QComboBox()
        for text, flow in self.flujo:
            self.flow.addItem(text)
        self.flow.currentIndexChanged.connect(self.plot)
        layout.addWidget(self.flow,1,2)
        self.mixed=QtGui.QComboBox()
        for text in self.mezclado:
            self.mixed.addItem(text)
        self.mixed.currentIndexChanged.connect(self.changeMixed)
        layout.addWidget(self.mixed,1,3)
        layout.addItem(QtGui.QSpacerItem(10,10,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Fixed),1,4)

        self.diagrama = mpl(self, width=10, height=10)
        self.image=self.diagrama.fig.figimage([[0]], 0, 0, zorder=1)
        logo=image.imread('images/pychemqt_98.png')
        self.logo=self.diagrama.fig.figimage(logo, 0, 0, zorder=1)

        self.botonGuardar=QtGui.QToolButton()
        self.botonGuardar.setIcon(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/fileSave.png")))
        self.botonGuardar.setToolTip(QtGui.QApplication.translate("pychemqt", "Save chart to file"))
        self.botonGuardar.clicked.connect(self.save)
        layout.addWidget(self.botonGuardar,5,1)
        layout.addWidget(self.diagrama,2,1,1,6)
        self.buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Close)
        self.buttonBox.rejected.connect(self.reject)
        layout.addWidget(self.buttonBox, 5, 2, 1, 5)

        self.plot(0)
        self.showMaximized()
        self.refixImage()
Exemplo n.º 7
0
    def __init__(self, parent=None):
        super(Moody, self).__init__(parent)
        self.showMaximized()
        self.setWindowTitle(self.title)
        layout = QtWidgets.QGridLayout(self)
        layout.setColumnStretch(3, 1)
        self.diagrama = mpl(self)
        layout.addWidget(self.diagrama, 2, 1, 1, 4)

        self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Close)
        self.buttonBox.rejected.connect(self.reject)
        txt = QtWidgets.QApplication.translate("pychemqt", "Calculate point")
        self.buttonCalculation = QtWidgets.QPushButton(txt)
        self.buttonBox.addButton(self.buttonCalculation, QtWidgets.QDialogButtonBox.ActionRole)
        self.buttonCalculation.clicked.connect(self.calculate)
        layout.addWidget(self.buttonBox, 3, 1, 1, 4)

        self.__plot()
Exemplo n.º 8
0
    def __init__(self, parent=None):
        super(Chart, self).__init__(parent)
        self.setWindowTitle(self.title)
        layout = QtWidgets.QGridLayout(self)
        layout.setColumnStretch(3, 1)
        self.plt = mpl(self)
        self.plt.fig.canvas.mpl_connect('button_press_event', self.click)
        layout.addWidget(self.plt, 2, 1, 1, 4)

        btBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Close,
                                           self)
        butonPNG = QtWidgets.QPushButton(
            QtGui.QIcon(os.path.join(IMAGE_PATH, "button", "image.png")),
            QtWidgets.QApplication.translate("pychemqt", "Save as PNG"))
        butonPNG.clicked.connect(self.plt.savePNG)
        butonConfig = QtWidgets.QPushButton(
            QtGui.QIcon(os.path.join(IMAGE_PATH, "button", "configure.png")),
            QtWidgets.QApplication.translate("pychemqt", "Configure"))
        butonConfig.clicked.connect(self.configure)
        butonCalculate = QtWidgets.QPushButton(
            QtGui.QIcon(os.path.join(IMAGE_PATH, "button", "calculator.png")),
            QtWidgets.QApplication.translate("pychemqt", "Calculate point"))
        butonCalculate.clicked.connect(self.calculate)
        btBox.rejected.connect(self.reject)
        btBox.layout().insertWidget(0, butonPNG)
        btBox.layout().insertWidget(0, butonCalculate)
        btBox.layout().insertWidget(0, butonConfig)
        layout.addWidget(btBox, 3, 1, 1, 4)

        self.Preferences = ConfigParser()
        self.Preferences.read(conf_dir + "pychemqtrc")
        self.config()
        self.plot()

        logo = image.imread(os.path.join(IMAGE_PATH, "pychemqt_98.png"))
        newax = self.plt.fig.add_axes(self.locLogo, anchor='SW')
        newax.imshow(logo, alpha=0.5)
        newax.axis('off')
Exemplo n.º 9
0
    def __init__(self, parent=None):
        super(Chart, self).__init__(parent)
        self.setWindowTitle(self.title)
        layout = QtWidgets.QGridLayout(self)
        layout.setColumnStretch(3, 1)
        self.plt = mpl(self)
        self.plt.fig.canvas.mpl_connect('button_press_event', self.click)
        layout.addWidget(self.plt, 2, 1, 1, 4)

        btBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Close)
        butonPNG = QtWidgets.QPushButton(QtGui.QIcon(
            os.path.join(IMAGE_PATH, "button", "image.png")),
            QtWidgets.QApplication.translate("pychemqt", "Save as PNG"))
        butonPNG.clicked.connect(self.plt.savePNG)
        butonConfig = QtWidgets.QPushButton(QtGui.QIcon(
            os.path.join(IMAGE_PATH, "button", "configure.png")),
            QtWidgets.QApplication.translate("pychemqt", "Configure"))
        butonConfig.clicked.connect(self.configure)
        butonCalculate = QtWidgets.QPushButton(QtGui.QIcon(
            os.path.join(IMAGE_PATH, "button", "calculator.png")),
            QtWidgets.QApplication.translate("pychemqt", "Calculate point"))
        butonCalculate.clicked.connect(self.calculate)
        btBox.rejected.connect(self.reject)
        btBox.layout().insertWidget(0, butonPNG)
        btBox.layout().insertWidget(0, butonCalculate)
        btBox.layout().insertWidget(0, butonConfig)
        layout.addWidget(btBox, 3, 1, 1, 4)

        self.Preferences = ConfigParser()
        self.Preferences.read(conf_dir+"pychemqtrc")
        self.config()
        self.plot()

        logo = image.imread(os.path.join(IMAGE_PATH, "pychemqt_98.png"))
        self.logo = self.plt.fig.figimage(logo, 0, 0, zorder=1, alpha=0.5)
        self.showMaximized()
Exemplo n.º 10
0
    def __init__(self, parent=None):
        super(Moody, self).__init__(parent)
        self.showMaximized()
        self.setWindowTitle(self.title)
        layout = QtWidgets.QGridLayout(self)
        layout.setColumnStretch(3, 1)
        self.plt = mpl(self)
        self.plt.fig.canvas.mpl_connect('button_press_event', self.click)
        layout.addWidget(self.plt, 2, 1, 1, 4)

        btBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Close)
        butonPNG = QtWidgets.QPushButton(
            QtGui.QIcon(os.environ["pychemqt"] +
                        os.path.join("images", "button", "image.png")),
            QtWidgets.QApplication.translate("pychemqt", "Save as PNG"))
        butonPNG.clicked.connect(self.plt.savePNG)
        butonConfig = QtWidgets.QPushButton(
            QtGui.QIcon(os.environ["pychemqt"] +
                        os.path.join("images", "button", "configure.png")),
            QtWidgets.QApplication.translate("pychemqt", "Configure"))
        butonConfig.clicked.connect(self.configure)
        butonCalculate = QtWidgets.QPushButton(
            QtGui.QIcon(os.environ["pychemqt"] +
                        os.path.join("images", "button", "calculator.png")),
            QtWidgets.QApplication.translate("pychemqt", "Calculate point"))
        butonCalculate.clicked.connect(self.calculate)
        btBox.rejected.connect(self.reject)
        btBox.layout().insertWidget(0, butonPNG)
        btBox.layout().insertWidget(0, butonCalculate)
        btBox.layout().insertWidget(0, butonConfig)
        layout.addWidget(btBox, 3, 1, 1, 4)

        self.Preferences = ConfigParser()
        self.Preferences.read(conf_dir + "pychemqtrc")
        self.config()
        self.plot()