Esempio n. 1
0
 def __open_serial_port__(self):
     port = self.comboBoxPort.currentIndex()
     self.reg.setPort(port)
     baud = int("%s" % self.comboBoxBaud.currentText(), 10)
     self.reg.setBaud(baud)
     username = self.textEditUsername.toPlainText()
     self.reg.setUsername(username)
     password = self.textEditPassword.text()
     self.reg.setPassword(password)
     email = self.textEditEmail.toPlainText()
     self.reg.setEmail(email)
     self.reg.sDeviceUUID(getserial())
     if self._serial_context_.isRunning():
         self._serial_context_.close()
         self.pushButtonOpenSerial.setText(u'Open/Save')
     else:
         self._serial_context_ = serialportcontext.SerialPortContext(
             port=port, baud=baud)
         self._serial_context_.registerReceivedCallback(
             self.__data_received__)
         self.checkBoxDTR.setChecked(True)
         self._serial_context_.setDTR(True)
         self.checkBoxRTS.setChecked(True)
         self._serial_context_.setRTS(True)
         self._serial_context_.open()
         self.pushButtonOpenSerial.setText(u'Close/Save')
     self.reg.writeDB()
    def __open_serial_port__(self):
        print("I am here")
        if self._serial_context_.isRunning():
            print("lets see")
            self._serial_context_.close()
            self.pushButtonOpenSerial.setText(u'open')
            print("open")
        else:
            try:

                #currentIndex() will get the number
                portss = self.comboBoxPort.currentText()
                port = self.comboBoxPort.currentText()
                print("the", portss)
                baud = int("%s" % self.comboBoxBaud.currentText(), 10)
                self._serial_context_ = serialportcontext.SerialPortContext(
                    port=port, baud=baud)
                #print(self._serial_context_ )
                self._serial_context_.recall()
                self._serial_context_.registerReceivedCallback(
                    self.__data_received__)

                print("4")
                self._serial_context_.open()
                print("5")
                self.pushButtonOpenSerial.setText(u'close')
            except Exception as e:
                print("error")
Esempio n. 3
0
 def __init__(self, parent=None):
     QMainWindow.__init__(self, parent)
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.about_Dialog = QtGui.QDialog()
     self.about_ui = Ui_about_dial()
     self.about_ui.setupUi(self.about_Dialog)
     self.update_dialog = UpdateQDialog(self)
     self._port = ''
     self._baud = ''
     self._currentcmd = ''
     self._last_received = ''
     self._gopath = 'D001' + self.ui.comboBox_d001_value.currentText()
     self.on_pushButton_serialrefresh_clicked()
     self._serial_context_ = serialportcontext.SerialPortContext(
         port=self._port, baud=self._port)
     self._receive_signal.connect(self.__display_recv_data__)
Esempio n. 4
0
 def __open_serial_port__(self):
     if  self._serial_context_.isRunning():
         self._serial_context_.close()
         self.pushButtonOpenSerial.setText(u'打开')
     else:
         try:
             port = self.comboBoxPort.currentText()
             baud = int("%s" % self.comboBoxBaud.currentText(),10)
             self._serial_context_ = serialportcontext.SerialPortContext(port = port,baud = baud)
             self._serial_context_.registerReceivedCallback(self.__data_received__)
             self.checkBoxDTR.setChecked(True)
             self._serial_context_.setDTR(True)
             self.checkBoxRTS.setChecked(True)
             self._serial_context_.setRTS(True)
             self._serial_context_.open()
             self.pushButtonOpenSerial.setText(u'关闭')
         except Exception as e:
             print(sys.exc_info()[0],' Error:',e)
             QtGui.QMessageBox.critical(self,u"打开端口",u"打开端口失败,请检查!")
Esempio n. 5
0
 def __open_serial_port__(self):
     if self._serial_context_.isRunning():
         self._serial_context_.close()
     else:
         try:
             port = str(self.ui.comboBox_serialport.currentText())
             baud = int('%s' % self.ui.comboBox_serialbauds.currentText(),
                        10)
             self._serial_context_ = serialportcontext.SerialPortContext(
                 port=port, baud=baud)
             self._serial_context_.registerReceivedCallback(
                 self.__data_received__)
             self._serial_context_.setDTR(True)
             self._serial_context_.setRTS(True)
             self._serial_context_.open()
         except Exception as e:
             self.print_debug(str(e))
             QtGui.QMessageBox.critical(
                 self, u'\x08\u958b\u8d77\u7aef\u53e3',
                 u'\u958b\u8d77\u7aef\u53e3\u5931\u6557,\u8acb\u6aa2\u67e5!'
             )
