def getUserinfo1(self, result): # 人脸识别失败,发送##SC500021\r\n告诉单片机状态 # 人脸识别成功,发送##SC500011\r\n告诉单片机状态 # msgbox = messageBox() # msgbox.show() # dialog.msgBox(2,"w12121") # logger.info("人脸识别") if result["result"]=="Error": logger.info("To:人脸识别失败:##SC500021\r\n") self.serial.send("##SC500021\r\n") self.msgbox = messageBox() self.msgbox.msgBox(3,"人脸识别失败") self.camera.setFaceFlag(True) else: # 置位脸部,人脸识别 self.finishFlag[5] =1 self.finishFlag[6] =1 logger.info("To:人脸识别成功:##SC500011\r\n") self.serial.send("##SC500011\r\n") self.msgbox = messageBox() self.msgbox.msgBox(3,"人脸识别成功") # 显示人脸识别结果到界面 self.ui.lineEdit_Name.setText(result["userName"]) self.ui.lineEdit_ID.setText(result["userId"]) self.ui.textEdit_Other.setText(result["result"]) self.ui.pushButton_getinfo.setText("人脸识别") self.ui.pushButton_getinfo.setDisabled(False)
def uploadProgress(self, str): # 告诉单片机体检流程全部结束 # 上传结束 logger.info("体检结束##SC500003\r\n") logger.info(str) result = json.loads(str) if result["errorcode"]!="1000": logger.info("上传失败,请重新体检##SC500004") self.serial.send("##SC500004\r\n") # messageBox.msgBox(3,"上传失败,请重新体检") else: logger.info("上传成功,体检结束##SC500003\r\n") self.serial.send("##SC500003\r\n") # messageBox.msgBox(3,"上传成功,体检结束") # qing 0 self.ui.lineEdit_ID.setText("") self.ui.lineEdit_Name.setText("") self.ui.lineEdit_Sex.setText("") self.ui.textEdit_Other.setText("") self.ui.lcdNumber_xinlv.setProperty("value",0) self.ui.lcdNumber_tiwen.setProperty("value",0) self.ui.lcdNumber_shengao.setProperty("value",0) self.ui.lcdNumber_tizhong.setProperty("value",0) self.msgbox = messageBox() self.msgbox.msgBox(5,"体检结束")
def getUserinfo(self): # 停止人脸标记 self.camera.setFaceFlag(False) self.msgbox = messageBox() self.msgbox.msgBox(3,"正在进行人脸识别,请稍后。。") self.camera.setMode("detect") self.ui.pushButton_getinfo.setText("正在识别,请稍后...") self.ui.pushButton_getinfo.setDisabled(True) # msg_box = QMessageBox.information(self.MainWindow,"提示","hhhhhh") # print("12121:",msg_box) # 第2步:正在测面部以及识别个人信息 logger.info("To:正在准备人脸识别:##SC500001\r\n") self.serial.send("##SC500001\r\n") self.re = RequestThread() self.re._signalError.connect(self.errorCallback) self.re._signal.connect(self.getUserinfo1) self.re.start()
def errorCallback(self,message): self.msgbox = messageBox() self.msgbox.msgBox(3,str(message)) logger.info("全局错误:" + message.__str__())