Ejemplo n.º 1
0
    def run(self):
        while True:
            if opencv_integrate.id == 'none':
                opencv_integrate.recog()
            print(opencv_integrate.id)
            if (opencv_integrate.id != 'none') and (self.check == 0):
                self.recognize.emit(opencv_integrate.id)
                self.check = 1

                while opencv_integrate.backcheck ==0:
                    opencv_integrate.backrecog()
                    if opencv_integrate.backcheck == 1:
                        self.Select_Update.emit(opencv_integrate.id, self.Time_value.toString("yyyy-MM-dd hh:mm:ss"),
                                                "퇴근")
                        opencv_integrate.backcheck = 0
                        break

                    if opencv_integrate.backcheck == 2:
                        self.Select_Update.emit(opencv_integrate.id, self.Time_value.toString("yyyy-MM-dd hh:mm:ss"),
                                                "출근")
                        opencv_integrate.backcheck = 0
                        break

                time.sleep(25)
                opencv_integrate.id = 'none'

            if (opencv_integrate.id == 'none') and (self.check == 1):
                self.recognize.emit(opencv_integrate.id)
                self.check = 0


            self.TimeUpdate()
            self.NewsUpdate()
            self.WeatherUpdate()
Ejemplo n.º 2
0
    def run(self):
        while True:
            opencv_integrate.recog()
            if (opencv_integrate.id != 'unknown') and (self.check == 0):
                self.recognize.emit(opencv_integrate.id)
                self.check = 1

                while opencv_integrate.backrecog(
                ) != 1 and opencv_integrate.backrecog() != 2:
                    if opencv_integrate.backrecog() == 1:
                        self.Select_Update.emit(
                            opencv_integrate.id,
                            self.Time_value.toString("yyyy-MM-dd hh:mm:ss"),
                            "퇴근")
                        time.sleep(5)

                    if opencv_integrate.backrecog() == 2:
                        self.Select_Update.emit(
                            opencv_integrate.id,
                            self.Time_value.toString("yyyy-MM-dd hh:mm:ss"),
                            "출근")
                        time.sleep(5)

                opencv_integrate.id = 'unknown'

            if (opencv_integrate.id == 'unknown') and (self.check == 1):
                self.recognize.emit(opencv_integrate.id)
                self.check = 0

            self.TimeUpdate()
            self.NewsUpdate()
            self.WeatherUpdate()
Ejemplo n.º 3
0
    def run(self):
        while True:
            if opencv_integrate.id == 'none':
                opencv_integrate.recog()
            print(opencv_integrate.id)
            if (opencv_integrate.id != 'none') and (self.check == 0):
                self.recognize.emit(opencv_integrate.id)
                self.check = 1

                while opencv_integrate.backcheck == 0:
                    opencv_integrate.backrecog()
                    if opencv_integrate.backcheck == 1:
                        self.Select_Update.emit(
                            opencv_integrate.id,
                            self.Time_value.toString("yyyy-MM-dd hh:mm:ss"),
                            "Right")
                        opencv_integrate.backcheck = 0
                        break

                    if opencv_integrate.backcheck == 2:
                        self.Select_Update.emit(
                            opencv_integrate.id,
                            self.Time_value.toString("yyyy-MM-dd hh:mm:ss"),
                            "Left")
                        opencv_integrate.backcheck = 0
                        break
                    print('running back...')
                if opencv_integrate.id != 'unknown':
                    time.sleep(20)
                else:
                    time.sleep(30)

                opencv_integrate.id = 'none'

            if (opencv_integrate.id == 'none') and (self.check == 1):
                self.recognize.emit(opencv_integrate.id)
                self.check = 0

            self.TimeUpdate()
            self.NewsUpdate()
            self.WeatherUpdate()