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

# Form implementation generated from reading ui file 'qt_test.py'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# 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.


import sys

from PyQt5.QtWidgets import QApplication, QMainWindow
from pressure_choice import *

class MyWindow(QMainWindow, Ui_MainWindow):
    def __init__(self, parent=None):
        super(MyWindow, self).__init__(parent)
        self.bar_value = 0
        self.start_num=0
        self.setupUi(self)

        self.checkBox_1.clicked.connect(self.choice_1)
        self.checkBox_2.clicked.connect(self.choice_2)
        self.checkBox_3.clicked.connect(self.choice_3)
        self.checkBox_4.clicked.connect(self.choice_4)
        self.checkBox_5.clicked.connect(self.choice_5)
        self.checkBox_6.clicked.connect(self.choice_6)
        self.checkBox_7.clicked.connect(self.choice_7)
        self.checkBox_8.clicked.connect(self.choice_8)
        self.checkBox_9.clicked.connect(self.choice_9)
        self.checkBox_10.clicked.connect(self.choice_10)
        self.checkBox_11.clicked.connect(self.choice_11)
        self.checkBox_12.clicked.connect(self.choice_12)
        self.cancel_choice.clicked.connect(self.cancel_data)
        self.all_choose.clicked.connect(self.start_run)
        # self.progressBar.setValue(self.bar_value)
        self.entrance=[]

    def choice_1(self):
        if self.checkBox_1.isChecked() == True:
            if 1 not in self.entrance:
                self.entrance.append(1)
        else:
            self.entrance.remove(1)
    def choice_2(self):
        if self.checkBox_2.isChecked() ==True:
            if 2 not in self.entrance:
                self.entrance.append(2)
        else:
            self.entrance.remove(2)
    def choice_3(self):
        if self.checkBox_3.isChecked() == True:
            if 3 not in self.entrance:
                self.entrance.append(3)
        else:
            self.entrance.remove(3)
    def choice_4(self):
        if self.checkBox_4.isChecked() == True:
            if 4 not in self.entrance:
                self.entrance.append(4)
        else:
            self.entrance.remove(4)
    def choice_5(self):
        if self.checkBox_5.isChecked() == True:
            if 5 not in self.entrance:
                self.entrance.append(5)
        else:
            self.entrance.remove(5)
    def choice_6(self):
        if self.checkBox_6.isChecked() == True:
            if 6 not in self.entrance:
                self.entrance.append(6)
        else:
            self.entrance.remove(6)
    def choice_7(self):
        if self.checkBox_7.isChecked() == True:
            if 7 not in self.entrance:
                self.entrance.append(7)
        else:
            self.entrance.remove(7)
    def choice_8(self):
        if self.checkBox_8.isChecked() == True:
            if 8 not in self.entrance:
                self.entrance.append(8)
        else:
            self.entrance.remove(8)
    def choice_9(self):
        if self.checkBox_9.isChecked() == True:
            if 9 not in self.entrance:
                self.entrance.append(9)
        else:
            self.entrance.remove(9)
    def choice_10(self):
        if self.checkBox_10.isChecked() == True:
            if 10 not in self.entrance:
                self.entrance.append(10)
        else:
            self.entrance.remove(10)
    def choice_11(self):
        if self.checkBox_11.isChecked() == True:
            if 11 not in self.entrance:
                self.entrance.append(11)
        else:
            self.entrance.remove(11)
    def choice_12(self):
        if self.checkBox_12.isChecked() == True:
            if 12 not in self.entrance:
                self.entrance.append(12)
        else:
            self.entrance.remove(12)
    def cancel_data(self):
        if self.checkBox_1.isChecked():
            self.checkBox_1.toggle()
        if self.checkBox_2.isChecked():
            self.checkBox_2.toggle()
        if self.checkBox_3.isChecked():
            self.checkBox_3.toggle()
        if self.checkBox_4.isChecked():
            self.checkBox_4.toggle()
        if self.checkBox_5.isChecked():
            self.checkBox_5.toggle()
        if self.checkBox_6.isChecked():
            self.checkBox_6.toggle()
        if self.checkBox_7.isChecked():
            self.checkBox_7.toggle()
        if self.checkBox_8.isChecked():
            self.checkBox_8.toggle()
        if self.checkBox_9.isChecked():
            self.checkBox_9.toggle()
        if self.checkBox_10.isChecked():
            self.checkBox_10.toggle()
        if self.checkBox_11.isChecked():
            self.checkBox_11.toggle()
        if self.checkBox_12.isChecked():
            self.checkBox_12.toggle()
        self.entrance = []
        self.start_num =0
        print(self.entrance)
    def start_run(self):
        if self.start_num ==0 and len(self.entrance) !=0:
            self.start_num=1
            self.label_5.setText('正在合并')
            num = list(set(self.entrance))
            self.bar_value=10
            print(num)

    def run(self):
        while True:
            pass


if __name__ == '__main__':
    app = QApplication(sys.argv)
    myWin = MyWindow()
    myWin.show()
    sys.exit(app.exec_())