
from PyQt5 import QtCore, QtGui,QtWidgets
from PyQt5.QtWidgets import QMessageBox, QWidget
from model.pred import prediction
import numpy as np
class Ui_MainWindow(QWidget):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(887, 762)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
        self.groupBox.setEnabled(True)
        self.groupBox.setGeometry(QtCore.QRect(20, 0, 851, 481))
        self.groupBox.setObjectName("groupBox")
        self.groupBox_2 = QtWidgets.QGroupBox(self.groupBox)
        self.groupBox_2.setEnabled(False)
        self.groupBox_2.setGeometry(QtCore.QRect(10, 20, 191, 381))
        self.groupBox_2.setObjectName("groupBox_2")
        self.lineEdit_x1 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x1.setGeometry(QtCore.QRect(50, 40, 113, 20))
        self.lineEdit_x1.setObjectName("lineEdit_x1")
        self.label = QtWidgets.QLabel(self.groupBox_2)
        self.label.setGeometry(QtCore.QRect(20, 40, 21, 16))
        self.label.setObjectName("label")
        self.lineEdit_x2 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x2.setGeometry(QtCore.QRect(50, 70, 113, 20))
        self.lineEdit_x2.setObjectName("lineEdit_x2")
        self.label_2 = QtWidgets.QLabel(self.groupBox_2)
        self.label_2.setGeometry(QtCore.QRect(20, 70, 21, 16))
        self.label_2.setObjectName("label_2")
        self.lineEdit_x3 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x3.setGeometry(QtCore.QRect(50, 100, 113, 20))
        self.lineEdit_x3.setObjectName("lineEdit_x3")
        self.label_3 = QtWidgets.QLabel(self.groupBox_2)
        self.label_3.setGeometry(QtCore.QRect(20, 100, 21, 16))
        self.label_3.setObjectName("label_3")
        self.lineEdit_x6 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x6.setGeometry(QtCore.QRect(50, 190, 113, 20))
        self.lineEdit_x6.setObjectName("lineEdit_x6")
        self.lineEdit_x4 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x4.setGeometry(QtCore.QRect(50, 130, 113, 20))
        self.lineEdit_x4.setObjectName("lineEdit_x4")
        self.label_4 = QtWidgets.QLabel(self.groupBox_2)
        self.label_4.setGeometry(QtCore.QRect(20, 160, 21, 16))
        self.label_4.setObjectName("label_4")
        self.label_5 = QtWidgets.QLabel(self.groupBox_2)
        self.label_5.setGeometry(QtCore.QRect(20, 190, 21, 16))
        self.label_5.setObjectName("label_5")
        self.groupBox_10 = QtWidgets.QGroupBox(self.groupBox_2)
        self.groupBox_10.setGeometry(QtCore.QRect(230, 110, 120, 80))
        self.groupBox_10.setObjectName("groupBox_10")
        self.lineEdit_x5 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x5.setGeometry(QtCore.QRect(50, 160, 113, 20))
        self.lineEdit_x5.setObjectName("lineEdit_x5")
        self.label_6 = QtWidgets.QLabel(self.groupBox_2)
        self.label_6.setGeometry(QtCore.QRect(20, 130, 21, 16))
        self.label_6.setObjectName("label_6")
        self.lineEdit_x9 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x9.setGeometry(QtCore.QRect(50, 280, 113, 20))
        self.lineEdit_x9.setObjectName("lineEdit_x9")
        self.lineEdit_x7 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x7.setGeometry(QtCore.QRect(50, 220, 113, 20))
        self.lineEdit_x7.setObjectName("lineEdit_x7")
        self.label_7 = QtWidgets.QLabel(self.groupBox_2)
        self.label_7.setGeometry(QtCore.QRect(20, 250, 21, 16))
        self.label_7.setObjectName("label_7")
        self.label_8 = QtWidgets.QLabel(self.groupBox_2)
        self.label_8.setGeometry(QtCore.QRect(20, 280, 21, 16))
        self.label_8.setObjectName("label_8")
        self.groupBox_11 = QtWidgets.QGroupBox(self.groupBox_2)
        self.groupBox_11.setGeometry(QtCore.QRect(290, 190, 120, 80))
        self.groupBox_11.setObjectName("groupBox_11")
        self.lineEdit_x8 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x8.setGeometry(QtCore.QRect(50, 250, 113, 20))
        self.lineEdit_x8.setObjectName("lineEdit_x8")
        self.label_9 = QtWidgets.QLabel(self.groupBox_2)
        self.label_9.setGeometry(QtCore.QRect(20, 220, 21, 16))
        self.label_9.setObjectName("label_9")
        self.label_10 = QtWidgets.QLabel(self.groupBox_2)
        self.label_10.setGeometry(QtCore.QRect(20, 340, 21, 16))
        self.label_10.setObjectName("label_10")
        self.lineEdit_x10 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x10.setGeometry(QtCore.QRect(50, 310, 113, 20))
        self.lineEdit_x10.setObjectName("lineEdit_x10")
        self.label_11 = QtWidgets.QLabel(self.groupBox_2)
        self.label_11.setGeometry(QtCore.QRect(20, 310, 21, 16))
        self.label_11.setObjectName("label_11")
        self.lineEdit_x11 = QtWidgets.QLineEdit(self.groupBox_2)
        self.lineEdit_x11.setGeometry(QtCore.QRect(50, 340, 113, 20))
        self.lineEdit_x11.setObjectName("lineEdit_x11")
        self.groupBox_4 = QtWidgets.QGroupBox(self.groupBox)
        self.groupBox_4.setGeometry(QtCore.QRect(10, 410, 171, 51))
        self.groupBox_4.setObjectName("groupBox_4")
        self.groupBox_12 = QtWidgets.QGroupBox(self.groupBox_4)
        self.groupBox_12.setGeometry(QtCore.QRect(210, -290, 171, 51))
        self.groupBox_12.setObjectName("groupBox_12")
        self.label_12 = QtWidgets.QLabel(self.groupBox_4)
        self.label_12.setGeometry(QtCore.QRect(20, 20, 21, 16))
        self.label_12.setObjectName("label_12")
        self.lineEdit_x12 = QtWidgets.QLineEdit(self.groupBox_4)
        self.lineEdit_x12.setEnabled(False)
        self.lineEdit_x12.setGeometry(QtCore.QRect(50, 20, 113, 20))
        self.lineEdit_x12.setObjectName("lineEdit_x12")
        self.groupBox_5 = QtWidgets.QGroupBox(self.groupBox)
        self.groupBox_5.setEnabled(False)
        self.groupBox_5.setGeometry(QtCore.QRect(210, 20, 181, 441))
        self.groupBox_5.setObjectName("groupBox_5")
        self.lineEdit_x15 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x15.setGeometry(QtCore.QRect(50, 80, 113, 20))
        self.lineEdit_x15.setObjectName("lineEdit_x15")
        self.lineEdit_x13 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x13.setGeometry(QtCore.QRect(50, 20, 113, 20))
        self.lineEdit_x13.setObjectName("lineEdit_x13")
        self.label_13 = QtWidgets.QLabel(self.groupBox_5)
        self.label_13.setGeometry(QtCore.QRect(20, 50, 21, 16))
        self.label_13.setObjectName("label_13")
        self.label_14 = QtWidgets.QLabel(self.groupBox_5)
        self.label_14.setGeometry(QtCore.QRect(20, 80, 21, 16))
        self.label_14.setObjectName("label_14")
        self.label_15 = QtWidgets.QLabel(self.groupBox_5)
        self.label_15.setGeometry(QtCore.QRect(20, 20, 21, 16))
        self.label_15.setObjectName("label_15")
        self.lineEdit_x14 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x14.setGeometry(QtCore.QRect(50, 50, 113, 20))
        self.lineEdit_x14.setObjectName("lineEdit_x14")
        self.label_16 = QtWidgets.QLabel(self.groupBox_5)
        self.label_16.setGeometry(QtCore.QRect(20, 140, 21, 16))
        self.label_16.setObjectName("label_16")
        self.lineEdit_x16 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x16.setGeometry(QtCore.QRect(50, 110, 113, 20))
        self.lineEdit_x16.setObjectName("lineEdit_x16")
        self.label_17 = QtWidgets.QLabel(self.groupBox_5)
        self.label_17.setGeometry(QtCore.QRect(20, 110, 21, 16))
        self.label_17.setObjectName("label_17")
        self.label_18 = QtWidgets.QLabel(self.groupBox_5)
        self.label_18.setGeometry(QtCore.QRect(20, 170, 21, 16))
        self.label_18.setObjectName("label_18")
        self.lineEdit_x18 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x18.setGeometry(QtCore.QRect(50, 170, 113, 20))
        self.lineEdit_x18.setObjectName("lineEdit_x18")
        self.lineEdit_x17 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x17.setGeometry(QtCore.QRect(50, 140, 113, 20))
        self.lineEdit_x17.setObjectName("lineEdit_x17")
        self.label_19 = QtWidgets.QLabel(self.groupBox_5)
        self.label_19.setGeometry(QtCore.QRect(20, 230, 21, 16))
        self.label_19.setObjectName("label_19")
        self.lineEdit_x23 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x23.setGeometry(QtCore.QRect(50, 320, 113, 20))
        self.lineEdit_x23.setText("")
        self.lineEdit_x23.setObjectName("lineEdit_x23")
        self.lineEdit_x24 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x24.setGeometry(QtCore.QRect(50, 350, 113, 20))
        self.lineEdit_x24.setText("")
        self.lineEdit_x24.setObjectName("lineEdit_x24")
        self.lineEdit_x22 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x22.setGeometry(QtCore.QRect(50, 290, 113, 20))
        self.lineEdit_x22.setText("")
        self.lineEdit_x22.setObjectName("lineEdit_x22")
        self.lineEdit_x19 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x19.setGeometry(QtCore.QRect(50, 200, 113, 20))
        self.lineEdit_x19.setText("")
        self.lineEdit_x19.setObjectName("lineEdit_x19")
        self.label_20 = QtWidgets.QLabel(self.groupBox_5)
        self.label_20.setGeometry(QtCore.QRect(20, 350, 21, 16))
        self.label_20.setObjectName("label_20")
        self.label_21 = QtWidgets.QLabel(self.groupBox_5)
        self.label_21.setGeometry(QtCore.QRect(20, 200, 21, 16))
        self.label_21.setObjectName("label_21")
        self.label_22 = QtWidgets.QLabel(self.groupBox_5)
        self.label_22.setGeometry(QtCore.QRect(20, 320, 21, 16))
        self.label_22.setObjectName("label_22")
        self.label_23 = QtWidgets.QLabel(self.groupBox_5)
        self.label_23.setGeometry(QtCore.QRect(20, 290, 21, 16))
        self.label_23.setObjectName("label_23")
        self.lineEdit_x21 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x21.setGeometry(QtCore.QRect(50, 260, 113, 20))
        self.lineEdit_x21.setText("")
        self.lineEdit_x21.setObjectName("lineEdit_x21")
        self.label_24 = QtWidgets.QLabel(self.groupBox_5)
        self.label_24.setGeometry(QtCore.QRect(20, 260, 21, 16))
        self.label_24.setObjectName("label_24")
        self.lineEdit_x20 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x20.setGeometry(QtCore.QRect(50, 230, 113, 20))
        self.lineEdit_x20.setText("")
        self.lineEdit_x20.setObjectName("lineEdit_x20")
        self.label_25 = QtWidgets.QLabel(self.groupBox_5)
        self.label_25.setGeometry(QtCore.QRect(20, 380, 21, 16))
        self.label_25.setObjectName("label_25")
        self.lineEdit_x25 = QtWidgets.QLineEdit(self.groupBox_5)
        self.lineEdit_x25.setGeometry(QtCore.QRect(50, 380, 113, 20))
        self.lineEdit_x25.setText("")
        self.lineEdit_x25.setObjectName("lineEdit_x25")
        self.groupBox_6 = QtWidgets.QGroupBox(self.groupBox)
        self.groupBox_6.setEnabled(False)
        self.groupBox_6.setGeometry(QtCore.QRect(410, 250, 171, 171))
        self.groupBox_6.setObjectName("groupBox_6")
        self.lineEdit_x31 = QtWidgets.QLineEdit(self.groupBox_6)
        self.lineEdit_x31.setGeometry(QtCore.QRect(50, 30, 113, 20))
        self.lineEdit_x31.setText("")
        self.lineEdit_x31.setObjectName("lineEdit_x31")
        self.lineEdit_x33 = QtWidgets.QLineEdit(self.groupBox_6)
        self.lineEdit_x33.setGeometry(QtCore.QRect(50, 90, 113, 20))
        self.lineEdit_x33.setText("")
        self.lineEdit_x33.setObjectName("lineEdit_x33")
        self.label_31 = QtWidgets.QLabel(self.groupBox_6)
        self.label_31.setGeometry(QtCore.QRect(20, 30, 21, 16))
        self.label_31.setObjectName("label_31")
        self.label_32 = QtWidgets.QLabel(self.groupBox_6)
        self.label_32.setGeometry(QtCore.QRect(20, 60, 21, 16))
        self.label_32.setObjectName("label_32")
        self.label_33 = QtWidgets.QLabel(self.groupBox_6)
        self.label_33.setGeometry(QtCore.QRect(20, 90, 21, 16))
        self.label_33.setObjectName("label_33")
        self.lineEdit_x34 = QtWidgets.QLineEdit(self.groupBox_6)
        self.lineEdit_x34.setGeometry(QtCore.QRect(50, 120, 113, 20))
        self.lineEdit_x34.setText("")
        self.lineEdit_x34.setObjectName("lineEdit_x34")
        self.label_34 = QtWidgets.QLabel(self.groupBox_6)
        self.label_34.setGeometry(QtCore.QRect(20, 120, 21, 16))
        self.label_34.setObjectName("label_34")
        self.lineEdit_x32 = QtWidgets.QLineEdit(self.groupBox_6)
        self.lineEdit_x32.setGeometry(QtCore.QRect(50, 60, 113, 20))
        self.lineEdit_x32.setText("")
        self.lineEdit_x32.setObjectName("lineEdit_x32")
        self.groupBox_7 = QtWidgets.QGroupBox(self.groupBox)
        self.groupBox_7.setEnabled(False)
        self.groupBox_7.setGeometry(QtCore.QRect(620, 170, 181, 71))
        self.groupBox_7.setObjectName("groupBox_7")
        self.label_37 = QtWidgets.QLabel(self.groupBox_7)
        self.label_37.setGeometry(QtCore.QRect(20, 30, 21, 16))
        self.label_37.setObjectName("label_37")
        self.lineEdit_x37 = QtWidgets.QLineEdit(self.groupBox_7)
        self.lineEdit_x37.setGeometry(QtCore.QRect(50, 30, 113, 20))
        self.lineEdit_x37.setText("")
        self.lineEdit_x37.setObjectName("lineEdit_x37")
        self.groupBox_9 = QtWidgets.QGroupBox(self.groupBox)
        self.groupBox_9.setEnabled(False)
        self.groupBox_9.setGeometry(QtCore.QRect(620, 30, 181, 101))
        self.groupBox_9.setObjectName("groupBox_9")
        self.lineEdit_x35 = QtWidgets.QLineEdit(self.groupBox_9)
        self.lineEdit_x35.setGeometry(QtCore.QRect(50, 30, 113, 20))
        self.lineEdit_x35.setText("")
        self.lineEdit_x35.setObjectName("lineEdit_x35")
        self.label_35 = QtWidgets.QLabel(self.groupBox_9)
        self.label_35.setGeometry(QtCore.QRect(20, 30, 21, 16))
        self.label_35.setObjectName("label_35")
        self.label_36 = QtWidgets.QLabel(self.groupBox_9)
        self.label_36.setGeometry(QtCore.QRect(20, 60, 21, 16))
        self.label_36.setObjectName("label_36")
        self.lineEdit_x36 = QtWidgets.QLineEdit(self.groupBox_9)
        self.lineEdit_x36.setGeometry(QtCore.QRect(50, 60, 113, 20))
        self.lineEdit_x36.setText("")
        self.lineEdit_x36.setObjectName("lineEdit_x36")
        self.groupBox_8 = QtWidgets.QGroupBox(self.groupBox)
        self.groupBox_8.setEnabled(False)
        self.groupBox_8.setGeometry(QtCore.QRect(410, 20, 171, 191))
        self.groupBox_8.setObjectName("groupBox_8")
        self.label_26 = QtWidgets.QLabel(self.groupBox_8)
        self.label_26.setGeometry(QtCore.QRect(10, 60, 21, 16))
        self.label_26.setObjectName("label_26")
        self.lineEdit_x30 = QtWidgets.QLineEdit(self.groupBox_8)
        self.lineEdit_x30.setGeometry(QtCore.QRect(40, 150, 113, 20))
        self.lineEdit_x30.setObjectName("lineEdit_x30")
        self.lineEdit_x29 = QtWidgets.QLineEdit(self.groupBox_8)
        self.lineEdit_x29.setGeometry(QtCore.QRect(40, 120, 113, 20))
        self.lineEdit_x29.setObjectName("lineEdit_x29")
        self.lineEdit_x26 = QtWidgets.QLineEdit(self.groupBox_8)
        self.lineEdit_x26.setGeometry(QtCore.QRect(40, 30, 113, 20))
        self.lineEdit_x26.setObjectName("lineEdit_x26")
        self.label_27 = QtWidgets.QLabel(self.groupBox_8)
        self.label_27.setGeometry(QtCore.QRect(10, 30, 21, 16))
        self.label_27.setObjectName("label_27")
        self.label_28 = QtWidgets.QLabel(self.groupBox_8)
        self.label_28.setGeometry(QtCore.QRect(10, 150, 21, 16))
        self.label_28.setObjectName("label_28")
        self.label_29 = QtWidgets.QLabel(self.groupBox_8)
        self.label_29.setGeometry(QtCore.QRect(10, 120, 21, 16))
        self.label_29.setObjectName("label_29")
        self.lineEdit_x28 = QtWidgets.QLineEdit(self.groupBox_8)
        self.lineEdit_x28.setGeometry(QtCore.QRect(40, 90, 113, 20))
        self.lineEdit_x28.setObjectName("lineEdit_x28")
        self.label_30 = QtWidgets.QLabel(self.groupBox_8)
        self.label_30.setGeometry(QtCore.QRect(10, 90, 21, 16))
        self.label_30.setObjectName("label_30")
        self.lineEdit_x27 = QtWidgets.QLineEdit(self.groupBox_8)
        self.lineEdit_x27.setGeometry(QtCore.QRect(40, 60, 113, 20))
        self.lineEdit_x27.setObjectName("lineEdit_x27")
        self.pushButton_import = QtWidgets.QPushButton(self.groupBox)
        self.pushButton_import.setEnabled(True)
        self.pushButton_import.setGeometry(QtCore.QRect(630, 280, 151, 41))
        self.pushButton_import.setObjectName("pushButton_import")
        self.pushButton_save = QtWidgets.QPushButton(self.groupBox)
        self.pushButton_save.setGeometry(QtCore.QRect(630, 350, 151, 41))
        self.pushButton_save.setObjectName("pushButton_save")
        self.groupBox_3 = QtWidgets.QGroupBox(self.centralwidget)
        self.groupBox_3.setGeometry(QtCore.QRect(310, 510, 561, 211))
        self.groupBox_3.setObjectName("groupBox_3")
        self.label_39 = QtWidgets.QLabel(self.groupBox_3)
        self.label_39.setGeometry(QtCore.QRect(70, 120, 21, 16))
        self.label_39.setObjectName("label_39")
        self.lineEdit_y3 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_y3.setGeometry(QtCore.QRect(100, 120, 113, 20))
        self.lineEdit_y3.setObjectName("lineEdit_y3")
        self.label_41 = QtWidgets.QLabel(self.groupBox_3)
        self.label_41.setGeometry(QtCore.QRect(70, 150, 21, 16))
        self.label_41.setObjectName("label_41")
        self.label_44 = QtWidgets.QLabel(self.groupBox_3)
        self.label_44.setGeometry(QtCore.QRect(70, 30, 21, 16))
        self.label_44.setObjectName("label_44")
        self.lineEdit_y1 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_y1.setGeometry(QtCore.QRect(100, 60, 113, 20))
        self.lineEdit_y1.setObjectName("lineEdit_y1")
        self.lineEdit_y2 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_y2.setGeometry(QtCore.QRect(100, 90, 113, 20))
        self.lineEdit_y2.setObjectName("lineEdit_y2")
        self.label_46 = QtWidgets.QLabel(self.groupBox_3)
        self.label_46.setGeometry(QtCore.QRect(70, 60, 21, 16))
        self.label_46.setObjectName("label_46")
        self.label_47 = QtWidgets.QLabel(self.groupBox_3)
        self.label_47.setGeometry(QtCore.QRect(70, 90, 21, 16))
        self.label_47.setObjectName("label_47")
        self.lineEdit_y4 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_y4.setGeometry(QtCore.QRect(100, 150, 113, 20))
        self.lineEdit_y4.setObjectName("lineEdit_y4")
        self.lineEdit_y0 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_y0.setGeometry(QtCore.QRect(100, 30, 113, 20))
        self.lineEdit_y0.setObjectName("lineEdit_y0")
        self.lineEdit_y9 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_y9.setGeometry(QtCore.QRect(270, 150, 113, 20))
        self.lineEdit_y9.setText("")
        self.lineEdit_y9.setObjectName("lineEdit_y9")
        self.label_42 = QtWidgets.QLabel(self.groupBox_3)
        self.label_42.setGeometry(QtCore.QRect(240, 30, 21, 16))
        self.label_42.setObjectName("label_42")
        self.lineEdit_y8 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_y8.setGeometry(QtCore.QRect(270, 120, 113, 20))
        self.lineEdit_y8.setText("")
        self.lineEdit_y8.setObjectName("lineEdit_y8")
        self.label_45 = QtWidgets.QLabel(self.groupBox_3)
        self.label_45.setGeometry(QtCore.QRect(240, 120, 21, 16))
        self.label_45.setObjectName("label_45")
        self.lineEdit_iy6 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_iy6.setGeometry(QtCore.QRect(270, 60, 113, 20))
        self.lineEdit_iy6.setText("")
        self.lineEdit_iy6.setObjectName("lineEdit_iy6")
        self.label_48 = QtWidgets.QLabel(self.groupBox_3)
        self.label_48.setGeometry(QtCore.QRect(240, 60, 21, 16))
        self.label_48.setObjectName("label_48")
        self.label_40 = QtWidgets.QLabel(self.groupBox_3)
        self.label_40.setGeometry(QtCore.QRect(240, 90, 21, 16))
        self.label_40.setObjectName("label_40")
        self.lineEdit_iy5 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_iy5.setGeometry(QtCore.QRect(270, 30, 113, 20))
        self.lineEdit_iy5.setObjectName("lineEdit_iy5")
        self.label_43 = QtWidgets.QLabel(self.groupBox_3)
        self.label_43.setGeometry(QtCore.QRect(240, 150, 21, 16))
        self.label_43.setObjectName("label_43")
        self.lineEdit_y7 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_y7.setGeometry(QtCore.QRect(270, 90, 113, 20))
        self.lineEdit_y7.setText("")
        self.lineEdit_y7.setObjectName("lineEdit_y7")
        self.label_49 = QtWidgets.QLabel(self.groupBox_3)
        self.label_49.setGeometry(QtCore.QRect(410, 30, 31, 16))
        self.label_49.setObjectName("label_49")
        self.lineEdit_y10 = QtWidgets.QLineEdit(self.groupBox_3)
        self.lineEdit_y10.setGeometry(QtCore.QRect(440, 30, 113, 20))
        self.lineEdit_y10.setObjectName("lineEdit_y10")
        self.comboBox = QtWidgets.QComboBox(self.centralwidget)
        self.comboBox.setGeometry(QtCore.QRect(100, 510, 141, 21))
        self.comboBox.setObjectName("comboBox")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.label_38 = QtWidgets.QLabel(self.centralwidget)
        self.label_38.setGeometry(QtCore.QRect(40, 510, 51, 21))
        self.label_38.setObjectName("label_38")
        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(70, 560, 141, 41))
        self.pushButton.setObjectName("pushButton")
        self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_2.setGeometry(QtCore.QRect(70, 620, 141, 41))
        self.pushButton_2.setObjectName("pushButton_2")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 887, 23))
        self.menubar.setObjectName("menubar")
        self.menu = QtWidgets.QMenu(self.menubar)
        self.menu.setObjectName("menu")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.action = QtWidgets.QAction(MainWindow)
        self.action.setObjectName("action")
        self.action_2 = QtWidgets.QAction(MainWindow)
        self.action_2.setObjectName("action_2")
        self.action_3 = QtWidgets.QAction(MainWindow)
        self.action_3.setObjectName("action_3")
        self.menu.addAction(self.action)
        self.menu.addAction(self.action_2)
        self.menu.addAction(self.action_3)
        self.menubar.addAction(self.menu.menuAction())

        self.retranslateUi(MainWindow)
        self.pushButton_import.clicked.connect(self.import_file)
        self.pushButton_save.clicked.connect(self.save_data)
        self.pushButton.clicked.connect(self.generate_x)
        self.pushButton_2.clicked.connect(self.import_y)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "工厂参数推荐"))
        self.groupBox.setTitle(_translate("MainWindow", "输入参数"))
        self.groupBox_2.setTitle(_translate("MainWindow", "A"))
        self.label.setText(_translate("MainWindow", "x1："))
        self.label_2.setText(_translate("MainWindow", "x2："))
        self.label_3.setText(_translate("MainWindow", "x3："))
        self.label_4.setText(_translate("MainWindow", "x5："))
        self.label_5.setText(_translate("MainWindow", "x6："))
        self.groupBox_10.setTitle(_translate("MainWindow", "B"))
        self.label_6.setText(_translate("MainWindow", "x4："))
        self.label_7.setText(_translate("MainWindow", "x8："))
        self.label_8.setText(_translate("MainWindow", "x9："))
        self.groupBox_11.setTitle(_translate("MainWindow", "B"))
        self.label_9.setText(_translate("MainWindow", "x7："))
        self.label_10.setText(_translate("MainWindow", "x11:："))
        self.label_11.setText(_translate("MainWindow", "x10:"))
        self.groupBox_4.setTitle(_translate("MainWindow", "B"))
        self.groupBox_12.setTitle(_translate("MainWindow", "B"))
        self.label_12.setText(_translate("MainWindow", "x12:："))
        self.groupBox_5.setTitle(_translate("MainWindow", "C"))
        self.label_13.setText(_translate("MainWindow", "x14:"))
        self.label_14.setText(_translate("MainWindow", "x15："))
        self.label_15.setText(_translate("MainWindow", "x13："))
        self.label_16.setText(_translate("MainWindow", "x17："))
        self.label_17.setText(_translate("MainWindow", "x16："))
        self.label_18.setText(_translate("MainWindow", "x18："))
        self.label_19.setText(_translate("MainWindow", "x20:"))
        self.label_20.setText(_translate("MainWindow", "x24："))
        self.label_21.setText(_translate("MainWindow", "x19:"))
        self.label_22.setText(_translate("MainWindow", "x23："))
        self.label_23.setText(_translate("MainWindow", "x22："))
        self.label_24.setText(_translate("MainWindow", "x21："))
        self.label_25.setText(_translate("MainWindow", "x25："))
        self.groupBox_6.setTitle(_translate("MainWindow", "E"))
        self.label_31.setText(_translate("MainWindow", "x31："))
        self.label_32.setText(_translate("MainWindow", "x32:"))
        self.label_33.setText(_translate("MainWindow", "x33："))
        self.label_34.setText(_translate("MainWindow", "x34："))
        self.groupBox_7.setTitle(_translate("MainWindow", "G"))
        self.label_37.setText(_translate("MainWindow", "x37："))
        self.groupBox_9.setTitle(_translate("MainWindow", "F"))
        self.label_35.setText(_translate("MainWindow", "x35："))
        self.label_36.setText(_translate("MainWindow", "x36:"))
        self.groupBox_8.setTitle(_translate("MainWindow", "D"))
        self.label_26.setText(_translate("MainWindow", "x27:"))
        self.label_27.setText(_translate("MainWindow", "x26："))
        self.label_28.setText(_translate("MainWindow", "x30："))
        self.label_29.setText(_translate("MainWindow", "x29："))
        self.label_30.setText(_translate("MainWindow", "x28："))
        self.pushButton_import.setText(_translate("MainWindow", "导入数据"))
        self.pushButton_save.setText(_translate("MainWindow", "保存数据"))
        self.groupBox_3.setTitle(_translate("MainWindow", "质量指标"))
        self.label_39.setText(_translate("MainWindow", "Y3:"))
        self.label_41.setText(_translate("MainWindow", "Y4:"))
        self.label_44.setText(_translate("MainWindow", "Y0:"))
        self.label_46.setText(_translate("MainWindow", "Y1:"))
        self.label_47.setText(_translate("MainWindow", "Y2:"))
        self.label_42.setText(_translate("MainWindow", "IY5:"))
        self.label_45.setText(_translate("MainWindow", "Y8:"))
        self.label_48.setText(_translate("MainWindow", "IY6:"))
        self.label_40.setText(_translate("MainWindow", "Y7:"))
        self.label_43.setText(_translate("MainWindow", "Y9:"))
        self.label_49.setText(_translate("MainWindow", "Y10:"))
        self.comboBox.setItemText(0, _translate("MainWindow", "product_1"))
        self.comboBox.setItemText(1, _translate("MainWindow", "product_0"))
        self.comboBox.setItemText(2, _translate("MainWindow", "product_2"))
        self.comboBox.setItemText(3, _translate("MainWindow", "product_3"))
        self.comboBox.setItemText(4, _translate("MainWindow", "product_4"))
        self.comboBox.setItemText(5, _translate("MainWindow", "product_5"))
        self.comboBox.setItemText(6, _translate("MainWindow", "product_6"))
        self.comboBox.setItemText(7, _translate("MainWindow", "product_7"))
        self.comboBox.setItemText(8, _translate("MainWindow", "product_8"))
        self.comboBox.setItemText(9, _translate("MainWindow", "product_9"))
        self.label_38.setText(_translate("MainWindow", "选择产品："))
        self.pushButton.setText(_translate("MainWindow", "生成推荐参数"))
        self.pushButton_2.setText(_translate("MainWindow", "导入推荐质量指标"))
        self.menu.setTitle(_translate("MainWindow", "文件"))
        self.action.setText(_translate("MainWindow", "导入数据"))
        self.action_2.setText(_translate("MainWindow", "保存数据"))
        self.action_3.setText(_translate("MainWindow", "关闭"))

    def import_file(self):
        QMessageBox.information(self, "提示", "只实现了生成推荐数据功能",QMessageBox.Ok)

    def save_data(self):
        QMessageBox.information(self, "提示", "只实现了生成推荐数据功能", QMessageBox.Ok)

    def generate_x(self):
        currentP = self.comboBox.currentText()
        xdata = list()
        # 获取数据
        if currentP != "product_1":
            QMessageBox.information(self, "提示", "测试版，只实现了产品1推荐", QMessageBox.Ok)
            return
        else:
            varName = ""
            for i in range(0, 11):
                if i == 6 or i == 5:
                    varName = "self.lineEdit_"+"iy"+str(i)
                else:
                    varName = "self.lineEdit_y"+str(i)
                if eval(varName).text() == "":
                    QMessageBox.information(self, "提示", "请输入数据，如果为NULl，输入0", QMessageBox.Ok)
                    ix = 0
                    return
                else:
                    ix = eval(varName).text()
                try:
                    ix = float(ix)
                    xdata.append(ix)
                except Exception:
                    QMessageBox.information(self, "提示", "请不要输入非法字符", QMessageBox.Ok)
                    return
        print(xdata)
        pred_y = prediction(xdata)
        x14 = self.generate_x14(int(round(pred_y[13])))
        x20 = self.generate_x20(int(round(pred_y[19])))
        x24 = self.generate_x24(int(round(pred_y[23])))
        x32 = self.generate_x32(int(round(pred_y[31])))
        x35 = self.openOrClose(int(round(pred_y[34])))
        x36 = self.openOrClose(int(round(pred_y[35])))
        for i in range(1,38):
            varName = "self.lineEdit_x"+str(i)
            if i == 14:
                eval(varName).setText(x14)
            elif i ==20:
                eval(varName).setText(x20)
            elif i == 24:
                eval(varName).setText(x24)
            elif i==32:
                eval(varName).setText(x32)
            elif i==35:
                eval(varName).setText(x35)
            elif i==36:
                eval(varName).setText(x36)
            else:
                eval(varName).setText(str(np.around(pred_y[i-1],3)))
    def import_y(self):
        QMessageBox.information(self, "提示", "只实现了生成推荐数据功能", QMessageBox.Ok)

    # 生成x14
    def generate_x14(self,x):
        if x == 1:
            return "100(AO)"
        elif x == 2:
            return "100(CBO)"
        elif x == 3:
            return "80(CBO):20(AO)"
        elif x == 4:
            return "40(CBO):60(AO)"
        elif x == 5:
            return "50(CBO):50(AO)"
        elif x == 6:
            return "60(CBO):40(AO)"
        elif x == 7:
            return "70(CBO):30(AO)"
        elif x == 8:
            return "80(CBO):20(AO)"
        else:
            return "error"
    #生成x20
    def generate_x20(self,x):
        if x == 1:
            return "16*0.62"
        elif x == 2:
            return "NULL"
        else:
            return "error"

    def generate_x24(self,x):
        if x == 1:
            return "24*0.086"
        elif x == 2:
            return "36*0.080"
        elif x == 3:
            return "36*0.086"
        elif x == 4:
            return "BM32"
        else:
            return "error"

    def generate_x32(self,x):
        if x==1:
            return "Delavan 25GPM"
        elif x==2:
            return "NULL"
        else:
            return "error"
    def openOrClose(self,x):
        if x==1:
            return "Opened"
        elif x==0:
            return  "Closed"
        else:
            return "error"