# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'C:\Users\lbh\Desktop\SoftwareProject\CooperateWork\UI\switch.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets

#主动交换函数窗口类
class Ui_Form(QtWidgets.QDialog):
    def __init__(self,board):
        super().__init__()
        self.board = board

    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.switchInput1 = QtWidgets.QLineEdit(Form)
        self.switchInput1.setGeometry(QtCore.QRect(280, 60, 21, 21))
        self.switchInput1.setObjectName("switchInput1")
        self.switchInput2 = QtWidgets.QLineEdit(Form)
        self.switchInput2.setGeometry(QtCore.QRect(280, 120, 21, 21))
        self.switchInput2.setObjectName("switchInput2")
        self.label = QtWidgets.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(140, 60, 121, 16))
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setGeometry(QtCore.QRect(140, 120, 121, 16))
        self.label_2.setObjectName("label_2")
        self.pushButton = QtWidgets.QPushButton(Form)
        self.pushButton.setGeometry(QtCore.QRect(240, 200, 93, 41))
        self.pushButton.setObjectName("pushButton")
        self.pushButton.clicked.connect(self.click)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)


    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "选择交换的位置"))
        self.switchInput1.setText(_translate("Form", "1"))
        self.switchInput2.setText(_translate("Form", "1"))
        self.label.setText(_translate("Form", "输入要交换的位置"))
        self.label_2.setText(_translate("Form", "输入要交换的位置"))
        self.pushButton.setText(_translate("Form", "确定"))


    def click(self):
        print("this is click")
        s1 = int(self.switchInput1.text())
        s2 = int(self.switchInput2.text())

        self.board.switch(s1,s2)
        self.board.change = [s1,s2]
        self.close()