Esempio n. 6
0
 def open_serial_port(self):
     if self._serial_context_.isRunning():
         self._serial_context_.close()
         self.pushButtonOpenSerial.setText(u'Open')
     else:
         try:
             port = self.comboBoxPort.currentIndex()
             baud = int("%s" % self.comboBoxBaud.currentText(), 10)
             #print("Open port %d, %d", port, baud);
             self._serial_context_ = serialportcontext.SerialPortContext(
                 port=port, baud=baud)
             self._serial_context_.registerReceivedCallback(
                 self.__data_received__)
             self.checkBoxDTR.setChecked(True)
             self._serial_context_.setDTR(True)
             self.checkBoxRTS.setChecked(True)
             self._serial_context_.setRTS(True)
             self._serial_context_.open()
             self.pushButtonOpenSerial.setText(u'Close/Save')
         except Exception, e:
             QtGui.QMessageBox.critical(self, u"Open Port",
                                        u"Fail to open the COM!")
    def initForms(self):
        #init serial ports
        self.setFixedSize(QtCore.QSize(821, 646))

        if platform.system() == "Windows":
            ports = QtCore.QStringList()
            for i in range(8):
                ports.append("COM%d" % ((i + 1)))
            self.comboBoxPort.addItems(ports)
        else:
            #todo:scan system serial port
            self.__scanSerialPorts__()

        #init bauds
        bauds = [
            "50", "75", "134", "110", "150", "200", "300", "600", "1200",
            "2400", "4800", "9600", "14400", "19200", "38400", "56000",
            "57600", "115200"
        ]
        self.comboBoxBaud.addItems(bauds)
        self.comboBoxBaud.setCurrentIndex(len(bauds) - 1)

        checks = ["None", "Odd", "Even", "Zero", "One"]
        self.comboBoxCheckSum.addItems(checks)
        self.comboBoxCheckSum.setCurrentIndex(len(checks) - 1)

        bits = ["4 Bits", "5 Bits", "6 Bits", "7 Bits", "8 Bits"]
        self.comboBoxBits.addItems(bits)
        self.comboBoxBits.setCurrentIndex(len(bits) - 1)

        stopbits = ["1 Bit", "1.5 Bits", "2 Bits"]
        self.comboBoxStopBits.addItems(stopbits)
        self.comboBoxStopBits.setCurrentIndex(0)

        port = self.comboBoxPort.currentText()

        baud = int("%s" % self.comboBoxBaud.currentText(), 10)
        self._serial_context_ = serialportcontext.SerialPortContext(port=port,
                                                                    baud=baud)

        self.checkBoxCD.setEnabled(False)
        self.checkBoxCTS.setEnabled(False)
        self.checkBoxDSR.setEnabled(False)
        self.checkBoxGND.setEnabled(False)
        self.checkBoxRI.setEnabled(False)
        self.checkBoxDSR.setEnabled(False)
        self.checkBoxRXD.setEnabled(False)
        self.checkBoxTXD.setEnabled(False)
        self.checkBoxDTR.setChecked(True)
        self.checkBoxRTS.setChecked(True)

        self.lineEditReceivedCounts.setText("0")
        self.lineEditSentCounts.setText("0")

        self.pushButtonOpenSerial.clicked.connect(self.__open_serial_port__)
        self._receive_signal.connect(self.__display_recv_data__)
        self.pushButtonClearRecvArea.clicked.connect(self.__clear_recv_area__)
        self.pushButtonSendData.clicked.connect(self.__send_data__)
        self.checkBoxSendHex.clicked.connect(self.__set_send_hex__)
        self.checkBoxDisplayHex.clicked.connect(self.__set_display_hex__)
        self.checkBoxCD.clicked.connect(self.__set_cd__)
        self.checkBoxRTS.clicked.connect(self.__set_rts__)
        self.checkBoxDTR.clicked.connect(self.__set_dtr__)
        self.pushButtonClearAllCounts.clicked.connect(self.__clear_all_counts)
        self.pushButtonClearRecvCounts.clicked.connect(
            self.__clear_recv_counts)
        self.pushButtonClearSentCounts.clicked.connect(
            self.__clear_send_counts)
        self.checkBoxSendLooping.clicked.connect(self.__handle_send_looping__)
        self._auto_send_signal.connect(self.__auto_send_update__)
        self.pushButtonOpenRecvFile.clicked.connect(self.__save_recv_file__)
        self.pushButtonOpenSendFile.clicked.connect(self.__open_send_file__)

        self._is_auto_sending = False
        self._recv_file_ = None
        self._send_file_ = None
        self._send_file_data = ''
    def initUI(self):
        self.setWindowTitle(self.title)
        #self.setGeometry(self.left, self.top, self.width, self.height)
        self.resize(1800, 1200)

        #image = cv2.imread(r'C:\Users\Pankaj\Downloads\pank do not throw\WorldExpo\test_video')
        # Combo BOX
        self.groupBox = QGroupBox(self)
        self.groupBox.setGeometry(QtCore.QRect(1150, 20, 200, 180))
        font = QtGui.QFont()
        font.setPointSize(8)
        self.groupBox.setFont(font)
        self.groupBox.setObjectName("groupBox")
        ######################################## PORT #######################
        self.comboBoxPort = QtWidgets.QComboBox(self.groupBox)
        self.comboBoxPort.setGeometry(QtCore.QRect(100, 25, 75, 21))
        self.comboBoxPort.setObjectName("comboBoxPort")
        #####################################label_2 = COM ##################################################################
        self.label_2 = QtWidgets.QLabel(self.groupBox)
        self.label_2.setGeometry(QtCore.QRect(2, 25, 80, 21))
        font = QtGui.QFont()
        font.setPointSize(8)
        self.label_2.setFont(font)
        self.label_2.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName("label_2")
        ######################################label = Baud rate ##################################################################
        self.label = QtWidgets.QLabel(self.groupBox)
        self.label.setGeometry(QtCore.QRect(2, 50, 80, 21))
        font = QtGui.QFont()
        font.setPointSize(8)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing
                                | QtCore.Qt.AlignVCenter)
        self.label.setObjectName("label")
        ####################################################################
        self.comboBoxBaud = QtWidgets.QComboBox(self.groupBox)
        self.comboBoxBaud.setGeometry(QtCore.QRect(100, 50, 75, 21))
        self.comboBoxBaud.setObjectName("comboBoxBaud")
        #################################### label_3 = Parity Bits ######################################################
        self.label_3 = QtWidgets.QLabel(self.groupBox)
        self.label_3.setGeometry(QtCore.QRect(2, 75, 80, 21))
        font = QtGui.QFont()
        font.setPointSize(8)
        self.label_3.setFont(font)
        self.label_3.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_3.setObjectName("label_3")
        #########################################################################
        self.comboBoxCheckSum = QtWidgets.QComboBox(self.groupBox)
        self.comboBoxCheckSum.setGeometry(QtCore.QRect(100, 75, 75, 21))
        self.comboBoxCheckSum.setObjectName("comboBoxCheckSum")
        ##################################### label_4 = Data Bits ##########################################################
        self.label_4 = QtWidgets.QLabel(self.groupBox)
        self.label_4.setGeometry(QtCore.QRect(2, 100, 80, 21))
        font = QtGui.QFont()
        font.setPointSize(8)
        self.label_4.setFont(font)
        self.label_4.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_4.setObjectName("label_4")
        ######################################################################
        self.comboBoxBits = QtWidgets.QComboBox(self.groupBox)
        self.comboBoxBits.setGeometry(QtCore.QRect(100, 100, 75, 21))
        self.comboBoxBits.setObjectName("comboBoxBits")
        ###################################### label_5 = Stop Bits ###########################################################
        self.label_5 = QtWidgets.QLabel(self.groupBox)
        self.label_5.setGeometry(QtCore.QRect(2, 125, 80, 21))
        font = QtGui.QFont()
        font.setPointSize(8)
        self.label_5.setFont(font)
        self.label_5.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_5.setObjectName("label_5")
        ##########################################################################
        self.comboBoxStopBits = QtWidgets.QComboBox(self.groupBox)
        self.comboBoxStopBits.setGeometry(QtCore.QRect(100, 125, 75, 21))
        self.comboBoxStopBits.setObjectName("comboBoxStopBits")
        ######################################### Open Button ############################################################
        self.pushButtonOpenSerial = QtWidgets.QPushButton(self.groupBox)
        self.pushButtonOpenSerial.setGeometry(QtCore.QRect(50, 150, 125, 21))
        self.pushButtonOpenSerial.setObjectName("pushButtonOpenSerial")
        ########################################  Send Button  for sending ####################################################
        self.pushButtonSendData = QtWidgets.QPushButton(self)
        self.pushButtonSendData.setGeometry(QtCore.QRect(1300, 450, 50, 75))
        self.pushButtonSendData.setAutoDefault(True)
        self.pushButtonSendData.setObjectName("pushButtonSendData")
        ########################################  clear Button  for sending ####################################################
        self.pushButtonclearSendData = QtWidgets.QPushButton(self)
        self.pushButtonclearSendData.setGeometry(
            QtCore.QRect(1300, 375, 50, 75))
        self.pushButtonclearSendData.setObjectName("pushButtonclearSendData")
        self.pushButtonclearSendData.clicked.connect(self.clearsenddata)
        ####################################### text  box for receiving  ############################################################
        self.textEditReceived = QtWidgets.QTextEdit(self)
        self.textEditReceived.setGeometry(QtCore.QRect(1100, 210, 250, 150))
        ###################################################################################################################
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.textEditReceived.sizePolicy().hasHeightForWidth())
        self.textEditReceived.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setPointSize(8)
        self.textEditReceived.setFont(font)
        self.textEditReceived.setReadOnly(True)
        self.textEditReceived.setObjectName("textEditReceived")
        ################################### Sending text box ###################################
        self.textEditSent = QtWidgets.QTextEdit(self)
        self.textEditSent.setGeometry(QtCore.QRect(1100, 375, 200, 150))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.textEditSent.setFont(font)
        self.textEditSent.setObjectName("textEditSent")

        #########################################################################################################################
        self.groupBox.setTitle("COM Setting")
        self.label_2.setText("COM")
        self.label.setText("Baud rate")
        self.label_3.setText("Parity Bit")
        self.label_4.setText("Data Bit")
        self.label_5.setText("Stop Bit")
        self.pushButtonOpenSerial.setText("Open")
        self.pushButtonSendData.setText("Send")
        self.pushButtonclearSendData.setText("Clear")

        self.textEditSent.setHtml(
            "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
            "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
            "p, li { white-space: pre-wrap; }\n"
            "</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:14pt; font-weight:400; font-style:normal;\">\n"
            "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'PMingLiU\';\"><br /></p></body></html>"
        )
        #groupBox = QGroupBox("Best Food")
        ######################################### controlling post creating group box ########################################################
        self.groupBox1 = QGroupBox(self)
        self.groupBox1.setGeometry(QtCore.QRect(1150, 535, 190, 80))
        font = QtGui.QFont()
        font.setPointSize(8)
        self.groupBox1.setFont(font)
        self.groupBox1.setObjectName("groupBox1")
        self.groupBox1.setTitle("Manual Post control")

        ####################################### post 1 ############################################################
        self.post1 = QtWidgets.QPushButton(self.groupBox1)
        self.post1.setGeometry(QtCore.QRect(10, 20, 80, 21))
        self.post1.setObjectName("post1")
        self.post1.setText("Post 1")
        self.post1.setCheckable(True)

        #self.post1.toggle()
        self.post1.clicked.connect(lambda: self.whichbtn(self.post1))
        self.post1.clicked.connect(self.btnstate1)

        #################################### post 2 ###########################
        self.post2 = QtWidgets.QPushButton(self.groupBox1)
        self.post2.setGeometry(QtCore.QRect(100, 20, 80, 21))
        self.post2.setObjectName("post2")
        self.post2.setText("Post 2")

        self.post2.setCheckable(True)
        #self.post2.toggle()
        self.post2.clicked.connect(lambda: self.whichbtn(self.post2))
        self.post2.clicked.connect(self.btnstate2)

        #################################### post 3 ###########################
        self.post3 = QtWidgets.QPushButton(self.groupBox1)
        self.post3.setGeometry(QtCore.QRect(10, 45, 80, 21))
        self.post3.setObjectName("post3")
        self.post3.setText("Post 3")

        self.post3.setCheckable(True)
        #self.post3.toggle()
        self.post3.clicked.connect(lambda: self.whichbtn(self.post3))
        self.post3.clicked.connect(self.btnstate3)

        #################################### post 4 ###########################
        self.post4 = QtWidgets.QPushButton(self.groupBox1)
        self.post4.setGeometry(QtCore.QRect(100, 45, 80, 21))
        self.post4.setObjectName("post4")
        self.post4.setText("Post 4")

        self.post4.setCheckable(True)
        #self.post4.toggle()
        self.post4.clicked.connect(lambda: self.whichbtn(self.post4))
        self.post4.clicked.connect(self.btnstate4)

        ######################################### group box for database of rfid ########################################################
        self.groupBox3 = QGroupBox(self)
        self.groupBox3.setGeometry(QtCore.QRect(1150, 615, 190, 80))
        font = QtGui.QFont()
        font.setPointSize(8)
        self.groupBox3.setFont(font)
        self.groupBox3.setObjectName("groupBox1")
        self.groupBox3.setTitle("RFID Database")
        #################################### rfid database ##########################
        self.rfid = QtWidgets.QPushButton(self.groupBox3)
        self.rfid.setGeometry(QtCore.QRect(10, 20, 170, 21))
        self.rfid.setObjectName("rfidtable")
        self.rfid.setText("Open Database")
        self.rfid.clicked.connect(self.showDialog1)
        ############################# Rfid Register#########################
        self.rfiddata = QtWidgets.QPushButton(self.groupBox3)
        self.rfiddata.setGeometry(QtCore.QRect(10, 45, 170, 21))
        self.rfiddata.setObjectName("rfidtable")
        self.rfiddata.setText("Register")
        self.rfiddata.clicked.connect(self.showDialog2)

        ############################### Group Box and update of serial com and baud rate setting ###############
        print(platform.system())

        if platform.system() == "Windows":
            ports = list()
            for i in range(8):
                ports.append("COM%d" % ((i + 1)))
            self.comboBoxPort.addItems(ports)
            print(ports)

        if platform.system() == "Linux":
            ports = glob.glob('/dev/tty[A-Za-z]*')
            print(ports)
            self.comboBoxPort.addItems(ports)

        bauds = [
            "50", "75", "134", "110", "150", "200", "300", "600", "1200",
            "2400", "4800", "9600", "14400", "19200", "38400", "56000",
            "57600", "115200"
        ]
        self.comboBoxBaud.addItems(bauds)
        self.comboBoxBaud.setCurrentIndex(len(bauds) - 1)

        checks = ["None", "Odd", "Even", "Zero", "One"]
        self.comboBoxCheckSum.addItems(checks)
        self.comboBoxCheckSum.setCurrentIndex(len(checks) - 1)

        bits = ["4 Bits", "5 Bits", "6 Bits", "7 Bits", "8 Bits"]
        self.comboBoxBits.addItems(bits)
        self.comboBoxBits.setCurrentIndex(len(bits) - 1)

        stopbits = ["1 Bit", "1.5 Bits", "2 Bits"]
        self.comboBoxStopBits.addItems(stopbits)
        self.comboBoxStopBits.setCurrentIndex(0)

        #self._auto_send_signal.connect(self.__auto_send_update__)

        port = self.comboBoxPort.currentText()
        baud = int("%s" % self.comboBoxBaud.currentText(), 10)
        self._serial_context_ = serialportcontext.SerialPortContext(port=port,
                                                                    baud=baud)

        #        self.lineEditReceivedCounts.setText("0")
        #        self.lineEditSentCounts.setText("0")
        self.pushButtonOpenSerial.clicked.connect(self.__open_serial_port__)
        # self.pushButtonClearRecvArea.clicked.connect(self.__clear_recv_area__)
        self.pushButtonSendData.clicked.connect(self.__send_data__)
        self._receive_signal.connect(self.__display_recv_data__)
        # self.pushButtonOpenRecvFile.clicked.connect(self.__save_recv_file__)

        ############################# Setting Label for image  #######################################
        imglabel = QLabel(self)
        imglabel.setGeometry(QtCore.QRect(0, 0, 1100, 700))

        pixmape = QPixmap('crossroads.jpg')
        scaleimage = pixmape.scaledToWidth(1090)
        imglabel.setPixmap(scaleimage)
        #
        #
        label = QLabel(self)
        label.move(450, 0)
        label.resize(210, 210)
        label.setStyleSheet("background-color:blue;")

        label1 = QLabel(self)
        label1.move(830, 260)
        label1.resize(210, 210)
        label1.setStyleSheet("background-color:red;")

        label2 = QLabel(self)
        label2.move(85, 260)
        label2.resize(210, 210)
        label2.setStyleSheet("background-color:white;")

        label3 = QLabel(self)
        label3.move(450, 500)
        label3.resize(210, 210)
        label3.setStyleSheet("background-color:yellow;")

        self.label21 = QLabel(self)
        self.label21.move(400, 220)
        self.label21.resize(300, 25)
        self.label21.setStyleSheet("background-color:blue;")  #525,245

        self.label22 = QLabel(self)
        self.label22.move(700, 220)
        self.label22.resize(25, 300)
        self.label22.setStyleSheet("background-color:red;")

        self.label23 = QLabel(self)
        self.label23.move(400, 495)
        self.label23.resize(300, 25)
        self.label23.setStyleSheet("background-color:white;")

        self.label24 = QLabel(self)
        self.label24.move(375, 220)
        self.label24.resize(25, 300)
        self.label24.setStyleSheet("background-color:yellow;")

        labelt = QLabel(self)
        labelt.move(525, 245)
        labelt.resize(50, 50)
        labelt.setStyleSheet("background-color:blue;"
                             "font: bold 20pt 'Arial'")  #525,245
        labelt.setAlignment(QtCore.Qt.AlignCenter)

        labelt21 = QLabel(self)
        labelt21.move(650, 350)
        labelt21.resize(50, 50)
        labelt21.setStyleSheet("background-color:red;"
                               "font: bold 20pt 'Arial'")
        labelt21.setAlignment(QtCore.Qt.AlignCenter)

        labelt22 = QLabel(self)
        labelt22.move(400, 350)
        labelt22.resize(50, 50)
        labelt22.setStyleSheet("background-color:white;"
                               "font: bold 20pt 'Arial'")
        labelt22.setAlignment(QtCore.Qt.AlignCenter)

        labelt23 = QLabel(self)
        labelt23.move(525, 445)
        labelt23.resize(50, 50)
        labelt23.setStyleSheet("background-color:yellow;"
                               "font: bold 20pt 'Arial'")  #525,445
        labelt23.setAlignment(QtCore.Qt.AlignCenter)

        #############################################################################################3
        self.groupBox8 = QGroupBox(self)
        self.groupBox8.setGeometry(QtCore.QRect(0, 700, 1090, 325))

        font = QtGui.QFont()
        font.setPointSize(8)

        self.groupBox8.setFont(font)
        self.groupBox8.setObjectName("groupBox8")

        #self.groupBox8.setStyleSheet("background-color:green;")

        self.horizontalLayout = QtGui.QHBoxLayout(self.groupBox8)
        self.horizontalLayout.setGeometry(QtCore.QRect(0, 0, 1090, 325))

        self.win = pg.GraphicsWindow()
        #self.win.resize(200,200)
        self.horizontalLayout.addWidget(self.win)
        #        pg.setConfigOption('background', 'w')
        #        pg.setConfigOption('foreground', 'k')

        self.p6 = self.win.addPlot(title="Density Plot")
        self.curve = self.p6.plot(pen='b')
        self.curve1 = self.p6.plot(pen='r')
        self.curve2 = self.p6.plot(pen='w')
        self.curve3 = self.p6.plot(pen='y')

        ####################################################################################################
        th = Thread(self)
        th.changePixmap.connect(label.setPixmap)
        th.changePixmap1.connect(label1.setPixmap)
        th.changePixmap2.connect(label2.setPixmap)
        th.changePixmap3.connect(label3.setPixmap)

        th.showdata.connect(labelt.setText)
        th.showdata1.connect(labelt21.setText)
        th.showdata2.connect(labelt22.setText)
        th.showdata3.connect(labelt23.setText)

        th.datacollect.connect(self.collecteddensity)
        #th.datacollect.connect(self.plotgraph)

        th.start()