#This is part of the source code for the Paineira Graphical User Interface - Iguape
#The code is distributed under the GNU GPL-3.0 License. Please refer to the main page (https://github.com/cnpem/iguape) for more information

"""
Main GUI python script. This GUI was built with PyQt5. The .ui file can be found inside the GUI folder.
"""

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(852, 605)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("Icons/Logo_IGUAPE.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MainWindow.setWindowIcon(icon)
        MainWindow.setStyleSheet("")
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.reset_button = QtWidgets.QPushButton(self.centralwidget)
        self.reset_button.setMinimumSize(QtCore.QSize(0, 0))
        self.reset_button.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.reset_button.setObjectName("reset_button")
        self.gridLayout.addWidget(self.reset_button, 2, 3, 1, 1)
        self.offset_label = QtWidgets.QLabel(self.centralwidget)
        self.offset_label.setObjectName("offset_label")
        self.gridLayout.addWidget(self.offset_label, 2, 0, 1, 1)
        self.min_temp_doubleSpinBox = QtWidgets.QDoubleSpinBox(self.centralwidget)
        self.min_temp_doubleSpinBox.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.min_temp_doubleSpinBox.setDecimals(0)
        self.min_temp_doubleSpinBox.setObjectName("min_temp_doubleSpinBox")
        self.gridLayout.addWidget(self.min_temp_doubleSpinBox, 4, 1, 1, 1)
        self.offset_slider = QtWidgets.QSlider(self.centralwidget)
        self.offset_slider.setMaximumSize(QtCore.QSize(500, 16777215))
        self.offset_slider.setOrientation(QtCore.Qt.Horizontal)
        self.offset_slider.setObjectName("offset_slider")
        self.gridLayout.addWidget(self.offset_slider, 2, 1, 1, 1)
        self.XRD_measure_order_checkbox = QtWidgets.QCheckBox(self.centralwidget)
        self.XRD_measure_order_checkbox.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.XRD_measure_order_checkbox.setCheckable(True)
        self.XRD_measure_order_checkbox.setChecked(True)
        self.XRD_measure_order_checkbox.setTristate(False)
        self.XRD_measure_order_checkbox.setObjectName("XRD_measure_order_checkbox")
        self.gridLayout.addWidget(self.XRD_measure_order_checkbox, 3, 1, 1, 1)
        self.index_label = QtWidgets.QLabel(self.centralwidget)
        self.index_label.setObjectName("index_label")
        self.gridLayout.addWidget(self.index_label, 3, 0, 1, 1)
        self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
        self.tabWidget.setObjectName("tabWidget")
        self.XRD_data_tab = QtWidgets.QWidget()
        self.XRD_data_tab.setObjectName("XRD_data_tab")
        self.tabWidget.addTab(self.XRD_data_tab, "")
        self.peak_fit_tab = QtWidgets.QWidget()
        self.peak_fit_tab.setObjectName("peak_fit_tab")
        self.tabWidget.addTab(self.peak_fit_tab, "")
        self.gridLayout.addWidget(self.tabWidget, 1, 0, 1, 6)
        self.save_peak_fit_data_button = QtWidgets.QPushButton(self.centralwidget)
        self.save_peak_fit_data_button.setMinimumSize(QtCore.QSize(0, 0))
        self.save_peak_fit_data_button.setMaximumSize(QtCore.QSize(16777215, 16777215))
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap("Icons/Save_Icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.save_peak_fit_data_button.setIcon(icon1)
        self.save_peak_fit_data_button.setObjectName("save_peak_fit_data_button")
        self.gridLayout.addWidget(self.save_peak_fit_data_button, 3, 4, 1, 2)
        self.min_filter_label = QtWidgets.QLabel(self.centralwidget)
        self.min_filter_label.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.min_filter_label.setObjectName("min_filter_label")
        self.gridLayout.addWidget(self.min_filter_label, 4, 0, 1, 1)
        self.CNPEM_logo = QtWidgets.QLabel(self.centralwidget)
        self.CNPEM_logo.setMaximumSize(QtCore.QSize(100, 50))
        self.CNPEM_logo.setText("")
        self.CNPEM_logo.setPixmap(QtGui.QPixmap("Icons/CNPEM-logo-colorido-2023_resize.png"))
        self.CNPEM_logo.setObjectName("CNPEM_logo")
        self.gridLayout.addWidget(self.CNPEM_logo, 0, 0, 1, 1)
        self.max_filter_label = QtWidgets.QLabel(self.centralwidget)
        self.max_filter_label.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.max_filter_label.setObjectName("max_filter_label")
        self.gridLayout.addWidget(self.max_filter_label, 4, 2, 1, 1)
        self.paineir_logo = QtWidgets.QLabel(self.centralwidget)
        self.paineir_logo.setMaximumSize(QtCore.QSize(70, 100))
        self.paineir_logo.setText("")
        self.paineir_logo.setPixmap(QtGui.QPixmap("Icons/Paineira_resize.png"))
        self.paineir_logo.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.paineir_logo.setObjectName("paineir_logo")
        self.gridLayout.addWidget(self.paineir_logo, 0, 5, 1, 1)
        self.refresh_button = QtWidgets.QPushButton(self.centralwidget)
        self.refresh_button.setMaximumSize(QtCore.QSize(16777215, 16777215))
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap("Icons/Refresh_Icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.refresh_button.setIcon(icon2)
        self.refresh_button.setObjectName("refresh_button")
        self.gridLayout.addWidget(self.refresh_button, 2, 2, 1, 1)
        self.peak_fit_button = QtWidgets.QPushButton(self.centralwidget)
        self.peak_fit_button.setMaximumSize(QtCore.QSize(16777215, 16777215))
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap("Icons/peak_fit_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.peak_fit_button.setIcon(icon3)
        self.peak_fit_button.setObjectName("peak_fit_button")
        self.gridLayout.addWidget(self.peak_fit_button, 2, 4, 1, 2)
        self.LNLS_logo = QtWidgets.QLabel(self.centralwidget)
        self.LNLS_logo.setMaximumSize(QtCore.QSize(16777215, 50))
        self.LNLS_logo.setText("")
        self.LNLS_logo.setPixmap(QtGui.QPixmap("Icons/LNLS_logo_resize.png"))
        self.LNLS_logo.setAlignment(QtCore.Qt.AlignCenter)
        self.LNLS_logo.setObjectName("LNLS_logo")
        self.gridLayout.addWidget(self.LNLS_logo, 0, 4, 1, 1)
        self.max_temp_doubleSpinBox_2 = QtWidgets.QDoubleSpinBox(self.centralwidget)
        self.max_temp_doubleSpinBox_2.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.max_temp_doubleSpinBox_2.setFrame(True)
        self.max_temp_doubleSpinBox_2.setDecimals(0)
        self.max_temp_doubleSpinBox_2.setObjectName("max_temp_doubleSpinBox_2")
        self.gridLayout.addWidget(self.max_temp_doubleSpinBox_2, 4, 3, 1, 1)
        self.temperature_checkbox = QtWidgets.QCheckBox(self.centralwidget)
        self.temperature_checkbox.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.temperature_checkbox.setObjectName("temperature_checkbox")
        self.gridLayout.addWidget(self.temperature_checkbox, 3, 2, 1, 1)
        self.filter_button = QtWidgets.QPushButton(self.centralwidget)
        self.filter_button.setMaximumSize(QtCore.QSize(16777215, 16777215))
        icon4 = QtGui.QIcon()
        icon4.addPixmap(QtGui.QPixmap("Icons/Filter_Icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.filter_button.setIcon(icon4)
        self.filter_button.setObjectName("filter_button")
        self.gridLayout.addWidget(self.filter_button, 4, 4, 1, 2)
        self.title_label = QtWidgets.QLabel(self.centralwidget)
        self.title_label.setMinimumSize(QtCore.QSize(0, 0))
        self.title_label.setMaximumSize(QtCore.QSize(16777215, 50))
        self.title_label.setFrameShape(QtWidgets.QFrame.HLine)
        self.title_label.setFrameShadow(QtWidgets.QFrame.Raised)
        self.title_label.setLineWidth(1)
        self.title_label.setAlignment(QtCore.Qt.AlignCenter)
        self.title_label.setObjectName("title_label")
        self.gridLayout.addWidget(self.title_label, 0, 1, 1, 3)
        self.verticalLayout.addLayout(self.gridLayout)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 852, 20))
        self.menubar.setObjectName("menubar")
        self.menuFolder = QtWidgets.QMenu(self.menubar)
        self.menuFolder.setObjectName("menuFolder")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.actionOpen_New_Folder = QtWidgets.QAction(MainWindow)
        self.actionOpen_New_Folder.setObjectName("actionOpen_New_Folder")
        self.actionAbout = QtWidgets.QAction(MainWindow)
        self.actionAbout.setObjectName("actionAbout")
        self.actionHelp = QtWidgets.QAction(MainWindow)
        self.actionHelp.setObjectName("actionHelp")
        self.menuFolder.addAction(self.actionOpen_New_Folder)
        self.menuFolder.addSeparator()
        self.menuFolder.addAction(self.actionAbout)
        self.menuFolder.addAction(self.actionHelp)
        self.menubar.addAction(self.menuFolder.menuAction())

        self.retranslateUi(MainWindow)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "Iguape"))
        self.reset_button.setText(_translate("MainWindow", "Reset 2θ"))
        self.offset_label.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:10pt; text-decoration: underline;\">XRD patterns offset:</span></p></body></html>"))
        self.XRD_measure_order_checkbox.setText(_translate("MainWindow", "XRD measure order"))
        self.index_label.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:10pt; text-decoration: underline;\">Select XDR patterns indexing:</span></p></body></html>"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.XRD_data_tab), _translate("MainWindow", "XRD Data"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.peak_fit_tab), _translate("MainWindow", "Peak Fitting"))
        self.save_peak_fit_data_button.setText(_translate("MainWindow", "Save Peak Fit Data"))
        self.min_filter_label.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:10pt; text-decoration: underline;\">Minimum:</span></p></body></html>"))
        self.max_filter_label.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:10pt; text-decoration: underline;\">Maximum:</span></p></body></html>"))
        self.refresh_button.setText(_translate("MainWindow", "Refresh"))
        self.peak_fit_button.setText(_translate("MainWindow", "Peak Fit"))
        self.temperature_checkbox.setText(_translate("MainWindow", "Blower Temperature"))
        self.filter_button.setText(_translate("MainWindow", "Apply Filter "))
        self.title_label.setText(_translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-weight:600;\">IGUAPE</span></p><p align=\"center\"><span style=\" font-size:7pt; font-weight:600;\">(PAINEIRA GRAPHICAL USER INTERFACE)</span></p></body></html>"))
        self.menuFolder.setTitle(_translate("MainWindow", "Folder"))
        self.actionOpen_New_Folder.setText(_translate("MainWindow", "Open New Folder"))
        self.actionAbout.setText(_translate("MainWindow", "About"))
        self.actionHelp.setText(_translate("MainWindow", "Help"))
