增加ini 人脸超时限制
This commit is contained in:
@ -20,7 +20,7 @@ from Shared_CODE.DialogModifyValue import DialogModifyValue
|
||||
from Shared_CODE.DialogModifyAlias import DialogModifyAlias
|
||||
from Shared_CODE.DialogModifyText import DialogModifyText
|
||||
from Shared_CODE.DialogInform import DialogInform
|
||||
from QT5_Project.Shared_CODE.DialogFaceVerify import VerifyDialog
|
||||
from QT5_Project.Shared_CODE.FaceRecognitionProtocol import parse_reply
|
||||
from QT5_Project.Shared_CODE.DialogFaceEnrollItgSingle import EnrollItgSingleDialog
|
||||
from QT5_Project.Shared_CODE.DialogFaceUserManage import UserManageDialog
|
||||
|
||||
@ -476,7 +476,7 @@ class UIFrameWork(QMainWindow, class_comm_mqtt_interface):
|
||||
self.check_widget_timeout_timer.timeout.connect(self.process_widget_timeout_list)
|
||||
self.check_widget_timeout_timer.start(100)
|
||||
self.page = get_tip_page(self.statusTip())
|
||||
self.menu_selectable_object_flush()
|
||||
self.menu_selectable_object_flush()
|
||||
|
||||
def get_circuit_mask(self, child_widget : QWidget = None) :
|
||||
widget :QWidget = child_widget
|
||||
@ -542,14 +542,15 @@ class UIFrameWork(QMainWindow, class_comm_mqtt_interface):
|
||||
)
|
||||
|
||||
def process_widget_timeout_list(self) :
|
||||
list_index = 0
|
||||
list_index = 0
|
||||
self.para_face() #刷新人脸数据显示
|
||||
for timeout_items in self.widget_timeout_list:
|
||||
time_limit = timeout_items[0]
|
||||
cur_time = timeout_items[1]
|
||||
cur_time += 100
|
||||
if cur_time >= time_limit:
|
||||
cur_time = 0
|
||||
timeout_widget : QWidget = timeout_items[2]
|
||||
timeout_widget : QWidget = timeout_items[2]
|
||||
if isinstance(timeout_widget, QLineEdit) :
|
||||
lineedit_widget : QLineEdit = timeout_widget
|
||||
lineedit_widget.setText("通信超时")
|
||||
@ -723,6 +724,7 @@ class UIFrameWork(QMainWindow, class_comm_mqtt_interface):
|
||||
self.create_alias_list()
|
||||
self.process_alias_query()
|
||||
self.para_or_measure_query()
|
||||
self.para_face()
|
||||
|
||||
def create_alias_list(self, child = None) :
|
||||
widget :QWidget = self
|
||||
@ -767,21 +769,43 @@ class UIFrameWork(QMainWindow, class_comm_mqtt_interface):
|
||||
def on_select_object_action_process(self, select_object : QWidget) :
|
||||
tip_str = select_object.statusTip()
|
||||
action_str = get_tip_value_str(tip_str, "Action", None)
|
||||
input = False
|
||||
if action_str != None :
|
||||
if "password" in tip_str :
|
||||
dialog_modify_text = DialogModifyValue(self)
|
||||
caption_str = "请输入密码:"
|
||||
dialog_modify_text.update_modify_info("", "0000", caption_str)
|
||||
input = False
|
||||
|
||||
if dialog_modify_text.exec() == QDialog.Accepted:
|
||||
input = True
|
||||
modify_screen_time_str = dialog_modify_text.value
|
||||
pass_word = system_parameter()
|
||||
if modify_screen_time_str != pass_word.get_system_password() :
|
||||
inform_box : DialogInform = DialogInform()
|
||||
inform_box.information("提示", "密码错误,无法修改!")
|
||||
return
|
||||
if "password" in tip_str:
|
||||
|
||||
# 第一步:弹出认证方式选择框
|
||||
dialog_auth_choice = DialogModifyAlias(self)
|
||||
auth_dict = {
|
||||
"face": "人脸认证",
|
||||
"word": "密码认证"
|
||||
}
|
||||
dialog_auth_choice.set_alias_item_info(auth_dict, "password", "请选择认证方式")
|
||||
|
||||
if dialog_auth_choice.exec() == QDialog.Accepted:
|
||||
choice = dialog_auth_choice.value
|
||||
|
||||
# 第二步:根据选择执行不同的认证
|
||||
if choice == "word":
|
||||
dialog_modify_text = DialogModifyValue(self)
|
||||
caption_str = "请输入密码:"
|
||||
dialog_modify_text.update_modify_info("", "0000", caption_str)
|
||||
input = False
|
||||
if dialog_modify_text.exec() == QDialog.Accepted:
|
||||
input = True
|
||||
modify_screen_time_str = dialog_modify_text.value
|
||||
pass_word = system_parameter()
|
||||
if modify_screen_time_str != pass_word.get_system_password():
|
||||
inform_box = DialogInform()
|
||||
inform_box.information("提示", "密码错误,无法修改!")
|
||||
return
|
||||
print("密码认证成功")
|
||||
|
||||
elif choice == "face":
|
||||
# face_page = self.parent_window.P05_01_FaceCameraView
|
||||
input = True
|
||||
|
||||
|
||||
|
||||
else:
|
||||
input = True
|
||||
if input :
|
||||
@ -799,12 +823,13 @@ class UIFrameWork(QMainWindow, class_comm_mqtt_interface):
|
||||
if isinstance(select_object, QLineEdit) :
|
||||
self.on_line_edit_modify_click(select_object)
|
||||
elif "Users" in action_str :
|
||||
UserManageDialog(self, self.sender()).exec_()
|
||||
self.do_manage_users()
|
||||
elif "Verify" in action_str :
|
||||
dlg = VerifyDialog(self)
|
||||
if dlg.exec_() == QDialog.Accepted:
|
||||
pd_val, timeout_val = dlg.values()
|
||||
self.send(build_verify(pd_val, timeout_val))
|
||||
self.do_verify()
|
||||
elif "EnrollItgSingle" in action_str :
|
||||
self.do_enroll_itg_single()
|
||||
elif "Reset" in action_str :
|
||||
self.reset_command()
|
||||
|
||||
self.virtual_widget_action_process(select_object, action_str)
|
||||
|
||||
@ -818,7 +843,27 @@ class UIFrameWork(QMainWindow, class_comm_mqtt_interface):
|
||||
break
|
||||
menu_index += 1
|
||||
return match_object, menu_index
|
||||
|
||||
################################################################################
|
||||
|
||||
def do_verify(self):
|
||||
pd_val = 0
|
||||
timeout_val = system_parameter().get_verify_timeout()
|
||||
self.send(build_verify(pd_val, timeout_val))
|
||||
|
||||
def do_enroll_itg_single(self):
|
||||
dlg = EnrollItgSingleDialog(self)
|
||||
if dlg.exec_() == QDialog.Accepted:
|
||||
admin_val, uname, face_dir, timeout_val, itg_val = dlg.values()
|
||||
self.last_enroll_name = uname
|
||||
self.send(build_enroll_itg_single(admin_val, uname, face_dir, timeout_val, itg_val))
|
||||
|
||||
def do_manage_users(self):
|
||||
UserManageDialog(self, self.send).exec_()
|
||||
|
||||
def reset_command(self):
|
||||
self.send(build_reset())
|
||||
|
||||
################################################################################
|
||||
#刷新屏幕上的系统信息, 例如时间日期之类
|
||||
def flush_system_info(self, child = None) :
|
||||
widget : QWidget= child
|
||||
@ -953,6 +998,22 @@ class UIFrameWork(QMainWindow, class_comm_mqtt_interface):
|
||||
pass_word.set_system_password(modify_screen_time_str)
|
||||
dialog_inform = DialogInform(self)
|
||||
dialog_inform.information("系统密码修改", "系统密码修改成功")
|
||||
|
||||
elif system == "FaceRecogTimeout":
|
||||
dialog_modify_text = DialogModifyValue(self)
|
||||
caption_str = "修改人脸识别超时时间(秒)"
|
||||
frt = system_parameter()
|
||||
dialog_modify_text.update_modify_info("", str(frt.get_verify_timeout()), caption_str)
|
||||
|
||||
if dialog_modify_text.exec() == QDialog.Accepted:
|
||||
modify_screen_time_str = dialog_modify_text.value
|
||||
result = frt.set_verify_timeout(modify_screen_time_str)
|
||||
|
||||
if result is not None:
|
||||
self.FaceRecogTimeoutEdit.setText(str(result))
|
||||
dialog_inform = DialogInform(self)
|
||||
dialog_inform.information("人脸识别超时时间修改", "人脸识别超时时间修改成功")
|
||||
|
||||
def on_line_edit_modify_click(self, sender :QLineEdit) :
|
||||
match_object : QLineEdit = None
|
||||
match_object, menu_index = self.search_menu_match_object(sender)
|
||||
@ -1307,7 +1368,7 @@ class UIFrameWork(QMainWindow, class_comm_mqtt_interface):
|
||||
|
||||
def menu_selectable_object_flush(self) :
|
||||
menu_count = len(self.sort_menu_list)
|
||||
for i in range(menu_count):
|
||||
for i in range(menu_count):
|
||||
object : QWidget = self.sort_menu_list[i][1]
|
||||
is_select_object_draw = False
|
||||
|
||||
@ -1665,6 +1726,20 @@ class UIFrameWork(QMainWindow, class_comm_mqtt_interface):
|
||||
self.param_dict[mqtt_str] = ALIAS_QUERY_NONE
|
||||
self.para_or_measure_query(child_widget)
|
||||
|
||||
def para_face(self, child = None) :
|
||||
widget :QWidget = self
|
||||
if child == None :
|
||||
self.param_dict = {}
|
||||
else :
|
||||
widget = child
|
||||
for child_widget in widget.children():
|
||||
if hasattr(child_widget, "statusTip") :
|
||||
tip_str : str = child_widget.statusTip()
|
||||
if "FaceRecogTimeout" in tip_str :
|
||||
frt = system_parameter()
|
||||
child_widget.setText(str(frt.get_verify_timeout()))
|
||||
continue
|
||||
self.para_face(child_widget)
|
||||
|
||||
def flush_system_cycle(self) :
|
||||
self.flush_system_info()
|
||||
|
||||
Reference in New Issue
Block a user