diff --git a/Linguist/FaceTick_DE.ts b/Linguist/FaceTick_DE.ts new file mode 100644 index 0000000..560019a --- /dev/null +++ b/Linguist/FaceTick_DE.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + Maske Ok + + + 未佩戴口罩 + Ohne Maske + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + Temp: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Passed + + + 禁止通行 + Sie dürfen nicht passieren + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + Serverausnahme + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + Bitte näher kommen + + + 未经许可人员 + Nicht autorisiertes Personal + + + 未佩戴口罩 + Ohne Maske + + + 请用本人证件 + Please use your ID + + + 请刷卡 + Please swipe card + + + 请正视镜头 + Please face the camera + + + 口罩检测通过 + Maske Ok + + + 体温: + Temp: + + + 禁止通行时段 + No-passing period + + + 身份证核验失败 + ID verification failed + + + 身份核验中 + Identitätsprüfung + + + 服务器连接异常 + Serverausnahme + + + 禁止通行 + Sie dürfen nicht passieren + + + 人脸特征更新中... + Aktualisierung der Gesichtszüge... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + Identitätsprüfung + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + Bitte näher kommen + + + 未经许可人员 + Nicht autorisiertes Personal + + + 禁止通行 + Sie dürfen nicht passieren + + + 未佩戴口罩 + Ohne Maske + + + 口罩检测通过 + Maske Ok + + + 体温: + Temp: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + + recoUiRecognizeTypeBase + + 身份核验中 + Identitätsprüfung + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + Serverausnahme + + + 身份证核验失败 + ID verification failed + + + 请刷脸通行 + Bitte näher kommen + + + 未经许可人员 + Nicht autorisiertes Personal + + + 禁止通行 + Sie dürfen nicht passieren + + + 未佩戴口罩 + Ohne Maske + + + 口罩检测通过 + Maske Ok + + + 体温: + Temp: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable 4WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_EN.ts b/Linguist/FaceTick_EN.ts new file mode 100644 index 0000000..59090d7 --- /dev/null +++ b/Linguist/FaceTick_EN.ts @@ -0,0 +1,3134 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 请补全*信息! + Please complete * information! + + + IC卡号重复! + Duplicate IC card number! + + + 身份证号已存在! + The ID number already exists! + + + 确认添加 + + + + 确定新增人员? + + + + 注册失败,已达到最大注册人数! + + + + 注册人员失败,请重新抓拍! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + Mask detection pass + + + 未佩戴口罩 + No wearing mask + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 删除人员 + Delete + + + 确定更改人员信息? + Are you sure to modify it? + + + 确定 + OK + + + 请补全*信息! + Please complete * information! + + + 无效的姓名! + Invalid name! + + + IC卡号重复! + Duplicate IC card number! + + + 身份证号已存在! + The ID number already exists! + + + 更改人员信息失败,人员或已被删除! + Failed to modify, maybe it already deleted! + + + 确定删除改人员? + Are you sure to delete it? + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加载中,请稍候 ... + Loading, please wait ... + + + 掌静脉录入成功 + Palm vein registration successful + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 人脸图片 + Face picture + + + *授权 + *Access + + + 永久授权 + Permanent + + + 非永久授权 + Not permanent + + + *姓名 + *Name + + + *授权截至日期 + Access expiration date + + + 工号 + Job number + + + 手机号 + Phone number + + + 身份证号 + ID number + + + IC卡/NFC + IC/NFC + + + 右手掌静脉 + Right palm vein + + + 左手掌静脉 + Left palm vein + + + 可以刷卡写入IC卡 + Can be written into IC card by swiping card + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 请注册右手... + Please register your right hand ... + + + 掌静脉注册成功 + Palm vein registration successful + + + 已注册 + Registered + + + 掌静脉注册失败 + Palm vein registration failed + + + 请注册左手... + Please register your left hand ... + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + Photograph + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + Temp: + + + + UserPwdDialog + + 请输入您的密码 + Please enter your password + + + 确认 + OK + + + 删除 + Delete + + + 清空 + Clear + + + 返回 + Back + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + ID: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Passed + + + 禁止通行 + No Passing + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 确认 + OK + + + 欢迎光临 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + Server exception + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + please scan QR code + + + 未授权卡片 + Unauthorized Card + + + 请刷脸通行 + Detect face to pass + + + 未经许可人员 + Unauthorized Personnel + + + 未佩戴口罩 + No wearing mask + + + 请用本人证件 + Please use your ID + + + 请刷卡 + Please swipe card + + + 请正视镜头 + Please face the camera + + + 口罩检测通过 + Mask detection pass + + + 体温: + Temp: + + + 禁止通行时段 + No-passing period + + + 身份证核验失败 + ID verification failed + + + 身份核验中 + Identity verification + + + 服务器连接异常 + Server exception + + + 未注册人员 + No Permissions + + + 禁止通行 + No Passing + + + 人脸特征更新中... + Feature Updating... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + Identity verification + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + please scan QR code + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + Detect face to pass + + + 未经许可人员 + Unauthorized Personnel + + + 禁止通行 + No Passing + + + 未佩戴口罩 + No wearing mask + + + 口罩检测通过 + Mask detection pass + + + 体温: + Temp: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + + recoUiRecognizeTypeBase + + 身份核验中 + Identity verification + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + please scan QR code + + + 未注册人员 + 未授权卡片 + No Permissions + + + 服务器异常 + Server exception + + + 身份证核验失败 + ID verification failed + + + 请刷脸通行 + Detect face to pass + + + 未经许可人员 + Unauthorized Personnel + + + 禁止通行 + No Passing + + + 未佩戴口罩 + No wearing mask + + + 口罩检测通过 + Mask detection pass + + + 体温: + Temp: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 未授权卡片 + Unauthorized Card + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Device + + + 人员管理 + 人脸管理 + Person Management + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 快速配置 + Quick Settings + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 蓝牙 + Bluetooth + + + 蓝牙音箱 + Bluetooth Speaker + + + 蓝牙门锁 + Bluetooth door lock + + + 蓝牙门锁操作 + Bluetooth door lock operation + + + 人员库 + 人脸库 + People Library + + + 通行记录 + Records + + + 编辑人员 + Modify Person + + + 拍照 + Photograph + + + 添加人员 + Add + + + 保存 + Save + + + 人脸管理 + Face + + + 设备检测 + + + + 已配对蓝牙设置 + + + + 人脸库 + Face Library + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 无 + None + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + GPIO4接口 + GPIO接口 + GPIO4 Port + + + GPIO5接口 + GPIO5 Port + + + 门超时报警(秒) + Door timeout alarm (seconds) + + + 防拆报警 + Tamper alarm + + + 防拆报警信号 + Anti-tamper alarm signal + + + (未设置) + (Not set) + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + (未设置) + (Not set) + + + 已开启 + Turned on + + + 已关闭 + Closed + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 蓝牙 + Bluetooth + + + 动态底库 + Dynamic base library + + + 通行密码 + Password + + + 界面显示ID及版本号 + + + + 禁用工程页面 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 蓝牙音箱 + Bluetooth Speaker + + + 蓝牙门锁 + Bluetooth door lock + + + 处理中,请稍候... + Processing, please wait... + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 删除 + Delete + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 启用有线网络 + Enable wired network + + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 人员库(人) + Person Library + + + 通行记录(条) + Records + + + + settingUiFastCfgPark + + 下一步 + Next + + + + settingUiFastCfgWireNet + + 下一步 + Next + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 屏下NFC ID + Under-screen NFC ID + + + 拓展NFC ID + Extend NFC ID + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + + settingUiPark + + (未设置) + (Not set) + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 居民二代身份证 + Resident second generation ID card + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 健康码核验 + Health code verification + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_FR.ts b/Linguist/FaceTick_FR.ts new file mode 100644 index 0000000..2fc8027 --- /dev/null +++ b/Linguist/FaceTick_FR.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + Masque OK + + + 未佩戴口罩 + Aucun masque présent + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Vérification ... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Veuillez passer + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Vérification ... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Veuillez passer + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + Température: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Veuillez passer + + + 禁止通行 + Entrée interdite + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + Exception De Serveur + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + Veuillez vous présenter face à la caméra + + + 未经许可人员 + Personne non autorisée + + + 未佩戴口罩 + Aucun masque présent + + + 请用本人证件 + Veuillez utiliser votre identifiant + + + 请刷卡 + Veuillez glisser la carte + + + 请正视镜头 + Veuillez faire face à la caméra + + + 口罩检测通过 + Masque OK + + + 体温: + Température: + + + 禁止通行时段 + No-passing period + + + 身份证核验失败 + ID verification failed + + + 身份核验中 + Vérification d'identité + + + 服务器连接异常 + Exception de serveur + + + 禁止通行 + Entrée interdite + + + 人脸特征更新中... + Mise à jour fonction visage... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + Vérification d'identité + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + Veuillez vous présenter face à la caméra + + + 未经许可人员 + Personne non autorisée + + + 禁止通行 + Entrée interdite + + + 未佩戴口罩 + Aucun masque présent + + + 口罩检测通过 + Masque OK + + + 体温: + Température: + + + 请刷卡 + Veuillez glisser la carte + + + 请用本人证件 + Veuillez utiliser votre identifiant + + + 请正视镜头 + Veuillez faire face à la caméra + + + 禁止通行时段 + No-passing period + + + + recoUiRecognizeTypeBase + + 身份核验中 + Vérification d'identité + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + Exception De Serveur + + + 身份证核验失败 + ID verification failed + + + 请刷脸通行 + Veuillez vous présenter face à la caméra + + + 未经许可人员 + Personne non autorisée + + + 禁止通行 + Entrée interdite + + + 未佩戴口罩 + Aucun masque présent + + + 口罩检测通过 + Masque OK + + + 体温: + Température: + + + 请刷卡 + Veuillez glisser la carte + + + 请用本人证件 + Veuillez utiliser votre identifiant + + + 请正视镜头 + Veuillez faire face à la caméra + + + 禁止通行时段 + No-passing period + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_HU.ts b/Linguist/FaceTick_HU.ts new file mode 100644 index 0000000..34c25f2 --- /dev/null +++ b/Linguist/FaceTick_HU.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + Maszk használat észlelve + + + 未佩戴口罩 + Nem visel maszkot + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + Testhőmérséklet: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Passed + + + 禁止通行 + Áthaladás megtagadva + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + A Szerverkapcsolat Kivétel + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + Arc leolvasása szükséges + + + 未经许可人员 + Illetéktelen személy + + + 未佩戴口罩 + Nem visel maszkot + + + 请用本人证件 + Kérjük, használja az igazolványát + + + 请刷卡 + Kérjük, használja a kártyáját + + + 请正视镜头 + Kérjük, nézzen szembe a kamerával + + + 口罩检测通过 + Maszk használat észlelve + + + 体温: + Testhőmérséklet: + + + 禁止通行时段 + Áthaladási időszak szünetelése + + + 身份证核验失败 + ID verification failed + + + 身份核验中 + Azonosítás ellenőrzése folyamatban + + + 服务器连接异常 + A szerverkapcsolat kivétel + + + 禁止通行 + Áthaladás megtagadva + + + 人脸特征更新中... + Arcfelismerés frissítés folyamatban... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + Azonosítás ellenőrzése folyamatban + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + Arc leolvasása szükséges + + + 未经许可人员 + Illetéktelen személy + + + 禁止通行 + Áthaladás megtagadva + + + 未佩戴口罩 + Nem visel maszkot + + + 口罩检测通过 + Maszk használat észlelve + + + 体温: + Testhőmérséklet: + + + 请刷卡 + Kérjük, használja a kártyáját + + + 请用本人证件 + Kérjük, használja az igazolványát + + + 请正视镜头 + Kérjük, nézzen szembe a kamerával + + + 禁止通行时段 + Áthaladási időszak szünetelése + + + + recoUiRecognizeTypeBase + + 身份核验中 + Azonosítás ellenőrzése folyamatban + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + A Szerverkapcsolat Kivétel + + + 身份证核验失败 + ID verification failed + + + 请刷脸通行 + Arc leolvasása szükséges + + + 未经许可人员 + Illetéktelen személy + + + 禁止通行 + Áthaladás megtagadva + + + 未佩戴口罩 + Nem visel maszkot + + + 口罩检测通过 + Maszk használat észlelve + + + 体温: + Testhőmérséklet: + + + 请刷卡 + Kérjük, használja a kártyáját + + + 请用本人证件 + Kérjük, használja az igazolványát + + + 请正视镜头 + Kérjük, nézzen szembe a kamerával + + + 禁止通行时段 + Áthaladási időszak szünetelése + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_IT.ts b/Linguist/FaceTick_IT.ts new file mode 100644 index 0000000..93cb5c3 --- /dev/null +++ b/Linguist/FaceTick_IT.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + Mascherina OK + + + 未佩戴口罩 + Indossare mascherina + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + Temp: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Passed + + + 禁止通行 + Ingresso non autorizzato + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + Esclusione Del Server + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + Prego inquadrare il viso + + + 未经许可人员 + Personale non autorizzato + + + 未佩戴口罩 + Indossare mascherina + + + 请用本人证件 + Please use your ID + + + 请刷卡 + Please swipe card + + + 请正视镜头 + Please face the camera + + + 口罩检测通过 + Mascherina OK + + + 体温: + Temp: + + + 禁止通行时段 + No-passing period + + + 身份证核验失败 + ID verification failed + + + 身份核验中 + Identificazione in corso + + + 服务器连接异常 + Esclusione del server + + + 禁止通行 + Ingresso non autorizzato + + + 人脸特征更新中... + Aggiornamento Funzione viso... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + Identificazione in corso + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + Prego inquadrare il viso + + + 未经许可人员 + Personale non autorizzato + + + 禁止通行 + Ingresso non autorizzato + + + 未佩戴口罩 + Indossare mascherina + + + 口罩检测通过 + Mascherina OK + + + 体温: + Temp: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + + recoUiRecognizeTypeBase + + 身份核验中 + Identificazione in corso + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + Esclusione Del Server + + + 身份证核验失败 + ID verification failed + + + 请刷脸通行 + Prego inquadrare il viso + + + 未经许可人员 + Personale non autorizzato + + + 禁止通行 + Ingresso non autorizzato + + + 未佩戴口罩 + Indossare mascherina + + + 口罩检测通过 + Mascherina OK + + + 体温: + Temp: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_IW.ts b/Linguist/FaceTick_IW.ts new file mode 100644 index 0000000..fb16f49 --- /dev/null +++ b/Linguist/FaceTick_IW.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + זיהוי מסיכה אושר + + + 未佩戴口罩 + לא זוהתה חבישת מסיכה + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + חום: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Passed + + + 禁止通行 + אין מעבר + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + חריג שרת + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + אנא הזדהה, על מנת לעבור + + + 未经许可人员 + גורם לא מאושר + + + 未佩戴口罩 + לא זוהתה חבישת מסיכה + + + 请用本人证件 + Please use your ID + + + 请刷卡 + Please swipe card + + + 请正视镜头 + Please face the camera + + + 口罩检测通过 + זיהוי מסיכה אושר + + + 体温: + חום: + + + 禁止通行时段 + No-passing period + + + 身份证核验失败 + ID verification failed + + + 身份核验中 + בדיקת זהות מתקדמת + + + 服务器连接异常 + חירום לשרת + + + 禁止通行 + אין מעבר + + + 人脸特征更新中... + עידכון מתבצע... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + בדיקת זהות מתקדמת + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + אנא הזדהה, על מנת לעבור + + + 未经许可人员 + גורם לא מאושר + + + 禁止通行 + אין מעבר + + + 未佩戴口罩 + לא זוהתה חבישת מסיכה + + + 口罩检测通过 + זיהוי מסיכה אושר + + + 体温: + חום: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + + recoUiRecognizeTypeBase + + 身份核验中 + בדיקת זהות מתקדמת + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + חריג שרת + + + 身份证核验失败 + ID verification failed + + + 请刷脸通行 + אנא הזדהה, על מנת לעבור + + + 未经许可人员 + גורם לא מאושר + + + 禁止通行 + אין מעבר + + + 未佩戴口罩 + לא זוהתה חבישת מסיכה + + + 口罩检测通过 + זיהוי מסיכה אושר + + + 体温: + חום: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_JP.ts b/Linguist/FaceTick_JP.ts new file mode 100644 index 0000000..a9aab05 --- /dev/null +++ b/Linguist/FaceTick_JP.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + マスクを確認しました + + + 未佩戴口罩 + マスクを着けて下さい + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + 顔認識装置 + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + 体表温度: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Passed + + + 禁止通行 + 係が来るまでお待ち下さい + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + サーバー例外 + + + 请调整人脸角度 + 顔の角度を調整する + + + 请刷脸通行 + 顔を近づけてください + + + 未经许可人员 + 無許可の人員 + + + 未佩戴口罩 + マスクを着けて下さい + + + 请用本人证件 + Please use your ID + + + 请刷卡 + Please swipe card + + + 请正视镜头 + Please face the camera + + + 口罩检测通过 + マスクを確認しました + + + 体温: + 体表温度: + + + 禁止通行时段 + No-passing period + + + 身份证核验失败 + ID verification failed + + + 身份核验中 + 身分確認中 + + + 服务器连接异常 + サーバ接続異常 + + + 禁止通行 + 係が来るまでお待ち下さい + + + 人脸特征更新中... + 顔特徴を更新中... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + 身分確認中 + + + 请调整人脸角度 + 顔の角度を調整する + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + 顔を近づけてください + + + 未经许可人员 + 無許可の人員 + + + 禁止通行 + 係が来るまでお待ち下さい + + + 未佩戴口罩 + マスクを着けて下さい + + + 口罩检测通过 + マスクを確認しました + + + 体温: + 体表温度: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + + recoUiRecognizeTypeBase + + 身份核验中 + 身分確認中 + + + 请调整人脸角度 + 顔の角度を調整する + + + 服务器异常 + サーバー例外 + + + 身份证核验失败 + ID verification failed + + + 请刷脸通行 + 顔を近づけてください + + + 未经许可人员 + 無許可の人員 + + + 禁止通行 + 係が来るまでお待ち下さい + + + 未佩戴口罩 + マスクを着けて下さい + + + 口罩检测通过 + マスクを確認しました + + + 体温: + 体表温度: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_KR.ts b/Linguist/FaceTick_KR.ts new file mode 100644 index 0000000..62827f8 --- /dev/null +++ b/Linguist/FaceTick_KR.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + 마스크 착용 통과 + + + 未佩戴口罩 + 마스크 미착용 + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verifying... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Passed + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + 체온: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Passed + + + 禁止通行 + 통행 차단 + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + 서버 예외 + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + 얼굴을 전달해 주세요. + + + 未经许可人员 + 미등록자 + + + 未佩戴口罩 + 마스크 미착용 + + + 请用本人证件 + Please use your ID + + + 请刷卡 + Please swipe card + + + 请正视镜头 + Please face the camera + + + 口罩检测通过 + 마스크 착용 통과 + + + 体温: + 체온: + + + 禁止通行时段 + No-passing period + + + 身份证核验失败 + ID verification failed + + + 身份核验中 + 신분 검증 중 + + + 服务器连接异常 + 서버 연결 이상 + + + 禁止通行 + 통행 차단 + + + 人脸特征更新中... + 안면특징 업그레이드... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + 신분 검증 중 + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + 얼굴을 전달해 주세요. + + + 未经许可人员 + 미등록자 + + + 禁止通行 + 통행 차단 + + + 未佩戴口罩 + 마스크 미착용 + + + 口罩检测通过 + 마스크 착용 통과 + + + 体温: + 체온: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + + recoUiRecognizeTypeBase + + 身份核验中 + 신분 검증 중 + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + 서버 예외 + + + 身份证核验失败 + ID verification failed + + + 请刷脸通行 + 얼굴을 전달해 주세요. + + + 未经许可人员 + 미등록자 + + + 禁止通行 + 통행 차단 + + + 未佩戴口罩 + 마스크 미착용 + + + 口罩检测通过 + 마스크 착용 통과 + + + 体温: + 체온: + + + 请刷卡 + Please swipe card + + + 请用本人证件 + Please use your ID + + + 请正视镜头 + Please face the camera + + + 禁止通行时段 + No-passing period + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_PT.ts b/Linguist/FaceTick_PT.ts new file mode 100644 index 0000000..59c0a54 --- /dev/null +++ b/Linguist/FaceTick_PT.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + Máscara detectada + + + 未佩戴口罩 + Máscara não detectada + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verificando ... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Por favor passe + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verificando ... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Por favor passe + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + Temp: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Por favor passe + + + 禁止通行 + Acesso não autorizado + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + Exceção do servidor + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + Identifique-se + + + 未经许可人员 + Usuário não reconhecido + + + 未佩戴口罩 + Máscara não detectada + + + 请用本人证件 + Por favor, informe seu ID + + + 请刷卡 + Por favor, passe o cartão + + + 请正视镜头 + Por favor, olhe para a câmera + + + 口罩检测通过 + Máscara detectada + + + 体温: + Temp: + + + 禁止通行时段 + Fora do período autorizado + + + 身份证核验失败 + ID verification failed + + + 身份核验中 + Verificação da identidade + + + 服务器连接异常 + Excepção do servidor + + + 禁止通行 + Acesso não autorizado + + + 人脸特征更新中... + Atualizando... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + Verificação da identidade + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + Identifique-se + + + 未经许可人员 + Usuário não reconhecido + + + 禁止通行 + Acesso não autorizado + + + 未佩戴口罩 + Máscara não detectada + + + 口罩检测通过 + Máscara detectada + + + 体温: + Temp: + + + 请刷卡 + Por favor, passe o cartão + + + 请用本人证件 + Por favor, informe seu ID + + + 请正视镜头 + Por favor, olhe para a câmera + + + 禁止通行时段 + Fora do período autorizado + + + + recoUiRecognizeTypeBase + + 身份核验中 + Verificação da identidade + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + Exceção do servidor + + + 身份证核验失败 + ID verification failed + + + 请刷脸通行 + Identifique-se + + + 未经许可人员 + Usuário não reconhecido + + + 禁止通行 + Acesso não autorizado + + + 未佩戴口罩 + Máscara não detectada + + + 口罩检测通过 + Máscara detectada + + + 体温: + Temp: + + + 请刷卡 + Por favor, passe o cartão + + + 请用本人证件 + Por favor, informe seu ID + + + 请正视镜头 + Por favor, olhe para a câmera + + + 禁止通行时段 + Fora do período autorizado + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_SP.ts b/Linguist/FaceTick_SP.ts new file mode 100644 index 0000000..559c1a8 --- /dev/null +++ b/Linguist/FaceTick_SP.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + Mascarilla Ok + + + 未佩戴口罩 + Sin Mascarilla + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verificando ... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Por favor pase + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + Verificando ... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Por favor pase + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + Temp: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Por favor pase + + + 禁止通行 + NO PUEDE PASAR + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + Excepción del servidor + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + Por favor acérquese + + + 未经许可人员 + Personal no autorizado + + + 未佩戴口罩 + Sin Mascarilla + + + 请用本人证件 + Por favor use su identificación + + + 请刷卡 + Pase la tarjeta + + + 请正视镜头 + Por favor, mira a la cámara + + + 口罩检测通过 + Mascarilla Ok + + + 体温: + Temp: + + + 禁止通行时段 + Período de no aprobación + + + 身份证核验失败 + Error de verificación de identificación + + + 身份核验中 + Identificación + + + 服务器连接异常 + Excepción del servidor + + + 禁止通行 + NO PUEDE PASAR + + + 人脸特征更新中... + Actualización de características faciales... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + Identificación + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + Por favor acérquese + + + 未经许可人员 + Personal no autorizado + + + 禁止通行 + NO PUEDE PASAR + + + 未佩戴口罩 + Sin Mascarilla + + + 口罩检测通过 + Mascarilla Ok + + + 体温: + Temp: + + + 请刷卡 + Pase la tarjeta + + + 请用本人证件 + Por favor use su identificación + + + 请正视镜头 + Por favor, mira a la cámara + + + 禁止通行时段 + Período de no aprobación + + + + recoUiRecognizeTypeBase + + 身份核验中 + Identificación + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + Excepción del servidor + + + 身份证核验失败 + Error de verificación de identificación + + + 请刷脸通行 + Por favor acérquese + + + 未经许可人员 + Personal no autorizado + + + 禁止通行 + NO PUEDE PASAR + + + 未佩戴口罩 + Sin Mascarilla + + + 口罩检测通过 + Mascarilla Ok + + + 体温: + Temp: + + + 请刷卡 + Pase la tarjeta + + + 请用本人证件 + Por favor use su identificación + + + 请正视镜头 + Por favor, mira a la cámara + + + 禁止通行时段 + Período de no aprobación + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_TC.ts b/Linguist/FaceTick_TC.ts new file mode 100644 index 0000000..3a06b12 --- /dev/null +++ b/Linguist/FaceTick_TC.ts @@ -0,0 +1,3072 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + 未搜索到相關通行記錄 + + + 通行时间: + 通行時間: + + + 通过 + 通過 + + + 不通过 + 不通過 + + + + AddPersonPage + + 确定 + 確定 + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + 確定 + + + + ComSelectDialog + + 确定 + 確定 + + + + CustomDialog + + 取消 + 取消 + + + + DateTimeDialog + + 确定 + 確定 + + + 点击对应时间项设置 + 點擊對應時間項設置 + + + + FaceDbPage + + 未搜索到相关人员 + 未搜索到相關人員 + + + 有效期: + 有效期: + + + 注册时间: + 註冊時間: + + + 有效期:永久有效 + 有效期:永久有效 + + + + InfoDialog + + 知道了 + 知道了 + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + 確定 + + + 设置有误,请重新输入! + 設置有誤,請重新輸入! + + + + IpInputDialog + + 确定 + 確定 + + + + ItemChooseDialog + + 确定 + 確定 + + + + LineEditInputDialog + + 确定 + 確定 + + + + MaskWidget + + 口罩检测通过 + 口罩檢測通過 + + + 未佩戴口罩 + 未佩戴口罩 + + + 请出示个人平安码 + 請出示個人平安碼 + + + 正在验证... + 正在驗證... + + + 验证错误请重试 + 驗證錯誤請重試 + + + 请走人工通道 + 請走人工通道 + + + 请通行 + 請通行 + + + 无效平安码 + 無效平安碼 + + + 扫码超时 + 掃碼超時 + + + + MaskWidget_o + + 请出示个人平安码 + 請出示個人平安碼 + + + 正在验证... + 正在驗證... + + + 验证错误请重试 + 驗證錯誤請重試 + + + 请走人工通道 + 請走人工通道 + + + 请通行 + 請通行 + + + 无效平安码 + 無效平安碼 + + + 扫码超时 + 掃碼超時 + + + + ModifyPersonPage + + 确定 + 確定 + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + 確定 + + + 取消 + 取消 + + + 恢复出厂 + 恢復出廠 + + + 工程密码 + 工程密碼 + + + 您确定恢复出厂设置吗? + 您確定恢復出廠設置嗎? + + + 恢复 + 恢復 + + + + PersonMsgUiPage + + 请输入人员姓名 + 請輸入人員姓名 + + + 请选择通行时间 + 請選擇通行時間 + + + + QObject + + 设置有误,请重新输入! + 設置有誤,請重新輸入! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + 由於之前多次密碼驗證 +錯誤,請稍等一會重試! + + + 知道了 + 知道了 + + + 由于之前多次密码验证错误,请稍等一会重试! + 由於之前多次密碼驗證錯誤,請稍等一會重試! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + 確定 + + + + RadioBtnChooseDialog + + 确定 + 確定 + + + + RegisterPersonPage + + 设置有误,请重新输入! + 設置有誤,請重新輸入! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 配置方式 + + + + 二维码配置 + + + + 手动配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + 確定 + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + 人臉識別終端 + + + + StyleItemChooseDialog + + 确定 + 確定 + + + 取消 + 取消 + + + + TmprWidget + + 体温: + 體溫: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + 名稱 + + + 密码 + 密碼 + + + 加入 + 加入 + + + 加密方式 + 加密方式 + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + 由於之前多次密碼驗證錯誤,請稍後再重試! + + + 知道了 + 知道了 + + + 设备编码: + 設備編碼: + + + 请输入密码 + 請輸入密碼 + + + 当前管理员账号:admin + 當前管理員賬號: + + + 密码错误,请重试 + 密碼錯誤,請重試 + + + 确定 + 確定 + + + 取消 + 取消 + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + 取消 + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + 請通行 + + + 禁止通行 + 禁止通行 + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + 服務器異常 + + + 请调整人脸角度 + 請調整人臉角度 + + + 请刷脸通行 + 請刷臉通行 + + + 未经许可人员 + 未經許可人員 + + + 未佩戴口罩 + 未佩戴口罩 + + + 请用本人证件 + 請用本人證件 + + + 请刷卡 + 請刷卡 + + + 请正视镜头 + 請正視鏡頭 + + + 口罩检测通过 + 口罩檢測通過 + + + 体温: + 體溫: + + + 禁止通行时段 + 禁止通行時段 + + + 身份证核验失败 + 身份證核驗失敗 + + + 身份核验中 + 身份核驗中 + + + 服务器连接异常 + 服務器連接异常 + + + 禁止通行 + 禁止通行 + + + 人脸特征更新中... + 人臉特徵更新中... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + 身份核驗中 + + + 请调整人脸角度 + 請調整人臉角度 + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + 請刷臉通行 + + + 未经许可人员 + 未經許可人員 + + + 禁止通行 + 禁止通行 + + + 未佩戴口罩 + 未佩戴口罩 + + + 口罩检测通过 + 口罩檢測通過 + + + 体温: + 體溫: + + + 请刷卡 + 請刷卡 + + + 请用本人证件 + 請用本人證件 + + + 请正视镜头 + 請正視鏡頭 + + + 禁止通行时段 + 禁止通行時段 + + + + recoUiRecognizeTypeBase + + 身份核验中 + 身份核驗中 + + + 请调整人脸角度 + 請調整人臉角度 + + + 服务器异常 + 服務器異常 + + + 身份证核验失败 + 身份證核驗失敗 + + + 请刷脸通行 + 請刷臉通行 + + + 未经许可人员 + 未經許可人員 + + + 禁止通行 + 禁止通行 + + + 未佩戴口罩 + 未佩戴口罩 + + + 口罩检测通过 + 口罩檢測通過 + + + 体温: + 體溫: + + + 请刷卡 + 請刷卡 + + + 请用本人证件 + 請用本人證件 + + + 请正视镜头 + 請正視鏡頭 + + + 禁止通行时段 + 禁止通行時段 + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + 軟件未授權 + + + 请联系平台管理员 + 請聯繫平台管理員 + + + 重新检测授权状态 + 重新檢測授權狀態 + + + 进入系统设置 + 進入系統設置 + + + 瑞为技术 +RECONOVA + 瑞為技術 +RECONOVA + + + + settingUi + + 操作 + 操作 + + + 信息查看 + 信息查看 + + + 设备管理 + 設備管理 + + + 人员管理 + 人脸管理 + 人臉管理 + + + 门禁管理 + 門禁管理 + + + 识别设置 + 識別設置 + + + 系统管理 + 系統管理 + + + 时间设置 + 時間設置 + + + 网络设置 + 網路設置 + + + 有线网络 + 有線網路 + + + 无线网络 + 無線網路 + + + 无线网络接入 + 無線網路接入 + + + 4G网络 + 4G網路 + + + 人员库 + 人脸库 + 人臉庫 + + + 通行记录 + 通行記錄 + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + 本地繼電器已使用 + + + 禁用 + 禁用 + + + 本地继电器 + 本地繼電器 + + + 韦根26 + 韋根26 + + + 韦根34 + 韋根34 + + + 韦根42 + 韋根42 + + + 开锁延迟(秒) + 開鎖延遲(秒) + + + 开锁时间(秒) + 開鎖時間(秒) + + + 开锁信号 + 開鎖信號 + + + 告警信号 + 告警信號 + + + 设置有误,请重新输入! + 設置有誤,請重新輸入! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + 從不 + + + 设置为0时永不进入待机 + 設定為0時永不進入待機 + + + 设置为0时永不进入熄屏 + 設定為0時永不進入熄屏 + + + 界面显示IP + 界面顯示IP + + + 音量控制 + 音量控制 + + + 亮度控制 + 亮度控制 + + + 进入屏保时间(秒) + 進入屏保時間(秒) + + + 熄屏等待时间(秒) + 熄屏等待時間(秒) + + + 时间设置 + 時間設置 + + + 网络设置 + 網路設置 + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 处理中,请稍候... + 處理中,請稍候... + + + 启用 + + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 处理中,请稍候... + 處理中,請稍候... + + + 启用 + + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + MAC地址 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + MAC地址 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + 搜索中,請稍候... + + + 处理中,请稍候... + 處理中,請稍候... + + + 设置有误,请重新输入! + 設置有誤,請重新輸入! + + + 确定 + 確定 + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + 設置有誤,請重新輸入! + + + 处理中,请稍候... + 處理中,請稍候... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + 獲取4G網絡配置失敗,請重試! + + + 您确定要禁用4G网络吗? + 您確定要禁用4G網路嗎? + + + 您确定要启用4G网络吗? + 您確定要啟用4G網路嗎? + + + 处理中,请稍候... + 處理中,請稍候... + + + 设置4G网络失败,请重试! + 設置4G網路失敗,請重試! + + + 您确定要重启4G网络吗? + 您確定要重啟4G網路嗎? + + + 重启成功! + 重啟成功! + + + 重启4G网络失败,请重试! + 重啟4G網路失敗,請重試! + + + 启用 + 啟用 + + + SIM卡信息 + SIM卡信息 + + + 重启4G网络 + 重啟4G網路 + + + 未插卡 + 未插卡 + + + 中国移动 + 中國移動 + + + 中国电信 + 中國電信 + + + 中国联通 + 中國聯通 + + + 4G启动中... + 4G啟動中... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + 獲取無線網路配置失敗,請重試! + + + 搜索中,请稍候... + 搜索中,請稍候... + + + 您确定要禁用无线网络吗? + 您確定要禁用無線網路嗎? + + + 您确定要启用无线网络吗? + 您確定要啟用無線網路嗎? + + + 处理中,请稍候... + 處理中,請稍候... + + + 设置无线网络失败,请重试! + 設置無線網路失敗,請重試! + + + 无线网络连接成功,是否禁用有线网络? + 無線網路連接成功,是否禁用有線網路? + + + 禁用有线网络失败,请重试! + 禁用有線網路失敗,請重試! + + + 请输入密码 + 請輸入密碼 + + + 连接无线网络失败,请重试! + 連接無線網路失敗,請重試! + + + 连接成功! + 連接成功! + + + 启用 + 啟用 + + + 其它网络 + 其它網路 + + + 重新搜索 + 重新搜索 + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + 獲取無線網路配置失敗,請重試! + + + IP设置不能为空! + IP設置不能為空! + + + 子网掩码设置不能为空! + 子網掩碼設置不能為空! + + + IP设置有误! + IP設置有誤! + + + 子网掩码设置有误! + 子網掩碼設置有誤! + + + 网关设置有误! + 網關設置有誤! + + + DNS设置有误! + DNS設置有誤! + + + 处理中,请稍候... + 處理中,請稍候... + + + 设置无线网络失败,请重试! + 設置無線網路失敗,請重試! + + + 无线网络连接成功,是否禁用有线网络? + 無線網路連接成功,是否禁用有線網路? + + + 禁用有线网络失败,请重试! + 禁用有線網路失敗,請重試! + + + 连接无线网络失败,请重试! + 連接無線網路失敗,請重試! + + + 您确定要忽略此网络吗? + 您確定要忽略此網路嗎? + + + 您确定要关闭自动获取吗? + 您確定要關閉自動獲取嗎? + + + 您确定要打开自动获取吗? + 您確定要打開自動獲取嗎? + + + 连接此网络 + 連接此網路 + + + 忽略此网络 + 忽略此網路 + + + 自动获取 + 自動獲取 + + + 手动配置 + 手動配置 + + + 设备IP + 設備IP + + + 子网掩码 + 子網掩碼 + + + 设备网关 + 設備網關 + + + DNS服务器 + DNS服務器 + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + 獲取有線網路配置失敗,請重試! + + + IP设置不能为空! + IP設置不能為空! + + + 子网掩码设置不能为空! + 子網掩碼設置不能為空! + + + IP设置有误! + IP設置有誤! + + + 子网掩码设置有误! + 子網掩碼設置有誤! + + + 网关设置有误! + 網關設置有誤! + + + DNS设置有误! + DNS設置有誤! + + + 处理中,请稍候... + 處理中,請稍候... + + + 设置有线网络失败,请重试! + 設置有線網路失敗,請重試! + + + 您确定要禁用有线网络吗? + 您确定要禁用有線網路吗? + + + 您确定要启用有线网络吗? + 您确定要啟用有線網路吗? + + + 您确定要禁用DHCP吗? + 您确定要禁用DHCP吗? + + + 您确定要启用DHCP吗? + 您确定要啟用DHCP吗? + + + 启用 + 啟用 + + + DHCP + DHCP + + + 手动配置 + 手動配寘 + + + 设备IP + 設備IP + + + 子网掩码 + 子網掩碼 + + + 设备网关 + 設備網關 + + + DNS服务器 + DNS服務器 + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + 獲取4G網路配置失敗,請重試! + + + 有线网络 + 有線網路 + + + 无线网络 + 無線網路 + + + 4G网络 + 4G網路 + + + + settingUiDevMngTime + + 设置有误,请重新输入! + 設置有誤,請重新輸入! + + + 处理中,请稍候... + 處理中,請稍候... + + + NTP校时失败,请检查! + NTP校時失敗,請檢查! + + + NTP获取时间 + NTP獲取時間 + + + NTP服务器 + NTP服務器 + + + 校时间隔(小时) + 校時間隔(小時) + + + 时区 + 時區 + + + 手动设置 + 手動設置 + + + UTC-11太平洋/中途岛 + UTC-11太平洋/中途島 + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30太平洋/馬克薩斯 + + + UTC-9美国/安克雷奇 + UTC-9美國/安克雷奇 + + + UTC-8美国/道森 + UTC-8美國/道森 + + + UTC-7美国/博伊西 + UTC-7美國/博伊西 + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6美國/巴伊亞州_班德拉斯 + + + UTC-5美国/多伦多 + UTC-5美國/多倫多 + + + UTC-4美国/安圭拉 + UTC-4美國/安圭拉 + + + UTC-3:30美国/圣约翰斯 + UTC-3:30加拿大/紐芬蘭 + + + UTC-3美国/阿拉瓜那 + UTC-3美國/阿拉瓜那 + + + UTC-2美国/诺罗尼亚 + UTC-2美國/諾羅尼亞 + + + UTC-1美国/斯科比斯松 + UTC-1美國/斯科比斯松 + + + UTC+0欧洲/里斯本/伦敦 + UTC+0歐洲/哥倫比亞/倫敦 + + + UTC+1欧洲/阿姆斯特丹 + UTC+1歐洲/阿姆斯特丹 + + + UTC+2亚洲/大马士革 + UTC+2亞洲/大馬士革 + + + UTC+3亚洲/科威特 + UTC+3亞洲/科威特 + + + UTC+3:30亚洲/德黑兰 + UTC+3:30亞洲/德黑蘭 + + + UTC+4印度/毛里求斯 + UTC+4印度/哥倫比亞 + + + UTC+4:30亚洲/喀布尔 + UTC+4:30亞洲/喀布爾 + + + UTC+5印度/马尔代夫 + UTC+5印度/馬爾代夫 + + + UTC+5:30亚洲/科伦坡 + UTC+5:30亞洲/科倫坡 + + + UTC+5:45亚洲/加德满都 + UTC+5:45亞洲/加德滿都 + + + UTC+6印度/查戈斯 + UTC+6印度/查戈斯 + + + UTC+6:30亚洲/仰光 + UTC+6:30亞洲/仰光 + + + UTC+7亚洲/曼谷 + UTC+7亞洲/曼谷 + + + UTC+8亚洲/北京/台北 + UTC+8亞洲/北京/台北 + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45澳大利亞/尤克拉 + + + UTC+9亚洲/首尔/东京 + UTC+9亞洲/首爾/東京 + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30澳大利亞/達爾文 + + + UTC+10澳大利亚/墨尔本 + UTC+10澳大利亞/墨爾本 + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30澳大利亞/領主豪 + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11太平洋/瓜達爾卡納爾島 + + + UTC+12太平洋/奥克兰 + UTC+12太平洋/奧克蘭 + + + UTC+12:45太平洋/查塔姆 + UTC+12:45太平洋/查塔姆 + + + UTC+13太平洋/阿皮亚 + UTC+13湯加/努庫阿洛法 + + + UTC+14太平洋/基里蒂马蒂) + UTC+14太平洋/基里蒂馬蒂 + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + 您確定重新啟動FaceTick嗎? + + + 重新启动 + 重新啟動 + + + 您确定恢复出厂设置吗? + 您確定恢復出廠設置嗎? + + + 恢复 + 恢復 + + + + settingUiFaceMng + + 人脸库(人) + 人臉庫(人) + + + 通行记录(条) + 通行記錄(條) + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + 設備編碼 + + + 软件版本 + 軟體版本 + + + 硬件配置 + 硬件配置 + + + MAC地址 + MAC地址 + + + 设备IP + 設備IP + + + 总容量(GB) + 總容量(GB) + + + 可用容量(GB) + 可用容量(GB) + + + 注册人数 + 註冊人數 + + + 未上传通行记录 + 未上傳通行記錄 + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + 服務器地址: + + + 端口: + 端口: + + + 设置有误,请重新输入! + 設置有誤,請重新輸入! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + 身份核驗 + + + 人脸识别阈值 + 人臉識別閾值 + + + 人脸识别自定义阈值(0-100): + 人臉識別自定義閾值(0-100): + + + 口罩检测 + 口罩檢測 + + + 未戴口罩禁止通行 + 未戴口罩禁止通行 + + + 活体检测 + 活體檢測 + + + 宽松 + 寬鬆 + + + 一般 + 一般 + + + 适中 + 適中 + + + 严格 + 嚴格 + + + 极严格 + 極嚴格 + + + 自定义 + 自定義 + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + 您需要重新啟動設備以設置並切換語言 + + + 重新启动 + 重新啟動 + + + 服务器地址: + 服務器地址: + + + 端口: + 端口: + + + 设置有误,请重新输入! + 設置有誤,請重新輸入! + + + 您确定重新启动FaceTick吗? + 您確定重新啟動FaceTick嗎? + + + 您确定清空数据吗? + 您確定清空數據嗎? + + + 清空数据 + 清空數據 + + + 您确定恢复出厂设置吗? + 您確定恢復出廠設置嗎? + + + 恢复 + 恢復 + + + 设备语言 + 設備語言 + + + 自动重启 + 自動重啟 + + + 自动重启时间 + 自動重啟時間 + + + 自动重启间隔(天) + 自動重啟間隔(天) + + + 手动重启 + 手動重啟 + + + 服务器 + 服務器 + + + 数据清空 + 數據清空 + + + 恢复出厂设置 + 恢復出廠設置 + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_TH.ts b/Linguist/FaceTick_TH.ts new file mode 100644 index 0000000..26db6a4 --- /dev/null +++ b/Linguist/FaceTick_TH.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + หน้ากากผ่าน + + + 未佩戴口罩 + ไม่มีหน้ากาก + + + 请出示个人平安码 + Please show your security code + + + 正在验证... + กำลังตรวจสอบ ... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + กรุณาผ่าน + + + 无效平安码 + Invalid security code + + + 扫码超时 + สแกนรหัสหมดเวลา + + + + MaskWidget_o + + 请出示个人平安码 + Please show your security code + + + 正在验证... + กำลังตรวจสอบ ... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + กรุณาผ่าน + + + 无效平安码 + Invalid security code + + + 扫码超时 + สแกนรหัสหมดเวลา + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + อุณหภูมิ: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + กรุณาผ่าน + + + 禁止通行 + ห้ามเข้า + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + ข้อยกเว้นของเซิร์ฟเวอร์ + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + กรุณาขยับมาใกล้อีก + + + 未经许可人员 + บุคลากรที่ไม่ได้รับอนุญาต + + + 未佩戴口罩 + ไม่มีหน้ากาก + + + 请用本人证件 + กรุณาใช้ ID ของคุณ + + + 请刷卡 + กรุณารูดบัตร + + + 请正视镜头 + กรุณาหันหน้าเข้าหากล้อง + + + 口罩检测通过 + หน้ากากผ่าน + + + 体温: + อุณหภูมิ: + + + 禁止通行时段 + ระยะเวลาที่ไม่ผ่าน + + + 身份证核验失败 + การยืนยัน ID ล้มเหลว + + + 身份核验中 + การตรวจสอบตัวตน + + + 服务器连接异常 + ยกเว้นเซิร์ฟเวอร์ + + + 禁止通行 + ห้ามเข้า + + + 人脸特征更新中... + อัพเดตคุณสมบัติใบหน้า... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + การตรวจสอบตัวตน + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + กรุณาขยับมาใกล้อีก + + + 未经许可人员 + บุคลากรที่ไม่ได้รับอนุญาต + + + 禁止通行 + ห้ามเข้า + + + 未佩戴口罩 + ไม่มีหน้ากาก + + + 口罩检测通过 + หน้ากากผ่าน + + + 体温: + อุณหภูมิ: + + + 请刷卡 + กรุณารูดบัตร + + + 请用本人证件 + กรุณาใช้ ID ของคุณ + + + 请正视镜头 + กรุณาหันหน้าเข้าหากล้อง + + + 禁止通行时段 + ระยะเวลาที่ไม่ผ่าน + + + + recoUiRecognizeTypeBase + + 身份核验中 + การตรวจสอบตัวตน + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + ข้อยกเว้นของเซิร์ฟเวอร์ + + + 身份证核验失败 + การยืนยัน ID ล้มเหลว + + + 请刷脸通行 + กรุณาขยับมาใกล้อีก + + + 未经许可人员 + บุคลากรที่ไม่ได้รับอนุญาต + + + 禁止通行 + ห้ามเข้า + + + 未佩戴口罩 + ไม่มีหน้ากาก + + + 口罩检测通过 + หน้ากากผ่าน + + + 体温: + อุณหภูมิ: + + + 请刷卡 + กรุณารูดบัตร + + + 请用本人证件 + กรุณาใช้ ID ของคุณ + + + 请正视镜头 + กรุณาหันหน้าเข้าหากล้อง + + + 禁止通行时段 + ระยะเวลาที่ไม่ผ่าน + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/FaceTick_TR.ts b/Linguist/FaceTick_TR.ts new file mode 100644 index 0000000..c45d0ad --- /dev/null +++ b/Linguist/FaceTick_TR.ts @@ -0,0 +1,3071 @@ + + + + + AccessRecordPage + + 未搜索到相关通行记录 + No relevant pass records were found + + + 通行时间: + Passing Time: + + + 通过 + Allow + + + 不通过 + Prohibit + + + + AddPersonPage + + 确定 + OK + + + 确认添加 + + + + 确定新增人员? + + + + 请补全*信息! + + + + 注册失败,已达到最大注册人数! + + + + IC卡号重复! + + + + 注册人员失败,请重新抓拍! + + + + 身份证号已存在! + + + + 注册人员失败! + + + + + CalendarDialog + + 确定 + OK + + + + ComSelectDialog + + 确定 + OK + + + + CustomDialog + + 取消 + Cancel + + + + DateTimeDialog + + 确定 + OK + + + 点击对应时间项设置 + Time Setting + + + + FaceDbPage + + 未搜索到相关人员 + No relevant personnel found + + + 有效期: + Valid: + + + 注册时间: + Registration Time: + + + 有效期:永久有效 + Valid:Permanent + + + + InfoDialog + + 知道了 + OK + + + + IpInputBar + + 请指定一个介于1和223之间的值 + + + + 请指定一个介于0和255之间的值 + + + + + IpInputBarDialog + + 确定 + OK + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + + IpInputDialog + + 确定 + OK + + + + ItemChooseDialog + + 确定 + OK + + + + LineEditInputDialog + + 确定 + OK + + + + MaskWidget + + 口罩检测通过 + Geçiş için maskeyi algıla + + + 未佩戴口罩 + Maske yok + + + 请出示个人平安码 + Lütfen kişisel güvenlik kodunuzu gösterin + + + 正在验证... + Doğrulanıyor... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Lütfen geç + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + MaskWidget_o + + 请出示个人平安码 + Lütfen kişisel güvenlik kodunuzu gösterin + + + 正在验证... + Doğrulanıyor... + + + 验证错误请重试 + Verification error, please try again + + + 请走人工通道 + Please take the artificial channel + + + 请通行 + Lütfen geç + + + 无效平安码 + Invalid security code + + + 扫码超时 + Scan code timeout + + + + ModifyPersonPage + + 确定 + OK + + + 删除人员 + + + + 确定更改人员信息? + + + + 请补全*信息! + + + + 无效的姓名! + + + + IC卡号重复! + + + + 身份证号已存在! + + + + 更改人员信息失败,人员或已被删除! + + + + 确定删除改人员? + + + + + PasswordDialog + + 确定 + OK + + + 取消 + Cancel + + + 恢复出厂 + Restore Factory + + + 工程密码 + Password + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + PersonMsgUiPage + + 请输入人员姓名 + Please enter the name of the person + + + 请选择通行时间 + Please select a passing time + + + + QObject + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设置有误,请重新输入! + 由于之前多次密码验证 +错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 知道了 + OK + + + 由于之前多次密码验证错误,请稍等一会重试! + Multiple password verification errors, please wait a while and try again! + + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 有线网络 + Wired Network + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 永不 + Never + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting + + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100) + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 请指定一个介于0和255之间的值 + + + + + QuestionDialog + + 确定 + OK + + + + RadioBtnChooseDialog + + 确定 + OK + + + + RegisterPersonPage + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 永久授权 + + + + 非永久授权 + + + + *姓名 + + + + *授权截至日期 + + + + 工号 + + + + 手机号 + + + + 身份证号 + + + + IC卡/NFC + + + + + SceneMsgWidget + + 今日检票: + + + + 今日通行: + + + + 人 + + + + + SettingUiQrcode + + 请将配置二维码对准扫码框 + + + + + SetupUiConfig + + 手动配置 + Manual + + + 配置方式 + + + + 二维码配置 + + + + 跳过 + + + + + SetupUiPrivacyDoc + + 这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档 + + + + + SetupUiProtoDoc + + 这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档 + + + + + SetupUiStart + + 请仔细阅读以下内容 + + + + 《XXXX协议》 + + + + 《XX隐私声明》 + + + + 我已阅读并同意以上协议 + + + + 开始使用 + + + + + SliderDialog + + 确定 + OK + + + + SnapFacePage + + 拍照 + + + + 抓拍人脸中,请稍候... + + + + 抓拍人脸失败,请重拍! + + + + + SplashScreenWithMsg + + 人脸识别终端 + Face Tick + + + + StyleItemChooseDialog + + 确定 + OK + + + 取消 + Cancel + + + + TmprWidget + + 体温: + Ateş: + + + + UserPwdDialog + + 请输入您的密码 + + + + 确认 + + + + 删除 + + + + 清空 + + + + 返回 + + + + + WifiAccPointDialog + + 名称 + Name + + + 密码 + Password + + + 加入 + Join + + + 加密方式 + Encryption + + + + keyboard + + can't load + can't load + + + + mainUi + + 由于之前多次密码验证错误,请稍后再重试! + 由于之前多次密码验证错误, +请稍后再重试! + Multiple password verification errors, + please wait a while and try again! + + + 知道了 + OK + + + 设备编码: + Equipment Number: + + + 请输入密码 + Please Enter Password + + + 当前管理员账号:admin + Account: + + + 密码错误,请重试 + Wrong Password + + + 确定 + OK + + + 取消 + Cancel + + + admin + + + + 设备设置页面已被禁用! + + + + 正在加载测试页面,请稍候... + + + + 检测到强拆设备 + + + + 解除锁定 + + + + + recoUiCallConsole + + 取消 + Cancel + + + 结束通话 + + + + 重拨 + + + + 启用摄像头 + + + + 接听 + + + + 拒绝 + + + + 呼叫中 ... + + + + 对方长时间未接听 + + + + 禁用摄像头 + + + + + recoUiCallDial + + 呼叫 + + + + -离线 + + + + + recoUiHealthCodePage + + 请通行 + Lütfen geç + + + 禁止通行 + Geçiş yok + + + 健康码智能核验系统 + + + + 体温: + + + + 姓名: + + + + 身份证: + + + + 核酸检测 + + + + 新冠疫苗 + + + + 绿码 + + + + 黄码 + + + + 红码 + + + + 暂无数据 + + + + CA数字哨兵 + + + + 抗原检测 + + + + 智能防疫核验系统 + + + + + recoUiPassword + + 欢迎光临 + + + + 确认 + + + + 密码错误 + + + + + recoUiRecognize + + 服务器异常 + Sunucu istisnası + + + 请调整人脸角度 + Adjust the face angle + + + 请刷脸通行 + Geçiş için yüz algıla + + + 未经许可人员 + Yetkisiz personel + + + 未佩戴口罩 + Maske yok + + + 请用本人证件 + Lütfen kimliğinizi kullanın + + + 请刷卡 + Lütfen kartı kaydırın + + + 请正视镜头 + Lütfen yüzünüzü kameraya dönün + + + 口罩检测通过 + Geçiş için maskeyi algıla + + + 体温: + Ateş: + + + 禁止通行时段 + Geçmeyen dönem + + + 身份证核验失败 + Kimlik doğrulanamadı + + + 身份核验中 + Kimlik doğrulaması ilerliyor + + + 服务器连接异常 + Sunucu istisnası + + + 禁止通行 + Geçiş yok + + + 人脸特征更新中... + Özellikler güncelleniyor... + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiRecognizeScene + + 身份核验中 + Kimlik doğrulaması ilerliyor + + + 请调整人脸角度 + Adjust the face angle + + + 请刷二维码 + + + + 请刷身份证 + + + + 请测试静电 + + + + 请刷身份证或扫码 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 请刷脸通行 + Geçiş için yüz algıla + + + 未经许可人员 + Yetkisiz personel + + + 禁止通行 + Geçiş yok + + + 未佩戴口罩 + Maske yok + + + 口罩检测通过 + Geçiş için maskeyi algıla + + + 体温: + Ateş: + + + 请刷卡 + Lütfen kartı kaydırın + + + 请用本人证件 + Lütfen kimliğinizi kullanın + + + 请正视镜头 + Lütfen yüzünüzü kameraya dönün + + + 禁止通行时段 + Geçmeyen dönem + + + + recoUiRecognizeTypeBase + + 身份核验中 + Kimlik doğrulaması ilerliyor + + + 请调整人脸角度 + Adjust the face angle + + + 服务器异常 + Sunucu istisnası + + + 身份证核验失败 + Kimlik doğrulanamadı + + + 请刷脸通行 + Geçiş için yüz algıla + + + 未经许可人员 + Yetkisiz personel + + + 禁止通行 + Geçiş yok + + + 未佩戴口罩 + Maske yok + + + 口罩检测通过 + Geçiş için maskeyi algıla + + + 体温: + Ateş: + + + 请刷卡 + Lütfen kartı kaydırın + + + 请用本人证件 + Lütfen kimliğinizi kullanın + + + 请正视镜头 + Lütfen yüzünüzü kameraya dönün + + + 禁止通行时段 + Geçmeyen dönem + + + 呼叫设备 + + + + 呼叫管理处 + + + + 服务器连接失败 + + + + 请在此处刷卡 + + + + 请刷二维码 + + + + 未授权卡片 + + + + 请刷身份证 + + + + 请测试静电 + + + + 静电测试异常 + + + + 请刷身份证或扫码 + + + + 健康码查询中 + + + + 查询失败 + + + + 二维码已过期 + + + + 网络异常 + + + + 服务器请求超时 + + + + 请刷行程卡 + + + + 请扫健康码 + + + + 请重刷行程卡 + + + + 刷身份证扫行程卡 + + + + 行程卡查询中 + + + + 请扫粤居码 + + + + 请刷粤居码/身份证 + + + + 巡更成功 + + + + 非巡更时段 + + + + 请摘下口罩 + + + + + recoUiSceneResult + + 请通行 +Pass through + + + + 禁止通行 +No Passing + + + + + recoUiUnauthorized + + 软件未授权 + Unauthorized + + + 请联系平台管理员 + Please contact the platform administrator + + + 重新检测授权状态 + Recheck authorization status + + + 进入系统设置 + Enter system settings + + + 瑞为技术 +RECONOVA + RECONOVA + + + + settingUi + + 操作 + Menu + + + 信息查看 + Information + + + 设备管理 + Equipment + + + 人员管理 + 人脸管理 + Face + + + 门禁管理 + Access Control + + + 识别设置 + AI + + + 系统管理 + System + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 无线网络接入 + WLAN access + + + 4G网络 + 4G + + + 人员库 + 人脸库 + Face Library + + + 通行记录 + Pass Record + + + 添加人员 + + + + 保存 + + + + 人脸管理 + Face + + + 快速配置 + + + + 设备检测 + + + + 蓝牙 + + + + 蓝牙音箱 + + + + 已配对蓝牙设置 + + + + 蓝牙门锁 + + + + 蓝牙门锁操作 + + + + 人脸库 + Face Library + + + 编辑人员 + + + + 拍照 + + + + 设备信息 + + + + + settingUiAccMng + + 本地继电器已使用 + Relay is used + + + 禁用 + Disable + + + 本地继电器 + KZ-OUT + + + 韦根26 + WG 26 + + + 韦根34 + WG 34 + + + 韦根42 + WG 42 + + + 开锁延迟(秒) + Unlock delay(s) + + + 开锁时间(秒) + Unlock Time(s) + + + 开锁信号 + Unlock signal + + + 告警信号 + Warning signal + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 反向通行 + + + + RS485 + + + + RS485协议1设备地址(0-255) + + + + 静电测试范围 + + + + GPIO4接口 + + + + GPIO5接口 + + + + 门超时报警(秒) + + + + 防拆报警 + + + + 防拆报警信号 + + + + (未设置) + + + + 请注意设置RS485协议1设备地址 + + + + GPIO4已设置为防拆报警输出,请重新设置! + + + + GPIO5已设置为门磁,请重新设置! + + + + GPIO5已设置为消防信号,请重新设置! + + + + GPIO5已设置为防拆报警输出,请重新设置! + + + + GPIO4已设置为门磁,请重新设置! + + + + GPIO4已设置为消防信号,请重新设置! + + + + 本地继电器已被使用,请重新设置! + + + + GPIO4已设置为信号输入,请重新设置! + + + + GPIO5已设置为信号输入,请重新设置! + + + + 手部 + + + + 脚部 + + + + 不检测 + + + + 协议1 + + + + 协议2 + + + + 协议3 + + + + 门磁 + + + + 消防信号 + + + + 无 + + + + GPIO4 + + + + GPIO5 + + + + + settingUiDevMng + + 永不 + Never + + + 设置为0时永不进入待机 + No standby when set to 0 + + + 设置为0时永不进入熄屏 + Do not turn off the screen when set to 0 + + + 界面显示IP + Display IP + + + 音量控制 + Volume + + + 亮度控制 + Brightness + + + 进入屏保时间(秒) + Enter Screen + + + 熄屏等待时间(秒) + Off Screen + + + 时间设置 + Time Setting + + + 网络设置 + Network + + + 界面显示ID及版本号 + + + + 蓝牙 + + + + 动态底库 + + + + 通行密码 + + + + 禁用工程页面 + + + + (未设置) + + + + 已开启 + + + + 已关闭 + + + + 打开此开关后,设备将无法进入工程页面, +是否确认打开? + + + + 密码为4-10位数字,设置有误,请重新输入! + + + + 平台下发的通行密码,如需修改请前往平台操作 + + + + + settingUiDevMngBt + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + 蓝牙音箱 + + + + 蓝牙门锁 + + + + + settingUiDevMngBtLock + + 启用 + Enable + + + 处理中,请稍候... + Processing, please wait... + + + MAC地址 + MAC + + + 添加蓝牙门锁 + + + + 厂商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址重复,请检查! + + + + + settingUiDevMngBtLockAccPoint + + MAC地址 + MAC + + + 门锁信息 + + + + 电量(0-100) + + + + 删除门锁 + + + + 产商名称 + + + + 房间名 + + + + 房间名不能为空! + + + + 房间名请控制在32个字符以内! + + + + mac地址与 + + + + 重复,请检查! + + + + 您确定要删除此门锁吗? + + + + 删除 + + + + 电量获取中,请稍候... + + + + (未知) + + + + + settingUiDevMngBtSpk + + 搜索中,请稍候... + Searching, please wait... + + + 处理中,请稍候... + Processing, please wait... + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 确定 + OK + + + 设备名称 + + + + 已配对设备 + + + + 可用设备 + + + + 此操作将会断开您与以下设备的连接:<br> + + + + 要与以下设备连接:<br> + + + + 连接 + + + + 蓝牙连接失败,请重试! + + + + 要与以下设备配对:<br> + + + + 配对 + + + + 蓝牙配对失败,请重试! + + + + + settingUiDevMngBtSpkAccPoint + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + 重命名 + + + + 取消配对 + + + + 您确定要取消此设备的配对 + + + + + settingUiDevMngNet4G + + 获取4G网络配置失败,请重试! + Failed to get 4G, please try again! + + + 您确定要禁用4G网络吗? + Are you sure to disable 4G? + + + 您确定要启用4G网络吗? + Are you sure to enable 4G? + + + 处理中,请稍候... + Processing, please wait... + + + 设置4G网络失败,请重试! + Failed to set 4G, please try again! + + + 您确定要重启4G网络吗? + Are you sure you want to restart 4G? + + + 重启成功! + Successful restart! + + + 重启4G网络失败,请重试! + Failed to restart 4G, please try again! + + + 启用 + Enable + + + SIM卡信息 + SIM + + + 重启4G网络 + Reboot + + + 未插卡 + No SIM + + + 中国移动 + China Mobile + + + 中国电信 + China Telecom + + + 中国联通 + China Unicom + + + 4G启动中... + 4G Starting... + + + + settingUiDevMngNetWifi + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + 搜索中,请稍候... + Searching, please wait... + + + 您确定要禁用无线网络吗? + Are you sure to disable WLAN? + + + 您确定要启用无线网络吗? + Are you sure to enable WLAN? + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 请输入密码 + Please Enter Password + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 连接成功! + Connection Succeeded! + + + 启用 + Enable + + + 其它网络 + Other + + + 重新搜索 + Search Again + + + AP模式 + + + + 热点密码 + + + + 您确定要关闭AP模式吗? + + + + 您确定要启用AP模式吗? + + + + 密码长度为8-16位字符! + + + + 设置成功! + + + + 设置失败,请重试! + + + + + settingUiDevMngNetWifiAccPoint + + 获取无线网络配置失败,请重试! + Failed to get wlan, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置无线网络失败,请重试! + Failed to set wlan, please try again! + + + 无线网络连接成功,是否禁用有线网络? + The wlan connection is successful, is the wired network disabled? + + + 禁用有线网络失败,请重试! + Failed to disable wired network, please try again! + + + 连接无线网络失败,请重试! + Failed to connect to the wlan, please try again! + + + 您确定要忽略此网络吗? + Are you sure you want to ignore this network? + + + 您确定要关闭自动获取吗? + Are you sure you want to turn off automatic acquisition? + + + 您确定要打开自动获取吗? + Are you sure you want to turn on automatic acquisition? + + + 连接此网络 + Connection + + + 忽略此网络 + Ignore + + + 自动获取 + Automatic Acquisition + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + + settingUiDevMngNetWire + + 获取有线网络配置失败,请重试! + Failed to obtain wired network configuration, please try again! + + + IP设置不能为空! + IP cannot be empty! + + + 子网掩码设置不能为空! + The subnet mask cannot be empty! + + + IP设置有误! + The IP setting is wrong! + + + 子网掩码设置有误! + The subnet mask is wrong! + + + 网关设置有误! + Wrong gateway! + + + DNS设置有误! + DNS settings are wrong! + + + 处理中,请稍候... + Processing, please wait... + + + 设置有线网络失败,请重试! + Failed to set up wired network, please try again! + + + 您确定要禁用有线网络吗? + Are you sure you want to disable the wired network? + + + 您确定要启用有线网络吗? + Are you sure you want to enable the wired network? + + + 您确定要禁用DHCP吗? + Are you sure you want to disable DHCP? + + + 您确定要启用DHCP吗? + Are you sure you want to enable DHCP? + + + 启用 + Enable + + + DHCP + DHCP + + + 手动配置 + Manual + + + 设备IP + Device IP + + + 子网掩码 + Subnet Mask + + + 设备网关 + Device Gateway + + + DNS服务器 + DNS Server + + + 启用有线网络 + + + + + settingUiDevMngNetwork + + 获取4G网络配置失败,请重试! + Failed to obtain 4G, please try again! + + + 有线网络 + Wired Network + + + 无线网络 + WLAN + + + 4G网络 + 4G + + + + settingUiDevMngTime + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 处理中,请稍候... + Processing, please wait... + + + NTP校时失败,请检查! + NTP time calibration failed, please check! + + + NTP获取时间 + NTP get time + + + NTP服务器 + NTP Server + + + 校时间隔(小时) + Time Interval + + + 时区 + Time Zone + + + 手动设置 + Manual + + + UTC-11太平洋/中途岛 + UTC-11Pacific / Midway + + + UTC-9:30太平洋/马克萨斯 + UTC-9:30Pacific / Maxas + + + UTC-9美国/安克雷奇 + UTC-9USA / Anchorage + + + UTC-8美国/道森 + UTC-8USA / Dawson + + + UTC-7美国/博伊西 + UTC-7USA / Boise + + + UTC-6美国/巴伊亚州_班德拉斯 + UTC-6United States / Bahia_Banderas + + + UTC-5美国/多伦多 + UTC-5USA / Toronto + + + UTC-4美国/安圭拉 + UTC-4United States / Anguilla + + + UTC-3:30美国/圣约翰斯 + UTC-3:30Canada / Newfoundland Island + + + UTC-3美国/阿拉瓜那 + UTC-3United States / Alaguana + + + UTC-2美国/诺罗尼亚 + UTC-2US / Noronha + + + UTC-1美国/斯科比斯松 + UTC-1USA / Skobisson + + + UTC+0欧洲/里斯本/伦敦 + UTC+0Europe / Lisbon / London + + + UTC+1欧洲/阿姆斯特丹 + UTC+1Europe / Amsterdam + + + UTC+2亚洲/大马士革 + UTC+2Asia / Damascus + + + UTC+3亚洲/科威特 + UTC+3Asia / Kuwait + + + UTC+3:30亚洲/德黑兰 + UTC+3:30Asia / Tehran + + + UTC+4印度/毛里求斯 + UTC+4India / Mauritius + + + UTC+4:30亚洲/喀布尔 + UTC+4:30Asia / Kabul + + + UTC+5印度/马尔代夫 + UTC+5India / Maldives + + + UTC+5:30亚洲/科伦坡 + UTC+5:30Asia / Colombo + + + UTC+5:45亚洲/加德满都 + UTC+5:45Asia / Kathmandu + + + UTC+6印度/查戈斯 + UTC+6India / Chagos + + + UTC+6:30亚洲/仰光 + UTC+6:30Asia / Yangon + + + UTC+7亚洲/曼谷 + UTC+7Asia / Bangkok + + + UTC+8亚洲/北京/台北 + UTC+8Asia / Beijing/Taipei + + + UTC+8:45澳大利亚/尤克拉 + UTC+8:45Australia / Ukra + + + UTC+9亚洲/首尔/东京 + UTC+9Asia / Seoul / Tokyo + + + UTC+9:30澳大利亚/达尔文 + UTC+9:30Australia / Darwin + + + UTC+10澳大利亚/墨尔本 + UTC+10Melbourne, Australia + + + UTC+10:30澳大利亚/领主豪 + UTC+10:30Australian / lord + + + UTC+11太平洋/瓜达尔卡纳尔岛 + UTC+11Pacific / Guadalcanal + + + UTC+12太平洋/奥克兰 + UTC+12Pacific / Auckland + + + UTC+12:45太平洋/查塔姆 + UTC+12:45Pacific / Chatham + + + UTC+13太平洋/阿皮亚 + UTC+13Tonga/ Nuku'alofa + + + UTC+14太平洋/基里蒂马蒂) + UTC+14Pacific / Kiritimati + + + + settingUiDevTest + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 重新启动 + Restart + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + + settingUiFaceMng + + 人脸库(人) + Face Library(people) + + + 通行记录(条) + Pass Record + + + + settingUiFastCfgPark + + 下一步 + + + + + settingUiFastCfgWireNet + + 下一步 + + + + + settingUiInfo + + 设备编码 + Number + + + 软件版本 + Software Version + + + 硬件配置 + Configuration + + + MAC地址 + MAC + + + 设备IP + Device IP + + + 总容量(GB) + Storage Capacity(GB) + + + 可用容量(GB) + Available Storage(GB) + + + 注册人数 + Registered Number + + + 未上传通行记录 + Pass record not uploaded + + + 屏下NFC ID + + + + 拓展NFC ID + + + + + settingUiPark + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 设备位置 + + + + (未设置) + + + + 园区信息不能为空 + + + + 园区信息不能超过32个字符 + + + + 设备位置不能超过32个字符 + + + + + settingUiRecoSet + + 身份核验 + Identity Verification + + + 人脸识别阈值 + Face Recognition Threshold + + + 人脸识别自定义阈值(0-100): + Customize(0-100): + + + 口罩检测 + Mask Test + + + 未戴口罩禁止通行 + No pass without a mask + + + 活体检测 + Live Detection + + + 宽松 + Loose + + + 一般 + General + + + 适中 + Moderate + + + 严格 + Strict + + + 极严格 + Extremely strict + + + 自定义 + Customize + + + 居民二代身份证 + + + + 健康码核验 + + + + 允许无人脸核验 + + + + 允许陌生人通行 + + + + 核验通行条件 + + + + + settingUiSysMng + + 您需要重新启动设备以设置并切换语言 + You need to restart the device to set the language + + + 重新启动 + Restart + + + 服务器地址: + server address: + + + 端口: + port: + + + 设置有误,请重新输入! + The setting is wrong, please re-enter! + + + 您确定重新启动FaceTick吗? + Are you sure to restart? + + + 您确定清空数据吗? + Are you sure to clear the data? + + + 清空数据 + Clear data + + + 您确定恢复出厂设置吗? + Are you sure to restore factory settings? + + + 恢复 + Restore + + + 设备语言 + Language + + + 自动重启 + Automatic Restart + + + 自动重启时间 + Automatic Restart Time + + + 自动重启间隔(天) + Automatic Restart Tnterval(day) + + + 手动重启 + Restart + + + 服务器 + Server + + + 数据清空 + Data Clear + + + 恢复出厂设置 + Reset + + + 数据加密 + + + + 您确定要开启数据加密吗?若确定设备将重启! + + + + 您确定要关闭数据加密吗?若确定设备将重启! + + + + diff --git a/Linguist/facetick.pro b/Linguist/facetick.pro new file mode 100644 index 0000000..ee6f646 --- /dev/null +++ b/Linguist/facetick.pro @@ -0,0 +1,123 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2020-09-14T10:46:41 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = facetick +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +CONFIG += c++11 + +SOURCES += \ + keyboard/keyboard.cpp \ + keyboard/LineEditWithKeyboard.cpp \ + keyboard/LineEditWithPopup.cpp \ + interface/View.cpp \ + interface/BackstageInterfaceForUi.cpp \ + interface/BackStage.cpp \ + recoUi/recoUiRecognize.cpp \ + recoUi/recoUiCallConsole.cpp \ + recoUi/recoUiRecognizeScene.cpp \ + recoUi/recoUiUnauthorized.cpp \ + recoUi/recoUiCallDial.cpp \ + recoUi/recoUiRecognizeTypeBase.cpp \ + recoUi/recoUiPassword.cpp \ + recoUi/recoUiHealthCode.cpp \ + recoUi/recoUi.cpp \ + recoUi/recoUiScreensaver.cpp \ + setupUi/SetupUi.cpp \ + setUi/settingUiFastCfg.cpp \ + setUi/settingUiSysMng.cpp \ + setUi/settingUiInfo.cpp \ + setUi/settingUiAccMng.cpp \ + setUi/settingUIProjectSet.cpp \ + setUi/settingUiFaceMng.cpp \ + setUi/settingUi.cpp \ + setUi/settingUiDevMng.cpp \ + setUi/settingUiRecoSet.cpp \ + setUi/settingUiDevTest.cpp \ + utility/DndModeCountDownItem.cpp \ + utility/SwitchControl.cpp \ + utility/UiTools.cpp \ + mainUi/UiConfig.cpp \ + mainUi/mainUi.cpp + + +HEADERS += \ + keyboard/LineEditWithKeyboard.h \ + keyboard/keyboard.h \ + keyboard/LineEditWithPopup.h \ + interface/BackStage.h \ + interface/View.h \ + interface/BackstageInterfaceForUi.h \ + interface/UiInterfaceForBackstage.h \ + recoUi/recoUiHealthCode.h \ + recoUi/recoUiCallDial.h \ + recoUi/recoUiCallConsole.h \ + recoUi/recoUiPassword.h \ + recoUi/recoUiRecognizeScene.h \ + recoUi/recoUiRecognize.h \ + recoUi/recoUiScreensaver.h \ + recoUi/recoUiUnauthorized.h \ + recoUi/recoUiRecognizeTypeBase.h \ + recoUi/recoUi.h \ + setupUi/SetupUi.h \ + setUi/settingUiDevTest.h \ + setUi/settingUiAccMng.h \ + setUi/settingUIProjectSet.h \ + setUi/settingUiFastCfg.h \ + setUi/settingUi.h \ + setUi/settingUiRecoSet.h \ + setUi/settingUiDevMng.h \ + setUi/settingUiSysMng.h \ + setUi/settingUiInfo.h \ + setUi/settingUiFaceMng.h \ + utility/AsyncEvent.h \ + utility/SwitchControl.h \ + utility/DndModeCountDownItem.h \ + utility/UiTools.h \ + mainUi/debug.h \ + mainUi/UiConfig.h \ + mainUi/UiCommon.h \ + mainUi/mainUi.h + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +RESOURCES += \ + res.qrc + +CONFIG += C++11 +#CONFIG += console pro + +TRANSLATIONS += FaceTick_TC.ts +TRANSLATIONS += FaceTick_EN.ts +TRANSLATIONS += FaceTick_JP.ts +TRANSLATIONS += FaceTick_KR.ts +TRANSLATIONS += FaceTick_SP.ts +TRANSLATIONS += FaceTick_TH.ts +TRANSLATIONS += FaceTick_PT.ts +TRANSLATIONS += FaceTick_IT.ts +TRANSLATIONS += FaceTick_FR.ts +TRANSLATIONS += FaceTick_IW.ts +TRANSLATIONS += FaceTick_DE.ts +TRANSLATIONS += FaceTick_TR.ts +TRANSLATIONS += FaceTick_HU.ts diff --git a/Linguist/interface/BackStage.cpp b/Linguist/interface/BackStage.cpp new file mode 100644 index 0000000..8cf1120 --- /dev/null +++ b/Linguist/interface/BackStage.cpp @@ -0,0 +1,3669 @@ +#include +#include +#include +#include "webrtc/WebRTCVideoChat.h" +#include +#include +#include +#include + + +#include "rw_zlog.h" +#include "common_utils.h" +#include "assert.h" +#include "cmd_process.h" +#include "db_manage.h" +#include "BackStage.h" +#include "file_utils.h" +#include "rw_protocol.h" +#include "detector/detector_tracker.h" +#include "decision_actuator/standby.h" +#include "dev_version.h" +#include "libcJSON.h" +#include "ScopeGuard.h" +#include "Peripheral.h" +#include "cmd_process.h" +#include "pe_input/pe_input.h" +#include "decision_center/decision_center.h" +#include "tracker_lock/tracker_lock.h" +#include "camera/camera.h" +#include "UiConfig.h" +#include "bluetooth.h" +#include "View.h" +#include "person_manage.h" + +#include "CardReaderProp.h" +#include "decision_actuator/decision_actuator.h" + + +Backstage::Backstage(void* pParaMng, void* pObjs) +{ + m_paramMng = reinterpret_cast(pParaMng); + m_objs = reinterpret_cast(pObjs); +} + +Backstage::~Backstage() +{ +} + +int Backstage::registerPerson(char *name, char *term, int nDataOrigin) +{ + if ((name == nullptr) || (term == nullptr)) + { + LOGE("param error!name==%p, term===%p", name, term); + return -1; + } + + return 0; +} + +int Backstage::startIdentyState(bool setfaceReco, bool setPeInput) +{ + LOGI("startIdentyState"); + if(setfaceReco && m_objs){ + GDetectorTracker *tracker = (GDetectorTracker*)m_objs->findObject("DetectorTracker"); + GStandby *pStandby = (GStandby*)m_objs->findObject("standby"); + GTrackerLock *pTrackLock = (GTrackerLock*)m_objs->findObject("trackerLock"); + if (tracker && pStandby && pTrackLock){ + if(!Singleton::GetInstance()->isHardwareTesting()){ + tracker->setRgbFaceDetMode(false); + pStandby->setKeepAwake(false); + } + else{ + LOGI("is testing hardware..."); + tracker->setRgbFaceDetMode(true); + pStandby->setKeepAwake(true); + } + pTrackLock->lockCtrl(false); + } + } + if(setPeInput){ + Singleton::GetInstance()->enableUserInput(Peripheral::enOptorMid, false, true); + } + return 0; +} + +int Backstage::stopIdentyState(bool setfaceReco, bool setPeInput) +{ + LOGI("stopIdentyState"); + if(setfaceReco && m_objs){ + GDetectorTracker *tracker = (GDetectorTracker*)m_objs->findObject("DetectorTracker"); + GStandby *pStandby = (GStandby*)m_objs->findObject("standby"); + GTrackerLock *pTrackLock = (GTrackerLock*)m_objs->findObject("trackerLock"); + if (tracker && pStandby && pTrackLock){ + tracker->setRgbFaceDetMode(false, true); + pStandby->setKeepAwake(true); + pTrackLock->lockCtrl(true); + } + } + if(setPeInput){ + Singleton::GetInstance()->enableUserInput(Peripheral::enOptorMid, true, false); + } + return 0; +} + +int Backstage::verifyFactorySettingPwd(const char *pwd) +{ + int ret = -1; + if(nullptr == pwd) + { + LOGE("param pwd is NULL!"); + return -1; + } + if (FileUtils::fileIsExist(PASSWORD_FILE)) + { + ifstream infile; + infile.open(PASSWORD_FILE); + if(infile.is_open()){ + //std::string s; + //while(getline(infile,s)) { + //cout<clearParam(); + FileUtils::removeFile(AGEING_TIME_FILE); + FileUtils::removeFile(DB_PATH"faceGate.db"); + FileUtils::removeFile(NETWORK_CFG_FILE); + FileUtils::remove_dir(MEETING_DIR); + FileUtils::remove_dir(TTS_PERSISTENCE_DIR); + + //devReboot(); //need black page before reboot + + return resetNetworkCfg(); +} + +int Backstage::getDeviceId(char *devId, int len)// 获取设备id +{ + int ret = -1; + constexpr auto macFile = "/data/.mac"; + memset(devId, 0, len); + if (FileUtils::fileIsExist(macFile) && FileUtils::getFileSize(macFile) > 0) { + const std::string sDevId = getDevId(); + LOGD("sDevId=%s", sDevId.c_str()); + if (sDevId.length() < (unsigned)len) { + strcpy(devId, sDevId.c_str()); + ret = 0; + } + } + return ret; +} + +std::string Backstage::getUnderScreenNfcModuleId(){ + CardReaderProp prop(CARD_READER_PROP_FILE); + return prop.UnderScreenCardReaderModuleId(); +} + +std::string Backstage::getExtendNfcModuleId(){ + CardReaderProp prop(CARD_READER_PROP_FILE); + return prop.ExtendUsbCardReaderModuleId(); +} + +bool Backstage::isIdModuleInfoUploaded(){ + LOGI("isIdModuleInfoUploaded"); + return FileUtils::fileIsExist("/tmp/.idModuleInfoUpload2Iot"); +} + +bool Backstage::isDevSettingDisable() +{ + return m_paramMng->getDisableDevSettingSw(); +} + +void Backstage::setAntiDemolitionAvail(bool avail, bool upload) +{ + m_paramMng->setAntiDemolitionAvail(avail); + + static int outputType = 0; + if(avail){ + outputType = getAntiDemolitionOutput(); + if(1 == outputType){ + GDecisionActuator::relayOnCB(2); + }else if(2 == outputType){ + Singleton::GetInstance()->controlGpioOut(BasePeripheral::enGpio2, false); + }else if(3 == outputType){ + Singleton::GetInstance()->controlGpioOut(BasePeripheral::enGpio3, false); + } + + if(upload){ + RWProtocol::getInstance()->addAlarmEvent(2, utils::getNowTimeS(), ""); + } + }else if(outputType){ + if(1 == outputType){ + GDecisionActuator::relayOnCB(3); + }else if(2 == outputType){ + Singleton::GetInstance()->controlGpioOut(BasePeripheral::enGpio2, true); + }else if(3 == outputType){ + Singleton::GetInstance()->controlGpioOut(BasePeripheral::enGpio3, true); + } + } +} + +bool Backstage::getAntiDemolitionSw() +{ + return m_paramMng->getAntiDemolitionSw(); +} + +void Backstage::setAntiDemolitionSw(bool sw) +{ + m_paramMng->setAntiDemolitionSw(sw); +} + +int Backstage::getAntiDemolitionOutput() +{ + return m_paramMng->getAntiDemolitionOutput(); +} + +void Backstage::setAntiDemolitionOutput(int output) +{ + m_paramMng->setAntiDemolitionOutput(output); +} + +int Backstage::getGpio4Cfg() +{ + return m_paramMng->getGpio4Cfg(); +} + +void Backstage::setGpio4Cfg(int cfg) +{ + m_paramMng->setGpio4Cfg(cfg); +} + +int Backstage::getGpio5Cfg() +{ + return m_paramMng->getGpio5Cfg(); +} + +void Backstage::setGpio5Cfg(int cfg) +{ + m_paramMng->setGpio5Cfg(cfg); +} + +int Backstage::getDoorCloseOvertime() +{ + return m_paramMng->getDoorCloseOvertime(); +} + +void Backstage::setDoorCloseOvertime(int overtime) +{ + m_paramMng->setDoorCloseOvertime(overtime); +} + +bool Backstage::getDisableDevSettingSw() +{ + return m_paramMng->getDisableDevSettingSw(); +} + +void Backstage::setDisableDevSettingSw(bool sw) +{ + m_paramMng->setDisableDevSettingSw(sw); +} + +int Backstage::getTicketCheckCountToday() +{ + const std::string curDay = utils::format_time(time(nullptr)).substr(0, 10); + const std::string cntDay = RWProtocol::getInstance()->m_paramMng->getTicketCheckDay(); + if(curDay != cntDay){ + return 0; + } + return m_paramMng->getTicketCheckCount(); +} + +int Backstage::getTicketModePeopleCountType() +{ + return m_paramMng->getTicketModePeopleCountType(); +} + +int Backstage::getCallDevList() { + WebRTCVideoChat::instance()->requestContacts(); + return 0; +} + +int Backstage::queryCallDevList(const std::string &text, std::vector &devList) { + devList.clear(); + auto contacts = WebRTCVideoChat::instance()->contactsSearch(text); + for (auto &contact : contacts) { + stCallDev info; + info.code = contact.code; + info.devTag = contact.uniqueTag; + info.name = contact.name; + info.type = contact.type; + info.status = contact.status; + devList.push_back(info); + } + return 0; +} + +int Backstage::callDev(const std::string &devTag, int devType) { + WebRTCVideoChat::instance()->callRemote(devType == 2 ? WebRTCVideoChat::Platform : WebRTCVideoChat::Device, devTag); + return 0; +} + +int Backstage::callAbort() { + WebRTCVideoChat::instance()->setCurrentSessionAction(WebRTCVideoChat::Action::Cancel); + return 0; +} + +int Backstage::callHangUp() { + WebRTCVideoChat::instance()->setCurrentSessionAction(WebRTCVideoChat::Action::Hangup); + return 0; +} + +int Backstage::callReject() { + WebRTCVideoChat::instance()->setCurrentSessionAction(WebRTCVideoChat::Action::Reject); + return 0; +} + +int Backstage::callAccept() { + WebRTCVideoChat::instance()->setCurrentSessionAction(WebRTCVideoChat::Action::Pickup); + return 0; +} + +int Backstage::openCallRemoteDoor() { + WebRTCVideoChat::instance()->setCurrentSessionAction(WebRTCVideoChat::Action::OpenDoor); + return 0; +} + +void Backstage::verifyAbort() +{ + GDecisionActuator *decAor = (GDecisionActuator*)m_objs->findObject("decisionActuator"); + if (!decAor){return;} + decAor->verifyAbort(); +} + +bool Backstage::getShowIdAndVerSw() +{ + return m_paramMng->getRecoUiShowDevIdAndVerSw(); +} + +int Backstage::setShowIdAndVerSw(bool sw) +{ + m_paramMng->setRecoUiShowDevIdAndVerSw(sw); + return 0; +} + +int Backstage::playAudio(enAudioIndex index) +{ + GDecisionActuator *decAor = (GDecisionActuator*)m_objs->findObject("decisionActuator"); + if (!decAor){return -1;} + const std::vector indexMap{32}; + if(index < 0 || index >= indexMap.size()){return -2;} + return decAor->_playAudioProc(indexMap.at(index)); +} + +int Backstage::userItemChoose(int index) +{ + GDecisionCenter *decCenter = (GDecisionCenter*)m_objs->findObject("decisionCenter"); + if (decCenter){ + decCenter->userItemChoose(index); + } + return 0; +} + +int Backstage::callSetVideoStream(bool enable) { + WebRTCVideoChat::instance()->setCurrentSessionAction(enable ? WebRTCVideoChat::Action::EnableVideo + : WebRTCVideoChat::Action::DisableVideo); + return 0; +} + +int Backstage::getHardwareConfig(char *hardVer, int len)//获取系统版本 +{ + int ret = -1; + std::string version; + getHardVersion(version); + LOGD("version=%s",version.c_str()); + if(version.length() < (unsigned)len){ + strcpy(hardVer, version.c_str()); + ret = 0; + } + return ret; +} + +int Backstage::getStorSpace(int &total, float &free)//获取存储空间 +{ + int ret = -1; + +#if 0 + char buf[1024] = {0}; + FILE *fp = popen("df -h | grep \"/data\"", "r"); + if (fp == NULL) + { + LOGE("popen FAIL!"); + return ret; + } + while(fgets(buf, 1024, fp) != NULL) + { + LOGD("read buf : %s", buf); + if (strstr(buf, "/data") && strstr(buf, "G")) + { + unsigned iPos = 0; + std::string line(buf); + for(int i=0; i<2; i++){ + iPos = line.find_last_of(" "); + if(iPos != std::string::npos){ + line = std::string(line.begin(), line.begin() + iPos); + line = line.substr(line.find_first_not_of(' '), line.find_last_not_of(' ') + 1); + } + } + iPos = line.find_last_of(" "); + if(iPos != std::string::npos) + { + line = line.substr(iPos + 1); + line = line.substr(line.find_first_not_of(' '), line.find_last_not_of(' ') + 1); + LOGD("avai space:%s", line.c_str()); + line.erase(line.length() - 1); + if(line.length() > 0){ + free = std::stof(line); + ret = 0; + } + } + } + } + total = 16; + if(SERIES_B021 == DevVersion::getInstance()->getDevSeries()) + { + total = 8; + } +#else + ret = getStoreSpace(free, total); +#if 0 + total = 16; + if(SERIES_B021 == DevVersion::getInstance()->getDevSeries()) + { + total = 8; + } +#endif +#endif + return ret; +} + +int Backstage::getAppVersion(char *appVer, int len)//获取应用版本号 +{ + int ret = -1; + std::string version; + getSoftVersion(version); + if (version.at(version.length() - 1) == '\n') + { + version.erase(version.length() - 1); + } + + if(version.length() < (unsigned)len){ + strcpy(appVer, version.c_str()); + ret = 0; + } + return ret; +} + +int Backstage::getRegisterNum()//获取注册人员数 +{ + int personCount = 0; + DBManage::getInstance()->getPersonAllCount(personCount); + return personCount; +} + +int Backstage::getAccessRecordQty() +{ + int sum = 0; + const string countSql = "select count(*) from access_record"; + DBManage::getInstance()->getCountOfTableBySQL(countSql, sum); + LOGD("sum==%d", sum); + return sum; +} + +int Backstage::getAccessRecordNotUpload()//获取未上传通行记录 +{ + return DBManage::getInstance()->getAccessRecordsNumByUploadSta(dbspace::enRodUpNotYet); +} + +int Backstage::getVolume()//获取音量大小 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getVolume(); +} + +int Backstage::setVolume(int vol)//设置音量大小 +{ + assert(nullptr != m_paramMng); + m_paramMng->setVolume(vol); + + int res = blueToothMng::getInstance().setVolume(vol); + if (res != 0) + { + LOGE("bluetooth fail!"); + } + + return 0; +} + +int Backstage::getLcdBrightness()//获取屏幕亮度 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getLcdBrightness(); +} + +int Backstage::setLcdBrightness(int brightness)//设置屏幕亮度 +{ + assert(nullptr != m_paramMng); + m_paramMng->setLcdBrightness(brightness); + return 0; +} + +bool Backstage::getFillLightSw()//获取智能补光开关 +{ + return 0; +} + +int Backstage::setFillLightSw(bool isOpen)//获取智能补光开关 +{ + return 0; +} + +int Backstage::getStandbyTime()//获取待机时间 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getStandbyTime(); +} + +int Backstage::setStandbyTime(int time)//设置待机时间 +{ + assert(nullptr != m_paramMng); + const bool isMeetingMode = m_paramMng->getMeetingMode() >= 0; + const bool isDndMode = m_paramMng->getDndMode() >= 0; + if (isMeetingMode) { // 会议模式 + m_paramMng->setMeetingScreensaverTimeBackup(time); + } else if (isDndMode) { + m_paramMng->setDndModeStandbyTime(time); + } else { + m_paramMng->setStandbyTime(time); + } + return 0; +} + +int Backstage::getCloseScreenTime()//获取关屏等待时间 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getCloseScreenTime(); +} + +int Backstage::setCloseScreenTime(int time)//获取关屏等待时间 +{ + assert(nullptr != m_paramMng); + m_paramMng->setCloseScreenTime(time); + return 0; +} + +int Backstage::getLanguage()//获取语言 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getLanguage(); +} + +int Backstage::setLanguage(int lang)//设置语言 +{ + assert(nullptr != m_paramMng); + m_paramMng->setLanguage(lang); + return 0; +} + +int Backstage::getIP(char *ip, int len, int& type)//获取IP +{ + std::string maskString; + std::string ipString; + std::string ifName; + + if(utils::checkNetRun(std::string("eth0"))) + { + ifName = "eth0"; + type = 0; + } + else if(utils::checkNetRun(std::string("wlan0"))) + { + ifName = "wlan0"; + type = 1; + } + else if(utils::checkNetRun(std::string("wwan0"))) + { + ifName = "wwan0"; + type = 2; + } + else if(utils::checkNetRun(std::string("ppp0"))) + { + ifName = "ppp0"; + type = -1; + + static int lastType = 6; //满格信号 + std::string text; + do{ + if(0 != utils::read_file("/tmp/.4G_signal_intensity", text)){break;} + if(text.find("+CSQ:") == std::string::npos){break;} + size_t end = text.find_last_of(","); + if(end == std::string::npos){break;} + const std::string sigStr = text.substr(6, end - 6); //+CSQ: 24,99 + int nSig = -1; + try{nSig = std::stoi(sigStr);}catch(...){break;} + if(nSig >= 5 && nSig <= 6){type = 2;} //1格 + else if(nSig >= 7 && nSig <= 9){type = 3;} //2格 + else if(nSig >= 10 && nSig <= 11){type = 4;} //3格 + else if(nSig >= 12 && nSig <= 14){type = 5;} //4格 + else if(nSig >= 15 && nSig <= 31){type = 6;} //5格 + else{type = 7;} //无信号 + lastType = type; + }while(0); + if(type < 0){LOGE("sig text:%s", text.c_str());type = lastType;} + } + else{ + type = -1; + } + int iRet = 0; + if(type >= 0){ + iRet = utils::getIpAndMask(ifName, ipString, maskString); + snprintf(ip, len, "%s", ipString.c_str()); + //LOGD("local ip==%s", ip); + } + //LOGI("getIP type:%d", type); + return iRet; +} + +int Backstage::setIP(char *ip)//设置IP +{ + return 0; +} + +enIpMethod Backstage::getIpMethod()//获取IP方法 +{ + return (enIpMethod)0; +} + +int Backstage::setIpMethod(enIpMethod ipMethod)//设置IP方法 +{ + return 0;//MVC_Ctrler::getInstance()->setIpMethod(ipMethod); +} + +int Backstage::getSubnetMask(char *mask, int len)//获取子网掩码 +{ + return 0;//MVC_Ctrler::getInstance()->getSubnetMask(mask, len); +} + +int Backstage::setSubnetMask(char *mask)//设置子网掩码 +{ + return 0;//MVC_Ctrler::getInstance()->setSubnetMask(mask); +} + +int Backstage::getGateway(char *gateway, int len)//获取默认网关 +{ + return 0;//MVC_Ctrler::getInstance()->getGateway(gateway, len); +} + +int Backstage::setGateway(char *gateway)//设置默认网关 +{ + return 0;//MVC_Ctrler::getInstance()->setGateway(gateway); +} + +int Backstage::getDNS(char *dns, int len)//获取DNS +{ + return 0;//MVC_Ctrler::getInstance()->getDNS(dns, len); +} + +int Backstage::setDNS(char *dns)//设置DNS +{ + return 0;//MVC_Ctrler::getInstance()->setDNS(dns); +} + +int Backstage::getEthMac(char *mac, int len)//获取mac +{ + int ret = -1; + const std::string macString = utils::getNetMac("eth0"); + LOGD("macString=%s", macString.c_str()); + if(macString.length() < (unsigned)len){ + strcpy(mac, macString.c_str()); + ret = 0; + } + return ret; +} + +int Backstage::getWifiMac(char *mac, int len)//获取wifi mac +{ + return 0; +} + +int Backstage::getServerAddr(char *addr, int len)//获取服务器ip +{ + assert(nullptr != m_paramMng); + int ret = -1; + std::string serverinfo = m_paramMng->getServerIP(); + if(serverinfo.length() < (unsigned)len){ + strcpy(addr, serverinfo.c_str()); + ret = 0; + } + return ret; +} + +int Backstage::setServerAddr(char *addr, bool byQrcode)//设置服务器ip +{ + assert(nullptr != m_paramMng); + m_paramMng->setLastModifyServer(1); + m_paramMng->setServerIP(addr); + if (!byQrcode) + { + FileUtils::removeFile(QRCODE_CONFIG_FILE);//用户修改平台IP后就删除保存的二维码信息文件,modify by wwb-20220104 + } + //RWProtocol::getInstance()->modifySrvAddrInfo(1); + return 0; +} + +int Backstage::testServerIP(char *addr, float &time)//测试服务器ip +{ + return 0; +} + +int Backstage::getIotServerIP(char *ip, int len)//获取服务器ip +{ + return 0;//MVC_Ctrler::getInstance()->getIotServerIP(ip, len); +} + +int Backstage::setIotServerIP(char *ip)//设置服务器ip +{ + return 0;//MVC_Ctrler::getInstance()->setIotServerIP(ip); +} + +int Backstage::getIotPort()//获取端口号, 成功返回端口号,失败返回-1 +{ + return 0;//MVC_Ctrler::getInstance()->getIotPort(); +} + +int Backstage::setIotPort(int port)//设置端口号 +{ + return 0;//MVC_Ctrler::getInstance()->setIotPort(port); +} + +bool Backstage::getIpShowSw() +{ + assert(nullptr != m_paramMng); + return m_paramMng->getIpShowSw(); +} + +int Backstage::setIpShowSw(bool sw) +{ + assert(nullptr != m_paramMng); + m_paramMng->setIpShowSw(sw); + return 0; +} + +int Backstage::getBtSwitch(bool &isOpen) +{ + assert(nullptr != m_paramMng); + isOpen = m_paramMng->getBluetoothSw(); + return 0; +} + +int Backstage::getBtName(string &devName) +{ + assert(nullptr != m_paramMng); + devName = m_paramMng->getDevName(); + return 0; +} + +int Backstage::getBtPairedDev(list &devList) +{ + std::list pairedList; + blueToothMng::getInstance().getPairedDevs(pairedList); + devList.clear(); + for(const auto &iter : pairedList) + { + BlueToothDevStat_e state = BlueToothDevStat_paired; + //连接状态:0搜索到, 1配对中, 2已配对, 3连接中, 4已连接 +// if (std::get<0>(iter) == 3) +// { +// state = BlueToothDevStat_connecting; +// } + //else + if (std::get<0>(iter) == 4) + { + state = BlueToothDevStat_connected; + } + LOGD("name:%s, state:%d", std::get<3>(iter).c_str(), std::get<0>(iter)); + devList.emplace_back(BluetoothDev_t(std::get<2>(iter), std::get<3>(iter), state)); + } + + return 0; +} + +int Backstage::getBtAvailDev(list &devList) +{ + std::list scanedList; + blueToothMng::getInstance().getScanedDevs(scanedList); + + devList.clear(); + for(const auto &iter : scanedList) + { + //LOGD("name:%s, state:%d", std::get<1>(iter).c_str(), std::get<0>(iter)); + devList.emplace_back(BluetoothDev_t(std::get<2>(iter), std::get<3>(iter), BlueToothDevStat_idle)); + } + + return 0; +} + +int Backstage::getBtAllInfo(BluetoothStat_t &bluetoothStat) +{ + assert(nullptr != m_paramMng); + + bluetoothStat.clear(); + bluetoothStat.devName = m_paramMng->getDevName(); + bluetoothStat.isEnable = m_paramMng->getBluetoothSw(); + getBtPairedDev(bluetoothStat.pairedDev); + getBtAvailDev(bluetoothStat.availableDev); + + return 0; +} + +//blueToothMng模块里有一个线程循环再搜索,所以没有提供主动搜索接口,只提供了获取搜索列表的接口,这里调用getBtAvailDev即可 +int Backstage::btScan(list &devList) +{ +#if 0 + std::list searchedList; + blueToothMng::getInstance().search(searchedList); + devList.clear(); + + for(const auto &iter : searchedList) + { + LOGD("name:%s, state:%d", std::get<1>(iter).c_str(), std::get<0>(iter)); + devList.emplace_back(BluetoothDev_t(std::get<2>(iter), std::get<1>(iter), BlueToothDevStat_idle)); + } +#endif + return 0; +} + +int Backstage::btSetSwitch(bool isOpen) +{ + assert(nullptr != m_paramMng); + + m_paramMng->setBluetoothSw(isOpen); + if (isOpen) + { + blueToothMng::getInstance().open(); + } + else + { + m_paramMng->setBleLockSw(false); + blueToothMng::getInstance().close(); + } + + return 0; +} + +int Backstage::btSetName(const string &devName) +{ + if (blueToothMng::getInstance().modifySysName(devName) == 0) + { + m_paramMng->setDevName(devName); + return 0; + } + return -1; +} + +int Backstage::btPaire(const string &devId) +{ + int res = blueToothMng::getInstance().pair(devId); + if (res != 0) + { + LOGE("bluetooth pairing fail! res:%d", res); + } + return res; +} + +int Backstage::btDisPaire(const string &devId) +{ + int res = blueToothMng::getInstance().disPair(devId); + if (res != 0) + { + LOGE("bluetooth disPairing fail! res:%d", res); + } + + return res; +} + +int Backstage::btConnect(const string &devId) +{ + int res = blueToothMng::getInstance().connect(devId); + if (res != 0) + { + LOGE("bluetooth connect fail!"); + } + + return res; +} + +int Backstage::btDisConnect(const string &devId) +{ + int res = blueToothMng::getInstance().disConnect(devId); + if (res != 0) + { + LOGE("bluetooth disConnect fail! res:%d", res); + } + + return res; +} + +int Backstage::btRenameDev(const string &devId, const string &devName) +{ + return blueToothMng::getInstance().modifyDevName(devId, devName); +} + +#if 1 //for test +bool g_isBluetoothEnable = false; +#endif +bool Backstage::getParamBluetoothEnable() +{ + return g_isBluetoothEnable; +} + +int Backstage::setParamBluetoothEnable(bool sw) +{ + g_isBluetoothEnable = sw; + return 0; +} + +#if 1 //for test +string g_bluetoothName = "rw-bluetooth"; +#endif +string Backstage::getParamBluetoothName() +{ + return g_bluetoothName; +} + +int Backstage::setParamBluetoothName(string name) +{ + g_bluetoothName = name; + return 0; +} + +int Backstage::getUnlockTime()//获取开锁时间 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getUnlockTime(); +} + +int Backstage::setUnlockTime(int time)//设置开锁时间 +{ + assert(nullptr != m_paramMng); + m_paramMng->setUnlockTime(time); + return 0; +} + +int Backstage::getUnlockDelay()//获取开锁延时 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getUnlockDelay(); +} + +int Backstage::setUnlockDelay(int time)//设置开锁延时 +{ + assert(nullptr != m_paramMng); + m_paramMng->setUnlockDelay(time); + return 0; +} + +enUnlockSignal Backstage::getUnlockSig()//获取开锁信号 +{ + assert(nullptr != m_paramMng); + if(m_paramMng->getUnlockSig() >= UnlockSigButt){ + return UnlockSigRelay; + } + return (enUnlockSignal)m_paramMng->getUnlockSig(); +} + +int Backstage::setUnlockSig(enUnlockSignal value)//设置开锁信号 +{ + assert(nullptr != m_paramMng); + m_paramMng->setUnlockSig(value); + return 0; +} + +enAssist Backstage::getAssistIn()//获取辅助输入 +{ + return (enAssist)0;//MVC_Ctrler::getInstance()->getAssistIn(); +} + +int Backstage::setAssistIn(enAssist assist)//设置辅助输入 +{ + return 0;//MVC_Ctrler::getInstance()->setAssistIn(assist); +} + +enAssist Backstage::getAssistOut()//获取辅助输出 +{ + return (enAssist)0;//MVC_Ctrler::getInstance()->getAssistOut(); +} + +int Backstage::setAssistOut(enAssist assist)//设置辅助输出 +{ + return 0;//MVC_Ctrler::getInstance()->setAssistOut(assist); +} + +enWiegand Backstage::getWiegandIn()//获取韦根输入 +{ + return (enWiegand)0;//MVC_Ctrler::getInstance()->getWiegandIn(); +} + +int Backstage::setWiegandIn(enWiegand wiegand)//设置韦根输入 +{ + return 0;//MVC_Ctrler::getInstance()->setWiegandIn(wiegand); +} + +enWiegand Backstage::getWiegandOut()//获取韦根输出 +{ + return (enWiegand)0; +} + +int Backstage::setWiegandOut(enWiegand wiegand)//设置韦根输出 +{ + return 0; +} + +enBaudRate Backstage::getBaudRate()//获取波特率 +{ + return (enBaudRate)0; +} + +int Backstage::setBaudRate(enBaudRate baudRate)//设置波特率 +{ + return 0; +} + +int Backstage::getWarningSig()//获取报警信号v +{ + assert(nullptr != m_paramMng); + return m_paramMng->getWarningSig(); +} + +int Backstage::setWarningSig(int signal)//设置报警信号 +{ + assert(nullptr != m_paramMng); + m_paramMng->setWarningSig(signal); + return 0; +} + +enLogo Backstage::getLogo()//获取logo +{ + assert(nullptr != m_paramMng); + return (enLogo)m_paramMng->getLogo(); +} + +int Backstage::setLogo(enLogo logo)//设置logo +{ + assert(nullptr != m_paramMng); + m_paramMng->setLogo((int)logo); + return 0; +} + +int Backstage::getCustomLogo(char *logo, int len)//获取自定义logo +{ + assert(nullptr != m_paramMng); + std::string customLogo = m_paramMng->getCustomLogo(); + snprintf(logo, len, "%s", customLogo.c_str()); + LOGD("customLogo: %s", customLogo.c_str()); + return 0; +} + +enLogo Backstage::getLogoTime()//获取logo+time +{ + return (enLogo)0;//MVC_Ctrler::getInstance()->getLogoTime(); + +} +int Backstage::setLogoTime(enLogo logo)//设置logo+time +{ + return 0;//MVC_Ctrler::getInstance()->setLogoTime(logo); +} + +enLogo Backstage::getBackground()//获取背景图 +{ + return (enLogo)0;//MVC_Ctrler::getInstance()->getBackground(); +} + +int Backstage::setBackground(enLogo logo)//设置背景图 +{ + return 0;//MVC_Ctrler::getInstance()->setBackground(logo); +} + +enRecogResult Backstage::getSuccessResult(char *data, int len)//获取成功结果 +{ + int nRet = 0;//MVC_Ctrler::getInstance()->getSuccessResult(data, len); + nRet = (nRet < 0) ? RecogResultButt : nRet; + return (enRecogResult)nRet; +} + +int Backstage::setSuccessResult(enRecogResult result, char *data)//设置成功结果 +{ + return 0;//MVC_Ctrler::getInstance()->setSuccessResult(result, data); +} + +enRecogResult Backstage::getFailResult(char *data, int len)//获取失败结果 +{ + int nRet = 0;//MVC_Ctrler::getInstance()->getFailResult(data, len); + nRet = (nRet < 0) ? RecogResultButt : nRet; + return (enRecogResult)nRet; +} + +int Backstage::setFailResult(enRecogResult result, char *data)//设置失败结果 +{ + return 0;//MVC_Ctrler::getInstance()->setFailResult(result, data); +} + +bool Backstage::getPlayAudioSw()//获取语音播报开关 +{ + return 0;//MVC_Ctrler::getInstance()->getPlayAudioSw(); +} + +int Backstage::setPlayAudioSw(bool isOpen)//设置语音播报开关 +{ + return 0;//MVC_Ctrler::getInstance()->setPlayAudioSw(isOpen); +} + +bool Backstage::getIdentificationSw()//获取身份核验开关 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getRecoSw(); +} + +int Backstage::setIdentificationSw(bool sw)//设置身份核验开关 +{ + assert(nullptr != m_paramMng); + m_paramMng->setRecoSw(sw); + return 0; +} + +enSimilarityTh Backstage::getSimilarityTh()//获取相似度阈值 +{ + assert(nullptr != m_paramMng); + return (enSimilarityTh)m_paramMng->getSimilarityType(); +} + +int Backstage::setSimilarityTh(enSimilarityTh th)//设置相似度阈值 +{ + assert(nullptr != m_paramMng); + m_paramMng->setSimilarityType(th); + return 0; +} + +int Backstage::setCustomSimilarity(int sim) //设置自定义识别相似度 +{ + assert(nullptr != m_paramMng); + m_paramMng->setSimilarityTh(sim); + return 0; +} + +int Backstage::getCustomSimilarity() //获取自定义识别相似度 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getSimilarityTh(); +} + +bool Backstage::getLivingBodySw()//获取活体开关 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getInfraAntiAttack(); +} + +int Backstage::setLivingBodySw(bool isOpen)//设置活体开关 +{ + assert(nullptr != m_paramMng); + m_paramMng->setInfraAntiAttack(isOpen); + return 0; +} + +enLivingBodyTh Backstage::getLivingBodyTh()//获取活体检测阈值 +{ + return (enLivingBodyTh)0; +} + +int Backstage::setLivingBodyTh(enLivingBodyTh th)//设置活体检测阈值 +{ + return 0; +} + +bool Backstage::getLivingBodyFailSw()//获取活体失败图片留存开关 +{ + return 0; +} + +int Backstage::setLivingBodyFailSw(bool isOpen)//设置失败图片留存开关 +{ + return 0; +} + +int Backstage::getVerifyInterval()//获取验证间隔时间 +{ + return 0; +} + +int Backstage::setVerifyInterval(int time)//设置验证间隔时间 +{ + return 0; +} + +enRecogDistance Backstage::getRecogDistance()//获取识别距离 +{ + return (enRecogDistance)0;//MVC_Ctrler::getInstance()->getRecogDistance(); +} + +int Backstage::setRecogDistance(enRecogDistance distance)//设置识别距离 +{ + return 0;//MVC_Ctrler::getInstance()->setRecogDistance(distance); +} + +enRecogAngle Backstage::getRecogAngle()//获取识别角度 +{ + return (enRecogAngle)0;//MVC_Ctrler::getInstance()->getRecogAngle(); +} + +int Backstage::setRecogAngle(enRecogAngle angle)//设置识别角度 +{ + return 0;//MVC_Ctrler::getInstance()->setRecogAngle(angle); +} + +int Backstage::getMaxTraceNum()//获取人脸最大跟踪数 +{ + return 0;//MVC_Ctrler::getInstance()->getMaxTraceNum(); +} + +int Backstage::setMaxTraceNum(int num)//设置人脸最大跟踪数 +{ + return 0;//MVC_Ctrler::getInstance()->setMaxTraceNum(num); +} + +enFaceQuality Backstage::getFaceQuality()//获取人脸质量阈值 +{ + return (enFaceQuality)0;//MVC_Ctrler::getInstance()->getFaceQuality(); +} + +int Backstage::setFaceQuality(enFaceQuality quality)//设置人脸质量阈值 +{ + return 0;//MVC_Ctrler::getInstance()->setFaceQuality(quality); +} + +bool Backstage::getDynamicFeatureSw() +{ + return m_paramMng->getDynamicFeatureSw(); +} + +int Backstage::setDynamicFeatureSw(bool sw) +{ + LOGD("setDynamicFeatureSw:%d", sw); + m_paramMng->setDynamicFeatureSw(sw); + return 0; +} + +bool Backstage::getNtpServerSw()//获取NTP服务开关 +{ + assert(nullptr != m_paramMng); + return m_paramMng->getNtpServerSw(); +} + +int Backstage::setNtpServerSw(bool isOpen)//设置NTP服务开关 +{ + assert(nullptr != m_paramMng); + m_paramMng->setNtpServerSw(isOpen); + return 0; +} + +int Backstage::getNtpServerAddr(char *addr, int len)//获取NTP服务地址 +{ + assert(nullptr != m_paramMng); + int ret = -1; + std::string serverinfo = m_paramMng->getNtpServerAddr(); + if(serverinfo.length() < (unsigned)len){ + strcpy(addr, serverinfo.c_str()); + ret = 0; + } + return ret; +} + +int Backstage::setNtpServerAddr(char *addr)//设置NTP服务地址 +{ + assert(nullptr != m_paramMng); + m_paramMng->setNtpServerAddr(addr); + return 0; +} + +int Backstage::testNtpServer(char *addr, float &time)//测试NTP服务 +{ + return 0;//MVC_Ctrler::getInstance()->testNtpServer(addr, time); +} + +int Backstage::getNtpServerPort()//获取NTP端口,成功返回端口号,失败返回-1 +{ + return m_paramMng->getNtpServerPort(); +} + +int Backstage::setNtpServerPort(int port)//设置NTP服务端口 +{ + m_paramMng->setNtpServerPort(port); + return 0; +} +int Backstage::getNtpCheckInterval() +{ + return m_paramMng->getNtpSyncInterval(); +} + +int Backstage::setNtpCheckInterval(int interval) +{ + m_paramMng->setNtpSyncInterval(interval); + return 0; +} + +int Backstage::getNtpTimeZone(char *timeZone, int len) +{ + assert(nullptr != m_paramMng); + int ret = -1; + std::string zone = m_paramMng->getZone(); + if(zone.length() < (unsigned)len){ + strcpy(timeZone, zone.c_str()); + ret = 0; + } + return ret; +} + +int Backstage::setNtpTimeZone(char *timeZone) +{ + assert(nullptr != m_paramMng); + m_paramMng->setZone(timeZone); + return 0; +} + +int Backstage::setVerifyFactorySettingPwd(char *pwd)//设置工程密码 +{ + return 0; +} + +int Backstage::testHardware()//硬件检测 +{ + return 0; +} + +int Backstage::cleanData()//清除数据 +{ + int ret = clearData(); + //清空数据会隐藏密码输入显示,需检查是否有本地设置密码 + if(m_paramMng->getLocalDevPwd().length()){ + View::getInstance()->setPwdButton(true); + } + return ret; +} + +int Backstage::devReboot()//重启设备 +{ + m_paramMng->setLcdBrightness(0, true); + sleep(1); + //deviceReboot(); + DEV_REBOOT; + //system("reboot -f"); + return 0; +} + +int Backstage::startCapture() +{ + int nRet = 0; + return nRet; +} + +int Backstage::deletePerson(long long personID) +{ + int nRet = 0; + + return nRet; +} + +int Backstage::queryPersonList(long long* pPersonIDBuff, int nBuffCount, long long startID, int& nRealPerson) +{ + int nRet = 0; + + return nRet; +} + +unsigned Backstage::queryPerson(const char* searchText) +{ + LOGD("searchText:%s", searchText); + const std::string countSql = std::string("select count(*) from person_info where 1=1 and name like '%") + searchText + "%'"; + int sum = 0; + DBManage::getInstance()->getCountOfTableBySQL(countSql, sum); + LOGD("sum:%d", sum); + return (unsigned)sum; +} + +unsigned Backstage::queryPerson(const char* searchText, int pageIndex, stQueryPersonInfo personRet[], int personRetSize) +{ + unsigned nRet = 0; + const std::string persql = std::string("select * from person_info where 1=1 and name like '%") + searchText + + "%' order by reg_time desc limit " + utils::to_string(personRetSize) + + " offset " + utils::to_string(pageIndex * personRetSize); + + std::list personInfoList; + DBManage::getInstance()->queryPersonListBySQL(persql, personInfoList); + int i = 0; + for (auto &personInfo : personInfoList) + { + if(i < personRetSize){ +#if 0 + snprintf(personRet[i].name, sizeof(personRet[i].name), personInfo.name.c_str()); + snprintf(personRet[i].regTime, sizeof(personRet[i].regTime), utils::format_time(personInfo.regTime).c_str()); + snprintf(personRet[i].expTime, sizeof(personRet[i].expTime), personInfo.expTime.c_str()); +#endif + personRet[i].name = personInfo.name; + personRet[i].regTime = utils::format_time(personInfo.regTime).c_str(); + personRet[i].expTime = personInfo.expTime; + + personRet[i].personId = personInfo.personId; + personRet[i].idNum = personInfo.idNum; + personRet[i].jobNum = personInfo.jobNum; + personRet[i].phoneNum = personInfo.phoneNum; + personRet[i].icNum = personInfo.cpuCardContent.empty() ? personInfo.icNum : personInfo.cpuCardContent; + personRet[i].personType = personInfo.personType; + string imgPath = utils::makeRegisterImgPath(personInfo.personId, personInfo.source, 1); + if(0 != access(imgPath.c_str(), F_OK))//如果不存在就去数据库中查找图片路径 + { + LOGE("register img %s not exsit .", imgPath.c_str()); + dbspace::rwFeatInfo faceInfo; + if (0 == DBManage::getInstance()->queryFaceByPersonId(personInfo.personId, faceInfo)) + { + imgPath = faceInfo.image; + } + } +#if 0 + snprintf(personRet[i].imgPath, sizeof(personRet[i].imgPath), imgPath.c_str()); +#endif + personRet[i].imgPath = imgPath; + i++; + nRet = (unsigned)i; + } + } + return nRet; +} + +unsigned Backstage::queryAccessRecord(const char* name, const char* time) +{ + unsigned nRet = 0; + std::string countSql("select count(*) from access_record where 1=1"); + if(name){ + countSql += " and name like '%"; + countSql += name; + countSql += "%'"; + } + if(time){ + std::string timeBegin(time); + timeBegin += " 00:00:00"; + std::string timeEnd(time); + timeEnd += " 23:59:59"; + + long long beginTime = utils::format_time(timeBegin.c_str()); + long long endTime = utils::format_time(timeEnd.c_str()); + LOGD("beginTime:%lld, endTime:%lld", beginTime, endTime); + countSql += " and access_time<="; + countSql += utils::to_string(endTime*1000); + countSql += " and access_time>="; + countSql += utils::to_string(beginTime*1000);//通行记录里面保存的是ms + } + int sum = 0; + DBManage::getInstance()->getCountOfTableBySQL(countSql, sum); + LOGD("sum:%d", sum); + nRet = (unsigned)sum; + return nRet; +} + +unsigned Backstage::queryAccessRecord(const char* name, const char* time, int pageIndex, stQueryAccRedInfo recordRet[], int recordRetSize) +{ + unsigned nRet = 0; + std::string dataSql("select * from access_record where 1=1"); + if(name){ + dataSql += " and name like '%"; + dataSql += name; + dataSql += "%'"; + } + //时间格式必须为2020-04-05 00:00:00 + if(time){ + std::string timeBegin(time); + timeBegin += " 00:00:00"; + std::string timeEnd(time); + timeEnd += " 23:59:59"; + + long long beginTime = utils::format_time(timeBegin.c_str()); + long long endTime = utils::format_time(timeEnd.c_str()); + LOGD("beginTime:%lld, endTime:%lld", beginTime, endTime); + dataSql += " and access_time<="; + dataSql += utils::to_string(endTime*1000); + dataSql += " and access_time>="; + dataSql += utils::to_string(beginTime*1000);//通行记录里面保存的是ms + } + dataSql += " order by access_time desc"; + dataSql += " limit "; + dataSql += utils::to_string(recordRetSize); + dataSql += " offset "; + dataSql += utils::to_string(recordRetSize * pageIndex); + + std::list accessInfoList; + DBManage::getInstance()->queryAccessRecordListBySQL(dataSql, accessInfoList); + int i = 0; + for (std::list::iterator itr = accessInfoList.begin(); itr != accessInfoList.end(); itr++) + { + if(i < recordRetSize){ + snprintf(recordRet[i].name, sizeof(recordRet[i].name), (*itr).name.length() > 0 ? (*itr).name.c_str() : (m_paramMng->getLanguage() < 2 ? "陌生人" : "stranger")); + snprintf(recordRet[i].accessTime, sizeof(recordRet[i].accessTime), utils::format_time((*itr).accessTime/1000).c_str()); + snprintf(recordRet[i].imgPath, sizeof(recordRet[i].imgPath), (*itr).imgFile.c_str()); + recordRet[i].allowPass = (bool)((*itr).gateStatus); + i++; + nRet = (unsigned)i; + } + } + return nRet; +} + +int Backstage::clearPeople() +{ + int nRet = 0; + + return nRet; +} + +int Backstage::getPersonListState(int &sum, unsigned long long &maxPersonID) +{ + int nRet = 0; + + return nRet; +} + +int Backstage::wakeUpFromScreenSaverOrScreenOff() +{ + return 0; +} + +int Backstage::delPerson(long long personId) +{ + return Singleton::GetInstance()->deletePerson(personId); +} + +int Backstage::modifyPerson(stQueryPersonInfo &personInfo) +{ + dbspace::rwPersonInfo dbPersonInfo; + dbPersonInfo.source = 1; + dbPersonInfo.personId = personInfo.personId; + dbPersonInfo.name = personInfo.name; + dbPersonInfo.idNum = personInfo.idNum; + dbPersonInfo.jobNum = personInfo.jobNum; + dbPersonInfo.phoneNum = personInfo.phoneNum; + dbPersonInfo.expTime = personInfo.expTime; + dbPersonInfo.icNum = personInfo.icNum; + int ret = Singleton::GetInstance()->modifyPerson(dbPersonInfo); + + return ret; +} + +int Backstage::addPerson(stQueryPersonInfo &personInfo) +{ + int count = 0; + DBManage::getInstance()->getPersonAllCount(count); + if (count >= REG_PERSON_NUM_MAX) + { + LOGE("The maximum number(%d) of people!", count); + return -99; + } + + dbspace::rwPersonInfo dbPersonInfo; + dbPersonInfo.source = 1; + //dbPersonInfo.personId = personInfo.personId; + dbPersonInfo.name = personInfo.name; + dbPersonInfo.idNum = personInfo.idNum; + dbPersonInfo.jobNum = personInfo.jobNum; + dbPersonInfo.phoneNum = personInfo.phoneNum; + dbPersonInfo.expTime = personInfo.expTime; + dbPersonInfo.icNum = personInfo.icNum; + + struct stat st; + if ((stat(personInfo.imgPath.c_str(), &st)<0) || (!S_ISREG(st.st_mode))){ + LOGE("file:%s is Non-existent!", personInfo.imgPath.c_str()); + return -1; + } + int len = st.st_size; + unsigned char *pImg = (unsigned char *)malloc(len); + if(pImg == nullptr){ + LOGE("malloc size(%d) FAIL!", len); + return -1; + } + ON_SCOPE_EXIT([&]{free(pImg);pImg = NULL;}); + + int faceImgLen = utils::read_file(personInfo.imgPath.c_str(), pImg, len); + if (faceImgLen <= 0) + { + LOGE("file: %s size is 0!", personInfo.imgPath.c_str()); + return -1; + } + + dbspace::rwFaceImg faceImg; + faceImg.imgType = dbspace::jpg; + faceImg.imgData = pImg; + faceImg.imgLen = len; + faceImg.faceX = 0; + faceImg.faceY = 0; + faceImg.faceW = 0; + faceImg.faceH = 0; + int ret = Singleton::GetInstance()->registerPerson(dbPersonInfo, faceImg); + + return ret; +#if 0 + if (ret != 0) + { + if (ret == -6) + { + code = CODE_CARD_ALREDDY_EXISTS; + } + else if (ret == -5) + { + code = CODE_EXTRACT_FEATURE; + } + else if (ret == -7) + { + code = CODE_ID_ALREDDY_EXISTS; + } + else + { + code = CODE_REGISTER_PERSON_FAIL; + } + ret = -1; + } +#endif +} + +int Backstage::snapFace(std::string &feature, std::string &savePath) +{ + GPeInput* pPeInput = (GPeInput*)m_objs->findObject("peInput"); + //GCamera* pCamera = (GCamera*)m_objs->findObject("normal"); + if(pPeInput){ + std::shared_ptr spOriImage; + pPeInput->getSpImageFrame(spOriImage); + if (spOriImage.get() == nullptr) + { + LOGE("spOriImage is nullptr"); + return -1; + } +#if 0 + //fds::RwImage *pflipImg = spOriImage->getFlipImage(); + int width = spOriImage->image.ext.width; + int height = spOriImage->image.ext.height; + uint8_t* nv21 = (uint8_t*)spOriImage->image.data; + uint8_t* size = (uint8_t*)spOriImage->image.ext.size; + dbspace::rwFaceImg faceImg = {0, 0, 0, 0, width, height, width, dbspace::nv21, size, nv21, savePath}; +#endif + fds::RwImage *rwImage = spOriImage->getJpegImage(); +#if 0 + #ifdef __RV1109__ + fds::RwImage* rwImage = spOriImage->getFlipJpegImage(); + #else + fds::RwImage* rwImage = spOriImage->getJpegImage(); + #endif +#endif + if(rwImage == nullptr) + { + LOGE("getJpegImage is nullptr"); + return -1; + } + dbspace::rwFaceImg faceImg = {0, 0, 0, 0, rwImage->ext.width, rwImage->ext.height, rwImage->ext.width, + dbspace::jpg, rwImage->ext.size, (uint8_t*)rwImage->data, savePath}; + + + std::vector tmp(FEATURE_SIZE); + RwFeature feat = {0}; + feat.feature_size = FEATURE_SIZE; + feat.feature = tmp.data(); + int ret = faceImg.getFeature(feat); + if (ret != 0) + { + LOGE("getFeature fail-->ret:%d", ret); + return -5; + } + + if (faceImg.imgJpgData == nullptr) + { + LOGE("jpg is null!"); + return -1; + } + + feature.assign((char*)feat.feature, feat.feature_size); + LOGD("jpg name:%s, imgdata:%p, imgLen:%d", faceImg.imgName.c_str(), faceImg.imgJpgData.get(), faceImg.imgLen); + ret = utils::write_file(faceImg.imgName, (char *)(faceImg.imgJpgData.get()), faceImg.imgLen); + + return ret; + } + + return -1; +} + +bool Backstage::getMaskCheckSwitch() +{ + assert(nullptr != m_paramMng); + return m_paramMng->getMaskSw(); +} + +int Backstage::setMaskCheckSwitch(const bool sw) +{ + assert(nullptr != m_paramMng); + m_paramMng->setMaskSw(sw); + return 0; +} + + +bool Backstage::getNoMaskNoPassSwitch() +{ + assert(nullptr != m_paramMng); + return m_paramMng->getNoMaskPassSw(); +} + +int Backstage::setNoMaskNoPassSwitch(const bool sw) +{ + assert(nullptr != m_paramMng); + m_paramMng->setNoMaskPassSw(sw); + return 0; +} + +bool Backstage::getTemperatureCheckSwitch() +{ + assert(nullptr != m_paramMng); + return m_paramMng->getTempSw(); +} + +int Backstage::setTemperatureCheckSwitch(const bool sw) +{ + assert(nullptr != m_paramMng); + m_paramMng->setTempSw(sw); + return 0; +} + +bool Backstage::getNoTemperatureNoPassSwitch() +{ + return 0;//MVC_Ctrler::getInstance()->getTempAnomalyNoEntrySwitch(); +} + +int Backstage::setNoTemperatureNoPassSwitch(const bool sw) +{ + return 0;//MVC_Ctrler::getInstance()->setTempAnomalyNoEntrySwitch(sw); +} + + +float Backstage::getLowTemperature() +{ + return 0;//MVC_Ctrler::getInstance()->getLowTemperature(); +} + +int Backstage::setLowTemperature(const float temp) +{ + return 0;//MVC_Ctrler::getInstance()->setLowTemperature(temp); +} + +float Backstage::getHighTemperature() +{ + return 0;//MVC_Ctrler::getInstance()->getHighTemperature(); +} + +int Backstage::setHighTemperature(const float temp) +{ + return 0;//MVC_Ctrler::getInstance()->setHighTemperature(temp); +} + +bool Backstage::getQRCodeSwitch() +{ + return 0;//MVC_Ctrler::getInstance()->getQRCodeSwitch(); +} + +int Backstage::setQRCodeSwitch(const bool sw) +{ + return 0; +} + +int Backstage::setDateTime(const char *dateTime) +{ + const std::string cmd = std::string("date -s \"") + dateTime + "\" && hwclock -w -u -f /dev/rtc0"; + LOGD("setDateTime cmd:%s", cmd.c_str()); + return utils::RW_System(cmd.c_str()); +} + +bool Backstage::getDataEncryptSw() +{ + assert(nullptr != m_paramMng); + return m_paramMng->getEncryptSw(); +} + + +int Backstage::setDataEncryptSw(bool sw) +{ + LOGD("setEncryptSw:%d", sw); + m_paramMng->setEncryptSw(sw); + return 0; +} + +bool Backstage::getAutoRebootSw() +{ + assert(nullptr != m_paramMng); + return m_paramMng->getAutoRebootSw(); +} + +int Backstage::setAutoRebootSw(bool sw) +{ + assert(nullptr != m_paramMng); + m_paramMng->setAutoRebootSw(sw); + updateRebootTime(sw, m_paramMng->getAutoRebootInterval(), m_paramMng->getAutoRebootTime().c_str()); + return 0; +} + +int Backstage::getAutoRebootTime(char* time, int len) +{ + assert(nullptr != m_paramMng); + int ret = -1; + std::string rebootTime = m_paramMng->getAutoRebootTime(); + if(rebootTime.length() < (unsigned)len){ + strcpy(time, rebootTime.c_str()); + ret = 0; + } + return ret; +} + +int Backstage::setAutoRebootTime(const char *time) +{ + assert(nullptr != m_paramMng); + m_paramMng->setAutoRebootTime(time); + updateRebootTime(m_paramMng->getAutoRebootSw(), m_paramMng->getAutoRebootInterval(), time); + return 0; +} + +int Backstage::getAutoRebootInterval() +{ + + assert(nullptr != m_paramMng); + return m_paramMng->getAutoRebootInterval(); +} + +int Backstage::setAutoRebootInterval(int interval) +{ + assert(nullptr != m_paramMng); + m_paramMng->setAutoRebootInterval(interval); + updateRebootTime(m_paramMng->getAutoRebootSw(), interval, m_paramMng->getAutoRebootTime().c_str()); + return 0; +} + +int Backstage::ntpTimeCorrect() +{ + int ret = -1; + do{ + bool ntpSw = getNtpServerSw(); + if(ntpSw){ + char ntpaddr[64] = {'\0'}; + if(0 != getNtpServerAddr(ntpaddr, sizeof(ntpaddr))){ + break; + } + char timeZone[64] = {'\0'}; + if(0 != getNtpTimeZone(timeZone, sizeof(timeZone))){ + break; + } + ret = ntpUpdater::getInstance().setParam(ntpSw, ntpaddr, getNtpCheckInterval(), timeZone); + //ret = ntpTimeCorrection(ntpSw, ntpaddr, getNtpCheckInterval(), timeZone); + } + else{ + //ret = ntpTimeCorrection(false, "", 0, ""); + ret = ntpUpdater::getInstance().setParam(false, "", 0, ""); + } + }while(0); + return ret; +} + +int Backstage::ntpTimeCorrectForDevTest(const std::string& ntpServerIp) +{ + int ret = 0; + //工厂生产时Mes服务器开启NTP校时服务 + std::string cmd = utils::to_string(APP_BIN_PATH"ntpdate.sh ") + utils::to_string("/dev/rtc0 ") + ntpServerIp; + LOGI("update ntp time for device test, cmd:%s", cmd.c_str()); + + int nReturn = utils::RW_System(cmd.c_str());//return 1 is + int err = WEXITSTATUS(nReturn); + if (0 != err) + { + LOGE("exec [%s] fail,err=%d,nReturn=%d", cmd.c_str(), err, nReturn); + ret = -1; + } + return ret; +} + +int Backstage::getNetWireCfg(stNetWire& wireCfg) +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "get_networkSettings"); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *obj = cJSON_GetObjectItem(root, "data"); + if (NULL == obj){ + LOGE("parse data error!"); + ret = -3; + break; + } + + cJSON *jsTmp = cJSON_GetObjectItem(obj, "type"); + if (NULL == jsTmp) { + LOGE("parse type error!"); + ret = -6; + break; + } + if (jsTmp->valueint < 0 || jsTmp->valueint > 1){ + LOGE("type error: %d", jsTmp->valueint); + ret = -7; + break; + } + wireCfg.cfg.type = jsTmp->valueint; + LOGI("wireCfg.cfg.type:%d", wireCfg.cfg.type); + + jsTmp = cJSON_GetObjectItem(obj, "status"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -4; + break; + } + if (jsTmp->valueint < 0 || jsTmp->valueint > 1){ + LOGE("status error: %d", jsTmp->valueint); + ret = -5; + break; + } + wireCfg.cfg.enable = jsTmp->valueint; + LOGI("wireCfg.cfg.enable:%d", wireCfg.cfg.enable); + if(false == wireCfg.cfg.enable){ + ret = 0; + break; + } + + if(wireCfg.cfg.type){ //dhcp + std::string maskString; + std::string ipString; + if(0 == utils::getIpAndMask("eth0", ipString, maskString)){ + snprintf(wireCfg.cfg.ip, sizeof(wireCfg.cfg.ip), ipString.c_str()); + snprintf(wireCfg.cfg.mask, sizeof(wireCfg.cfg.mask), maskString.c_str()); + } + std::string gw; + if(0 == utils::GetDefaultGw(gw)){ + snprintf(wireCfg.cfg.gw, sizeof(wireCfg.cfg.gw), gw.c_str()); + } + snprintf(wireCfg.cfg.dns, sizeof(wireCfg.cfg.dns), utils::getDNS().c_str()); + ret = 0; + break; + } + + jsTmp = cJSON_GetObjectItem(obj, "ip"); + if (NULL == jsTmp){ + LOGE("parse ip error!"); + ret = -8; + break; + } + snprintf(wireCfg.cfg.ip, sizeof(wireCfg.cfg.ip), jsTmp->valuestring); + LOGI("ip:%s", wireCfg.cfg.ip); + + jsTmp = cJSON_GetObjectItem(obj, "netmask"); + if (NULL == jsTmp){ + LOGE("parse netmask error!"); + ret = -9; + break; + } + snprintf(wireCfg.cfg.mask, sizeof(wireCfg.cfg.mask), jsTmp->valuestring); + LOGI("netmask:%s", wireCfg.cfg.mask); + + jsTmp = cJSON_GetObjectItem(obj, "gateway"); + if (NULL == jsTmp){ + LOGE("parse gateway error!"); + ret = -10; + break; + } + snprintf(wireCfg.cfg.gw, sizeof(wireCfg.cfg.gw), jsTmp->valuestring); + LOGI("gateway:%s", wireCfg.cfg.gw); + + jsTmp = cJSON_GetObjectItem(obj, "dns"); + if (NULL == jsTmp){ + LOGE("parse dns error!"); + ret = -11; + break; + } + snprintf(wireCfg.cfg.dns, sizeof(wireCfg.cfg.dns), jsTmp->valuestring); + LOGI("dns:%s", wireCfg.cfg.dns); + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + +int Backstage::setNetWireCfg(const stNetWire& wireCfg) +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "set_networkSettings"); + cJSON_AddNumberToObject(json, "type", wireCfg.cfg.type); + if(!wireCfg.cfg.type){ + cJSON_AddStringToObject(json, "ip", wireCfg.cfg.ip); + cJSON_AddStringToObject(json, "netmask", wireCfg.cfg.mask); + if(wireCfg.cfg.gw[0]){ + cJSON_AddStringToObject(json, "gateway", wireCfg.cfg.gw); + } + if(wireCfg.cfg.dns[0]){ + cJSON_AddStringToObject(json, "dns", wireCfg.cfg.dns); + } + } + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *jsTmp = cJSON_GetObjectItem(root, "ret"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -3; + break; + } + if (0 != jsTmp->valueint){ + LOGE("netconfig ret: %d", jsTmp->valueint); + ret = -4; + break; + } + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} +int Backstage::setNetWireEnable(bool enable) +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "update_network_status"); + cJSON_AddBoolToObject(json, "status", enable); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *jsTmp = cJSON_GetObjectItem(root, "ret"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -3; + break; + } + if (0 != jsTmp->valueint){ + LOGE("netconfig ret: %d", jsTmp->valueint); + ret = -4; + break; + } + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + + +int Backstage::getNetWifiCfg(stNetWifi& wifiCfg) +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "get_wifiSettings"); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *obj = cJSON_GetObjectItem(root, "data"); + if (NULL == obj){ + LOGE("parse data error!"); + ret = -3; + break; + } + + cJSON *jsTmp = cJSON_GetObjectItem(obj, "status"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -4; + break; + } + if (jsTmp->valueint < 0 || jsTmp->valueint > 1){ + LOGE("status error: %d", jsTmp->valueint); + ret = -5; + break; + } + wifiCfg.cfg.enable = jsTmp->valueint; + LOGI("wireCfg.cfg.enable:%d", wifiCfg.cfg.enable); + if(false == wifiCfg.cfg.enable){ + ret = 0; + break; + } + + jsTmp = cJSON_GetObjectItem(obj, "enableAp"); + if (NULL == jsTmp){ + LOGE("parse enableAp error!"); + ret = -12; + break; + } + wifiCfg.enableAp = jsTmp->valueint; + + if(wifiCfg.enableAp){ + jsTmp = cJSON_GetObjectItem(obj, "apPwd"); + if (NULL == jsTmp){ + LOGE("parse apPwd error!"); + ret = -12; + break; + } + snprintf(wifiCfg.apPwd, sizeof(wifiCfg.apPwd), jsTmp->valuestring); + ret = 0; + break; + } + + jsTmp = cJSON_GetObjectItem(obj, "enctype"); + if (NULL == jsTmp){ + LOGE("parse enctype error!"); + ret = -12; + break; + } + snprintf(wifiCfg.encType, sizeof(wifiCfg.encType), jsTmp->valuestring); + LOGI("encType:%s", wifiCfg.encType); + + jsTmp = cJSON_GetObjectItem(obj, "ssid"); + if (NULL == jsTmp){ + LOGE("parse ssid error!"); + ret = -13; + break; + } + snprintf(wifiCfg.ssid, sizeof(wifiCfg.ssid), jsTmp->valuestring); + LOGI("ssid:%s", wifiCfg.ssid); + + jsTmp = cJSON_GetObjectItem(obj, "pwd"); + if (NULL == jsTmp){ + LOGE("parse pwd error!"); + ret = -14; + break; + } + snprintf(wifiCfg.pwd, sizeof(wifiCfg.pwd), jsTmp->valuestring); + LOGI("pwd:%s", wifiCfg.pwd); + + jsTmp = cJSON_GetObjectItem(obj, "connected"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -15; + break; + } + if (jsTmp->valueint < 0 || jsTmp->valueint > 1){ + LOGE("connected error: %d", jsTmp->valueint); + ret = -16; + break; + } + wifiCfg.isConnected = jsTmp->valueint; + LOGI("wireCfg.connected:%d", wifiCfg.isConnected); + + jsTmp = cJSON_GetObjectItem(obj, "type"); + if (NULL == jsTmp) { + LOGE("parse type error!"); + ret = -6; + break; + } + if (jsTmp->valueint < 0 || jsTmp->valueint > 1){ + LOGE("type error: %d", jsTmp->valueint); + ret = -7; + break; + } + wifiCfg.cfg.type = jsTmp->valueint; + LOGI("wifiCfg.cfg.type:%d", wifiCfg.cfg.type); + if(wifiCfg.cfg.type){ //dhcp + std::string maskString; + std::string ipString; + if(0 == utils::getIpAndMask("wlan0", ipString, maskString)){ + snprintf(wifiCfg.cfg.ip, sizeof(wifiCfg.cfg.ip), ipString.c_str()); + snprintf(wifiCfg.cfg.mask, sizeof(wifiCfg.cfg.mask), maskString.c_str()); + } + std::string gw; + if(0 == utils::GetDefaultGw(gw)){ + snprintf(wifiCfg.cfg.gw, sizeof(wifiCfg.cfg.gw), gw.c_str()); + } + snprintf(wifiCfg.cfg.dns, sizeof(wifiCfg.cfg.dns), utils::getDNS().c_str()); + ret = 0; + break; + } + + jsTmp = cJSON_GetObjectItem(obj, "ip"); + if (NULL == jsTmp){ + LOGE("parse ip error!"); + ret = -8; + break; + } + snprintf(wifiCfg.cfg.ip, sizeof(wifiCfg.cfg.ip), jsTmp->valuestring); + LOGI("ip:%s", wifiCfg.cfg.ip); + + jsTmp = cJSON_GetObjectItem(obj, "netmask"); + if (NULL == jsTmp){ + LOGE("parse netmask error!"); + ret = -9; + break; + } + snprintf(wifiCfg.cfg.mask, sizeof(wifiCfg.cfg.mask), jsTmp->valuestring); + LOGI("netmask:%s", wifiCfg.cfg.mask); + + jsTmp = cJSON_GetObjectItem(obj, "gateway"); + if (NULL == jsTmp){ + LOGE("parse gateway error!"); + ret = -10; + break; + } + snprintf(wifiCfg.cfg.gw, sizeof(wifiCfg.cfg.gw), jsTmp->valuestring); + LOGI("gateway:%s", wifiCfg.cfg.gw); + + jsTmp = cJSON_GetObjectItem(obj, "dns"); + if (NULL == jsTmp){ + LOGE("parse dns error!"); + ret = -11; + break; + } + snprintf(wifiCfg.cfg.dns, sizeof(wifiCfg.cfg.dns), jsTmp->valuestring); + LOGI("ip:%s", wifiCfg.cfg.dns); + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + +int Backstage::setNetWifiCfg(const stNetWifi& wifiCfg) +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "set_wifiSettings"); + cJSON_AddStringToObject(json, "enctype", wifiCfg.encType); + cJSON_AddStringToObject(json, "ssid", wifiCfg.ssid); + cJSON_AddStringToObject(json, "pwd", wifiCfg.pwd); + cJSON_AddNumberToObject(json, "type", wifiCfg.cfg.type); + if(!wifiCfg.cfg.type){ + cJSON_AddStringToObject(json, "ip", wifiCfg.cfg.ip); + cJSON_AddStringToObject(json, "netmask", wifiCfg.cfg.mask); + if(wifiCfg.cfg.gw[0]){ + cJSON_AddStringToObject(json, "gateway", wifiCfg.cfg.gw); + } + if(wifiCfg.cfg.dns[0]){ + cJSON_AddStringToObject(json, "dns", wifiCfg.cfg.dns); + } + } + cJSON_AddBoolToObject(json, "enableAp", wifiCfg.enableAp); + cJSON_AddStringToObject(json, "apPwd", wifiCfg.apPwd); + cJSON_AddBoolToObject(json, "isApCfg", wifiCfg.isAPCfg); + cJSON_AddBoolToObject(json, "isDevCfg", true); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *jsTmp = cJSON_GetObjectItem(root, "ret"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -3; + break; + } + if (0 != jsTmp->valueint){ + LOGE("netconfig ret: %d", jsTmp->valueint); + ret = -4; + break; + } + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + +int Backstage::setNetWifiEnable(bool enable) +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "update_wifi_status"); + cJSON_AddBoolToObject(json, "status", enable); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *jsTmp = cJSON_GetObjectItem(root, "ret"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -3; + break; + } + if (0 != jsTmp->valueint){ + LOGE("netconfig ret: %d", jsTmp->valueint); + ret = -4; + break; + } + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + +int Backstage::getSsidList(stAccPoint accPointList[], int accPointListSize) +{ +#if 0 //test + int ret = -1; + std::vector vSsidList; + std::vector vSigLev; + std::vector vEncrypt; + ret = wifiScan(vSsidList, vSigLev, vEncrypt, targetSsid); + if(0 == ret){ + int i = 0; + for(auto& s : vSsidList){ + if(i < accPointListSize){ + if("" != s){ + snprintf(accPointList[i].ssid, sizeof(accPointList[i].ssid), s.c_str()); + accPointList[i].sigLev = vSigLev[i]; + accPointList[i].isEncrypt = vEncrypt[i]; + if(s == targetSsid){ + targetConn = wifiConnect(targetSsid, targetSsidPwd); + } + i++; + } + } + else{ + break; + } + } + ret = i; + } + return ret; +#else + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "get_wifiList"); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *obj = cJSON_GetObjectItem(root, "data"); + if (NULL == obj){ + LOGE("parse data error!"); + ret = -3; + break; + } + + cJSON *ap_arry = cJSON_GetObjectItem(obj, "wifiList"); + if( NULL == ap_arry ){ + LOGE("parse wifiList error!"); + ret = -4; + break; + } + int i = 0; + cJSON *client_list = ap_arry->child; + while( client_list != NULL ){ + if(i < accPointListSize){ + char *ssid = cJSON_GetObjectItem( client_list , "ssid")->valuestring; + if(ssid && *ssid){ + LOGI("ssid:%s", accPointList[i].ssid); + snprintf(accPointList[i].ssid, sizeof(accPointList[i].ssid), ssid); + accPointList[i].sigLev = cJSON_GetObjectItem( client_list , "sig")->valueint; + accPointList[i].isEncrypt = (bool)cJSON_GetObjectItem( client_list , "ept")->valueint; + accPointList[i].isConnected = (bool)cJSON_GetObjectItem( client_list , "conn")->valueint; + i++; + LOGI("ssid:%s, sigLev:%d, isEncrypt:%d, isConnected:%d", accPointList[i].ssid, accPointList[i].sigLev, accPointList[i].isEncrypt, accPointList[i].isConnected); + } + } + else{ + LOGE("space for ssid list not enough"); + break; + } + client_list = client_list->next ; + } + ret = i; + }while(0); + } + free(jsonBuf); + } + return ret; +#endif +} + +int Backstage::claerNetWifiCfg() +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "clear_wifiSettings"); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *jsTmp = cJSON_GetObjectItem(root, "ret"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -3; + break; + } + if (0 != jsTmp->valueint){ + LOGE("netconfig ret: %d", jsTmp->valueint); + ret = -4; + break; + } + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + +int Backstage::getNet4GCfg(stNet4G& n4gCfg) +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "get_4g_status"); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *obj = cJSON_GetObjectItem(root, "data"); + if (NULL == obj){ + LOGE("parse data error!"); + ret = -3; + break; + } + + cJSON *jsTmp = cJSON_GetObjectItem(obj, "hasDevice"); + if (NULL == jsTmp){ + LOGE("parse available error!"); + ret = -4; + break; + } + if (jsTmp->valueint < 0 || jsTmp->valueint > 1){ + LOGE("status available: %d", jsTmp->valueint); + ret = -5; + break; + } + n4gCfg.available = jsTmp->valueint; + LOGI("n4gCfg.available:%d", n4gCfg.available); + if(false == n4gCfg.available){ + ret = 0; + break; + } + + jsTmp = cJSON_GetObjectItem(obj, "status"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -6; + break; + } + if (jsTmp->valueint < 0 || jsTmp->valueint > 1){ + LOGE("status error: %d", jsTmp->valueint); + ret = -7; + break; + } + n4gCfg.enable = jsTmp->valueint; + LOGI("n4gCfg.enable:%d", n4gCfg.enable); + if(false == n4gCfg.enable){ + ret = 0; + break; + } + + jsTmp = cJSON_GetObjectItem(obj, "service_provider_type"); + if (NULL == jsTmp){ + LOGE("parse provider error!"); + ret = -8; + break; + } + n4gCfg.provider = jsTmp->valueint; + LOGI("provider:%d", n4gCfg.provider); + + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + +int Backstage::setNet4GEnable(bool enable) +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "update_4g_status"); + cJSON_AddBoolToObject(json, "status", enable); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *jsTmp = cJSON_GetObjectItem(root, "ret"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -3; + break; + } + if (0 != jsTmp->valueint){ + LOGE("netconfig ret: %d", jsTmp->valueint); + ret = -4; + break; + } + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + +int Backstage::reboot4G() +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "reboot_4g"); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *jsTmp = cJSON_GetObjectItem(root, "ret"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -3; + break; + } + if (0 != jsTmp->valueint){ + LOGE("netconfig ret: %d", jsTmp->valueint); + ret = -4; + break; + } + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + +int Backstage::getScreenSaverConfig(stScreensaverCfg& cfg) +{ + cfg.type = m_paramMng->getScreensaverType(); + cfg.interval = m_paramMng->getScreensaverInter(); + cfg.picQty = 0; + std::string screensaverCfg(m_paramMng->getScreensaverPics()); + while(screensaverCfg.length()){ + unsigned iPos = screensaverCfg.find(";"); + if(iPos != std::string::npos){ + snprintf(&cfg.pic[cfg.picQty][0], sizeof(cfg.pic[0]), screensaverCfg.substr(0, iPos).c_str()); + LOGI("screenasver %d : %s", cfg.picQty, &cfg.pic[cfg.picQty][0]); + cfg.picQty++; + screensaverCfg = (screensaverCfg.length() > iPos + 1 ? screensaverCfg.substr(iPos + 1) : ""); + } + else{ + return -1; + } + } + + return 0; +} + +int Backstage::sendPassword(const char *password) +{ + if(m_objs){ + LOGI("sendPassword"); + GPeInput *peinput = (GPeInput*)m_objs->findObject("peinput"); + if (nullptr != peinput){ + peinput->sendPassword(password); + } + } + return 0; +} + +void Backstage::resetDecisionCenterTimer() +{ + if(m_objs){ + LOGI("resetDecisionCenterTimer"); + GDecisionCenter *decCenter = (GDecisionCenter*)m_objs->findObject("decisionCenter"); + if (nullptr != decCenter){ + decCenter->timerReset(); + } + } +} + +int Backstage::pauseDataFlow() +{ + if(m_objs){ + LOGI("pause Data Flow"); + #if 0 + GDecisionCenter *decCenter = (GDecisionCenter*)m_objs->findObject("decisionCenter"); + if (nullptr != decCenter){ + if(!Singleton::GetInstance()->isHardwareTesting()){ + decCenter->pauseDataFlowAfterAllNotRecoResRecvd(); + } + else{ + LOGI("is testing hardware..."); + } + return 0; + } + #else + GTrackerLock *pTrackLock = (GTrackerLock*)m_objs->findObject("trackerLock"); + GStandby *pStandby = (GStandby*)m_objs->findObject("standby"); + if (nullptr != pTrackLock && nullptr != pStandby){ + if(!Singleton::GetInstance()->isHardwareTesting()){ + pTrackLock->lockCtrl(true); + } + else{ + LOGI("is testing hardware..."); + } + return 0; + } + #endif + } + return -1; +} + +int Backstage::resumeDataFlow() +{ + if(m_objs){ + LOGI("resume Data Flow"); + #if 0 + GDecisionCenter *decCenter = (GDecisionCenter*)m_objs->findObject("decisionCenter"); + if (nullptr != decCenter){ + decCenter->resumeDataFlow(); + return 0; + } + #else + GTrackerLock *pTrackLock = (GTrackerLock*)m_objs->findObject("trackerLock"); + if (pTrackLock){ + pTrackLock->lockCtrl(false); + return 0; + } + #endif + } + return -1; +} + +int Backstage::candidateChoosedInPopupWindow(int index) +{ + LOGI("candidateChoosedInPopupWindow:%d", (int)index); + if(index >= 0){ + RWProtocol::getInstance()->sendSelectedItem(index); + } + else{ + if(m_objs){ + LOGI("cancle choosed by user"); + GDecisionCenter *decCenter = (GDecisionCenter*)m_objs->findObject("decisionCenter"); + if (nullptr != decCenter){ + decCenter->recheckResult(2);//二次核验未经许可人员 + } + } + } + return 0; +} + +int Backstage::resetNetworkCfg() +{ + int ret = -1; + cJSON *json = cJSON_CreateObject(); + if (!json){ + LOGE("cJSON_CreateObject list FAIL!"); + return ret; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(json);}); + cJSON_AddStringToObject(json, "cmd", "set_default_setting"); + char *jsonBuf = cJSON_PrintUnformatted(json); + if(jsonBuf){ + LOGI("udp json:%s", jsonBuf); + std::string reply; + if(0 == udpSend(std::string(jsonBuf), reply)){ + do{ + cJSON *root = cJSON_Parse(reply.c_str()); + if (!root){ + LOGE("parse root error. "); + ret = -2; + break; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + cJSON *jsTmp = cJSON_GetObjectItem(root, "ret"); + if (NULL == jsTmp){ + LOGE("parse status error!"); + ret = -3; + break; + } + if (0 != jsTmp->valueint){ + LOGE("reset Network Cfg ret: %d", jsTmp->valueint); + ret = -4; + break; + } + ret = 0; + }while(0); + } + free(jsonBuf); + } + return ret; +} + +int Backstage::udpSend(const string &sendData, string &recvData) +{ + int fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) + { + LOGE("create socket fail!"); + return -1; + } + + timeval tv = {30, 0}; + int ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char*)&tv, sizeof(timeval)); + if (ret) + { + ::close(fd); + return -2; + } + + struct sockaddr_in sin; + bzero(&sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(INADDR_ANY); + sin.sin_port = htons(6788); + sendto(fd, sendData.c_str(), sendData.length(), 0, (struct sockaddr *)&sin, sizeof(struct sockaddr)); + + char buff[1024 * 8] = {0}; + #if 0 + int len = recvfrom(fd, buff, sizeof(buff) - 1, 0, nullptr, nullptr); + #else + int len = 0; + int tryTime = 3; + do{ + len = recvfrom(fd, buff, sizeof(buff) - 1, 0, nullptr, nullptr); + }while(len < 0 && 4 == errno && tryTime--); + #endif + if (len < 0) + { + LOGE("no recv data, ret:%d, errno:%d", len, errno); + ::close(fd); + return -3; + } + if (buff[len - 2] == '\n' && buff[len - 1] == '\0') + { + buff[len - 2] = '\0'; + len -= 1; + } + else + { + buff[len] = '\0'; + len++; + } + LOGD("recv[%d]:%s", strlen(buff), buff); + recvData = buff; + + ::close(fd); + return 0; +} + +bool Backstage::isWiegandIoTestOk() +{ + LOGI("isWiegandIoTestOk"); + GPeInput* pPeInput = (GPeInput*)m_objs->findObject("peInput"); + if(pPeInput){ + pPeInput->hardwareTest(enWgOut); + usleep(300000); + return pPeInput->isWiegandLoopTestOk(); + } + return false; +} + +bool Backstage::isRelayAndGpioTestOk() +{ + LOGI("isRelayAndGpioTestOk"); + bool ret = true; + for(int i=0; i::GetInstance()->hasGpio((BasePeripheral::enGpio)i)){ + LOGI("has no gpio%d", i); + continue; + } + int value = 0; + if(Singleton::GetInstance()->getGpioValue((BasePeripheral::enGpio)i, value) < 0){ + LOGE("get Gpio%d Value failed!", i); + ret = false; + } + if(value != 1){ + LOGE("gpio%d not high before relay on", i); + ret = false; + } + } + LOGI("relay on"); + Singleton::GetInstance()->controlKZOut(true); + usleep(100000); + for(int i=0; i::GetInstance()->hasGpio((BasePeripheral::enGpio)i)){ + LOGI("has no gpio%d", i); + continue; + } + int value = 0; + if(Singleton::GetInstance()->getGpioValue((BasePeripheral::enGpio)i, value) < 0){ + LOGE("get Gpio%d Value failed!", i); + ret = false; + } + if(value != 0){ + LOGE("gpio%d not low after relay on", i); + ret = false; + } + } + LOGI("relay off"); + Singleton::GetInstance()->controlKZOut(false); + return ret; +} + +bool Backstage::isRs485TestOk() +{ + LOGI("isRs485TestOk"); + + Singleton::GetInstance()->setTestingFlag(true); + ON_SCOPE_EXIT([] { Singleton::GetInstance()->setTestingFlag(false); }); + usleep(100000); + + std::string usbTo485DevNode; + do{ + std::string cmd = "ls /sys/bus/usb-serial/drivers/ftdi_sio/ | grep tty"; + if(utils::read_popen(cmd, usbTo485DevNode) > 0){ + LOGI("get ftdi_sio usb to rs485 dev node:%s", usbTo485DevNode.c_str()); + break; + } + cmd = "ls /sys/bus/usb-serial/drivers/ch341-uart/ | grep ttyUSB0"; + if(utils::read_popen(cmd, usbTo485DevNode) > 0){ + LOGI("get ch341-uart usb to rs485 dev node:%s", usbTo485DevNode.c_str()); + break; + } + LOGE("get usb to rs485 dev node failed!"); + return false; + }while(0); + LOGI("Dev Node:%s", usbTo485DevNode.c_str()); + const std::string devNode = "/dev/" + usbTo485DevNode; + int usbTo485 = open(devNode.c_str(), O_RDWR | O_NOCTTY); + if(usbTo485 < 0){ + return false; + } + setSerialOpt(usbTo485, 9600, 8, 'N', 1); + + LOGI("rs485 send str 123456"); + Singleton::GetInstance()->rs485Send((const unsigned char*)"123456", strlen("123456")); + + char buffer[32] = {0}; + int readBytes = read(usbTo485, buffer, sizeof(buffer) - 1); + LOGI("usb2485 recv: %s", buffer); + if(readBytes <= 0){ + close(usbTo485); + return false; + } + + int writeLen = write(usbTo485, buffer, readBytes); + LOGI("usb2485 send data:%s, len:%d", buffer, writeLen); + + usleep(100000); + + int len = Singleton::GetInstance()->rs485Recv((unsigned char*)buffer, sizeof(buffer)); + LOGI("rs485 recv len:%d", len); + if(len <= 0){ + close(usbTo485); + return false; + } + LOGI("data: %s", (const char*)buffer); + close(usbTo485); + + return (!memcmp("123456", buffer, strlen("123456"))); +} + +bool Backstage::isReaderUnderScreenTestOk() +{ + LOGI("isReaderUnderScreenTestOk"); + GPeInput* pPeInput = (GPeInput*)m_objs->findObject("peInput"); + if(!pPeInput){ + return false; + } + pPeInput->hardwareTest(enReadCardUnderScreen); + return pPeInput->isReaderUnderScreenTestOk(); +} + +bool Backstage::isWifiTestOk() +{ + LOGI("isWifiTestOk"); + #define TEST_SSID "reconova" // "RW-5F" // + #define TEST_PWD "12345678" //"RW@sz=B103#" // + + const int ssidListSize = 64; + stAccPoint ssidList[ssidListSize]; + int ret = getSsidList(ssidList, ssidListSize); + LOGI("ssid list size:%d", ret); + if(ret > 0){ + for(int i=0; i 45){ + return wifiConnect(TEST_SSID, TEST_PWD); + } + } + } + return false; +} + +bool Backstage::isRtcTestOk() +{ + LOGI("isRtcTestOk, time:%lld", utils::getNowTimeMS()); + //return utils::getNowTimeMS() > 946656000000; //20000101 00:00:00 + return FileUtils::fileIsExist("/data/.rtc_test_ok"); +} + +bool Backstage::isWireEthTestOk() +{ + LOGI("isWireEthTestOk");sleep(1);return true; +} + +bool Backstage::is4gTestOk() +{ + LOGI("is4gTestOk");sleep(1);return true; +} + +bool Backstage::isSerial1TestOk() +{ + LOGI("isSerial1TestOk"); + + system("killall skcaper"); + Singleton::GetInstance()->setTestingFlag(true); + ON_SCOPE_EXIT([] { Singleton::GetInstance()->setTestingFlag(false); }); + usleep(100000); + + const std::string devNode = "/dev/ttyS3"; + LOGI("Dev Node:%s", devNode.c_str()); + int fdSerial1 = open(devNode.c_str(), O_RDWR | O_NOCTTY); + if(fdSerial1 < 0){ + LOGE("open %s failed!", devNode.c_str()); + return false; + } + setSerialOpt(fdSerial1, 9600, 8, 'N', 1); + + const char* testData = "123456"; + int writeLen = write(fdSerial1, testData, strlen(testData)); + LOGI("write len:%d", writeLen); + + usleep(100000); + + char buffer[32] = {0}; + int readBytes = read(fdSerial1, buffer, sizeof(buffer) - 1); + LOGI("serial0 read bytes: %d", readBytes); + if(readBytes <= 0){ + close(fdSerial1); + return false; + } + close(fdSerial1); + LOGI("data: %s", (const char*)buffer); + return (!memcmp(testData, buffer, strlen(testData))); +} + + +void Backstage::screenTest() +{ + LOGI("screenTest"); + GPeInput* pPeInput = (GPeInput*)m_objs->findObject("peInput"); + if(pPeInput){ + pPeInput->hardwareTest(enLcd); + } +} + +void Backstage::speakerTest() +{ + LOGI("speakerTest"); + GPeInput* pPeInput = (GPeInput*)m_objs->findObject("peInput"); + if(pPeInput){ + pPeInput->hardwareTest(enSpeaker); + } +} + +void Backstage::microphoneTest(bool record) +{ + LOGI("microphoneTest"); + GPeInput *pPeInput = (GPeInput *)m_objs->findObject("peInput"); + if (pPeInput) { + pPeInput->hardwareTest(record ? enMicrophoneRecord : enMicrophonePlay); + } +} + +void Backstage::audioSwitchTest() { + LOGI("Backstage::audioSwitchTest()"); + auto pPeInput = reinterpret_cast(m_objs->findObject("peInput")); + if (pPeInput != nullptr) { + pPeInput->hardwareTest(enAuidoSwitch); + } +} + +void Backstage::tpTest() +{ + LOGI("tpTest"); + GPeInput* pPeInput = (GPeInput*)m_objs->findObject("peInput"); + if(pPeInput){ + //pPeInput->hardwareTest(enTp); + } +} + +void Backstage::irCamTest() +{ + LOGI("irCamTest"); + GPeInput* pPeInput = (GPeInput*)m_objs->findObject("peInput"); + if(pPeInput){ + pPeInput->hardwareTest(enIrCamOn); + sleep(3); + pPeInput->hardwareTest(enIrCamOff); + } +} + +void Backstage::irLedTest() +{ + LOGI("irLedTest"); + GPeInput* pPeInput = (GPeInput*)m_objs->findObject("peInput"); + if(pPeInput){ + pPeInput->hardwareTest(enIrCamOn); + for(int i=0; i<3; i++){ + Singleton::GetInstance()->setIRledBrightness(0); + usleep(500000); + Singleton::GetInstance()->setIRledBrightness(255); + usleep(500000); + } + pPeInput->hardwareTest(enIrCamOff); + } +} + +void Backstage::ageingTest(unsigned hours) +{ + LOGI("ageingTest"); + std::string cmd{"{\"cmd\":\"set_ageing_test\",\"sw\":"}; + if(hours){ + cmd += "true,\"all_time\":"; + cmd += utils::to_string(hours); + cmd += "}"; + } + else{ + cmd += "false}"; + } + udpLoopToSvr(cmd); +} + +int Backstage::getMacFromMes(const char* mesAddrAndProdNo, const char* pcbSeq, std::string& mac) +{ + LOGI("getMacFromMes:%s, %s", mesAddrAndProdNo, pcbSeq); + const std::string tmp(mesAddrAndProdNo); + unsigned iPos = tmp.find("/"); + if(iPos == std::string::npos){ + return -1; + } + + std::string mesAddr = tmp.substr(0, iPos); + std::string prodNo = tmp.substr(iPos + 1); + std::string strPcbSeq = pcbSeq; + std::string cmd = "curl -s -K 12 -m 20 -k -X POST \"http://"; + cmd += utils::trim(mesAddr); + cmd += "/mrs/getProdField?prodNo="; + cmd += utils::trim(prodNo); + cmd += "&pcbSeq="; + cmd += utils::trim(strPcbSeq); + cmd += "&fieldName=lanmac\""; + LOGI("cmd:%s", cmd.c_str()); + if(utils::read_popen(cmd, mac) <= 0){ + LOGE("get mac failed!"); + return -2; + } + if(mac.length() != 12){ + LOGE("mac invalid, len:%d, mac:%s", mac.length(), mac.c_str()); + return -3; + } + for(int i=5; i>0; i--){ + mac.insert(i * 2, 1, ':'); + } + LOGI("mac:%s", mac.c_str()); + cmd = "keydata set mac "; + cmd += mac; + cmd += " -f"; + LOGI("cmd:%s", cmd.c_str()); + int nReturn = utils::RW_System(cmd.c_str()); + int nResult = WEXITSTATUS(nReturn); + if(nResult != 0){ + LOGE("str=%s, nReturn=%d, nResult=%d", cmd.c_str(), nReturn, nResult); + return -1; + } + cmd = "echo -n \""; + cmd += mac; + cmd += " \" > /data/.HWaddr"; + LOGI("cmd:%s", cmd.c_str()); + nReturn = utils::RW_System(cmd.c_str()); + nResult = WEXITSTATUS(nReturn); + if(nResult != 0){ + LOGE("str=%s, nReturn=%d, nResult=%d", cmd.c_str(), nReturn, nResult); + return -1; + } + return 0; +} + +bool Backstage::isAgeing(std::string& hours) +{ + LOGI("isAgeing"); + if(FileUtils::fileIsExist(AGEING_TIME_FILE)){ + if(0 == utils::read_file(AGEING_TIME_FILE, hours)){ + LOGI("ageing time:%s hours", hours.c_str()); + return true; + } + } + return false; +} + +int Backstage::getKeyDataMac(std::string& mac) +{ + LOGI("getKeyDataMac"); + return utils::read_popen("keydata get mac", mac); +} + +int Backstage::getRecoUiAdConfig(stScreensaverCfg& cfg) +{ + cfg.type = 1; + cfg.interval = m_paramMng->getAdInter(); + cfg.picQty = 0; + LOGI("reco ui ad config:%s", m_paramMng->getAdPics().c_str()); + std::string screensaverCfg(m_paramMng->getAdPics()); + while(screensaverCfg.length()){ + unsigned iPos = screensaverCfg.find(";"); + if(iPos != std::string::npos){ + snprintf(&cfg.pic[cfg.picQty][0], sizeof(cfg.pic[0]), screensaverCfg.substr(0, iPos).c_str()); + LOGI("ad %d : %s", cfg.picQty, &cfg.pic[cfg.picQty][0]); + cfg.picQty++; + screensaverCfg = (screensaverCfg.length() > iPos + 1 ? screensaverCfg.substr(iPos + 1) : ""); + } + else{ + return -1; + } + } + return 0; +} + +int Backstage::recoUiTypeSwitch(unsigned x, unsigned y, unsigned w, unsigned h) +{ + GCamera* pcam = (GCamera*)m_objs->findObject("normal"); + if (nullptr != pcam){ + pcam->voSetDisWin(x, y, w, h); + } + setLogo(getLogo());//get logo when reci ui switch + + return 0; +} + +int Backstage::getDevPwd(int& type, std::string& pwd) +{ + int ret = DBManage::getInstance()->getDevicePin(pwd); + if(0 == ret && pwd.length()){ + type = 2; + return 0; + } + + pwd = m_paramMng->getLocalDevPwd(); + type = 1; + return 0; +} + +int Backstage::setLocalDevPwd(const std::string& pwd) +{ + m_paramMng->setLocalDevPwd(pwd); + + //该参数配置需要支持清空(取消本地密码操作) + //清空时参数对应的更新处理不会关闭识别界面密码按键 + //因此需要在这里关闭密码按键显示 + if(0 == pwd.length()){ + LOGI("hide password button cause pwd deleted by user"); + View::getInstance()->setPwdButton(false); + } + + return 0; +} + +int Backstage::getKeyDataHardware(std::string& hardware) +{ + LOGI("getKeyDataHardware"); + return utils::read_popen("keydata get hardware", hardware); +} + +int Backstage::setKeyDataHardwareAndUpdataFunction(const std::string& hardware) +{ + LOGI("set hardware:%s", hardware.c_str()); + std::string setHwCmd{"keydata set hardware "}; + setHwCmd += hardware; + setHwCmd += " -f"; + system(setHwCmd.c_str()); + + std::ostringstream oss; + oss << "echo " << hardware << " > " WEB_DATA_PATH ".hardversion; sync"; + auto command = oss.str(); + LOGD("command: %s", command.c_str()); + system(command.c_str()); + + DevVersion::getInstance()->init(); // 工装重新录入型号后,再重新加载 + + auto manufacturer = DevVersion::getInstance()->getManu(); + if (manufacturer == Manu_E::ManuRWRk1109V05) { + Singleton::GetInstance()->setAudioOutEnabled(m_paramMng->getAudioOutEnabled()); + } + + const bool hasReaderUnderScreen = ('2' == hardware[strlen("HWA531052") - 1]); + Singleton::GetInstance()->functionSwitch(0, hasReaderUnderScreen); + const bool hasTp = ('1' == hardware[strlen("HWA5310522C11") - 1]); + LOGI("has TP:%d", hasTp); + View::getInstance()->showCursorSwitch(!hasTp); + return 0; +} + + +int Backstage::setSetupAlreadyFlag() +{ + FileUtils::removeFile(SETUP_ALREADY_FILE); + return 0; +} + +int Backstage::getParkInfo(std::string& info) +{ + info = m_paramMng->getParkInfo(); + return 0; +} + +int Backstage::setParkInfo(const std::string& info) +{ + m_paramMng->setParkInfo(info); + return 0; +} + +int Backstage::getDevPosi(std::string& posi) +{ + posi = m_paramMng->getDevicePosition(); + return 0; +} + +int Backstage::setDevPosi(const std::string& posi) +{ + m_paramMng->setDevicePosition(posi); + return 0; +} + +int Backstage::getRs485Cfg() +{ + if(m_paramMng->getRs485Cfg() == -1){ + if(m_paramMng->getAccessController() >= 0){return 1;} //协议1 + else if(m_paramMng->getPassCheckByRs485()){return 2;} //协议2 + return 0; //禁用 + } + return m_paramMng->getRs485Cfg(); +} + +int Backstage::setRs485Cfg(int cfg) +{ + #if 0 + switch (cfg){ + case 0:{m_paramMng->setAccessController(-1);m_paramMng->setPassCheckByRs485(false);}break; + case 1:{m_paramMng->setPassCheckByRs485(false);m_paramMng->setAccessController(0);}break;//协议1:门禁控制器 + case 2:{m_paramMng->setPassCheckByRs485(true);m_paramMng->setAccessController(-1);}break;//协议2:闸机信号反馈 + default:LOGE("rs485 cfg error!");break; + } + #else + m_paramMng->setRs485Cfg(cfg); + #endif + return 0; +} + +int Backstage::setReverseAccessSw(bool enabled) { + int ret = -1; + if (m_paramMng != nullptr) { + m_paramMng->setReverseAccessSw(enabled); + ret = 0; + } + return ret; +} + +bool Backstage::getReverseAccessSw() const { + bool ret = false; + if (m_paramMng != nullptr) { + ret = m_paramMng->getReverseAccessSw(); + } + return ret; +} + +int Backstage::getRs485Prot1Addr() +{ + return m_paramMng->getAccessController(); +} + +int Backstage::setRs485Prot1Addr(int addr) +{ + if(addr < 0 || addr > 255){return -1;} + m_paramMng->setAccessController(addr);return 0; +} + +int Backstage::getRs485Prot3Cfg(int& handCfg, int& feetCfg) +{ + handCfg = m_paramMng->getStaticHandCfg(); + feetCfg = m_paramMng->getStaticFeetCfg(); + return 0; +} + +int Backstage::setRs485Prot3Cfg(int handCfg, int feetCfg) +{ + m_paramMng->setStaticHandCfg(handCfg); + m_paramMng->setStaticFeetCfg(feetCfg); + return 0; +} + +int Backstage::getGPIOCfg() +{ + //return m_paramMng->getGpio4Sw() ? m_paramMng->getGpio4Use() + 1 : 0; + return 0; +} + +int Backstage::setGPIOCfg(int cfg) +{ +#if 0 + switch (cfg){ + case 0:{m_paramMng->setGpio4Sw(false);}break;//禁用 + case 1:{m_paramMng->setGpio4Sw(true);m_paramMng->setGpio4Use(0);}break;//开门信号上报(门磁) + default:LOGE("gpio cfg error!");break; + } +#endif + return 0; +} + +int Backstage::getIDFaceVerifySw() +{ + return m_paramMng->getFaceIDVerifySw(); +} + +int Backstage::setIDFaceVerifySw(bool sw) +{ + m_paramMng->setFaceIDVerifySw(sw); + return 0; +} + +int Backstage::getBtLockCfg(BtDoorLock& cfg) +{ + cfg.isEnable = m_paramMng->getBleLockSw(); + + int manu[5] = {0}; + std::string manuS = m_paramMng->getBleManu(); + sscanf(manuS.c_str(), "%d,%d,%d,%d,%d", manu, manu+1, manu+2, manu+3, manu+4); + + char name[5][128] = {0}; + std::string nameS = m_paramMng->getBleName(); + sscanf(nameS.c_str(), "%[^,],%[^,],%[^,],%[^,],%s", name[0], name[1], name[2], name[3], name[4]); + + char mac[5][20] = {0}; + std::string macS = m_paramMng->getBleMac(); + sscanf(macS.c_str(), "%[^,],%[^,],%[^,],%[^,],%s", mac[0], mac[1], mac[2], mac[3], mac[4]); + + for(cfg.qty = 0; cfg.qty < 5 && manu[cfg.qty] > 0; cfg.qty++) + { + LOGD("manu[%d]=%d", cfg.qty, manu[cfg.qty]); + cfg.manufacturer.emplace_back(manu[cfg.qty]); + + LOGD("name[%d]=%s", cfg.qty, name[cfg.qty]); + cfg.position.emplace_back(name[cfg.qty]); + + LOGD("mac[%d]=%s", cfg.qty, mac[cfg.qty]); + cfg.mac.emplace_back(mac[cfg.qty]); + } + return 0; +} + +int Backstage::setBtLockCfg(const BtDoorLock& cfg) +{ + LOGI("setBtLockCfg"); + + blueToothMng::getInstance().clearBleLock(); + + std::string bleManu; + std::string bleName; + std::string bleId; + for(int i=0; isetBleManu(bleManu.c_str()); + m_paramMng->setBleName(bleName.c_str()); + m_paramMng->setBleMac(bleId.c_str()); + m_paramMng->setBleLockSw(cfg.isEnable); + return 0; +} + +int Backstage::getBtLockRemainingBatPwr(const std::string& mac) +{ + return blueToothMng::getInstance().getElecValue(blueToothMng::enBleLockManu::BYX, mac.c_str()); +} + +bool Backstage::getHealthCodeSw() +{ + return m_paramMng->getHealthCodeSw(); +} + +int Backstage::setHealthCodeSw(bool sw) +{ + m_paramMng->setHealthCodeSw(sw); + if(sw){ + m_paramMng->setRecoSw(true); + m_paramMng->setFaceIDVerifySw(true); + } + return 0; +} + +bool Backstage::getHealthCodeNoFaceRequired(){ + return m_paramMng->getHealthNoFaceRequired(); +} + +int Backstage::setHealthCodeNoFaceRequired(bool sw){ + m_paramMng->setHealthNoFaceRequired(sw); + return 0; +} + +bool Backstage::getHealthCodeAllowStranger() +{ + return m_paramMng->getHealthCodeAllowStrangerSw(); +} + +int Backstage::setHealthCodeAllowStranger(bool sw) +{ + m_paramMng->setHealthCodeAllowStrangerSw(sw); + return 0; +} + +int Backstage::getHealthCodePassCfg(int& codeColorCfg, int& c19tCfg, int& tripCfg, int& abtCfg) +{ + codeColorCfg = m_paramMng->getHealthCodeColorPassCfg(); + c19tCfg = m_paramMng->getHealthC19TResPassCfg(); + tripCfg = m_paramMng->getHealthTripResPassCfg(); + abtCfg = m_paramMng->getHealthAbtResPassCfg(); + return 0; +} + +int Backstage::setHealthCodePassCfg(int codeColorCfg, int c19tCfg, int tripCfg, int abtCfg) +{ + m_paramMng->setHealthCodeColorPassCfg(codeColorCfg); + m_paramMng->setHealthC19TResPassCfg(c19tCfg); + m_paramMng->setHealthTripResPassCfg(tripCfg); + m_paramMng->setHealthAbtResPassCfg(abtCfg); + return 0; +} + +std::string Backstage::utfRawStrToEncodeStr(const std::string &str) { + return utils::utfRawStrToEncodeStr(str); +} + +int Backstage::udpLoopToSvr(const std::string &sendData) +{ + int udpFd = socket(AF_INET, SOCK_DGRAM, 0); + if (udpFd < 0){ + LOGE("create socket fail!"); + } + + timeval tv = {1, 0}; + int ret = setsockopt(udpFd, SOL_SOCKET, SO_RCVTIMEO, (char*)&tv, sizeof(timeval)); + if (ret){ + LOGE("setsockopt failed"); + ::close(udpFd); + udpFd = -1; + } + struct sockaddr_in sin; + bzero(&sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(INADDR_ANY); + sin.sin_port = htons(6790); + sendto(udpFd, sendData.c_str(), sendData.length(), 0, (struct sockaddr *)&sin, sizeof(struct sockaddr)); + LOGI("udp send:%s", sendData.c_str()); + ::close(udpFd); + return 0; +} + + diff --git a/Linguist/interface/BackStage.h b/Linguist/interface/BackStage.h new file mode 100644 index 0000000..12cbd1a --- /dev/null +++ b/Linguist/interface/BackStage.h @@ -0,0 +1,344 @@ +#ifndef BACKSTAGEI_H +#define BACKSTAGEI_H + +#include "BackstageInterfaceForUi.h" +#include "param_manage.h" +#include "golib/golib.h" + + +class Backstage : public BackstageInterfaceForUi +{ +public: + Backstage(void* pParaMng, void* pObjs); + virtual ~Backstage(); + + int registerPerson(char *name, char *term, int nDataOrigin = 1); + int startIdentyState(bool setfaceReco = true, bool setPeInput = true); + int stopIdentyState(bool setfaceReco = true, bool setPeInput = true); + + //工程设置 + int verifyFactorySettingPwd(const char *pwd);//验证密码 + int recoveryFactorySetting();//恢复出厂设置 + + //设备设置 + int getDeviceId(char *devId, int len);//获取设备id + int getHardwareConfig(char *hardVer, int len); + int getStorSpace(int &total, float &free);//获取存储空间 + int getAppVersion(char *appVer, int len);//获取应用版本号 + int getRegisterNum();//获取注册人员数 + int getAccessRecordNotUpload();//获取未上传通行记录 + int getAccessRecordQty();//获取通行记录条数 + int getVolume();//获取音量大小 + int setVolume(int vol);//设置音量大小 + int getLcdBrightness();//获取屏幕亮度 + int setLcdBrightness(int brightness);//设置屏幕亮度 + bool getFillLightSw();//获取智能补光开关 + int setFillLightSw(bool isOpen);//获取智能补光开关 + int getStandbyTime();//获取待机时间 + int setStandbyTime(int time);//设置待机时间 + int getCloseScreenTime();//获取关屏等待时间 + int setCloseScreenTime(int time);//获取关屏等待时间 + int getLanguage();//获取语言 + int setLanguage(int lang);//设置语言 + //网络设置 + int getIP(char *ip, int len, int& type);//获取IP + int setIP(char *ip);//设置IP + enIpMethod getIpMethod();//获取IP方法 + int setIpMethod(enIpMethod ipMethod);//设置IP方法 + int getSubnetMask(char *mask, int len);//获取子网掩码 + int setSubnetMask(char *mask);//设置子网掩码 + int getGateway(char *gateway, int len);//获取默认网关 + int setGateway(char *gateway);//设置默认网关 + int getDNS(char *dns, int len);//获取DNS + int setDNS(char *dns);//设置DNS + int getEthMac(char *mac, int len);//获取mac + int getWifiMac(char *mac, int len);//获取wifi mac + int getServerAddr(char *addr, int len);//获取服务器ip + int setServerAddr(char *addr, bool byQrcode = false);//设置服务器ip + int testServerIP(char *addr, float &time);//测试服务器ip,成功返回0,失败-1 + int getIotServerIP(char *ip, int len);//获取服务器ip + int setIotServerIP(char *ip);//设置服务器ip + int getIotPort();//获取端口号, 成功返回端口号,失败返回-1 + int setIotPort(int port);//设置端口号 + bool getIpShowSw(); + int setIpShowSw(bool sw); + //蓝牙设置 + //if success, return 0, else return err num; + int getBtSwitch(bool &isOpen); + int getBtName(string &devName); + int getBtPairedDev(list &devList); + int getBtAvailDev(list &devList); + int getBtAllInfo(BluetoothStat_t &bluetoothStat); + + int btScan(list &devList);//这个接口不需要吧?现在是定时的去搜索?所以点击“可用设备"条目时,直接调用getBtAvailDev就可以了? + int btSetSwitch(bool isOpen); + int btSetName(const string &devName); + int btPaire(const string &devId); + int btDisPaire(const string &devId); + int btConnect(const string &devId); + int btDisConnect(const string &devId); + int btRenameDev(const string &devId, const string &devName); + + bool getParamBluetoothEnable();//获取蓝牙的开关 + int setParamBluetoothEnable(bool sw);//设置蓝牙的开关 + std::string getParamBluetoothName();//获取蓝牙设备名称 + int setParamBluetoothName(std::string name);//设置蓝牙设备名称 + //门禁设置 + int getUnlockTime();//获取开锁时间 + int setUnlockTime(int time);//设置开锁时间 + int getUnlockDelay();//获取开锁延时 + int setUnlockDelay(int time);//设置开锁延时 + enUnlockSignal getUnlockSig();//获取开锁信号 + int setUnlockSig(enUnlockSignal value);//设置开锁信号 + enAssist getAssistIn();//获取辅助输入 + int setAssistIn(enAssist assist);//设置辅助输入 + enAssist getAssistOut();//获取辅助输出 + int setAssistOut(enAssist assist);//设置辅助输出 + enWiegand getWiegandIn();//获取韦根输入 + int setWiegandIn(enWiegand wiegand);//设置韦根输入 + enWiegand getWiegandOut();//获取韦根输出 + int setWiegandOut(enWiegand wiegand);//设置韦根输出 + enBaudRate getBaudRate();//获取波特率 + int setBaudRate(enBaudRate baudRate);//设置波特率 + int getWarningSig();//获取报警信号 + int setWarningSig(int signal);//设置报警信号 + //交互提示 + enLogo getLogo();//获取logo + int setLogo(enLogo logo);//设置logo + int getCustomLogo(char *logo, int len); + enLogo getLogoTime();//获取logo+time + int setLogoTime(enLogo logo);//设置logo+time + enLogo getBackground();//获取背景图 + int setBackground(enLogo logo);//设置背景图 + enRecogResult getSuccessResult(char *data, int len);//获取成功结果 + int setSuccessResult(enRecogResult result, char *data);//设置成功结果 + enRecogResult getFailResult(char *data, int len);//获取失败结果 + int setFailResult(enRecogResult result, char *data);//设置失败结果 + bool getPlayAudioSw();//获取语音播报开关 + int setPlayAudioSw(bool isOpen);//设置语音播报开关 + + //人脸识别 + bool getIdentificationSw();//获取身份核验开关 + int setIdentificationSw(bool sw);//设置身份核验开关 + enSimilarityTh getSimilarityTh();//获取相似度阈值 + int setSimilarityTh(enSimilarityTh th);//设置相似度阈值 + int setCustomSimilarity(int sim);//设置自定义识别相似度 + int getCustomSimilarity();//获取自定义识别相似度 + bool getLivingBodySw();//获取活体开关 + int setLivingBodySw(bool isOpen);//设置活体开关 + enLivingBodyTh getLivingBodyTh();//获取活体检测阈值 + int setLivingBodyTh(enLivingBodyTh th);//设置活体检测阈值 + bool getLivingBodyFailSw();//获取活体失败图片留存开关 + int setLivingBodyFailSw(bool isOpen);//设置失败图片留存开关 + int getVerifyInterval();//获取验证间隔时间 + int setVerifyInterval(int time);//设置验证间隔时间 + enRecogDistance getRecogDistance();//获取识别距离 + int setRecogDistance(enRecogDistance distance);//设置识别距离 + enRecogAngle getRecogAngle();//获取识别角度 + int setRecogAngle(enRecogAngle angle);//设置识别角度 + int getMaxTraceNum();//获取人脸最大跟踪数 + int setMaxTraceNum(int num);//设置人脸最大跟踪数 + enFaceQuality getFaceQuality();//获取人脸质量阈值 + int setFaceQuality(enFaceQuality quality);//设置人脸质量阈值 + virtual bool getDynamicFeatureSw();//获取动态底库的开关 + virtual int setDynamicFeatureSw(bool sw);//设置动态底库的开关 + //系统设置 + bool getNtpServerSw();//获取NTP服务开关 + int setNtpServerSw(bool isOpen);//设置NTP服务开关 + int getNtpServerAddr(char *addr, int len);//获取NTP服务地址 + int setNtpServerAddr(char *addr);//设置NTP服务地址 + int testNtpServer(char *addr, float &time);//测试NTP服务, 成功返回0,失败-1 + int getNtpServerPort();//获取NTP端口,成功返回端口号,失败返回-1 + int setNtpServerPort(int port);//设置NTP服务端口 + int getNtpCheckInterval(); + int setNtpCheckInterval(int interval); + int getNtpTimeZone(char *timeZone, int len); + int setNtpTimeZone(char *timeZone); + int setVerifyFactorySettingPwd(char *pwd);//设置工程密码 + int testHardware();//硬件检测 + int cleanData();//清除数据 + int devReboot();//重启设备 + + int startCapture();//start capture on register + int deletePerson(long long personID); + int queryPersonList(long long* pPersonIDBuff, int nBuffCount, long long startID, int& nRealPerson); + unsigned queryPerson(const char* searchText); + unsigned queryPerson(const char* searchText, int pageIndex, stQueryPersonInfo personRet[], int personRetSize); + unsigned queryAccessRecord(const char* name, const char* time); + unsigned queryAccessRecord(const char* name, const char* time, int pageIndex, stQueryAccRedInfo recordRet[], int recordRetSize); + int clearPeople(); + int getPersonListState(int &sum, unsigned long long &maxPersonID); + + int wakeUpFromScreenSaverOrScreenOff(); + + virtual int delPerson(long long personId); + virtual int modifyPerson(stQueryPersonInfo &personInfo); + virtual int addPerson(stQueryPersonInfo &personInfo); + virtual int snapFace(std::string &feature, std::string &savePath); + + bool getMaskCheckSwitch(); + int setMaskCheckSwitch(const bool sw); + + bool getNoMaskNoPassSwitch(); + int setNoMaskNoPassSwitch(const bool sw); + + bool getTemperatureCheckSwitch(); + int setTemperatureCheckSwitch(const bool sw); + bool getNoTemperatureNoPassSwitch(); + int setNoTemperatureNoPassSwitch(const bool sw); + + float getLowTemperature(); + int setLowTemperature(const float temp); + float getHighTemperature(); + int setHighTemperature(const float temp); + + bool getQRCodeSwitch(); + int setQRCodeSwitch(const bool sw); + + bool getDataEncryptSw(); + int setDataEncryptSw(bool sw); + int setDateTime(const char *dateTime); + bool getAutoRebootSw(); + int setAutoRebootSw(bool sw); + int getAutoRebootTime(char* time, int len); + int setAutoRebootTime(const char *time); + int getAutoRebootInterval(); + int setAutoRebootInterval(int interval); + int ntpTimeCorrect(); + int ntpTimeCorrectForDevTest(const std::string& ntpServerIp); + + int getNetWireCfg(stNetWire& wireCfg); + int setNetWireCfg(const stNetWire& wireCfg); + int setNetWireEnable(bool enable); + + int getNetWifiCfg(stNetWifi& wifiCfg); + int setNetWifiCfg(const stNetWifi& wifiCfg); + int setNetWifiEnable(bool enable); + int getSsidList(stAccPoint accPointList[], int accPointListSize); + int claerNetWifiCfg(); + + int getNet4GCfg(stNet4G& n4gCfg); + int setNet4GEnable(bool enable); + int reboot4G(); + + int getScreenSaverConfig(stScreensaverCfg& cfg); + + int sendPassword(const char *password); + + void resetDecisionCenterTimer(); + int pauseDataFlow(); + int resumeDataFlow(); + + int candidateChoosedInPopupWindow(int index); + + bool isWiegandIoTestOk(); + bool isRelayAndGpioTestOk(); + bool isRs485TestOk(); + bool isReaderUnderScreenTestOk(); + bool isWifiTestOk(); + bool isRtcTestOk(); + bool isWireEthTestOk(); + bool is4gTestOk(); + bool isSerial1TestOk(); + + void screenTest(); + void speakerTest(); + void microphoneTest(bool record) final; + void audioSwitchTest() final; + void tpTest(); + void irCamTest(); + void irLedTest(); + void ageingTest(unsigned hours); + int getMacFromMes(const char* mesAddrAndProdNo, const char* pcbSeq, std::string& mac); + bool isAgeing(std::string& hours); + int getKeyDataMac(std::string& mac); + + int getRecoUiAdConfig(stScreensaverCfg& cfg); + int recoUiTypeSwitch(unsigned x, unsigned y, unsigned w, unsigned h); + + int getDevPwd(int& type, std::string& pwd); + int setLocalDevPwd(const std::string& pwd); + + int getKeyDataHardware(std::string& hardware); + int setKeyDataHardwareAndUpdataFunction(const std::string& hardware); + + int setSetupAlreadyFlag(); + int getParkInfo(std::string& info); + int setParkInfo(const std::string& info); + int getDevPosi(std::string& posi); + int setDevPosi(const std::string& posi); + + int getRs485Cfg(); + int setRs485Cfg(int cfg); + int getRs485Prot1Addr(); + int setRs485Prot1Addr(int addr); + int getRs485Prot3Cfg(int& handCfg, int& feetCfg); + int setRs485Prot3Cfg(int handCfg, int feetCfg); + int getGPIOCfg(); + int setGPIOCfg(int cfg); + int setReverseAccessSw(bool enabled) final; + bool getReverseAccessSw() const final; + int getIDFaceVerifySw(); + int setIDFaceVerifySw(bool sw); + int getBtLockCfg(BtDoorLock& cfg); + int setBtLockCfg(const BtDoorLock& cfg); + int getBtLockRemainingBatPwr(const std::string& mac); + bool getHealthCodeSw(); + int setHealthCodeSw(bool sw); + bool getHealthCodeNoFaceRequired(); + int setHealthCodeNoFaceRequired(bool sw); + bool getHealthCodeAllowStranger(); + int setHealthCodeAllowStranger(bool sw); + int getHealthCodePassCfg(int& codeColorCfg, int& c19tCfg, int& tripCfg, int& abtCfg); + int setHealthCodePassCfg(int codeColorCfg, int c19tCfg, int tripCfg, int abtCfg); + + std::string utfRawStrToEncodeStr(const std::string &str); + + std::string getUnderScreenNfcModuleId(); + std::string getExtendNfcModuleId(); + bool isIdModuleInfoUploaded(); + bool isDevSettingDisable(); + void setAntiDemolitionAvail(bool avail, bool upload); + bool getAntiDemolitionSw(); + void setAntiDemolitionSw(bool sw); + int getAntiDemolitionOutput(); + void setAntiDemolitionOutput(int output); + int getGpio4Cfg(); + void setGpio4Cfg(int cfg); + int getGpio5Cfg(); + void setGpio5Cfg(int cfg); + int getDoorCloseOvertime(); + void setDoorCloseOvertime(int overtime); + bool getDisableDevSettingSw(); + void setDisableDevSettingSw(bool sw); + int getTicketCheckCountToday(); + int getTicketModePeopleCountType(); + + int getCallDevList();//获取通话设备列表 + int queryCallDevList(const std::string& text, std::vector& devList);//查询指定的通话设备 + int callDev(const std::string& devTag, int devType);//发起通话请求 + int callAbort();//放弃通话(拨通之前) + int callHangUp();//挂断 + int callReject();//拒接 + int callAccept();//接听 + int callSetVideoStream(bool enable);//允许/禁用视频 + int openCallRemoteDoor() final; // 被打入电话过程中,打开对面面板机控制的闸机 + + void verifyAbort(); + bool getShowIdAndVerSw(); + int setShowIdAndVerSw(bool sw); + int playAudio(enAudioIndex index); + int userItemChoose(int index); + +private: + int udpSend(const string &sendData, string &recvData); + + int resetNetworkCfg(); + int udpLoopToSvr(const std::string &sendData); + +private: + ParamManage *m_paramMng = nullptr; + GOBJ m_objs = nullptr; +}; + +#endif diff --git a/Linguist/interface/BackstageInterfaceForUi.cpp b/Linguist/interface/BackstageInterfaceForUi.cpp new file mode 100644 index 0000000..79dfe96 --- /dev/null +++ b/Linguist/interface/BackstageInterfaceForUi.cpp @@ -0,0 +1,6 @@ + +#include "BackstageInterfaceForUi.h" + + + + diff --git a/Linguist/interface/BackstageInterfaceForUi.h b/Linguist/interface/BackstageInterfaceForUi.h new file mode 100644 index 0000000..ad56385 --- /dev/null +++ b/Linguist/interface/BackstageInterfaceForUi.h @@ -0,0 +1,574 @@ +#ifndef BACKSTAGEINTERFACEFORUI +#define BACKSTAGEINTERFACEFORUI + +#include +using namespace std; + +typedef unsigned char UINT8; +typedef unsigned short int UINT16; +typedef unsigned int UINT32; +typedef unsigned long long int UINT64; + +typedef enum +{ + DHCP, //DHCP方式 + STATIC //静态 +}enIpMethod; + +typedef enum _unlockSignal +{ + DISABLE = 0, //禁用 + UnlockSigRelay, //继电器 + UnlockSigWiegand26, //韦根 + UnlockSigWiegand34, //韦根 + UnlockSigWiegand42, //韦根 + UnlockSigRs485, //485 + UnlockSigButt +}enUnlockSignal; + +typedef enum _assist +{ + FireFightingLinkage, //消防联动 + NormallyOpenOutput, //常开输出 + Nothing //无 +}enAssist; + +typedef enum _Wiegand +{ + Wiegand26, //韦根26 + Wiegand34, //韦根34 + Wiegand37 //韦根37 +}enWiegand; + +typedef enum _Logo +{ + LogoDefault, //默认 + LogoNeutral, //中性 + LogoServerSetting//平台配置 +}enLogo; + +typedef enum _recogResult +{ + RecogResultDefault, //默认 + RecogResultShowName, //显示人员姓名(识别成功时使用) + RecogResultNotRegister, //未注册(识别失败时使用) + RecogResultCustom, //自定义 + RecogResultButt //出错时返回 +}enRecogResult; + + +typedef enum _similarityTh +{ + SimilarityThLoose, //宽松 + SimilarityThGeneral, //一般 + SimilarityThDefault, //默认 + SimilarityThStrict, //严格 + SimilarityThVeryStrict, //极严格 + SimilarityThCustom //自定义 +}enSimilarityTh; + +typedef enum _livingBodyTh +{ + LivingBodyLoose, //宽松 + LivingBodyGeneral, //一般 + LivingBodyStrict, //严格 +}enLivingBodyTh; + +typedef enum _recogDistance +{ + RecogDistanceNear, //近 + RecogDistanceMid, //适中 + RecogDistanceFar, //远 + RecogDistanceFarther //更远 +}enRecogDistance; + +typedef enum _recogAngle +{ + RecogAngleLittle, //15° + RecogAngleMid, //30° + RecogAngleBig, //45° +}enRecogAngle; + +typedef enum _faceQuality +{ + FaceQualityBad, //较差 + FaceQualityGood, //适中 + FaceQualityBetter, //较好 +}enFaceQuality; + +typedef enum _baudRate +{ + BaudRate9600, + BaudRate14400, + BaudRate19200, + BaudRate38400, + BaudRate57600, + BaudRate115200 +}enBaudRate; + +typedef struct +{ + std::string imgPath; + std::string name; + std::string expTime; + std::string regTime; + long long personId; + std::string idNum; + std::string jobNum; + std::string phoneNum; + std::string icNum; + std::string feature; + int personType; + void clear() + { + personId = -1; + imgPath.clear(); + name.clear(); + expTime.clear(); + regTime.clear(); + idNum.clear(); + jobNum.clear(); + phoneNum.clear(); + icNum.clear(); + feature.clear(); + personType = -1; + } +}stQueryPersonInfo; + +typedef struct +{ + char imgPath[128]; + char name[64]; + char accessTime[64]; + bool allowPass; +}stQueryAccRedInfo; + +typedef struct +{ + int type; //0:static, 1:DHCP + char ip[16]; + char mask[16]; + char gw[16]; + char dns[16]; + bool enable; +}stNetworkPara; + +typedef struct +{ + stNetworkPara cfg; +}stNetWire; + +typedef struct +{ + stNetworkPara cfg; + char encType[16]; + char ssid[64]; + char pwd[64]; + bool isConnected; + bool enableAp; + char apPwd[32]; + bool isAPCfg = false; +}stNetWifi; + +typedef struct +{ + char ssid[32]; + int sigLev; + bool isEncrypt; + bool isConnected; +}stAccPoint; + +typedef struct +{ + //char provider[32]; + int provider; + bool enable; + bool available; +}stNet4G; + +typedef struct +{ + int type; + int interval; + int picQty; + char pic[10][128]; +}stScreensaverCfg; + +enum BlueToothDevStat_e +{ + BlueToothDevStat_idle, + BlueToothDevStat_pairing, + BlueToothDevStat_paired, + BlueToothDevStat_connecting, + BlueToothDevStat_connected + //... +}; + +struct BluetoothDev_t +{ + string id;//唯一的标识? + string name; + //other attribute + //e.g 当前dev的状态:已连接/连接中/空闲... + BlueToothDevStat_e devStat; + BluetoothDev_t(){} + BluetoothDev_t(string _id, string _name, BlueToothDevStat_e _devStat):id(_id), name(_name), devStat(_devStat){} + void clear(){id.clear(); name.clear();devStat = BlueToothDevStat_idle;} +}; + +struct BluetoothStat_t +{ + string devName; + bool isEnable; + list pairedDev; + list availableDev; + void clear(){devName.clear(); isEnable=false; pairedDev.clear(); availableDev.clear();} +}; + +struct BtDoorLock +{ + bool isEnable = false; + int qty = 0; + std::vector manufacturer; + std::vector position; + std::vector mac; +}; + +typedef struct{ + std::string name; + std::string code; + std::string devTag; + int type; + int status; +}stCallDev; + +typedef enum { + audioInputPwd = 0 +}enAudioIndex; + +class BackstageInterfaceForUi +{ +public: + virtual ~BackstageInterfaceForUi(){} + virtual int registerPerson(char *name, char *term, int nDataOrigin = 1) = 0;//注册人员,返回值:成功0,失败-1 + virtual int startIdentyState(bool setfaceReco = true, bool setPeInput = true) = 0;//开始识别 + virtual int stopIdentyState(bool setfaceReco = true, bool setPeInput = true) = 0;//停止识别 + + //工程设置 + virtual int verifyFactorySettingPwd(const char *pwd) = 0;//验证密码,返回值:0、验证成功, -1失败 + virtual int recoveryFactorySetting() = 0;//恢复出厂设置,返回值:0、成功, -1失败 + //设备设置 + virtual int getDeviceId(char *devId, int len) = 0;//获取设备id + virtual int getHardwareConfig(char *config, int len) = 0;//获取硬件配置 + virtual int getStorSpace(int &total, float &free) = 0;//获取存储空间 + virtual int getAppVersion(char *appVer, int len) = 0;//获取应用版本号 + virtual int getRegisterNum() = 0;//获取注册人员数 + virtual int getAccessRecordNotUpload() = 0;//获取未上传通行记录 + virtual int getAccessRecordQty() = 0;//获取通行记录条数 + virtual int getVolume() = 0;//获取音量大小 + virtual int setVolume(int vol) = 0;//设置音量大小 + virtual int getLcdBrightness() = 0;//获取屏幕亮度 + virtual int setLcdBrightness(int brightness) = 0;//设置屏幕亮度 + virtual bool getFillLightSw() = 0;//获取智能补光开关 + virtual int setFillLightSw(bool isOpen) = 0;//获取智能补光开关 + virtual int getStandbyTime() = 0;//获取待机时间 + virtual int setStandbyTime(int time) = 0;//设置待机时间 + virtual int getCloseScreenTime() = 0;//获取关屏等待时间 + virtual int setCloseScreenTime(int time) = 0;//获取关屏等待时间 + virtual int getLanguage() = 0;//获取语言 + virtual int setLanguage(int lang) = 0;//设置语言 + //网络设置 + virtual int getIP(char *ip, int len, int& type) = 0;//获取IP + virtual int setIP(char *ip) = 0;//设置IP + virtual enIpMethod getIpMethod() = 0;//获取IP方法 + virtual int setIpMethod(enIpMethod ipMethod) = 0;//设置IP方法 + virtual int getSubnetMask(char *mask, int len) = 0;//获取子网掩码 + virtual int setSubnetMask(char *mask) = 0;//设置子网掩码 + virtual int getGateway(char *gateway, int len) = 0;//获取默认网关 + virtual int setGateway(char *gateway) = 0;//设置默认网关 + virtual int getDNS(char *dns, int len) = 0;//获取DNS + virtual int setDNS(char *dns) = 0;//设置DNS + virtual int getEthMac(char *mac, int len) = 0;//获取mac + virtual int getWifiMac(char *mac, int len) = 0;//获取wifi mac + virtual int getServerAddr(char *addr, int len) = 0;//获取服务器ip + virtual int setServerAddr(char *addr, bool byQrcode = false) = 0;//设置服务器ip + virtual int testServerIP(char *addr, float &time) = 0;//测试服务器ip,成功返回0,失败-1 + virtual int getIotServerIP(char *ip, int len) = 0;//获取服务器ip + virtual int setIotServerIP(char *ip) = 0;//设置服务器ip + virtual int getIotPort() = 0;//获取端口号, 成功返回端口号,失败返回-1 + virtual int setIotPort(int port) = 0;//设置端口号 + virtual bool getIpShowSw() = 0;//获取IP是否在屏幕上显示的开关 + virtual int setIpShowSw(bool sw) = 0;//设置IP是否在屏幕上显示的开关 + //蓝牙设置 + //if success, return 0, else return err num; + virtual int getBtSwitch(bool &isOpen) = 0; + virtual int getBtName(string &devName) = 0; + virtual int getBtPairedDev(list &devList) = 0; + virtual int getBtAvailDev(list &devList) = 0; + virtual int getBtAllInfo(BluetoothStat_t &bluetoothStat) = 0; + + virtual int btScan(list &devList) = 0;//这个接口不需要吧?现在是定时的去搜索?所以点击“可用设备"条目时,直接调用getBtAvailDev就可以了? + virtual int btSetSwitch(bool isOpen) = 0; + virtual int btSetName(const string &devName) = 0; + virtual int btPaire(const string &devId) = 0; + virtual int btDisPaire(const string &devId) = 0; + virtual int btConnect(const string &devId) = 0; + virtual int btDisConnect(const string &devId) = 0; + virtual int btRenameDev(const string &devId, const string &devName) = 0; + + virtual bool getParamBluetoothEnable() = 0;//获取蓝牙的开关 + virtual int setParamBluetoothEnable(bool sw) = 0;//设置蓝牙的开关 + virtual std::string getParamBluetoothName() = 0;//获取蓝牙设备名称 + virtual int setParamBluetoothName(std::string name) = 0;//设置蓝牙设备名称 + //门禁设置 + virtual int getUnlockTime() = 0;//获取开锁时间,取值范围是1-10秒。默认值为1秒 + virtual int setUnlockTime(int time) = 0;//设置开锁时间 + virtual int getUnlockDelay() = 0;//获取开锁延时,取值范围是0-10秒。默认值为0秒 + virtual int setUnlockDelay(int time) = 0;//设置开锁延时 + virtual enUnlockSignal getUnlockSig() = 0;//获取开锁信号 + virtual int setUnlockSig(enUnlockSignal value) = 0;//设置开锁信号,返回-1:不支持,-2:表示和报警信号冲突,0:成功 + virtual enAssist getAssistIn() = 0;//获取辅助输入 + virtual int setAssistIn(enAssist assist) = 0;//设置辅助输入 + virtual enAssist getAssistOut() = 0;//获取辅助输出 + virtual int setAssistOut(enAssist assist) = 0;//设置辅助输出 + virtual enWiegand getWiegandIn() = 0;//获取韦根输入 + virtual int setWiegandIn(enWiegand wiegand) = 0;//设置韦根输入 + virtual enWiegand getWiegandOut() = 0;//获取韦根输出 + virtual int setWiegandOut(enWiegand wiegand) = 0;//设置韦根输出 + virtual enBaudRate getBaudRate() = 0;//获取波特率 + virtual int setBaudRate(enBaudRate baudRate) = 0;//设置波特率 + virtual int getWarningSig() = 0;//获取报警信号 + virtual int setWarningSig(int signal) = 0;//设置报警信号, signal,0:禁用,1:继电器。返回-1:和开门信号设置的继电器有冲突,返回0:成功 + virtual int setReverseAccessSw(bool enabled) = 0; + virtual bool getReverseAccessSw() const = 0; + //交互提示 + virtual enLogo getLogo() = 0;//获取logo + virtual int setLogo(enLogo logo) = 0;//设置logo + virtual int getCustomLogo(char *logo, int len) = 0; + virtual enLogo getLogoTime() = 0;//获取logo+time + virtual int setLogoTime(enLogo logo) = 0;//设置logo+time + virtual enLogo getBackground() = 0;//获取背景图 + virtual int setBackground(enLogo logo) = 0;//设置背景图 + virtual enRecogResult getSuccessResult(char *data = nullptr, int len = 0) = 0;//获取成功结果 + virtual int setSuccessResult(enRecogResult result = RecogResultDefault, char *data = nullptr) = 0;//设置成功结果 + virtual enRecogResult getFailResult(char *data = nullptr, int len = 0) = 0;//获取失败结果 + virtual int setFailResult(enRecogResult result = RecogResultDefault, char *data = nullptr) = 0;//设置失败结果 + virtual bool getPlayAudioSw() = 0;//获取语音播报开关 + virtual int setPlayAudioSw(bool isOpen) = 0;//设置语音播报开关 + //人脸识别 + virtual bool getIdentificationSw() = 0;//获取身份核验开关 + virtual int setIdentificationSw(bool sw) = 0;//设置身份核验开关 + virtual enSimilarityTh getSimilarityTh() = 0;//获取相似度阈值 + virtual int setSimilarityTh(enSimilarityTh th) = 0;//设置相似度阈值 + virtual int setCustomSimilarity(int sim) = 0;//设置自定义识别相似度 + virtual int getCustomSimilarity() = 0;//获取自定义识别相似度 + virtual bool getLivingBodySw() = 0;//获取活体开关 + virtual int setLivingBodySw(bool isOpen) = 0;//设置活体开关 + virtual enLivingBodyTh getLivingBodyTh() = 0;//获取活体检测阈值 + virtual int setLivingBodyTh(enLivingBodyTh th) = 0;//设置活体检测阈值 + virtual bool getLivingBodyFailSw() = 0;//获取活体失败图片留存开关 + virtual int setLivingBodyFailSw(bool isOpen) = 0;//设置失败图片留存开关 + virtual int getVerifyInterval() = 0;//获取验证间隔时间,取值范围0-5秒。0秒表示一人只做一次识别。大于1秒时,当上次同一人识别时间超过设定间隔时,再次进行识别 + virtual int setVerifyInterval(int time) = 0;//设置验证间隔时间 + virtual enRecogDistance getRecogDistance() = 0;//获取识别距离 + virtual int setRecogDistance(enRecogDistance distance) = 0;//设置识别距离 + virtual enRecogAngle getRecogAngle() = 0;//获取识别角度 + virtual int setRecogAngle(enRecogAngle angle) = 0;//设置识别角度 + virtual int getMaxTraceNum() = 0;//获取人脸最大跟踪数,取值范围是1-10. 默认值为1.即每次只识别画面中最大的人脸 + virtual int setMaxTraceNum(int num) = 0;//设置人脸最大跟踪数 + virtual enFaceQuality getFaceQuality() = 0;//获取人脸质量阈值 + virtual int setFaceQuality(enFaceQuality quality) = 0;//设置人脸质量阈值 + virtual bool getDynamicFeatureSw() = 0;//获取动态底库的开关 + virtual int setDynamicFeatureSw(bool sw) = 0;//设置动态底库的开关 + //系统设置 + virtual bool getNtpServerSw() = 0;//获取NTP服务开关 + virtual int setNtpServerSw(bool isOpen) = 0;//设置NTP服务开关 + virtual int getNtpServerAddr(char *addr, int len) = 0;//获取NTP服务地址 + virtual int setNtpServerAddr(char *addr) = 0;//设置NTP服务地址 + virtual int testNtpServer(char *addr, float &time) = 0;//测试NTP服务, 成功返回0,失败-1 + virtual int getNtpServerPort() = 0;//获取NTP端口,成功返回端口号,失败返回-1 + virtual int setNtpServerPort(int port) = 0;//设置NTP服务端口 + virtual int getNtpCheckInterval() = 0;/////////////////////////////////////////// + virtual int setNtpCheckInterval(int interval) = 0;/////////////////////////////////////////// + virtual int getNtpTimeZone(char *timeZone, int len) = 0;/////////////////////////////////////////// + virtual int setNtpTimeZone(char* timeZone) = 0;/////////////////////////////////////////// + virtual int setVerifyFactorySettingPwd(char *pwd) = 0;//设置工程密码,密码要求:数字0-9,字母a-z,A-Z,共6位。默认密码为666666 + virtual int testHardware() = 0;//硬件检测,包括:a)双摄像头的回显, b)补光灯的点亮,c)继电器开关,d)刷卡信息的显示 + virtual int cleanData() = 0;//清除数据 + virtual int devReboot() = 0;//重启设备 + + virtual int startCapture() = 0;//start capture on register + + virtual int deletePerson(long long personID) = 0; + + /*query person ID + *pPersonIDBuff : [out]person id list + *nBuffCount : [in] buff size + *startID : [in] start id, the param greater zero + */ + virtual int queryPersonList(long long* pPersonIDBuff, int nBuffCount, long long startID, int& nRealPerson) = 0; + virtual int clearPeople() = 0; + virtual unsigned queryPerson(const char* searchText) = 0; + virtual unsigned queryPerson(const char* searchText, int pageIndex, stQueryPersonInfo personRet[], int personRetSize) = 0; + virtual unsigned queryAccessRecord(const char* name, const char* time) = 0; + virtual unsigned queryAccessRecord(const char* name, const char* time, int pageIndex, stQueryAccRedInfo recordRet[], int recordRetSize) = 0; + virtual int getPersonListState(int &sum, unsigned long long &maxPersonID) = 0; + virtual int wakeUpFromScreenSaverOrScreenOff() = 0; + + virtual int delPerson(long long personId) = 0; + virtual int modifyPerson(stQueryPersonInfo &personInfo) = 0; + virtual int addPerson(stQueryPersonInfo &personInfo) = 0; + virtual int snapFace(std::string &feature, std::string &savePath) = 0; + + virtual bool getMaskCheckSwitch() = 0; + virtual int setMaskCheckSwitch(const bool sw) = 0; + + virtual bool getNoMaskNoPassSwitch() = 0; + virtual int setNoMaskNoPassSwitch(const bool sw) = 0; + + virtual bool getTemperatureCheckSwitch() = 0; + virtual int setTemperatureCheckSwitch(const bool sw) = 0; + + virtual bool getNoTemperatureNoPassSwitch() = 0; + virtual int setNoTemperatureNoPassSwitch(const bool sw) = 0; + + virtual float getLowTemperature() = 0; + virtual int setLowTemperature(const float temp) = 0; + virtual float getHighTemperature() = 0; + virtual int setHighTemperature(const float temp) = 0; + virtual bool getQRCodeSwitch() = 0; + virtual int setQRCodeSwitch(const bool sw) = 0; + + virtual int setDateTime(const char *dateTime) = 0; + + virtual bool getDataEncryptSw() = 0; + virtual int setDataEncryptSw(bool sw) = 0; + virtual bool getAutoRebootSw() = 0; + virtual int setAutoRebootSw(bool sw) = 0; + virtual int getAutoRebootTime(char* time, int len) = 0; + virtual int setAutoRebootTime(const char *time) = 0; + virtual int getAutoRebootInterval() = 0; + virtual int setAutoRebootInterval(int interval) = 0; + + virtual int ntpTimeCorrect() = 0; + virtual int ntpTimeCorrectForDevTest(const std::string& ntpServerIp) = 0; + + virtual int getNetWireCfg(stNetWire& wireCfg) = 0; + virtual int setNetWireCfg(const stNetWire& wireCfg) = 0; + virtual int setNetWireEnable(bool enable) = 0; + + virtual int getNetWifiCfg(stNetWifi& wifiCfg) = 0; + virtual int setNetWifiCfg(const stNetWifi& wifiCfg) = 0; + virtual int setNetWifiEnable(bool enable) = 0; + virtual int getSsidList(stAccPoint accPointList[], int accPointListSize) = 0; + virtual int claerNetWifiCfg() = 0; + + virtual int getNet4GCfg(stNet4G& n4gCfg) = 0; + virtual int setNet4GEnable(bool enable) = 0; + virtual int reboot4G() = 0; + + virtual int getScreenSaverConfig(stScreensaverCfg& cfg) = 0; + + virtual int sendPassword(const char *password) = 0; + virtual void resetDecisionCenterTimer() = 0; + virtual int pauseDataFlow() = 0; + virtual int resumeDataFlow() = 0; + + virtual int candidateChoosedInPopupWindow(int index) = 0; + + virtual bool isWiegandIoTestOk() = 0; + virtual bool isRelayAndGpioTestOk() = 0; + virtual bool isRs485TestOk() = 0; + virtual bool isReaderUnderScreenTestOk() = 0; + virtual bool isWifiTestOk() = 0; + virtual bool isRtcTestOk() = 0; + virtual bool isWireEthTestOk() = 0; + virtual bool is4gTestOk() = 0; + virtual bool isSerial1TestOk() = 0; + + virtual void screenTest() = 0; + virtual void speakerTest() = 0; + virtual void microphoneTest(bool record) = 0; + virtual void audioSwitchTest() = 0; + virtual void tpTest() = 0; + virtual void irCamTest() = 0; + virtual void irLedTest() = 0; + virtual void ageingTest(unsigned hours) = 0; + virtual int getMacFromMes(const char* mesAddrAndProdNo, const char* pcbSeq, std::string& mac) = 0; + virtual bool isAgeing(std::string& hours) = 0; + virtual int getKeyDataMac(std::string& mac) = 0; + + virtual int getRecoUiAdConfig(stScreensaverCfg& cfg) = 0; + virtual int recoUiTypeSwitch(unsigned x, unsigned y, unsigned w, unsigned h) = 0; + + virtual int getDevPwd(int& type, std::string& pwd) = 0; + virtual int setLocalDevPwd(const std::string& pwd) = 0; + + virtual int getKeyDataHardware(std::string& hardware) = 0; + virtual int setKeyDataHardwareAndUpdataFunction(const std::string& hardware) = 0; + + virtual int setSetupAlreadyFlag() = 0; + virtual int getParkInfo(std::string& info) = 0; + virtual int setParkInfo(const std::string& info) = 0; + virtual int getDevPosi(std::string& posi) = 0; + virtual int setDevPosi(const std::string& posi) = 0; + + virtual int getRs485Cfg() = 0; + virtual int setRs485Cfg(int cfg) = 0; + virtual int getRs485Prot1Addr() = 0; + virtual int setRs485Prot1Addr(int addr) = 0; + virtual int getRs485Prot3Cfg(int& handCfg, int& feetCfg) = 0; + virtual int setRs485Prot3Cfg(int handCfg, int feetCfg) = 0; + virtual int getGPIOCfg() = 0; + virtual int setGPIOCfg(int cfg) = 0; + virtual int getIDFaceVerifySw() = 0; + virtual int setIDFaceVerifySw(bool sw) = 0; + virtual int getBtLockCfg(BtDoorLock& cfg) = 0; + virtual int setBtLockCfg(const BtDoorLock& cfg) = 0; + virtual int getBtLockRemainingBatPwr(const std::string& mac) = 0; + virtual bool getHealthCodeSw() = 0; + virtual int setHealthCodeSw(bool sw) = 0; + virtual bool getHealthCodeNoFaceRequired() = 0; + virtual int setHealthCodeNoFaceRequired(bool sw) = 0; + virtual bool getHealthCodeAllowStranger() = 0; + virtual int setHealthCodeAllowStranger(bool sw) = 0; + virtual int getHealthCodePassCfg(int& codeColorCfg, int& c19tCfg, int& tripCfg, int& abtCfg) = 0; + virtual int setHealthCodePassCfg(int codeColorCfg, int c19tCfg, int tripCfg, int abtCfg) = 0; + virtual std::string getUnderScreenNfcModuleId() = 0; + virtual std::string getExtendNfcModuleId() = 0; + virtual bool isIdModuleInfoUploaded() = 0; + virtual bool isDevSettingDisable() = 0; + virtual void setAntiDemolitionAvail(bool avail, bool upload) = 0; + virtual bool getAntiDemolitionSw() = 0; + virtual void setAntiDemolitionSw(bool sw) = 0; + virtual int getAntiDemolitionOutput() = 0; + virtual void setAntiDemolitionOutput(int output) = 0; + virtual int getGpio4Cfg() = 0; + virtual void setGpio4Cfg(int cfg) = 0; + virtual int getGpio5Cfg() = 0; + virtual void setGpio5Cfg(int cfg) = 0; + virtual int getDoorCloseOvertime() = 0; + virtual void setDoorCloseOvertime(int overtime) = 0; + virtual bool getDisableDevSettingSw() = 0; + virtual void setDisableDevSettingSw(bool sw) = 0; + virtual int getTicketCheckCountToday() = 0; + virtual int getTicketModePeopleCountType() = 0; + virtual std::string utfRawStrToEncodeStr(const std::string &str) = 0; + virtual int getCallDevList() = 0; + virtual int queryCallDevList(const std::string& text, std::vector& devList) = 0; + virtual int callDev(const std::string& devTag, int devType) = 0; + virtual int callAbort() = 0; + virtual int callHangUp() = 0; + virtual int callReject() = 0; + virtual int callAccept() = 0; + virtual int callSetVideoStream(bool enable) = 0; + virtual int openCallRemoteDoor() = 0; + virtual void verifyAbort() = 0; + virtual bool getShowIdAndVerSw() = 0; + virtual int setShowIdAndVerSw(bool sw) = 0; + virtual int playAudio(enAudioIndex index) = 0; + virtual int userItemChoose(int index) = 0; +}; + +#endif // BACKSTAGEINTERFACEFORUI + diff --git a/Linguist/interface/UiInterfaceForBackstage.h b/Linguist/interface/UiInterfaceForBackstage.h new file mode 100644 index 0000000..996d52c --- /dev/null +++ b/Linguist/interface/UiInterfaceForBackstage.h @@ -0,0 +1,120 @@ +#ifndef UIINTERFACEFORBACKSTAGE +#define UIINTERFACEFORBACKSTAGE + +#include "UiTools.h" +#include + +class UiInterfaceForBackstage : public WidgetWithBackstageInterface +{ +public: + typedef enum + { + PLATFORM_CONNECTION_STATUS_DISCONNECTED, + PLATFORM_CONNECTION_STATUS_CONNECTED, + PLATFORM_CONNECTION_STATUS_LOGGED + }PLATFORM_CONNECTION_STATUS_E; + + typedef enum + { + QRCode_Msg_Standby, + QRCode_Msg_GreenCode, + QRCode_Msg_YellowCode, + QRCode_Msg_RedCode, + QRCode_Msg_Verifying, + QRCode_Msg_Error, + QRCode_Msg_OtherCode, + QRCode_Msg_Overtime + }QRCode_Msg_E; + + virtual long long getUiVersion() = 0; + + virtual void showUnauthorizedPage() = 0; + virtual void showScreenSaverPage() = 0; + + virtual void showRecoMsgReco() = 0; + virtual void showRecoMsgRetry() = 0; + virtual void showRecoMsgFail(int failType) = 0; + virtual void notifyFaceInfo(const bool faceAvailable) = 0; + virtual void showRecoSuccess(const char *name) = 0; + virtual void showRecoMsgIDFail() = 0; + + virtual int showFaceImg(const unsigned char *imgData, const int imgLen) = 0; + virtual void updatePlatformConnectionStatus(const PLATFORM_CONNECTION_STATUS_E) = 0; + + virtual void showRecoMsgMoveForehead() = 0; //移动到额头区 + virtual void showRecoMsgForeheadNormalTemp(const float temp, const bool isC) = 0; //显示正常温度 + virtual void showRecoMsgForeheadAbnormalTemp(const float temp, const bool isHigh, const bool isC) = 0; //显示异常温度 + + virtual void showRecoMsgReadTempFailed() = 0; //体温检测失败 + virtual void showRecoMsgNoMaskWarn() = 0; //请戴口罩 + virtual void showRecoMsgMaskOk() = 0; + virtual void showRecoMsgMaskWarn() = 0; + + virtual void showRecoMsgNoEntry(const bool) = 0; //显示禁止通行 + + virtual void turnOffScanLine() = 0; + + virtual void clearLocalFacePage() = 0; //清除本地人脸库数据,在平台清空本地人脸的时候 + virtual void updateLogo(const enLogo) = 0; //更新logo + + virtual void showQRCodeMsg(const QRCode_Msg_E) = 0; + virtual void showQRCodeReco() = 0; + virtual void showFaceReco() = 0; + virtual void updateRecoUiIp() = 0; + + virtual void showFeatureUpdateProgress(const unsigned current, const unsigned all) = 0; + virtual void closeFeatureUpdateProgress() = 0; + + virtual void showRecoUiMask(int maskType) = 0; + + virtual void showNotiMsg(const char *msg, int color) = 0; + + virtual void updateScreenSaver() = 0; + + virtual int grabScreen(const QString& picName, int rotate = 0) = 0; + + virtual void showDrawPage() = 0; + virtual int switchToRecoUi() = 0; + + virtual int showCenterMsg(const char* msg, int type) = 0; + + virtual int showUserPwd(const char* name) = 0; + virtual void setPwdButton(bool visible) = 0; + virtual void showPwdUiPersonName(const char* name) = 0; + virtual void showUserPwdError(int type, int color) = 0; + virtual void showUserCandidate(const char* title, const char** opns, int opnsNum) = 0; + virtual void showDevTestPage(const char* devCfgMsg) = 0; + virtual void setDevTestMesAddrAndProdNoText(const char* text) = 0; + virtual void setDevTestPcbSeqText(const char* text) = 0; + virtual void setDevTestConfigInfo(const char* text) = 0; + + virtual void showOrHideFaceFrame(bool show) = 0; + virtual void showPassResult(bool pass) = 0; + + virtual void showRecoUiColorFaceSnapshot(const char* path) = 0; + virtual void showRecoUiColorFaceSnapshot(const unsigned char* jpgDate, int len) = 0; + virtual void recoUiswitchToType(int type) = 0; + + virtual void qrcodeFastCfgResult(bool isSuccessed) = 0; + + virtual void icCardResult(const char *icCardNum) = 0; + + virtual void showHealthMsg(int type, float temp, const char * msg, bool pass, const unsigned char* jpgDate, + int jpgLen, const char * tripCity, const char* failReason, int bgColor, int displayTime) = 0; + virtual void showHealthCodeAuthStatus(int status) = 0; + virtual void showAntiDismantleDetect(bool upload) = 0; + virtual void showSceneResult(int result, const char* resultText, const char* businessInfo, int displayTime) = 0; + virtual void updatePersonNumAccessed(int personAccess, int personAll) = 0; + virtual bool isScenePassing() = 0; + virtual void setSceneUiPersonCountType(int type) = 0; + virtual void updateSceneUiPersonCount(int count) = 0; + virtual void showCallDialPage() = 0; + virtual void setCallConsoleStatus(int status, const char* tip) = 0; + virtual void setDndMode(bool enabled, const std::chrono::system_clock::time_point &time) = 0; + virtual void showRecoUiDevIdAndVer(bool show) = 0; + virtual void showUserItemChoose(const std::vector& items) = 0; +}; + + +#endif // UIINTERFACEFORBACKSTAGE + diff --git a/Linguist/interface/View.cpp b/Linguist/interface/View.cpp new file mode 100644 index 0000000..8a2d8d4 --- /dev/null +++ b/Linguist/interface/View.cpp @@ -0,0 +1,635 @@ +/******************************************************************** +* Name : View.cpp +* Param : +* Return : +* Describ : +* Author : +* Date : +********************************************************************/ + +#include "View.h" +#include "rw_zlog.h" +#include "param_manage.h" +#include "timer/timer.h" +#include "AsyncEvent.h" +#include "recoUiCallConsole.h" + + +View * View::m_this = nullptr; + +View::View( ) +{ + m_ui = nullptr; + m_backstage = nullptr; +} + +View* View::getInstance() +{ + if( nullptr == m_this ) + { + m_this = new View; + } + + return m_this; +} + + +int View::viewInitBackstage( void* pParaMng, void* pObjs, bool needSetupWizard) +{ + m_backstage = new Backstage(pParaMng, pObjs); + m_backstage->stopIdentyState(); + m_needSetupWizard = needSetupWizard; + return 0; +} + +int View::viewCreateUi(int languageType, bool showCursor) +{ + LOGD("language type: %d", languageType); + if(languageType < 0){ + return -1; + } + m_ui = new mainUi(languageType, m_needSetupWizard); + if(nullptr == m_backstage){ + LOGE("backstage not ready!!!"); + return -2; + } + showCursorSwitch(showCursor); + m_ui->setBackstageUiinterface(m_backstage); + LOGI("ui version:%lld", m_ui->getUiVersion()); + + return 0; +} + +int View::viewCreateSettingUi() +{ + int ret = -1; + if(m_ui){ + m_ui->createSettingUi(); + ret = 0; + } + return ret; +} + +void View::showRecoMsgReco() +{ + if (m_ui) + { + m_ui->showRecoMsgReco(); + } +} + +void View::showUnauthorizedPage() +{ + if (m_ui) + { + m_ui->showUnauthorizedPage(); + } +} + +void View::showScreenSaverPage() +{ + if (m_ui) + { + m_ui->showScreenSaverPage(); + } +} + +void View::showErrorDisplayPage(enErrCode errCode) +{ + +} + +void View::notifyFaceInfo(const bool faceAvailable) +{ + if(m_ui) + { + m_ui->notifyFaceInfo(faceAvailable); + } +} + +void View::showRecoMsgRetry() +{ + if (m_ui) + { + m_ui->showRecoMsgRetry(); + } +} + +void View::showRecoMsgFail(int failType)//未经许可人员 +{ + if (m_ui) + { + m_ui->showRecoMsgFail(failType); + } +} + +void View::showRecoSuccess(const char *name) +{ + if (m_ui) + { + m_ui->showRecoSuccess(name); + } +} + +void View::showFaceImg(const unsigned char *imgData, const int imgLen) +{ + if (m_ui) + { + m_ui->showFaceImg(imgData, imgLen); + } +} + +void View::showRecoMsgIDFail()//身份证核验失败 +{ + if (m_ui) + { + m_ui->showRecoMsgIDFail(); + } +} + +void View::updatePlatformConnectionStatus(UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_E state) +{ + //LOGD("m_ui===%p", m_ui); + if (m_ui) + { + m_ui->updatePlatformConnectionStatus(state); + } +} + +void View::showRecoMsgMoveForehead() //移动到额头区 +{ + if (m_ui) + { + m_ui->showRecoMsgMoveForehead(); + } +} + +void View::showRecoMsgForeheadNormalTemp(const float temp, const bool isC) //显示正常温度 +{ + //LOGD("view show temp: %f", temp); + if (m_ui) + { + m_ui->showRecoMsgForeheadNormalTemp(temp, isC); + } +} + +void View::showRecoMsgForeheadAbnormalTemp(const float temp, const bool isHigh, const bool isC) //显示异常温度 +{ + //LOGD("view show temp: %f", temp); + if (m_ui) + { + m_ui->showRecoMsgForeheadAbnormalTemp(temp, isHigh, isC); + } +} + +void View::showRecoMsgReadTempFailed() //体温检测失败 +{ + if (m_ui) + { + m_ui->showRecoMsgReadTempFailed(); + } +} + +void View::showRecoMsgNoMaskWarn() //请戴口罩 +{ + if (m_ui) + { + m_ui->showRecoMsgNoMaskWarn(); + } +} + +void View::showRecoMsgMaskOk() //口罩检测成功 +{ + if (m_ui) + { + m_ui->showRecoMsgMaskOk(); + } +} + +void View::showRecoMsgNoEntry(const bool noEntry) //禁止通行 +{ + if (m_ui) + { + m_ui->showRecoMsgNoEntry(noEntry); + } +} + +void View::showRecoMsgMaskWarn() +{ + m_ui->showRecoMsgMaskWarn(); +} + +void View::turnOffScanLine() //关闭扫描线 +{ + if (m_ui) + { + m_ui->turnOffScanLine(); + } +} + +void View::updateLogo(int logo) +{ + if (m_ui) + { + LOGD("logo=======%d", logo); + m_ui->updateLogo((enLogo)logo); + } +} + +void View::showQRCodeResult(int result) +{ + if (m_ui) + { + + if(result)LOGD("result=======%d", result); + m_ui->showQRCodeMsg(static_cast(result)); + } +} + +void View::showQRCodeReco() +{ + LOGD("m_ui==%p", m_ui); + if (m_ui) + { + m_ui->showQRCodeReco(); + } +} + +void View::showFaceReco() +{ + if (m_ui) + { + m_ui->showFaceReco(); + } +} + +void View::updateRecoUiIp() +{ + if (m_ui) + { + m_ui->updateRecoUiIp(); + } +} + +void View::showFeatureUpdateProgress(const unsigned current, const unsigned all) +{ + if (m_ui){ + m_ui->showFeatureUpdateProgress(current, all); + } +} + +void View::closeFeatureUpdateProgress() +{ + if (m_ui){ + m_ui->closeFeatureUpdateProgress(); + } +} + +void View::showCalibrationBox() +{ + if (m_ui) + { + m_ui->showRecoUiMask((int)View::enRecoUiMaskType::enRecoUiMaskTempCalibra); + } +} + +void View::closeCalibrationBox() +{ + if (m_ui) + { + m_ui->showRecoUiMask((int)View::enRecoUiMaskType::enRecoUiMaskLight); + } +} + +void View::showNotiMsg(const char *msg, int color, double displayTime) +{ + if (m_ui && msg){ + m_ui->showNotiMsg(msg, color); + if(strlen(msg)){ + rw_timer_del(m_ullNotiMsgShowTmr); + rw_timer_add(&m_ullNotiMsgShowTmr, displayTime, 1, msgShowOvertimeCloseCB, (void*)0); + } + } +} + +void View::switchLightOrDarkRecoUi(bool isDark) +{ + if (m_ui) + { + View::enRecoUiMaskType type = View::enRecoUiMaskType::enRecoUiMaskLight; + if(isDark){ + type = View::enRecoUiMaskType::enRecoUiMaskDark; + } + m_ui->showRecoUiMask((int)type); + } +} + +void View::updateScreenSaver() +{ + if (m_ui) + { + m_ui->updateScreenSaver(); + } +} + +void View::grabScreen(const char* picName, int rotate) +{ + if (m_ui) + { + m_ui->grabScreen(picName, rotate); + } +} + +void View::switchToRecoUi() +{ + if (m_ui) + { + m_ui->switchToRecoUi(); + } +} + +void View::showCenterMsg(const char* msg, double displayTime, int type) +{ + if (m_ui && msg){ + LOGI("showCenterMsg:%s", msg); + m_ui->showCenterMsg(msg, type); + rw_timer_del(m_ullCenterMsgShowTmr); + if(strlen(msg)){ + LOGI("enable timer..."); + rw_timer_add(&m_ullCenterMsgShowTmr, displayTime, 1, msgShowOvertimeCloseCB, (void*)1); + } + } +} + +void View::closeCenterMsgWin() +{ + LOGI("close center msg window"); + m_ui->showCenterMsg("", 0); + rw_timer_del(m_ullCenterMsgShowTmr); +} + +void View::showDrawPage() +{ + if (m_ui){ + m_ui->showDrawPage(); + } +} + +void View::showCursorSwitch(bool sw) +{ + if (m_ui){ + m_ui->showCursorSwitch(sw); + } +} + +void View::setPwdButton(bool visible) +{ + if (m_ui){ + m_ui->setPwdButton(visible); + } +} + +void View::showPwdUiPersonName(const char* name) +{ + if (m_ui){ + m_ui->showPwdUiPersonName(name); + } +} + + +View::~View() +{ + delete m_ui; + delete m_backstage; +} + +int View::msgShowOvertimeCloseCB(void *data) +{ + if(0 == (int)data){ + View::getInstance()->showNotiMsg("", 0); + }else if(1 == (int)data){ + View::getInstance()->showCenterMsg(""); + } + return 0; +} + +int View::setNetWire(const stNetWire& wireCfg) +{ + return m_backstage->setNetWireCfg(wireCfg); +} + +int View::setServerAddr(const char *addr, bool byQrcode) +{ + return m_backstage->setServerAddr((char*)addr, byQrcode); +} + +void View::showUserPwd(const char* name) +{ + if (m_ui){ + m_ui->showUserPwd(name); + } +} + +void View::showUserPwdError(int type, int color) +{ + if (m_ui){ + m_ui->showUserPwdError(type, color); + } +} + +void View::showUserCandidate(const char** opns, int opnsNum) +{ + if (m_ui){ + m_ui->showUserCandidate("请选择项目", opns, opnsNum); + } +} + +void View::showDevTestPage(const char* devCfgMsg) +{ + if (m_ui){ + m_ui->showDevTestPage(devCfgMsg); + UiConfig::GetInstance()->setDevTestStatus(true); + } +} + +void View::setDevTestMesAddrAndProdNoText(const char* text) +{ + if (m_ui){ + m_ui->setDevTestMesAddrAndProdNoText(text); + } +} + +void View::setDevTestPcbSeqText(const char* text) +{ + if (m_ui){ + m_ui->setDevTestPcbSeqText(text); + } +} + +#if 0 +void View::setDevTestConfigInfo(const char* text) +{ + m_ui->setDevTestConfigInfo(text); +} +#endif + +void View::showOrHideFaceFrame(bool show) +{ + if (m_ui){ + m_ui->showOrHideFaceFrame(show); + } +} + +void View::showPassResult(bool pass) +{ + if (m_ui){ + m_ui->showPassResult(pass); + } +} + +void View::showRecoUiColorFaceSnapshot(const char* path) +{ + m_ui->showRecoUiColorFaceSnapshot(path); +} + +void View::showRecoUiColorFaceSnapshot(const unsigned char* jpgDate, int len) +{ + m_ui->showRecoUiColorFaceSnapshot(jpgDate, len); +} + + +void View::recoUiswitchToType(int type) +{ + m_ui->recoUiswitchToType(type); +} + +void View::qrcodeFastCfgResult(bool isSuccessed) +{ + m_ui->qrcodeFastCfgResult(isSuccessed); +} + +void View::icCardResult(const char *icCardNum) +{ + m_ui->icCardResult(icCardNum); +} + +bool View::isInSettingUi() +{ + return m_ui->isInSettingUi(); +} + +void View::updateAdScreen() +{ + return m_ui->updateAdScreen(); +} + +void View::showHealthMsg(int type, float temp, const char* msg, bool pass, + const unsigned char* jpgDate, int jpgLen, const char* tripCity, const char* failReason, int bgColor, int displayTime) +{ + m_ui->showHealthMsg(type, temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor, displayTime); +} + +/* +0:隐藏 +1:打开 +2:未授权 +3:已授权 +4:授权不可用 +*/ +void View::showHealthCodeAuthStatus(int status) +{ + m_ui->showHealthCodeAuthStatus(status); +} + +void View::showAntiDismantleDetect(bool upload) +{ + m_ui->showAntiDismantleDetect(upload); +} + +void View::showSceneResult(int result, const char* resultText, const char* businessInfo, int displayTime) +{ + m_ui->showSceneResult(result, resultText, businessInfo, displayTime); +} + +void View::updatePersonNumAccessed(int personAccess, int personAll) +{ + m_ui->updatePersonNumAccessed(personAccess, personAll); +} + +bool View::isScenePassing() +{ + return m_ui->isScenePassing(); +} + +void View::setSceneUiPersonCountType(int type) +{ + return m_ui->setSceneUiPersonCountType(type); +} + +void View::updateSceneUiPersonCount(int count) +{ + m_ui->updateSceneUiPersonCount(count); +} + +void View::showCallBtn(bool callButton, bool videoButton) { + auto event = new AsyncEvent([=]() { + emit m_ui->signalShowCallBtn(callButton, videoButton); + }); + QCoreApplication::postEvent(m_ui, event); +} + +void View::showCallDialPage() +{ + m_ui->showCallDialPage(); +} + +void View::showCallReceiverCallIn(const char* callerName, bool videoEnable) +{ + m_ui->setCallConsoleStatus(videoEnable ? 51 : 50, callerName); +} + +void View::showCallInitiatorConnected(bool videoEnable) +{ + m_ui->setCallConsoleStatus(videoEnable ? 1 : 0, ""); +} + +void View::exitCall() +{ + m_ui->setCallConsoleStatus(100, ""); +} + +void View::showCallPlatformCallIn(const char *callerName) { + m_ui->setCallConsoleStatus(recoUiCallConsole::PlatformCallIn, callerName); +} + +void View::showCallVideoPlayer(bool show) { + m_ui->setCallConsoleStatus(show ? recoUiCallConsole::ShowVideo : recoUiCallConsole::HideVideo, ""); +} + +void View::setDndMode(bool enabled, const std::chrono::system_clock::time_point &time) { + auto event = new AsyncEvent([=]() { m_ui->setDndMode(enabled, time); }); + QCoreApplication::postEvent(m_ui, event); +} + +void View::showRecoUiDevIdAndVer(bool show) +{ + m_ui->showRecoUiDevIdAndVer(show); +} + +void View::showUserItemChoose(const std::vector& items) +{ + m_ui->showUserItemChoose(items); +} + + + +#include +#include +void rotateRgbImage(const unsigned char* inputImage, int width, int height, unsigned char* outptuImg, double angle) +{ + QImage inputImg((const uchar*)inputImage, width, height, QImage::Format_RGB888); + QMatrix matrix; + matrix.rotate(angle); + memcpy(outptuImg, inputImg.transformed(matrix).bits(), width * height * 3); +} + diff --git a/Linguist/interface/View.h b/Linguist/interface/View.h new file mode 100644 index 0000000..cf026ca --- /dev/null +++ b/Linguist/interface/View.h @@ -0,0 +1,174 @@ +/******************************************************************** +* Name : View.h +* Param : +* Return : +* Describ : +* Author : Zhang Botong +* Date : 2019-11-13 +********************************************************************/ + +#ifndef VIEW_H +#define VIEW_H + +#include "BackStage.h" +#include "mainUi.h" + +typedef enum +{ + Error1_N = 1000, + Error_INPUT_PARAM, + Error1_1, + ErrorLive, + Error_PERSON_ID_NO_EXIST, + Error_REGISTER_PERSON, + Error_DELETE_PERSON, + Error_CLEAR_PERSON, + Error_QUERY_PERSON_COUNT, + Error_QUERY_MAX_PERSON_ID, + Error_NO_FACE, + Error_NO_FACE_IMAGE, + Error_REGISTER_FACE, + Error_DELETE_FACE, + Error_QUERY_PERSONID, + Error_QUERY +}enErrCode; + +class View +{ +public: + enum class enRecoUiMaskType + { + enRecoUiMaskNormal, + enRecoUiMaskTempCalibra, + enRecoUiMaskLight, + enRecoUiMaskDark, + + enRecoUiMaskMax + }; + + static View* getInstance(); + static int msgShowOvertimeCloseCB(void *data); + + int viewInitBackstage(void* pParaMng, void* pObjs, bool needSetupWizard); + int viewCreateUi(int languageType, bool showCursor); + int viewCreateSettingUi(); + virtual ~View(); + + void showRecoMsgReco(); + void showUnauthorizedPage(); + void showScreenSaverPage(); + void showErrorDisplayPage(enErrCode errCode); + void notifyFaceInfo(const bool faceAvailable); + + void showRecoMsgRetry(); + void showRecoMsgFail(int failType = 0); + void showRecoSuccess(const char *name); + void showFaceImg(const unsigned char *imgData, const int imgLen); + void showRecoMsgIDFail(); + + void startCapture(); + void updatePlatformConnectionStatus(UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_E state); + + void showRecoMsgMoveForehead(); //移动到额头区 + void showRecoMsgForeheadNormalTemp(const float temp, const bool isC); //显示正常温度 + void showRecoMsgForeheadAbnormalTemp(const float temp, const bool isHigh, const bool isC); //显示异常温度 + + void showRecoMsgReadTempFailed(); //体温检测失败 + void showRecoMsgNoMaskWarn(); //请戴口罩 + void showRecoMsgMaskOk(); //口罩检测成功 + void showRecoMsgNoEntry(const bool noEntry); //禁止通行或者清除禁止通行 + void showRecoMsgMaskWarn(); + void turnOffScanLine(); //关闭扫描线 + void updateLogo(int logo); + void showQRCodeResult(int result); + void showQRCodeReco(); + void showFaceReco(); + void updateRecoUiIp(); + + void showFeatureUpdateProgress(const unsigned current, const unsigned all); + void closeFeatureUpdateProgress(); + + void showCalibrationBox(); + void closeCalibrationBox(); + + //color:0-white, 1-red, 2-yellow + void showNotiMsg(const char *msg, int color, double displayTime = 3600 * 8); + + void switchLightOrDarkRecoUi(bool isDark); + + void updateScreenSaver(); + void grabScreen(const char* picName, int rotate = 0); + void showDrawPage(); + void switchToRecoUi(); + + void showCenterMsg(const char* msg, double displayTime = 3.0, int type = 0); + void closeCenterMsgWin(); + + void showCursorSwitch(bool sw); + void setPwdButton(bool visible); + + int setNetWire(const stNetWire& wireCfg); + int setServerAddr(const char *addr, bool byQrcode = false); + + void showPwdUiPersonName(const char* name); + void showUserPwd(const char* name); + void showUserPwdError(int type, int color = 0); + + void showUserCandidate(const char** opns, int opnsNum); + void showDevTestPage(const char* devCfgMsg); + void setDevTestMesAddrAndProdNoText(const char* text); + void setDevTestPcbSeqText(const char* text); + #if 0 + void setDevTestConfigInfo(const char* text); + #endif + + void showOrHideFaceFrame(bool show); + void showPassResult(bool pass); + + void showRecoUiColorFaceSnapshot(const char* path); + void showRecoUiColorFaceSnapshot(const unsigned char* jpgDate, int len); + void recoUiswitchToType(int type); + void qrcodeFastCfgResult(bool isSuccessed); + + void icCardResult(const char* icCardNum); + bool isInSettingUi(); + void updateAdScreen(); + + void showHealthMsg(int type, float temp, const char* msg, bool pass, const unsigned char* jpgDate, + int jpgLen, const char* tripCity, const char* failReason, int bgColor, int displayTime = 3); + void showHealthCodeAuthStatus(int status); + + void showAntiDismantleDetect(bool upload); + + void showSceneResult(int result, const char* resultText, const char* businessInfo, int displayTime); + void updatePersonNumAccessed(int personAccess, int personAll); + bool isScenePassing(); + void setSceneUiPersonCountType(int type); + void updateSceneUiPersonCount(int count); + + void showCallBtn(bool callButton, bool videoButton);//显示/隐藏通话按键 + void showCallDialPage();//显示拨号页面 + void showCallReceiverCallIn(const char* callerName, bool videoEnable);//显示接收者通话拨入 + void showCallInitiatorConnected(bool videoEnable);//显示发起者通话接通 + void exitCall();//退出通话界面 + void showCallPlatformCallIn(const char* callerName);//显示平台通话拨入 + void showCallVideoPlayer(bool show);//显示/隐藏视频播放 + void setDndMode(bool enabled, const std::chrono::system_clock::time_point &time); + void showRecoUiDevIdAndVer(bool show); + void showUserItemChoose(const std::vector& items); + +protected: + View(); +private: + Backstage* m_backstage; + mainUi* m_ui; + static View * m_this; + bool m_needSetupWizard = false; + + unsigned long long m_ullNotiMsgShowTmr = 0; + unsigned long long m_ullCenterMsgShowTmr = 0; +}; + +void rotateRgbImage(const unsigned char* inputImage, int width, int height, unsigned char* outptuImg, double angle); + +#endif diff --git a/Linguist/keyboard/LineEditWithKeyboard.cpp b/Linguist/keyboard/LineEditWithKeyboard.cpp new file mode 100644 index 0000000..48282d1 --- /dev/null +++ b/Linguist/keyboard/LineEditWithKeyboard.cpp @@ -0,0 +1,33 @@ +#include "LineEditWithKeyboard.h" +#include +#include "keyboard.h" + +LineEditWithKeyboard::LineEditWithKeyboard(QWidget *parent) : + QLineEdit(parent), m_keyboard(nullptr) +{ +} + +void LineEditWithKeyboard::mousePressEvent(QMouseEvent *event) +{ + qDebug() << "LineEditWithKeyboard::mousePressEvent"; + emit signalMousePressed(); + + keyboard::GetInstance(this); + QLineEdit::mousePressEvent(event); +} + +void LineEditWithKeyboard::slotWordChoose(QString word) +{ + setText(text() + word); +} + +void LineEditWithKeyboard::keyPressEvent(QKeyEvent* event) +{ + //qDebug() << "LineEditWithKeyboard::keyPressEvent"; + emit signalMousePressed(); + QWidget* w = dynamic_cast(parent()); + if(w) + w->setFocus(); + QLineEdit::keyPressEvent(event); +} + diff --git a/Linguist/keyboard/LineEditWithKeyboard.h b/Linguist/keyboard/LineEditWithKeyboard.h new file mode 100644 index 0000000..3e46d30 --- /dev/null +++ b/Linguist/keyboard/LineEditWithKeyboard.h @@ -0,0 +1,28 @@ +#ifndef LINEDIT_WITH_KEYBOARD +#define LINEDIT_WITH_KEYBOARD +#include +#include +#include "keyboard.h" + +class LineEditWithKeyboard : public QLineEdit +{ + Q_OBJECT +public: + LineEditWithKeyboard(QWidget *parent = nullptr); + +protected: + void mousePressEvent(QMouseEvent *event); + +signals: + void signalMousePressed(); + +public slots: + void slotWordChoose(QString word); + +private: + void keyPressEvent(QKeyEvent* event); + + keyboard* m_keyboard; +}; + +#endif // LINEDIT_WITH_KEYBOARD diff --git a/Linguist/keyboard/LineEditWithPopup.cpp b/Linguist/keyboard/LineEditWithPopup.cpp new file mode 100644 index 0000000..ba4e071 --- /dev/null +++ b/Linguist/keyboard/LineEditWithPopup.cpp @@ -0,0 +1,17 @@ +#include "LineEditWithPopup.h" + +LineEditWithPopup::LineEditWithPopup(QWidget *parent) : QLineEdit(parent) +{ + connect(this, SIGNAL(signalCallPopup()), this, SLOT(slotShowPopup)); +} + + +void LineEditWithPopup::mousePressEvent(QMouseEvent *event) +{ + + QLineEdit::mousePressEvent(event); +} + +void LineEditWithPopup::slotShowPopup() +{ +} diff --git a/Linguist/keyboard/LineEditWithPopup.h b/Linguist/keyboard/LineEditWithPopup.h new file mode 100644 index 0000000..f31cc82 --- /dev/null +++ b/Linguist/keyboard/LineEditWithPopup.h @@ -0,0 +1,23 @@ +#ifndef LINEEDITWITHPOPUP_H +#define LINEEDITWITHPOPUP_H + +#include +#include + +class LineEditWithPopup : public QLineEdit +{ + Q_OBJECT +public: + explicit LineEditWithPopup(QWidget *parent = nullptr); +signals: + void signalCallPopup(); + +public slots: + void slotShowPopup(); + +private: + QStringList* m_list; + void mousePressEvent(QMouseEvent *event); +}; + +#endif // LINEEDITWITHPOPUP_H diff --git a/Linguist/keyboard/keyboard.cpp b/Linguist/keyboard/keyboard.cpp new file mode 100644 index 0000000..4eadc1d --- /dev/null +++ b/Linguist/keyboard/keyboard.cpp @@ -0,0 +1,594 @@ +#include "keyboard.h" +#include "LineEditWithKeyboard.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "UiConfig.h" +#include "UiTools.h" + +//∧ len:3 +#define KEY_COL_UNIT 4 +#define KEY_HIDE " ▼ " +#define KEY_UPPER "△" +#define KEY_LOWER "∧" +#define KEY_SYMBOL " !@# " +#define KEY_SYMBOL_BACK "Back" +#define KEY_CN "中" +#define KEY_EN "En" +#define KEY_SPACE " Space " +#define KEY_BACKSPACE " ← " +#define KEY_ENTER "Enter" + + + +//添加按键时需要注意不要超出头文件中定义的按键个数 +static const char* lower_letter[] = {KEY_HIDE, + "1","2","3","4","5","6","7","8","9","0", + "q","w","e","r","t","y","u","i","o","p", + "a","s","d","f","g","h","j","k","l", + KEY_UPPER,"z","x","c","v","b","n","m",KEY_BACKSPACE, + KEY_CN,KEY_SYMBOL,KEY_SPACE,".",KEY_ENTER}; + +static const char* upper_letter[] = {KEY_HIDE, + "1","2","3","4","5","6","7","8","9","0", + "Q","W","E","R","T","Y","U","I","O","P", + "A","S","D","F","G","H","J","K","L", + KEY_LOWER,"Z","X","C","V", "B","N","M",KEY_BACKSPACE, + KEY_CN,KEY_SYMBOL,KEY_SPACE,".",KEY_ENTER}; + +static const char* cn_letter[] = {KEY_HIDE, + "-","=","[","]","\\",";","\'",",","?","/", + "!","@","#","$","%","^","&&","*","(",")", + "_","+","{","}","|",":","\"","<",">", + "~","·","×","÷","「","」","✘","√",KEY_BACKSPACE, + KEY_CN,KEY_SYMBOL_BACK,KEY_SPACE,".",KEY_ENTER}; + +static const int COL_NUM_EACH_ROW[] = {1, 10, 10, 9, 9, 5}; +static const int KEY_NUM = sizeof(lower_letter) / sizeof(*lower_letter); + + +#if 0 +QPushButton* keyboard::m_btn[KEYS_QUANTITY_MAX] = {nullptr}; +//chinese support +QVector* keyboard::m_btnsCnCdd = nullptr; +QLineEdit* keyboard::m_editCn = nullptr; +QPushButton* keyboard::m_btnCnPrePage = nullptr; +QPushButton* keyboard::m_btnCnNextPage = nullptr; +#endif + +QFile* keyboard::m_pinyinFile = nullptr; +QRegExp* keyboard::m_regExp = nullptr; +QMultiMap* keyboard::m_pinyinMap = nullptr; + +keyboard* keyboard::m_instance = nullptr; +keyboard::enKeyboardStatus keyboard::m_status = enKeyboardNotGen; + +keyboard* keyboard::GetInstance(QWidget *parent) +{ + if(nullptr == m_instance && nullptr != parent){ + qDebug() << "create keyboard"; + m_status = enKeyboardCreating; + m_instance = new keyboard(parent); + m_instance->popup(); + m_status = enKeyboardCreated; + } + if(parent){ + QObject* recv = static_cast(parent); + if(m_instance->receiver() != recv){ + m_instance->setReceiver(static_cast(parent)); + } + } + return m_instance; +} + +void keyboard::close() +{ + if(m_instance){ + if(enKeyboardCreated == m_status){ + qDebug() << "close keyboard"; + m_instance->slotClose(); + } + else { + qDebug() << "close keyboard later"; + QTimer::singleShot(500, m_instance, SLOT(slotClose())); + } + } +} + +void keyboard::preLoad() +{ + if(nullptr == m_instance){ + qDebug() << "keyboard pre load"; + keyboard(); + } +} + +keyboard::keyboard(QWidget *parent) : QDialog(parent), m_receiver(nullptr) +{ + m_status = enKeyboardNotGen; + m_editCn = nullptr; + m_btnCnPrePage = nullptr; + m_btnCnNextPage = nullptr; + + setReceiver(static_cast(parent)); + + qDebug() << "keyboard()"; + QPalette palette(this->palette()); + palette.setColor(QPalette::ButtonText, Qt::white); + + const int chooseBtnHeight = UiConfig::GetInstance()->getUiWidth() / 16; + + m_btnsCnCdd.resize(8); + QHBoxLayout* hLayoutCdd = new QHBoxLayout(); + for(auto &b : m_btnsCnCdd) + { + //if(nullptr == b){ + b = new QPushButton(); + b->setFixedWidth(static_cast(UiConfig::GetInstance()->getUiWidth()) / m_btnsCnCdd.size()); + b->setPalette(palette); + b->setStyleSheet("background-color: transparent;"); + b->setFlat(true); + b->setFixedSize(chooseBtnHeight * 2, chooseBtnHeight); + connect(b, SIGNAL(clicked(bool)), this, SLOT(slotCandidateBtnClicked())); + //} + hLayoutCdd->addWidget(b, 1, Qt::AlignLeft); + } + hLayoutCdd->addWidget(new QLabel(this), 100, Qt::AlignRight); + + if(nullptr == m_editCn){ + m_editCn = new QLineEdit(); + m_editCn->setReadOnly(true); + palette.setColor(QPalette::Text, Qt::white); + m_editCn->setPalette(palette); + m_editCn->setFixedSize(chooseBtnHeight * 4, chooseBtnHeight); + m_editCn->setStyleSheet("background:transparent;border-width:0;border-style:outset"); + } + if(nullptr == m_btnCnPrePage){ + m_btnCnPrePage = new QPushButton(); + m_btnCnPrePage->setText(" ↑ "); + m_btnCnPrePage->setPalette(palette); + m_btnCnPrePage->setFixedSize(chooseBtnHeight * 2, chooseBtnHeight); + m_btnCnPrePage->setStyleSheet("background-color: rgb(57, 53, 50);"); + connect(m_btnCnPrePage, SIGNAL(clicked(bool)), this, SLOT(slotPageTurnBtnClicked())); + } + + if(nullptr == m_btnCnNextPage){ + m_btnCnNextPage = new QPushButton(); + m_btnCnNextPage->setText(" ↓ "); + m_btnCnNextPage->setPalette(palette); + m_btnCnNextPage->setFixedSize(chooseBtnHeight * 2, chooseBtnHeight); + m_btnCnNextPage->setStyleSheet("background-color: rgb(57, 53, 50);"); + connect(m_btnCnNextPage, SIGNAL(clicked(bool)), this, SLOT(slotPageTurnBtnClicked())); + } + + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->addLayout(hLayoutCdd); + + QHBoxLayout* hLayoutLine[ROW_NUM] = {nullptr}; + for(int i = 0; i < ROW_NUM; i ++) + { + hLayoutLine[i] = new QHBoxLayout(); + hLayoutLine[i]->setMargin(0); + //hLayoutLine[i]->setSpacing(15); + if(i < ROW_NUM - 1){ //最后一列不需要 + hLayoutLine[i]->addStretch(0); + } + } + hLayoutLine[0]->addWidget(m_editCn, 2, Qt::AlignLeft); + hLayoutLine[0]->addWidget(m_btnCnPrePage, 1, Qt::AlignLeft); + hLayoutLine[0]->addWidget(m_btnCnNextPage, 1, Qt::AlignLeft); + + int col = 0; + int row = 0; + int colMax = 0; //最大列数 + int colTaken = 0; + palette.setColor(QPalette::ButtonText, Qt::white); + QFont ft; + ft.setPointSize(UiConfig::GetInstance()->isRkDevice() ? 12 : 24); + for(int i = 0; i < KEY_NUM; i ++) + { + m_btn[i] = new QPushButton(this); + m_btn[i]->setPalette(palette); + m_btn[i]->setStyleSheet("background-color: rgb(57, 53, 50);"); + m_btn[i]->setFocusPolicy(Qt::NoFocus); + m_btn[i]->setFont(ft); + //m_btn[i]->setFlat(true); + + connect(m_btn[i], SIGNAL(clicked(bool)), this, SLOT(slotBtnClicked())); + connect(m_btn[i], SIGNAL(pressed()), this, SLOT(slotBtnPressed())); + connect(m_btn[i], SIGNAL(released()), this, SLOT(slotBtnReleased())); + + int btnCol = (strlen(lower_letter[i]) / KEY_COL_UNIT) + 1; + hLayoutLine[row]->addWidget(m_btn[i]); + + colTaken += btnCol; + col++; + if(COL_NUM_EACH_ROW[row] == col) + { + col = 0; + row++; + if(colTaken > colMax){ + colMax = colTaken; + } + colTaken = 0; + } + } + + int unit = (UiConfig::GetInstance()->getUiWidth() - ((colMax - 1) * SPACE)) / colMax; + for(int i = 0; i < KEY_NUM; i ++) + { + int btnCol = (strlen(lower_letter[i]) / KEY_COL_UNIT) + 1; + m_btn[i]->setFixedSize(unit * btnCol, static_cast(unit)); + } + for(int i = 0; i < ROW_NUM; i ++) + { + if(i > 0 && i < ROW_NUM - 1){ //首行和尾行不需要 + hLayoutLine[i]->addStretch(0); + } + vLayout->addLayout(hLayoutLine[i]); + } + vLayout->setSpacing(5);//10 + vLayout->setContentsMargins(0, 10, 0, 10); + setLayout(vLayout); + setFocusPolicy(Qt::NoFocus); + setWindowFlags( Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Tool | Qt::WindowDoesNotAcceptFocus); + + if(nullptr == m_pinyinFile){ + m_pinyinFile = new QFile(); + m_pinyinFile->setFileName(":/res/inputCn/pinyin-utf8"); //设置QFile的名称 + if(!m_pinyinFile->open(QIODevice::ReadOnly) ){ //只读模式,打开文件 + QMessageBox::warning(nullptr, "pinyin file", "can't load"); //打开失败,则报错 + } + } + if(nullptr == m_regExp){ + m_regExp = new QRegExp(); + m_regExp->setCaseSensitivity(Qt::CaseSensitive); //设置正则表达式的参数,Qt::CaseInsensitive,大小写敏感 + m_regExp->setPattern(QString("([a-z]+)")); //获得正则本身,获取a-z + } + if(nullptr == m_pinyinMap){ + m_pinyinMap = new QMultiMap(); + while(!m_pinyinFile->atEnd()) + { + QByteArray lineData = m_pinyinFile->readLine(); //读取一行 + //qDebug() << "line:" << QString(data.data()); + int ret = m_regExp->indexIn(QString(lineData.data()), 0, QRegExp::CaretAtZero); //进行匹配,如果成功则返回index,不成功返回-1 ,data.data()是读取到的一行数据,返回值应该是匹配到的位置 + //qDebug() << "ret =" << ret; + //qDebug() << "m_regExp.cap(1):" << m_regExp.cap(1) << "QString(lineData.data()).left(ret):" << QString(lineData.data()).left(ret); + if("\r\n" != QString(lineData.data()).left(ret)){ + m_pinyinMap->insert(m_regExp->cap(1), QString(lineData.data()).left(ret)); //将mmap对象的成员初始化;key是字母,value是行字 + } + } + m_pinyinFile->close(); + } + setInputMethodCn(false); + setAttribute(Qt::WA_DeleteOnClose); + setFixedWidth(UiConfig::GetInstance()->getUiWidth()); + + m_labelTip = new QLabel(this); + m_labelTip->setFixedSize(unit, static_cast(unit * 1.5)); + m_labelTip->setFont(ft); + m_labelTip->setStyleSheet("background-color: rgb(15, 116, 248);"); + m_labelTip->setAlignment(Qt :: AlignCenter); + m_labelTip->hide(); + + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimer())); + + shiftkeyboard(2); +} + +keyboard::~keyboard() +{ + qDebug() << "~keyboard()"; + m_instance = nullptr; +} + +void keyboard::setInputMethodCn(bool setCn) +{ + if(setCn){ + m_editCn->clear(); + m_editCn->show(); + } + else { + for(auto &b : m_btnsCnCdd){ + b->hide(); + } + m_editCn->hide(); + m_btnCnPrePage->hide(); + m_btnCnNextPage->hide(); + } + isInputMethodCn = setCn; +} + +void keyboard::shiftkeyboard(int caps) +{ + const char** letter = nullptr; + if(0 == caps){ + letter = upper_letter; + } + else if (1 == caps) { + letter = cn_letter; + } + else if (2 == caps) { + letter = lower_letter; + } + for(int i = 0; i < KEY_NUM; i ++){ + if(m_btn[i]->text().isEmpty()){ //if has icon, clear first + m_btn[i]->setIcon(QIcon()); + } + if(QString(letter[i]) == KEY_BACKSPACE){ + m_btn[i]->setText(""); + //m_btn[i]->setIcon(QIcon(":res/image/pwd_del_large.png")); + setButtonBackImage(m_btn[i], ":res/image/pwd_del_large_black.png", m_btn[i]->height() / 2 , static_cast(m_btn[i]->height() * 0.34));//w/2*(24/35) + m_btn[i]->setStyleSheet("background-color: rgb(57, 53, 50);"); + m_btn[i]->setProperty("key", letter[i]); + } + else if(QString(letter[i]) == KEY_UPPER){ + m_btn[i]->setText(""); + //m_btn[i]->setIcon(QIcon(":res/image/shift_large.png")); + setButtonBackImage(m_btn[i], ":res/image/shift_large_black.png", m_btn[i]->height() / 2, m_btn[i]->height() / 2); + m_btn[i]->setStyleSheet("background-color: rgb(57, 53, 50);"); + m_btn[i]->setProperty("key", letter[i]); + } + else if(QString(letter[i]) == KEY_LOWER){ + m_btn[i]->setText(""); + //m_btn[i]->setIcon(QIcon(":res/image/shift_lock_large.png")); + setButtonBackImage(m_btn[i], ":res/image/shift_lock_large_black.png", m_btn[i]->height() / 2, m_btn[i]->height() / 2); + m_btn[i]->setStyleSheet("background-color: rgb(57, 53, 50);"); + m_btn[i]->setProperty("key", letter[i]); + } + else{ + m_btn[i]->setText(letter[i]); + } + } +} + +void keyboard::slotBtnPressed() +{ + //qDebug() << "unit:" << dynamic_cast(sender())->width(); + QPushButton* btn = dynamic_cast(sender()); + if(btn){ + for(int i = 0; i < KEY_NUM - 4; i ++){ + if(btn == m_btn[i]){ + int len = strlen(btn->text().toStdString().c_str()); + if(len > 0 && len <= 3){ + m_labelTip->setText(btn->text()); + m_labelTip->move(btn->x(), btn->y() - m_labelTip->height()); + m_labelTip->show(); + } + } + } + m_curPressedKey = btn; + m_timer->start(500); + } +} + +void keyboard::slotBtnReleased() +{ + m_labelTip->hide(); + m_timer->stop(); + m_curPressedKey = nullptr; +} + +void keyboard::slotBtnClicked() +{ + for(int i = 0; i < KEY_NUM; i ++){ + if(sender() == m_btn[i]){ + keyPress(m_btn[i]); + break; + } + } +} + +void keyboard::slotPageTurnBtnClicked() +{ + if(sender() == m_btnCnPrePage){ + changePage(--m_iCddPageIndex); + } + else if (sender() == m_btnCnNextPage) { + changePage(++m_iCddPageIndex); + } +} + +void keyboard::slotCandidateBtnClicked() +{ + for(auto &b : m_btnsCnCdd){ + if(sender() == b){ + emit signalWordChoose(b->text()); + m_editCn->clear(); + for(auto &btn : m_btnsCnCdd){ + btn->hide(); + } + m_btnCnPrePage->hide(); + m_btnCnNextPage->hide(); + break; + } + } +} + +void keyboard::slotClose() +{ + done(0); +} + +void keyboard::slotTimer() +{ + if(m_curPressedKey){ + m_timer->start(100); + keyPress(m_curPressedKey); + } +} + + +void keyboard::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + painter.fillRect(this->rect(), QColor(0, 0, 0,/*0x1f, 0x28, 0x41,*/ 255)); //QColor最后一个参数代表背景的透明度 + return QWidget::paintEvent(event); +} + +void keyboard::keyPress(const QPushButton* btn) +{ + if(!btn){ + return; + } + + QString str = btn->text(); + if(str.isEmpty()){ + str = btn->property("key").toString(); + } + + QKeyEvent* event = nullptr; + if(str == KEY_BACKSPACE){ + event = new QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier); + }else if(str == KEY_ENTER){ + event = new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier); + }else if(str == KEY_UPPER){ + shiftkeyboard(0);//upper_letter + }else if(str == KEY_LOWER){ + shiftkeyboard(2);//lower_letter + }else if(str == KEY_CN){ + shiftkeyboard(2); + for(int j = 0; j < KEY_NUM; j ++){ + if(m_btn[j]->text() == KEY_CN){ + m_btn[j]->setText(KEY_EN); + } + } + setInputMethodCn(true); + }else if(str == KEY_EN){ + for(int j = 0; j < KEY_NUM; j ++){ + if(m_btn[j]->text() == KEY_EN){ + m_btn[j]->setText(KEY_CN); + } + } + setInputMethodCn(false); + }else if(str == KEY_HIDE){ + slotClose(); + }else if(str == KEY_SYMBOL){ + shiftkeyboard(1); + }else if(str == KEY_SYMBOL_BACK){ + shiftkeyboard(2); + }else{ + if(str == KEY_SPACE) + str = " "; + else if (str == "&&") { + str = "&"; + } + event = new QKeyEvent(QEvent::KeyPress, 0, Qt::NoModifier, str); + } + + if(isInputMethodCn){ + if(str >= "a" && str <= "z"){ //qt5.5 does not have isLower() func + m_editCn->setText(m_editCn->text() + str); + matching(m_editCn->text()); + }else if (str == KEY_BACKSPACE) { + if("" != m_editCn->text()){ + m_editCn->setText(m_editCn->text().remove(m_editCn->text().length() - 1, 1)); + matching(m_editCn->text()); + }else{ + QApplication::sendEvent(m_receiver, new QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier)); + } + }else { + if(nullptr != event){ + QApplication::sendEvent(m_receiver, event); + } + } + }else{ + if(nullptr != event){ + QApplication::sendEvent(m_receiver, event); + } + } + static_cast(m_receiver)->setFocus(); +} + + +void keyboard::popup(const int posToBottom) +{ + qDebug() << "keyboard popup"; + show(); + move(0, UiConfig::GetInstance()->getUiHeight() - height() - posToBottom); +#if 0 + qDebug() << "child: " << children().size(); + QObjectList& childList = const_cast(children()); + childList.clear(); + qDebug() << "****************child: " << children().size(); +#endif +} + +void keyboard::matching(const QString& userInput) +{ + //qDebug() << "input:" << userInput; + QList list = m_pinyinMap->values(userInput); + int foundQty = list.size(); + //qDebug() << "list:" << foundQty; + m_pinyinList.clear(); +#if 0 + for (QList::const_reverse_iterator itr = list.rbegin(); itr != list.rend(); ++itr){ + m_pinyinList.append(*itr); + } +#else + for(int i=0; ihide(); + } + + const int matchQty = m_pinyinList.size(); + //qDebug() << "matchQty:" << matchQty; + if(matchQty){ + const int btnQty = m_btnsCnCdd.size(); + const int showQty = matchQty - (index * btnQty) > btnQty ? btnQty : matchQty - (index * btnQty); + for(int i=0; iisHidden()){ + m_btnsCnCdd.at(i)->show(); + } + m_btnsCnCdd.at(i)->setText(m_pinyinList.value(i + index * btnQty)); + //qDebug() << "word:" << m_pinyinList.value(i + index * btnQty); + } + + m_btnCnPrePage->show(); + m_btnCnNextPage->show(); + m_btnCnPrePage->setEnabled(0 != index); + m_btnCnNextPage->setEnabled( (showQty == btnQty) && (matchQty - ((index + 1) * btnQty)) ); + } + else { + m_btnCnPrePage->hide(); + m_btnCnNextPage->hide(); + } +} + +void keyboard::setReceiver(QObject* receiver) +{ + if(nullptr != receiver){ + if(m_receiver){ + disconnect(this, SIGNAL(signalWordChoose(QString)), m_receiver, SLOT(slotWordChoose(QString))); + } + m_receiver = receiver; + connect(this, SIGNAL(signalWordChoose(QString)), m_receiver, SLOT(slotWordChoose(QString))); + } +} + + +QObject* keyboard::receiver() const +{ + return m_receiver; +} diff --git a/Linguist/keyboard/keyboard.h b/Linguist/keyboard/keyboard.h new file mode 100644 index 0000000..14df657 --- /dev/null +++ b/Linguist/keyboard/keyboard.h @@ -0,0 +1,85 @@ +#ifndef KEYBOARD_H +#define KEYBOARD_H + +#include +#include +#include +#include + +//chinese support +#include +#include +#include +#include + +class keyboard : public QDialog +{ + Q_OBJECT +public: + typedef enum + { + enKeyboardNotGen, + enKeyboardCreating, + enKeyboardCreated + }enKeyboardStatus; + + static const int KEYS_QUANTITY_MAX = 60; + static const int SPACE = 5; + static const int ROW_NUM = 6; + + static keyboard* GetInstance(QWidget *parent); + static void preLoad(); + static void close(); + + ~keyboard(); + void popup(const int posToBottom = 0); + +signals: + void signalWordChoose(QString word); + +public slots: + void slotBtnClicked(); + void slotBtnPressed(); + void slotBtnReleased(); + void slotPageTurnBtnClicked(); + void slotCandidateBtnClicked(); + void slotClose(); + void slotTimer(); + +private: + static keyboard* m_instance; + QObject* m_receiver; + static enKeyboardStatus m_status; + + QPushButton* m_btn[KEYS_QUANTITY_MAX]; + //chinese support + QVector m_btnsCnCdd; + QLineEdit* m_editCn; + QPushButton* m_btnCnPrePage; + QPushButton* m_btnCnNextPage; + + static QFile* m_pinyinFile; + static QRegExp* m_regExp; + static QMultiMap* m_pinyinMap; + + bool isInputMethodCn; + int m_iCddPageIndex; + QList m_pinyinList; + + QLabel* m_labelTip; + QTimer* m_timer; + QPushButton* m_curPressedKey; + + explicit keyboard(QWidget *parent = nullptr); + void setInputMethodCn(bool setCn); + void matching(const QString& userInput); + void changePage(int index); + void setReceiver(QObject*); + QObject* receiver() const; + + void shiftkeyboard(int caps); + void paintEvent(QPaintEvent *event); + void keyPress(const QPushButton* btn); +}; + +#endif // KEYBOARD_H diff --git a/Linguist/mainUi/UiCommon.h b/Linguist/mainUi/UiCommon.h new file mode 100644 index 0000000..72ce028 --- /dev/null +++ b/Linguist/mainUi/UiCommon.h @@ -0,0 +1,16 @@ +#ifndef UICOMMON_H +#define UICOMMON_H + +typedef enum +{ + OPTION_LOGO = 0, + OPTION_LOGOTIME, + OPTION_BACKGROUND, + OPTION_RECOGNIZE_OK, + OPTION_RECOGNIZE_FAIL, + OPTION_AUDIO_OK, + OPTION_AUDIO_FAIL, + OPTION_OTHERS +}INTERACION_OPTION; + +#endif // UICOMMON_H diff --git a/Linguist/mainUi/UiConfig.cpp b/Linguist/mainUi/UiConfig.cpp new file mode 100644 index 0000000..f5ae70a --- /dev/null +++ b/Linguist/mainUi/UiConfig.cpp @@ -0,0 +1,369 @@ +#include "UiConfig.h" +#include +#include + + +const int UiConfig::GLOBAL_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY] = {11, 20, 20, 8, 8}; + +const QString UiConfig::WELCOME[SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/start-600-1024.jpg", +":/res/image/start-800-1280.jpg", +":/res/image/start-720-1280.jpg", +":/res/image/start-800-1280.jpg", +":/res/image/start-720-1280.jpg" +}; + + +const QString UiConfig::LANGUAGE_FILE[SUPPORT_LANGUAGE_QUANTITY] = { + "", "FaceTick_TC.qm", "FaceTick_EN.qm", "FaceTick_JP.qm", "FaceTick_KR.qm", + "FaceTick_SP.qm", "FaceTick_TH.qm", "FaceTick_PT.qm", "FaceTick_IT.qm", "FaceTick_IW.qm", + "FaceTick_FR.qm", "FaceTick_DE.qm", "FaceTick_TR.qm", "FaceTick_HU.qm"}; +const int UiConfig::DEV_NAME_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY][SUPPORT_LANGUAGE_QUANTITY] = { + {25, 25, 15, 25, 25, 15, 25, 15, 15, 15, 15, 15, 15, 15}, + {50, 50, 30, 50, 50, 30, 50, 30, 30, 30, 30, 30, 30, 30}, + {50, 50, 30, 50, 50, 30, 50, 30, 30, 30, 30, 30, 30, 30}, + {20, 20, 12, 20, 20, 12, 20, 12, 12, 12, 12, 12, 12, 12}, + {20, 20, 12, 20, 20, 12, 20, 12, 12, 12, 12, 12, 12, 12} +}; +const int UiConfig::MASK_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY][SUPPORT_LANGUAGE_QUANTITY] = { + {20, 20, 14, 12, 20, 12, 12, 12, 8, 12, 12, 14, 12, 12}, + {40, 40, 28, 24, 40, 24, 24, 26, 18, 24, 24, 28, 24, 24}, + {40, 40, 28, 24, 40, 24, 24, 26, 18, 24, 24, 28, 24, 24}, + {15, 15, 10, 9, 12, 10, 10, 8, 7, 10, 10, 11, 10, 8}, + {15, 15, 10, 9, 12, 10, 10, 8, 7, 10, 10, 11, 10, 8} +}; +const int UiConfig::PERSON_MSG_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY][SUPPORT_LANGUAGE_QUANTITY] = { + {20, 20, 14, 15, 12, 15, 14, 13, 9, 12, 10, 13, 13, 9}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {14, 15, 9, 10, 10, 12, 11, 8, 8, 10, 6, 8, 10, 8}, + {15, 15, 9, 10, 10, 12, 11, 8, 8, 10, 6, 8, 10, 8} +}; + +const long long UiConfig::UI_VERSION = 202011171553; + +UiConfig* UiConfig::m_instance = nullptr; + +UiConfig* UiConfig::GetInstance() +{ + if( m_instance == nullptr ) + { + m_instance = new UiConfig(); + } + return m_instance; +} + +UiConfig::UiConfig() +{ + m_languageType = 0; + memset(m_recoUiTunningFontSize, 0, sizeof(m_recoUiTunningFontSize)); +} + +UiConfig::~UiConfig() +{ + +} + +void UiConfig::setUiConfig(const ScreenSize_E config) +{ + m_screenSize = config; + if(ScreenSize_7inch == config){ //haiqing 7inch + m_screenWidth = 600; + m_screenHeight = 1024; + } + else if(ScreenSize_8inch == config || ScreenSize_8inch_rk == config){ + m_screenWidth = 800; + m_screenHeight = 1280; + } + else if(ScreenSize_5inch == config || ScreenSize_5inch_rk == config){ + m_screenWidth = 720; + m_screenHeight = 1280; + } + else { + //nop + } +} + +void UiConfig::setUiFaceFrameSize(const FaceFrameSize_E config) +{ + m_faceFrameSize = config; +} + +int UiConfig::getUiWidth() const +{ + return m_screenWidth; +} + +int UiConfig::getUiHeight() const +{ + return m_screenHeight; +} + +const QString& UiConfig::getWelcome() const +{ + return WELCOME[(int)m_screenSize]; +} + +#if 0 +bool UiConfig::is7inch() const +{ + return (ScreenSize_7inch == m_screenSize); +} + +bool UiConfig::is8inch() const +{ + return (ScreenSize_8inch == m_screenSize); +} + +bool UiConfig::is5inch() const +{ + return (ScreenSize_5inch == m_screenSize); +} +#endif + +bool UiConfig::is8inchA038HaimanFaceFrame() const +{ + return FaceFrameSize_8inchHaiman_A038 == m_faceFrameSize; +} + +bool UiConfig::is8inchA038JinggongFaceFrame() const +{ + return FaceFrameSize_8inchJinggong_A038 == m_faceFrameSize; +} + +int UiConfig::getScreenConfigIndex() const +{ + return static_cast(m_screenSize); +} + +int UiConfig::getGlobalFontSize() const +{ + return GLOBAL_FONT_SIZE[static_cast(m_screenSize)]; +} + +int UiConfig::setLanguageType(const int type) +{ + m_languageType = type; + return 0; +} + +int UiConfig::getLanguageType() const +{ + return m_languageType; +} + +#ifdef CUSTOM_QRCODE_AREA //自定义扫描框 + +int UiConfig::getQRCodeAreaCoordinateX() const +{ + return m_QRCodeAreaX; +} + +int UiConfig::getQRCodeAreaCoordinateY() const +{ + return m_QRCodeAreaY; +} + +int UiConfig::getQRCodeAreaWidth() const +{ + return (m_screenWidth - (m_QRCodeAreaX * 2)); +} + +int UiConfig::getQRCodeAreaHeight() const +{ + //区域为正方形 + return getQRCodeAreaWidth(); +} + +void UiConfig::setQRCodeAreaCoordinateX(const int x) +{ + m_QRCodeAreaX = x; +} + +void UiConfig::setQRCodeAreaCoordinateY(const int y) +{ + m_QRCodeAreaY = y; +} + +#else + +int UiConfig::getQRCodeAreaCoordinateX() const +{ + return QRCODE_AREA_COORDINATE_X; +} + +int UiConfig::getQRCodeAreaCoordinateY() const +{ + return QRCODE_AREA_COORDINATE_Y; +} + +int UiConfig::getQRCodeAreaWidth() const +{ + return (m_screenWidth - (QRCODE_AREA_COORDINATE_X * 2)); +} + +int UiConfig::getQRCodeAreaHeight() const +{ + //区域为正方形 + return getQRCodeAreaWidth(); + //return (m_screenHeight - (QRCODE_AREA_COORDINATE_Y * 2)); +} + +#endif + +void UiConfig::setHardwareTesting(bool sw) +{ + m_bIsHardwareTesting = sw; +} + +bool UiConfig::getHardwareTesting() const +{ + return m_bIsHardwareTesting; +} + +void UiConfig::showFaceFrameByTempExist(bool set) +{ + m_bShowFaceFrame = set; +} + +bool UiConfig::isFaceFrameShowByTempExist() const +{ + return m_bShowFaceFrame; +} + +void UiConfig::setTpAvailable(bool available) +{ + m_bTpAvailable = available; +} + +bool UiConfig::isTpAvailable() const +{ + return m_bTpAvailable; +} + +void UiConfig::setfuncNotSupport(Func_E func) +{ + if(func < sizeof(m_ullfuncNotSupp) * 8){ + m_ullfuncNotSupp |= (1 << func); + } +} + +bool UiConfig::isFuncNotSupport(Func_E func) const +{ + if(func < sizeof(m_ullfuncNotSupp) * 8){ + return (bool)(m_ullfuncNotSupp & (1 << func)); + } + return true; +} + +void UiConfig::setRecoUiStyle(int style) { + if (style >= 0) { + m_recoUiStyle = style; + } +} + +bool UiConfig::isRecoUiStyleClassical() const +{ + return (0 == m_recoUiStyle); +} + +bool UiConfig::isRecoUiStyleStandard() const +{ + return (1 == m_recoUiStyle); +} + +bool UiConfig::isRecoUiStyleColor() const +{ + return (2 == m_recoUiStyle); +} + +bool UiConfig::isRecoUiStyleAd() const +{ + return (3 == m_recoUiStyle); +} + +bool UiConfig::isRecoUiStyleScene() const +{ + return (4 == m_recoUiStyle); +} + + +#if 0 +void UiConfig::setRecoUiFontSizeScale(int sizeType) +{ + m_recoUiFontSizeType = sizeType; +} + +float UiConfig::recoUiFontSizeScale() const +{ + const QVector scales{1.0f, 1.25f, 1.5f}; + return m_recoUiFontSizeType < scales.size() ? scales[m_recoUiFontSizeType] : 1.0f; +} +#endif + +void UiConfig::setRecoUiFontSize(unsigned index, int size) +{ + if(index < sizeof (m_recoUiTunningFontSize) / sizeof (m_recoUiTunningFontSize[0])){ + m_recoUiTunningFontSize[index] = size; + } +} + +int UiConfig::recoUiFontSize(unsigned index) const +{ + if(index < sizeof (m_recoUiTunningFontSize) / sizeof (m_recoUiTunningFontSize[0])){ + return m_recoUiTunningFontSize[index]; + } + return 0; +} + +int UiConfig::setRecoUITextCfg(RecoUiTextCfg::enTextType type, RecoUiTextCfg::enDisMode mode, const char* cusText, RecoUiTextCfg::enFontSize fontSize) +{ + m_textCfg[type].m_mode = mode; + m_textCfg[type].m_cusText = cusText; + m_textCfg[type].m_fontSize = fontSize; + return 0; +} + +float UiConfig::recoUiTextCfgFontSize(RecoUiTextCfg::enTextType type) +{ + const float scales[] = {1.0f, 1.2f, 0.8f, 1.4f}; + return scales[UiConfig::GetInstance()->m_textCfg[type].m_fontSize]; +} + +void UiConfig::setDefaultScreensaver(int index) +{ + m_defaultScreensaver = index; +} + +int UiConfig::defaultScreensaver() const +{ + return m_defaultScreensaver; +} + +bool UiConfig::isRkDevice() const +{ + return (ScreenSize_8inch_rk == m_screenSize || ScreenSize_5inch_rk == m_screenSize); +} + +void UiConfig::setDevTestStatus(bool test) +{ + m_isDevTesting = test; +} + +bool UiConfig::isDevTesting() const +{ + return m_isDevTesting; +} + +void UiConfig::setFastCfgStatus(bool cfg) +{ + m_isFastCfging = cfg; +} + +bool UiConfig::isFastCfging() const +{ + return m_isFastCfging; +} + + + diff --git a/Linguist/mainUi/UiConfig.h b/Linguist/mainUi/UiConfig.h new file mode 100644 index 0000000..45b5168 --- /dev/null +++ b/Linguist/mainUi/UiConfig.h @@ -0,0 +1,303 @@ +#ifndef UICONFIG_H +#define UICONFIG_H + +#include "memory.h" +#include + + +//#define DEBUG_MODE + +#define QRCODE_SUPPORT + +#ifdef QRCODE_SUPPORT +#define CUSTOM_QRCODE_AREA +#endif + + +typedef enum +{ + ScreenSize_7inch, + ScreenSize_8inch, + ScreenSize_5inch, + ScreenSize_8inch_rk, + ScreenSize_5inch_rk +}ScreenSize_E; + +typedef enum +{ + FaceFrameSize_8inchJinggong_B020, + FaceFrameSize_8inchHaiman_A038, + FaceFrameSize_8inchJinggong_A038, + + FaceFrameSize_Butt +}FaceFrameSize_E; + +typedef enum +{ + FuncWifi, + FuncWg42, + FuncCardReaderUnderScreen, + FuncDataEncrypt +}Func_E; + +class RecoUiTextCfg +{ +public: + typedef enum + { + TextOtherRecoResult, + TextFacePass = 0, + TextAllowPass, + TextAuthFailed, + TextNoEntry, + TextNOMask, + TextMaskOk, + TextTemp, + TextTapCard, + TextUseOwnCertifi, + TextFaceCam, + TextNoEntryTime, + + TextCfgMax + }enTextType; + + typedef enum + { + DisModeDefault, + DisModeHide, + DisModeCustom, + + DisModeHideKeyWord + }enDisMode; + + typedef enum + { + FontSizeDefault, + FontSizeLarge, + FontSizeSmall, + FontSizeHuge + }enFontSize; + + enDisMode m_mode = DisModeDefault; + QString m_cusText; + enFontSize m_fontSize = FontSizeDefault; + char m_padding[4]; +}; + + +class UiConfig +{ +public: + static const long long UI_VERSION; + + static const int SUPPORT_SCREEN_SIZE_QUANTITY = 5; + static const int SUPPORT_LANGUAGE_QUANTITY = 14; //简 繁 英 日 韩 西班牙 泰 葡萄牙 意大利 希伯来 法 德 土耳其 匈牙利 + + static const int GLOBAL_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString WELCOME[SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DEV_NAME_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY][SUPPORT_LANGUAGE_QUANTITY]; + static const int MASK_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY][SUPPORT_LANGUAGE_QUANTITY]; + static const int PERSON_MSG_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY][SUPPORT_LANGUAGE_QUANTITY]; + static const QString LANGUAGE_FILE[SUPPORT_LANGUAGE_QUANTITY]; + + //大 86 294 + //小133 324 + static const int QRCODE_AREA_COORDINATE_X = 133; + static const int QRCODE_AREA_COORDINATE_Y = 324; + //static const int QRCODE_AREA_WIDTH = 0; + //static const int QRCODE_AREA_HEIGHT = 0; + + RecoUiTextCfg m_textCfg[RecoUiTextCfg::TextCfgMax]; + + + typedef enum + { + #ifndef DEBUG_MODE + + //启动画面展示时间,单位:毫秒 + START_SCREEN_TIMEOUT = 4000, + + //设置界面密码多次输错等待时间,单位:分钟 + PWD_ACCEPT_DELAY_TIME = 2, + //设置界面密码尝试次数,到达次数后需要等待一段时间 + RETRY_TIMES_MAX_PER_GROUP = 6, + //设置界面密码输入无操作自动返回时间,单位:秒 + NO_OPERATION_OVERTIME_RETURN = 30, + + //识别界面鼠标点击进入设置界面次数 + MOUSE_CLICK_TIMES_TO_SETTING = 10, + + //长按时长进设置界面,需大于200ms,单位:毫秒 + TOUCH_TIME_TO_SETTING = 1000, //3000 + + #define SPECIAL_PWD_1 "recon123" + + #else + + //启动画面展示时间,单位:毫秒 + START_SCREEN_TIMEOUT = 1000, + + //设置界面密码多次输错等待时间,单位:分钟 + PWD_ACCEPT_DELAY_TIME = 1, + //设置界面密码尝试次数,到达次数后需要等待一段时间 + RETRY_TIMES_MAX_PER_GROUP = 2, + //设置界面密码输入无操作自动返回时间,单位:秒 + NO_OPERATION_OVERTIME_RETURN = 10, + + //识别界面鼠标点击进入设置界面次数 + MOUSE_CLICK_TIMES_TO_SETTING = 2, + + //长按时长进设置界面,需大于200ms,单位:毫秒 + TOUCH_TIME_TO_SETTING = 300, + + #define SPECIAL_PWD_1 "x" + + #endif + + //主风格颜色 + MAIN_STYLE_COLOR_RED = 255, + MAIN_STYLE_COLOR_GREEN = 255, + MAIN_STYLE_COLOR_BLUE = 255, + MAIN_STYLE_COLOR_TRAN = 255, + + //主界面背景颜色 + //主界面字体颜色 + + SUB_STYLE_COLOR_RED = 245, + SUB_STYLE_COLOR_GREEN = 243, + SUB_STYLE_COLOR_BLUE = 251, + SUB_STYLE_COLOR_TRAN = 255, + + DIALOG_SCREEN_BG_COLOR = 0xFFFFFF, //0x929292, + DIALOG_SCREEN_BG_TRAN = 200, + + //同一风格按键背景颜色 + //同一风格按键字体颜色 + + //弹窗背景颜色 + //弹窗字体颜色 + //弹窗确认按键背景颜色 + //弹窗确认按键字体颜色 + //弹窗取消按键背景颜色 + //弹窗取消按键字体颜色 + + //键盘背景颜色 + //键盘按键颜色 + //键盘字体颜色 + + //人脸库管理每页显示人数 + LOCAL_FACE_QUANTITY_EACH_PAGE = 20, + + //设置界面item条目高度 + SETTING_PAGE_ITEM_HEIGHT = 41, + //设置界面到边框距离 + SETTING_PAGE_WIDGET_TO_FRAME = 30, + + //识别界面鼠标点击进入设置界面两次点击间最长间隔,单位:毫秒 + MOUSE_CLICK_INTERVAL_MAX = 1000, + }UiConfig_E; + + ~UiConfig(); + static UiConfig* GetInstance(); + void setUiConfig(const ScreenSize_E config); + void setUiFaceFrameSize(const FaceFrameSize_E config); + + int getUiWidth() const; + int getUiHeight() const; + const QString& getWelcome() const; + #if 0 + bool is7inch() const; + bool is8inch() const; + bool is5inch() const; + #endif + bool is8inchA038HaimanFaceFrame() const; + bool is8inchA038JinggongFaceFrame() const; + + int getScreenConfigIndex() const; + int getGlobalFontSize() const; + int setLanguageType(const int); + int getLanguageType() const; + + int getQRCodeAreaCoordinateX() const; + int getQRCodeAreaCoordinateY() const; + int getQRCodeAreaWidth() const; + int getQRCodeAreaHeight() const; + + #ifdef CUSTOM_QRCODE_AREA //自定义扫描框 + void setQRCodeAreaCoordinateX(const int); + void setQRCodeAreaCoordinateY(const int); + #endif + + void setHardwareTesting(bool sw); + bool getHardwareTesting() const; + + void showFaceFrameByTempExist(bool set); + bool isFaceFrameShowByTempExist() const; + + void setTpAvailable(bool available); + bool isTpAvailable() const; + + void setfuncNotSupport(Func_E func); + bool isFuncNotSupport(Func_E func) const; + + void setRecoUiStyle(int style); + bool isRecoUiStyleClassical() const; + bool isRecoUiStyleStandard() const; + bool isRecoUiStyleColor() const; + bool isRecoUiStyleAd() const; + bool isRecoUiStyleScene() const; + +#if 0 + void setRecoUiFontSizeScale(int sizeType); + float recoUiFontSizeScale() const; +#endif + + void setRecoUiFontSize(unsigned index, int size); + int recoUiFontSize(unsigned index) const; + + bool isRkDevice() const; + int setRecoUITextCfg(RecoUiTextCfg::enTextType type, RecoUiTextCfg::enDisMode mode, const char* cusText, RecoUiTextCfg::enFontSize fontSize); + float recoUiTextCfgFontSize(RecoUiTextCfg::enTextType type); + + void setDefaultScreensaver(int index); + int defaultScreensaver() const; + + void setDevTestStatus(bool test); + bool isDevTesting() const; + + void setFastCfgStatus(bool cfg); + bool isFastCfging() const; + +private: + static UiConfig* m_instance; + + ScreenSize_E m_screenSize; + int m_screenWidth; + int m_screenHeight; + int m_languageType; + + FaceFrameSize_E m_faceFrameSize = FaceFrameSize_8inchJinggong_B020; + bool m_bShowFaceFrame = false; + bool m_bTpAvailable = true; + unsigned long long m_ullfuncNotSupp = 0; + + #ifdef CUSTOM_QRCODE_AREA //自定义扫描框 + int m_QRCodeAreaX; + int m_QRCodeAreaY; + #endif + + bool m_bIsHardwareTesting = false; //do not enter setting if testing touch screen + int m_recoUiFontSizeType = 0; + int m_recoUiTunningFontSize[RecoUiTextCfg::TextCfgMax]; + int m_recoUiStyle = 0; + + int m_defaultScreensaver = 0; + + bool m_isDevTesting = false; + bool m_isFastCfging = false; + + UiConfig(); + +}; + +#endif // UICONFIG_H diff --git a/Linguist/mainUi/debug.h b/Linguist/mainUi/debug.h new file mode 100644 index 0000000..31d0db2 --- /dev/null +++ b/Linguist/mainUi/debug.h @@ -0,0 +1,24 @@ +#ifndef DEBUG_H +#define DEBUG_H + + + + +//#define x86 + +//#define DEBUG_MODE + + + +#ifdef x86 + +#define GATE_FACE_PRJ + +#define LANGUAGE_TYPE 2 //繁体:1 英文:2 +#define LANGUAGE_DIR_PATH "Z:\\a038\\source\\GateFaceHisi\\View\\build-qt-a038-Desktop_Qt_5_12_3_MinGW_64_bit-Debug\\debug" + +#endif + + + +#endif // DEBUG_H diff --git a/Linguist/mainUi/mainUi.cpp b/Linguist/mainUi/mainUi.cpp new file mode 100644 index 0000000..0dd5c58 --- /dev/null +++ b/Linguist/mainUi/mainUi.cpp @@ -0,0 +1,826 @@ +#include "mainUi.h" +#include +#include +#include +#include +#include "UiTools.h" +#include "UiConfig.h" +#include + + +SplashScreenWithMsg::SplashScreenWithMsg(const int languageType) +{ + m_label_msg = new QLabel(this); + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,QColor(0x0e, 0xbc, 0xf8, 0xFF)); + + QFont ft; + //need to adjust font size + m_label_msg->setText(tr("人脸识别终端")); + int fontSize = 10; + if(UiConfig::SUPPORT_LANGUAGE_QUANTITY > languageType) + { + fontSize = UiConfig::DEV_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][languageType]; + } + ft.setPointSize(fontSize); + m_label_msg->setFont(ft); + m_label_msg->setPalette(palette); + m_label_msg->setAlignment(Qt::AlignCenter); + m_label_msg->setFixedWidth(UiConfig::GetInstance()->getUiWidth()); + m_label_msg->move(0, UiConfig::GetInstance()->getUiHeight() / 4); + + setPixmap(QPixmap(UiConfig::GetInstance()->getWelcome())); + show(); +} + +SplashScreenWithMsg::~SplashScreenWithMsg() +{ + +} + +mainUi::mainUi(const int languageType, bool needSetupWizard) + : m_reTryTimes(0), pwdAcceptDelay(false), m_isPasswordDialogShowed(false), m_settingUi(nullptr) +{ + qDebug() << "mainUi()"; + +#if 0 + setCursor(QCursor(Qt::BlankCursor)); +#endif + + UiConfig::GetInstance()->setLanguageType(languageType); + setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + + //this->setWindowOpacity(1); + //this->setAttribute(Qt::WA_TranslucentBackground); + QPalette pal = palette(); + pal.setColor(QPalette::Background, Qt::transparent); + setPalette(pal); + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::black); + + m_stackWidget_mainUi = new QStackedWidget(this); + //m_splash_startPage = new SplashScreenWithMsg(languageType); + m_splash_startPage = nullptr; + + //计算启动时间 + m_time_startupCost = new QTime(); + m_time_startupCost->start(); + + if(needSetupWizard){ + m_setupUi = new SetupUi(this); + connect(m_setupUi, SIGNAL(signalSetupDone()), this, SLOT(slotSetupDone())); + m_stackWidget_mainUi->addWidget(m_setupUi); + } + + m_recoUi = new recoUi(this); + m_stackWidget_mainUi->addWidget(m_recoUi); + + connect(m_recoUi, SIGNAL(signalShowSettingPage()), this, SLOT(slotShowSettingPage())); + connect(this, SIGNAL(signalShowRecoUiPage(int)), m_recoUi, SLOT(slotShowRecoUiPage(int))); + connect(this, SIGNAL(signalNoSuccessPage(int)), m_recoUi, SLOT(slotNoSuccessPage(int))); + connect(this, SIGNAL(signalSuccessPage(const int, const QString&)), \ + m_recoUi, SIGNAL(signalSuccessPage(const int, const QString&))); + connect(this, SIGNAL(signalUpdatePlatformConnectionStatus(const int)), m_recoUi, SLOT(slotUpdatePlatformConnectionStatus(const int))); + + connect(this, SIGNAL(signalShowUserCandidate(const QString&, const QStringList&)), this, + SLOT(slotShowUserCandidate(const QString&, const QStringList&))); + connect(this, SIGNAL(signalRecoUiswitchToType(int)), m_recoUi, SLOT(slotRecoUiswitchToType(int))); + connect(this, SIGNAL(signalCreateAndShowDevTestPage(const QString&)), this, SLOT(slotCreateAndShowDevTestPage(const QString&))); + connect(this, SIGNAL(signalDelayResetRecoUi()), this, SLOT(slotDelayResetRecoUi())); + connect(this, SIGNAL(signalShowAntiDismantleDetect(bool)), this, SLOT(slotShowAntiDismantleDetect(bool))); + connect(this, SIGNAL(signalShowCallDialPage()), m_recoUi, SLOT(slotShowCallDialPage())); + connect(this, SIGNAL(signalSetCallConsoleStatus(int, const QString&)), m_recoUi, SLOT(slotSetCallConsoleStatus(int, const QString&))); + connect(this, SIGNAL(signalShowUserItemChoose(const QStringList&)), this, SLOT(slotShowUserItemChoose(const QStringList&))); +#if 0 + m_settingUi = new settingUi(this); //nullptr; // + m_stackWidget_mainUi->addWidget(m_settingUi); + connect(m_settingUi, SIGNAL(signalShowRecoPage()), this, SLOT(slotShowRecoPage())); + connect(m_settingUi, SIGNAL(signalChangeRecoUiMode()), m_recoUi, SIGNAL(signalChangeRecoUiMode())); + connect(m_settingUi, SIGNAL(signalUpdateRecoUiIpDisplay(bool)), m_recoUi, SIGNAL(signalUpdateRecoUiIpDisplay(bool))); +#endif + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addWidget(m_stackWidget_mainUi); + vbLayout->setMargin(0); + setLayout(vbLayout); + + m_timer = new QTimer(this); + connect( m_timer, SIGNAL(timeout()), this, SLOT(slotPwdAcceptDelayUpdate()) ); + + //int startPageShowTime = (START_SCREEN_TIMEOUT - m_time_startupCost->elapsed() > 0 ? START_SCREEN_TIMEOUT - m_time_startupCost->elapsed() : 1); + //QTimer::singleShot(startPageShowTime, this, SLOT(slotCloseStartPage()) ); + slotCloseStartPage(); +} + +mainUi::~mainUi() +{ + qDebug() << "~mainUi()"; + if(nullptr != m_splash_startPage) + { + delete m_splash_startPage; + m_splash_startPage = nullptr; + } +} + +void mainUi::createSettingUi() +{ + if(m_settingUi){ + return; + } + qDebug() << "create setting Ui"; + m_settingUi = new settingUi(this); + m_stackWidget_mainUi->addWidget(m_settingUi); + connect(m_settingUi, SIGNAL(signalShowRecoPage()), this, SLOT(slotShowRecoPage())); + connect(m_settingUi, SIGNAL(signalChangeRecoUiMode()), m_recoUi, SIGNAL(signalChangeRecoUiMode())); + connect(m_settingUi, SIGNAL(signalUpdateRecoUiIpDisplay(bool)), m_recoUi, SIGNAL(signalUpdateRecoUiIpDisplay(bool))); + connect(this, SIGNAL(signalShowDevTestPage()), m_settingUi, SLOT(slotShowDevTestPage())); + qDebug() << "setting ui setBackstageUiinterface before ..."; + m_settingUi->setBackstageUiinterface(m_backstageIf); + qDebug() << "setting ui setBackstageUiinterface after ..."; +} + +void mainUi::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + if(m_setupUi){ + m_setupUi->setBackstageUiinterface(interface); + } + m_recoUi->setBackstageUiinterface(interface); + +#if 0 + m_settingUi->setBackstageUiinterface(interface); +#endif + + updateAllOption(); +} + +void mainUi::slotCloseStartPage() +{ + if(m_splash_startPage) + { + m_splash_startPage->finish(this); + delete m_splash_startPage; + m_splash_startPage = nullptr; + } + + if(m_time_startupCost) + { + delete m_time_startupCost; + m_time_startupCost = nullptr; + } + + show(); + QTimer::singleShot(100, this, SLOT(slotShowRecoPage())); +} + +void mainUi::slotShowRecoPage() +{ + m_stackWidget_mainUi->setCurrentIndex(MAIN_UI_PAGE_RECOGNIZE); + + m_recoUi->updateVideoWind(); + + if(!m_setupUi){ + qDebug() << "m_backstageIf->startIdentyState()"; + m_backstageIf->startIdentyState(); + } + keyboard::preLoad(); +} + +int mainUi::settingPageAuthentication(const QString& dialogTitle, const QString& okBtn, const QString& cancelBtn, bool overtimeClose) +{ + if(pwdAcceptDelay){ + InfoDialog(tr("由于之前多次密码验证错误,请稍后再重试!"), m_settingUi, tr("知道了"), 30000).exec(); + return -1; + } + + if(m_isPasswordDialogShowed){ + qDebug() << "isPasswordDialogShowed"; + return -1; + } + m_isPasswordDialogShowed = true; + + m_backstageIf->stopIdentyState(); + + QString userInput; + QString devId(tr("设备编码:")); + char buf[64] = {'\0'}; + if(0 == m_backstageIf->getDeviceId(buf, sizeof(buf))){ + devId += buf; + } + + do{ + PasswordDialog pwd_check(dialogTitle, tr("admin"), overtimeClose ? UiConfig::NO_OPERATION_OVERTIME_RETURN * 1000 : 0, + m_settingUi, userInput, devId, okBtn, cancelBtn); + //connect(&pwd_check, SIGNAL(signalRestoreFactory()), m_settingUi, SLOT(slotRestoreFactory())); + int ret = pwd_check.exec(); + if(QDialog::Rejected == ret){ + slotShowRecoPage(); + m_isPasswordDialogShowed = false; + return -1; + } + + userInput = pwd_check.getPwd(); +#if 0 + if(0 == userInput.compare(SPECIAL_PWD_1)) + { + emit signalShowLogoChooseDialogBySpecialPwd(); + emit signalResetRecoUi(); + reOpen = false; + } + else{ +#endif + if(0 == m_backstageIf->verifyFactorySettingPwd(userInput.toStdString().c_str())){ + emit signalResetRecoUi(); + m_isPasswordDialogShowed = false; + return 0; + }else { + InfoDialog(tr("密码错误,请重试"), m_settingUi).exec(); + if(overtimeClose && ++m_reTryTimes >= RETRY_TIMES_MAX_PER_GROUP){ + m_reTryTimes = 0; + pwdAcceptDelay = true; + m_timer->start(PWD_ACCEPT_DELAY_TIME); + slotShowRecoPage(); + m_isPasswordDialogShowed = false; + return -1; + } + } + + }while(true); + return -1; +} + +void mainUi::slotShowSettingPage() +{ + if(m_backstageIf->isDevSettingDisable()){ + #if 0 + m_backstageIf->stopIdentyState(); + InfoDialog(tr("设备设置页面已被禁用!"), m_settingUi, tr("知道了"), 30000).exec(); + m_backstageIf->startIdentyState(); + #endif + return; + } + + if(0 == settingPageAuthentication(tr("请输入密码"), tr("确定"), tr("取消"), true)){ + //m_settingUi->reset(); + m_stackWidget_mainUi->setCurrentIndex(MAIN_UI_PAGE_SETTING); + } +} + +void mainUi::slotPwdAcceptDelayUpdate() +{ + pwdAcceptDelay = false; +} + +void mainUi::slotUpdateIp() +{ + if(m_settingUi){ + m_settingUi->update_IpBar(); + } + + if(m_recoUi){ + m_recoUi->update_IpBar(); + } +} + +//设置接口后刷新页面 +void mainUi::updateAllOption() +{ + +} + + +//ui接口 +long long mainUi::getUiVersion() +{ + return UiConfig::UI_VERSION; +} + +//switch from standby to reco +void mainUi::showRecoMsgReco() +{ + //qDebug()<<"void mainUi::showRecoMsgReco()"; + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_IN); +} + +void mainUi::showRecoMsgRetry() +{ + //qDebug()<<"void mainUi::showRecoMsgRetry()"; + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_CHECK); +} + +void mainUi::showRecoMsgFail(int failType) +{ + //qDebug()<<"void mainUi::showRecoMsgFail()" << failType; + GLOBAL_RECO_STATE state = (GLOBAL_RECO_STATE)(GLOBAL_RECO_END_NO + failType); + if(state >= GLOBAL_RECO_END_NO && failType <= GLOBAL_RECO_SHOW_QRCODE) + { + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(state); + } +} + +void mainUi::notifyFaceInfo(const bool faceAvailable) +{ + //qDebug()<<"void mainUi::notifyFaceInfo():" << faceAvailable; + if(!faceAvailable){ //不绘制扫描线,只处理人脸离开复位情况 + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalDrawScanner(GLOBAL_RECO_IN_SCANNER, faceAvailable); + } +} + +void mainUi::showRecoSuccess(const char* name) +{ + //qDebug()<<"void mainUi::showRecoSuccess()"; + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + if (name){ + emit signalSuccessPage(GLOBAL_RECO_END_OK, QString(name)); + } +} + +void mainUi::showRecoMsgIDFail() +{ + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_ID_FAILED); +} + +void mainUi::showUnauthorizedPage() +{ + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_BEGIN_AUTH); +} + +void mainUi::showScreenSaverPage() +{ + emit signalShowRecoUiPage(RECO_UI_PAGE_SCREENSAVER); +} + +int mainUi::showFaceImg(const unsigned char *imgData, const int imgLen) +{ + //qDebug()<<"void mainUi::showFaceImg()"; + if(imgData == nullptr) + return -1; + emit signalShowAddFaceImg(imgData, imgLen); + return 0; +} + +void mainUi::updatePlatformConnectionStatus(const PLATFORM_CONNECTION_STATUS_E status) +{ + emit signalUpdatePlatformConnectionStatus(static_cast(status)); +} + +void mainUi::showRecoMsgMoveForehead() +{ + //qDebug() << "showRecoMsgMoveForehead()"; + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_TEMP_REQ); +} + +void mainUi::showRecoMsgForeheadNormalTemp(const float temp, const bool isC) //显示正常温度 +{ + //qDebug() << "showRecoMsg Normal Temp"; + emit signalShowForeheadNormalTemp(temp, isC); +} + +void mainUi::showRecoMsgForeheadAbnormalTemp(const float temp, const bool isHigh, const bool isC) //显示异常温度 +{ + //qDebug() << "showRecoMsg Abnormal Temp:" << isHigh; + emit signalShowForeheadAbnormalTemp(temp, isHigh, isC); +} + +void mainUi::showRecoMsgReadTempFailed() //体温检测失败 +{ + //qDebug() << "showRecoMsgRead Temp Failed"; + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_READ_TEMP_FAILED); +} + +void mainUi::showRecoMsgNoMaskWarn() //请戴口罩 +{ + //qDebug() << "showRecoMsgNoMaskWarn"; + //emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_MASK_REQ); +} + +void mainUi::showRecoMsgMaskOk() +{ + //qDebug() << "showRecoMsgMaskOk"; + //emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_MASK_OK); +} + +void mainUi::showRecoMsgMaskWarn() +{ + emit signalNoSuccessPage(GLOBAL_RECO_TAKE_OFF_MASK); +} + +void mainUi::showRecoMsgNoEntry(const bool noEntry) +{ + //qDebug() << "showRecoMsgNoEntry"; + //emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + if(noEntry) + emit signalNoSuccessPage(GLOBAL_RECO_NO_ENTRY); + else { + emit signalNoSuccessPage(GLOBAL_RECO_CLEAR_NO_ENTRY); + } + //测试QRcode + /* + static int i = 0; + emit signalShowQRCodeMsg(i); + i++; + if(i > 5) i = 0; + */ +} + +void mainUi::turnOffScanLine() +{ + //qDebug() << "turnOffScanLine"; + //emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_CLOSE_SCANLINE); +} + +void mainUi::clearLocalFacePage() +{ + emit signalClearLocalFacePage(); +} + +void mainUi::updateLogo(const enLogo option) +{ + emit signalUpdateLogo(static_cast(option));//切换ui时logo没有显示,没有信号更新--------------------------------------------------------------------------------------------------------------- +} + +void mainUi::showQRCodeMsg(const QRCode_Msg_E msg) +{ + emit signalShowQRCodeMsg(static_cast(msg)); +} + +void mainUi::showQRCodeReco() +{ + //qDebug() << "showQRCodeReco"; + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_SHOW_QRCODE_RECO); +} + +void mainUi::showFaceReco() +{ + //qDebug() << "showFaceReco"; + emit signalShowRecoUiPage(RECO_UI_PAGE_RECOGNIZE); + emit signalNoSuccessPage(GLOBAL_RECO_SHOW_FACE_RECO); +} + +void mainUi::updateRecoUiIp() +{ + m_recoUi->update_IpBar(); +} + +void mainUi::showFeatureUpdateProgress(const unsigned current, const unsigned all) +{ + emit signalShowFeatureUpdateProgress(current, all); +} + +void mainUi::closeFeatureUpdateProgress() +{ + emit signalCloseFeatureUpdateProgress(); +} + +void mainUi::showRecoUiMask(int maskType) +{ + int type = 0; + if(0 == maskType){ //normal + //if(UiConfig::GetInstance()->isFaceFrameShowByTempExist()){ + type = 1; // bg + //} + }else if(1 == maskType){ //TempCalibra + type = 2; //TempCalibra + }else if(2 == maskType){ //day mode + //if(UiConfig::GetInstance()->isFaceFrameShowByTempExist()){ + type = 1; //bg + //} + }else if(3 == maskType){ //night mode + type = 3; //night mode + } + emit signalShowRecoUiMask(type); +} + +void mainUi::showNotiMsg(const char *msg, int color) +{ + //qDebug()<<"void mainUi::showRecoSuccess()"; + if (msg) + { + emit signalNotiMsg(GLOBAL_RECO_SHOW_NOTI_MSG, QString(msg), color); + } +} + +void mainUi::updateScreenSaver() +{ + m_stackWidget_mainUi->setCurrentIndex(MAIN_UI_PAGE_RECOGNIZE); + QCoreApplication::processEvents(); + emit signalUpdateScreenSaver(); +} + +int mainUi::grabScreen(const QString& picName, int rotate) +{ + if(UiConfig::GetInstance()->isRkDevice()){ + QMatrix matrix; + matrix.rotate(rotate); + QPixmap pixmap = grab(QRect(0, 0, UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight())); + pixmap.transformed(matrix, Qt::SmoothTransformation).save(picName, "jpg"); + } + else{ + GrabFullScreen(picName, rotate); //A038选择角度问题 + } + return 0; +} + +int mainUi::switchToRecoUi() +{ + emit signalShowRecoUiPage(RECO_UI_PAGE_WORK_MODE); + return 0; +} + +int mainUi::showCenterMsg(const char* msg, int type) +{ + if(msg){ + emit signalCenterMsg(GLOBAL_RECO_SHOW_CENTER_MSG + type, QString(msg)); + } + + if(strlen(msg)){ + emit signalDelayResetRecoUi(); + +} + QCoreApplication::processEvents(); + return 0; +} + +void mainUi::showDrawPage() +{ + emit signalShowRecoUiPage(RECO_UI_PAGE_DRAW); +} + + +void mainUi::showCursorSwitch(bool sw) +{ + QApplication::setOverrideCursor(sw ? Qt::ArrowCursor : Qt::BlankCursor); +} + +int mainUi::showUserPwd(const char* name) +{ + emit signalShowUserPwd(QString(name)); + return 0; +} + +void mainUi::setPwdButton(bool visible) +{ + emit signalSetUserPwdButton(visible); +} + +void mainUi::showPwdUiPersonName(const char* name) +{ + emit signalShowPwdUiPersonName(name); +} + +void mainUi::showUserPwdError(int type, int color) +{ + emit signalShowUserPwdError(type, color); +} + +void mainUi::showUserCandidate(const char* title, const char** opns, int opnsNum) +{ + if(nullptr == title || nullptr == opns || opnsNum <= 0){ + return; + } + QStringList options; + for(int i=0; ipauseDataFlow(); + + StyleItemChooseDialog dlg(title, opns, m_backstageIf); + int ret = dlg.exec(); + if(QDialog::Accepted == ret){ + m_backstageIf->resetDecisionCenterTimer(); + const int userChoose = dlg.getChoosedIndex(); + //qDebug() << "user choose:" << userChoose; + m_backstageIf->candidateChoosedInPopupWindow(userChoose); + } + else if(QDialog::Rejected == ret){ + m_backstageIf->candidateChoosedInPopupWindow(-1); + } + + //m_backstageIf->resumeDataFlow(); +} + +void mainUi::slotShowSettingUi() +{ + m_stackWidget_mainUi->setCurrentIndex(MAIN_UI_PAGE_SETTING); +} + +void mainUi::slotSetupDone() +{ + m_stackWidget_mainUi->removeWidget(m_setupUi); + delete m_setupUi; + m_setupUi = nullptr; + m_backstageIf->startIdentyState(); +} + +void mainUi::slotScreenTouch() +{ + createSettingUi(); +} + +void mainUi::slotCreateAndShowDevTestPage(const QString& devCfgMsg) +{ + MsgDialog msgdlg(tr("正在加载测试页面,请稍候...")); + msgdlg.show(); + QCoreApplication::processEvents(); + createSettingUi(); + emit signalShowDevTestPage(); + emit signalDevTestConfigInfo(devCfgMsg); +} + + +void mainUi::slotDelayResetRecoUi() +{ + QTimer::singleShot(200, this, [this]{notifyFaceInfo(false);}); +} + +void mainUi::slotShowAntiDismantleDetect(bool upload) +{ + qDebug() << "slotShowAntiDismantleDetect"; + m_backstageIf->setAntiDemolitionAvail(true, upload); + if(0 == settingPageAuthentication(tr("检测到强拆设备"), tr("解除锁定"), "", false)){ + m_backstageIf->startIdentyState(); + m_backstageIf->setAntiDemolitionAvail(false, false); + } +} + +void mainUi::recoUiswitchToType(int type) +{ + emit signalRecoUiswitchToType(type); +} + +void mainUi::qrcodeFastCfgResult(bool isSuccessed) +{ + emit signalQrcodeFastCfgResult(isSuccessed); +} + +void mainUi::icCardResult(const char *icCardNum) +{ + emit signalIcCardResult(QString(icCardNum)); +} + +bool mainUi::isInSettingUi() +{ + return (m_stackWidget_mainUi->currentIndex() == MAIN_UI_PAGE_SETTING); +} + +void mainUi::updateAdScreen() +{ + emit signalUpdateAdWidget(); +} + +void mainUi::showHealthMsg(int type, float temp, const char * msg, bool pass, + const unsigned char* jpgDate, int jpgLen, const char* tripCity, const char* failReason, int bgColor, int displayTime) +{ + emit signalShowHealthMsg(type, temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor, displayTime); + if(type > 0){ + emit signalDelayResetRecoUi(); + } + QCoreApplication::processEvents(); +} + +void mainUi::showHealthCodeAuthStatus(int status) +{ + emit signalShowHealthCodeAuthStatus(status); +} + +void mainUi::showAntiDismantleDetect(bool upload) +{ + if(m_backstageIf->getAntiDemolitionSw()){ + emit signalShowAntiDismantleDetect(upload); + } +} + +void mainUi::showSceneResult(int result, const char* resultText, const char* businessInfo, int displayTime) +{ + if(!UiConfig::GetInstance()->isRecoUiStyleScene()){ + return; + } + emit signalShowSceneResult(result, resultText, businessInfo, displayTime); + QCoreApplication::processEvents(); +} + +void mainUi::updatePersonNumAccessed(int personAccess, int personAll) +{ + emit signalUpdatePersonNumAccessed(personAccess, personAll); +} + +bool mainUi::isScenePassing() +{ + return m_recoUi->isScenePassing(); +} + +void mainUi::setSceneUiPersonCountType(int type) +{ + emit signalSetSceneUiPersonCountType(type); +} + +void mainUi::updateSceneUiPersonCount(int count) +{ + emit signalUpdateSceneUiPersonCount(count); +} + +void mainUi::showCallDialPage() +{ + emit signalShowCallDialPage(); +} + +void mainUi::setCallConsoleStatus(int status, const char* tip) +{ + emit signalSetCallConsoleStatus(status, tip); +} + +void mainUi::setDndMode(bool enabled, const std::chrono::system_clock::time_point &time) { + m_recoUi->setDndMode(enabled,time); +} + +void mainUi::showRecoUiDevIdAndVer(bool show) +{ + emit signalShowRecoUiDevIdAndVer(show); +} + +void mainUi::showUserItemChoose(const std::vector& items) +{ + QStringList options; + for(const auto& i : items){ + options << QString(i.c_str()); + } + emit signalShowUserItemChoose(options); +} + +void mainUi::slotShowUserItemChoose(const QStringList& opns) +{ + m_backstageIf->stopIdentyState(); + + StyleItemChooseDialog dlg("请选择", opns, m_backstageIf); + int ret = dlg.exec(); + if(QDialog::Accepted == ret){ + m_backstageIf->resetDecisionCenterTimer(); + const int userChoose = dlg.getChoosedIndex(); + //qDebug() << "user choose:" << userChoose; + m_backstageIf->startIdentyState(); + m_backstageIf->userItemChoose(userChoose); + }else if(QDialog::Rejected == ret){ + m_backstageIf->startIdentyState(); + m_backstageIf->userItemChoose(-1); + } +} + + diff --git a/Linguist/mainUi/mainUi.h b/Linguist/mainUi/mainUi.h new file mode 100644 index 0000000..b19da0e --- /dev/null +++ b/Linguist/mainUi/mainUi.h @@ -0,0 +1,255 @@ +#ifndef MAINUI_H +#define MAINUI_H + +#include +#include +#include +#include +#include + +#include "UiInterfaceForBackstage.h" +#include "settingUi.h" +#include "recoUi.h" +#include "BackstageInterfaceForUi.h" +#include "UiCommon.h" +#include "UiConfig.h" +#include "SetupUi.h" + + + +class SplashScreenWithMsg : public QSplashScreen +{ + Q_OBJECT //多语言 + +public: + explicit SplashScreenWithMsg(const int languageType); + ~SplashScreenWithMsg(); + +private: + QLabel* m_label_msg; + +}; + +class mainUi : public UiInterfaceForBackstage +{ + Q_OBJECT +public: + static const int START_SCREEN_TIMEOUT = UiConfig::START_SCREEN_TIMEOUT; + static const int PWD_ACCEPT_DELAY_TIME = UiConfig::PWD_ACCEPT_DELAY_TIME * 60 * 1000; //min to ms + static const int RETRY_TIMES_MAX_PER_GROUP = UiConfig::RETRY_TIMES_MAX_PER_GROUP; + + explicit mainUi(const int languageType, bool needSetupWizard); + ~mainUi(); + + void createSettingUi(); + virtual void setBackstageUiinterface(BackstageInterfaceForUi* interface); + + //UI提供给后台的接口 + virtual long long getUiVersion(); + virtual void showUnauthorizedPage(); + virtual void showScreenSaverPage(); + + virtual void showRecoMsgReco(); + virtual void showRecoMsgRetry(); + virtual void showRecoMsgFail(int failType); + virtual void notifyFaceInfo(const bool faceAvailable); + virtual void showRecoSuccess(const char* name); + virtual void showRecoMsgIDFail(); + + virtual int showFaceImg(const unsigned char *imgData, const int imgLen); + virtual void updatePlatformConnectionStatus(const PLATFORM_CONNECTION_STATUS_E); + + virtual void showRecoMsgMoveForehead(); //移动到额头区 + virtual void showRecoMsgForeheadNormalTemp(const float temp, const bool isC); //显示正常温度 + virtual void showRecoMsgForeheadAbnormalTemp(const float temp, const bool isHigh, const bool isC); //显示异常温度 + + virtual void showRecoMsgReadTempFailed(); //体温检测失败 + virtual void showRecoMsgNoMaskWarn(); //请戴口罩 + virtual void showRecoMsgMaskOk(); //口罩检测通过 + virtual void showRecoMsgMaskWarn(); + + virtual void showRecoMsgNoEntry(const bool); //显示禁止通行 + + virtual void turnOffScanLine(); + virtual void clearLocalFacePage(); + virtual void updateLogo(const enLogo); + virtual void showQRCodeMsg(const QRCode_Msg_E); + virtual void showQRCodeReco(); + virtual void showFaceReco(); + virtual void updateRecoUiIp(); + + virtual void showFeatureUpdateProgress(const unsigned current, const unsigned all); + virtual void closeFeatureUpdateProgress(); + + virtual void showRecoUiMask(int maskType); + virtual void showNotiMsg(const char *msg, int color); + + virtual void updateScreenSaver(); + virtual int grabScreen(const QString& picName, int rotate = 0); + virtual int switchToRecoUi(); + + virtual int showCenterMsg(const char* msg, int type); + virtual int showUserPwd(const char* name); + + void showDrawPage(); + + void showCursorSwitch(bool sw); + void setPwdButton(bool visible); + void showPwdUiPersonName(const char* name); + void showUserPwdError(int type, int color); + void showUserCandidate(const char* title, const char** opns, int opnsNum); + void showDevTestPage(const char* devCfgMsg); + void setDevTestMesAddrAndProdNoText(const char* text); + void setDevTestPcbSeqText(const char* text); + void setDevTestConfigInfo(const char* text); + + void showOrHideFaceFrame(bool show); + void showPassResult(bool pass); + + void showRecoUiColorFaceSnapshot(const char* path); + void showRecoUiColorFaceSnapshot(const unsigned char* jpgDate, int len); + void recoUiswitchToType(int type); + void qrcodeFastCfgResult(bool isSuccessed); + + void icCardResult(const char* icCardNum); + bool isInSettingUi(); + void updateAdScreen(); + void showHealthMsg(int type, float temp, const char * msg, bool pass, const unsigned char* jpgDate, + int jpgLen, const char* tripCity, const char* failReason, int bgColor, int displayTime); + void showHealthCodeAuthStatus(int status); + void showAntiDismantleDetect(bool upload); + void showSceneResult(int result, const char* resultText, const char* businessInfo, int displayTime); + void updatePersonNumAccessed(int personAccess, int personAll); + bool isScenePassing(); + void setSceneUiPersonCountType(int type); + void updateSceneUiPersonCount(int count); + void showCallDialPage(); + void setCallConsoleStatus(int status, const char* tip); + void setDndMode(bool enabled, const std::chrono::system_clock::time_point &time) final; + void showRecoUiDevIdAndVer(bool show); + void showUserItemChoose(const std::vector& items); + +signals: + void signalShowRecoUiPage(const int); + void signalShowRecoState(const int); + void signalNoSuccessPage(const int); + void signalSuccessPage(const int nPage, const QString& name); + void signalDrawScanner(const int nPage, const bool faceAvailable); + void signalShowAddFaceImg(const unsigned char* imgData, int len); + void signalUpdatePlatformConnectionStatus(const int); + + void signalInteraction(const INTERACION_OPTION& interaction, int nSelectRes); //后面去掉 + + void signalShowForeheadNormalTemp(const float temp, const bool isC); + void signalShowForeheadAbnormalTemp(const float temp, const bool isHigh, const bool isC); + + void signalClearLocalFacePage(); + + void signalShowLogoChooseDialogBySpecialPwd(); + void signalUpdateLogo(const int); + void signalShowQRCodeMsg(const int); + + void signalResetRecoUi(); //在识别界面进入设置界面时复位识别界面,否则可能导致扫描线定时器一直在被调用 + + void signalShowFeatureUpdateProgress(const unsigned current, const unsigned all); + void signalCloseFeatureUpdateProgress(); + + void signalShowRecoUiMask(int maskType); + + void signalNotiMsg(const int nPage, const QString& msg, int color); + + void signalUpdateScreenSaver(); + + void signalCenterMsg(const int nPage, const QString& msg); + + void signalShowUserPwd(const QString& name); + void signalShowUserPwdButton(); + void signalSetUserPwdButton(bool visible); + void signalShowPwdUiPersonName(const QString& name); + void signalShowUserPwdError(int type, int color); + + void signalShowUserCandidate(const QString& title, const QStringList& opns); + + void signalCreateAndShowDevTestPage(const QString& devCfgMsg); + void signalDevTestMesAddrAndProdNoText(const QString& text); + void signalDevTestPcbSeqText(const QString& text); + void signalDevTestConfigInfo(const QString& text); + + void signalShowOrHideFaceFrame(bool show); + void signalShowFinalResult(bool pass); + void signalShowDevTestPage(); + + void signalShowRecoUiColorFaceSnapshot(const QString& path); + void signalShowRecoUiColorFaceSnapshot(const unsigned char* jpgDate, int len); + void signalRecoUiswitchToType(int type); + void signalQrcodeFastCfgResult(bool isSuccessed); + + void signalIcCardResult(const QString& icCard); + void signalUpdateAdWidget(); + + void signalShowHealthMsg(int type, float temp, const QString& msg, bool pass, const unsigned char* jpgDate, + int jpgLen, const QString& tripCity, const QString& failReason, int bgColor, int displayTime); + void signalShowHealthCodeAuthStatus(int status); + void signalDelayResetRecoUi(); + void signalShowAntiDismantleDetect(bool); + void signalShowSceneResult(int result, const QString& resultText, const QString& businessInfo, int displayTime); + void signalUpdatePersonNumAccessed(int personAccess, int personAll); + void signalSetSceneUiPersonCountType(int type); + void signalUpdateSceneUiPersonCount(int count); + void signalShowCallDialPage(); + void signalSetCallConsoleStatus(int status, const QString& text); + void signalShowCallBtn(bool callButton, bool videoButton); + void signalShowRecoUiDevIdAndVer(bool); + void signalShowUserItemChoose(const QStringList& opns); + +public slots: + void slotCloseStartPage(); + void slotShowRecoPage(); + void slotShowSettingPage(); + void slotPwdAcceptDelayUpdate(); + + void slotUpdateIp(); //刷新识别界面的IP,设置界面没有IP显示了,后面去掉 + + void slotShowUserCandidate(const QString& title, const QStringList& opns); + void slotShowSettingUi(); + void slotSetupDone(); + void slotScreenTouch(); + void slotCreateAndShowDevTestPage(const QString& devCfgMsg); + void slotDelayResetRecoUi(); + void slotShowAntiDismantleDetect(bool); + void slotShowUserItemChoose(const QStringList& opns); + +private: + typedef enum + { + MAIN_UI_PAGE_RECOGNIZE, + MAIN_UI_PAGE_SETTING + }MAIN_UI_PAGE_E; + + QStackedWidget* m_stackWidget_mainUi; + + //QSplashScreen *m_splash_startPage; + SplashScreenWithMsg *m_splash_startPage; + QTime* m_time_startupCost; + + SetupUi* m_setupUi = nullptr; + settingUi* m_settingUi = nullptr;; + recoUi* m_recoUi; + + QTranslator *m_translatorEnglish; + + //密码多次输错处理 + QTimer *m_timer; + int m_reTryTimes; + bool pwdAcceptDelay; + + bool m_isPasswordDialogShowed; + + void updateAllOption(); + int settingPageAuthentication(const QString& dialogTitle, const QString& okBtn, const QString& cancelBtn, bool overtimeClose); + + //void getBackImgPath(QString& imgPath); + //void getSaverPath(QString &imgPath); +}; + +#endif // MAINUI_H diff --git a/Linguist/recoUi/recoUi.cpp b/Linguist/recoUi/recoUi.cpp new file mode 100644 index 0000000..35e126e --- /dev/null +++ b/Linguist/recoUi/recoUi.cpp @@ -0,0 +1,607 @@ +#include "recoUi.h" +#include +#include +#include +#include "UiTools.h" +#include "UiInterfaceForBackstage.h" +#include "mainUi.h" + +statusbarUi::statusbarUi(QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + qDebug() << "statusbarUi()"; + + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::white); + + m_label_ip = new QLabel(this); + //m_label_ip->setText("192.168.10.106"); + m_label_ip->setPalette(palette); + m_label_ip->installEventFilter(this); + + m_label_platform = new QLabel(this); + QPixmap pm(":/res/image/disconnect.png"); + pm = pm.scaled(20, 20, Qt::KeepAspectRatio); + m_label_platform->setPixmap(pm); + +// m_label_wifi = new QLabel(this); +// pm.load(":/res/image/Wifi.png"); +// pm = pm.scaled(20, 20, Qt::KeepAspectRatio); +// m_label_wifi->setPixmap(pm); + +// m_label_4g = new QLabel(this); +// pm.load(":/res/image/4G.png"); +// pm = pm.scaled(20, 20, Qt::KeepAspectRatio); +// m_label_4g->setPixmap(pm); + + m_label_time = new QLabel(this); +// m_label_time->setText("12:34"); + m_label_time->setPalette(palette); + qDebug()<<"recoUi _labelTime = "<installEventFilter(this); + + QHBoxLayout* hbLayout = new QHBoxLayout(); + hbLayout->addWidget(m_label_ip, 20, Qt::AlignLeft); + hbLayout->addWidget(m_label_platform, 1, Qt::AlignRight); +// hbLayout->addWidget(m_label_wifi, 1, Qt::AlignRight); +// hbLayout->addWidget(m_label_4g, 1, Qt::AlignRight); + hbLayout->addWidget(m_label_time, 1, Qt::AlignRight); + setLayout(hbLayout); +} + +statusbarUi:: ~statusbarUi() +{ + if(nullptr != _timerUpdate) + { + delete _timerUpdate; + } + + qDebug() << "~statusbarUi()"; +} + +void statusbarUi::updatePlatformConnectionStatus(const int status) +{ + QPixmap pm; + switch(status) + { + case UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_DISCONNECTED: + pm.load(":/res/image/disconnect.png"); + break; + case UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_CONNECTED: + pm.load(":/res/image/display.png"); + break; + case UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_LOGGED: + pm.load(":/res/image/display.png"); + break; + default: + break; + } + m_label_platform->setPixmap(pm.scaled(20, 20, Qt::KeepAspectRatio)); +} + +void statusbarUi::updateIpLabel(QString &ipStr) +{ + if(m_label_ip) + { + m_label_ip->setText(ipStr); + } +} + +//bool statusbarUi::eventFilter(QObject *watched, QEvent *event) +//{ +// if( ( m_label_ip == watched ) && (event->type() == QEvent::MouseButtonPress) ) +// { +// emit signalChangeRecoPage(); +// } +// if( ( m_label_time == watched ) && (event->type() == QEvent::MouseButtonPress) ) +// { +// emit signalTestChangePage(); +// } +//} + +recoUi::recoUi(QWidget *parent) : WidgetWithBackstageInterface(parent) +{ + qDebug() << "recoUi()"; + + m_stack_recoPage = new QStackedWidget(this); + // m_statusbar = new statusbarUi(this); + + if(UiConfig::GetInstance()->isRecoUiStyleColor()){ + m_recoPageColor = new recoUiRecognizeTypeColor(false, false, false, this); + m_stack_recoPage->addWidget(m_recoPageColor); + }else if (UiConfig::GetInstance()->isRecoUiStyleAd()){ + m_recoPageAd = new recoUiRecognizeTypeAd(false, false, false, this); + m_stack_recoPage->addWidget(m_recoPageAd); + } + #if 0 + else if(UiConfig::GetInstance()->isRecoUiStyleScene()){ + m_recoPageScene = new recoUiRecognizeScene(false, false, this); + m_stack_recoPage->addWidget(m_recoPageScene); + } + #endif + else { + m_recoPage = new recoUiRecognize(false, false, false, this); + m_stack_recoPage->addWidget(m_recoPage); + } + + m_ssPage = new recoUiScreensaver(0, this); + m_stack_recoPage->addWidget(m_ssPage); + + m_pwdPage = new recoUiPassword(this); + m_stack_recoPage->addWidget(m_pwdPage); + + m_healthMsgPage = new recoUiHealthCode(this); + m_stack_recoPage->addWidget(m_healthMsgPage); + + m_sceneResult = new recoUiSceneResult(this); + m_stack_recoPage->addWidget(m_sceneResult); + + m_callDialPage = new recoUiCallDial(this); + m_stack_recoPage->addWidget(m_callDialPage); + + m_callConsolePage = new recoUiCallConsole(this); + m_stack_recoPage->addWidget(m_callConsolePage); + + if(UiConfig::GetInstance()->isRkDevice()){ + DrawPage* draw = new DrawPage(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight(), this); + m_stack_recoPage->addWidget(draw); + } + + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimer())); + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addWidget(m_stack_recoPage, 90); + //vbLayout->addWidget(m_statusbar, 1); + vbLayout->setMargin(0); + vbLayout->setSpacing(0); + setLayout(vbLayout); + + connect(parent, SIGNAL(signalUpdateScreenSaver()), m_ssPage, SLOT(slotUpdateScreenSaver())); + connect(parent, SIGNAL(signalShowUserPwd(const QString&)), this, SLOT(slotShowPasswordPage(const QString&))); + connect(m_pwdPage, SIGNAL(signalShowRecognizePage()), this, SLOT(slotShowRecognizePage())); + connect(parent, SIGNAL(signalShowPwdUiPersonName(const QString&)), m_pwdPage, SLOT(slotShowPwdUiPersonName(const QString&))); + connect(parent, SIGNAL(signalShowUserPwdError(int, int)), m_pwdPage, SLOT(slotShowUserPwdError(int, int))); + connect(parent, SIGNAL(signalSetUserPwdButton(bool)), this, SLOT(slotSaveRecoUiPwdBtnStatus(bool))); + connect(parent, SIGNAL(signalShowRecoUiMask(int)), this, SLOT(slotSaveRecoUiNightModeStatus(int))); + connect(parent, SIGNAL(signalUpdateAdWidget()), this, SLOT(slotUpdateAdScreen())); + connect(parent, SIGNAL(signalShowHealthMsg(int, float, const QString&, bool, const unsigned char*, int, const QString&, const QString&, int, int)), + this, SLOT(slotShowHealthMsg(int, float, const QString&, bool, const unsigned char*, int, const QString&, const QString&, int, int))); + connect(parent, SIGNAL(signalShowSceneResult(int, const QString&, const QString&, int)), + this, SLOT(slotShowSceneResult(int, const QString&, const QString&, int))); + connect(parent, SIGNAL(signalUpdatePersonNumAccessed(int, int)), this, SLOT(slotUpdatePersonNumAccessed(int, int))); + connect(parent, SIGNAL(signalSetSceneUiPersonCountType(int)), this, SLOT(slotSetSceneUiPersonCountType(int))); + connect(parent, SIGNAL(signalUpdateSceneUiPersonCount(int)), this, SLOT(slotUpdateSceneUiPersonCount(int))); + connect(m_callDialPage, SIGNAL(signalShowRecognizePage()), this, SLOT(slotShowRecognizePage())); + connect(m_callConsolePage, SIGNAL(signalShowRecognizePage()), this, SLOT(slotShowRecognizePage())); + connect(m_callDialPage, SIGNAL(signalCallBtnPressed(const QString&)), this, SLOT(slotShowCallConsolePage(const QString&))); + connect(m_callConsolePage, SIGNAL(signalCallAgain()), m_callDialPage, SLOT(slotCall())); + + auto p = dynamic_cast(parent); + if (p != nullptr) { + connect(p, &mainUi::signalShowCallBtn, this, &recoUi::slotShowCallBtn); + } +} + +recoUi::~recoUi() +{ + qDebug() << "~recoUi()"; +} + +void recoUi::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + if(m_recoPage){ + m_recoPage->setBackstageUiinterface(m_backstageIf); + connectRecoPage(m_recoPage); + m_recoPage->setStyle(UiConfig::GetInstance()->isRecoUiStyleScene() ? 4 : 0); + }else if(m_recoPageColor){ + m_recoPageColor->setBackstageUiinterface(m_backstageIf); + connectRecoPage(m_recoPageColor); + }else if(m_recoPageAd){ + m_recoPageAd->setBackstageUiinterface(m_backstageIf); + connectRecoPage(m_recoPageAd); + QTimer::singleShot(1000, this, [this]{m_recoPageAd->setCamVideoWind();}); + } + if (m_sceneResult != nullptr && m_backstageIf != nullptr) { // 初始化检票人数 + m_sceneResult->setPersonCountType(m_backstageIf->getTicketModePeopleCountType()); + m_sceneResult->setTicketCheckCount(-1, m_backstageIf->getTicketCheckCountToday()); + } +#if 0 + else if(m_recoPageScene){ + connectRecoPage(m_recoPageScene); + m_recoPageScene->setBackstageUiinterface(m_backstageIf); + } + #endif + m_ssPage->setBackstageUiinterface(m_backstageIf); + m_pwdPage->setBackstageUiinterface(m_backstageIf); + m_healthMsgPage->setBackstageUiinterface(m_backstageIf); + m_callDialPage->setBackstageUiinterface(m_backstageIf); + m_callConsolePage->setBackstageUiinterface(m_backstageIf); + update_IpBar(); +} + +//statusbarUi *recoUi::getStatusInstance() +//{ +// return m_statusbar; +//} + +void recoUi::slotShowSettingPage() +{ + emit signalShowSettingPage(); +} + +void recoUi::slotShowRecoUiPage(const int nPage) +{ + int index = m_stack_recoPage->currentIndex(); + if(nPage == RECO_UI_PAGE_WORK_MODE){ + if(index == RECO_UI_PAGE_SCREENSAVER){ + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_RECOGNIZE); + } + return; + }else if(index == RECO_UI_PAGE_HEALTHCODE || index == RECO_UI_PAGE_SCENERESULT || index == RECO_UI_PAGE_CALL_DIAL || index == RECO_UI_PAGE_CALL_CONSOLE){ + return; + } + m_stack_recoPage->setCurrentIndex(nPage); +} + +void recoUi::slotUpdatePlatformConnectionStatus(int status) { + m_isPlatformConnected = (status == UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_LOGGED); + if (m_callDialPage != nullptr) { + m_callDialPage->setPlatformConnected(status == UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_LOGGED); + } +} + +void recoUi::slotShowPasswordPage(const QString& name) +{ + m_pwdPage->reset(name); + slotShowRecoUiPage(RECO_UI_PAGE_PASSWORD); +} + +void recoUi::slotShowRecognizePage() +{ + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_RECOGNIZE); + m_backstageIf->startIdentyState(); +} + +void recoUi::update_IpBar() +{ + if(nullptr == m_backstageIf) + { + return ; + } + +#if 0 + const int nSize = 128; + char buf[nSize] = ""; + m_backstageIf->getIP(buf, nSize); + QString ipStr = buf; + m_statusbar->updateIpLabel(ipStr); +#endif + if(m_backstageIf){ + emit signalUpdateRecoUiIpDisplay(m_backstageIf->getIpShowSw()); + } +} + +void recoUi::updateVideoWind() +{ + QWidget *curWidget = m_stack_recoPage->currentWidget(); + + if(curWidget == m_recoPage){ + m_recoPage->setCamVideoWind(); + }else if(curWidget == m_recoPageColor){ + m_recoPageColor->setCamVideoWind(); + }else if(curWidget == m_recoPageAd){ + m_recoPageAd->setCamVideoWind(); + } + #if 0 + else if(curWidget == m_recoPageScene){ + m_recoPageScene->setCamVideoWind(); + } + #endif +} + +bool recoUi::isScenePassing() +{ + return m_stack_recoPage->currentIndex() == RECO_UI_PAGE_SCENERESULT;//m_sceneResult->isPassing(); +} + + +void recoUi::connectRecoPage(const QObject* recoPage) +{ + connect(recoPage, SIGNAL(signalChangePage()), this, SLOT(slotShowSettingPage())); + + connect(this, SIGNAL(signalNoSuccessPage(const int)), recoPage, SLOT(slotsNoSuccessPage(const int))); + connect(this, SIGNAL(signalSuccessPage(const int, const QString&)), recoPage, SLOT(slotsSuccessPage(const int, const QString&))); + connect(parent()->parent(), SIGNAL(signalDrawScanner(const int, const bool)), recoPage, SLOT(slotsDrawScanner(const int, const bool))); + connect(parent()->parent(), SIGNAL(signalInteraction(const INTERACION_OPTION& , int )), + recoPage, SLOT(slotsInteractionChange(const INTERACION_OPTION& , int ))); + connect(parent()->parent(), SIGNAL(signalShowForeheadNormalTemp(const float, const bool)), recoPage, SLOT(slotShowNormalTemp(const float, const bool))); + connect(parent()->parent(), SIGNAL(signalShowForeheadAbnormalTemp(const float, const bool, const bool)), recoPage, SLOT(slotShowAbnormalTemp(const float, const bool, const bool))); + connect(parent()->parent(), SIGNAL(signalUpdateLogo(const int)), recoPage, SLOT(slotUpdateLogo(const int))); + connect(parent()->parent(), SIGNAL(signalUpdatePlatformConnectionStatus(const int)), recoPage, SLOT(slotUpdatePlatformConnectionStatus(const int))); + connect(parent()->parent(), SIGNAL(signalResetRecoUi()), recoPage, SLOT(slotsResetRecoUi())); + connect(parent()->parent(), SIGNAL(signalShowQRCodeMsg(int)), recoPage, SLOT(slotShowQRCodeMsg(int))); + connect(this, SIGNAL(signalChangeRecoUiMode()), recoPage, SLOT(slotChangeRecoUiMode())); + connect(this, SIGNAL(signalUpdateRecoUiIpDisplay(bool)), recoPage, SLOT(slotUpdateRecoUiIpDisplay(bool))); + connect(parent()->parent(), SIGNAL(signalShowFeatureUpdateProgress(const unsigned, const unsigned)), recoPage, SLOT(slotShowFeatureUpdateProgress(const unsigned, const unsigned))); + connect(parent()->parent(), SIGNAL(signalCloseFeatureUpdateProgress()), recoPage, SLOT(slotCloseFeatureUpdateProgress())); + connect(parent()->parent(), SIGNAL(signalShowRecoUiMask(int)), recoPage, SLOT(slotShowRecoUiMask(int))); + connect(parent()->parent(), SIGNAL(signalNotiMsg(const int, const QString&, int)), recoPage, SLOT(slotNotiMsg(const int, const QString&, int))); + connect(parent()->parent(), SIGNAL(signalCenterMsg(const int, const QString&)), recoPage, SLOT(slotCenterMsg(const int, const QString&))); + connect(recoPage, SIGNAL(signalShowPwdPage(const QString&)), this, SLOT(slotShowPasswordPage(const QString&))); + connect(parent()->parent(), SIGNAL(signalSetUserPwdButton(bool)), recoPage, SLOT(slotSetUserPwdButton(bool))); + connect(parent()->parent(), SIGNAL(signalShowOrHideFaceFrame(bool)), recoPage, SLOT(slotShowOrHideFaceFrame(bool))); + connect(parent()->parent(), SIGNAL(signalShowFinalResult(bool)), recoPage, SLOT(slotShowFinalResult(bool))); + + connect(parent()->parent(), SIGNAL(signalShowRecoUiColorFaceSnapshot(const QString&)), recoPage, SLOT(slotShowRecoUiColorFaceSnapshot(const QString&))); + connect(parent()->parent(), SIGNAL(signalShowRecoUiColorFaceSnapshot(const unsigned char*, int)), recoPage, SLOT(slotShowRecoUiColorFaceSnapshot(const unsigned char*, int))); + connect(parent()->parent(), SIGNAL(signalUpdateScreenSaver()), recoPage, SIGNAL(signalUpdateScreenSaver())); + connect(recoPage, SIGNAL(signalScreenTouch()), parent()->parent(), SLOT(slotScreenTouch())); + connect(parent()->parent(), SIGNAL(signalShowHealthCodeAuthStatus(int)), recoPage, SLOT(slotShowHealthCodeAuthStatus(int))); + connect(parent()->parent(), SIGNAL(signalShowRecoUiDevIdAndVer(bool)), recoPage, SLOT(slotShowRecoUiDevIdAndVer(bool))); + if ((m_recoPage != nullptr) && (dynamic_cast(recoPage) == m_recoPage)) { + connect(m_recoPage, &recoUiRecognize::callDialButtonClicked, this, &recoUi::slotShowCallDialPage); + connect(m_recoPage, &recoUiRecognize::callPlatformButtonClicked, this, &recoUi::slotShowCallConsolePage); + } else if ((m_recoPageColor != nullptr) && (dynamic_cast(recoPage) == m_recoPageColor)) { + connect(m_recoPageColor, &recoUiRecognizeTypeColor::callDialButtonClicked, this, &recoUi::slotShowCallDialPage); + connect(m_recoPageColor, &recoUiRecognizeTypeColor::callPlatformButtonClicked, this, &recoUi::slotShowCallConsolePage); + } else if ((m_recoPageAd != nullptr) && (dynamic_cast(recoPage) == m_recoPageAd)) { + connect(m_recoPageAd, &recoUiRecognizeTypeAd::callDialButtonClicked, this, &recoUi::slotShowCallDialPage); + connect(m_recoPageAd, &recoUiRecognizeTypeAd::callPlatformButtonClicked, this, &recoUi::slotShowCallConsolePage); + } +} + +void recoUi::slotRecoUiswitchToType(int type) +{ + if( (0 == type && UiConfig::GetInstance()->isRecoUiStyleClassical()) || + (1 == type && UiConfig::GetInstance()->isRecoUiStyleStandard()) || + (2 == type && UiConfig::GetInstance()->isRecoUiStyleColor()) || + (3 == type && UiConfig::GetInstance()->isRecoUiStyleAd()) || + (4 == type && UiConfig::GetInstance()->isRecoUiStyleScene()) ){ + return; + } + + if( ( (0 == type || 4 == type) && !UiConfig::GetInstance()->isRecoUiStyleStandard()) || + ( (1 == type || 4 == type) && !UiConfig::GetInstance()->isRecoUiStyleClassical()) || + ( (0 == type || 1 == type) && !UiConfig::GetInstance()->isRecoUiStyleScene()) ){ + if(!m_recoPage){ + m_recoPage = new recoUiRecognize(m_isNightMode, m_showPwdBtn, m_showCallBtn, this); + connectRecoPage(m_recoPage); + m_recoPage->setBackstageUiinterface(m_backstageIf); + } + m_stack_recoPage->insertWidget(0, m_recoPage); + m_recoPage->setCamVideoWind(); + }else if(2 == type){ + if(!m_recoPageColor){ + m_recoPageColor = new recoUiRecognizeTypeColor(m_isNightMode, m_showPwdBtn, m_showCallBtn, this); + connectRecoPage(m_recoPageColor); + m_recoPageColor->setBackstageUiinterface(m_backstageIf); + } + m_stack_recoPage->insertWidget(0, m_recoPageColor); + m_recoPageColor->setCamVideoWind(); + }else if(3 == type){ + if(!m_recoPageAd){ + m_recoPageAd = new recoUiRecognizeTypeAd(m_isNightMode, m_showPwdBtn, m_showCallBtn, this); + connectRecoPage(m_recoPageAd); + m_recoPageAd->setBackstageUiinterface(m_backstageIf); + } + m_stack_recoPage->insertWidget(0, m_recoPageAd); + m_recoPageAd->setCamVideoWind(); + } + #if 0 + else if(4 == type){ + if(!m_recoPageScene){ + m_recoPageScene = new recoUiRecognizeScene(m_isNightMode, m_showPwdBtn, m_showCallBtn, this); + connectRecoPage(m_recoPageScene); + m_recoPageScene->setBackstageUiinterface(m_backstageIf); + } + m_stack_recoPage->insertWidget(0, m_recoPageScene); + m_recoPageScene->setCamVideoWind(); + } + #endif + + if( (1 != type && 4 != type && UiConfig::GetInstance()->isRecoUiStyleClassical()) || + (0 != type && 4 != type && UiConfig::GetInstance()->isRecoUiStyleStandard()) || + (0 != type && 1 != type && UiConfig::GetInstance()->isRecoUiStyleScene()) ){ + m_stack_recoPage->removeWidget(m_recoPage); + }else if(2 != type && UiConfig::GetInstance()->isRecoUiStyleColor()){ + m_stack_recoPage->removeWidget(m_recoPageColor); + }else if(3 != type && UiConfig::GetInstance()->isRecoUiStyleAd()){ + m_stack_recoPage->removeWidget(m_recoPageAd); + } + #if 0 + else if(4 != type && UiConfig::GetInstance()->isRecoUiStyleScene()){ + m_stack_recoPage->removeWidget(m_recoPageScene); + } + #endif + + m_stack_recoPage->setCurrentIndex(0); + UiConfig::GetInstance()->setRecoUiStyle(type); + if( m_recoPage && (0 == type || 1 == type || 4 == type) ){ + m_recoPage->setStyle(type); + } +} + +void recoUi::slotSaveRecoUiPwdBtnStatus(bool status) +{ + qDebug() << "slotSaveRecoUiPwdBtnStatus:" << status; + m_showPwdBtn = status; +} + +void recoUi::slotSaveRecoUiNightModeStatus(int type) +{ + //qDebug() << "slotSaveRecoUiNightModeStatus:" << type; + m_isNightMode = (3 == type); +} + +void recoUi::slotUpdateAdScreen() +{ + if(m_recoPageAd){ + m_recoPageAd->updateAdWidget(); + } +} + +void recoUi::slotTimer() +{ + m_timer->stop(); + m_recoPage->slotsResetRecoUi(); // 这里直接调用 reset, 否则RECO_UI_PAGE_RECOGNIZE可能会出现中间态 + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_RECOGNIZE); + if(UiConfig::GetInstance()->isRecoUiStyleScene()){ + m_sceneResult->resetPersonCount(); + } +} + +void recoUi::slotShowHealthMsg(int type, float temp, const QString& msg, bool pass, const unsigned char* jpgDate, + int jpgLen, const QString& tripCity, const QString& failReason, int bgColor, int displayTime) +{ + if(type < 0){ + m_timer->stop(); + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_RECOGNIZE); + return; + } + + m_healthMsgPage->showHealthMsg(type, temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor); + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_HEALTHCODE); + m_timer->start(displayTime * 1000); +} + +void recoUi::slotShowSceneResult(int result, const QString& resultText, const QString& businessInfo, int displayTime) +{ + if(result < 0){ + if(-1 == result){ //超时 + m_sceneResult->resetPersonCount(); + m_recoPage->setSceneUiReco(false); + }else{ + m_recoPage->setSceneUiReco(true); + } + m_timer->stop(); + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_RECOGNIZE); + return; + } + if(result > 0){//通过才更新 + int count = m_backstageIf->getTicketCheckCountToday(); + m_sceneResult->setTicketCheckCount(0, count); + m_recoPage->setTicketCheckCount(0, count); + + #if 0 + m_recoPageScene->setTicketCheckCount(count); + #endif + } + m_sceneResult->showResult(result, resultText, businessInfo); + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_SCENERESULT); + m_timer->start(displayTime); +} + +void recoUi::slotUpdatePersonNumAccessed(int personAccess, int personAll) +{ + if(m_stack_recoPage->currentIndex() != RECO_UI_PAGE_SCENERESULT){ + return; + } + if(m_sceneResult->updatePersonNumAccessed(personAccess, personAll)){ + m_timer->start(1000); + } +} + +void recoUi::slotNoSuccessPage(int result) +{ + if(UiConfig::GetInstance()->isRecoUiStyleScene()){ + if(m_stack_recoPage->currentIndex() == RECO_UI_PAGE_SCENERESULT){ + if(GLOBAL_RECO_FACE_CAMERA == result){ + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_RECOGNIZE);//请正视镜头可以打断场景结果,需要切换页面 + }else{ + return; + } + } + if(result != GLOBAL_RECO_NO_ENTRY && result != GLOBAL_RECO_CLEAR_NO_ENTRY){ + m_recoPage->setSceneUiReco(true); + } + } + emit signalNoSuccessPage(result); +} + +void recoUi::slotSetSceneUiPersonCountType(int type) +{ + m_sceneResult->setPersonCountType(type); + m_recoPage->setScenePersonCountType(type); +} + +void recoUi::slotUpdateSceneUiPersonCount(int count) +{ + m_sceneResult->setTicketCheckCount(1, count); + m_recoPage->setTicketCheckCount(1, count); +} + +void recoUi::slotShowCallDialPage() { + if (m_isPlatformConnected) { + m_callDialPage->reset(); + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_CALL_DIAL); + m_backstageIf->getCallDevList(); + } else { + if (m_recoPage != nullptr) { + emit m_recoPage->slotCenterMsg(64, "当前设备离线,请稍后重试"); + QTimer::singleShot(1500, this, [this]() { emit m_recoPage->slotCenterMsg(64, ""); }); + } + if (m_recoPageColor != nullptr) { + emit m_recoPageColor->slotCenterMsg(64, "当前设备离线,请稍后重试"); + QTimer::singleShot(1500, this, [this]() { emit m_recoPageColor->slotCenterMsg(64, ""); }); + } + if (m_recoPageAd != nullptr) { + emit m_recoPageAd->slotCenterMsg(64, "当前设备离线,请稍后重试"); + QTimer::singleShot(1500, this, [this]() { emit m_recoPageAd->slotCenterMsg(64, ""); }); + } + } +} + +void recoUi::slotShowCallConsolePage(const QString &contactName) { + if (m_isPlatformConnected) { + m_callConsolePage->reset(contactName); + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_CALL_CONSOLE); + if (contactName == "管理处") { + m_backstageIf->callDev("", 2); + } + } else { + if (m_recoPage != nullptr) { + emit m_recoPage->slotCenterMsg(64, "当前设备离线,请稍后重试"); + QTimer::singleShot(1500, this, [this]() { emit m_recoPage->slotCenterMsg(64, ""); }); + } + if (m_recoPageColor != nullptr) { + emit m_recoPageColor->slotCenterMsg(64, "当前设备离线,请稍后重试"); + QTimer::singleShot(1500, this, [this]() { emit m_recoPageColor->slotCenterMsg(64, ""); }); + } + if (m_recoPageAd != nullptr) { + emit m_recoPageAd->slotCenterMsg(64, "当前设备离线,请稍后重试"); + QTimer::singleShot(1500, this, [this]() { emit m_recoPageAd->slotCenterMsg(64, ""); }); + } + } +} + +void recoUi::slotSetCallConsoleStatus(int status, const QString& text) +{ + m_callConsolePage->setStatus(status, text); + if(status < 100){ + m_stack_recoPage->setCurrentIndex(RECO_UI_PAGE_CALL_CONSOLE); + } +} + +void recoUi::slotShowCallBtn(bool callButton, bool videoButton) { + m_showCallBtn = callButton; + if (m_recoPage != nullptr) { + m_recoPage->slotShowCallBtn(m_showCallBtn); + } + if (m_recoPageColor != nullptr) { + m_recoPageColor->slotShowCallBtn(m_showCallBtn); + } + if (m_recoPageAd != nullptr) { + m_recoPageAd->slotShowCallBtn(m_showCallBtn); + } + if (m_callConsolePage != nullptr) { + m_callConsolePage->setVideoButtonVisible(videoButton); + } +} + +void recoUi::setDndMode(bool enabled, const std::chrono::system_clock::time_point &time) { + if (m_recoPageAd) { + m_recoPageAd->setDndMode(enabled, time); + } +} diff --git a/Linguist/recoUi/recoUi.h b/Linguist/recoUi/recoUi.h new file mode 100644 index 0000000..84f7a6f --- /dev/null +++ b/Linguist/recoUi/recoUi.h @@ -0,0 +1,130 @@ +#ifndef RECOUI_H +#define RECOUI_H + +#include +#include +#include "recoUiUnauthorized.h" +#include "recoUiRecognize.h" +#include "recoUiScreensaver.h" +#include "recoUiPassword.h" +#include "UiTools.h" +#include "BackstageInterfaceForUi.h" +#include "recoUiRecognizeTypeBase.h" +#include "recoUiHealthCode.h" +#include "recoUiRecognizeScene.h" +#include "recoUiCallDial.h" +#include "recoUiCallConsole.h" + +class statusbarUi : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + explicit statusbarUi(QWidget *parent = nullptr); + ~statusbarUi(); + void updatePlatformConnectionStatus(const int); + void updateIpLabel(QString& ipStr); + +signals: + +public slots: + +private: + QLabel* m_label_ip; + QLabel* m_label_platform; + //QLabel* m_label_wifi; + //QLabel* m_label_4g; + QLabel* m_label_time; + + TimerUpdate* _timerUpdate; +}; + +typedef enum +{ + RECO_UI_PAGE_RECOGNIZE, + RECO_UI_PAGE_SCREENSAVER, + RECO_UI_PAGE_PASSWORD, + RECO_UI_PAGE_HEALTHCODE, + RECO_UI_PAGE_SCENERESULT, + RECO_UI_PAGE_CALL_DIAL, + RECO_UI_PAGE_CALL_CONSOLE, + RECO_UI_PAGE_DRAW, + + RECO_UI_PAGE_MAX, + RECO_UI_PAGE_WORK_MODE +}RECO_UI_PAGE_E; + +class recoUi : public WidgetWithBackstageInterface +{ + Q_OBJECT +public: + explicit recoUi(QWidget *parent = nullptr); + ~recoUi(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + + //statusbarUi* getStatusInstance(); + + void update_IpBar(); + void updateVideoWind(); + bool isScenePassing(); + void setDndMode(bool enabled, const std::chrono::system_clock::time_point &time); + +signals: + void signalShowSettingPage(); + void signalNoSuccessPage(int); + void signalSuccessPage(int nPage, const QString& name); +// void signalDrawScanner(const int nPage, RWFaceInfo* pInfo, int sum); + void signalChangeRecoUiMode(); //底下的页面开关二维码模式信号 + void signalUpdateRecoUiIpDisplay(const bool); //增加识别界面ip显示开关,更新信号 + +public slots: + void slotShowSettingPage(); + void slotShowRecoUiPage(int); + void slotUpdatePlatformConnectionStatus(int); + void slotShowPasswordPage(const QString& name); + void slotShowRecognizePage(); + void slotRecoUiswitchToType(int type); + void slotSaveRecoUiPwdBtnStatus(bool status); + void slotSaveRecoUiNightModeStatus(int type); + void slotUpdateAdScreen(); + void slotShowHealthMsg(int type, float temp, const QString& msg, bool pass, const unsigned char* jpgDate, + int jpgLen, const QString& tripCity, const QString& failReason, int bgColor, int displayTime); + void slotTimer(); + void slotShowSceneResult(int result, const QString& resultText, const QString& businessInfo, int displayTime); + void slotUpdatePersonNumAccessed(int personAccess, int personAll); + void slotNoSuccessPage(int); + void slotSetSceneUiPersonCountType(int type); + void slotUpdateSceneUiPersonCount(int count); + void slotShowCallDialPage(); + void slotShowCallConsolePage(const QString&); + void slotSetCallConsoleStatus(int status, const QString& text); + void slotShowCallBtn(bool callButton, bool videoButton); + +private: + QStackedWidget* m_stack_recoPage; + + // statusbarUi* m_statusbar; + + recoUiRecognize* m_recoPage = nullptr; + recoUiRecognizeTypeColor* m_recoPageColor = nullptr; + recoUiRecognizeTypeAd* m_recoPageAd = nullptr; + //recoUiRecognizeScene* m_recoPageScene = nullptr; + + recoUiScreensaver* m_ssPage; + recoUiPassword* m_pwdPage; + recoUiHealthCode* m_healthMsgPage; + recoUiSceneResult* m_sceneResult; + recoUiCallDial* m_callDialPage = nullptr; + recoUiCallConsole* m_callConsolePage = nullptr; + + bool m_showPwdBtn = false; + bool m_isNightMode = false; + bool m_showCallBtn = false; + bool m_isPlatformConnected = false; + + QTimer* m_timer = nullptr; + + void connectRecoPage(const QObject* recoPage); + void disconnectRecoPage(const QObject* recoPage); +}; + +#endif // RECOUI_H diff --git a/Linguist/recoUi/recoUiCallConsole.cpp b/Linguist/recoUi/recoUiCallConsole.cpp new file mode 100644 index 0000000..5eaf38f --- /dev/null +++ b/Linguist/recoUi/recoUiCallConsole.cpp @@ -0,0 +1,288 @@ +#include "recoUiCallConsole.h" +#include +#include +#include + +recoUiCallConsole::recoUiCallConsole(QWidget *parent) : WidgetWithBackstageInterface(parent) +{ + qDebug() << "recoUiCallConsole()"; + + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + + QLabel* labelImg = new QLabel(this); + labelImg->setPixmap(QPixmap(":/res/image/reco_msg_face_pic_large.png")); + + m_labelContactName = new QLabel(this); + + m_labelTip = new QLabel("xxxxxx", this); + + m_btnCancel = createButton(QPixmap(":/res/image/fail2_large.png"), tr("取消")); + m_btnHungUp = createButton(QPixmap(":/res/image/hung_up_large.png"), tr("结束通话")); + m_btnCallAgain = createButton(QPixmap(":/res/image/call_large.png"), tr("重拨")); + + m_btnVideoCtrl = createButton(QPixmap(":/res/image/enable_video_large.png"), tr("启用摄像头")); + + m_btnAccept = createButton(QPixmap(":/res/image/call_large.png"), tr("接听")); + m_btnReject = createButton(QPixmap(":/res/image/hung_up_large.png"), tr("拒绝")); + + m_btnOpenDoor = createButton(QPixmap(":/res/image/key-large.png"),"开门"); + + QHBoxLayout* hlayBtns = new QHBoxLayout(); + hlayBtns->addWidget(m_btnOpenDoor); + hlayBtns->addWidget(m_btnCancel); + hlayBtns->addWidget(m_btnVideoCtrl); + hlayBtns->addWidget(m_btnHungUp); + hlayBtns->addWidget(m_btnCallAgain); + hlayBtns->addWidget(m_btnReject); + hlayBtns->addWidget(m_btnAccept); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(labelImg, 1, Qt::AlignCenter | Qt::AlignTop); + vlay->addWidget(m_labelContactName, 1, Qt::AlignCenter | Qt::AlignTop); + vlay->addSpacing(UiConfig::GetInstance()->getUiHeight() / 15); + vlay->addWidget(m_labelTip, 1, Qt::AlignCenter | Qt::AlignTop); + vlay->addStretch(10); + vlay->addLayout(hlayBtns); + vlay->setContentsMargins(0, UiConfig::GetInstance()->getUiHeight() / 10, 0, UiConfig::GetInstance()->getUiHeight() / 10); + setLayout(vlay); + + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); + setBackgroundTransparent(false); + setVideoButtonVisible(false); +} + +void recoUiCallConsole::setBackgroundTransparent(bool transparent) { + if (transparent) { + setAutoFillBackground(false); + } else { + setAutoFillBackground(true); + QPalette palette(this->palette()); + palette.setBrush(QPalette::Window, Qt::darkGray); + palette.setColor(QPalette::WindowText, Qt::white); + palette.setColor(QPalette::Text, Qt::white); + setPalette(palette); + } +} + +void recoUiCallConsole::setVideoButtonVisible(bool visible) { + m_videoButtonVisible = visible; + m_btnVideoCtrl->setVisible(visible); +} + +void recoUiCallConsole::reset(const QString& contactName) +{ + m_labelContactName->setText(contactName); + setBackgroundTransparent(false); + setStatus(99); + m_timeCount = 0; + m_timer->start(TIMEOUT); + m_btnOpenDoor->hide(); + m_initiatorDoorCfg = false; +} + +void recoUiCallConsole::setStatus(int status, const QString& text) +{ + switch(status){ + //发起者 + case 0://通话接通,不允许开关视频 + case 1://通话接通,允许开关视频 + m_btnHungUp->show(); + m_btnCancel->hide(); + m_btnCallAgain->hide(); + m_btnReject->hide(); + m_btnAccept->hide(); + videoCtrl(false); + m_labelTip->setText("00:00"); + m_timeCount = 1; + m_timer->start(1000); + if(status - 0){ + m_btnVideoCtrl->show(); + }else{ + m_btnVideoCtrl->hide(); + } + break; + case ShowVideo: { + setBackgroundTransparent(true); + break; + } + case HideVideo: { + setBackgroundTransparent(false); + break; + } + //接收者 + case 50://设备通话请求到达,不允许开关视频 + case 51://设备通话请求到达,允许开关视频 + setBackgroundTransparent(false); + m_btnHungUp->hide(); + m_btnCancel->hide(); + m_btnCallAgain->hide(); + m_btnReject->show(); + m_btnAccept->show(); + m_btnVideoCtrl->hide(); + m_labelContactName->setText(text); + m_labelTip->setText(""); + videoCtrl(false); + m_initiatorVideoCfg = status - 50; + m_btnOpenDoor->hide(); + m_initiatorDoorCfg = true; + m_backstageIf->stopIdentyState(); + break; + + case PlatformCallIn://平台通话请求到达,不允许开关视频 + setBackgroundTransparent(false); + m_initiatorDoorCfg = false; + m_btnOpenDoor->hide(); // 平台没有开门需求 + m_btnHungUp->hide(); + m_btnCancel->hide(); + m_btnCallAgain->hide(); + m_btnReject->hide(); + m_btnAccept->hide(); + videoCtrl(false); + m_btnVideoCtrl->hide(); + m_labelContactName->setText(text); + m_labelTip->setText("00:00"); + m_timeCount = 1; + m_timer->start(1000); + m_backstageIf->stopIdentyState(); + break; + case 100: + m_timer->stop(); + emit signalShowRecognizePage(); + break; + + //内部处理 + case 99://发起者呼叫中 + m_btnCancel->show(); + m_btnCallAgain->hide(); + m_btnVideoCtrl->hide(); + m_btnHungUp->hide(); + m_btnReject->hide(); + m_btnAccept->hide(); + m_labelTip->setText(tr("呼叫中 ...")); + break; + case 98://发起者超时未接通 + m_btnCancel->show(); + m_btnCallAgain->show(); + m_btnVideoCtrl->hide(); + m_btnHungUp->hide(); + m_btnReject->hide(); + m_btnAccept->hide(); + m_labelTip->setText(tr("对方长时间未接听")); + break; + case 97://接收者接通 + m_btnCancel->hide(); + m_btnCallAgain->hide(); + m_btnHungUp->show(); + m_btnReject->hide(); + m_btnAccept->hide(); + m_labelTip->setText("00:00"); + m_timeCount = 1; + m_timer->start(1000); + if(m_initiatorVideoCfg){ + m_btnVideoCtrl->show(); + }else{ + m_btnVideoCtrl->hide(); + } + m_btnOpenDoor->setVisible(m_initiatorDoorCfg); + break; + default:break; + } +} + +void recoUiCallConsole::slotBtnClicked() +{ + const QObject* send = sender(); + if (send == m_btnCallAgain) { + emit signalCallAgain(); + setStatus(99); + m_timeCount = 0; + m_timer->start(TIMEOUT); + }else if (send == m_btnHungUp) { + m_timer->stop(); + m_backstageIf->callHangUp(); + emit signalShowRecognizePage(); + }else if (send == m_btnCancel) { + m_timer->stop(); + m_backstageIf->callAbort(); + emit signalShowRecognizePage(); + }else if(send == m_btnVideoCtrl){ + m_videoEnable = !m_videoEnable; + videoCtrl(m_videoEnable); + m_backstageIf->callSetVideoStream(m_videoEnable); + }else if(send == m_btnReject){ + m_backstageIf->callReject(); + emit signalShowRecognizePage(); + }else if(send == m_btnAccept){ + m_backstageIf->callAccept(); + setStatus(97); + } else if (send == m_btnOpenDoor) { + m_backstageIf->openCallRemoteDoor(); + } + + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiCallConsole::slotTimeout() +{ + if(m_timeCount){ + updateCallTime(m_timeCount++); + }else{ + m_timer->stop(); + m_backstageIf->callAbort(); + setStatus(98); + } +} + +void recoUiCallConsole::videoCtrl(bool enable) +{ + QLabel *icon = m_btnVideoCtrl->findChild("icon"); + if (!icon) { + qDebug() << "video btn label not found"; + return; + } + QLabel *text = m_btnVideoCtrl->findChild("text"); + if (!icon) { + qDebug() << "video btn text not found"; + return; + } + text->setText(enable ? tr("禁用摄像头") : tr("启用摄像头")); + QPixmap pm(enable ? ":/res/image/disable_video_large.png" : ":/res/image/enable_video_large.png"); + pm = pm.scaled(120, 120, Qt::KeepAspectRatio); + icon->setPixmap(pm); + m_videoEnable = enable; +} + +QPushButton* recoUiCallConsole::createButton(const QPixmap& icon, const QString& btnText) +{ + QPushButton* btn = new QPushButton(this); + btn->setFocusPolicy(Qt::NoFocus); + btn->setFixedSize(240, 240); + btn->setStyleSheet("background-color: transparent;"); + connect(btn, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QLabel* labelIcon = new QLabel(btn); + labelIcon->setObjectName("icon"); + QPixmap pm(icon); + pm = pm.scaled(120, 120, Qt::KeepAspectRatio); + labelIcon->setPixmap(pm); + + QLabel *btnName = new QLabel(btnText, btn); + btnName->setObjectName("text"); + btnName->setStyleSheet("color: white;"); + + QVBoxLayout* vlay = new QVBoxLayout(btn); + vlay->addWidget(labelIcon, 9, Qt::AlignCenter); + vlay->addWidget(btnName, 1, Qt::AlignCenter); + vlay->setAlignment(Qt::AlignCenter); + + return btn; +} + +void recoUiCallConsole::updateCallTime(int second) +{ + m_labelTip->setText(QString::number(second / 60).rightJustified(2, QChar('0')) + ":" + QString::number(second % 60).rightJustified(2, QChar('0'))); +} + diff --git a/Linguist/recoUi/recoUiCallConsole.h b/Linguist/recoUi/recoUiCallConsole.h new file mode 100644 index 0000000..ae0f0a3 --- /dev/null +++ b/Linguist/recoUi/recoUiCallConsole.h @@ -0,0 +1,83 @@ +#ifndef RECOUICALLCONSOLE_H +#define RECOUICALLCONSOLE_H + +#include "UiTools.h" +#include "UiConfig.h" + + +class recoUiCallConsole : public WidgetWithBackstageInterface +{ + Q_OBJECT +public: + static const int PASSWORD_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int NUM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int CONFIRM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const QString PWD_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString CONFIRM_BTN_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString CONFIRM_BTN_DISABLE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int CONFIRM_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int CONFIRM_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BACK_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int BACK_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int BACK_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString DEL_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DEL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DEL_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString NUM_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + enum Status { + PlatformCallIn = 60, // 平台打过来 + ShowVideo = 101, // 背景透明,显示对方视频 + HideVideo = 102, // 背景不透明, 不显示对方视频 + }; + + explicit recoUiCallConsole(QWidget *parent = nullptr); + void reset(const QString& contactName); + void setStatus(int status, const QString& text = QString()); + void setVideoButtonVisible(bool visible); + +signals: + void signalShowRecognizePage(); + void signalCallAgain(); + +public slots: + void slotBtnClicked(); + void slotTimeout(); + +protected: + /** + * @brief 透明背景能够显示视频 + * + * @param transparent + */ + void setBackgroundTransparent(bool transparent); + +private: + enum{ + TIMEOUT = 30000, + }; + + QLabel* m_labelContactName; + QLabel* m_labelTip; + QPushButton* m_btnCancel; + QPushButton* m_btnHungUp; + QPushButton* m_btnCallAgain; + QPushButton* m_btnVideoCtrl; + QPushButton* m_btnAccept; + QPushButton* m_btnReject; + QPushButton *m_btnOpenDoor = nullptr; + + QTimer* m_timer; + bool m_videoButtonVisible = false; + bool m_videoEnable = false; + bool m_initiatorVideoCfg = false; + bool m_initiatorDoorCfg = false; + int m_timeCount = 0; + + QPushButton* createButton(const QPixmap& icon, const QString& btnText); + void videoCtrl(bool enable); + void updateCallTime(int second); + +}; + +#endif // RECOUICALLCONSOLE_H diff --git a/Linguist/recoUi/recoUiCallDial.cpp b/Linguist/recoUi/recoUiCallDial.cpp new file mode 100644 index 0000000..726135f --- /dev/null +++ b/Linguist/recoUi/recoUiCallDial.cpp @@ -0,0 +1,370 @@ +#include "recoUiCallDial.h" +#include +#include +#include "AsyncEvent.h" +#include "recoUiRecognize.h" + +const int recoUiCallDial::DEV_CODE_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY] = { + {20, 20, 14, 15, 12, 15, 14, 13, 9, 12, 10, 13, 13, 9}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {14, 14, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8}, + {14, 14, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8} +}; +const int recoUiCallDial::NUM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY] = { + {20, 20, 14, 15, 12, 15, 14, 13, 9, 12, 10, 13, 13, 9}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {16, 16, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8}, + {16, 16, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8} +}; +const int recoUiCallDial::CALL_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY] = { + {20, 20, 14, 15, 12, 15, 14, 13, 9, 12, 10, 13, 13, 9}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {14, 14, 10, 11, 9, 11, 10, 9, 7, 9, 8, 9, 9, 7}, + {14, 14, 10, 11, 9, 11, 10, 9, 7, 9, 8, 9, 9, 7} +}; + +const QString recoUiCallDial::DIAL_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_bg_small.jpg", +":/res/image/pwd_bg_large.jpg", +":/res/image/pwd_bg_middle.jpg", +":/res/image/pwd_bg_large.jpg", +":/res/image/pwd_bg_middle.jpg" +}; + +const QString recoUiCallDial::CALL_BTN_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_confirm_small.png", +":/res/image/pwd_confirm_large.png", +":/res/image/pwd_confirm_middle.png", +":/res/image/pwd_confirm_large.png", +":/res/image/pwd_confirm_middle.png" +}; +const QString recoUiCallDial::CALL_BTN_DISABLE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_confirm_small_disable.png", +":/res/image/pwd_confirm_large_disable.png", +":/res/image/pwd_confirm_middle_disable.png", +":/res/image/pwd_confirm_large_disable.png", +":/res/image/pwd_confirm_middle_disable.png" +}; +const int recoUiCallDial::CALL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {344, 430, 430, 430, 430}; +const int recoUiCallDial::CALL_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {72, 90, 90, 90, 90}; + +const QString recoUiCallDial::BACK_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_back_small.png", +":/res/image/pwd_back_large.png", +":/res/image/pwd_back_middle.png", +":/res/image/pwd_back_large.png", +":/res/image/pwd_back_middle.png" +}; +const int recoUiCallDial::BACK_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {20, 24, 24, 24, 24}; +const int recoUiCallDial::BACK_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {35, 44, 44, 44, 44}; + +const QString recoUiCallDial::DEL_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_del_small.png", +":/res/image/pwd_del_large_black.png", +":/res/image/pwd_del_middle.png", +":/res/image/pwd_del_large_black.png", +":/res/image/pwd_del_middle.png" +}; +const int recoUiCallDial::DEL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {344, 35, 35, 35, 35}; +const int recoUiCallDial::DEL_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {344, 24, 24, 24, 24}; + +const QString recoUiCallDial::NUM_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/num_btn_small.png", +":/res/image/num_btn_large.png", +":/res/image/num_btn_middle.png", +":/res/image/num_btn_large.png", +":/res/image/num_btn_middle.png" +}; + + + +recoUiCallDial::recoUiCallDial(QWidget *parent) : WidgetWithBackstageInterface(parent) +{ + qDebug() << "recoUiCallDial()"; + + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + + setAutoFillBackground(true); + QPalette palette(this->palette()); + palette.setBrush(QPalette::Window,QBrush(QPixmap(DIAL_BG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + //palette.setBrush(QPalette::Window, Qt::white); + setPalette(palette); + + const int btnWidth = UiConfig::GetInstance()->getUiWidth() / 8; + + m_btnBack = new QPushButton(this); + setButtonBackImage(m_btnBack, BACK_BTN[UiConfig::GetInstance()->getScreenConfigIndex()], + BACK_BTN_W[UiConfig::GetInstance()->getScreenConfigIndex()], + BACK_BTN_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_btnBack->setFixedSize(btnWidth, btnWidth); + //m_btnBack->setStyleSheet("QPushButton:focus{outline: none;}"); + m_btnBack->setFocusPolicy(Qt::NoFocus); + connect(m_btnBack, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QFont ft; + ft.setWeight(ft.weight() * 2 > 99 ? 99 : ft.weight() * 2);//Weight must be between 0 and 99 + + m_editDevCode = new QLineEdit(this); + m_editDevCode->setFixedWidth(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.9)); + m_editDevCode->setReadOnly(true); + QPalette lineEditPal; + lineEditPal.setColor(QPalette::Text,QColor(255, 255, 255, 255)); + m_editDevCode->setPalette(lineEditPal); + ft.setPointSize(DEV_CODE_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_editDevCode->setFont(ft); + m_editDevCode->setStyleSheet("background:transparent;border-width:0;border-style:outset"); + m_editDevCode->setAlignment(Qt::AlignCenter); + connect(m_editDevCode, SIGNAL(textChanged(const QString&)), this, SLOT(slotTextChanged(const QString&))); + + QPalette btnPal; + btnPal.setColor(QPalette::ButtonText,QColor(255, 255, 255, 255)); + QGridLayout* glayMid = new QGridLayout(); + for(int i=0; isetText(QString::number(i)); + m_btnsNum[i]->setPalette(btnPal); + ft.setPointSize(NUM_BTN_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_btnsNum[i]->setFont(ft); + m_btnsNum[i]->setFlat(true); + m_btnsNum[i]->setCursor(QCursor(Qt::PointingHandCursor)); + m_btnsNum[i]->setFocusPolicy(Qt::NoFocus); + m_btnsNum[i]->setFixedSize(btnWidth, btnWidth); + m_btnsNum[i]->setStyleSheet("background-color:transparent;border-radius:0px;focus{outline: none;}"); + connect(m_btnsNum[i], SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + if(!UiConfig::GetInstance()->isRkDevice()){ + connect(m_btnsNum[i], SIGNAL(pressed()), this, SLOT(slotBtnPressed())); + connect(m_btnsNum[i], SIGNAL(released()), this, SLOT(slotBtnReleased())); + } + if(i > 0){ + const int pos = i - 1; + glayMid->addWidget(m_btnsNum[i], pos / 3, pos % 3); + } + } + m_btnBackspace = new QPushButton(this); + setButtonBackImage(m_btnBackspace, DEL_BTN[UiConfig::GetInstance()->getScreenConfigIndex()], + DEL_BTN_W[UiConfig::GetInstance()->getScreenConfigIndex()], + DEL_BTN_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_btnBackspace->setFixedSize(btnWidth, btnWidth); + connect(m_btnBackspace, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + glayMid->addWidget(m_btnsNum[0], 3, 1); + glayMid->addWidget(m_btnBackspace, 3, 2); + + m_btnCall = new QPushButton(this); + m_btnCall->setText(tr("呼叫")); + m_btnCall->setPalette(btnPal); + m_btnCall->setFlat(true); + m_btnCall->setCursor(QCursor(Qt::PointingHandCursor)); + m_btnCall->setFocusPolicy(Qt::NoFocus); + m_btnCall->setFixedSize(CALL_BTN_W[UiConfig::GetInstance()->getScreenConfigIndex()], + UiConfig::GetInstance()->isRkDevice() ? + (CALL_BTN_H[UiConfig::GetInstance()->getScreenConfigIndex()] >> 2 << 2) : + CALL_BTN_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + ft.setPointSize(CALL_BTN_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_btnCall->setFont(ft); + /*m_btnCall->setStyleSheet(QString("background-color:transparent;" + "color:white;" + "border-image: url(%1);" + ).arg(CALL_BTN_BG[UiConfig::GetInstance()->getScreenConfigIndex()]));*/ + m_btnCall->setStyleSheet("QPushButton {" + "border: 0px;" + "border-radius:10px;" + "background-color:rgb(31, 164, 38);" + "focus{outline: none;}" + "}" + "QPushButton:pressed {" + "background-color:rgb(31, 255, 38);" + "focus{outline: none;}" + "}"); + connect(m_btnCall, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(m_btnBack, 1, Qt::AlignLeft | Qt::AlignTop); + vlay->addWidget(m_editDevCode, 1, Qt::AlignCenter | Qt::AlignTop); + vlay->addSpacing(UiConfig::GetInstance()->getUiHeight() / 3); + vlay->addLayout(glayMid); + vlay->addStretch(100); + vlay->addWidget(m_btnCall, 1, Qt::AlignCenter | Qt::AlignBottom); + vlay->setContentsMargins(0, 10, 0, UiConfig::GetInstance()->getUiHeight() / 20); + setLayout(vlay); + + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); + + m_tooltip = new CenterMsgWidget(this); // 不继承父组件样式 + m_tooltip->hide(); + m_tooltipTimer = new QTimer(this); + m_tooltipTimer->setSingleShot(true); + connect(m_tooltipTimer, &QTimer::timeout, this, &recoUiCallDial::onTooltipTimeout); + +} + +void recoUiCallDial::setToolip(const QString &message, int millisecondTimeout) { + if (m_tooltip != nullptr) { + m_tooltip->showMsg(message, 64); + m_tooltip->show(); + m_tooltip->raise(); + m_tooltipTimer->start(millisecondTimeout); + } +} + +void recoUiCallDial::setPlatformConnected(bool connected) { + m_platformConnected = connected; +} + + void recoUiCallDial::onTooltipTimeout(){ + m_tooltip->hide(); + } + +void recoUiCallDial::reset() +{ + m_editDevCode->clear(); + m_timer->start(TIMEOUT); + m_backstageIf->stopIdentyState(); + if(m_candidate){ + delete m_candidate; + m_candidate = nullptr; + } +} + +void recoUiCallDial::slotBtnClicked() +{ + m_timer->start(TIMEOUT); + const QObject* send = sender(); + if (send == m_btnCall) { + if (m_platformConnected) { + auto code = m_editDevCode->text(); + if (code.isEmpty()) { + setToolip("号码不能为空", 1500); + } else { + auto iterator = std::find_if(m_devList.cbegin(), m_devList.cend(), + [&code](const stCallDev &device) { return device.code == code.toStdString(); }); + if (iterator != m_devList.cend()) { + if (iterator->status == 0) { + setToolip("呼叫设备离线,请稍后重试", 1500); + } else { + m_timer->stop(); + slotCall(); + emit signalCallBtnPressed(QString::fromStdString(iterator->name)); + } + } else { + setToolip("设备不存在", 1500); + } + } + } else { + setToolip("当前设备离线,请稍后重试", 1500); + } + }else if (send == m_btnBackspace) { + QString text = m_editDevCode->text(); + if(text.size()){ + m_editDevCode->setText(text.left(text.size() - 1)); + } + }else if (send == m_btnBack) { + exit(); + }else{ + if(m_editDevCode->text().length() >= CODE_LEN_MAX){ + return; + } + for(int i=0; isetText(m_editDevCode->text() + m_btnsNum[i]->text()); + break; + } + } + } + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiCallDial::slotBtnPressed() +{ + dynamic_cast(sender())->setStyleSheet(QString("QPushButton {" + "border: 0px;" + "}" + "QPushButton:pressed {" + "border: 0px;" + "background:url(%1);" + "background-repeat:none;" + "background-position:center;" + "}") + .arg(NUM_BTN[UiConfig::GetInstance()->getScreenConfigIndex()])); +} + +void recoUiCallDial::slotBtnReleased() +{ + dynamic_cast(sender())->setStyleSheet("background-color:transparent;border-radius:0px;focus{outline: none;}"); +} + +void recoUiCallDial::slotTimeout() +{ + exit(); +} + +void recoUiCallDial::slotItemChoosed(int index) { + if (index < m_devList.size()) { + auto event = new AsyncEvent([=]() { + m_timer->start(TIMEOUT); + m_editDevCode->setText(QString::fromStdString(m_devList.at(index).code)); + if (UiConfig::GetInstance()->isRkDevice()) { + update(); + } + }); + QCoreApplication::postEvent(this, event); + } +} + +void recoUiCallDial::slotTextChanged(const QString& text) +{ + m_devList.clear(); + if(m_candidate){ + delete m_candidate; + m_candidate = nullptr; + } + if(text.length() < CODE_LEN_MIN){ + return; + } + m_backstageIf->queryCallDevList(text.toStdString(), m_devList); + QVector opns; + for(auto &item : m_devList){ + QString dev{item.code.c_str()}; + dev += "("; + dev += item.name.c_str(); + if(item.status == 0){ + dev += tr("-离线"); + } + dev += ")"; + opns.append(myListWidget::SetOpnCfg(dev)); + } + showCandidate(opns); +} + +void recoUiCallDial::slotCall() { + auto iterator = std::find_if(m_devList.cbegin(), m_devList.cend(), + [this](const stCallDev &device) { return device.code == m_editDevCode->text().toStdString(); }); + if (iterator != m_devList.cend()) { + m_backstageIf->callDev(iterator->devTag, iterator->type); + } +} + +void recoUiCallDial::showCandidate(const QVector& opns) +{ + if(opns.size() == 0){ + return; + } + m_candidate = new SearchBarCandidate(opns, 0, this); + m_candidate->setFixedSize(m_editDevCode->width(), m_editDevCode->height() * 5); + m_candidate->move(m_editDevCode->x(), m_editDevCode->y() + m_editDevCode->height() + 20); + m_candidate->show(); + connect(m_candidate, SIGNAL(signalItemChoosed(int)), this, SLOT(slotItemChoosed(int))); +} + +void recoUiCallDial::exit() +{ + m_timer->stop(); + emit signalShowRecognizePage(); +} + diff --git a/Linguist/recoUi/recoUiCallDial.h b/Linguist/recoUi/recoUiCallDial.h new file mode 100644 index 0000000..992506e --- /dev/null +++ b/Linguist/recoUi/recoUiCallDial.h @@ -0,0 +1,79 @@ +#ifndef RECOUICALLDIAL_H +#define RECOUICALLDIAL_H + +#include "UiTools.h" +#include "UiConfig.h" + +class CenterMsgWidget; + +class recoUiCallDial : public WidgetWithBackstageInterface +{ + Q_OBJECT +public: + static const int DEV_CODE_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int NUM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int CALL_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const QString DIAL_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString CALL_BTN_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString CALL_BTN_DISABLE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int CALL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int CALL_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BACK_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int BACK_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int BACK_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString DEL_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DEL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DEL_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString NUM_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit recoUiCallDial(QWidget *parent = nullptr); + void reset(); + void setToolip(const QString &message, int millisecondTimeout); + void setPlatformConnected(bool connected); + +signals: + void signalShowRecognizePage(); + void signalCallBtnPressed(const QString&); + +public slots: + void slotBtnClicked(); + void slotBtnPressed(); + void slotBtnReleased(); + + void slotTimeout(); + void slotItemChoosed(int index); + void slotTextChanged(const QString& text); + + void slotCall(); + +protected: + void onTooltipTimeout(); + +private: + enum{ + NUM_BTNS_QTY = 10, + TIMEOUT = 30000, + CODE_LEN_MIN = 3, + CODE_LEN_MAX = 16, + }; + + QPushButton* m_btnBack; + QLineEdit* m_editDevCode; + QPushButton* m_btnsNum[NUM_BTNS_QTY]; + QPushButton* m_btnBackspace; + QPushButton* m_btnCall; + SearchBarCandidate* m_candidate = nullptr; + + CenterMsgWidget *m_tooltip = nullptr; + QTimer *m_tooltipTimer = nullptr; + + QTimer* m_timer; + + bool m_platformConnected = false; + std::vector m_devList; + + void showCandidate(const QVector& opns); + void exit(); +}; + +#endif // RECOUICALLDIAL_H diff --git a/Linguist/recoUi/recoUiHealthCode.cpp b/Linguist/recoUi/recoUiHealthCode.cpp new file mode 100644 index 0000000..7546310 --- /dev/null +++ b/Linguist/recoUi/recoUiHealthCode.cpp @@ -0,0 +1,1889 @@ +#include "recoUiHealthCode.h" +#include +#include +#include +#include + +#include "libcJSON.h" +#include "rw_zlog.h" +#include "common_utils.h" +#include "file_utils.h" +#include "ScopeGuard.h" + + +static const QColor green(31, 164, 38); //166 +static const QColor yellow(232, 105, 20); +static const QColor red(250, 59, 59); +static const QColor purple(128, 0, 128); + + +const int recoUiHealthCodePage::PIC_WIDGET_H_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {200, 200, 200, 201, 201}; + +#if 1 +recoUiHealthCodePage::recoUiHealthCodePage(int type, QWidget *parent) : QWidget(parent) +{ + qDebug() << "recoUiHealthCodePage()"; + + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + setAutoFillBackground(true); + + QPalette labelPal; + labelPal.setColor(QPalette::Background,QColor(0, 0, 0, 0)); + QFont ft; + + m_labelTitle = new QLabel(this); + m_labelTitle->setText(tr("健康码智能核验系统")); + labelPal.setColor(QPalette::WindowText, Qt::white); + m_labelTitle->setPalette(labelPal); + ft.setBold(true); + ft.setPointSize(12); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelTitle->setFont(ft); + + QPalette pal = palette(); + pal.setColor(QPalette::Background, QColor(255, 255, 255, 255)); + + RoundedWidget* healthMsg = new RoundedWidget(this); + healthMsg->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.9), + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.45)); + healthMsg->setAutoFillBackground(true); + healthMsg->setPalette(pal); + + m_labelTempTip = new QLabel(this); + m_labelTempTip->setText(tr("体温:")); + labelPal.setColor(QPalette::WindowText, Qt::black); + m_labelTempTip->setPalette(labelPal); + ft.setBold(true); + ft.setPointSize(14); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelTempTip->setFont(ft); + + m_labelTemp = new QLabel("36.5℃", healthMsg); + m_labelTemp->setPalette(labelPal); + m_labelTemp->setFont(ft); + + QLabel* labelCodePic = new QLabel(healthMsg); + //QLabel* labelCode = new QLabel(healthMsg); + //labelCode->setAutoFillBackground(true); + //labelCode->setAlignment(Qt::AlignCenter); + //labelCode->setFixedWidth(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.7)); + if(0 == type){ + labelCodePic->setPixmap(QPixmap(":/res/image/health_code_green_large.png").scaled(140, 140, Qt::KeepAspectRatio)); + //labelCode->setText(tr("绿码")); + //pal.setColor(QPalette::WindowText, green); + //pal.setColor(QPalette::Background, QColor(200, 247, 200, 100)); + }else if(1 == type){ + labelCodePic->setPixmap(QPixmap(":/res/image/health_code_yellow_large.png").scaled(140, 140, Qt::KeepAspectRatio)); + //labelCode->setText(tr("黄码")); + //pal.setColor(QPalette::WindowText, yellow); + //pal.setColor(QPalette::Background, QColor(232, 105, 20, 100)); + }else if(2 == type){ + labelCodePic->setPixmap(QPixmap(":/res/image/health_code_red_large.png").scaled(140, 140, Qt::KeepAspectRatio)); + //labelCode->setText(tr("红码")); + //pal.setColor(QPalette::WindowText, red); + //pal.setColor(QPalette::Background, QColor(218, 59, 59, 100)); + } + else if(3 == type){ + labelCodePic->setPixmap(QPixmap(":/res/image/health_code_grey_large.png").scaled(140, 140, Qt::KeepAspectRatio)); + //labelCode->setText(tr("红码")); + //pal.setColor(QPalette::WindowText, red); + //pal.setColor(QPalette::Background, QColor()); + } + //labelCode->setPalette(pal); + + QLabel* labelNameTip = new QLabel(healthMsg); + labelNameTip->setText(tr("姓名:")); + labelNameTip->setPalette(labelPal); + ft.setBold(false); + ft.setPointSize(8); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + labelNameTip->setFont(ft); + m_labelName = new QLabel("张**", healthMsg); + m_labelName->setPalette(labelPal); + m_labelName->setFont(ft); + + QLabel* labelIdNoTip = new QLabel(healthMsg); + labelIdNoTip->setText(tr("身份证:")); + labelIdNoTip->setPalette(labelPal); + ft.setBold(false); + ft.setPointSize(8); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + labelIdNoTip->setFont(ft); + m_labelIdNo = new QLabel("**************5934", healthMsg); + m_labelIdNo->setPalette(labelPal); + m_labelIdNo->setFont(ft); + + pal.setColor(QPalette::WindowText, Qt::white); + pal.setColor(QPalette::Background, QColor(245, 245, 245)); + const int MSG_WGT_WIDTH = static_cast(UiConfig::GetInstance()->getUiWidth() * 0.4); + const int MSG_WGT_HEIGHT = static_cast(UiConfig::GetInstance()->getUiWidth() * 0.2); + + m_covid19Testing = new RoundedWidget(healthMsg); + m_covid19Testing->setFixedSize(MSG_WGT_WIDTH, MSG_WGT_HEIGHT); + m_covid19Testing->setAutoFillBackground(true); + m_covid19Testing->setPalette(pal); + + m_labelC19T = new QLabel(m_covid19Testing); + m_labelC19T->setPixmap(QPixmap(":/res/image/c19t_white_large.png")); + + m_labelC19TTitle = new QLabel(m_covid19Testing); + m_labelC19TTitle->setText(tr("核酸检测")); + m_labelC19TTitle->setPalette(labelPal); + ft.setBold(false); + ft.setPointSize(8); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelC19TTitle->setFont(ft); + + m_stackC19T = new QStackedWidget(m_covid19Testing); + m_stackC19T->setFixedSize(static_cast(MSG_WGT_WIDTH * 0.8), static_cast(MSG_WGT_HEIGHT * 0.4)); + for(int i=0; i<3; i++){ + QWidget* wgt = new QWidget(m_stackC19T); + QLabel* time = new QLabel(QString::number((i + 1) * 24), wgt); + time->setPalette(pal); + ft.setPointSize(16); + time->setFont(ft); + QLabel* tip = new QLabel("小时\n阴性", wgt); + tip->setPalette(pal); + ft.setPointSize(6); + tip->setFont(ft); + QHBoxLayout* hb = new QHBoxLayout(); + hb->addStretch(); + hb->addWidget(time); + hb->addWidget(tip); + //hb->setSpacing(0); + hb->setMargin(0); + hb->addStretch(); + wgt->setLayout(hb); + m_stackC19T->addWidget(wgt); + } + ft.setBold(true); + ft.setPointSize(10); + QLabel* labelNegative = new QLabel("阴性", m_stackC19T); + labelNegative->setFont(ft); + labelNegative->setAlignment(Qt::AlignCenter); + m_stackC19T->addWidget(labelNegative); + QLabel* labelPositive = new QLabel("阳性", m_stackC19T); + labelPositive->setFont(ft); + labelPositive->setAlignment(Qt::AlignCenter); + m_stackC19T->addWidget(labelPositive); + + pal.setColor(QPalette::WindowText, Qt::black); + + QLabel* labelNodata = new QLabel("暂无数据", m_stackC19T); + labelNodata->setAlignment(Qt::AlignCenter); + labelNodata->setPalette(pal); + ft.setBold(true); + ft.setPointSize(10); + labelNodata->setFont(ft); + m_stackC19T->addWidget(labelNodata); + m_stackC19T->setCurrentIndex(5); //test......................................................... + + m_labelC19TTime = new QLabel("2022-04-01", m_covid19Testing); + m_labelC19TTime->setPalette(labelPal); + ft.setBold(false); + ft.setPointSize(6); + //ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelC19TTime->setFont(ft); + + RoundedWidget* antibodyTesting = new RoundedWidget(healthMsg); + antibodyTesting->setFixedSize(MSG_WGT_WIDTH, MSG_WGT_HEIGHT); + antibodyTesting->setAutoFillBackground(true); + antibodyTesting->setPalette(pal); + + QLabel* labelAbT = new QLabel(antibodyTesting); + labelAbT->setPixmap(QPixmap(":/res/image/abt_large.png")); + + m_labelABTTitle = new QLabel(antibodyTesting); + m_labelABTTitle->setText(tr("新冠疫苗")); + m_labelABTTitle->setPalette(labelPal); + m_labelABTTitle->setAlignment(Qt::AlignCenter); + ft.setBold(false); + ft.setPointSize(8); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelABTTitle->setFont(ft); + + m_labelABTRes = new QLabel("已接种第3针", antibodyTesting); + m_labelABTRes->setAlignment(Qt::AlignCenter); + m_labelABTRes->setFixedSize(static_cast(MSG_WGT_WIDTH * 0.8), static_cast(MSG_WGT_HEIGHT * 0.4)); + m_labelABTRes->setPalette(labelPal); + ft.setBold(true); + ft.setPointSize(10); + //ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelABTRes->setFont(ft); + + m_labelABTTime = new QLabel("2022-4-2 15:33:34", antibodyTesting); + m_labelABTTime->setPalette(labelPal); + m_labelABTTime->setAlignment(Qt::AlignCenter); + ft.setBold(false); + ft.setPointSize(6); + //ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelABTTime->setFont(ft); + + QHBoxLayout* hlayC19Title = new QHBoxLayout(); + hlayC19Title->addStretch(); + hlayC19Title->addWidget(m_labelC19T); + hlayC19Title->addWidget(m_labelC19TTitle); + hlayC19Title->addStretch(); + QHBoxLayout* hlayAbtTitle = new QHBoxLayout(); + hlayAbtTitle->addStretch(); + hlayAbtTitle->addWidget(labelAbT); + hlayAbtTitle->addWidget(m_labelABTTitle); + hlayAbtTitle->addStretch(); + QHBoxLayout* hlayTemp = new QHBoxLayout(); + hlayTemp->addStretch(); + hlayTemp->addWidget(m_labelTempTip); + hlayTemp->addWidget(m_labelTemp); + hlayTemp->addStretch(); + hlayTemp->setSpacing(0); + QHBoxLayout* hlayName = new QHBoxLayout(); + hlayName->addStretch(); + hlayName->addWidget(labelNameTip); + hlayName->addWidget(m_labelName); + hlayName->addStretch(); + QHBoxLayout* hlayIdNo = new QHBoxLayout(); + hlayIdNo->addStretch(); + hlayIdNo->addWidget(labelIdNoTip); + hlayIdNo->addWidget(m_labelIdNo); + hlayIdNo->addStretch(); + QVBoxLayout* vlayIdMsg = new QVBoxLayout(); + vlayIdMsg->addLayout(hlayName); + vlayIdMsg->addLayout(hlayIdNo); + + QVBoxLayout* vlayCovid19Testing = new QVBoxLayout(); + vlayCovid19Testing->addLayout(hlayC19Title); + //vlayCovid19Testing->addWidget(m_labelC19TTitle, 1, Qt::AlignCenter); + //vlayCovid19Testing->addWidget(m_labelC19TRes, 1, Qt::AlignCenter); + vlayCovid19Testing->addWidget(m_stackC19T, 1, Qt::AlignCenter); + vlayCovid19Testing->addWidget(m_labelC19TTime, 1, Qt::AlignCenter); + vlayCovid19Testing->setSpacing(0); + vlayCovid19Testing->setMargin(5); + m_covid19Testing->setLayout(vlayCovid19Testing); + + QVBoxLayout* vlayAntibodyTesting = new QVBoxLayout(); + vlayAntibodyTesting->addLayout(hlayAbtTitle); + //vlayAntibodyTesting->addWidget(m_labelABTTitle, 1, Qt::AlignCenter); + vlayAntibodyTesting->addWidget(m_labelABTRes, 1, Qt::AlignCenter); + vlayAntibodyTesting->addWidget(m_labelABTTime, 1, Qt::AlignCenter); + vlayAntibodyTesting->setSpacing(0); + vlayAntibodyTesting->setMargin(5); + antibodyTesting->setLayout(vlayAntibodyTesting); + + QHBoxLayout* hlayTesting = new QHBoxLayout(); + hlayTesting->addWidget(m_covid19Testing); + hlayTesting->addWidget(antibodyTesting); + hlayTesting->setSpacing(0); + + QVBoxLayout* vlayHealth = new QVBoxLayout(); + vlayHealth->addLayout(hlayTemp); + vlayHealth->addWidget(labelCodePic, 1, Qt::AlignCenter); + //vlayHealth->addWidget(labelCode, 1, Qt::AlignCenter); + vlayHealth->addLayout(vlayIdMsg); + vlayHealth->addLayout(hlayTesting); + healthMsg->setLayout(vlayHealth); + + +// trip msg + RoundedWidget* tripMsg = new RoundedWidget(this); + tripMsg->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.9), + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.2)); + pal.setColor(QPalette::Background, QColor(255, 255, 255, 255)); + tripMsg->setAutoFillBackground(true); + tripMsg->setPalette(pal); + + QLabel* m_labelTrip = new QLabel(tripMsg); + m_labelTrip->setPixmap(QPixmap(":/res/image/pass_large.png")); + + m_labelTripRes = new QLabel("近14天途经中高风险地区", tripMsg); + m_labelTripRes->setWordWrap(true); + m_labelTripRes->setAlignment(Qt::AlignCenter); + ft.setPointSize(10); + m_labelTripRes->setFont(ft); + m_labelTripResTime = new QLabel("2022-04-20 10:12:13", tripMsg); + ft.setPointSize(6); + m_labelTripResTime->setFont(ft); + m_labelTripResTime->hide(); + + QHBoxLayout* hlayTrip = new QHBoxLayout(); + hlayTrip->addWidget(m_labelTrip, 1); + hlayTrip->addWidget(m_labelTripRes, 9); + //hlayTrip->addStretch(); + tripMsg->setLayout(hlayTrip); + + +//access msg + RoundedWidget* accMsg = new RoundedWidget(this); + accMsg->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.9), + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.2)); + pal.setColor(QPalette::Background, QColor(255, 255, 255, 255)); + accMsg->setAutoFillBackground(true); + accMsg->setPalette(pal); + + m_labelAcc = new QLabel(accMsg); + m_labelAcc->setPixmap(QPixmap(":/res/image/pass_large.png")); + + m_labelAccRes = new QLabel("请通行", accMsg); + labelPal.setColor(QPalette::WindowText, Qt::white); + m_labelAccRes->setPalette(labelPal); + ft.setBold(true); + ft.setPointSize(16); + //ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelAccRes->setFont(ft); + + m_failReason = new QLabel(accMsg); + + m_labelFacePic = new QWidget(accMsg); + m_labelFacePic->setAutoFillBackground(true); + + QVBoxLayout* vlayAcc = new QVBoxLayout(); + vlayAcc->addWidget(m_labelAccRes, 99, Qt::AlignCenter); + vlayAcc->addWidget(m_failReason, 1, Qt::AlignCenter); + vlayAcc->setSpacing(5); + vlayAcc->setMargin(5); + + QHBoxLayout* hlayAccRes = new QHBoxLayout(); + hlayAccRes->addWidget(m_labelAcc, 1, Qt::AlignLeft); + hlayAccRes->addLayout(vlayAcc, 99); + //hlayAccRes->addStretch(); + hlayAccRes->addWidget(m_labelFacePic, 1, Qt::AlignRight); + hlayAccRes->setSpacing(5); + accMsg->setLayout(hlayAccRes); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(m_labelTitle, 1, Qt::AlignCenter | Qt::AlignTop); + //vlay->addWidget(m_labelCurTime, 1, Qt::AlignCenter | Qt::AlignTop);// + vlay->addWidget(healthMsg, 7, Qt::AlignCenter | Qt::AlignTop); + vlay->addStretch(); + vlay->addWidget(tripMsg, 1, Qt::AlignCenter | Qt::AlignBottom); + vlay->addWidget(accMsg, 1, Qt::AlignCenter | Qt::AlignBottom); + //vlay->setContentsMargins(0, 10, 0, (UiConfig::GetInstance()->getUiHeight() / 12) >> 1 << 1); + //vlay->setMargin(0); + setLayout(vlay); +} +#else +recoUiHealthCodePage::recoUiHealthCodePage(int type, QWidget *parent) : QWidget(parent) +{ + qDebug() << "recoUiHealthCodePage()"; + + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + setAutoFillBackground(true); + + QPalette labelPal; + labelPal.setColor(QPalette::Background,QColor(0, 0, 0, 0)); + + QFont ft; + //ft.setWeight(20);//Weight must be between 0 and 99 + + m_labelTitle = new QLabel(this); + m_labelTitle->setText(tr("健康码智能核验系统")); + m_labelTitle->setPalette(labelPal); + ft.setBold(true); + ft.setPointSize(12); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelTitle->setFont(ft); + +#if 0 + m_labelCurTime = new QLabel("2022-4-2 15:33:34", this); + m_labelCurTime->setPalette(labelPal); + ft.setBold(false); + ft.setPointSize(8); + m_labelCurTime->setFont(ft); +#endif + + QPalette pal = palette(); +#if 0 + if(0 == type){ + pal.setColor(QPalette::Background, green); + }else if(1 == type){ + pal.setColor(QPalette::Background, yellow); + }else if(2 == type){ + pal.setColor(QPalette::Background, red); + } + setPalette(pal); +#endif + pal.setColor(QPalette::Background, QColor(255, 255, 255, 255)); + + RoundedWidget* healthMsg = new RoundedWidget(this); + healthMsg->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.9), + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.65)); + healthMsg->setAutoFillBackground(true); + healthMsg->setPalette(pal); + + m_labelTempTip = new QLabel(this); + m_labelTempTip->setText(tr("体温:")); + m_labelTempTip->setPalette(labelPal); + ft.setBold(true); + ft.setPointSize(14); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelTempTip->setFont(ft); + + m_labelTemp = new QLabel("36.5℃", healthMsg); + m_labelTemp->setPalette(labelPal); + m_labelTemp->setFont(ft); + + QLabel* labelCodePic = new QLabel(healthMsg); + QLabel* labelCode = new QLabel(healthMsg); + labelCode->setAutoFillBackground(true); + labelCode->setAlignment(Qt::AlignCenter); + labelCode->setFixedWidth(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.7)); + if(0 == type){ + labelCodePic->setPixmap(QPixmap(":/res/image/health_code_green_large.png")); + labelCode->setText(tr("绿码")); + pal.setColor(QPalette::WindowText, green); + QColor bg(green); + pal.setColor(QPalette::Background, QColor(200, 247, 200, 100)); + }else if(1 == type){ + labelCodePic->setPixmap(QPixmap(":/res/image/health_code_yellow_large.png")); + labelCode->setText(tr("黄码")); + pal.setColor(QPalette::WindowText, yellow); + pal.setColor(QPalette::Background, QColor(232, 105, 20, 100)); + }else if(2 == type){ + labelCodePic->setPixmap(QPixmap(":/res/image/health_code_red_large.png")); + labelCode->setText(tr("红码")); + pal.setColor(QPalette::WindowText, red); + pal.setColor(QPalette::Background, QColor(218, 59, 59, 100)); + } + labelCode->setPalette(pal); + + QLabel* labelNameTip = new QLabel(healthMsg); + labelNameTip->setText(tr("姓名:")); + labelNameTip->setPalette(labelPal); + ft.setBold(false); + ft.setPointSize(8); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + labelNameTip->setFont(ft); + m_labelName = new QLabel("张**", healthMsg); + m_labelName->setPalette(labelPal); + m_labelName->setFont(ft); + + QLabel* labelIdNoTip = new QLabel(healthMsg); + labelIdNoTip->setText(tr("身份证:")); + labelIdNoTip->setPalette(labelPal); + ft.setBold(false); + ft.setPointSize(8); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + labelIdNoTip->setFont(ft); + m_labelIdNo = new QLabel("**************5934", healthMsg); + m_labelIdNo->setPalette(labelPal); + m_labelIdNo->setFont(ft); + + + pal.setColor(QPalette::WindowText, Qt::white); + pal.setColor(QPalette::Background, QColor(245, 245, 245)); + const int MSG_WGT_WIDTH = static_cast(UiConfig::GetInstance()->getUiWidth() * 0.4); + const int MSG_WGT_HEIGHT = static_cast(UiConfig::GetInstance()->getUiWidth() * 0.25); + + m_covid19Testing = new RoundedWidget(healthMsg); + m_covid19Testing->setFixedSize(MSG_WGT_WIDTH, MSG_WGT_HEIGHT); + m_covid19Testing->setAutoFillBackground(true); + m_covid19Testing->setPalette(pal); + + m_labelC19TTitle = new QLabel(m_covid19Testing); + m_labelC19TTitle->setText(tr("核酸检测")); + m_labelC19TTitle->setPalette(labelPal); + ft.setBold(false); + ft.setPointSize(8); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelC19TTitle->setFont(ft); + + #if 0 + m_labelC19TRes = new QLabel("24小时阴性", m_covid19Testing); + m_labelC19TRes->setPalette(labelPal); + ft.setBold(true); + ft.setPointSize(8); + //ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelC19TRes->setFont(ft); + #endif + + m_stackC19T = new QStackedWidget(m_covid19Testing); + m_stackC19T->setFixedSize(static_cast(MSG_WGT_WIDTH * 0.8), static_cast(MSG_WGT_HEIGHT * 0.4)); + for(int i=0; i<3; i++){ + QWidget* wgt = new QWidget(m_stackC19T); + QLabel* time = new QLabel(QString::number((i + 1) * 24), wgt); + time->setPalette(pal); + ft.setPointSize(16); + time->setFont(ft); + QLabel* tip = new QLabel("小时\n阴性", wgt); + tip->setPalette(pal); + ft.setPointSize(6); + tip->setFont(ft); + QHBoxLayout* hb = new QHBoxLayout(); + hb->addStretch(); + hb->addWidget(time); + hb->addWidget(tip); + //hb->setSpacing(0); + hb->setMargin(0); + hb->addStretch(); + wgt->setLayout(hb); + m_stackC19T->addWidget(wgt); + } + ft.setBold(true); + ft.setPointSize(10); + QLabel* labelNegative = new QLabel("阴性", m_stackC19T); + labelNegative->setFont(ft); + labelNegative->setAlignment(Qt::AlignCenter); + m_stackC19T->addWidget(labelNegative); + QLabel* labelPositive = new QLabel("阳性", m_stackC19T); + labelPositive->setFont(ft); + labelPositive->setAlignment(Qt::AlignCenter); + m_stackC19T->addWidget(labelPositive); + + pal.setColor(QPalette::WindowText, Qt::black); + + QLabel* labelNodata = new QLabel("暂无数据", m_stackC19T); + labelNodata->setAlignment(Qt::AlignCenter); + labelNodata->setPalette(pal); + ft.setBold(true); + ft.setPointSize(10); + labelNodata->setFont(ft); + m_stackC19T->addWidget(labelNodata); + m_stackC19T->setCurrentIndex(5); //test......................................................... + + m_labelC19TTime = new QLabel("2022-04-01", m_covid19Testing); + m_labelC19TTime->setPalette(labelPal); + ft.setBold(false); + ft.setPointSize(6); + //ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelC19TTime->setFont(ft); + + RoundedWidget* antibodyTesting = new RoundedWidget(healthMsg); + antibodyTesting->setFixedSize(MSG_WGT_WIDTH, MSG_WGT_HEIGHT); + antibodyTesting->setAutoFillBackground(true); + antibodyTesting->setPalette(pal); + + m_labelABTTitle = new QLabel(antibodyTesting); + m_labelABTTitle->setText(tr("新冠疫苗")); + m_labelABTTitle->setPalette(labelPal); + m_labelABTTitle->setAlignment(Qt::AlignCenter); + ft.setBold(false); + ft.setPointSize(8); + //ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelABTTitle->setFont(ft); + + m_labelABTRes = new QLabel("已接种第3针", antibodyTesting); + m_labelABTRes->setAlignment(Qt::AlignCenter); + m_labelABTRes->setFixedSize(static_cast(MSG_WGT_WIDTH * 0.8), static_cast(MSG_WGT_HEIGHT * 0.4)); + m_labelABTRes->setPalette(labelPal); + ft.setBold(true); + ft.setPointSize(10); + //ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelABTRes->setFont(ft); + + m_labelABTTime = new QLabel("2022-4-2 15:33:34", antibodyTesting); + m_labelABTTime->setPalette(labelPal); + m_labelABTTime->setAlignment(Qt::AlignCenter); + ft.setBold(false); + ft.setPointSize(6); + //ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelABTTime->setFont(ft); + + + m_labelAccRes = new QLabel("请通行", this); + labelPal.setColor(QPalette::WindowText, Qt::white); + m_labelAccRes->setPalette(labelPal); + ft.setBold(true); + ft.setPointSize(16); + //ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelAccRes->setFont(ft); + + + QHBoxLayout* hlayTemp = new QHBoxLayout(); + hlayTemp->addStretch(); + hlayTemp->addWidget(m_labelTempTip); + hlayTemp->addWidget(m_labelTemp); + hlayTemp->addStretch(); + hlayTemp->setSpacing(0); + QHBoxLayout* hlayName = new QHBoxLayout(); + hlayName->addStretch(); + hlayName->addWidget(labelNameTip); + hlayName->addWidget(m_labelName); + hlayName->addStretch(); + QHBoxLayout* hlayIdNo = new QHBoxLayout(); + hlayIdNo->addStretch(); + hlayIdNo->addWidget(labelIdNoTip); + hlayIdNo->addWidget(m_labelIdNo); + hlayIdNo->addStretch(); + QVBoxLayout* vlayIdMsg = new QVBoxLayout(); + vlayIdMsg->addLayout(hlayName); + vlayIdMsg->addLayout(hlayIdNo); + + QVBoxLayout* vlayCovid19Testing = new QVBoxLayout(); + vlayCovid19Testing->addWidget(m_labelC19TTitle, 1, Qt::AlignCenter); + //vlayCovid19Testing->addWidget(m_labelC19TRes, 1, Qt::AlignCenter); + vlayCovid19Testing->addWidget(m_stackC19T, 1, Qt::AlignCenter); + vlayCovid19Testing->addWidget(m_labelC19TTime, 1, Qt::AlignCenter); + vlayCovid19Testing->setSpacing(0); + m_covid19Testing->setLayout(vlayCovid19Testing); + + QVBoxLayout* vlayAntibodyTesting = new QVBoxLayout(); + vlayAntibodyTesting->addWidget(m_labelABTTitle, 1, Qt::AlignCenter); + vlayAntibodyTesting->addWidget(m_labelABTRes, 1, Qt::AlignCenter); + vlayAntibodyTesting->addWidget(m_labelABTTime, 1, Qt::AlignCenter); + vlayAntibodyTesting->setSpacing(0); + antibodyTesting->setLayout(vlayAntibodyTesting); + + QHBoxLayout* hlayTesting = new QHBoxLayout(); + hlayTesting->addWidget(m_covid19Testing); + hlayTesting->addWidget(antibodyTesting); + hlayTesting->setSpacing(0); + + QVBoxLayout* vlayHealth = new QVBoxLayout(); + vlayHealth->addLayout(hlayTemp); + vlayHealth->addWidget(labelCodePic, 1, Qt::AlignCenter); + vlayHealth->addLayout(vlayIdMsg); + vlayHealth->addWidget(labelCode, 1, Qt::AlignCenter); + vlayHealth->addLayout(hlayTesting); + healthMsg->setLayout(vlayHealth); + + +// acc msg + RoundedWidget* accMsg = new RoundedWidget(this); + accMsg->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.9), + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.2)); + pal.setColor(QPalette::Background, QColor(255, 255, 255, 255)); + accMsg->setAutoFillBackground(true); + accMsg->setPalette(pal); + + m_labelAcc = new QLabel(accMsg); + if(0 == type){ + m_labelAcc->setPixmap(QPixmap(":/res/image/pass_large.png")); + }else{ + m_labelAcc->setPixmap(QPixmap(":/res/image/no_entry_large.png")); + } + + m_labelTripRes = new QLabel("近14天途经中高风险地区", accMsg); + m_labelTripRes->setWordWrap(true); + m_labelTripRes->setAlignment(Qt::AlignCenter); + ft.setPointSize(10); + m_labelTripRes->setFont(ft); + m_labelTripResTime = new QLabel("2022-04-20 10:12:13", accMsg); + ft.setPointSize(6); + m_labelTripResTime->setFont(ft); + m_labelTripResTime->hide(); + + m_labelFacePic = new QWidget(accMsg); + m_labelFacePic->setAutoFillBackground(true); + + QHBoxLayout* hlayAccRes = new QHBoxLayout(); + hlayAccRes->addStretch(); + hlayAccRes->addWidget(m_labelAcc); + hlayAccRes->addWidget(m_labelAccRes); + hlayAccRes->addStretch(); + hlayAccRes->setSpacing(5); + + QVBoxLayout* vlayTrip = new QVBoxLayout(); + //vlayTrip->addWidget(m_labelAccRes, 1, Qt::AlignCenter); + vlayTrip->addLayout(hlayAccRes); + vlayTrip->addWidget(m_labelTripRes, 99, Qt::AlignCenter); + vlayTrip->addWidget(m_labelTripResTime, 1, Qt::AlignCenter); + vlayTrip->setSpacing(5); + vlayTrip->setMargin(5); + QHBoxLayout* hlayAcc = new QHBoxLayout(); + //hlayAcc->addWidget(m_labelAcc); + hlayAcc->addLayout(vlayTrip); + hlayAcc->addWidget(m_labelFacePic); + hlayAcc->setSpacing(5); + hlayAcc->setMargin(5); + accMsg->setLayout(hlayAcc); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(m_labelTitle, 1, Qt::AlignCenter | Qt::AlignTop); + //vlay->addWidget(m_labelCurTime, 1, Qt::AlignCenter | Qt::AlignTop);// + vlay->addWidget(healthMsg, 6, Qt::AlignCenter | Qt::AlignTop); + vlay->addStretch(); + vlay->addWidget(accMsg, 1, Qt::AlignCenter | Qt::AlignBottom); + //vlay->setContentsMargins(0, 10, 0, (UiConfig::GetInstance()->getUiHeight() / 12) >> 1 << 1); + //vlay->setMargin(0); + setLayout(vlay); +} +#endif + +void recoUiHealthCodePage::showTemp(float temp) +{ + if(temp > 2.0f){ + QString strTemp; + strTemp.setNum(temp, 'f', 1); + strTemp += "℃"; + m_labelTemp->setText(strTemp); + m_labelTemp->show(); + m_labelTempTip->show(); + }else{ + m_labelTempTip->hide(); + m_labelTemp->hide(); + } +} + +void recoUiHealthCodePage::showPersonMsg(const QString& name, const QString& idNum, const unsigned char* jpgDate, int len) +{ + m_labelName->setText(name.contains("*") ? name : QString(utils::hideStrMidSeg(name.toStdString()).c_str())); + m_labelIdNo->setText(idNum.contains("*") ? idNum : idNum.left(4) + QString(idNum.size() - 8, QChar('*')) + idNum.right(4)); + //m_labelCurTime->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")); + + if(jpgDate == nullptr || len <= 0){ + qDebug() << "face img data error"; + m_labelFacePic->hide(); + return; + } + QImage faceImg; + faceImg.loadFromData(jpgDate, len, "JPG"); + if(faceImg.isNull()){ + qDebug() << "load face img failed!"; + return; + } + + QPalette pal(m_labelFacePic->palette()); + QImage img(ScaleImage(faceImg, + QSize(PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()], + PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_labelFacePic->setFixedSize(img.width(), img.height()); + pal.setBrush(QPalette::Background, QBrush(img)); + m_labelFacePic->setPalette(pal); + m_labelFacePic->show(); +} + +void recoUiHealthCodePage::showAntibodyTestingMsg(int num, const QString& testingTime) +{ + QPalette pal(m_labelABTRes->palette()); + if(num > 0){ + m_labelABTRes->setText(QString("已接种第%1针").arg(num)); + pal.setColor(QPalette::WindowText, green); + m_labelABTTime->setText(testingTime); + m_labelABTTime->show(); + }else{ + m_labelABTRes->setText(tr("暂无数据")); + pal.setColor(QPalette::WindowText, Qt::black); + m_labelABTTime->hide(); + } + m_labelABTRes->setPalette(pal); +} + +void recoUiHealthCodePage::showCovid19TestingMsg(int res, const QString& testingTime) +{ + QPalette palTitle(m_labelC19TTitle->palette()); + QPalette pal(m_covid19Testing->palette()); + if(res > 0){ + if(1 == res){ + qint64 interval = QDateTime::fromString(testingTime, "yyyy-MM-dd hh:mm:ss").secsTo(QDateTime::currentDateTime()); + + if(interval <= 24 * 3600){m_stackC19T->setCurrentIndex(0);pal.setColor(QPalette::Background, QColor(6, 118, 244));} + else if(interval <= 48 * 3600){m_stackC19T->setCurrentIndex(1);pal.setColor(QPalette::Background, QColor(131, 107, 231));} + else if(interval <= 72 * 3600){m_stackC19T->setCurrentIndex(2);pal.setColor(QPalette::Background, QColor(47, 191, 186));} + else{m_stackC19T->setCurrentIndex(3);pal.setColor(QPalette::Background, QColor(47, 191, 186));} + }else{ + m_stackC19T->setCurrentIndex(4); //阳性 + pal.setColor(QPalette::Background, QColor(218, 59, 59)); + } + m_labelC19TTime->setText(testingTime); + m_labelC19TTime->show(); + palTitle.setColor(QPalette::WindowText, Qt::white); + m_labelC19T->setPixmap(QPixmap(":/res/image/c19t_white_large.png")); + }else{ + m_stackC19T->setCurrentIndex(5); + m_labelC19TTime->hide(); + pal.setColor(QPalette::Background, QColor(245, 245, 245)); + palTitle.setColor(QPalette::WindowText, Qt::black); + m_labelC19T->setPixmap(QPixmap(":/res/image/c19t_grey_large.png")); + } + m_covid19Testing->setPalette(pal); + m_labelC19TTitle->setPalette(palTitle); +} + +void recoUiHealthCodePage::showAntiGenTestingMsg(int res, const QString& testingTime) +{ + QPalette pal(m_labelABTRes->palette()); + if(res > 0){ + if(1 == res){ + m_labelABTRes->setText("阴性"); + pal.setColor(QPalette::WindowText, green); + }else if(2 == res){ + m_labelABTRes->setText("阳性"); + pal.setColor(QPalette::WindowText, red); + } + m_labelABTTime->setText(testingTime); + m_labelABTTime->show(); + }else{ + m_labelABTRes->setText(tr("暂无数据")); + pal.setColor(QPalette::WindowText, Qt::black); + m_labelABTTime->hide(); + } + m_labelABTRes->setPalette(pal); +} + + +void recoUiHealthCodePage::showTripMsg(int res, const QString& tripCity) +{ + QPalette pal(m_labelTripRes->palette()); + if(tripCity.isEmpty()){ + if(res > 0){ + m_labelTripRes->setText(1 == res ? "近7日未途经中高风险地区" : "近7日途经中高风险地区"); + pal.setColor(QPalette::WindowText, 1 == res ? green : red); + }else{ + m_labelTripRes->setText("7天内经过: "); + pal.setColor(QPalette::WindowText, Qt::black); + } + m_labelTripRes->setPalette(pal); + }else{ + do{ + cJSON *root = cJSON_Parse(tripCity.toStdString().c_str()); + if(!root){m_labelTripRes->setText("行程数据异常");break;} + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + cJSON* jsonTmp = cJSON_GetObjectItem(root, "code"); + if(!jsonTmp){m_labelTripRes->setText("行程数据异常");break;} + if(jsonTmp->valueint != 0){break;} + jsonTmp = cJSON_GetObjectItem(root, "data"); + if(!jsonTmp){m_labelTripRes->setText("行程数据异常");break;} + cJSON* item = cJSON_GetObjectItem(jsonTmp, "riskLevel"); + if(!item){m_labelTripRes->setText("行程数据异常");break;} + if(6 == item->valueint){ + item = cJSON_GetObjectItem(jsonTmp, "status"); + if(!item){m_labelTripRes->setText("行程数据异常");break;} + if(0 == item->valueint){m_labelTripRes->setText("行程卡识别失败,请重试");} + pal.setColor(QPalette::WindowText, Qt::black); + m_labelTripRes->setPalette(pal); + break; + }else if(1 == item->valueint || 2 == item->valueint){ //低风险、无风险 + m_labelTripRes->setText("近7日未途经中高风险地区"); + pal.setColor(QPalette::WindowText, Qt::green); + m_labelTripRes->setPalette(pal); + break; + } + + QString showRes; + item = cJSON_GetObjectItem(jsonTmp, "keyAreas"); + if(item){ + int cnt = cJSON_GetArraySize(item); + LOGI("array size:%d", cnt); + QString citys; + for(int i=0; ivaluestring;} + } + if(cnt){ + showRes += QString("%1").arg("近7日途经重点风险地区
"); + showRes += QString("%1").arg(citys); + } + } + + item = cJSON_GetObjectItem(jsonTmp, "highRiskAreas"); + if(item){ + int cnt = cJSON_GetArraySize(item); + LOGI("array size:%d", cnt); + QString citys; + for(int i=0; ivaluestring;} + } + if(cnt){ + if(showRes.isEmpty()){showRes += QString("%1").arg("近7日途经高风险地区
");} + else{showRes += ",";} + showRes += QString("%1").arg(citys); + } + } + + item = cJSON_GetObjectItem(jsonTmp, "middleRiskAreas"); + if(item){ + int cnt = cJSON_GetArraySize(item); + LOGI("array size:%d", cnt); + QString citys; + for(int i=0; ivaluestring;} + } + if(cnt){ + if(showRes.isEmpty()){showRes += QString("%1").arg("近7日途经中风险地区
");} + else{showRes += ",";} + showRes += QString("%1").arg(citys); + } + } + m_labelTripRes->setText(showRes); + }while(0); + } +} + +void recoUiHealthCodePage::showAccResult(bool pass, const QString& failReason, int bgColor) +{ + m_labelAccRes->setText(pass ? tr("请通行") : tr("禁止通行")); + QPalette pal(m_labelAccRes->palette()); + pal.setColor(QPalette::WindowText, pass ? green : red); + m_labelAccRes->setPalette(pal); + m_labelAcc->setPixmap(pass ? QPixmap(":/res/image/ok_large.png") : QPixmap(":/res/image/fail2_large.png")); + m_failReason->setText(failReason); + + if(bgColor >= 0 && bgColor <= 3){ + QPalette pal2 = palette(); + const QColor colors[] = {green, yellow, red, purple}; + pal2.setColor(QPalette::Background, colors[bgColor]); + setPalette(pal2); + } +} + +void recoUiHealthCodePage::setResultShowType(int type) +{ + switch(type){ + case 1: + m_labelTitle->setText(tr("CA数字哨兵")); + m_labelABTTitle->setText(tr("抗原检测")); + break; + case 2: + m_labelTitle->setText(tr("智能防疫核验系统")); + break; + default: + break; + } +} + +#if 0 +void recoUiHealthCodePage::setBgColorByResult(int codeColor, int c19t, int trip, bool pass) +{ + QColor color{green}; + if(c19t == 2 || trip == 3){//核酸阳性、到过重点地区 + color = purple; + }else if(trip == 4){//行程卡核验失败 + color = yellow; + }else if(!pass){ + color = red; + } + + QPalette pal = palette(); + pal.setColor(QPalette::Background, color); + setPalette(pal); +} +#endif + +recoUiHealthCode::recoUiHealthCode(QWidget *parent) : WidgetWithBackstageInterface(parent) +{ + qDebug() << "recoUiHealthCode()"; + + m_stackPages = new QStackedWidget(this); + + m_pageGreen = new recoUiHealthCodePage(0, this); + m_stackPages->addWidget(m_pageGreen); + m_pageYellow = new recoUiHealthCodePage(1, this); + m_stackPages->addWidget(m_pageYellow); + m_pageRed = new recoUiHealthCodePage(2, this); + m_stackPages->addWidget(m_pageRed); + m_pageGrey = new recoUiHealthCodePage(3, this); + m_stackPages->addWidget(m_pageGrey); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(m_stackPages); + vlay->setMargin(0); + setLayout(vlay); +} + +void recoUiHealthCode::showHealthMsg(int type, float temp, const QString& msg, bool pass, + const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + LOGI("_x_watch_point_, showHealthMsg type %d, msg %s", type, msg.toStdString().c_str()); + //m_backstageIf->stopIdentyState();//需要外设输入如身份证终止展示 + switch(type){ + case 0:_showType0HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 1:_showType1HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 2:_showType2HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 3:_showType3HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 4:_showType4HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 5:_showType5HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 6:_showType6HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 7:_showType7HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 8:_showType8HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 9:_showType9HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + case 101:_showType101HealthData(temp, msg, pass, jpgDate, jpgLen, tripCity, failReason, bgColor);break; + default:LOGE("unknow health data type:%d", type); + } +} + +void recoUiHealthCode::setResultShowType(int type) +{ + m_pageGreen->setResultShowType(type); + m_pageYellow->setResultShowType(type); + m_pageRed->setResultShowType(type); + m_pageGrey->setResultShowType(type); +} + +void recoUiHealthCode::_showType0HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + QJsonParseError jsonError; + const QJsonDocument cfgDoc = QJsonDocument::fromJson(QByteArray(msg.toStdString().c_str()), &jsonError); + if (cfgDoc.isNull() || (jsonError.error != QJsonParseError::NoError)) { + qDebug() << "json data error:" << jsonError.error; + return; + } + const QJsonObject obj = cfgDoc.object(); + if (!obj.contains("data")){ + return; + } + + const QJsonObject& resObj = obj.value("data").toObject(); + + recoUiHealthCodePage* page = m_pageGreen; + int pageIndex = 0; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + const QString& colorCode = resObj.value("jkmStatus").toString(); + if(colorCode == "yellow"){page = m_pageYellow;pageIndex = 1;} + else if(colorCode == "red"){page = m_pageRed;pageIndex = 2;} + + name = resObj.value("idCardName").toString(), + idNum = resObj.value("idCardNo").toString(); + if(resObj.contains("hsjcSearchStatus") && 1 == resObj.value("hsjcSearchStatus").toInt()){ + c19tRes = resObj.value("hsjcStatus").toString() == "阴性" ? 1 : 2; + c19tTime = resObj.value("hsjcQuestTime").toString(); + } + if(resObj.contains("ymjzSearchStatus") && 1 == resObj.value("ymjzSearchStatus").toInt()){ + abtRes = resObj.value("ymjzStatus").toInt(); + abtTime = resObj.value("ymjzQuestTime").toString(); + } + if(resObj.contains("xcmSearchStatus") && 1 == resObj.value("xcmSearchStatus").toInt()){ + tripRes = ("1" == resObj.value("xcmStatus").toString() ? 1 : 2);//行程码返回数据为字符串 + } + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType1HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGrey; + int pageIndex = 3; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + int cnt = cJSON_GetArraySize(root); + qDebug() << "cnt:" << cnt; + for(int i=0; ivaluestring}; + if(!c19t.isEmpty()){c19tRes = (c19t == "阴性" ? 1 : 2);} + } + jsTmp = cJSON_GetObjectItem(hsRes, "jc_rq");// 检测时间 + if(jsTmp){c19tTime = jsTmp->valuestring;} + } + continue; + } + cJSON * ykmRes = cJSON_GetObjectItem(arrayItem, "ykm_result"); + if(ykmRes){ + ykmRes = cJSON_GetObjectItem(ykmRes, "data"); + if(ykmRes){ykmRes = cJSON_GetObjectItem(ykmRes, "data");} + if(ykmRes){ykmRes = cJSON_GetArrayItem(ykmRes, 0);} + if(ykmRes){ykmRes = cJSON_GetObjectItem(ykmRes, "JKMYS");} + if(ykmRes){ + if(QString(ykmRes->valuestring) == "绿"){page = m_pageGreen;pageIndex = 0;} + else if(QString(ykmRes->valuestring) == "黄"){page = m_pageYellow;pageIndex = 1;} + else if(QString(ykmRes->valuestring) == "红"){page = m_pageRed;pageIndex = 2;} + } + continue; + } + cJSON * idMsg = cJSON_GetObjectItem(arrayItem, "sqfydsry_result"); + if(idMsg){ + cJSON * jsTmp = cJSON_GetObjectItem(idMsg, "identityNum"); + if(jsTmp){idNum = jsTmp->valuestring;} + jsTmp = cJSON_GetObjectItem(idMsg, "name"); + if(jsTmp){name = jsTmp->valuestring;} + continue; + } + cJSON * ymRes = cJSON_GetObjectItem(arrayItem, "ym_result"); + if(ymRes){ + ymRes = cJSON_GetObjectItem(ymRes, "data"); + if(ymRes){ymRes = cJSON_GetObjectItem(ymRes, "data");} + if(ymRes){ + int needleTimes = cJSON_GetArraySize(ymRes); + qDebug() << "needleTimes" << needleTimes; + QString nt{"0"}; + for(int j=0; jvaluestring) > nt){ + nt = jsTmp->valuestring; + jsTmp = cJSON_GetObjectItem(jsArrayItem, "inoculationdate"); + if(jsTmp){abtTime = jsTmp->valuestring;} + } + } + } + } + abtRes = nt.toInt(); + } + continue; + } + } + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType2HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGreen; + int pageIndex = 0; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + cJSON* jsonTmp = cJSON_GetObjectItem(root, "retCode"); + if(!jsonTmp){return;} + if(0 != jsonTmp->valueint){return;} + + jsonTmp = cJSON_GetObjectItem(root, "idCard"); + if(jsonTmp){idNum = jsonTmp->valuestring;} + jsonTmp = cJSON_GetObjectItem(root, "name"); + if(jsonTmp){name = jsonTmp->valuestring;} + + jsonTmp = cJSON_GetObjectItem(root, "healthStatus"); + if(jsonTmp){ + const std::string status{jsonTmp->valuestring}; + if(status == "中风险"){page = m_pageYellow;pageIndex = 1;} + else if(status == "高风险"){page = m_pageRed;pageIndex = 2;} + } + + jsonTmp = cJSON_GetObjectItem(root, "covid19Testing"); + if(jsonTmp){ + cJSON * jsTmp = cJSON_GetObjectItem(jsonTmp, "result"); + if(jsTmp){ + const QString c19t{jsTmp->valuestring}; + if(!c19t.isEmpty()){c19tRes = (c19t == "阴性" ? 1 : 2);} + } + jsTmp = cJSON_GetObjectItem(jsonTmp, "testingTime"); + if(jsTmp){c19tTime = jsTmp->valuestring;} + } + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType3HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGreen; + int pageIndex = 0; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + //TODO + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType4HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGreen; + int pageIndex = 0; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + cJSON* jsonTmp = cJSON_GetObjectItem(root, "health"); + if(jsonTmp){ + cJSON* jsTmp = cJSON_GetObjectItem(jsonTmp, "color"); + if(jsTmp){ + std::string colorCode{jsTmp->valuestring}; + if("yellow" == colorCode){page = m_pageYellow;pageIndex = 1;} + else if("red" == colorCode){page = m_pageRed;pageIndex = 2;} + } + } + + jsonTmp = cJSON_GetObjectItem(root, "nucleicAcid"); + if(jsonTmp){ + cJSON * jsTmp = cJSON_GetObjectItem(jsonTmp, "colorText"); + if(jsTmp){ + std::string c19t{jsTmp->valuestring}; + if("阴性" == c19t){c19tRes = 1;} + else if("阳性" == c19t){c19tRes = 2;} + } + jsTmp = cJSON_GetObjectItem(jsonTmp, "datetime"); + if(jsTmp){c19tTime = jsTmp->valuestring;} + } + + jsonTmp = cJSON_GetObjectItem(root, "vaccine"); + if(jsonTmp){ + cJSON * jsTmp = cJSON_GetObjectItem(jsonTmp, "count"); + if(jsTmp){abtRes = jsTmp->valueint;} + jsTmp = cJSON_GetObjectItem(jsonTmp, "date"); + if(jsTmp){abtTime = jsTmp->valuestring;} + } + + jsonTmp = cJSON_GetObjectItem(root, "user"); + if(jsonTmp){ + cJSON * jsTmp = cJSON_GetObjectItem(jsonTmp, "name"); + if(jsTmp){name = jsTmp->valuestring;} + jsTmp = cJSON_GetObjectItem(jsonTmp, "idNo"); + if(jsTmp){idNum = jsTmp->valuestring;} + } + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType5HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + if(m_resultType != 1){ + m_resultType = 1; + setResultShowType(m_resultType); + } + + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGrey; + int pageIndex = 3; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + cJSON* jsonTmp = cJSON_GetObjectItem(root, "code"); + if(!jsonTmp){return;} + if(0 != jsonTmp->valueint){return;} + + jsonTmp = cJSON_GetObjectItem(root, "result"); + if(!jsonTmp){return;} + + cJSON* item = cJSON_GetObjectItem(jsonTmp, "name"); + if(item){name = item->valuestring;} + item = cJSON_GetObjectItem(jsonTmp, "paper_no"); + if(item){idNum = item->valuestring;} + + item = cJSON_GetObjectItem(jsonTmp, "health_code"); + if(item){ + std::string colorCode{item->valuestring}; + if("00" == colorCode){page = m_pageGreen;pageIndex = 0;} + else if("01" == colorCode){page = m_pageYellow;pageIndex = 1;} + else if("10" == colorCode){page = m_pageRed;pageIndex = 2;} + } + + item = cJSON_GetObjectItem(jsonTmp, "nucleic_info"); + int cnt = cJSON_GetArraySize(item); + LOGI("array size:%d", cnt); + //for(int i=0; ivaluestring}; + if(c19t.find("阴性") != std::string::npos){c19tRes = 1;} + else if(c19t.find("阳性") != std::string::npos){c19tRes = 2;} + } + jsTmp = cJSON_GetObjectItem(arrayItem, "nat_time");// 检测时间 + if(jsTmp){c19tTime = jsTmp->valuestring;} + } +#if 0 + item = cJSON_GetObjectItem(jsonTmp, "vaccine_info"); + if(item){ + cJSON * jsTmp = cJSON_GetObjectItem(item, "count"); + if(jsTmp){abtRes = jsTmp->valueint;} + jsTmp = cJSON_GetObjectItem(item, "last_vac_time"); + if(jsTmp){abtTime = jsTmp->valuestring;} + } +#else + item = cJSON_GetObjectItem(jsonTmp, "antigen_info"); + if(item){ + cJSON * jsTmp = cJSON_GetObjectItem(item, "antigen_code"); + if(jsTmp){ + std::string antiGen{jsTmp->valuestring}; + if(antiGen == "-1"){abtRes = 1;} + else if(antiGen == "1"){abtRes = 2;} + } + jsTmp = cJSON_GetObjectItem(item, "report_time"); + if(jsTmp){abtTime = jsTmp->valuestring;} + } +#endif + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + //page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showAntiGenTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showTypexHealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGreen; + int pageIndex = 0; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + cJSON* jsonTmp = cJSON_GetObjectItem(root, "code"); + if(!jsonTmp){return;} + if(std::string(jsonTmp->valuestring) != "0000"){return;} + + jsonTmp = cJSON_GetObjectItem(root, "data"); + if(!jsonTmp){return;} + + cJSON* item = cJSON_GetObjectItem(jsonTmp, "queryStatus"); + if(!item){return;} + if(std::string(jsonTmp->valuestring) != "0"){return;} + + item = cJSON_GetObjectItem(jsonTmp, "name"); + if(item){name = item->valuestring;} + item = cJSON_GetObjectItem(jsonTmp, "idcardNo"); + if(item){idNum = item->valuestring;} + + item = cJSON_GetObjectItem(jsonTmp, "level"); + if(item){ + std::string colorCode{item->valuestring}; + if("YELLOW" == colorCode){page = m_pageYellow;pageIndex = 1;} + else if("RED" == colorCode){page = m_pageRed;pageIndex = 2;} + } + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType101HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGreen; + int pageIndex = 0; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + cJSON* jsonTmp = cJSON_GetObjectItem(root, "errcode"); + if(!jsonTmp){return;} + if(jsonTmp->valueint != 0){return;} + + jsonTmp = cJSON_GetObjectItem(root, "data"); + if(!jsonTmp){return;} + + cJSON* item = cJSON_GetObjectItem(jsonTmp, "color"); + if(item){ + std::string colorCode{item->valuestring}; + if("Y" == colorCode){page = m_pageYellow;pageIndex = 1;} + else if("R" == colorCode){page = m_pageRed;pageIndex = 2;} + } + + item = cJSON_GetObjectItem(jsonTmp, "name"); + if(item){name = item->valuestring;} + item = cJSON_GetObjectItem(jsonTmp, "cid"); + if(item){idNum = item->valuestring;} + + item = cJSON_GetObjectItem(jsonTmp, "ext"); + if(item){ + cJSON *r = cJSON_Parse(item->valuestring); + if(r){ + ON_SCOPE_EXIT([&]{cJSON_Delete(r);}); + item = cJSON_GetObjectItem(r, "nat"); + if(item){ + int cnt = cJSON_GetArraySize(item); + LOGI("array size:%d", cnt); + if(cnt){ + cJSON * arrayItem = cJSON_GetArrayItem(item, 0); + if(arrayItem){ + cJSON * jsTmp = cJSON_GetObjectItem(arrayItem, "result"); + if(jsTmp){ + std::string c19t{jsTmp->valuestring}; + if("阴性" == c19t){c19tRes = 1;} + else if("阳性" == c19t){c19tRes = 2;} + } + jsTmp = cJSON_GetObjectItem(arrayItem, "dtime"); + if(jsTmp){c19tTime = jsTmp->valuestring;} + } + } + } + + item = cJSON_GetObjectItem(r, "vac"); + if(item){ + int cnt = cJSON_GetArraySize(item); + LOGI("array size:%d", cnt); + if(cnt){ + cJSON * arrayItem = cJSON_GetArrayItem(item, 0); + if(arrayItem){ + cJSON * jsTmp = cJSON_GetObjectItem(arrayItem, "needle_times"); + if(jsTmp){abtRes = jsTmp->valueint;} + jsTmp = cJSON_GetObjectItem(arrayItem, "date"); + if(jsTmp){abtTime = jsTmp->valuestring;} + } + } + } + } + } + +#if 0 + jsonTmp = cJSON_GetObjectItem(root, "healthCode"); + if(jsonTmp){ + cJSON *r = cJSON_Parse(jsonTmp->valuestring); + if(r){ + ON_SCOPE_EXIT([&]{cJSON_Delete(r);}); + item = cJSON_GetObjectItem(r, "name"); + if(item){name = item->valuestring;} + item = cJSON_GetObjectItem(r, "cid"); + if(item){idNum = item->valuestring;} + } + } +#endif + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType6HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor) +{ + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGrey; + int pageIndex = 3; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + cJSON* jsonTmp = cJSON_GetObjectItem(root, "code"); + if(!jsonTmp){return;} + if(std::string(jsonTmp->valuestring) != "0000"){return;} + + jsonTmp = cJSON_GetObjectItem(root, "ID"); + if(jsonTmp && jsonTmp->valuestring){idNum = jsonTmp->valuestring;} + jsonTmp = cJSON_GetObjectItem(root, "name"); + if(jsonTmp && jsonTmp->valuestring){name = jsonTmp->valuestring;} + + jsonTmp = cJSON_GetObjectItem(root, "provinceRisklevel"); + if(jsonTmp && jsonTmp->valuestring){ + const std::string status{jsonTmp->valuestring}; + if(status == "00"){page = m_pageGreen;pageIndex = 0;} + else if(status == "01"){page = m_pageYellow;pageIndex = 1;} + else if(status == "10"){page = m_pageRed;pageIndex = 2;} + } + + jsonTmp = cJSON_GetObjectItem(root, "hsjcjg"); + if(jsonTmp && jsonTmp->valuestring){ + std::string c19t{jsonTmp->valuestring}; + if("阴性" == c19t){c19tRes = 1;} + else if("阳性" == c19t){c19tRes = 2;} + } + jsonTmp = cJSON_GetObjectItem(root, "hsjcsj"); + if(jsonTmp && jsonTmp->valuestring){c19tTime = jsonTmp->valuestring;} + + jsonTmp = cJSON_GetObjectItem(root, "ymjzcs"); + if(jsonTmp){abtRes = jsonTmp->valueint;} + jsonTmp = cJSON_GetObjectItem(root, "jzrq"); + if(jsonTmp && jsonTmp->valuestring){abtTime = jsonTmp->valuestring;} + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType7HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor){ + + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGrey; + int pageIndex = 3; + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + QString antiGentime; + int tripRes = 0; + // int antigenSts = 0; + + cJSON* state = cJSON_GetObjectItem(root, "state"); + if(!state && state->valueint != 1) return; + + cJSON* data = cJSON_GetObjectItem(root, "data"); + if(!data) return; + + + cJSON* jsonTmp = cJSON_GetObjectItem(data, "health_status"); + if(jsonTmp){ + //FJQRJKM 健康码颜色 "1":红码; "2":黄码; "3":绿码 + if(strcmp(jsonTmp->valuestring, "3") == 0){page = m_pageGreen;pageIndex = 0;} + else if(strcmp(jsonTmp->valuestring, "2") == 0){page = m_pageYellow;pageIndex = 1;} + else if(strcmp(jsonTmp->valuestring, "1") == 0){page = m_pageRed;pageIndex = 2;} + } + + jsonTmp = cJSON_GetObjectItem(data, "vaccines_num"); + if(jsonTmp){ + //疫苗接种次数 + abtRes = atoi(jsonTmp->valuestring); + } + + jsonTmp = cJSON_GetObjectItem(data, "caid_status"); + if(jsonTmp){ + //FJQRJKM 核酸检测结果 "-1":异常; "0":无 核酸; "2":阴性; "1":阳性 + c19tRes = 0; + if(strcmp(jsonTmp->valuestring, "2") == 0){ + c19tRes = 1; + }else if(strcmp(jsonTmp->valuestring, "1") == 0){ + c19tRes = 2; + } + } + + jsonTmp = cJSON_GetObjectItem(data, "newest_sampling_time"); + // if(jsonTmp) {c19tTime = QString::fromStdString(FileUtils::getTimeString(atol(jsonTmp->valuestring)));} + if(jsonTmp && std::string(jsonTmp->valuestring) != ""){ + int newestSamplingTimeStp = atol(jsonTmp->valuestring); + if(newestSamplingTimeStp > 0){ + c19tTime = QString::fromStdString(FileUtils::getTimeString(newestSamplingTimeStp)); + } + } + + if(c19tTime.isEmpty() && c19tRes > 0){ + LOGI("c19 time invalid!!!"); + c19tRes = 0; + } + + jsonTmp = cJSON_GetObjectItem(data, "user_name"); + if(jsonTmp) {name = jsonTmp->valuestring;} + + jsonTmp = cJSON_GetObjectItem(data, "cid"); + if(jsonTmp) {idNum = jsonTmp->valuestring;} + + //停留中高风险地区状态 0-去过,1-未去过,2-信息不全 + jsonTmp = cJSON_GetObjectItem(data, "stay_risk_area_status"); + if(jsonTmp){ + #if 0 + if(strcmp(jsonTmp->valuestring, "0") == 0){ + tripRes = 2; + }else if(strcmp(jsonTmp->valuestring, "1") == 0){ + tripRes = 1; + } + #else + //0:7天内途经省内中高风险地区且无省外旅居史,1:7天内未途经省内中高风险地区且无省外旅居史,2:7天内有省外旅居史 + if(std::string(jsonTmp->valuestring) == "0"){tripRes = 2;} + else if(std::string(jsonTmp->valuestring) == "1"){tripRes = 1;} + else if(std::string(jsonTmp->valuestring) == "2"){tripRes = 2;} + #endif + } + + //抗原检测结果 -1:异常; 0:无抗原检测; 2:阴性; 1:阳性 目前不作展示 + // jsonTmp = cJSON_GetObjectItem(data, "antigen_status"); + // if(jsonTmp != nullptr){ + // if(strcmp(jsonTmp->valuestring, "2") == 0){ + // antigenSts = 1; + // }else if(strcmp(jsonTmp->valuestring, "1") == 0){ + // antigenSts = 2; + // } + // } + + // jsonTmp = cJSON_GetObjectItem(data, "newest_antigen_time"); + // if(jsonTmp != nullptr){ + // antiGentime = QString::fromStdString(FileUtils::getTimeString(atol(jsonTmp->valuestring))); + // } + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, (c19tRes > 0)&&(!c19tTime.toStdString().empty()) ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, (abtRes > 0) && (!abtTime.toStdString().empty()) ? abtTime : ""); + // page->showAntiGenTestingMsg(antigenSts, (antigenSts > 0) && (!antiGentime.toStdString().empty()) ? antiGentime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType8HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor){ + if(m_resultType != 2){ + m_resultType = 2; + setResultShowType(m_resultType); + } + + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if (!root) { + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + QString name; + QString idNum; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + QString antiGentime; + int tripRes = 0; + // int antigenSts = 0; + recoUiHealthCodePage* page = m_pageGrey; + int pageIndex = 3; + + cJSON* state = cJSON_GetObjectItem(root, "code"); + if(!state && std::string(state->valuestring) != "0") return; + + cJSON* jsonTmp = cJSON_GetObjectItem(root, "idNum"); + if(jsonTmp) {idNum = jsonTmp->valuestring;} + + jsonTmp = cJSON_GetObjectItem(root, "name"); + if(jsonTmp) {name = jsonTmp->valuestring;} + + jsonTmp = cJSON_GetObjectItem(root, "healthSts"); + if(jsonTmp){ + //颜色:"0":绿码; "1":黄码; "2":红码; + if(strcmp(jsonTmp->valuestring, "0") == 0){page = m_pageGreen;pageIndex = 0;} + else if(strcmp(jsonTmp->valuestring, "1") == 0){page = m_pageYellow;pageIndex = 1;} + else if(strcmp(jsonTmp->valuestring, "2") == 0){page = m_pageRed;pageIndex = 2;} + } + + jsonTmp = cJSON_GetObjectItem(root, "caidSts"); + if(jsonTmp){ + //核酸检测结果 "-1":无结果; "0":阴性; "1":阳性 + if(std::string(jsonTmp->valuestring) == "0"){ + c19tRes = 1; + }if(std::string(jsonTmp->valuestring) == "1"){ + c19tRes = 2; + } + } + + jsonTmp = cJSON_GetObjectItem(root, "caidNewstSampleTime"); + if(jsonTmp) {c19tTime = jsonTmp->valuestring;} + + if(c19tTime.isEmpty() && c19tRes > 0){ + LOGI("c19 time invalid!!!"); + c19tRes = 0; + } + + + jsonTmp = cJSON_GetObjectItem(root, "vaccinesNum"); + if(jsonTmp) {abtRes = jsonTmp->valueint;} + jsonTmp = cJSON_GetObjectItem(root, "vaccinesNewstTime"); + if(jsonTmp) {abtTime = jsonTmp->valuestring;} + + jsonTmp = cJSON_GetObjectItem(root, "stayRiskAreaSts"); + if(jsonTmp){ + #if 0 + if(std::string(jsonTmp->valuestring) == "0"){tripRes = 1;} + else if(std::string(jsonTmp->valuestring) == "1"){tripRes = 2;} + #else + //0:7天内途经省内中高风险地区且无省外旅居史,1:7天内未途经省内中高风险地区且无省外旅居史,2:7天内有省外旅居史 + if(std::string(jsonTmp->valuestring) == "0"){tripRes = 2;} + else if(std::string(jsonTmp->valuestring) == "1"){tripRes = 1;} + else if(std::string(jsonTmp->valuestring) == "2"){tripRes = 2;} + #endif + } + + //抗原检测结果 -1:异常; 0:无抗原检测; 2:阴性; 1:阳性 目前不作展示 + // jsonTmp = cJSON_GetObjectItem(data, "antigen_status"); + // if(jsonTmp != nullptr){ + // if(strcmp(jsonTmp->valuestring, "2") == 0){ + // antigenSts = 1; + // }else if(strcmp(jsonTmp->valuestring, "1") == 0){ + // antigenSts = 2; + // } + // } + + // jsonTmp = cJSON_GetObjectItem(data, "newest_antigen_time"); + // if(jsonTmp != nullptr){ + // antiGentime = QString::fromStdString(FileUtils::getTimeString(atol(jsonTmp->valuestring))); + // } + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + +void recoUiHealthCode::_showType9HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor){ + cJSON *root = cJSON_Parse(msg.toStdString().c_str()); + if(!root){ + qDebug() << "json data error"; + return; + } + ON_SCOPE_EXIT([&]{cJSON_Delete(root);}); + + recoUiHealthCodePage* page = m_pageGrey; + int pageIndex = 3; + + QString name; + QString idNum{"******************"}; + int c19tRes = 0; + QString c19tTime; + int abtRes = 0; + QString abtTime; + int tripRes = 0; + + cJSON* jsonTmp = cJSON_GetObjectItem(root, "errcode"); + if(!jsonTmp){return;} + QString errCode{jsonTmp->valuestring}; + if( errCode != "000000" && (errCode < "100303" || errCode > "100306") ){return;} + + jsonTmp = cJSON_GetObjectItem(root, "colourstatus"); + if(jsonTmp){ + //健康码颜色 "1":红码; "2":黄码; "0":绿码 + if(strcmp(jsonTmp->valuestring, "0") == 0){page = m_pageGreen;pageIndex = 0;;} + else if(strcmp(jsonTmp->valuestring, "1") == 0){page = m_pageRed;pageIndex = 2;} + else if(strcmp(jsonTmp->valuestring, "2") == 0){page = m_pageYellow;pageIndex = 1;} + } + + jsonTmp = cJSON_GetObjectItem(root, "hsstatus"); + if(jsonTmp){//核酸检测结果,0阴性,1阳性 + c19tRes = 0; + if(strcmp(jsonTmp->valuestring, "0") == 0){c19tRes = 1;} + else if(strcmp(jsonTmp->valuestring, "1") == 0){c19tRes = 2;} + } + jsonTmp = cJSON_GetObjectItem(root, "hsjcsj"); //检测时间, hscysj采样时间 + if(jsonTmp){c19tTime = jsonTmp->valuestring;} + + jsonTmp = cJSON_GetObjectItem(root, "name"); + if(jsonTmp){name = jsonTmp->valuestring;} + + jsonTmp = cJSON_GetObjectItem(root, "ymtimes"); + if(jsonTmp){abtRes = atoi(jsonTmp->valuestring);} + jsonTmp = cJSON_GetObjectItem(root, "ymzssj"); + if(jsonTmp){abtTime = jsonTmp->valuestring;} + + page->showTemp(temp); + page->showPersonMsg(name, idNum, jpgDate, jpgLen); + page->showCovid19TestingMsg(c19tRes, c19tRes > 0 ? c19tTime : ""); + page->showAntibodyTestingMsg(abtRes, abtRes > 0 ? abtTime : ""); + page->showTripMsg(tripRes, tripCity); + page->showAccResult(pass, failReason, bgColor); + m_stackPages->setCurrentIndex(pageIndex); +} + + diff --git a/Linguist/recoUi/recoUiHealthCode.h b/Linguist/recoUi/recoUiHealthCode.h new file mode 100644 index 0000000..28ddf7f --- /dev/null +++ b/Linguist/recoUi/recoUiHealthCode.h @@ -0,0 +1,114 @@ +#ifndef RECOUIHEALTHCODE_H +#define RECOUIHEALTHCODE_H + +#include "UiTools.h" +#include "UiConfig.h" + + +class recoUiHealthCodePage : public QWidget +{ + Q_OBJECT +public: +#if 0 + static const int PERSON_NAME_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int WEL_MSG_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int PASSWORD_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int NUM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int CONFIRM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const QString PWD_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString CONFIRM_BTN_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString CONFIRM_BTN_DISABLE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int CONFIRM_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int CONFIRM_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BACK_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int BACK_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int BACK_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString DEL_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DEL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DEL_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString NUM_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; +#endif + static const int PIC_WIDGET_H_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit recoUiHealthCodePage(int type, QWidget *parent = nullptr); + void showTemp(float temp); + void showPersonMsg(const QString& name, const QString& idNum, const unsigned char* jpgDate, int len); + void showAntibodyTestingMsg(int num, const QString& testingTime); + void showCovid19TestingMsg(int res, const QString& testingTime); + void showAntiGenTestingMsg(int res, const QString& testingTime); + void showTripMsg(int res, const QString& tripCity); + void showAccResult(bool pass, const QString& failReason, int bgColor); + void setResultShowType(int type); + //void setBgColorByResult(int codeColor, int c19t, int trip, bool pass); + +signals: + +public slots: + +private: + QLabel* m_labelTitle; + + QLabel* m_labelCurTime; + QLabel* m_labelTempTip; + QLabel* m_labelTemp; + QWidget* m_labelFacePic; + QLabel* m_labelName; + QLabel* m_labelIdNo; + + QLabel* m_labelABTTitle; + QLabel* m_labelABTRes; + QLabel* m_labelABTTime; + + QLabel* m_labelC19T; + QLabel* m_labelC19TTitle; + RoundedWidget* m_covid19Testing; + QStackedWidget* m_stackC19T; + QLabel* m_labelC19TTime; + + QLabel* m_labelAccRes; + QLabel* m_labelTripRes; + QLabel* m_labelTripResTime; + QLabel* m_labelAcc; + + QLabel* m_failReason; + +}; + +class recoUiHealthCode : public WidgetWithBackstageInterface +{ + Q_OBJECT +public: + explicit recoUiHealthCode(QWidget *parent = nullptr); + void showHealthMsg(int type, float temp, const QString& msg, bool pass, + const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void setResultShowType(int type); + +signals: + +public slots: + +private: + QStackedWidget* m_stackPages; + recoUiHealthCodePage* m_pageGreen; + recoUiHealthCodePage* m_pageYellow; + recoUiHealthCodePage* m_pageRed; + recoUiHealthCodePage* m_pageGrey; + + int m_resultType = 0; + + void _showType0HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType1HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType2HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType3HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType4HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType5HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showTypexHealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType101HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType6HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType7HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType8HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); + void _showType9HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor); +}; + + +#endif // RECOUIPASSWORD_H diff --git a/Linguist/recoUi/recoUiPassword.cpp b/Linguist/recoUi/recoUiPassword.cpp new file mode 100644 index 0000000..865c244 --- /dev/null +++ b/Linguist/recoUi/recoUiPassword.cpp @@ -0,0 +1,422 @@ +#include "recoUiPassword.h" +#include +#include + + +const int recoUiPassword::PERSON_NAME_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY] = { + {24, 20, 14, 15, 12, 15, 14, 13, 9, 12, 10, 13, 13, 9}, + {48, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {48, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {16, 16, 10, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8}, + {16, 16, 10, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8} +}; +const int recoUiPassword::WEL_MSG_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY] = { + {16, 20, 14, 15, 12, 15, 14, 13, 9, 12, 10, 13, 13, 9}, + {32, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {32, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {12, 12, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8}, + {12, 12, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8} +}; +const int recoUiPassword::PASSWORD_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY] = { + {20, 20, 14, 15, 12, 15, 14, 13, 9, 12, 10, 13, 13, 9}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {14, 14, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8}, + {14, 14, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8} +}; +const int recoUiPassword::NUM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY] = { + {20, 20, 14, 15, 12, 15, 14, 13, 9, 12, 10, 13, 13, 9}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {16, 16, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8}, + {16, 16, 11, 12, 10, 12, 11, 10, 8, 10, 9, 10, 10, 8} +}; +const int recoUiPassword::CONFIRM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY] = { + {20, 20, 14, 15, 12, 15, 14, 13, 9, 12, 10, 13, 13, 9}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {40, 40, 28, 30, 24, 30, 28, 26, 19, 26, 22, 26, 26, 19}, + {14, 14, 10, 11, 9, 11, 10, 9, 7, 9, 8, 9, 9, 7}, + {14, 14, 10, 11, 9, 11, 10, 9, 7, 9, 8, 9, 9, 7} +}; + +const QString recoUiPassword::PWD_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_bg_small.jpg", +":/res/image/pwd_bg_large.jpg", +":/res/image/pwd_bg_middle.jpg", +":/res/image/pwd_bg_large.jpg", +":/res/image/pwd_bg_middle.jpg" +}; + +const QString recoUiPassword::CONFIRM_BTN_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_confirm_small.png", +":/res/image/pwd_confirm_large.png", +":/res/image/pwd_confirm_middle.png", +":/res/image/pwd_confirm_large.png", +":/res/image/pwd_confirm_middle.png" +}; +const QString recoUiPassword::CONFIRM_BTN_DISABLE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_confirm_small_disable.png", +":/res/image/pwd_confirm_large_disable.png", +":/res/image/pwd_confirm_middle_disable.png", +":/res/image/pwd_confirm_large_disable.png", +":/res/image/pwd_confirm_middle_disable.png" +}; +const int recoUiPassword::CONFIRM_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {344, 430, 430, 430, 430}; +const int recoUiPassword::CONFIRM_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {72, 90, 90, 90, 90}; + +const QString recoUiPassword::BACK_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_back_small.png", +":/res/image/pwd_back_large.png", +":/res/image/pwd_back_middle.png", +":/res/image/pwd_back_large.png", +":/res/image/pwd_back_middle.png" +}; +const int recoUiPassword::BACK_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {20, 24, 24, 24, 24}; +const int recoUiPassword::BACK_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {35, 44, 44, 44, 44}; + +const QString recoUiPassword::DEL_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_del_small.png", +":/res/image/pwd_del_large_black.png", +":/res/image/pwd_del_middle.png", +":/res/image/pwd_del_large_black.png", +":/res/image/pwd_del_middle.png" +}; +const int recoUiPassword::DEL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {344, 35, 35, 35, 35}; +const int recoUiPassword::DEL_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {344, 24, 24, 24, 24}; + +const QString recoUiPassword::NUM_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/num_btn_small.png", +":/res/image/num_btn_large.png", +":/res/image/num_btn_middle.png", +":/res/image/num_btn_large.png", +":/res/image/num_btn_middle.png" +}; + + + +recoUiPassword::recoUiPassword(QWidget *parent) : WidgetWithBackstageInterface(parent) +{ + qDebug() << "recoUiPassword()"; + + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + + setAutoFillBackground(true); + QPalette palette(this->palette()); + palette.setBrush(QPalette::Window,QBrush(QPixmap(PWD_BG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + setPalette(palette); + + const int btnWidth = UiConfig::GetInstance()->getUiWidth() / 5; + + m_btnBack = new QPushButton(this); + setButtonBackImage(m_btnBack, BACK_BTN[UiConfig::GetInstance()->getScreenConfigIndex()], + BACK_BTN_W[UiConfig::GetInstance()->getScreenConfigIndex()], + BACK_BTN_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_btnBack->setFixedSize(btnWidth, btnWidth); + //m_btnBack->setStyleSheet("QPushButton:focus{outline: none;}"); + m_btnBack->setFocusPolicy(Qt::NoFocus); + connect(m_btnBack, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QPalette labelPal; + labelPal.setColor(QPalette::Background,QColor(0, 0, 0, 0)); + + QFont ft; + ft.setWeight(ft.weight() * 2 > 99 ? 99 : ft.weight() * 2);//Weight must be between 0 and 99 + //ft.setBold(true); + m_labelName = new QLabel(this); + //m_labelName->setText(tr("某某某")); + m_labelName->setPalette(labelPal); + ft.setPointSize(PERSON_NAME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelName->setFont(ft); + m_labelName->hide(); + + m_labelWelStr = new QLabel(this); + m_labelWelStr->setText(tr("欢迎光临")); + labelPal.setColor(QPalette::WindowText,QColor(203, 242, 252)); + m_labelWelStr->setPalette(labelPal); + ft.setPointSize(WEL_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_labelWelStr->setFont(ft); + m_labelWelStr->hide(); + + if(UiConfig::GetInstance()->isRkDevice()){ + m_editPwd = new QPasswordLineEdit(this, "."); + } + else{ + m_editPwd = new QPasswordLineEdit(this); + } + m_editPwd->setReadOnly(true); + QPalette lineEditPal; + lineEditPal.setColor(QPalette::Text,QColor(255, 255, 255, 255)); + m_editPwd->setPalette(lineEditPal); + ft.setPointSize(PASSWORD_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_editPwd->setFont(ft); + m_editPwd->setStyleSheet("background:transparent;border-width:0;border-style:outset"); + m_editPwd->setAlignment(Qt::AlignCenter); + + QPalette btnPal; + btnPal.setColor(QPalette::ButtonText,QColor(255, 255, 255, 255)); + QGridLayout* glayMid = new QGridLayout(); + for(int i=0; isetText(QString::number(i)); + m_btnsNum[i]->setPalette(btnPal); + ft.setPointSize(NUM_BTN_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_btnsNum[i]->setFont(ft); + m_btnsNum[i]->setFlat(true); + m_btnsNum[i]->setCursor(QCursor(Qt::PointingHandCursor)); + m_btnsNum[i]->setFocusPolicy(Qt::NoFocus); + m_btnsNum[i]->setFixedSize(btnWidth, btnWidth); + m_btnsNum[i]->setStyleSheet("background-color:transparent;border-radius:0px;focus{outline: none;}"); + /*const QString numBtnStyle = QString("QPushButton {" + "border: 0px;" + "background-color:transparent;" + "background:url(%1);" + "}" + "QPushButton:hover { " + "border: 0px;" + "background:url(%2);" + "background-repeat:none;" + "background-position:center;" + "}" + "QPushButton:pressed {" + "border: 0px;" + "background:url(%3);" + "background-repeat:none;" + "background-position:center;" + //"background-origin: content;" // 设置背景图片基于content,默认是基于border的 + //"padding-left: 8px;" //设置content相对于border的偏移,如果此属性要对背景图片生效的话,需要设置上面的属性 + "}") + .arg(":/res/image/num_btn_large.png") + .arg(":/res/image/num_btn_large.png") + .arg(":/res/image/num_btn_large.png"); + m_btnsNum[i]->setStyleSheet(numBtnStyle); + m_btnsNum[i]->setStyleSheet("QPushButton {" + "font-size:100px;" + "color:yellow; " + "border-radius:150px;" //圆角大小,因为矩形的一半为150,所以圆角大小 设置为150以后,将会成为一个原型,小于150,就是圆角矩形了。 + "background-color:rgba(0,255,0,200);" //设置按钮背景为绿色 + "}" + "QPushButton:hover { " + "font-size:100px;" + "color:green;" + "border-radius:150px;" + "background-color:rgba(255,255,0,200);" //设置按钮背景为黄色 = 红+绿 + "}" + "QPushButton:pressed {" + "color:orange; " + "border-width:3;" + "border-radius:150px;" + "border-color:orange;" + "border-style:solid;" + "background-color:cyan;" + "}"); + */ + connect(m_btnsNum[i], SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + if(!UiConfig::GetInstance()->isRkDevice()){ + connect(m_btnsNum[i], SIGNAL(pressed()), this, SLOT(slotBtnPressed())); + connect(m_btnsNum[i], SIGNAL(released()), this, SLOT(slotBtnReleased())); + } + if(i > 0){ + const int pos = i - 1; + glayMid->addWidget(m_btnsNum[i], pos / 3, pos % 3); + } + } + m_btnBackspace = new QPushButton(this); + setButtonBackImage(m_btnBackspace, DEL_BTN[UiConfig::GetInstance()->getScreenConfigIndex()], + DEL_BTN_W[UiConfig::GetInstance()->getScreenConfigIndex()], + DEL_BTN_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_btnBackspace->setFixedSize(btnWidth, btnWidth); + connect(m_btnBackspace, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + //m_btnClear = new QPushButton(this); + //m_btnClear->setText(tr("清空")); + //connect(m_btnClear, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + //glayMid->addWidget(m_btnClear, 3, 0); + glayMid->addWidget(m_btnsNum[0], 3, 1); + glayMid->addWidget(m_btnBackspace, 3, 2); + + m_btnConfirm = new QPushButton(this); + m_btnConfirm->setText(tr("确认")); + m_btnConfirm->setPalette(btnPal); + m_btnConfirm->setFlat(true); + m_btnConfirm->setCursor(QCursor(Qt::PointingHandCursor)); + m_btnConfirm->setFocusPolicy(Qt::NoFocus); + m_btnConfirm->setFixedSize(CONFIRM_BTN_W[UiConfig::GetInstance()->getScreenConfigIndex()], + UiConfig::GetInstance()->isRkDevice() ? + (CONFIRM_BTN_H[UiConfig::GetInstance()->getScreenConfigIndex()] >> 2 << 2) : + CONFIRM_BTN_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + ft.setWeight(ft.weight() * 2 > 99 ? 99 : ft.weight() * 2);//Weight must be between 0 and 99 + ft.setPointSize(CONFIRM_BTN_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()]); + m_btnConfirm->setFont(ft); + #if 1 + const QString confirmBtnStyle = QString("background-color:transparent;" + "color:white;" + "border-image: url(%1);" + ) + .arg(CONFIRM_BTN_BG[UiConfig::GetInstance()->getScreenConfigIndex()]); + #else + QString confirmBtnStyle = QString("QPushButton{background:url(%1); background-color:transparent;border: none; }" //正常 + "QPushButton:hover{background:url(%2); background-color:transparent; }" //滑过 + "QPushButton:pressed{background:url(%3); background-color:transparent; }") //按下 + .arg(CONFIRM_BTN_BG[UiConfig::GetInstance()->getScreenConfigIndex()]) + .arg(CONFIRM_BTN_DISABLE_BG[UiConfig::GetInstance()->getScreenConfigIndex()]) + .arg(CONFIRM_BTN_DISABLE_BG[UiConfig::GetInstance()->getScreenConfigIndex()]); + #endif + //qDebug() << "confirmBtnStyle:" << confirmBtnStyle; + m_btnConfirm->setStyleSheet(confirmBtnStyle); + connect(m_btnConfirm, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(m_btnBack, 1, Qt::AlignLeft | Qt::AlignTop); + vlay->addWidget(m_labelName, 1, Qt::AlignCenter | Qt::AlignTop); + vlay->addWidget(m_labelWelStr, 1, Qt::AlignCenter | Qt::AlignTop); + vlay->addWidget(m_editPwd, 80, Qt::AlignCenter | Qt::AlignBottom); + vlay->addLayout(glayMid); + vlay->addWidget(m_btnConfirm, 1, Qt::AlignCenter | Qt::AlignTop); + vlay->setContentsMargins(0, 10, 0, (UiConfig::GetInstance()->getUiHeight() / 12) >> 1 << 1); + //vlay->setMargin(0); + setLayout(vlay); + + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); +} + +void recoUiPassword::reset(const QString& name) +{ + m_editPwd->clear(); + m_pwd.clear(); + m_timeCnt = 0; + m_tryTime = 0; + m_timer->start(TIMEOUT); + m_btnConfirm->setEnabled(false); + slotShowPwdUiPersonName(name); + //m_backstageIf->pauseDataFlow(); + m_backstageIf->stopIdentyState(); + m_need2ResetDecisionCenterTimer = !name.isEmpty(); +} + +void recoUiPassword::slotBtnClicked() +{ + qDebug() << "slotBtnClicked"; + const QObject* send = sender(); + if (send == m_btnConfirm) { + m_timeCnt = 0; + qDebug() << "password:" << m_pwd; + m_backstageIf->sendPassword(m_pwd.toStdString().c_str()); + m_editPwd->clear(); + m_pwd.clear(); + m_btnConfirm->setEnabled(false); + m_timer->stop(); + m_tryTime++; + if(m_tryTime >= TRY_TIME){ + emit signalShowRecognizePage(); + //m_backstageIf->resumeDataFlow(); + } + } + else if (send == m_btnBackspace) { + m_timeCnt = 0; + QString text = m_editPwd->text(); + if(text.size()){ + m_pwd = m_pwd.left(m_pwd.size() - 1); + m_editPwd->setText(text.left(text.size() - 1)); + m_btnConfirm->setEnabled(m_editPwd->text().length() >= PWD_LEN_MIN); + } + } + //else if (send == m_btnClear) { + //m_editPwd->clear(); + //} + else if (send == m_btnBack) { + emit signalShowRecognizePage(); + m_timer->stop(); + //m_backstageIf->resumeDataFlow(); + m_backstageIf->verifyAbort(); + } + else{ + m_timeCnt = 0; + if(m_editPwd->text().length() >= PWD_LEN_MAX){ + return; + } + for(int i=0; ihide(); + m_labelWelStr->hide(); + } + m_pwd += m_btnsNum[i]->text(); + m_editPwd->setText(m_editPwd->text() + m_btnsNum[i]->text()); + m_btnConfirm->setEnabled(m_editPwd->text().length() >= PWD_LEN_MIN); + break; + } + } + } + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiPassword::slotBtnPressed() +{ + const QString numBtnStyle = QString("QPushButton {" + "border: 0px;"//"background-color:transparent;" + "}" + "QPushButton:pressed {" + "border: 0px;" + "background:url(%1);" + "background-repeat:none;" + "background-position:center;" + "}") + .arg(NUM_BTN[UiConfig::GetInstance()->getScreenConfigIndex()]); + dynamic_cast(sender())->setStyleSheet(numBtnStyle); +} + +void recoUiPassword::slotBtnReleased() +{ + qDebug() << "slotBtnReleased"; + dynamic_cast(sender())->setStyleSheet("background-color:transparent;border-radius:0px;focus{outline: none;}"); +} + + +void recoUiPassword::slotTimeout() +{ + m_timeCnt++; + qDebug() << "slotTimeout:" << m_timeCnt; + if(m_need2ResetDecisionCenterTimer && m_timeCnt < (PROC_OVERTIME - BACKSTAGE_PROC_OVERTIME) ){ + m_backstageIf->resetDecisionCenterTimer(); + } + else if(m_timeCnt >= PROC_OVERTIME){ + m_timer->stop(); + emit signalShowRecognizePage(); + //m_backstageIf->resumeDataFlow(); + } +} + +void recoUiPassword::slotShowPwdUiPersonName(const QString& name) +{ + if(name.isEmpty()){ + m_labelName->hide(); + m_labelWelStr->hide(); + } + else{ + m_labelName->setText(name); + m_labelName->setStyleSheet("color:#CBF2FC;"); + m_labelName->show(); + m_labelWelStr->show(); + } +} + +void recoUiPassword::slotShowUserPwdError(int type, int color) +{ + m_timer->start(); + switch(type){ + case 0: + m_labelName->setText(tr("密码错误")); + if(0 == color){ + m_labelName->setStyleSheet("color:#DB1624;"); + } + m_labelWelStr->hide(); + m_labelName->show(); + break; + default: + break; + } +} + + diff --git a/Linguist/recoUi/recoUiPassword.h b/Linguist/recoUi/recoUiPassword.h new file mode 100644 index 0000000..eaeab61 --- /dev/null +++ b/Linguist/recoUi/recoUiPassword.h @@ -0,0 +1,71 @@ +#ifndef RECOUIPASSWORD_H +#define RECOUIPASSWORD_H + +#include "UiTools.h" +#include "UiConfig.h" + + +class recoUiPassword : public WidgetWithBackstageInterface +{ + Q_OBJECT +public: + static const int PERSON_NAME_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int WEL_MSG_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int PASSWORD_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int NUM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const int CONFIRM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY]; + static const QString PWD_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString CONFIRM_BTN_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString CONFIRM_BTN_DISABLE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int CONFIRM_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int CONFIRM_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BACK_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int BACK_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int BACK_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString DEL_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DEL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DEL_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString NUM_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit recoUiPassword(QWidget *parent = nullptr); + void reset(const QString& name); + +signals: + void signalShowRecognizePage(); + +public slots: + void slotBtnClicked(); + void slotBtnPressed(); + void slotBtnReleased(); + + void slotTimeout(); + void slotShowPwdUiPersonName(const QString& name); + void slotShowUserPwdError(int type, int color); + +private: + enum{ + NUM_BTNS_QTY = 10, + TIMEOUT = 1000, + BACKSTAGE_PROC_OVERTIME = 5, //BACKSTAGE_PROC_OVERTIME * TIMEOUT + PROC_OVERTIME = 10, //PROC_OVERTIME * TIMEOUT + PWD_LEN_MIN = 4, + PWD_LEN_MAX = 16, + TRY_TIME = 5 + }; + QPushButton* m_btnBack; + QLabel* m_labelName; + QLabel* m_labelWelStr; + QPasswordLineEdit* m_editPwd; + QPushButton* m_btnsNum[NUM_BTNS_QTY]; + //QPushButton* m_btnClear; + QPushButton* m_btnBackspace; + QPushButton* m_btnConfirm; + + QString m_pwd; + QTimer* m_timer; + int m_timeCnt = 0; + int m_tryTime = 0; + bool m_need2ResetDecisionCenterTimer = false; +}; + +#endif // RECOUIPASSWORD_H diff --git a/Linguist/recoUi/recoUiRecognize.cpp b/Linguist/recoUi/recoUiRecognize.cpp new file mode 100644 index 0000000..0f3f171 --- /dev/null +++ b/Linguist/recoUi/recoUiRecognize.cpp @@ -0,0 +1,2789 @@ +#include "recoUiRecognize.h" +#include +#include "UiConfig.h" +#include +#include +#include +#include +#include "UiInterfaceForBackstage.h" +#include + +const int SceneMsgWidget::DATE_TIME_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {28, 26, 26, 10, 10}; +SceneMsgWidget::SceneMsgWidget(QWidget *parent) : QWidget(parent) +{ + setAutoFillBackground(true); + + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::black); + palette.setColor(QPalette::Background, QColor(Qt::white)); + setPalette(palette); + setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight() / 10); + + m_wgtDateTime = new DateTimeWidgetClassical(DATE_TIME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()], this); + connect(m_wgtDateTime, SIGNAL(signalNewDay()), this, SLOT(slotNewDay())); + m_labelPersonNum = new QLabel(this); + QFont ft; + ft.setPointSize(DATE_TIME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_labelPersonNum->setFont(ft); + + QHBoxLayout* hlay = new QHBoxLayout(); + hlay->addWidget(m_wgtDateTime); + hlay->addStretch(); + hlay->addWidget(m_labelPersonNum); + hlay->setMargin(20); + setLayout(hlay); +} + +int SceneMsgWidget::setType(int type) +{ + qDebug() << "type:" << type << "m_type:" << m_type; + + if(type < 0 || type > 2 || m_type == type){ + return -1; + } + m_type = type; + if(2 == m_type){ + m_labelPersonNum->setText(""); + }else if(m_type >= 0){ + setPersonNum(-1, 0); + } + return 0; +} + +void SceneMsgWidget::setPersonNum(int source, int personNum) +{ + qDebug() << "type:" << m_type << "source:" << source; + if(m_type == 2 || (source >=0 && source != m_type)){ + return; + } + const QVector items{tr("今日检票:"), tr("今日通行:")}; + if (m_type < items.size()) { + m_labelPersonNum->setText(items.at(m_type) + QString::number(personNum) + tr("人")); + } +} + +void SceneMsgWidget::setBgTransparent(bool set) +{ + QPalette palette(this->palette()); + palette.setColor(QPalette::Background, set ? QColor(0, 0, 0, 0) : QColor(Qt::white)); + setPalette(palette); +} + +void SceneMsgWidget::slotNewDay() +{ + setPersonNum(-1, 0); +} + + +const QString TmprWidget::TEMP_BG_GREEN_TOP_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/green-top-small.png", +":/res/image/green-top-middle.png", +":/res/image/green-top-middle.png", +":/res/image/green-top-middle-rk.png", +":/res/image/green-top-middle-rk.png" +}; + +const QString TmprWidget::TEMP_BG_RED_TOP_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/red-top-small.png", +":/res/image/red-top-middle.png", +":/res/image/red-top-middle.png", +":/res/image/red-top-middle-rk.png", +":/res/image/red-top-middle-rk.png" +}; + +const int TmprWidget::TMPR_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {174, 192, 192, 193, 193}; +const int TmprWidget::TMPR_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {25, 40, 40, 14, 14}; + + +const QString MsgWidget::NO_NETWORK_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +{":/res/image/no-network-smallB.png", +":/res/image/no-network-middleB.png", +":/res/image/no-network-middleB.png", +":/res/image/no-network-middleB.png", +":/res/image/no-network-middleB.png"}, +{":/res/image/no-network-small.png", +":/res/image/no-network-middle.png", +":/res/image/no-network-middle.png", +":/res/image/no-network-middle.png", +":/res/image/no-network-middle.png"}, +}; + +const QString MsgWidget::NETWORK_CONNECTED_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +{":/res/image/network-connected-smallB.png", +":/res/image/network-connected-middleB.png", +":/res/image/network-connected-middleB.png", +":/res/image/network-connected-middleB.png", +":/res/image/network-connected-middleB.png"}, +{":/res/image/network-connected-small.png", +":/res/image/network-connected-middle.png", +":/res/image/network-connected-middle.png", +":/res/image/network-connected-middle.png", +":/res/image/network-connected-middle.png"}, +}; + +const QString MsgWidget::NETWORK_LOGGED_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +{":/res/image/network-cloud-smallB.png", +":/res/image/network-cloud-middleB.png", +":/res/image/network-cloud-middleB.png", +":/res/image/network-cloud-middleB.png", +":/res/image/network-cloud-middleB.png"}, +{":/res/image/network-cloud-small.png", +":/res/image/network-cloud-middle.png", +":/res/image/network-cloud-middle.png", +":/res/image/network-cloud-middle.png", +":/res/image/network-cloud-middle.png"}, +}; + +const QString MsgWidget::NET_ETH_IP_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +{":/res/image/network-smallB.png", +":/res/image/network-middleB.png", +":/res/image/network-middleB.png", +":/res/image/network-middleB.png", +":/res/image/network-middleB.png"}, +{":/res/image/network-small.png", +":/res/image/network-middle.png", +":/res/image/network-middle.png", +":/res/image/network-middle.png", +":/res/image/network-middle.png"}, +}; + +const QString MsgWidget::NET_WIFI_IP_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +{":/res/image/wifi-smallB.png", +":/res/image/wifi-middleB.png", +":/res/image/wifi-middleB.png", +":/res/image/wifi-middleB.png", +":/res/image/wifi-middleB.png"}, +{":/res/image/wifi-small.png", +":/res/image/wifi-middle.png", +":/res/image/wifi-middle.png", +":/res/image/wifi-middle.png", +":/res/image/wifi-middle.png"}, +}; + +const QString MsgWidget::NET_4G_IP_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/4G-small.png", +":/res/image/4G-middle.png", +":/res/image/4G-middle.png", +":/res/image/4G-middle.png", +":/res/image/4G-middle.png" +}; + +const QString MsgWidget::BG_BLUE_BOM_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/blue-bom-small.png", +":/res/image/blue-bom-middle.png", +":/res/image/blue-bom-middle.png", +":/res/image/blue-bom-middle.png", +":/res/image/blue-bom-middle.png" +}; + +const QString MsgWidget::BG_GREEN_BOM_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/green-bom-small.png", +":/res/image/green-bom-middle.png", +":/res/image/green-bom-middle.png", +":/res/image/green-bom-middle.png", +":/res/image/green-bom-middle.png" +}; + +const QString MsgWidget::BG_RED_BOM_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/red-bom-small.png", +":/res/image/red-bom-middle.png", +":/res/image/red-bom-middle.png", +":/res/image/red-bom-middle.png", +":/res/image/red-bom-middle.png" +}; + +const int MsgWidget::TIME_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {8, 24, 22, 8, 7}; +const int MsgWidget::MSG_WORD_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {12, 24, 24, 8, 8}; +const int MsgWidget::NOTI_MSG_WORD_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {8, 16, 15, 6, 5}; + + +//const int DetectResultWidget::DETECT_RESULT_WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {389, 492, 492, 492, 492}; +//const int DetectResultWidget::DETECT_RESULT_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {108, 134, 134, 136, 136}; +const int DetectResultWidget::DETECT_RESULT_WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {389, 490, 490, 490, 490}; +const int DetectResultWidget::DETECT_RESULT_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {108, 128, 128, 129, 129}; +const int DetectResultWidget::MASK_LOGO_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {50, 80, 80, 64, 64}; +const QString DetectResultWidget::BG_BLUE_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/msg_box_bg_blue.png", +":/res/image/msg_box_bg_type1_blue_large.png", +":/res/image/msg_box_bg_type1_blue_large.png", +":/res/image/msg_box_bg_type1_blue_large.png", //msg_box_bg_blue_middle +":/res/image/msg_box_bg_type1_blue_large.png" +}; + +const QString DetectResultWidget::BG_RED_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/msg_box_bg_red.png", +":/res/image/msg_box_bg_type1_red_large.png", +":/res/image/msg_box_bg_type1_red_large.png", +":/res/image/msg_box_bg_type1_red_large.png", //msg_box_bg_red_middle +":/res/image/msg_box_bg_type1_red_large.png" +}; + + + const QString recoUiRecognize::BG_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/face-small.png", +":/res/image/jinggong-face-middle.png", +":/res/image/face_720_1280.png", +":/res/image/jinggong-face-middle.png", +":/res/image/face_720_1280.png" +}; + +const QString recoUiRecognize::DARK_FILL_LIGHT_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +"", +":/res/image/dark_fill_light_8inch.png", +":/res/image/dark_fill_light_5inch.png", +":/res/image/dark_fill_light_8inch.png", +":/res/image/dark_fill_light_5inch.png" +}; + + +//7 inch: 600 * 0.1 +//8 inch: 800 * 0.12 +//5 inch: 720 * 0.12 +const int recoUiRecognize::MSG_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {60, 96, 86, 97, 97}; + +const QString recoUiRecognize::SCANLINE_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/scan-line-small.png", +":/res/image/scan-line-middle.png", +":/res/image/scan-line-middle.png", +":/res/image/scan-line-middle.png", +":/res/image/scan-line-middle.png" +}; + +const QString recoUiRecognize::LOGO_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/logo_small.png", +":/res/image/logo2.png", +":/res/image/logo2.png", +":/res/image/logo2.png", +":/res/image/logo2.png" +}; + +const QString recoUiRecognize::TEMP_CALIBOX_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/calibration_box_small.png", +":/res/image/calibration_box_middle.png", +":/res/image/calibration_box_middle.png", +":/res/image/calibration_box_middle.png", +":/res/image/calibration_box_middle.png" +}; + +const int CenterMsgWidget::WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {459, 566, 509, 566, 509}; +const int CenterMsgWidget::WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {253, 313, 282, 313, 282}; +const int CenterMsgWidget::FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {14, 22, 22, 8, 8}; +const QString CenterMsgWidget::BG_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/center_msg_600_1024.png", +":/res/image/center_msg_800_1280.png", +":/res/image/center_msg_720_1280.png", +":/res/image/center_msg_800_1280.png", +":/res/image/center_msg_720_1280.png" +}; + +const QString recoUiRecognize::PWD_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_small.png", +":/res/image/pwd_large.png", +":/res/image/pwd_middle.png", +":/res/image/pwd_large.png", +":/res/image/pwd_middle.png" +}; +const QString recoUiRecognize::PWD_BTN_PRESSED[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/pwd_small_pressed.png", +":/res/image/pwd_large_pressed.png", +":/res/image/pwd_middle_pressed.png", +":/res/image/pwd_large_pressed.png", +":/res/image/pwd_middle_pressed.png" +}; +const int recoUiRecognize::PWD_BTN_W_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {61, 92, 76, 93, 77}; + +const QString FinalResultWidget::FINAL_RESULT_OK_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/ok_small.png", +":/res/image/ok_large.png", +":/res/image/ok_middle.png", +":/res/image/ok_large.png", +":/res/image/ok_middle.png" +}; +const QString FinalResultWidget::FINAL_RESULT_FAIL_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/fail_small.png", +":/res/image/fail_large.png", +":/res/image/fail_middle.png", +":/res/image/fail_large.png", +":/res/image/fail_middle.png" +}; +const int FinalResultWidget::FINAL_RESULT_WIDGET_W_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {130, 173, 160, 173, 160}; + +const int recoUiRecognize::SWIP_CARD_WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {400, 598, 598, 598, 598}; +const int recoUiRecognize::SWIP_CARD_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {70, 131, 131, 132, 132}; +const QString recoUiRecognize::SWIP_CARD_DAY_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/swipe_card_day_mode_type0_large.png", +":/res/image/swipe_card_day_mode_type0_large.png", +":/res/image/swipe_card_day_mode_type0_large.png", +":/res/image/swipe_card_day_mode_type0_large.png", +":/res/image/swipe_card_day_mode_type0_large.png" +}; +const QString recoUiRecognize::SWIP_CARD_NIGHT_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/swipe_card_night_mode_type0_large.png", +":/res/image/swipe_card_night_mode_type0_large.png", +":/res/image/swipe_card_night_mode_type0_large.png", +":/res/image/swipe_card_night_mode_type0_large.png", +":/res/image/swipe_card_night_mode_type0_large.png" +}; +const QString recoUiRecognize::CALL_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/voice_video_call_large.png", +":/res/image/voice_video_call_large.png", +":/res/image/voice_video_call_large.png", +":/res/image/voice_video_call_large.png", +":/res/image/voice_video_call_large.png" +}; + + +TmprWidget::TmprWidget(QWidget *parent) : QWidget (parent), m_ForeheadTmpr(0) +{ + m_label_tem = new QLabel(this); + //m_label_tem->setText("--℃"); + + //m_label_msg = new QLabel(this); + //m_label_msg->setText(tr("体温正常")); + + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::white); + palette.setColor(QPalette::Background,QColor(0, 0, 0, 0)); + setAutoFillBackground(true); + setPalette(palette); + + QFont ft; + ft.setPointSize(static_cast(TMPR_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * + UiConfig::GetInstance()->recoUiTextCfgFontSize(RecoUiTextCfg::TextTemp))); + m_label_tem->setFont(ft); + //m_label_msg->setFont(ft); + + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->addWidget(m_label_tem, 1, Qt::AlignTop | Qt::AlignCenter); + //vLayout->addWidget(m_label_msg, 1, Qt::AlignCenter); + + setLayout(vLayout); +} + +TmprWidget::~TmprWidget() +{ +} + +void TmprWidget::showNormalTemp(const QString& msg, float temp, bool isC) +{ + //if(isHidden() || fabs(m_ForeheadTmpr - temp) > 0.1f) + { + QString strTem = msg; + QString tmpr; + const float min = (isC ? recoUiRecognize::LOW_TEMP_VALUE : recoUiRecognize::LOW_TEMP_VALUE * 1.8 + 32.0); + const float max = (isC ? recoUiRecognize::HIGH_TEMP_VALUE : recoUiRecognize::HIGH_TEMP_VALUE * 1.8 + 32.0); + if(temp < min){ + strTem += "<" + tmpr.setNum(min, 'f', 1); //为了不增加新的翻译项,小于号单独加 + } + else if(temp > max){ + strTem += ">" + tmpr.setNum(max, 'f', 1); //为了不增加新的翻译项,大于号单独加 + } + else { + strTem += tmpr.setNum(temp, 'f', 1); + } + strTem += (isC ? "℃" : "℉"); + if(temp < 0.0f){ + strTem = ""; + } + QFont ft; + ft.setPointSize(UiConfig::GetInstance()->recoUiFontSize(RecoUiTextCfg::TextTemp) ? + UiConfig::GetInstance()->recoUiFontSize(RecoUiTextCfg::TextTemp) : + static_cast(TMPR_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * + UiConfig::GetInstance()->recoUiTextCfgFontSize(RecoUiTextCfg::TextTemp))); + m_label_tem->setFont(ft); + m_label_tem->setText(strTem); + #if 0 + QPalette palette(this->palette()); + palette.setColor(QPalette::Background,QColor(79, 129, 223, 200)); //蓝色正常体温 + setPalette(palette); + show(); + #endif + m_ForeheadTmpr = temp; + } +} + +void TmprWidget::showAbnormalTemp(const QString& msg, float temp, bool isHigh, bool isC) +{ + //qDebug() << "showAbnormalTemp:" << temp << "-" << isHigh; + //if(isHidden() || fabs(m_ForeheadTmpr - temp) > 0.1f) + { + const float min = (isC ? recoUiRecognize::LOW_TEMP_VALUE : recoUiRecognize::LOW_TEMP_VALUE * 1.8 + 32.0); + const float max = (isC ? recoUiRecognize::HIGH_TEMP_VALUE : recoUiRecognize::HIGH_TEMP_VALUE * 1.8 + 32.0); + QString strTem = msg; + //QPalette palette(this->palette()); + /* + if( temp > static_cast(-(1e-6)) && temp < static_cast(1e-6) ) + { + //strTem = "---℃"; + //m_label_msg->setText(tr("体温测量中...")); + //palette.setColor(QPalette::Background,QColor(144, 158, 195, 200)); + } + else*/ + { + QString tmpr; + //if(isHigh){ + if(temp < min){ + strTem += "<" + tmpr.setNum(min, 'f', 1); //为了不增加新的翻译项,小于号单独加 + } + else if(temp > max){ + strTem += ">" + tmpr.setNum(max, 'f', 1); //为了不增加新的翻译项,大于号单独加 + } + else { + strTem += tmpr.setNum(temp, 'f', 1); + } + //} + strTem += (isC ? "℃" : "℉"); + //if(isHigh) + // m_label_msg->setText(tr("疑似高温")); + //else + // m_label_msg->setText(tr("低温异常")); + + //palette.setColor(QPalette::Background,QColor(200, 77, 79, 200));//红色异常体温 + } + if(temp < 0.0f){ + strTem = ""; + } + QFont ft; + ft.setPointSize(UiConfig::GetInstance()->recoUiFontSize(RecoUiTextCfg::TextTemp) ? + UiConfig::GetInstance()->recoUiFontSize(RecoUiTextCfg::TextTemp) : + static_cast(TMPR_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * + UiConfig::GetInstance()->recoUiTextCfgFontSize(RecoUiTextCfg::TextTemp))); + m_label_tem->setFont(ft); + m_label_tem->setText(strTem); + //setPalette(palette); + //show(); + + m_ForeheadTmpr = temp; + } +} + +void TmprWidget::setBackgroundColor(WIDGET_BG_COLOR_E color) +{ + QPalette pal(palette()); + if(WIDGET_BG_COLOR_GREEN == color){ + pal.setBrush(QPalette::Background, QBrush(QPixmap(TEMP_BG_GREEN_TOP_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + else if(WIDGET_BG_COLOR_RED == color){ + pal.setBrush(QPalette::Background, QBrush(QPixmap(TEMP_BG_RED_TOP_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + + pal.setColor(QPalette::WindowText,Qt::white); + setPalette(pal); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } +} + + +MsgWidget::MsgWidget(int timeType, int iconType, const QColor& textColor, QWidget *parent) : QWidget(parent), m_style(iconType) +{ + qDebug() << "MsgWidget()"; + + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText, textColor); + palette.setColor(QPalette::Background, QColor(0, 0, 0, 0)); + setPalette(palette); + + setAutoFillBackground(true); + + QFont ft; + //m_label_msgTop = new QLabel(this); + //m_label_msgTop->setText(tr("请刷脸通行")); + //ft.setPointSize(recoUiRecognize::MSG_WORD_SIZE); + //m_label_msgTop->setFont(ft); + + m_label_Icon = new QLabel(this); + //m_label_Icon->setFixedSize(recoUiRecognize::LOGO_SIZE, recoUiRecognize::LOGO_SIZE); + //QPixmap pm(":/res/image/logo.png"); + //m_label_Icon->setPixmap(pm.scaled(recoUiRecognize::LOGO_SIZE, recoUiRecognize::LOGO_SIZE, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + m_label_Icon->setAutoFillBackground(true); + setLogo(""); + + m_label_msgBtm = new QLabel(this); + ft.setPointSize(MSG_WORD_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_label_msgBtm->setFont(ft); + + m_label_msgNoti = new QLabel(this); + ft.setPointSize(NOTI_MSG_WORD_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_label_msgNoti->setFont(ft); + //m_label_msgNoti->setText("正在同步云端人员信息(99/100)");//for test + + m_label_networkStatus = new QLabel(this); + QPixmap pm; + pm.load(NO_NETWORK_RES_FILE[m_style][UiConfig::GetInstance()->getScreenConfigIndex()]); + //pm = pm.scaled(20, 20, Qt::KeepAspectRatio); + m_label_networkStatus->setPixmap(pm); + + m_label_time = new QLabel(this); + m_label_time->setText("12:34"); + ft.setPointSize(TIME_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_label_time->setFont(ft); + _timerUpdate = new TimerUpdate(m_label_time, this); + if(0 == timeType){ + m_label_time->hide(); + } + + m_label_ip = new QLabel(this); + m_label_ip->setText("xxx.xxx.xxx.xxx"); + ft.setPointSize(static_cast(TIME_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * 0.8)); + m_label_ip->setFont(ft); + + m_label_ipType = new QLabel(this); + pm.load(NET_ETH_IP_RES_FILE[m_style][UiConfig::GetInstance()->getScreenConfigIndex()]); + //pm = pm.scaled(20, 20, Qt::KeepAspectRatio); + m_label_ipType->setPixmap(pm); + + + //ft.setPointSize(static_cast(TIME_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * 0.8)); + m_labelDevId = new QLabel(this); + m_labelDevId->setFont(ft); + m_labelVer = new QLabel(this); + m_labelVer->setFont(ft); + QVBoxLayout* vLayoutInfo = new QVBoxLayout(); + vLayoutInfo->addStretch(); + vLayoutInfo->addWidget(m_labelDevId); + vLayoutInfo->addWidget(m_labelVer); + vLayoutInfo->setSpacing(0); + vLayoutInfo->setContentsMargins(10, 0, 0, 15);//setMargin(15);// + + QHBoxLayout* hLayoutIcon = new QHBoxLayout(); + hLayoutIcon->addWidget(m_label_Icon); + hLayoutIcon->setSpacing(0); + hLayoutIcon->setMargin(10); + + QHBoxLayout* hLayoutRight = new QHBoxLayout(); + hLayoutRight->addWidget(m_label_networkStatus, 8, Qt::AlignRight); + if(m_label_time){ + hLayoutRight->addWidget(m_label_time, 1, Qt::AlignRight); + } + hLayoutRight->setSpacing(5); + hLayoutRight->setMargin(5); + + QHBoxLayout* hLayoutIp = new QHBoxLayout(); + hLayoutIp->addWidget(m_label_ipType, 8, Qt::AlignRight); + hLayoutIp->addWidget(m_label_ip, 1, Qt::AlignRight); + hLayoutIp->setSpacing(5); + hLayoutIp->setMargin(5); + + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->addLayout(hLayoutRight, 50); + vLayout->addLayout(hLayoutIp, 2); + vLayout->setSpacing(0); + vLayout->setMargin(10); + + //by x 20210317 + QVBoxLayout* vLayoutMsg = new QVBoxLayout(); + vLayoutMsg->addWidget(m_label_msgBtm); + vLayoutMsg->addWidget(m_label_msgNoti); + vLayoutMsg->setSpacing(0); + vLayoutMsg->setMargin(0); + + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->addWidget(m_label_Icon);//, 1, Qt::AlignLeft + hLayout->addLayout(vLayoutInfo);//, 1 + //hLayout->addStretch(); + //hLayout->addWidget(m_label_msgBtm, 6, Qt::AlignCenter); //布局管理在其他组件消失时会位置偏移 + //hLayout->addWidget(m_label_networkStatus, 1, Qt::AlignRight); + //hLayout->addWidget(m_label_time, 1, Qt::AlignRight); + //hLayout->addLayout(hLayoutIcon, 1); + //hLayout->addLayout(vLayoutMsg, 80); //by x 20210317 + hLayout->addLayout(vLayout, 99); + hLayout->setContentsMargins(UiConfig::GetInstance()->getUiWidth() / 50, 0, 0, 0); + hLayout->setSpacing(0); + + //QVBoxLayout* vLayout = new QVBoxLayout(); + //vLayout->addLayout(hLayoutTop); + //vLayout->addLayout(hLayout); + //vLayout->setSpacing(20); + + setLayout(hLayout); +} + +MsgWidget::~MsgWidget() +{ + qDebug() << "~MsgWidget()"; +} + +/* +void MsgWidget::setMsgTop(const QString& msg) +{ + m_label_msgTop->setText(msg); +} +*/ + +void MsgWidget::setMsgBtm(const QString& msg, const bool setRedColor) +{ + if(msg != ""){ + m_label_msgBtm->setText(msg); + QPalette palette(this->palette()); + palette.setColor(QPalette::Background,QColor(0, 0, 0, 0)); + if(setRedColor){ + palette.setColor(QPalette::WindowText,Qt::red); + } + else{ + palette.setColor(QPalette::WindowText,Qt::white); + } + m_label_msgBtm->setPalette(palette); + m_label_msgBtm->setAlignment(Qt::AlignCenter); + QFont ft; + ft.setPointSize(static_cast(MSG_WORD_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * + UiConfig::GetInstance()->recoUiTextCfgFontSize(RecoUiTextCfg::TextNoEntry))); + m_label_msgBtm->setFont(ft); + //by x 20210317 + m_label_msgBtm->setFixedSize(UiConfig::GetInstance()->getUiWidth() * 0.7, height() / 2); + m_label_msgBtm->move((UiConfig::GetInstance()->getUiWidth() - m_label_msgBtm->width()) / 2, 0); //(height() - m_label_msgBtm->height()) / 2); + m_label_msgBtm->show(); + } + else{ + m_label_msgBtm->hide(); + } +} + +void MsgWidget::setMsgNoti(const QString& msg, int color) +{ + if(msg != ""){ + m_label_msgNoti->setText(msg); + QPalette palette(this->palette()); + palette.setColor(QPalette::Background,QColor(0, 0, 0, 0)); + switch(color) + { + case 0: + palette.setColor(QPalette::WindowText,Qt::white); + break; + case 1: + palette.setColor(QPalette::WindowText,Qt::red); + break; + case 2: + palette.setColor(QPalette::WindowText,Qt::yellow); + break; + case 3: + break; + default: + break; + } + m_label_msgNoti->setPalette(palette); + m_label_msgNoti->setAlignment(Qt::AlignCenter); + + //by x 20210317 + m_label_msgNoti->setFixedSize(UiConfig::GetInstance()->getUiWidth() * 0.5, height() / 2); + m_label_msgNoti->move((UiConfig::GetInstance()->getUiWidth() - m_label_msgNoti->width()) / 2, height() / 2); //(height() - m_label_msgNoti->height()) / 2); + m_label_msgNoti->show(); + + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } + } + else{ + m_label_msgNoti->hide(); + } +} + + +void MsgWidget::setLogo(const QString& pic, const bool scale) +{ + if(!pic.isEmpty()){ + QPixmap pm(pic); + if(scale){ + m_label_Icon->setFixedSize(height(), height()); + m_label_Icon->setPixmap(ScalePixmap2Label(pm, *m_label_Icon)); + } + else { + m_label_Icon->setPixmap(pm); + } + m_label_Icon->show(); + } + else{ + #if 0 + //使用颜色填充替代隐藏,隐藏后会导致其他组件位置变化 + m_label_Icon->clear(); + QPalette palette(this->palette()); + palette.setColor(QPalette::Background,QColor(0, 0, 0, 0)); + m_label_Icon->setPalette(palette); + #else + m_label_Icon->hide(); + #endif + } +} + +bool MsgWidget::hasNoMsg() +{ + return (m_label_msgBtm->text() == ""); +} + +void MsgWidget::setNetworkStatus(const int status) +{ + QPixmap pm; + switch(status) + { + case UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_DISCONNECTED: + pm.load(NO_NETWORK_RES_FILE[m_style][UiConfig::GetInstance()->getScreenConfigIndex()]); + break; + case UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_CONNECTED: + pm.load(NETWORK_CONNECTED_RES_FILE[m_style][UiConfig::GetInstance()->getScreenConfigIndex()]); + break; + case UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_LOGGED: + pm.load(NETWORK_LOGGED_RES_FILE[m_style][UiConfig::GetInstance()->getScreenConfigIndex()]); + break; + default: + break; + } + //m_label_networkStatus->setPixmap(pm.scaled(20, 20, Qt::KeepAspectRatio)); + m_label_networkStatus->setPixmap(pm); +} + +void MsgWidget::setBackgroundColor(const WIDGET_BG_COLOR_E color) +{ + QPalette pal(palette()); + if(WIDGET_BG_COLOR_BLUE == color){ + pal.setBrush(QPalette::Background,QBrush(QPixmap(BG_BLUE_BOM_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + else if(WIDGET_BG_COLOR_GREEN == color){ + pal.setBrush(QPalette::Background,QBrush(QPixmap(BG_GREEN_BOM_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + else if(WIDGET_BG_COLOR_RED == color){ + pal.setBrush(QPalette::Background,QBrush(QPixmap(BG_RED_BOM_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + setPalette(pal); +} + +void MsgWidget::updateIp(const QString& ip, int type) +{ + if(ip != "" && type >= 0){ + m_label_ip->setText(ip); + m_label_ip->show(); + + QPixmap icon; + switch(type){ + case 0:icon.load(NET_ETH_IP_RES_FILE[m_style][UiConfig::GetInstance()->getScreenConfigIndex()]);break; + case 1:icon.load(NET_WIFI_IP_RES_FILE[m_style][UiConfig::GetInstance()->getScreenConfigIndex()]);break; + #if 0 + case 2:icon.load(":/res/image/4g_1.png");break; + case 3:icon.load(":/res/image/4g_2.png");break; + case 4:icon.load(":/res/image/4g_3.png");break; + case 5:icon.load(":/res/image/4g_4.png");break; + case 6:icon.load(":/res/image/4g_5.png");break; + case 7:icon.load(":/res/image/4g_0.png");break; + #else + case 2 ... 7: + icon.load(QString(":/res/image/4g_%1%2.png").arg(type <= 6 ? type - 1 : 0).arg(1 == m_style ? "B" : ""));break; + #endif + default:break; + } + m_label_ipType->setPixmap(icon); + m_label_ipType->show(); + } + else { + m_label_ip->hide(); + m_label_ipType->hide(); + } + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } +} + +void MsgWidget::showDevInfo(const QString& devId, const QString& ver) +{ + m_labelDevId->setText("ID:" + devId); + m_labelVer->setText("VER:" + ver.mid(8)); +} + +void MsgWidget::setStyle(int timeType, int iconType, const QColor& textColor) +{ + if(0 == timeType){ + m_label_time->hide(); + }else{ + m_label_time->show(); + } + m_style = iconType; + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText, textColor); + setPalette(palette); +} + +void MsgWidget::showRecoUiDevIdAndVer(bool show) +{ + m_labelDevId->setVisible(show); + m_labelVer->setVisible(show); +} + + +DetectResultWidget::DetectResultWidget(QWidget *parent) : QWidget(parent) +{ + qDebug() << "DetectResultWidget()"; + + QPalette palette; + palette.setColor(QPalette::WindowText,Qt::white); + //palette.setColor(QPalette::Background,QColor(0, 0, 0, 0)); + setPalette(palette); + + m_label_Icon = new QLabel(this); + m_label_msg = new QLabel(this); + m_label_msg->setPalette(palette); + + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->addWidget(m_label_Icon, 1, Qt::AlignCenter); + hLayout->addWidget(m_label_msg, 4, Qt::AlignCenter); + hLayout->setMargin(0); + //hLayout->setSpacing(10); + setLayout(hLayout); + setFixedSize(DETECT_RESULT_WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()], + DETECT_RESULT_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + setAutoFillBackground(true); + + //hide(); +} + +DetectResultWidget::~DetectResultWidget() +{ + qDebug() << "~DetectResultWidget()"; +} + +void DetectResultWidget::showMsg(const QString& msg, int msgSize, BG_COLOR_E color, const QPixmap* icon) +{ + if("" == msg){ + hide(); + return; + } + + if(icon){ + m_label_Icon->setPixmap(*icon); + } + else { + m_label_Icon->hide(); + } + + QFont ft; + ft.setPointSize(msgSize); + m_label_msg->setFont(ft); + m_label_msg->setText(msg); + + QPalette pal(palette()); + if(BG_COLOR_BLUE == color){ + //setStyleSheet("border-image:url(:/res/image/SmartGate_scanFail.png);"); + pal.setBrush(QPalette::Background,QBrush(QPixmap(BG_BLUE_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + else if(BG_COLOR_RED == color){ + pal.setBrush(QPalette::Background,QBrush(QPixmap(BG_RED_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + if(BG_COLOR_GREEN == color){ + pal.setBrush(QPalette::Background,QBrush(QPixmap(":/res/image/msg_box_bg_green.png"))); + } + else if(BG_COLOR_YELLOW == color){ + pal.setBrush(QPalette::Background,QBrush(QPixmap(":/res/image/msg_box_bg_yellow.png"))); + } + else if(BG_COLOR_TRAN == color){ + m_label_msg->clear(); + pal.setColor(QPalette::Background,QColor(0, 0, 0, 0)); + m_label_msg->setPalette(pal); + } + + pal.setColor(QPalette::WindowText,Qt::white); + setPalette(pal); +} + +#if 1 + +void DetectResultWidget::updateMsg(const QString& msg) +{ + m_label_msg->setText(msg); +} + +MaskWidget_o::MaskWidget_o(QWidget *parent) : DetectResultWidget(parent), m_lastMaskOk(true) +{ + qDebug() << "MaskWidget()"; + m_iconMaskOk.load(":/res/image/green_mask.png"); + m_iconMaskOk = m_iconMaskOk.scaled(MASK_LOGO_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()], + MASK_LOGO_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()], + Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + m_iconMaskNull.load(":/res/image/red_mask.png"); + m_iconMaskNull = m_iconMaskNull.scaled(MASK_LOGO_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()], + MASK_LOGO_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()], + Qt::IgnoreAspectRatio, Qt::SmoothTransformation); +} + +void MaskWidget_o::setMaskMsg(bool maskOk, const QString& msg) +{ + //qDebug() << "setMaskMsg" << maskOk; + // if(isHidden() || m_lastMaskOk != maskOk) //by x 20220323 + { + //qDebug() << "m_lastMaskOk != maskOk"; + //need to adjust font size + int fontSize = UiConfig::GetInstance()->recoUiFontSize(maskOk ? RecoUiTextCfg::TextMaskOk : RecoUiTextCfg::TextNOMask) ? + UiConfig::GetInstance()->recoUiFontSize(maskOk ? RecoUiTextCfg::TextMaskOk : RecoUiTextCfg::TextNOMask) : + static_cast(UiConfig::MASK_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()] * + UiConfig::GetInstance()->recoUiTextCfgFontSize(maskOk ? RecoUiTextCfg::TextMaskOk : RecoUiTextCfg::TextNOMask)); + if(maskOk){ + showMsg(msg, fontSize, BG_COLOR_BLUE, &m_iconMaskOk); + } + else { + showMsg(msg, fontSize, BG_COLOR_RED, &m_iconMaskNull); + } + m_lastMaskOk = maskOk; + show(); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } + } +} + +void MaskWidget_o::showQRCodeMsg(UiInterfaceForBackstage::QRCode_Msg_E msg) +{ + QString str; + BG_COLOR_E color = BG_COLOR_TRAN; + int fontSize = UiConfig::GetInstance()->recoUiFontSize(2) ? UiConfig::GetInstance()->recoUiFontSize(2) : + static_cast(UiConfig::PERSON_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()] * + 1); + switch (msg) { + case UiInterfaceForBackstage::QRCode_Msg_Standby: + str = tr("请出示个人平安码"); + break; + case UiInterfaceForBackstage::QRCode_Msg_Verifying: + str = tr("正在验证..."); + break; + case UiInterfaceForBackstage::QRCode_Msg_Error: + str = tr("验证错误请重试"); + break; + case UiInterfaceForBackstage::QRCode_Msg_RedCode: + str = tr("请走人工通道"); //红码 + color = BG_COLOR_RED; + break; + case UiInterfaceForBackstage::QRCode_Msg_GreenCode: + str = tr("请通行"); //绿码 + color = BG_COLOR_GREEN; + break; + case UiInterfaceForBackstage::QRCode_Msg_YellowCode: + str = tr("请走人工通道"); //黄码 + color = BG_COLOR_YELLOW; + break; + case UiInterfaceForBackstage::QRCode_Msg_OtherCode: + str = tr("无效平安码"); + break; + case UiInterfaceForBackstage::QRCode_Msg_Overtime: + str = tr("扫码超时"); + break; + default: + break; + } + showMsg(str, fontSize, color); +} + +QString MaskWidget_o::curMsg() const +{ + return m_label_msg->text(); +} + +PersonWidget_o::PersonWidget_o(QWidget *parent) : DetectResultWidget(parent), isShowingResultMsg(false) +{ + qDebug() << "PersonWidget()"; + if(UiConfig::GetInstance()->isRkDevice()){ + m_label_msg->setAlignment(Qt::AlignCenter); + m_label_msg->setFixedSize(static_cast(DETECT_RESULT_WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()] * 0.98), + 64);//static_cast(DETECT_RESULT_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()] * 0.5) >> 2 << 2 ); + } +} + +void PersonWidget_o::setPersonMsg(RecoUiTextCfg::enTextType type, const QString& msg, const BG_COLOR_E color, const bool isResultMsg) +{ + //need to adjust font size + int fontSize = 0; + if(UiConfig::SUPPORT_LANGUAGE_QUANTITY > UiConfig::GetInstance()->getLanguageType()){ + fontSize = UiConfig::GetInstance()->recoUiFontSize(type) ? UiConfig::GetInstance()->recoUiFontSize(type) : + static_cast(UiConfig::PERSON_MSG_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->getLanguageType()] * + UiConfig::GetInstance()->recoUiTextCfgFontSize(type)); + } + showMsg(msg, fontSize, color); + //QCoreApplication::processEvents(); + isShowingResultMsg = isResultMsg; + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } +} + +bool PersonWidget_o::allowToShow() +{ + return (!isHidden() && isShowingResultMsg); +} + + +MaskWidget::MaskWidget(QWidget *parent) : QWidget(parent), m_lastMaskOk(true) +{ + qDebug() << "MaskWidget()"; + m_wgts = new QStackedWidget(this); + m_wgts->setFixedSize(DetectResultWidget::DETECT_RESULT_WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()], + DetectResultWidget::DETECT_RESULT_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + + MaskWidget_o* w = new MaskWidget_o(this); + w->setMaskMsg(true, "口罩检测通过"); + m_wgts->addWidget(w); + + w = new MaskWidget_o(this); + w->setMaskMsg(false, "未佩戴口罩"); + m_wgts->addWidget(w); + + m_wgts->addWidget(new QLabel(this)); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(m_wgts); + vlay->setMargin(0); + setLayout(vlay); + show(); +} + +void MaskWidget::setMaskMsg(bool maskOk, const QString& msg) +{ + MaskWidget_o* w = dynamic_cast(m_wgts->widget(maskOk ? 0 : 1)); + if(w && msg != w->curMsg()){ + qDebug() << "-----------------------curMsg:" << w->curMsg() << ", set msg:" << msg; + w->updateMsg(msg); + } + m_wgts->setCurrentIndex(maskOk ? 0 : 1); +} + +void MaskWidget::showQRCodeMsg(UiInterfaceForBackstage::QRCode_Msg_E msg) +{ + +} + +void MaskWidget::hideSelf() +{ + m_wgts->setCurrentIndex(2); +} + + +PersonWidget::PersonWidget(QWidget *parent) : QWidget(parent), isShowingResultMsg(false) +{ + qDebug() << "MaskWidget()"; + + m_wgts = new QStackedWidget(this); + + PersonWidget_o* w = new PersonWidget_o(this); + w->setPersonMsg(RecoUiTextCfg::TextFacePass, "111", DetectResultWidget::BG_COLOR_BLUE, false); + m_wgts->addWidget(w); + + w = new PersonWidget_o(this); + w->setPersonMsg(RecoUiTextCfg::TextAuthFailed, "222", DetectResultWidget::BG_COLOR_RED, false); + m_wgts->addWidget(w); + + m_wgts->addWidget(new QLabel(this)); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(m_wgts); + setLayout(vlay); + + m_wgts->setFixedSize(DetectResultWidget::DETECT_RESULT_WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()], + DetectResultWidget::DETECT_RESULT_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); +} + +void PersonWidget::setPersonMsg(RecoUiTextCfg::enTextType type, const QString& msg, const BG_COLOR_E color, const bool isResultMsg) +{ + if(msg.isEmpty()){ + m_wgts->setCurrentIndex(2); + return; + } + + if(BG_COLOR_BLUE == color){ + m_wgts->setCurrentIndex(0); + PersonWidget_o* w = dynamic_cast(m_wgts->widget(0)); + if(w){ + w->updateMsg(msg); + } + }else if(BG_COLOR_TRAN == color){ + m_wgts->setCurrentIndex(2); + }else{ + m_wgts->setCurrentIndex(1); + PersonWidget_o* w = dynamic_cast(m_wgts->widget(1)); + if(w){ + w->updateMsg(msg); + } + } + + isShowingResultMsg = isResultMsg; + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } + QCoreApplication::processEvents(); +} + +bool PersonWidget::allowToShow() +{ + return (!isHidden() && isShowingResultMsg); +} + +#endif + + +recoUiRecognize::recoUiRecognize(bool isNightMode, bool hasPwdBtn, bool hasCallBtn, QWidget *parent) : PageAcceptMouseAndTouch(parent), + m_clickCount(0), m_currentBackColor(MSG_BG_COLOR_BOM_NULL), + m_tempRefresh(-1), m_maskRefresh(-1), m_personRefresh(-1), m_NotiMsgRefresh(-1), m_msgShowed(false),m_faceAivaliable(false), m_showGreenColor(0), + m_showRedColor(0), runScanLine(false), timerTimeoutOperation(0), m_widget_progress(nullptr) +{ + qDebug() << "recoUiRecognize()"; + + //setAttribute(Qt::WA_AcceptTouchEvents); + //installEventFilter(this);//screen click event + QString backImg = BG_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]; + int msg_widget_height = MSG_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]; + m_label_back = new QLabel(this); + m_label_back->setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + + if(!UiConfig::GetInstance()->isFuncNotSupport(FuncCardReaderUnderScreen)){ + m_wgtCardUnderScreen = new QWidget(this); + m_wgtCardUnderScreen->setAutoFillBackground(true); + m_wgtCardUnderScreen->setFixedSize(SWIP_CARD_WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()], + SWIP_CARD_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_wgtCardUnderScreen->move((UiConfig::GetInstance()->getUiWidth() - SWIP_CARD_WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()]) / 2, + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.73)); + } + else{ + m_wgtCardUnderScreen = nullptr; + } + + slotShowRecoUiMask(isNightMode ? 3 : 1); //for show below person wgt + + int tmprWidgetHeight = TmprWidget::TMPR_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]; + m_widget_tmpr = new TmprWidget(this); + m_widget_tmpr->setFixedSize(UiConfig::GetInstance()->getUiWidth(), tmprWidgetHeight); + //m_widget_tmpr->hide(); + m_widget_tmpr->move(0, UiConfig::GetInstance()->getUiHeight()); + + const int maskWidgetWidth = DetectResultWidget::DETECT_RESULT_WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()]; + const int maskWgtx = (UiConfig::GetInstance()->getUiWidth() - maskWidgetWidth) / 2; + const int maskWgty = static_cast(UiConfig::GetInstance()->getUiHeight() * 0.1); + m_widget_mask = new MaskWidget(this); + m_widget_mask->move(maskWgtx, maskWgty); +#if 0 + m_widget_mask->hide();//by x 20220322 +#endif + + m_widget_cMsg = new CenterMsgWidget(); //不继承父组件样式 + //m_widget_cMsg->move((UiConfig::GetInstance()->getUiWidth() - CenterMsgWidget::WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()]) / 2, + // static_cast(UiConfig::GetInstance()->getUiHeight() * 0.3)); + m_widget_cMsg->hide(); + + m_widget_person = new PersonWidget(this); + m_widget_person->setPersonMsg(RecoUiTextCfg::TextFacePass, recoUiTextCfg(RecoUiTextCfg::TextFacePass), PersonWidget::BG_COLOR_BLUE, false);//tr("请刷脸通行") + + //const int m_widget_msg_height = 100; + m_widget_msg = new MsgWidget(1, 1, Qt::white, this); + m_widget_msg->setFixedSize(UiConfig::GetInstance()->getUiWidth(), msg_widget_height); + //m_widget_msg->move(0, UiConfig::SCREEN_HIGHT - m_widget_msg_height); + + _moveScanner = new QLabel(this); + _moveScanner->setAutoFillBackground(true); + _moveScanner->setPixmap(SCANLINE_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]); + _moveScanner->setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight() / 25); + _moveScanner->hide(); + + #if 0 + _ScanCurorAnimation = new QPropertyAnimation(_moveScanner, "geometry"); + _ScanCurorAnimation->setDuration(SCAN_LINE_RUN_TIME); + _ScanCurorAnimation->setStartValue(QRect(0, -SCAN_LINE_HEIGHT, _moveScanner->width(), _moveScanner->height())); //从顶端平滑出现 + _ScanCurorAnimation->setEndValue(QRect(0, UiConfig::GetInstance()->getUiHeight() - SCAN_LINE_HEIGHT, _moveScanner->width(), _moveScanner->height())); + //_ScanCurorAnimation->setLoopCount(-1); //一直循环 + //_ScanCurorAnimation->start(); + #endif + + _pShowResTimer = new QTimer(this); + connect(_pShowResTimer, SIGNAL(timeout()), this, SLOT(handleRecoResShowTime())); + + //_timerId = startTimer(3000);//scaner timer + + //scan line + m_timer_QRCodeScanLine = new QTimer(this); + connect(m_timer_QRCodeScanLine, SIGNAL(timeout()), this, SLOT(slotTimerQRCodeScanline())); + + m_label_QRCodeScanLine = new QLabel(this); + m_label_QRCodeScanLine->setAutoFillBackground(true); + m_label_QRCodeScanLine->setPixmap(QPixmap(":/res/image/scan-line-small.png")); + m_label_QRCodeScanLine->setFixedSize(UiConfig::GetInstance()->getQRCodeAreaWidth(), UiConfig::GetInstance()->getUiHeight() / 40); + m_label_QRCodeScanLine->hide(); + + m_QRCodeAnimation = new QPropertyAnimation(m_label_QRCodeScanLine, "geometry"); + m_QRCodeAnimation->setDuration(QRCODE_SCAN_LINE_RUN_TIME); + m_QRCodeAnimation->setStartValue(QRect(UiConfig::GetInstance()->getQRCodeAreaCoordinateX(), UiConfig::GetInstance()->getQRCodeAreaCoordinateY(), + m_label_QRCodeScanLine->width(), m_label_QRCodeScanLine->height())); //从顶端平滑出现 + m_QRCodeAnimation->setEndValue(QRect(UiConfig::GetInstance()->getQRCodeAreaCoordinateX(), + UiConfig::GetInstance()->getQRCodeAreaCoordinateY() + UiConfig::GetInstance()->getQRCodeAreaHeight() - m_label_QRCodeScanLine->height(), + m_label_QRCodeScanLine->width(), m_label_QRCodeScanLine->height())); + m_QRCodeTimer = new QTimer(this); + connect(m_QRCodeTimer, SIGNAL(timeout()), this, SLOT(slotQRCodeSwitchToStandbyStatusFromOvertimeStatus())); + + /* + movie = new QMovie("/nfsroot/a038/source/GateFaceHisi/build/4.gif"); + m_label_back = new QLabel(this); + m_label_back->setFixedSize(600, 1024); + m_label_back->setMovie(movie); + movie->start(); + */ + + m_btnPwd = new QWidget(this); + m_btnPwd->setAutoFillBackground(true); + m_btnPwd->setFixedSize(PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()], + PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + const int pwdBtnX = maskWgtx + maskWidgetWidth + (maskWgtx - PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()]) / 2; + const int pwdBtnY = maskWgty + (DetectResultWidget::DETECT_RESULT_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()] - + PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()]) / 2; + m_btnPwd->move(pwdBtnX, pwdBtnY); + QPalette pwdPal(m_btnPwd->palette()); + pwdPal.setBrush(QPalette::Background,QBrush(QPixmap(recoUiRecognize::PWD_BTN[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_btnPwd->setPalette(pwdPal); + /*QString m_btnPwd = QString("QPushButton{background:url(%1); background-color:transparent;border: none; }" //正常 + "QPushButton:hover{background:url(%2); background-color:transparent; }" //滑过 + "QPushButton:pressed{background:url(%3); background-color:transparent; }") //按下 + .arg(PWD_BTN[UiConfig::GetInstance()->getScreenConfigIndex()]) + .arg(PWD_BTN_PRESSED[UiConfig::GetInstance()->getScreenConfigIndex()]) + .arg(PWD_BTN_PRESSED[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_btnPwd->setStyleSheet(styleSheet); + */ + if(!hasPwdBtn){ + m_btnPwd->hide(); + } + + QPalette dialPal; + dialPal.setBrush(QPalette::Background,QBrush(QPixmap(":/res/image/grey_bg_large.png"))); + const int callWgtWidth = 400; + const int callWgtHeight = 128; + const int callWgtPosY = static_cast(UiConfig::GetInstance()->getUiHeight() * 0.6); + const int callWgtDevPosX = static_cast(UiConfig::GetInstance()->getUiWidth() * 0.55); + const int callWgtMngCenterPosX = -(callWgtDevPosX + callWgtWidth - UiConfig::GetInstance()->getUiWidth()); + QFont ft; + + m_wgtCallDialDev = new RoundedWidget(this); +#if 0 + dialPal.setColor(QPalette::WindowText, QColor(18, 165, 127)); +#else + dialPal.setColor(QPalette::WindowText,Qt::darkGray); + m_wgtCallDialDev->setDisabled(true); +#endif + m_wgtCallDialDev->setPalette(dialPal); + m_wgtCallDialDev->setAutoFillBackground(true); + m_wgtCallDialDev->setFixedSize(callWgtWidth, callWgtHeight); + m_wgtCallDialDev->move(callWgtDevPosX, callWgtPosY); +#if 0 + m_wgtCallDialDev->setFixedSize(PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()], + PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + dialPal.setBrush(QPalette::Background,QBrush(QPixmap(recoUiRecognize::CALL_BTN[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_wgtCallDialDev->move(pwdBtnX - PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()] - 20, pwdBtnY); +#endif + QLabel* labelCallDevIcon = new QLabel(m_wgtCallDialDev); + labelCallDevIcon->setPixmap(QPixmap(":/res/image/call1_large.png")); + QLabel* labelCallDevText = new QLabel(tr("呼叫设备"), m_wgtCallDialDev); + labelCallDevText->setAlignment(Qt::AlignCenter); + ft.setPointSize(12); + labelCallDevText->setFont(ft); + + QHBoxLayout* hlayCallDev = new QHBoxLayout(); + hlayCallDev->setMargin(30); + hlayCallDev->addSpacing(10); + hlayCallDev->addWidget(labelCallDevIcon); + hlayCallDev->addWidget(labelCallDevText); + hlayCallDev->addStretch(); + m_wgtCallDialDev->setLayout(hlayCallDev); + if(!hasCallBtn){ + m_wgtCallDialDev->hide(); + } + + m_wgtCallMngCenter = new RoundedWidget(this); + dialPal.setColor(QPalette::WindowText, QColor(18, 150, 219)); + m_wgtCallMngCenter->setPalette(dialPal); + m_wgtCallMngCenter->setAutoFillBackground(true); + m_wgtCallMngCenter->setFixedSize(callWgtWidth, callWgtHeight); + m_wgtCallMngCenter->move(callWgtMngCenterPosX, callWgtPosY); + + QLabel* MngCenter = new QLabel(m_wgtCallMngCenter); + MngCenter->setPixmap(QPixmap(":/res/image/customer_service_large.png")); + QLabel* labelCallMngCenterText = new QLabel(tr("呼叫管理处"), m_wgtCallMngCenter); + labelCallMngCenterText->setFont(ft); + labelCallMngCenterText->setAlignment(Qt::AlignCenter); + QHBoxLayout* hlayCallMngCenter = new QHBoxLayout(); + hlayCallMngCenter->setMargin(30); + hlayCallMngCenter->addStretch(); + hlayCallMngCenter->addWidget(MngCenter); + hlayCallMngCenter->addWidget(labelCallMngCenterText); + //hlayCallMngCenter->addStretch(); + m_wgtCallMngCenter->setLayout(hlayCallMngCenter); + if(!hasCallBtn){ + m_wgtCallMngCenter->hide(); + } + + m_resWgt = new FinalResultWidget(this); + m_resWgt->move((UiConfig::GetInstance()->getUiWidth() - FinalResultWidget::FINAL_RESULT_WIDGET_W_H[UiConfig::GetInstance()->getScreenConfigIndex()]) / 2, + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.65)); + m_resWgt->hide(); + + m_healthCodeAuthstatus = new QLabel("未授权", this); + QPalette authPal(m_healthCodeAuthstatus->palette()); + authPal.setColor(QPalette::WindowText,Qt::white); + m_healthCodeAuthstatus->setPalette(authPal); + m_healthCodeAuthstatus->setAlignment(Qt::AlignRight); + m_healthCodeAuthstatus->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.2), + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.05)); + m_healthCodeAuthstatus->hide(); + m_healthCodeAuthstatus->move(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.8), + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.9)); + + m_wgtSceneMsg = new SceneMsgWidget(this); + m_wgtSceneMsg->setVisible(false); // BUG B045-182: 防止其他模式刚上电时会看到这个组件 + + QVBoxLayout* vLayout = new QVBoxLayout(); + //vLayout->addWidget(m_widget_tmpr, 1, Qt::AlignTop | Qt::AlignCenter); //温度不加如布局管理器,因为使用move方式控制show 和 hide + //vLayout->addWidget(m_widget_mask, 50, Qt::AlignTop | Qt::AlignCenter); //口罩不加到布局管理器,因为温度不一定显示,如果加入,温度不显示时口罩会跳到顶端 +#if 1 + vLayout->addWidget(m_widget_person, 50, Qt::AlignBottom | Qt::AlignCenter); +#else + QHBoxLayout* hlayPerWgtPwdBtn = new QHBoxLayout(); + hlayPerWgtPwdBtn->addSpacing((UiConfig::GetInstance()->getUiWidth() - m_widget_person->width()) / 2); + hlayPerWgtPwdBtn->addWidget(m_widget_mask); + hlayPerWgtPwdBtn->addStretch(); + hlayPerWgtPwdBtn->addWidget(m_btnPwd, 1, Qt::AlignRight); + hlayPerWgtPwdBtn->setContentsMargins(0, 0, UiConfig::GetInstance()->getUiWidth() * 0.03, 0); + vLayout->addStretch(50); + vLayout->addLayout(hlayPerWgtPwdBtn); +#endif + vLayout->addWidget(m_widget_msg, 1, Qt::AlignBottom | Qt::AlignCenter); + vLayout->setMargin(0); + setLayout(vLayout); + + m_widget_mask->hideSelf(); +} + +recoUiRecognize::~recoUiRecognize() +{ + qDebug() << "~recoUiRecognize()"; + if(m_widget_cMsg){ + delete m_widget_cMsg; + } +} + +bool recoUiRecognize::eventFilter(QObject *watched, QEvent *event) +{ + if( watched == this){ + if(event->type() == QEvent::MouseButtonPress){ + qDebug() << "MouseButtonPress"; + emit signalScreenTouch(); + if(multiPressToSettingPage()){ + QPoint pos; + pos.setX(UiConfig::GetInstance()->getUiWidth() / 2); + pos.setY(UiConfig::GetInstance()->getUiHeight() / 2); + QCursor::setPos(pos); + } + } + else{ + return false; + } + } + else{ + return QWidget::eventFilter(watched, event); + } + + return false; +} + +void recoUiRecognize::setBackstageUiinterface(BackstageInterfaceForUi *interface) +{ + m_backstageIf = interface; + +#if VERSION_XIAMEN_GONGAN == 0 + if(m_backstageIf){ + if(m_backstageIf->getQRCodeSwitch()){ + m_widget_person->hide(); + + m_widget_mask->showQRCodeMsg(UiInterfaceForBackstage::QRCode_Msg_Standby); + + setBackgroundColor(MSG_BG_COLOR_QRCODE); + + runQRCodeScanLine(); + } + + char buf[64] = {'\0'}; + m_backstageIf->getDeviceId(buf, sizeof(buf)); + QString devId{buf}; + memset(buf, 0, sizeof(buf)); + m_backstageIf->getAppVersion(buf, sizeof(buf)); + QString ver{buf}; + m_widget_msg->showDevInfo(devId, ver); + m_widget_msg->showRecoUiDevIdAndVer(m_backstageIf->getShowIdAndVerSw()); + m_wgtSceneMsg->setType(m_backstageIf->getTicketModePeopleCountType()); + setTicketCheckCount(-1, m_backstageIf->getTicketCheckCountToday()); + } +#endif +} + +void recoUiRecognize::timerEvent(QTimerEvent *event) +{ +#if 0 + if(_timerId == event->timerId()) + { + qDebug() << "timerEvent()"; + _ScanCurorAnimation->start(); + } +#endif +} + +void recoUiRecognize::slotsNoSuccessPage(const int nPage) +{ + //qDebug() << "slotsNoSuccessPage"; + closeRecoResTime(); + if(nPage >= GLOBAL_RECO_END_NO && nPage <= GLOBAL_RECO_SHOW_QRCODE) + { + showRecoFail((GLOBAL_RECO_STATE)nPage); + } + else if(GLOBAL_RECO_ID_FAILED == nPage) + { + showRecoIDFail(); + } + else if(GLOBAL_RECO_IN == nPage) + { + //qDebug() << "slotsNoSuccessPageshowRecoNoScanner"; + + //if(!m_widget_tmpr->isHidden()){ + if(0 == m_widget_tmpr->pos().y()){ + //qDebug() << "cancle scanner, hide temp window"; + //m_widget_tmpr->hide(); //没有人脸,转到人脸识别系统显示,此时隐藏温度提示 + m_widget_tmpr->move(0, UiConfig::GetInstance()->getUiHeight()); + m_widget_msg->setMsgBtm(tr("")); + } + } + else if(GLOBAL_RECO_CHECK == nPage) + { + showRetry(); + } + else if(GLOBAL_RECO_MASK_REQ == nPage) + { + showNoMaskWarn(); //请戴口罩 + } + else if(GLOBAL_RECO_MASK_OK == nPage) + { + showMaskOk(); + } + else if(GLOBAL_RECO_TAKE_OFF_MASK == nPage) + { + showMaskWarn(); + } + else if(GLOBAL_RECO_NO_ENTRY == nPage) + { + showNoEntry(); + } + else if(GLOBAL_RECO_CLEAR_NO_ENTRY == nPage) + { + clearNoEntry(); + } + else if(GLOBAL_RECO_CLOSE_SCANLINE == nPage) + { + //qDebug() << "GLOBAL_RECO_CLOSE_SCANLINE == nPage"; + setScannerState(SCAN_LINE_SWITCH_OFF); + +#if 0 + //如果取消扫描线了,当前定时器在运行,立即调用槽函数 + if(_pShowResTimer->isActive()) + { + _pShowResTimer->stop(); + _pShowResTimer->start(1); + } +#endif + } + else if(GLOBAL_RECO_SHOW_QRCODE_RECO == nPage) + { + //显示识别二维码界面 + //showQRCodeReco(); + } + else if(GLOBAL_RECO_SHOW_FACE_RECO == nPage) + { + showFaceReco(); + } + else + { + //NOP + } +} + +//返回值:0 扫描线状态有变化 +//返回值:-1 扫描线状态没有变化 +int recoUiRecognize::setScannerState(const SCAN_LINE_SWITCH_E sw) +{ + int ret = -1; + //if(sw != m_currentScanLine) + { + if(SCAN_LINE_SWITCH_OFF == sw){ + //qDebug() << "runScanLine = false"; + _moveScanner->hide(); + if(true == runScanLine){ + runScanLine = false; + ret = 0; + } + } + else if(SCAN_LINE_SWITCH_BLUE == sw){ + m_widget_person->hide(); //画扫描线时关闭人员信息 + if(false == runScanLine){ + runScanLine = true; + _pShowResTimer->start(SCAN_LINE_RUN_TIME * 30 / 1000); + int startPos = static_cast(UiConfig::GetInstance()->getUiHeight() * SCAN_LINE_START_POS_SCALE); + _moveScanner->move(0, startPos); + m_scanLinePos = startPos; + ret = 0; + } +#if 0 + if(false == runScanLine){ + _ScanCurorAnimation->start(); + _pShowResTimer->start(SCAN_LINE_RUN_TIME); + runScanLine = true; + _moveScanner->show(); + timerTimeoutOperation = 0; + //qDebug() << "runScanLine = true"; + } +#endif + } + else if(SCAN_LINE_SWITCH_RED == sw){ + m_widget_person->hide(); //画扫描线时关闭人员信息 +#if 0 + if(false == runScanLine){ + _pShowResTimer->start(SCAN_LINE_TIMER); + _ScanCurorAnimation->start(); + _moveScanner->show(); + runScanLine = true; + timerTimeoutOperation = 0; + } +#endif + } + m_currentScanLine = sw; + } + return ret; +} + +void recoUiRecognize::setBackgroundColor(const MSG_BG_COLOR_E index) +{ + QPixmap pm; + switch (index) { + case MSG_BG_COLOR_BOM_BLUE: + m_widget_tmpr->move(0, UiConfig::GetInstance()->getUiHeight()); + m_widget_msg->setBackgroundColor(WIDGET_BG_COLOR_BLUE); + break; + case MSG_BG_COLOR_BOM_GREEN: + break; + case MSG_BG_COLOR_BOM_TOP_GREEN: + m_widget_tmpr->setBackgroundColor(WIDGET_BG_COLOR_GREEN); + m_widget_msg->setBackgroundColor(WIDGET_BG_COLOR_GREEN); + break; + case MSG_BG_COLOR_BOM_RED: + break; + case MSG_BG_COLOR_BOM_TOP_RED: + m_widget_tmpr->setBackgroundColor(WIDGET_BG_COLOR_RED); + m_widget_msg->setBackgroundColor(WIDGET_BG_COLOR_RED); + break; + case MSG_BG_COLOR_QRCODE: + //m_stackwig_back->setCurrentIndex(3); + break; + default: + break; + } + m_currentBackColor = index; +} + +void recoUiRecognize::showRecoScanner() +{ + //qDebug() << "showRecoScanner"; + if(0 == setScannerState(SCAN_LINE_SWITCH_BLUE)){ + //m_widget_tmpr->hide(); + m_widget_tmpr->move(0, UiConfig::GetInstance()->getUiHeight()); +#if 0 + m_widget_mask->hide();//by x 20220322 +#else + m_widget_mask->hideSelf(); +#endif + //qDebug() << "setBackgroundColor(MSG_BG_COLOR_BOM_BLUE)"; + setBackgroundColor(MSG_BG_COLOR_BOM_BLUE); + //最终结果区域情况,跟扫描线互斥 + m_widget_msg->setMsgBtm(tr("")); + } +} + +void recoUiRecognize::showRetry() +{ + //qDebug() << "showRetry"; + //m_widget_msg->setMsgTop(tr("请靠近重试")); + // m_widget_msg->setMsgBtm(tr("")); + //setScannerState(SCAN_LINE_SWITCH_BLUE);//xxxxxxxxxxxxx + // setBackgroundColor(MSG_BG_COLOR_BOM_BLUE); +} + +void recoUiRecognize::showNoMaskWarn() //请戴口罩 +{ + //if(! || !m_widget_mask->isHidden()){ //不阻塞扫描线 + m_maskRefresh = 2; + if(_moveScanner->isHidden()){ //阻塞扫描线 + showMaskMsg(); + } +} + +void recoUiRecognize::showMaskWarn() +{ + m_maskRefresh = 3; + if(_moveScanner->isHidden()){ //阻塞扫描线 + showMaskMsg(); + } +} + +void recoUiRecognize::showMaskOk() //口罩检测成功 +{ + //qDebug() << "showMaskOk"; + //如果当前正在画扫描线,显示内容,没有画扫描线说明已经没有人员在画面中了,下层会出现无人在画面的调用后再调显示人员信息,导致信息残留在画面一直不消失 + //如果当前口罩在显示,那可以刷新口罩内容,例如人脸在画面中一直脱戴口罩的情况,但是没有画扫描线了,此时还能刷新口罩结果 + //if(! || !m_widget_mask->isHidden()){ //不阻塞扫描线 + m_maskRefresh = 1; + if(_moveScanner->isHidden()){ //阻塞扫描线 + showMaskMsg(); + } +} + +void recoUiRecognize::showNoEntry() +{ + m_NoEntryRefresh = 1; + if(_moveScanner->isHidden()){ + showNoEntryMsg(); + } +} + +void recoUiRecognize::clearNoEntry() +{ + m_NoEntryRefresh = 2; + if(_moveScanner->isHidden()){ + showNoEntryMsg(); + } +} + +int recoUiRecognize::setCamVideoWind() +{ + return m_backstageIf->recoUiTypeSwitch(0, 0, UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); +} + +void recoUiRecognize::setStyle(int style) +{ + if(4 == style){ + m_bgSceneIdle = QPixmap(":/res/image/reco_ui_scene_bg_medium.jpg"); + m_label_back->setPixmap(m_bgSceneIdle); + if(m_wgtCardUnderScreen){m_wgtCardUnderScreen->hide();} + m_widget_msg->setStyle(0, 0, Qt::black); + m_wgtSceneMsg->show(); + }else{ + m_label_back->setPixmap(m_bgPm); + if(m_wgtCardUnderScreen){m_wgtCardUnderScreen->show();} + m_widget_msg->setStyle(1, 1, Qt::white); + m_wgtSceneMsg->hide(); + } + m_widget_person->setPersonMsg(RecoUiTextCfg::TextFacePass, recoUiTextCfg(RecoUiTextCfg::TextFacePass), PersonWidget::BG_COLOR_BLUE, false); + +} + +void recoUiRecognize::setSceneUiReco(bool toReco) +{ + m_label_back->setPixmap(toReco ? m_bgPm : m_bgSceneIdle); +} + +void recoUiRecognize::setTicketCheckCount(int source, int count) +{ + m_wgtSceneMsg->setPersonNum(source, count); +} + +void recoUiRecognize::setScenePersonCountType(int type) +{ + m_wgtSceneMsg->setType(type); +} + +void recoUiRecognize::slotShowOrHideFaceFrame(bool show) +{ + //设备连接测温模块启动后移除测温,web上设置人形框 + if(UiConfig::GetInstance()->isFaceFrameShowByTempExist()){ + UiConfig::GetInstance()->showFaceFrameByTempExist(false); + } + m_showFaceFrameByUser = show; + if(!m_isNightMode){ + slotShowRecoUiMask(1); + } +} + +void recoUiRecognize::slotShowFinalResult(bool pass) +{ + if(UiConfig::GetInstance()->isRecoUiStyleStandard()){ + m_resWgt->showResult(pass); + } +} + +void recoUiRecognize::slotShowHealthCodeAuthStatus(int status) +{ + switch(status){ + case 0:m_healthCodeAuthstatus->hide();break; + case 1:m_healthCodeAuthstatus->show();break; + case 2:m_healthCodeAuthstatus->setText("未授权");break; + case 3:m_healthCodeAuthstatus->setText("已授权");break; + case 4:m_healthCodeAuthstatus->setText("授权不可用");break; + default:break; + } +} + +void recoUiRecognize::slotShowCallBtn(bool show) +{ + m_wgtCallDialDev->setVisible(show); + m_wgtCallMngCenter->setVisible(show); +} + +void recoUiRecognize::slotShowRecoUiDevIdAndVer(bool show) +{ + m_widget_msg->showRecoUiDevIdAndVer(show); +} + +void recoUiRecognize::showRecoFail(GLOBAL_RECO_STATE failType) +{ + m_personRefresh = failType; + if(_moveScanner->isHidden()){ // m_widget_person->allowToShow() + showPersonWidgetMsg(); + } +} + +void recoUiRecognize::showRecoIDFail() +{ + m_personRefresh = GLOBAL_RECO_ID_FAILED; + if(_moveScanner->isHidden()){ + showPersonWidgetMsg(); + } +} + +void recoUiRecognize::closeRecoResTime() +{ + //if(_pShowResTimer->isActive()) + { + // _pShowResTimer->stop(); + } +} + +void recoUiRecognize::slotsSuccessPage(const int nPage, const QString& name) +{ + if( GLOBAL_RECO_END_OK != nPage) + { + return ; + } + closeRecoResTime(); + + m_personRefresh = GLOBAL_RECO_END_OK; + m_name = name; + if(_moveScanner->isHidden()){ + showPersonWidgetMsg(); + } +} + +void recoUiRecognize::slotsDrawScanner(const int nPage, const bool faceAvailable) +{ + //qDebug()<<"slotsDrawScanner():" << nPage <<" face: " << faceAvailable; + if(!faceAvailable) + { + //qDebug() << "(sum <= 0) && (nullptr == pInfo showRecoNoScanner()"; + m_currentBackColor = MSG_BG_COLOR_BOM_NULL; + + setScannerState(SCAN_LINE_SWITCH_OFF); + //if(!m_widget_tmpr->isHidden()) + if(0 == m_widget_tmpr->pos().y()) + { + //m_widget_tmpr->hide(); //没有人脸,转到人脸识别系统显示,此时隐藏温度提示 + m_widget_tmpr->move(0, UiConfig::GetInstance()->getUiHeight()); + } + #if 0 + if(!m_widget_mask->isHidden()){ + m_widget_mask->hide();//by x 20220322 + } + #else + m_widget_mask->hideSelf(); + #endif + + setBackgroundColor(MSG_BG_COLOR_BOM_BLUE); + + m_widget_person->setPersonMsg(RecoUiTextCfg::TextFacePass, recoUiTextCfg(RecoUiTextCfg::TextFacePass), PersonWidget::BG_COLOR_BLUE, false);//tr("请刷脸通行") + m_widget_msg->setMsgBtm(tr("")); + + if(UiConfig::GetInstance()->isRecoUiStyleStandard()){ + m_resWgt->hide(); + }else if(UiConfig::GetInstance()->isRecoUiStyleScene()){ + m_label_back->setPixmap(m_bgSceneIdle); + } + + m_msgShowed = false; + //qDebug() << "m_faceAivaliable set false"; + m_faceAivaliable = false; + + m_tempRefresh = -1; + m_maskRefresh = -1; + m_personRefresh = -1; + m_NotiMsgRefresh = -1; + m_NoEntryRefresh = 0; + m_showGreenColor = 0; + m_showRedColor = 0; + return ; + } + + m_faceAivaliable = true; + + if(GLOBAL_RECO_IN_SCANNER != nPage) + { + return ; + } + + closeRecoResTime(); + showRecoScanner(); +} + +void recoUiRecognize::slotShowNormalTemp(const float temp, const bool isC) +{ + m_widget_tmpr->showNormalTemp(recoUiTextCfg(RecoUiTextCfg::TextTemp), temp, isC); + + #if 0 + if(true == runScanLine){ + m_tempRefresh = 1; + } + #endif + + m_tempRefresh = 1; + if(_moveScanner->isHidden()){ + showTempMsg(); + } +} + +void recoUiRecognize::slotShowAbnormalTemp(const float temp, const bool isHigh, const bool isC) +{ + m_widget_tmpr->showAbnormalTemp(recoUiTextCfg(RecoUiTextCfg::TextTemp), temp, isHigh, isC); + + #if 0 + if(true == runScanLine){ + if(isHigh){ + m_tempRefresh = 2; + } + else { + m_tempRefresh = 3; + } + } + #endif + if(isHigh){ + m_tempRefresh = 2; + } + else { + m_tempRefresh = 3; + } + if(_moveScanner->isHidden()){ + showTempMsg(); + } +} + +void recoUiRecognize::slotsInteractionChange(const INTERACION_OPTION &interaction, int nSelectRes) +{ + if(OPTION_LOGO == interaction){ + QString logo; + if(0 == nSelectRes){ + logo = LOGO_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]; + m_widget_msg->setLogo(logo); + } + else if(1 == nSelectRes){ + logo = ""; + m_widget_msg->setLogo(logo); + } + else if(2 == nSelectRes){ //自定义logo + if(m_backstageIf){ + char logoPath[256] = {'\0'}; + if(0 == m_backstageIf->getCustomLogo(logoPath, sizeof(logoPath))){ + logo = QString(logoPath); + m_widget_msg->setLogo(logo, true); + } + } + } + } +} + +void recoUiRecognize::slotUpdateLogo(const int option) +{ + slotsInteractionChange(OPTION_LOGO, option); +} + +void recoUiRecognize::handleRecoResShowTime() +{ + if(m_scanLineInterval > 0 && true == runScanLine){ + m_scanLineInterval -= (SCAN_LINE_RUN_TIME * 30 / 1000); + return; + } + + int startPos = static_cast(UiConfig::GetInstance()->getUiHeight() * SCAN_LINE_START_POS_SCALE); + int distance = static_cast(UiConfig::GetInstance()->getUiHeight() * SCAN_LINE_RUN_DISTANCE_SCALE); + m_scanLinePos += (distance * 1000 / 30 / SCAN_LINE_RUN_TIME); //1000ms 30帧 + if(m_scanLinePos >= (startPos + distance)){ + m_scanLinePos = startPos; + m_scanLineInterval = SCAN_LINE_LOOP_INTERVAL; + _moveScanner->hide(); + return; + } + _moveScanner->hide(); + if(true == runScanLine){ + _moveScanner->move(0, m_scanLinePos); + } + do{ +#if 0 + if(showTempMsg()){ + break; + } + if(showMaskMsg()){ + break; + } + if(showPersonWidgetMsg()){ + break; + } + if(showNoEntryMsg()){ + break; + } + if(showNotiMsg()){ + break; + } +#else + if(showPersonWidgetMsg()){ + break; + } + if(showMaskMsg()){ + break; + } + if(showTempMsg()){ + break; + } + if(showNoEntryMsg()){ + break; + } + if(showNotiMsg()){ + break; + } +#endif + }while(0); + + if(false == runScanLine && 0 == m_showGreenColor && 0 == m_showRedColor){ + _pShowResTimer->stop(); + _moveScanner->hide(); + m_scanLineInterval = 0; + } + else { + if(true == runScanLine) + _moveScanner->show(); + } +} + +void recoUiRecognize::slotUpdatePlatformConnectionStatus(const int status) +{ + m_widget_msg->setNetworkStatus(status); +} + +void recoUiRecognize::slotsResetRecoUi() +{ + //人脸识别 / 二维码 二选一 + #if 0 + if(m_backstageIf){ + if(m_backstageIf->getQRCodeSwitch()){ + //二维码扫描模式不复位到人脸识别界面,否则会出现人脸框叠加二维码扫描框 + } + else { + slotsDrawScanner(0, nullptr, 0); + } + } + #endif + slotsDrawScanner(0, false); +} + +void recoUiRecognize::slotShowQRCodeMsg(const int msg) +{ + m_widget_mask->showQRCodeMsg(static_cast(msg)); + if(UiInterfaceForBackstage::QRCode_Msg_Error == static_cast(msg)){ + m_QRCodeTimer->start(QRCODE_FAILED_MSG_DISPLAY_TIME); + } + else { + m_QRCodeTimer->stop(); + } +} + +void recoUiRecognize::slotChangeRecoUiMode() +{ + if(m_backstageIf->getQRCodeSwitch()){ + //qDebug() << "recoUiRecognize::slotChangeRecoUiMode QRCode mode!"; + showQRCodeReco(); + } + else { + //qDebug() << "recoUiRecognize::slotChangeRecoUiMode face reco mode!"; + showFaceReco(); + } +} + +void recoUiRecognize::slotTimerQRCodeScanline() +{ + runQRCodeScanLine(); +} + +void recoUiRecognize::runQRCodeScanLine() +{ + if(m_label_QRCodeScanLine->isHidden()) + m_label_QRCodeScanLine->show(); + m_QRCodeAnimation->start(); + m_timer_QRCodeScanLine->start(QRCODE_SCAN_LINE_RUN_INTERVAL_TIME); +} + +void recoUiRecognize::showQRCodeReco() +{ + //停止人脸识别界面一切活动 + slotsResetRecoUi(); + m_widget_tmpr->hide(); + m_widget_person->hide(); + m_widget_msg->setMsgBtm(tr("")); + + //_pShowResTimer->stop(); + _moveScanner->hide(); + _ScanCurorAnimation->stop(); + + //切换到二维码识别界面 + setBackgroundColor(MSG_BG_COLOR_QRCODE); + m_widget_mask->showQRCodeMsg(UiInterfaceForBackstage::QRCode_Msg_Standby); + + runQRCodeScanLine(); +} + +void recoUiRecognize::showFaceReco() +{ + m_label_QRCodeScanLine->hide(); + m_QRCodeAnimation->stop(); + m_timer_QRCodeScanLine->stop(); + +#if 0 + m_widget_mask->hide(); +#else + m_widget_mask->hideSelf(); +#endif + slotsResetRecoUi(); +} + +bool recoUiRecognize::showPersonWidgetMsg() +{ + bool ret = false; + if(m_personRefresh >= 0) + { + switch(m_personRefresh) + { + case GLOBAL_RECO_END_OK: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextAllowPass, recoUiTextCfg(RecoUiTextCfg::TextAllowPass), PersonWidget::BG_COLOR_BLUE, true);//m_name + break; + case GLOBAL_RECO_END_NO: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextAuthFailed, recoUiTextCfg(RecoUiTextCfg::TextAuthFailed), PersonWidget::BG_COLOR_RED, true);//tr("未经许可人员") + break; + case GLOBAL_RECO_FACE_CARD_NOT_MATCH: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextUseOwnCertifi, recoUiTextCfg(RecoUiTextCfg::TextUseOwnCertifi), PersonWidget::BG_COLOR_RED, true);//tr("请用本人证件") + break; + case GLOBAL_RECO_SWIPE_CARD: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextTapCard, recoUiTextCfg(RecoUiTextCfg::TextTapCard), PersonWidget::BG_COLOR_RED, true);//tr("请刷卡") + break; + case GLOBAL_RECO_FACE_CAMERA: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextFaceCam, recoUiTextCfg(RecoUiTextCfg::TextFaceCam), PersonWidget::BG_COLOR_RED, true);//tr("请正视镜头") + break; + case GLOBAL_RECO_NOT_PASS_TIME: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextNoEntryTime, recoUiTextCfg(RecoUiTextCfg::TextNoEntryTime), PersonWidget::BG_COLOR_RED, true);//tr("禁止通行时段") + break; + case GLOBAL_RECO_ID_FAILED: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("身份证核验失败"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_NEED_RECHECK: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("身份核验中"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_PLATFORM_DISCONNECTED: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("服务器连接失败"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_SWIPE_CARD_HERE: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请在此处刷卡"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_HIDE_NAME_AREA: + #if 0 + m_widget_person->hide(); + #else + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, "", PersonWidget::BG_COLOR_TRAN, true); + #endif + break; + case GLOBAL_RECO_NOT_LIVING: + if(!UiConfig::GetInstance()->isRecoUiStyleScene()){ + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请调整人脸角度"), PersonWidget::BG_COLOR_RED, true); + } + break; + case GLOBAL_RECO_SHOW_QRCODE: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请刷二维码"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_UNAUTH_CARD: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("未授权卡片"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_PLS_TAP_ID_CARD: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请刷身份证"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_PLS_CHECK_STATIC: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请测试静电"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_STATIC_ABNORMAL: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("静电测试异常"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_SWIPE_ID_OR_HEALEH_CODE: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请刷身份证或扫码"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_CHECKING: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("健康码查询中"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_CHECK_FAILED: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("查询失败"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_QRCODE_OVERDUE: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("二维码已过期"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_NETWORK_ERROR: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("网络异常"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_PLATFORM_ERROR: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("服务器异常"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_REQUEST_OVERTIME: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("服务器请求超时"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_SWIPE_TRIP_CARD: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请刷行程卡"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_SHOW_HEALTH_CODE: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请扫健康码"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_RESWIPE_TRIP_CARD: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请重刷行程卡"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_SWIPE_ID_AND_TRIP_CARD: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("刷身份证扫行程卡"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_TRIP_CARD_CHECKING: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("行程卡查询中"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_SCAN_YUEJUMA: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请扫粤居码"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_SCAN_YUEJUMA_OR_SWIPE_ID: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("请刷粤居码/身份证"), PersonWidget::BG_COLOR_RED, true); + break; + case GLOBAL_RECO_PATROL_OK: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("巡更成功"), PersonWidget::BG_COLOR_BLUE, true); + break; + case GLOBAL_RECO_PATROL_NOT_RIGHT_TIME: + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tr("非巡更时段"), PersonWidget::BG_COLOR_RED, true); + break; + default: + break; + } + ret = true; + } + if(ret){ + m_personRefresh = -1; + m_msgShowed = true; + ret = runScanLine; + } + return ret; +} + +bool recoUiRecognize::showNoEntryMsg() +{ + bool ret = false; + if(1 == m_NoEntryRefresh){ + m_widget_msg->setMsgBtm(recoUiTextCfg(RecoUiTextCfg::TextNoEntry), MSG_BG_COLOR_BOM_TOP_GREEN == m_currentBackColor);//tr("禁止通行") + ret = true; + } + else if(2 == m_NoEntryRefresh){ + m_widget_msg->setMsgBtm(tr("")); + ret = true; + } + if(ret){ + m_NoEntryRefresh = 0; + m_msgShowed = true; + ret = runScanLine; + } + return ret; +} + +bool recoUiRecognize::showNotiMsg() +{ + bool ret = false; + if(GLOBAL_RECO_SHOW_NOTI_MSG == m_NotiMsgRefresh){ + m_widget_msg->setMsgNoti(m_notimsg, m_notiMsgColor); + ret = true; + } + if(ret){ + m_NotiMsgRefresh = -1; + m_msgShowed = true; + ret = runScanLine; + } + return ret; +} + +bool recoUiRecognize::showTempMsg() +{ + bool ret = false; + if(1 == m_tempRefresh || 3 == m_tempRefresh){ + m_showRedColor = 0; + if(0 == m_showGreenColor){ + m_widget_tmpr->setBackgroundColor(WIDGET_BG_COLOR_GREEN); + m_showGreenColor = 1; + } + else if(1 == m_showGreenColor){ + m_widget_msg->setBackgroundColor(WIDGET_BG_COLOR_GREEN); + m_showGreenColor = 0; + m_tempRefresh = -1; + } + else { + m_showGreenColor = 0; + } + ret = true; + } + else if(2 == m_tempRefresh){ + m_showGreenColor = 0; + if(0 == m_showRedColor){ + m_widget_tmpr->setBackgroundColor(WIDGET_BG_COLOR_RED); + m_showRedColor = 1; + } + else if(1 == m_showRedColor){ + m_widget_msg->setBackgroundColor(WIDGET_BG_COLOR_RED); + m_showRedColor = 0; + m_tempRefresh = -1; + } + else { + m_showRedColor = 0; + } + ret = true; + } + if(ret){ + m_widget_tmpr->move(0, 0); + m_msgShowed = true; + ret = runScanLine; + } + return ret; +} + +bool recoUiRecognize::showMaskMsg() +{ + bool ret = false; + if(1 == m_maskRefresh){ + m_widget_mask->setMaskMsg(true, recoUiTextCfg(RecoUiTextCfg::TextMaskOk)); + ret = true; + }else if(2 == m_maskRefresh){ + m_widget_mask->setMaskMsg(false, recoUiTextCfg(RecoUiTextCfg::TextNOMask)); + ret = true; + }else if(3 == m_maskRefresh){ + m_widget_mask->setMaskMsg(false, tr("请摘下口罩")); + ret = true; + } + if(ret){ + m_maskRefresh = -1; + m_msgShowed = true; + ret = runScanLine; + } + return ret; +} + +bool recoUiRecognize::event(QEvent *event) +{ + switch( event->type() ) + { + case QEvent::TouchBegin: + { + do{ + qDebug() << "recoUiRecognize touch begin"; + if(UiConfig::GetInstance()->getHardwareTesting()){ + break; + } + + QList touch_list = static_cast(event)->touchPoints(); + QPoint mousePos = mapFromGlobal(QPoint(touch_list.at(0).pos().x(),touch_list.at(0).pos().y())); + if(!m_btnPwd->isHidden() && m_btnPwd->geometry().contains(mousePos)){ + //qDebug() << touch_list.at(0).pos().x(); + //qDebug() << touch_list.at(0).pos().y(); + //QMouseEvent mouseEvent(QEvent::MouseButtonPress,QPointF(touch_list.at(0).pos().x(),touch_list.at(0).pos().y()),Qt::LeftButton,Qt::LeftButton,Qt::NoModifier); + //QCoreApplication::sendEvent(this,&mouseEvent); + m_backstageIf->playAudio(audioInputPwd); + slotPwdBtnClicked(); + break; + } +#if 0 // 设备对讲还有缺陷,暂不支持 + if(!m_wgtCallDialDev->isHidden() && m_wgtCallDialDev->geometry().contains(mousePos)){ + emit callDialButtonClicked(); + break; + } +#endif + if(!m_wgtCallMngCenter->isHidden() && m_wgtCallMngCenter->geometry().contains(mousePos)){ + emit callPlatformButtonClicked("管理处"); + break; + } + + isTouched = true; + _preTime = QTime::currentTime(); + longPressToSettingPage(); + emit signalScreenTouch(); + }while(0); + + event->accept(); + return true; + + } + case QEvent::TouchUpdate: + { + //QTouchEvent* touch = static_cast(event); + //if(touch->touchPointStates() & Qt::TouchPointPressed){ + //判断是否有触摸点处于TouchPointPressed或TouchPointMoved或TouchPointStationary或TouchPointReleased + //} + event->accept(); + return true; + } + case QEvent::TouchEnd: + { + //QTouchEvent* touch = static_cast(event); + qDebug() << "recoUiRecognize touch end!"; + isTouched = false; + _preTime = QTime::currentTime(); + event->accept(); + return true; + } + default: + break; + } + return QWidget::event(event); +} + +bool recoUiRecognize::multiPressToSettingPage() +{ + bool bRet = false; + QTime time = QTime::currentTime(); + if(0 != m_clickCount) { + if( _preTime.msecsTo(time) > clickGrap) { + //qDebug() << "_preTime.msecsTo(time) > clickGrap()"; + m_clickCount = 0; + } + } + //qDebug()<<"m_clickCount = "<wakeUpFromScreenSaverOrScreenOff(); + } + + m_clickCount++; + _preTime = time; + + if(m_clickCount == clickNum) + { + m_clickCount = 0; + if(!UiConfig::GetInstance()->isTpAvailable()){ + emit signalChangePage(); + } + bRet = true; + } + return bRet; +} + +void recoUiRecognize::slotLongPressShowSetting() +{ + //qDebug() << "isTouched:" << isTouched << ", pre time:" << _preTime.msecsTo(QTime::currentTime()) << ", need time:" << UiConfig::TOUCH_TIME_TO_SETTING - 200; + if(isTouched && _preTime.msecsTo(QTime::currentTime()) > (UiConfig::TOUCH_TIME_TO_SETTING - 200)){ + qDebug() << "into setting..."; + emit signalChangePage(); + } +} + +bool recoUiRecognize::longPressToSettingPage() +{ + //qDebug() << "longPressToSettingPage"; + if(m_backstageIf) + m_backstageIf->wakeUpFromScreenSaverOrScreenOff(); + QTimer::singleShot(UiConfig::TOUCH_TIME_TO_SETTING, this, SLOT(slotLongPressShowSetting())); + return true; +} + +void recoUiRecognize::slotCenterMsg(const int nPage, const QString& msg) +{ + //if( GLOBAL_RECO_SHOW_CENTER_MSG != nPage){ + //return ; + //} + + //no scanner, no color + //m_MsgCenterRefresh = GLOBAL_RECO_SHOW_CENTER_MSG; + //m_centermsg = msg; + //m_centerMsgColor = color; + if(_moveScanner->isHidden()){ + showCenterMsg(msg, nPage); + } +} + +void recoUiRecognize::slotPwdBtnClicked() +{ + emit signalShowPwdPage(""); +} + +void recoUiRecognize::slotSetUserPwdButton(bool visible) +{ + if(visible){ + m_btnPwd->show(); + }else{ + m_btnPwd->hide(); + } +} + + +void recoUiRecognize::slotQRCodeSwitchToStandbyStatusFromOvertimeStatus() +{ + m_widget_mask->showQRCodeMsg(UiInterfaceForBackstage::QRCode_Msg_Standby); +} + +void recoUiRecognize::slotUpdateRecoUiIpDisplay(const bool switchStatus) //增加识别界面ip显示开关,更新信号 +{ + if(switchStatus){ + if(m_backstageIf){ + char ip[16] = {0}; + int type = 0; + if(0 == m_backstageIf->getIP(ip, sizeof (ip), type)){ + m_widget_msg->updateIp(ip, type); + } + } + } + else { + m_widget_msg->updateIp(""); + } +} + +void recoUiRecognize::slotShowFeatureUpdateProgress(const unsigned current, const unsigned all) +{ + if(nullptr == m_widget_progress){ + m_widget_progress = new ProgressWidget(tr("人脸特征更新中...")); + m_widget_progress->setFixedSize(UiConfig::GetInstance()->getUiWidth() / 1.8, UiConfig::GetInstance()->getUiHeight() / 8); + m_widget_progress->move((UiConfig::GetInstance()->getUiWidth() - m_widget_progress->width()) / 2, + (UiConfig::GetInstance()->getUiHeight() - m_widget_progress->height()) / 2); + m_widget_progress->show(); + } + m_widget_progress->setMsg(current, all); +} + +void recoUiRecognize::slotCloseFeatureUpdateProgress() +{ + if(nullptr != m_widget_progress){ + delete m_widget_progress; + m_widget_progress = nullptr; + } +} + +void recoUiRecognize::slotShowRecoUiMask(int maskType) +{ + qDebug() << "reco ui type:" << maskType; + if(maskType > 3){ + return; + } + + if(0 == maskType){ + //m_label_back->clear(); + m_bgPm = QPixmap(); + m_isNightMode = false; + }else if(1 == maskType){ + if(UiConfig::GetInstance()->isFaceFrameShowByTempExist()){ + //m_label_back->setPixmap( + m_bgPm = QPixmap(UiConfig::GetInstance()->is8inchA038HaimanFaceFrame() ? + ":/res/image/haiman-face-middle.png" : BG_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]); + }else if(m_showFaceFrameByUser){ + //m_label_back->setPixmap( + m_bgPm = QPixmap(BG_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]); + }else{ + //m_label_back->clear(); + m_bgPm = QPixmap(); + } + m_isNightMode = false; + }else if(2 == maskType){ + //m_label_back->setPixmap(QPixmap(TEMP_CALIBOX_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()])); + m_bgPm = QPixmap(TEMP_CALIBOX_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_isNightMode = false; + }else if(3 == maskType){ + //m_label_back->setPixmap(QPixmap(DARK_FILL_LIGHT_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()])); + m_bgPm = QPixmap(DARK_FILL_LIGHT_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_isNightMode = true; + } + if(!UiConfig::GetInstance()->isRecoUiStyleScene()){ + m_label_back->setPixmap(m_bgPm); + } + setCardReaderUnderScreenInstructions(m_isNightMode); +} + + + +void recoUiRecognize::slotNotiMsg(const int nPage, const QString& msg, int color) +{ + if( GLOBAL_RECO_SHOW_NOTI_MSG != nPage) + { + return ; + } + + m_NotiMsgRefresh = GLOBAL_RECO_SHOW_NOTI_MSG; + m_notimsg = msg; + m_notiMsgColor = color; + if(_moveScanner->isHidden()) + { + showNotiMsg(); + } +} + +QString recoUiRecognize::recoUiTextCfg(RecoUiTextCfg::enTextType type) +{ + const QString texts[] = {tr("请刷脸通行"), m_name, tr("未经许可人员"), tr("禁止通行"), tr("未佩戴口罩"), + tr("口罩检测通过"), tr("体温:"), tr("请刷卡"), tr("请用本人证件"), tr("请正视镜头"), + tr("禁止通行时段")}; + if(UiConfig::GetInstance()->isRecoUiStyleScene() && RecoUiTextCfg::enTextType::TextFacePass == type){ + return ""; + } + if(RecoUiTextCfg::DisModeHide == UiConfig::GetInstance()->m_textCfg[type].m_mode){ + return ""; + } + else if(RecoUiTextCfg::DisModeCustom == UiConfig::GetInstance()->m_textCfg[type].m_mode){ + return UiConfig::GetInstance()->m_textCfg[type].m_cusText; + } + return texts[type]; +} + +bool recoUiRecognize::showCenterMsg(const QString& msg, int type) //no buf, show msg immediately +{ +#if 0 + bool ret = false; + //if(GLOBAL_RECO_SHOW_CENTER_MSG == m_centerMsgRefresh){ + m_widget_cMsg->showMsg(msg, type); + ret = true; + //} + if(ret){ + //m_centerMsgRefresh = -1; + m_msgShowed = true; + ret = runScanLine; + } + return ret; +#else + if(msg.isEmpty()){ + //m_widget_person->show(); + m_widget_cMsg->hide(); + } + else{ + //m_widget_person->hide(); + //m_widget_msg->hide(); + m_widget_cMsg->showMsg(msg, type); + m_msgShowed = true; + m_widget_cMsg->show(); + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } + //TODO..................................................... + //m_backstageIf->stopIdentyState();//bt lock unlocking or other situation which showing this widget, pause face recognition + } + QCoreApplication::processEvents(); + return runScanLine; +#endif +} + +void recoUiRecognize::setCardReaderUnderScreenInstructions(bool isNightMode) +{ + if(nullptr == m_wgtCardUnderScreen){ + return; + } + + QPalette pal(m_wgtCardUnderScreen->palette()); + pal.setBrush(QPalette::Background,QBrush(QPixmap(isNightMode ? + SWIP_CARD_NIGHT_MODE_WIDGET_BG[UiConfig::GetInstance()->getScreenConfigIndex()] : + SWIP_CARD_DAY_MODE_WIDGET_BG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_wgtCardUnderScreen->setPalette(pal); +} + + +CenterMsgWidget::CenterMsgWidget(QWidget *parent) : QWidget(parent) +{ + qDebug() << "CenterMsgWidget()"; + + m_label_msg = new QLabel(this); + //m_label_msg->setPalette(palette); + m_label_msg->setGeometry(QRect(328, 240, 329, 27*4)); //四倍行距 + m_label_msg->setWordWrap(true); + m_label_msg->setAlignment(Qt::AlignCenter); + //m_label_msg->setAutoFillBackground(true); + m_label_msg->setStyleSheet("background-color:transparent;"); + + //QFont ft; + //ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + //m_label_msg->setFont(ft); + //m_label_msg->setStyleSheet("background-color:transparent;font-size:40px"); + + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->addWidget(m_label_msg, 4, Qt::AlignCenter); + setLayout(hLayout); + + #if 1 //bg img + setAutoFillBackground(true); + #else + setFixedWidth(WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()]); + setStyleSheet("background-color:rgba(0, 0, 0, 100);border-radius:10px;padding:2px 4px;focus{outline: none;}"); + setAttribute(Qt::WA_TranslucentBackground);//设置窗口背景透明 + setWindowFlags(Qt::FramelessWindowHint); //设置无边框窗口 + #endif +} + +CenterMsgWidget::~CenterMsgWidget() +{ + qDebug() << "~CenterMsgWidget()"; +} + +void CenterMsgWidget::showMsg(const QString& msg, int type) +{ + if("" == msg){ + hide(); + #if 0 + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } + #endif + return; + } + + #if 0 + if(m_centerMsgType != type){ + QPalette palette; + palette.setColor(QPalette::WindowText,Qt::white); + if(GLOBAL_RECO_SHOW_CENTER_MSG == type){ + #if 0 //bg img + palette.setBrush(QPalette::Background,QBrush(QPixmap(BG_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + setFixedHeight(WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + #else + setFixedHeight(UiConfig::GetInstance()->getUiHeight() / 5); + #endif + } + else{ //if(GLOBAL_RECO_SHOW_CENTER_MSG_BIG == type || GLOBAL_RECO_SHOW_CENTER_MSG_BIG_RED == type){ + setFixedHeight(static_cast(UiConfig::GetInstance()->getUiHeight() * 0.8)); + } + m_label_msg->setPalette(palette); + m_centerMsgType = type; + } + #endif + QPoint posi(0, 0); + QFont ft; + QPalette pal(this->palette()); + m_label_msg->setAutoFillBackground(false); + + if(GLOBAL_RECO_SHOW_CENTER_MSG_BIG_RED == type){ + QStringList list = msg.split("\n"); + QString str; + int segNum = list.length() - 1; + if(segNum){ + //qDebug() << "segNum:" << segNum; + for(int i=0; i%1").arg(list[i]) + "
"; + } + str += QString("%1").arg(list[segNum - 1]); + } + //setStyleSheet("background-color:rgba(0, 0, 0, 100);border-radius:10px;padding:2px 4px;focus{outline: none;}"); + pal.setBrush(QPalette::Background,QBrush(QColor(0, 0, 0, 100))); + //setFixedHeight(static_cast(UiConfig::GetInstance()->getUiHeight() * 0.5)); + setFixedSize(WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()], + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.5)); + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * 1.5); + m_label_msg->setFont(ft); + m_label_msg->setText(str); + posi.setX((UiConfig::GetInstance()->getUiWidth() - WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()]) / 2); + posi.setY(static_cast(UiConfig::GetInstance()->getUiHeight() * 0.2)); + }else{ + switch(type){ + case GLOBAL_RECO_SHOW_CENTER_MSG_BG_GREEN: + pal.setBrush(QPalette::Background,QBrush(QPixmap(":/res/image/bg_green_large.png"))); + setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * 2); + break; + case GLOBAL_RECO_SHOW_CENTER_MSG_BG_YELLOW: + pal.setBrush(QPalette::Background,QBrush(QPixmap(":/res/image/bg_yellow_large.png"))); + setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * 2); + break; + case GLOBAL_RECO_SHOW_CENTER_MSG_BG_RED: + pal.setBrush(QPalette::Background,QBrush(QPixmap(":/res/image/bg_red_large.png"))); + setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * 2); + break; + case GLOBAL_RECO_SHOW_CENTER_MSG_BG_PURPLE: + pal.setBrush(QPalette::Background,QBrush(QPixmap(":/res/image/bg_purple_large.png"))); + setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * 2); + break; + case GLOBAL_RECO_SHOW_CENTER_MSG_BG_BLACK: + pal.setBrush(QPalette::Background, QBrush(Qt::black)); + setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * 2); + break; + case GLOBAL_RECO_SHOW_CENTER_MSG_FIRE_ALARM: + //m_label_msg->clear(); + m_label_msg->setFixedSize(200, 200); + m_label_msg->setAutoFillBackground(true); + m_label_msg->setPixmap(QPixmap(":/res/image/fire_alarm.png")); + pal.setBrush(QPalette::Background,QBrush(QColor(255, 255, 255, 255))); + setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.8), + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.3)); + posi.setX((UiConfig::GetInstance()->getUiWidth() - static_cast(UiConfig::GetInstance()->getUiWidth() * 0.8)) / 2); + posi.setY(static_cast(UiConfig::GetInstance()->getUiHeight() * 0.3)); + const_cast(msg).clear(); + break; + default: + pal.setBrush(QPalette::Background,QBrush(QColor(0, 0, 0, 100))); + setFixedSize(WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()], + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.5)); + posi.setX((UiConfig::GetInstance()->getUiWidth() - WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()]) / 2); + posi.setY(static_cast(UiConfig::GetInstance()->getUiHeight() * 0.2)); + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()] * 1.5); + break; + } + + if(!msg.isEmpty()){ + m_label_msg->setFixedSize(static_cast(width() * 0.8), static_cast(height() * 0.8)); + m_label_msg->setFont(ft); + QPalette palette; + palette.setColor(QPalette::WindowText,Qt::white); + m_label_msg->setPalette(palette); + m_label_msg->setText(msg); + } + setPalette(pal); + } + move(posi.x(), posi.y()); + show(); +} + +void CenterMsgWidget::paintEvent(QPaintEvent *event) +{ + QStyleOption opt; + opt.initFrom(this); + QPainter pr(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &pr, this);//绘制样式 + + return QWidget::paintEvent(event); +} + + +FinalResultWidget::FinalResultWidget(QWidget *parent) : QWidget(parent) +{ + setFixedSize(FinalResultWidget::FINAL_RESULT_WIDGET_W_H[UiConfig::GetInstance()->getScreenConfigIndex()], + FinalResultWidget::FINAL_RESULT_WIDGET_W_H[UiConfig::GetInstance()->getScreenConfigIndex()] + 1); + setAutoFillBackground(true); + hide(); +} + +FinalResultWidget::~FinalResultWidget() +{ +} + +void FinalResultWidget::showResult(bool pass) +{ + QPalette pal(palette()); + pal.setBrush(QPalette::Background,QBrush(QPixmap(pass ? + FinalResultWidget::FINAL_RESULT_OK_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()] : + FinalResultWidget::FINAL_RESULT_FAIL_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + setPalette(pal); + show(); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } +} + + diff --git a/Linguist/recoUi/recoUiRecognize.h b/Linguist/recoUi/recoUiRecognize.h new file mode 100644 index 0000000..bc041fb --- /dev/null +++ b/Linguist/recoUi/recoUiRecognize.h @@ -0,0 +1,571 @@ +#ifndef RECOUIRECOGNIZE_H +#define RECOUIRECOGNIZE_H + +#include +#include +#include +#include +#include +#include +#include "UiTools.h" +#include +#include +#include "UiCommon.h" +#include "UiConfig.h" +#include "UiInterfaceForBackstage.h" + +class SceneMsgWidget : public QWidget +{ + Q_OBJECT + +public: + static const int DATE_TIME_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + SceneMsgWidget(QWidget *parent = nullptr); + void setPersonNum(int source, int personNum); + void setBgTransparent(bool set); + int setType(int type); + +public slots: + void slotNewDay(); + +private: + DateTimeWidgetClassical *m_wgtDateTime = nullptr; + QLabel *m_labelPersonNum = nullptr; + int m_type = 0; +}; + + +typedef enum +{ + GLOBAL_RECO_END_OK = 0, + GLOBAL_RECO_END_NO, + GLOBAL_RECO_FACE_CARD_NOT_MATCH, + GLOBAL_RECO_SWIPE_CARD, + GLOBAL_RECO_FACE_CAMERA, + GLOBAL_RECO_NOT_PASS_TIME, + GLOBAL_RECO_NEED_RECHECK, + GLOBAL_RECO_PLATFORM_DISCONNECTED, + GLOBAL_RECO_SWIPE_CARD_HERE, + GLOBAL_RECO_HIDE_NAME_AREA, + GLOBAL_RECO_NOT_LIVING, + GLOBAL_RECO_UNAUTH_CARD, + GLOBAL_RECO_PLS_TAP_ID_CARD, + GLOBAL_RECO_PLS_CHECK_STATIC, + GLOBAL_RECO_STATIC_ABNORMAL, + GLOBAL_RECO_SWIPE_ID_OR_HEALEH_CODE, + GLOBAL_RECO_CHECKING, + GLOBAL_RECO_CHECK_FAILED, + GLOBAL_RECO_QRCODE_OVERDUE, + GLOBAL_RECO_NETWORK_ERROR, + GLOBAL_RECO_PLATFORM_ERROR, + GLOBAL_RECO_REQUEST_OVERTIME, + GLOBAL_RECO_SWIPE_TRIP_CARD, + GLOBAL_RECO_SHOW_HEALTH_CODE, + GLOBAL_RECO_RESWIPE_TRIP_CARD, + GLOBAL_RECO_SWIPE_ID_AND_TRIP_CARD, + GLOBAL_RECO_TRIP_CARD_CHECKING, + GLOBAL_RECO_SCAN_YUEJUMA, + GLOBAL_RECO_SCAN_YUEJUMA_OR_SWIPE_ID, + GLOBAL_RECO_PATROL_OK, + GLOBAL_RECO_PATROL_NOT_RIGHT_TIME, + + GLOBAL_RECO_SHOW_QRCODE, + GLOBAL_RECO_ID_FAILED, //身份证核验失败 + GLOBAL_RECO_IN, //close to recognize + GLOBAL_RECO_IN_SCANNER, + GLOBAL_RECO_CHECK, //靠近重试 + GLOBAL_RECO_BEGIN_AUTH, + GLOBAL_RECO_TEMP_REQ, //请移动额头到测温区 + GLOBAL_RECO_READ_TEMP_FAILED, //体温检测失败 + GLOBAL_RECO_MASK_REQ, //请戴口罩 + GLOBAL_RECO_MASK_OK, //口罩检测正常 + GLOBAL_RECO_NO_ENTRY, //禁止通行 + GLOBAL_RECO_CLEAR_NO_ENTRY, //清除禁止通行字样 + GLOBAL_RECO_CLOSE_SCANLINE, //关闭扫描线 + + GLOBAL_RECO_SHOW_QRCODE_RECO, //显示识别二维码界面 + GLOBAL_RECO_SHOW_FACE_RECO, //显示人脸识别界面,可能是从二维码界面切换过去的 + + GLOBAL_RECO_SHOW_NOTI_MSG, //显示通知信息 + + GLOBAL_RECO_SHOW_CENTER_MSG, //显示中央信息块 + GLOBAL_RECO_SHOW_CENTER_MSG_BIG,//显示超大中央信息块 + GLOBAL_RECO_SHOW_CENTER_MSG_BIG_RED, + GLOBAL_RECO_SHOW_CENTER_MSG_BG_GREEN, + GLOBAL_RECO_SHOW_CENTER_MSG_BG_YELLOW, + GLOBAL_RECO_SHOW_CENTER_MSG_BG_RED, + GLOBAL_RECO_SHOW_CENTER_MSG_BG_PURPLE, + GLOBAL_RECO_SHOW_CENTER_MSG_BG_BLACK, + GLOBAL_RECO_SHOW_CENTER_MSG_FIRE_ALARM, + + GLOBAL_RECO_TAKE_OFF_MASK, + + GLOBAL_RECO_OTHERS +}GLOBAL_RECO_STATE; + +typedef enum +{ + WIDGET_BG_COLOR_TRAN, + WIDGET_BG_COLOR_BLUE, + WIDGET_BG_COLOR_GREEN, + WIDGET_BG_COLOR_RED +}WIDGET_BG_COLOR_E; + + +class TmprWidget : public QWidget +{ + Q_OBJECT //多语言需要 + +public: + static const QString TEMP_BG_GREEN_TOP_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString TEMP_BG_RED_TOP_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int TMPR_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int TMPR_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit TmprWidget(QWidget *parent = nullptr); + ~TmprWidget(); + void showNormalTemp(const QString& msg, float temp, bool isC); + void showAbnormalTemp(const QString& msg, float temp, bool isHigh, bool isC); + void setBackgroundColor(WIDGET_BG_COLOR_E color); + +private: + QLabel* m_label_tem; + //QLabel* m_label_msg; + + //记录当前显示温度,差值超分辨率0.1才刷新 + float m_ForeheadTmpr; +}; + +class MsgWidget : public QWidget +{ + Q_OBJECT + +public: + #define STYLE_QUANTITY 2 + static const QString NO_NETWORK_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString NETWORK_CONNECTED_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString NETWORK_LOGGED_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString NET_ETH_IP_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString NET_WIFI_IP_RES_FILE[STYLE_QUANTITY][UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString NET_4G_IP_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BG_BLUE_BOM_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BG_GREEN_BOM_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BG_RED_BOM_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int TIME_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int MSG_WORD_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; //move to uiConfig if want to set font size for each language + static const int NOTI_MSG_WORD_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit MsgWidget(int timeType, int iconType, const QColor& textColor, QWidget *parent = nullptr); + ~MsgWidget(); + + void setMsgTop(const QString&); + void setMsgBtm(const QString&, const bool setRedColor = false); + void setMsgNoti(const QString& msg, int color); + void setLogo(const QString&, const bool scale = false); + bool hasNoMsg(); + void setNetworkStatus(const int); + void setBackgroundColor(const WIDGET_BG_COLOR_E color); + void updateIp(const QString& ip, int type = -1); + void showDevInfo(const QString& devId, const QString& ver); + void setStyle(int timeType, int iconType, const QColor& textColor); + void showRecoUiDevIdAndVer(bool show); + +private: + //QLabel* m_label_msgTop; + QLabel* m_label_Icon; + QLabel* m_label_msgBtm; + QLabel* m_label_msgNoti; + QLabel* m_label_time = nullptr; + QLabel* m_label_networkStatus; + QLabel* m_label_ip; + QLabel* m_label_ipType; //eth wifi 4g + + TimerUpdate* _timerUpdate = nullptr; + QLabel* m_labelDevId; + QLabel* m_labelVer; + + int m_style = 0; +}; + +class DetectResultWidget : public QWidget +{ + Q_OBJECT + +public: + typedef enum + { + BG_COLOR_BLUE, + BG_COLOR_RED, + BG_COLOR_TRAN, + BG_COLOR_GREEN, + BG_COLOR_YELLOW + }BG_COLOR_E; + + static const int DETECT_RESULT_WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DETECT_RESULT_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int MASK_LOGO_SIZE_7INCH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BG_BLUE_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BG_GREEN_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BG_RED_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int MASK_LOGO_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + + explicit DetectResultWidget(QWidget *parent = nullptr); + virtual ~DetectResultWidget(); + void updateMsg(const QString& msg); + +protected: + void showMsg(const QString& msg, int msgSize, BG_COLOR_E color, const QPixmap* icon = nullptr); + QLabel* m_label_msg; + +private: + QLabel* m_label_Icon; +}; + +#if 1 +class MaskWidget_o : public DetectResultWidget +{ + Q_OBJECT + +public: + explicit MaskWidget_o(QWidget *parent = nullptr); + MaskWidget_o(); + + void setMaskMsg(bool maskOk, const QString& msg); + void showQRCodeMsg(UiInterfaceForBackstage::QRCode_Msg_E); + QString curMsg() const; + +private: + bool m_lastMaskOk; + + QPixmap m_iconMaskOk; + QPixmap m_iconMaskNull; +}; + +class PersonWidget_o : public DetectResultWidget +{ + Q_OBJECT + +public: + explicit PersonWidget_o(QWidget *parent = nullptr); + PersonWidget_o(); + + void setPersonMsg(RecoUiTextCfg::enTextType, const QString&, const BG_COLOR_E, const bool); + bool allowToShow(); + +private: + bool isShowingResultMsg; +}; + +#endif + +class MaskWidget : public QWidget +{ + Q_OBJECT + +public: + explicit MaskWidget(QWidget *parent = nullptr); + + QStackedWidget* m_wgts; + + void setMaskMsg(bool maskOk, const QString& msg); + void showQRCodeMsg(UiInterfaceForBackstage::QRCode_Msg_E); + void hideSelf(); + +private: + bool m_lastMaskOk; +}; + +class PersonWidget : public QWidget +{ + Q_OBJECT + +public: + typedef enum + { + BG_COLOR_BLUE, + BG_COLOR_RED, + BG_COLOR_TRAN, + BG_COLOR_GREEN, + BG_COLOR_YELLOW + }BG_COLOR_E; + + explicit PersonWidget(QWidget *parent = nullptr); + + QStackedWidget* m_wgts; + + void setPersonMsg(RecoUiTextCfg::enTextType, const QString&, const BG_COLOR_E, const bool); + bool allowToShow(); + +private: + bool isShowingResultMsg; + +}; + + + +class CenterMsgWidget : public QWidget +{ + Q_OBJECT + +public: + static const int WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BG_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit CenterMsgWidget(QWidget *parent = nullptr); + virtual ~CenterMsgWidget(); + + void showMsg(const QString& msg, int type); + +protected: + +private: + QLabel* m_label_msg; + int m_centerMsgType = 0; + + void paintEvent(QPaintEvent *event); +}; + +class FinalResultWidget : public QWidget +{ + Q_OBJECT + +public: + static const QString FINAL_RESULT_OK_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString FINAL_RESULT_FAIL_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int FINAL_RESULT_WIDGET_W_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit FinalResultWidget(QWidget *parent = nullptr); + virtual ~FinalResultWidget(); + + void showResult(bool pass); + +protected: + +private: +}; + + + +class recoUiRecognize : public PageAcceptMouseAndTouch +{ + Q_OBJECT + +public: + static const QString BG_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int MSG_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString SCANLINE_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString LOGO_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString TEMP_CALIBOX_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString DARK_FILL_LIGHT_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + static const QString PWD_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString PWD_BTN_PRESSED[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int PWD_BTN_W_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + static const int SWIP_CARD_WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int SWIP_CARD_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString SWIP_CARD_DAY_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString SWIP_CARD_NIGHT_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString CALL_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + //扫描线运行一次时间,时间越短,运行越快 + static const int SCAN_LINE_RUN_TIME = 800; + static constexpr float SCAN_LINE_START_POS_SCALE = 0.2f; + static constexpr float SCAN_LINE_RUN_DISTANCE_SCALE = 0.55f; + static const int SCAN_LINE_LOOP_INTERVAL = 500; + + static const int clickNum = UiConfig::MOUSE_CLICK_TIMES_TO_SETTING; + static const int clickGrap = UiConfig::MOUSE_CLICK_INTERVAL_MAX; + + static const int QRCODE_SCAN_LINE_RUN_TIME = 1000; + static const int QRCODE_SCAN_LINE_RUN_INTERVAL_TIME = QRCODE_SCAN_LINE_RUN_TIME + 200; + static const int QRCODE_FAILED_MSG_DISPLAY_TIME = 2000; //ms + + static constexpr float HIGH_TEMP_VALUE = 42.0f; + static constexpr float LOW_TEMP_VALUE = 35.0f; + + + typedef enum + { + MSG_BG_COLOR_BOM_NULL, + MSG_BG_COLOR_BOM_BLUE, + MSG_BG_COLOR_BOM_GREEN, + MSG_BG_COLOR_BOM_TOP_GREEN, + MSG_BG_COLOR_BOM_RED, + MSG_BG_COLOR_BOM_TOP_RED, + MSG_BG_COLOR_QRCODE + }MSG_BG_COLOR_E; + + typedef enum + { + SCAN_LINE_SWITCH_OFF, + SCAN_LINE_SWITCH_BLUE, + SCAN_LINE_SWITCH_RED + }SCAN_LINE_SWITCH_E; + +public: + explicit recoUiRecognize(bool isNightMode, bool hasPwdBtn, bool hasCallBtn, QWidget *parent = nullptr); + ~recoUiRecognize(); + + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void timerEvent(QTimerEvent *event); + int setScannerState(const SCAN_LINE_SWITCH_E); + + void showRecoScanner(); + void showRecoFail(GLOBAL_RECO_STATE failType); + void showRecoIDFail(); + void showRetry(); + + void showNoMaskWarn(); //请戴口罩 + void showMaskOk(); + void showMaskWarn(); + + void showNoEntry(); + void clearNoEntry(); + + void setPwdButton(bool visible); + int setCamVideoWind(); + void setStyle(int style); + void setSceneUiReco(bool toReco); + void setTicketCheckCount(int source, int count); + void setScenePersonCountType(int type); + +signals: + void signalChangePage(); + void signalShowPwdPage(const QString& name); + void signalScreenTouch(); + void callDialButtonClicked(); // 呼叫设备按钮 + void callPlatformButtonClicked(const QString &name); // 呼叫管理处 + +public slots: + void slotsNoSuccessPage(const int nPage); + void slotsSuccessPage(const int nPage, const QString& name); + void slotsDrawScanner(const int nPage, const bool faceAvailable); + void handleRecoResShowTime(); + void slotsInteractionChange(const INTERACION_OPTION& interaction, int nSelectRes); + void slotShowNormalTemp(const float temp, const bool isC); + void slotShowAbnormalTemp(const float temp, const bool isHigh, const bool isC); + void slotUpdateLogo(const int); + void slotUpdatePlatformConnectionStatus(const int); + void slotsResetRecoUi(); + void slotShowQRCodeMsg(const int); + void slotChangeRecoUiMode(); //二维码开关时更新识别页面,人脸识别模式/二维码扫描模式 + void slotTimerQRCodeScanline(); + void slotQRCodeSwitchToStandbyStatusFromOvertimeStatus(); + void slotUpdateRecoUiIpDisplay(const bool); //增加识别界面ip显示开关,更新信号 + + void slotShowFeatureUpdateProgress(const unsigned current, const unsigned all); + void slotCloseFeatureUpdateProgress(); + + void slotShowRecoUiMask(int maskType); + + void slotNotiMsg(const int nPage, const QString& msg, int color); + void slotLongPressShowSetting(); + + void slotCenterMsg(const int nPage, const QString& msg); + + void slotPwdBtnClicked(); + void slotSetUserPwdButton(bool visible); + + void slotShowOrHideFaceFrame(bool show); + void slotShowFinalResult(bool pass); + void slotShowHealthCodeAuthStatus(int status); + void slotShowCallBtn(bool show); + void slotShowRecoUiDevIdAndVer(bool show); + +private: + void closeRecoResTime(); + +private: + QLabel* m_label_back; + QWidget* m_wgtCardUnderScreen; + + TmprWidget* m_widget_tmpr; + MaskWidget* m_widget_mask; + CenterMsgWidget* m_widget_cMsg; + PersonWidget* m_widget_person; + MsgWidget* m_widget_msg; + + QLabel* _moveScanner; + QPropertyAnimation* _ScanCurorAnimation; + SCAN_LINE_SWITCH_E m_currentScanLine; + + int m_clickCount; + QTime _preTime; + bool isTouched; + + int _timerId; //扫描动画定时器 + + QTimer* _pShowResTimer; + + QString m_name; + + MSG_BG_COLOR_E m_currentBackColor; //当前背景颜色,用于显示“禁止通行”时决定字样的颜色 + int m_tempRefresh; //温度刷新标志 + int m_maskRefresh; //口罩刷新标志 + int m_personRefresh; //人员信息刷新标志 + int m_NotiMsgRefresh; //通知信息刷新标志 + int m_NoEntryRefresh; //通行结果刷新标志 + bool m_msgShowed; //是否有前面4个信息在显示中 + bool m_faceAivaliable; //当前画面是否存在人脸 + + int m_showGreenColor; + int m_showRedColor; + + int m_scanLineInterval; + + bool runScanLine; //扫描线开关状态 + int m_scanLinePos; + + bool timerTimeoutOperation; //定时器超时后动作类型,就是超时时做什么事 + + QTimer* m_timer_QRCodeScanLine; + QLabel* m_label_QRCodeScanLine; + QPropertyAnimation* m_QRCodeAnimation; + QTimer* m_QRCodeTimer; + + ProgressWidget* m_widget_progress; + + QString m_notimsg; + int m_notiMsgColor; + + QWidget* m_btnPwd; + bool m_showFaceFrameByUser = false; + bool m_isNightMode = false; + FinalResultWidget* m_resWgt; + + QLabel* m_healthCodeAuthstatus; + + QPixmap m_bgPm; + QPixmap m_bgSceneIdle; + SceneMsgWidget* m_wgtSceneMsg = nullptr; + + RoundedWidget* m_wgtCallDialDev; + RoundedWidget* m_wgtCallMngCenter; + + bool eventFilter(QObject *watched, QEvent *event); + void setBackgroundColor(const MSG_BG_COLOR_E index); + void runQRCodeScanLine(); + void showQRCodeReco(); + void showFaceReco(); + bool showPersonWidgetMsg(); + bool showNoEntryMsg(); + bool showNotiMsg(); + bool showTempMsg(); + bool showMaskMsg(); + + bool event(QEvent *event); + bool multiPressToSettingPage(); + bool longPressToSettingPage(); + + QString recoUiTextCfg(RecoUiTextCfg::enTextType type); + + bool showCenterMsg(const QString& msg, int type); + void setCardReaderUnderScreenInstructions(bool isNightMode); +}; + +#endif // RECOUIRECOGNIZE_H diff --git a/Linguist/recoUi/recoUiRecognizeScene.cpp b/Linguist/recoUi/recoUiRecognizeScene.cpp new file mode 100644 index 0000000..660a4f2 --- /dev/null +++ b/Linguist/recoUi/recoUiRecognizeScene.cpp @@ -0,0 +1,811 @@ +#include "recoUiRecognizeScene.h" +#include +#include +#include +#include + + +const int recoUiRecognizeScene::TOP_MSG_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {89, 89, 89, 90, 90}; +const QString recoUiRecognizeScene::TOP_MSG_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/top_msg_large.png", +":/res/image/top_msg_large.png", +":/res/image/top_msg_large.png", +":/res/image/top_msg_large.png", +":/res/image/top_msg_large.png" +}; +const int recoUiRecognizeScene::SWIP_CARD_WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {400, 746, 720, 746, 720}; +const int recoUiRecognizeScene::SWIP_CARD_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {70, 104, 104, 105, 105}; +const QString recoUiRecognizeScene::SWIP_CARD_DAY_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/swipe_card_day_mode_type1_large.png", +":/res/image/swipe_card_day_mode_type1_large.png", +":/res/image/swipe_card_day_mode_type1_large.png", +":/res/image/swipe_card_day_mode_type1_large.png", +":/res/image/swipe_card_day_mode_type1_large.png" +}; +const QString recoUiRecognizeScene::SWIP_CARD_NIGHT_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/swipe_card_night_mode_type1_large.png", +":/res/image/swipe_card_night_mode_type1_large.png", +":/res/image/swipe_card_night_mode_type1_large.png", +":/res/image/swipe_card_night_mode_type1_large.png", +":/res/image/swipe_card_night_mode_type1_large.png" +}; +const QString recoUiRecognizeScene::PAGE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_ui_scene_bg_medium.jpg", +":/res/image/reco_ui_scene_bg_medium.jpg", +":/res/image/reco_ui_scene_bg_medium.jpg", +":/res/image/reco_ui_scene_bg_medium.jpg", +":/res/image/reco_ui_scene_bg_medium.jpg" +}; +const QString recoUiRecognizeScene::PAGE_STATUS_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_ui_scene_result_bg_medium.jpg", +":/res/image/reco_ui_scene_result_bg_medium.jpg", +":/res/image/reco_ui_scene_result_bg_medium.jpg", +":/res/image/reco_ui_scene_result_bg_medium.jpg", +":/res/image/reco_ui_scene_result_bg_medium.jpg" +}; +recoUiRecognizeScene::recoUiRecognizeScene(bool isNightMode, bool hasPwdBtn, QWidget *parent) : PageAcceptMouseAndTouch(parent) +{ + qDebug() << "recoUiRecognizeScene"; + setAutoFillBackground(true); + + m_wgtBack = new QWidget(this); + m_wgtBack->setAutoFillBackground(true); + m_wgtBack->setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + + #if 0 + if(!UiConfig::GetInstance()->isFuncNotSupport(FuncCardReaderUnderScreen)){ + qDebug() << "show swipe card area"; + m_wgtCardUnderScreen = new QWidget(this); + m_wgtCardUnderScreen->setAutoFillBackground(true); + m_wgtCardUnderScreen->setFixedSize(SWIP_CARD_WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()], + SWIP_CARD_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + } + #endif + + //m_wgtSceneMsg = new SceneMsgWidget(this); + + m_wgtDevMsg = new MsgWidget(0, 0, Qt::black, this); + m_wgtDevMsg->setFixedSize(UiConfig::GetInstance()->getUiWidth(), recoUiRecognize::MSG_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_wgtDevMsg->setBackgroundColor(WIDGET_BG_COLOR_BLUE); + + m_wgtBtnPwd = new QWidget(this); + m_wgtBtnPwd->setAutoFillBackground(true); + m_wgtBtnPwd->setFixedSize(recoUiRecognize::PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()], + recoUiRecognize::PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + if(!hasPwdBtn){ + m_wgtBtnPwd->hide(); + } + + QPalette pwdPal(m_wgtBtnPwd->palette()); + pwdPal.setBrush(QPalette::Background,QBrush(QPixmap(recoUiRecognize::PWD_BTN[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_wgtBtnPwd->setPalette(pwdPal); + QHBoxLayout* hlayBtn = new QHBoxLayout(); + hlayBtn->addWidget(m_wgtBtnPwd, 1, Qt::AlignTop | Qt::AlignRight); + hlayBtn->setMargin(UiConfig::GetInstance()->getUiWidth() / 15); + + #if 0 + m_wgtStatusTip = new QLabel(this); + QFont ft; + ft.setBold(true); + ft.setPointSize(16); + m_wgtStatusTip->setFont(ft); + #else + m_widget_person = new PersonWidget(this); + m_widget_person->setPersonMsg(RecoUiTextCfg::TextFacePass, recoUiTextCfg(RecoUiTextCfg::TextFacePass), PersonWidget::BG_COLOR_BLUE, false); + #endif + + m_widget_cMsg = new CenterMsgWidget(); + m_widget_cMsg->hide(); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->setMargin(0); + vlay->setSpacing(0); + //vlay->addWidget(m_wgtSceneMsg, 1, Qt::AlignTop); + vlay->addLayout(hlayBtn, 1); + vlay->addSpacing(UiConfig::GetInstance()->getUiHeight() / 4); + //vlay->addWidget(m_wgtStatusTip, 1, Qt::AlignBottom | Qt::AlignCenter); + vlay->addStretch(10); + vlay->addWidget(m_widget_person, 50, Qt::AlignBottom | Qt::AlignCenter); + vlay->addSpacing(UiConfig::GetInstance()->getUiHeight() / 15); + if(m_wgtCardUnderScreen){ + vlay->addWidget(m_wgtCardUnderScreen, 1, Qt::AlignBottom | Qt::AlignCenter); + } + vlay->addWidget(m_wgtDevMsg, 1, Qt::AlignBottom); + setLayout(vlay); + + //slotShowRecoUiMask(isNightMode ? 3 : 1); + + //m_pageIdle = QBrush(QPixmap(PAGE_BG[UiConfig::GetInstance()->getScreenConfigIndex()])); + //m_pageIdle = QBrush(QColor(0, 0, 0, 0)); + //m_pageStatusTip = QBrush(QPixmap(PAGE_STATUS_BG[UiConfig::GetInstance()->getScreenConfigIndex()])); + m_pageReco = QBrush(QPixmap(recoUiRecognize::BG_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()])); +} + +recoUiRecognizeScene::~recoUiRecognizeScene() +{ + if(m_widget_cMsg){ + delete m_widget_cMsg; + } +} + +bool recoUiRecognizeScene::eventFilter(QObject *watched, QEvent *event) +{ + if( watched == this){ + if(event->type() == QEvent::MouseButtonPress){ + qDebug() << "MouseButtonPress"; + emit signalScreenTouch(); + if(multiPressToSettingPage()){ + QPoint pos; + pos.setX(UiConfig::GetInstance()->getUiWidth() / 2); + pos.setY(UiConfig::GetInstance()->getUiHeight() / 2); + QCursor::setPos(pos); + } + }else{ + return false; + } + }else{ + return QWidget::eventFilter(watched, event); + } + return false; +} + +bool recoUiRecognizeScene::event(QEvent *event) +{ + switch( event->type() ){ + case QEvent::TouchBegin: + do{ + if(UiConfig::GetInstance()->getHardwareTesting()){ + break; + } + if(!m_wgtBtnPwd->isHidden()){ + QTouchEvent* touch = static_cast(event); + QList touch_list = touch->touchPoints(); + QRect widgetRect = m_wgtBtnPwd->geometry(); + QPoint mousePos = mapFromGlobal(QPoint(touch_list.at(0).pos().x(),touch_list.at(0).pos().y())); + if (widgetRect.contains(mousePos)){ + slotPwdBtnClicked(); + break; + } + } + isTouched = true; + _preTime = QTime::currentTime(); + longPressToSettingPage(); + emit signalScreenTouch(); + }while(0); + event->accept(); + return true; + case QEvent::TouchUpdate: + event->accept(); + return true; + case QEvent::TouchEnd: + isTouched = false; + _preTime = QTime::currentTime(); + event->accept(); + return true; + default: + break; + } + return QWidget::event(event); +} + +bool recoUiRecognizeScene::multiPressToSettingPage() +{ + bool bRet = false; + QTime time = QTime::currentTime(); + if(0 != m_clickCount) { + if( _preTime.msecsTo(time) > UiConfig::MOUSE_CLICK_INTERVAL_MAX) { + m_clickCount = 0; + } + } + if(0 == m_clickCount){ + if(m_backstageIf) + m_backstageIf->wakeUpFromScreenSaverOrScreenOff(); + } + + m_clickCount++; + _preTime = time; + + if(m_clickCount == UiConfig::MOUSE_CLICK_TIMES_TO_SETTING){ + m_clickCount = 0; + if(!UiConfig::GetInstance()->isTpAvailable()){ + emit signalChangePage(); + } + bRet = true; + } + return bRet; +} + +void recoUiRecognizeScene::slotLongPressShowSetting() +{ + if(isTouched && _preTime.msecsTo(QTime::currentTime()) > (UiConfig::TOUCH_TIME_TO_SETTING - 200)){ + emit signalChangePage(); + } +} + +bool recoUiRecognizeScene::longPressToSettingPage() +{ + if(m_backstageIf) + m_backstageIf->wakeUpFromScreenSaverOrScreenOff(); + QTimer::singleShot(UiConfig::TOUCH_TIME_TO_SETTING, this, SLOT(slotLongPressShowSetting())); + return true; +} + +void recoUiRecognizeScene::slotsNoSuccessPage(int nPage) +{ + if(nPage >= GLOBAL_RECO_END_NO && nPage <= GLOBAL_RECO_SHOW_QRCODE){ + switch(nPage) + { + case GLOBAL_RECO_END_OK: + break; + case GLOBAL_RECO_END_NO: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextAuthFailed)); + break; + case GLOBAL_RECO_FACE_CARD_NOT_MATCH: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextUseOwnCertifi)); + break; + case GLOBAL_RECO_SWIPE_CARD: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextTapCard)); + showStatusTip(recoUiTextCfg(RecoUiTextCfg::TextTapCard)); + break; + case GLOBAL_RECO_FACE_CAMERA: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextFaceCam)); + //slotShowRecoUiMask(99); + showStatusTip(recoUiTextCfg(RecoUiTextCfg::TextFaceCam)); + break; + case GLOBAL_RECO_NOT_PASS_TIME: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextNoEntryTime)); + break; + case GLOBAL_RECO_NEED_RECHECK: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("身份核验中")); + showStatusTip(tr("身份核验中")); + break; + case GLOBAL_RECO_PLATFORM_DISCONNECTED: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("服务器连接失败")); + break; + case GLOBAL_RECO_SWIPE_CARD_HERE: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请在此处刷卡")); + break; + case GLOBAL_RECO_HIDE_NAME_AREA: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, ""); + break; + case GLOBAL_RECO_NOT_LIVING: + showStatusTip(tr("请调整人脸角度")); + break; + case GLOBAL_RECO_SHOW_QRCODE: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷二维码")); + showStatusTip(tr("请刷二维码")); + break; + case GLOBAL_RECO_UNAUTH_CARD: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("未授权卡片")); + break; + case GLOBAL_RECO_PLS_TAP_ID_CARD: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷身份证")); + showStatusTip(tr("请刷身份证")); + break; + case GLOBAL_RECO_PLS_CHECK_STATIC: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请测试静电")); + showStatusTip(tr("请测试静电")); + break; + case GLOBAL_RECO_STATIC_ABNORMAL: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("静电测试异常")); + break; + case GLOBAL_RECO_SWIPE_ID_OR_HEALEH_CODE: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷身份证或扫码")); + showStatusTip(tr("请刷身份证或扫码")); + break; + case GLOBAL_RECO_CHECKING: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("健康码查询中")); + break; + case GLOBAL_RECO_CHECK_FAILED: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("查询失败")); + break; + case GLOBAL_RECO_QRCODE_OVERDUE: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("二维码已过期")); + break; + case GLOBAL_RECO_NETWORK_ERROR: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("网络异常")); + break; + case GLOBAL_RECO_PLATFORM_ERROR: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("服务器异常")); + break; + case GLOBAL_RECO_REQUEST_OVERTIME: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("服务器请求超时")); + break; + case GLOBAL_RECO_SWIPE_TRIP_CARD: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷行程卡")); + break; + case GLOBAL_RECO_SHOW_HEALTH_CODE: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请扫健康码")); + break; + case GLOBAL_RECO_RESWIPE_TRIP_CARD: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请重刷行程卡")); + break; + case GLOBAL_RECO_SWIPE_ID_AND_TRIP_CARD: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("刷身份证扫行程卡")); + break; + case GLOBAL_RECO_TRIP_CARD_CHECKING: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("行程卡查询中")); + break; + case GLOBAL_RECO_SCAN_YUEJUMA: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请扫粤居码")); + showStatusTip(tr("请扫粤居码")); + break; + case GLOBAL_RECO_SCAN_YUEJUMA_OR_SWIPE_ID: + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷粤居码/身份证")); + showStatusTip(tr("请刷粤居码/身份证")); + break; + default: + break; + } + } + else if(GLOBAL_RECO_ID_FAILED == nPage) { + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("身份证核验失败")); + } + else if(GLOBAL_RECO_IN == nPage){ + uiReset(); + } + else if(GLOBAL_RECO_CHECK == nPage){ + } + else if(GLOBAL_RECO_MASK_REQ == nPage){ + //m_wgtIdentity->showMaskResult(false, recoUiTextCfg(RecoUiTextCfg::TextNOMask)); + } + else if(GLOBAL_RECO_MASK_OK == nPage){ + //m_wgtIdentity->showMaskResult(true, recoUiTextCfg(RecoUiTextCfg::TextMaskOk)); + } + else if(GLOBAL_RECO_TAKE_OFF_MASK == nPage){ + //m_wgtIdentity->showMaskResult(false, tr("请摘下口罩")); + } + else if(GLOBAL_RECO_NO_ENTRY == nPage){ + //m_wgtDevMsg->setMsgBtm(recoUiTextCfg(RecoUiTextCfg::TextNoEntry), true); + } + else if(GLOBAL_RECO_CLEAR_NO_ENTRY == nPage){ + //m_wgtDevMsg->setMsgBtm(""); + } + else if(GLOBAL_RECO_CLOSE_SCANLINE == nPage){ + } + else if(GLOBAL_RECO_SHOW_QRCODE_RECO == nPage){ + } + else if(GLOBAL_RECO_SHOW_FACE_RECO == nPage){ + uiReset(); + } + +#if 0 + if (GLOBAL_RECO_NOT_LIVING == nPage || + GLOBAL_RECO_SWIPE_CARD == nPage || + GLOBAL_RECO_FACE_CAMERA == nPage) { + m_widget_result->showResult(2); + setMsgWidgetBg(1); + m_wgtIdentity->switchBg(3); + } +#endif +} + +void recoUiRecognizeScene::slotsSuccessPage(const int nPage, const QString& name) +{ + if( GLOBAL_RECO_END_OK != nPage){ + return ; + } + m_name = name; + //m_wgtIdentity->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextAllowPass)); +} + +void recoUiRecognizeScene::slotsDrawScanner(const int nPage, const bool faceAvailable) +{ + if(!faceAvailable){ + uiReset(); + } +} + +void recoUiRecognizeScene::slotsInteractionChange(const INTERACION_OPTION &interaction, int nSelectRes) +{ + if(OPTION_LOGO == interaction){ + QString logo; + if(0 == nSelectRes){ + logo = recoUiRecognize::LOGO_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]; + m_wgtDevMsg->setLogo(logo); + } + else if(1 == nSelectRes){ + logo = ""; + m_wgtDevMsg->setLogo(logo); + } + else if(2 == nSelectRes){ //自定义logo + if(m_backstageIf){ + char logoPath[256] = {'\0'}; + if(0 == m_backstageIf->getCustomLogo(logoPath, sizeof(logoPath))){ + logo = QString(logoPath); + m_wgtDevMsg->setLogo(logo, true); + } + } + } + } +} + +void recoUiRecognizeScene::slotShowNormalTemp(const float temp, const bool isC) +{ + //m_wgtIdentity->showTempResult(recoUiTextCfg(RecoUiTextCfg::TextTemp), temp, true, isC); +} + +void recoUiRecognizeScene::slotShowAbnormalTemp(const float temp, const bool isHigh, const bool isC) +{ + Q_UNUSED(isHigh); + //m_wgtIdentity->showTempResult(recoUiTextCfg(RecoUiTextCfg::TextTemp), temp, false, isC); +} + +void recoUiRecognizeScene::slotUpdateLogo(const int option) +{ + slotsInteractionChange(OPTION_LOGO, option); +} + +void recoUiRecognizeScene::slotUpdatePlatformConnectionStatus(const int status) +{ + m_wgtDevMsg->setNetworkStatus(status); +} + +void recoUiRecognizeScene::slotsResetRecoUi() +{ + slotsDrawScanner(0, false); +} + +void recoUiRecognizeScene::slotUpdateRecoUiIpDisplay(const bool switchStatus) +{ + if(switchStatus){ + if(m_backstageIf){ + char ip[16] = {0}; + int type = 0; + if(0 == m_backstageIf->getIP(ip, sizeof (ip), type)){ + m_wgtDevMsg->updateIp(ip, type); + } + } + } + else { + m_wgtDevMsg->updateIp(""); + } +} + +void recoUiRecognizeScene::slotShowRecoUiMask(int maskType) +{ + qDebug() << "slotShowRecoUiMask:" << maskType; + if(1 == maskType){ //day mode +#if 0 + setBg(m_pageIdle); + m_wgtStatusTip->hide(); +#else + m_wgtBack->hide(); + recoUiTextCfg(RecoUiTextCfg::TextFacePass); +#endif + //setCardReaderUnderScreenInstructions(false); + }else if(3 == maskType){ //night mode + //pal.setColor(QPalette::Background, QColor(Qt::white)); + //setCardReaderUnderScreenInstructions(true); + }else if(99 == maskType){ + if(1){//cam video with face frame m_backstageIf->getFaceFrameShowSw() + setBg(m_pageReco); + }else{//cam video without face frame + m_wgtBack->hide(); + } + } + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiRecognizeScene::slotNotiMsg(const int nPage, const QString& msg, int color) +{ + Q_UNUSED(nPage); + m_wgtDevMsg->setMsgNoti(msg, color); +} + + +void recoUiRecognizeScene::slotCenterMsg(const int nPage, const QString& msg) +{ + m_widget_cMsg->showMsg(msg, nPage); + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiRecognizeScene::slotPwdBtnClicked() +{ + emit signalShowPwdPage(""); +} + +void recoUiRecognizeScene::slotSetUserPwdButton(bool visible) +{ + if(visible){ + m_wgtBtnPwd->show(); + }else{ + m_wgtBtnPwd->hide(); + } +} + +void recoUiRecognizeScene::slotShowFinalResult(bool pass) +{ +#if 0 + m_widget_result->showResult(static_cast(pass)); + m_wgtIdentity->switchBg(pass ? 1 : 2); + m_wgtIdentity->show(); + setMsgWidgetBg(1); + QCoreApplication::processEvents(); +#endif +} + + +QString recoUiRecognizeScene::recoUiTextCfg(RecoUiTextCfg::enTextType type) +{ + const QString texts[] = {tr("请刷脸通行"), m_name, tr("未经许可人员"), tr("禁止通行"), tr("未佩戴口罩"), + tr("口罩检测通过"), tr("体温:"), tr("请刷卡"), tr("请用本人证件"), tr("请正视镜头"), + tr("禁止通行时段")}; + if(RecoUiTextCfg::DisModeHide == UiConfig::GetInstance()->m_textCfg[type].m_mode){ + return ""; + } + else if(RecoUiTextCfg::DisModeCustom == UiConfig::GetInstance()->m_textCfg[type].m_mode){ + return UiConfig::GetInstance()->m_textCfg[type].m_cusText; + } + return texts[type]; +} + +void recoUiRecognizeScene::uiReset() +{ + slotShowRecoUiMask(1); +#if 0 + m_wgtIdentity->reset(); + m_widget_result->hide(); + setMsgWidgetBg(0); +#endif +} + +void recoUiRecognizeScene::setTicketCheckCount(int source, int count) +{ + //m_wgtSceneMsg->setPersonNum(count); +} + +void recoUiRecognizeScene::setMsgWidgetBg(int bgType) +{ + QPalette pal(m_wgtDevMsg->palette()); + if(0 == bgType){ + pal.setBrush(QPalette::Background, QBrush(QPixmap(TOP_MSG_WIDGET_BG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + else if(1 == bgType){ + pal.setColor(QPalette::Background, QColor(0, 0, 0, 0)); + } + m_wgtDevMsg->setPalette(pal); + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiRecognizeScene::setCardReaderUnderScreenInstructions(bool isNightMode) +{ + if(nullptr == m_wgtCardUnderScreen){ + return; + } + + QPalette pal(m_wgtCardUnderScreen->palette()); + pal.setBrush(QPalette::Background,QBrush(QPixmap(isNightMode ? + SWIP_CARD_NIGHT_MODE_WIDGET_BG[UiConfig::GetInstance()->getScreenConfigIndex()] : + SWIP_CARD_DAY_MODE_WIDGET_BG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_wgtCardUnderScreen->setPalette(pal); + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiRecognizeScene::setBg(const QBrush& brush) +{ + QPalette pal(m_wgtBack->palette()); + pal.setBrush(QPalette::Background, brush); + m_wgtBack->setPalette(pal); + m_wgtBack->show(); +} + +void recoUiRecognizeScene::showStatusTip(const QString& tip) +{ + #if 0 + setBg(m_pageStatusTip); + m_wgtStatusTip->setText(tip); + m_wgtStatusTip->show(); + #else + m_widget_person->setPersonMsg(RecoUiTextCfg::TextOtherRecoResult, tip, PersonWidget::BG_COLOR_RED, true); + #endif +} + + +int recoUiRecognizeScene::setCamVideoWind() +{ + return m_backstageIf->recoUiTypeSwitch(0, 0, UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); +} + +void recoUiRecognizeScene::updateBg() +{ + qDebug() << "updateBg"; + return;//TODO + + #if 0 + stScreensaverCfg cfg; + if(0 != m_backstageIf->getRecoUiAdConfig(cfg)){ + qDebug() << "getRecoUiAdConfig failed!"; + return; + } + m_pageIdle = cfg.picQty ? QBrush(QPixmap(cfg.pic[0])) : QBrush(QPixmap(PAGE_BG[UiConfig::GetInstance()->getScreenConfigIndex()])); + setBg(m_pageIdle); + #endif +} + +void recoUiRecognizeScene::setBackstageUiinterface(BackstageInterfaceForUi *interface) +{ + m_backstageIf = interface; + char buf[64] = {'\0'}; + m_backstageIf->getDeviceId(buf, sizeof(buf)); + QString devId{buf}; + memset(buf, 0, sizeof(buf)); + m_backstageIf->getAppVersion(buf, sizeof(buf)); + QString ver{buf}; + m_wgtDevMsg->showDevInfo(devId, ver); + setTicketCheckCount(-1, m_backstageIf->getTicketCheckCountToday()); +} + + +const QString recoUiSceneResult::PAGE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_ui_scene_result_bg_medium.jpg", +":/res/image/reco_ui_scene_result_bg_medium.jpg", +":/res/image/reco_ui_scene_result_bg_medium.jpg", +":/res/image/reco_ui_scene_result_bg_medium.jpg", +":/res/image/reco_ui_scene_result_bg_medium.jpg" +}; +recoUiSceneResult::recoUiSceneResult(QWidget *parent) : QWidget(parent) +{ + setAutoFillBackground(true); + + QPalette palette(this->palette()); + //palette.setBrush(QPalette::Background, QBrush(QPixmap(PAGE_BG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + palette.setColor(QPalette::WindowText,Qt::black); + setPalette(palette); + + m_wgtSceneMsg = new SceneMsgWidget(this); + + QFont ft; + ft.setBold(true); + ft.setPointSize(16); + + m_labelResult = new QLabel(this); + m_labelResult->setAlignment(Qt::AlignCenter); + m_labelResult->setWordWrap(true); + m_labelResult->setFont(ft); + + ft.setBold(false); + ft.setPointSize(12); + m_labelBussInfo = new QLabel(this); + m_labelBussInfo->setFont(ft); + m_labelBussInfo->setAlignment(Qt::AlignCenter); + m_labelBussInfo->setWordWrap(true); + m_labelBussInfo->setFixedWidth(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.8)); + + m_labelBussPersonNum = new QLabel(this); + m_labelBussPersonNum->setAlignment(Qt::AlignCenter); + m_labelBussPersonNum->setFont(ft); + +#if 0 + m_accMsg = new QWidget(this); + m_accMsg->setFixedSize(UiConfig::GetInstance()->getUiWidth(), static_cast(UiConfig::GetInstance()->getUiHeight() * 0.2)); + m_accMsg->setAutoFillBackground(true); + + m_labelAcc = new QLabel(m_accMsg); + m_labelAcc->setPixmap(QPixmap(":/res/image/icon_arrow_upward_medium.png")); + m_labelAccRes = new QLabel(m_accMsg); + m_labelAccRes->setAlignment(Qt::AlignCenter); + m_labelAccRes->setMinimumWidth(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.4)); + m_labelAccRes->setWordWrap(true); + QPalette labelPal; + labelPal.setColor(QPalette::WindowText, Qt::white); + m_labelAccRes->setPalette(labelPal); + ft.setBold(true); + m_labelAccRes->setFont(ft); + + QHBoxLayout* hlayAcc = new QHBoxLayout(); + hlayAcc->addStretch(10); + hlayAcc->addWidget(m_labelAcc, 1, Qt::AlignCenter); + hlayAcc->addWidget(m_labelAccRes, 1, Qt::AlignCenter); + hlayAcc->addStretch(10); + hlayAcc->setSpacing(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.05)); + m_accMsg->setLayout(hlayAcc); +#endif + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->setMargin(0); + vlay->addWidget(m_wgtSceneMsg, 1, Qt::AlignTop); + vlay->addSpacing(static_cast(UiConfig::GetInstance()->getUiHeight() * 0.3)); + vlay->addWidget(m_labelResult, 1, Qt::AlignCenter); + vlay->addWidget(m_labelBussInfo, 1, Qt::AlignCenter); + vlay->addWidget(m_labelBussPersonNum, 1, Qt::AlignCenter); + vlay->addStretch(10); + //vlay->addSpacing(UiConfig::GetInstance()->getUiHeight() / 3); + //vlay->addWidget(m_accMsg, Qt::AlignCenter); + setLayout(vlay); + + m_bgWhiteList = QBrush(QPixmap(":/res/image/reco_ui_scene_bg_white_list_medium.jpg")); + m_bgSceneOk = QBrush(QPixmap(":/res/image/reco_ui_scene_bg_ok_medium.jpg")); + m_bgSceneFailed = QBrush(QPixmap(":/res/image/reco_ui_scene_bg_failed_medium.jpg")); +} + +void recoUiSceneResult::showResult(bool pass, const QString& result, const QString& businessInfo) +{ + m_labelResult->setText(""); + m_labelBussInfo->setText(""); + m_labelBussPersonNum->setText(""); + + QPalette palette(this->palette()); + if(!businessInfo.isEmpty()){ + QJsonParseError jsonError; + const QJsonDocument doc = QJsonDocument::fromJson(businessInfo.toUtf8(), &jsonError); + if (doc.isNull() || (jsonError.error != QJsonParseError::NoError)) {return;} + const QJsonObject obj = doc.object(); + QString visitorInfo; + const QString personInfo{obj.value("personInfo").toString()}; + if(!personInfo.isEmpty()){visitorInfo += personInfo;visitorInfo += "\n";} + const QString ticket{obj.value("ticket").toString()}; + if(!ticket.isEmpty()){visitorInfo += ticket;} + m_labelBussInfo->setText(visitorInfo); + if(obj.contains("personNum") && obj.value("personNum").toInt() > 1){ + //m_personAccessed = 0; + //m_personAll = obj.value("personNum").toInt(); + m_labelBussPersonNum->setText(QString("0/%1").arg(obj.value("personNum").toInt())); + } + palette.setBrush(QPalette::Background, pass ? m_bgSceneOk : m_bgSceneFailed); + }else if(!result.isEmpty()){ + m_labelResult->setText(result); + //m_personAccessed = 0; + //m_personAll = 1; + palette.setBrush(QPalette::Background, m_bgWhiteList); + }else{ + //m_labelResult->setText("无效票\nIneffectiveness"); + palette.setBrush(QPalette::Background, m_bgSceneFailed); + } + setPalette(palette); + +#if 0 + static const QPixmap ok(":/res/image/icon_arrow_upward_medium.png"); + static const QPixmap failed(":/res/image/forward slash_medium.png"); + m_labelAcc->setPixmap(pass ? ok : failed); + m_labelAccRes->setText(pass ? tr("请通行\nPass through") : tr("禁止通行\nNo Passing")); + QPalette pal(m_accMsg->palette()); + pal.setBrush(QPalette::Background, pass ? QColor(31, 164, 38) : QColor(250, 59, 59)); + m_accMsg->setPalette(pal); + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +#endif +} + +bool recoUiSceneResult::updatePersonNumAccessed(int personAccess, int personAll) +{ + m_personAccessed = personAccess; + m_personAll = personAll; + + if(personAll > 1){ + m_labelBussPersonNum->setText(QString("%1/%2").arg(m_personAccessed).arg(m_personAll)); + } + return m_personAccessed >= m_personAll; +} + +void recoUiSceneResult::setTicketCheckCount(int source, int count) +{ + m_wgtSceneMsg->setPersonNum(source, count); +} + +bool recoUiSceneResult::isPassing() const +{ + return m_personAccessed < m_personAll; +} + +void recoUiSceneResult::resetPersonCount() +{ + m_personAccessed = 0; + m_personAll = 0; +} + +void recoUiSceneResult::setPersonCountType(int type) +{ + m_wgtSceneMsg->setType(type); +} + + diff --git a/Linguist/recoUi/recoUiRecognizeScene.h b/Linguist/recoUi/recoUiRecognizeScene.h new file mode 100644 index 0000000..4c367a6 --- /dev/null +++ b/Linguist/recoUi/recoUiRecognizeScene.h @@ -0,0 +1,129 @@ +#ifndef RECOUIRECOGNIZESCENE_H +#define RECOUIRECOGNIZESCENE_H + +#include +#include "UiTools.h" +#include "recoUiRecognize.h" + + +class recoUiRecognizeScene : public PageAcceptMouseAndTouch +{ + Q_OBJECT +public: + static const int TOP_MSG_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString TOP_MSG_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int SWIP_CARD_WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int SWIP_CARD_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString SWIP_CARD_DAY_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString SWIP_CARD_NIGHT_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString PAGE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString PAGE_STATUS_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit recoUiRecognizeScene(bool isNightMode, bool hasPwdBtn, QWidget *parent = nullptr); + virtual ~recoUiRecognizeScene(); + void setBackstageUiinterface(BackstageInterfaceForUi *interface); + int setCamVideoWind(); + void updateBg(); + void uiReset(); + void setTicketCheckCount(int source, int count); + +signals: + void signalChangePage(); + void signalShowPwdPage(const QString& name); + void signalScreenTouch(); + +public slots: + void slotsNoSuccessPage(int nPage); + void slotsSuccessPage(const int nPage, const QString& name); + void slotsDrawScanner(const int nPage, const bool faceAvailable); + //void handleRecoResShowTime(); + void slotsInteractionChange(const INTERACION_OPTION& interaction, int nSelectRes); + void slotShowNormalTemp(const float temp, const bool isC); + void slotShowAbnormalTemp(const float temp, const bool isHigh, const bool isC); + void slotUpdateLogo(const int); + void slotUpdatePlatformConnectionStatus(const int); + void slotsResetRecoUi(); + //void slotShowQRCodeMsg(const int); + //void slotChangeRecoUiMode(); + //void slotTimerQRCodeScanline(); + //void slotQRCodeSwitchToStandbyStatusFromOvertimeStatus(); + void slotUpdateRecoUiIpDisplay(const bool); + //void slotShowFeatureUpdateProgress(const unsigned current, const unsigned all); + //void slotCloseFeatureUpdateProgress(); + void slotShowRecoUiMask(int maskType); + void slotNotiMsg(const int nPage, const QString& msg, int color); + void slotLongPressShowSetting(); + void slotCenterMsg(const int nPage, const QString& msg); + void slotPwdBtnClicked(); + void slotSetUserPwdButton(bool visible); + //void slotShowOrHideFaceFrame(bool show); + void slotShowFinalResult(bool pass); + +private: + //SceneMsgWidget* m_wgtSceneMsg; + MsgWidget* m_wgtDevMsg; + QWidget* m_wgtBack; + QWidget* m_wgtBtnPwd; + QWidget* m_wgtCardUnderScreen = nullptr; + //QLabel* m_wgtStatusTip; + CenterMsgWidget* m_widget_cMsg; + PersonWidget* m_widget_person; + + //QBrush m_pageIdle; + //QBrush m_pageStatusTip; + QBrush m_pageReco; + + QString m_name; + + int m_clickCount; + QTime _preTime; + bool isTouched; + + QString recoUiTextCfg(RecoUiTextCfg::enTextType type); + bool eventFilter(QObject *watched, QEvent *event); + bool event(QEvent *event); + bool multiPressToSettingPage(); + bool longPressToSettingPage(); + void setMsgWidgetBg(int bgType); + void setCardReaderUnderScreenInstructions(bool isNightMode); + void setBg(const QBrush& brush); + void showStatusTip(const QString& tip); +}; + +class recoUiSceneResult : public QWidget +{ + Q_OBJECT +public: + static const QString PAGE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit recoUiSceneResult(QWidget *parent = nullptr); + void showResult(bool pass, const QString& result, const QString& businessInfo); + bool updatePersonNumAccessed(int personAccess, int personAll); + void setTicketCheckCount(int source, int count); + bool isPassing() const; + void resetPersonCount(); + void setPersonCountType(int type); + +signals: + +public slots: + +private: + SceneMsgWidget* m_wgtSceneMsg; + QLabel* m_labelResult; + + QLabel* m_labelBussInfo; + QLabel* m_labelBussPersonNum; + + QBrush m_bgWhiteList; + QBrush m_bgSceneOk; + QBrush m_bgSceneFailed; + + //QWidget* m_accMsg; + //QLabel* m_labelAcc; + //QLabel* m_labelAccRes; + int m_personAccessed; + int m_personAll; +}; + +#endif // RECOUIRECOGNIZESCENE_H diff --git a/Linguist/recoUi/recoUiRecognizeTypeBase.cpp b/Linguist/recoUi/recoUiRecognizeTypeBase.cpp new file mode 100644 index 0000000..88c793a --- /dev/null +++ b/Linguist/recoUi/recoUiRecognizeTypeBase.cpp @@ -0,0 +1,1272 @@ +#include "recoUiRecognizeTypeBase.h" +#include +#include +#include "DndModeCountDownItem.h" + +const int RecoResultWidget::FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {25, 28, 28, 10, 10}; + +const QString RecoResultWidget::RECO_OK_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_reco_ok_large.png", +":/res/image/reco_msg_reco_ok_large.png", +":/res/image/reco_msg_reco_ok_large.png", +":/res/image/reco_msg_reco_ok_large.png", +":/res/image/reco_msg_reco_ok_large.png" +}; +const QString RecoResultWidget::RECO_FAIL_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_reco_fail_large.png", +":/res/image/reco_msg_reco_fail_large.png", +":/res/image/reco_msg_reco_fail_large.png", +":/res/image/reco_msg_reco_fail_large.png", +":/res/image/reco_msg_reco_fail_large.png" +}; +const QString RecoResultWidget::RECO_WARN_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_reco_warn_large.png", +":/res/image/reco_msg_reco_warn_large.png", +":/res/image/reco_msg_reco_warn_large.png", +":/res/image/reco_msg_reco_warn_large.png", +":/res/image/reco_msg_reco_warn_large.png" +}; +const QString RecoResultWidget::MASK_OK_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_mask_ok_large.png", +":/res/image/reco_msg_mask_ok_large.png", +":/res/image/reco_msg_mask_ok_large.png", +":/res/image/reco_msg_mask_ok_large.png", +":/res/image/reco_msg_mask_ok_large.png" +}; +const QString RecoResultWidget::MASK_NULL_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_mask_null_large.png", +":/res/image/reco_msg_mask_null_large.png", +":/res/image/reco_msg_mask_null_large.png", +":/res/image/reco_msg_mask_null_large.png", +":/res/image/reco_msg_mask_null_large.png" +}; + +const QString RecoResultWidget::TEMP_OK_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_temp_ok_large.png", +":/res/image/reco_msg_temp_ok_large.png", +":/res/image/reco_msg_temp_ok_large.png", +":/res/image/reco_msg_temp_ok_large.png", +":/res/image/reco_msg_temp_ok_large.png" +}; +const QString RecoResultWidget::TEMP_ABN_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_temp_abnorm_large.png", +":/res/image/reco_msg_temp_abnorm_large.png", +":/res/image/reco_msg_temp_abnorm_large.png", +":/res/image/reco_msg_temp_abnorm_large.png", +":/res/image/reco_msg_temp_abnorm_large.png" +}; + +RecoResultWidget::RecoResultWidget(QWidget *parent) : QWidget(parent) +{ + QFont ft; + m_label_identity_icon = new QLabel(this); + m_label_identity_word = new QLabel(this); + m_label_identity_word->setAlignment(Qt::AlignLeft); + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]);// * 1.1 + m_label_identity_word->setFont(ft); + QHBoxLayout* hlayId = new QHBoxLayout(); + hlayId->addWidget(m_label_identity_icon, 1, Qt::AlignLeft); + hlayId->addWidget(m_label_identity_word, 10, Qt::AlignLeft); + + m_label_mask_icon = new QLabel(this); + m_label_mask_word = new QLabel(this); + m_label_mask_word->setAlignment(Qt::AlignLeft); + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_label_mask_word->setFont(ft); + QHBoxLayout* hlayMask = new QHBoxLayout(); + hlayMask->addSpacing(10); //id icon:60, mask icon:40 + hlayMask->addWidget(m_label_mask_icon, 1, Qt::AlignLeft); + hlayMask->addSpacing(10); + hlayMask->addWidget(m_label_mask_word, 10, Qt::AlignLeft); + + m_label_temp_icon = new QLabel(this); + m_label_temp_word = new QLabel(this); + m_label_temp_word->setAlignment(Qt::AlignLeft); + m_label_temp_word->setFont(ft); + QHBoxLayout* hlayTemp = new QHBoxLayout(); + hlayTemp->addSpacing(10); + hlayTemp->addWidget(m_label_temp_icon, 1, Qt::AlignLeft); + hlayMask->addSpacing(10); + hlayTemp->addWidget(m_label_temp_word, 10, Qt::AlignLeft); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addStretch(); + vlay->addLayout(hlayId); + vlay->addLayout(hlayMask); + vlay->addLayout(hlayTemp); + vlay->addStretch(); + vlay->setMargin(0); + setLayout(vlay); +} + +void RecoResultWidget::showIdentityResult(GLOBAL_RECO_STATE state, const QString& msg) +{ + qDebug() << "show result:" << state; + if(GLOBAL_RECO_END_OK == state){ + qDebug() << "show name"; + m_label_identity_icon->setPixmap(RECO_OK_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_label_identity_icon->show(); + m_label_identity_word->setText(msg); + m_label_identity_word->show(); + } + else if (GLOBAL_RECO_NOT_LIVING == state || + GLOBAL_RECO_SWIPE_CARD == state || + GLOBAL_RECO_FACE_CAMERA == state) { + m_label_identity_icon->setPixmap(RECO_WARN_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_label_identity_icon->show(); + m_label_identity_word->setText(msg); + m_label_identity_word->show(); + } + else { + m_label_identity_icon->setPixmap(RECO_FAIL_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_label_identity_icon->show(); + m_label_identity_word->setText(msg); + m_label_identity_word->show(); + } +} + +void RecoResultWidget::showMaskResult(bool hasMask, const QString& msg) +{ + m_label_mask_icon->setPixmap(hasMask ? MASK_OK_IMG[UiConfig::GetInstance()->getScreenConfigIndex()] : + MASK_NULL_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_label_mask_icon->show(); + m_label_mask_word->setText(msg); + m_label_mask_word->show(); +} + +void RecoMsgWidget::setDndMode(bool dndMode, const std::chrono::system_clock::time_point &endTime) { + m_dndItem->setVisible(dndMode); + QVector widgets; + int timeWidgetIndex = -1; + int dndItemIndex = -1; + for (int i = 0; i < m_stackWgt_msg->count(); i++) { + auto current = m_stackWgt_msg->widget(i); + widgets.push_back(current); + if (dynamic_cast(current) == m_widget_time) { + timeWidgetIndex = i; + } else if (dynamic_cast(current) == m_dndItem) { + dndItemIndex = i; + } + } + for (auto widget : widgets) { + m_stackWgt_msg->removeWidget(widget); + } + + if (dndMode) { + if (timeWidgetIndex >= 0) { + widgets[timeWidgetIndex] = m_dndItem; + } + m_dndItem->setEndTime(endTime); + } else { + if (dndItemIndex >= 0) { + widgets[dndItemIndex] = m_widget_time; + } + } + + for (auto widget : widgets) { + m_stackWgt_msg->addWidget(widget); + } +} + +void RecoResultWidget::showTempResult(const QString& msg, float temp, bool isNormal, bool isC) +{ + m_label_temp_icon->setPixmap(isNormal ? TEMP_OK_IMG[UiConfig::GetInstance()->getScreenConfigIndex()] : + TEMP_ABN_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_label_temp_icon->show(); + QString strTem = msg; + if(temp > 1.0f){ + const float min = (isC ? recoUiRecognize::LOW_TEMP_VALUE : recoUiRecognize::LOW_TEMP_VALUE * 1.8 + 32.0); + const float max = (isC ? recoUiRecognize::HIGH_TEMP_VALUE : recoUiRecognize::HIGH_TEMP_VALUE * 1.8 + 32.0); + if(temp < min){ + strTem += "<"; + } + else if(temp > max){ + strTem += ">"; + } + strTem += QString().setNum(temp, 'f', 1); + strTem += (isC ? "℃" : "℉"); + } + m_label_temp_word->setText(strTem); + m_label_temp_word->show(); +} + +void RecoResultWidget::reset() +{ + m_label_identity_icon->hide(); + m_label_identity_word->hide(); + m_label_mask_icon->hide(); + m_label_mask_word->hide(); + m_label_temp_icon->hide(); + m_label_temp_word->hide(); +} + +const int RecoMsgWidget::TIME_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {30, 55, 55, 20, 20}; +const int RecoMsgWidget::DATE_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {24, 22, 22, 8, 8}; +const int RecoMsgWidget::MSG_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {256, 256, 258, 257, 257}; +const int RecoMsgWidget::PIC_WIDGET_H_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {200, 200, 200, 201, 201}; +const QString RecoMsgWidget::PIC_WIDGET_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_face_pic_large.png", +":/res/image/reco_msg_face_pic_large.png", +":/res/image/reco_msg_face_pic_large.png", +":/res/image/reco_msg_face_pic_large.png", +":/res/image/reco_msg_face_pic_large.png" +}; +const QString RecoMsgWidget::IDLE_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_bg_idle_middle.png", +":/res/image/reco_msg_bg_idle_large.png", +":/res/image/reco_msg_bg_idle_middle.png", +":/res/image/reco_msg_bg_idle_large.png", +":/res/image/reco_msg_bg_idle_middle.png" +}; +const QString RecoMsgWidget::OK_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_bg_pass_middle.png", +":/res/image/reco_msg_bg_pass_large.png", +":/res/image/reco_msg_bg_pass_middle.png", +":/res/image/reco_msg_bg_pass_large.png", +":/res/image/reco_msg_bg_pass_middle.png" +}; +const QString RecoMsgWidget::FAIL_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_bg_fail_middle.png", +":/res/image/reco_msg_bg_fail_large.png", +":/res/image/reco_msg_bg_fail_middle.png", +":/res/image/reco_msg_bg_fail_large.png", +":/res/image/reco_msg_bg_fail_middle.png" +}; +const QString RecoMsgWidget::WARN_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_msg_bg_warn_middle.png", +":/res/image/reco_msg_bg_warn_large.png", +":/res/image/reco_msg_bg_warn_middle.png", +":/res/image/reco_msg_bg_warn_large.png", +":/res/image/reco_msg_bg_warn_middle.png" +}; + +const QString RecoMsgWidget::T1_IDLE_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/t1_reco_msg_bg_idle_middle.png", +":/res/image/t1_reco_msg_bg_idle_large.png", +":/res/image/t1_reco_msg_bg_idle_middle.png", +":/res/image/t1_reco_msg_bg_idle_large.png", +":/res/image/t1_reco_msg_bg_idle_middle.png" +}; +const QString RecoMsgWidget::T1_OK_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/t1_reco_msg_bg_pass_middle.png", +":/res/image/t1_reco_msg_bg_pass_large.png", +":/res/image/t1_reco_msg_bg_pass_middle.png", +":/res/image/t1_reco_msg_bg_pass_large.png", +":/res/image/t1_reco_msg_bg_pass_middle.png" +}; +const QString RecoMsgWidget::T1_FAIL_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/t1_reco_msg_bg_fail_middle.png", +":/res/image/t1_reco_msg_bg_fail_large.png", +":/res/image/t1_reco_msg_bg_fail_middle.png", +":/res/image/t1_reco_msg_bg_fail_large.png", +":/res/image/t1_reco_msg_bg_fail_middle.png" +}; +const QString RecoMsgWidget::T1_WARN_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/t1_reco_msg_bg_warn_middle.png", +":/res/image/t1_reco_msg_bg_warn_large.png", +":/res/image/t1_reco_msg_bg_warn_middle.png", +":/res/image/t1_reco_msg_bg_warn_large.png", +":/res/image/t1_reco_msg_bg_warn_middle.png" +}; + +RecoMsgWidget::RecoMsgWidget(bool hasFacePic, bool enTimeType, int bgImgType, QWidget *parent) + : QWidget(parent), m_bgImgType(bgImgType) +{ + if(hasFacePic){ + m_widget_pic = new QWidget(this); + m_widget_pic->setAutoFillBackground(true); + } + else{ + m_widget_pic = nullptr; + } + + m_stackWgt_msg = new QStackedWidget(this); + m_stackWgt_msg->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.55), + static_cast(MSG_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()] * 0.9)); + + m_widget_time = new TimeWidget(enTimeType, TIME_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()], + DATE_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()], this); + m_stackWgt_msg->addWidget(m_widget_time); + + m_dndItem = new DndModeCountDownItem(this); + m_dndItem->hide(); + + m_widget_result = new RecoResultWidget(this); + m_stackWgt_msg->addWidget(m_widget_result); + + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::white); + setAutoFillBackground(true); + setPalette(palette); + + #if 0 + QHBoxLayout* hlay = new QHBoxLayout(); + if(m_widget_pic){ + hlay->addWidget(m_widget_pic); + hlay->addSpacing(UiConfig::GetInstance()->getUiWidth() / 15); + } + else{ + hlay->addSpacing(UiConfig::GetInstance()->getUiWidth() / 3); + } + hlay->addWidget(m_stackWgt_msg); + hlay->setContentsMargins(UiConfig::GetInstance()->getUiWidth() / 10, 10, UiConfig::GetInstance()->getUiWidth() / 10, 0); + setLayout(hlay); + #else + if(m_widget_pic){ + m_widget_pic->move(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.1), + static_cast(MSG_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()] * 0.15)); + } + m_stackWgt_msg->move(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.38), + static_cast(MSG_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()] * 0.07)); + #endif + + setFixedSize(UiConfig::GetInstance()->getUiWidth(), MSG_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + reset(); +} + +void RecoMsgWidget::showFacePic(const QString& picPath) +{ + if(!m_widget_pic){ + return; + } + + QPalette pal(m_widget_pic->palette()); + #if 1 + QPixmap pm(ScalePixmap(QPixmap(picPath), + QSize(PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()], + PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()]))); + qDebug() << "w:" << pm.width() << " h:" << pm.height(); + m_widget_pic->setFixedSize(pm.width(), pm.height()); + pal.setBrush(QPalette::Background,QBrush(pm)); + #else + pal.setBrush(QPalette::Background, QBrush(QPixmap(picPath).scaled( + PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()], + PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()], + Qt::IgnoreAspectRatio, Qt::SmoothTransformation))); + #endif + m_widget_pic->setPalette(pal); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } + QCoreApplication::processEvents(); +} + +void RecoMsgWidget::showFacePic(const unsigned char* jpgDate, int len) +{ + if(jpgDate == nullptr || len <= 0){ + return; + } + QImage faceImg; + faceImg.loadFromData(jpgDate, len, "JPG"); + if(!faceImg.isNull()){ + QPalette pal(m_widget_pic->palette()); + #if 1 + QImage img(ScaleImage(faceImg, + QSize(PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()], + PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()]))); + qDebug() << "w:" << img.width() << " h:" << img.height(); + m_widget_pic->setFixedSize(img.width(), img.height()); + pal.setBrush(QPalette::Background, QBrush(img)); + #else + pal.setBrush(QPalette::Background, QBrush(QPixmap::fromImage(*image).scaled( + PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()], + PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()], + Qt::IgnoreAspectRatio, Qt::SmoothTransformation))); + #endif + m_widget_pic->setPalette(pal); + + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } + } + QCoreApplication::processEvents(); +} + +void RecoMsgWidget::facePicReset() +{ + if(!m_widget_pic){ + return; + } + m_widget_pic->setFixedSize(PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()], + PIC_WIDGET_H_W[UiConfig::GetInstance()->getScreenConfigIndex()]); + QPalette pal(m_widget_pic->palette()); + pal.setBrush(QPalette::Background,QBrush(QPixmap(PIC_WIDGET_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_widget_pic->setPalette(pal); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } + QCoreApplication::processEvents(); +} + +void RecoMsgWidget::showIdentityResult(GLOBAL_RECO_STATE state, const QString& msg) +{ + m_widget_result->showIdentityResult(state, msg); + m_stackWgt_msg->setCurrentIndex(1); + m_widget_time->enableUpdate(false); + QCoreApplication::processEvents(); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } +} + +void RecoMsgWidget::showMaskResult(bool hasMask, const QString& msg) +{ + m_widget_result->showMaskResult(hasMask, msg); + m_stackWgt_msg->setCurrentIndex(1); + m_widget_time->enableUpdate(false); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } +} + +void RecoMsgWidget::showTempResult(const QString& msg, float temp, bool isNormal, bool isC) +{ + m_widget_result->showTempResult(msg, temp, isNormal, isC); + m_stackWgt_msg->setCurrentIndex(1); + m_widget_time->enableUpdate(false); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } +} + +void RecoMsgWidget::reset() +{ + m_widget_result->reset(); + m_widget_time->enableUpdate(true); + switchBg(0); + facePicReset(); + m_stackWgt_msg->setCurrentIndex(0); +} + +void RecoMsgWidget::switchBg(int type) +{ + type += (m_bgImgType * 10); + QPalette palette(this->palette()); + switch (type) { + case 0: + palette.setBrush(QPalette::Background, QBrush(QPixmap(IDLE_BG_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + break; + case 1: + palette.setBrush(QPalette::Background, QBrush(QPixmap(OK_BG_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + break; + case 2: + palette.setBrush(QPalette::Background, QBrush(QPixmap(FAIL_BG_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + break; + case 3: + palette.setBrush(QPalette::Background, QBrush(QPixmap(WARN_BG_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + break; + + case 10: + palette.setBrush(QPalette::Background, QBrush(QPixmap(T1_IDLE_BG_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + break; + case 11: + palette.setBrush(QPalette::Background, QBrush(QPixmap(T1_OK_BG_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + break; + case 12: + palette.setBrush(QPalette::Background, QBrush(QPixmap(T1_FAIL_BG_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + break; + case 13: + palette.setBrush(QPalette::Background, QBrush(QPixmap(T1_WARN_BG_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + break; + default: + break; + } + setPalette(palette); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } +} + + +const QString RecoTypeResultWidget::RESULT_OK_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/final_res_ok_middle.png", +":/res/image/final_res_ok_large.png", +":/res/image/final_res_ok_middle.png", +":/res/image/final_res_ok_large.png", +":/res/image/final_res_ok_middle.png" +}; +const QString RecoTypeResultWidget::RESULT_FAIL_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/final_res_fail_middle.png", +":/res/image/final_res_fail_large.png", +":/res/image/final_res_fail_middle.png", +":/res/image/final_res_fail_large.png", +":/res/image/final_res_fail_middle.png" +}; +const QString RecoTypeResultWidget::RESULT_WARN_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/final_res_warn_middle.png", +":/res/image/final_res_warn_large.png", +":/res/image/final_res_warn_middle.png", +":/res/image/final_res_warn_large.png", +":/res/image/final_res_warn_middle.png" +}; +RecoTypeResultWidget::RecoTypeResultWidget(QWidget *parent) : QWidget(parent) +{ + setFixedSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + setAutoFillBackground(true); + hide(); +} + +void RecoTypeResultWidget::showResult(int type) +{ + QPalette pal(palette()); + if(type == 2){ + pal.setBrush(QPalette::Background, QBrush(QPixmap(RecoTypeResultWidget::RESULT_WARN_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + else{ + pal.setBrush(QPalette::Background,QBrush(QPixmap(1 == type ? + RecoTypeResultWidget::RESULT_OK_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()] : + RecoTypeResultWidget::RESULT_FAIL_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + setPalette(pal); + show(); + if(UiConfig::GetInstance()->isRkDevice()){ + dynamic_cast(parent())->update(); + } +} + + +const int recoUiRecognizeTypeBase::TOP_MSG_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {89, 89, 89, 90, 90}; +const int recoUiRecognizeTypeBase::AD_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {1052, 1052, 1052, 1053, 1053}; +const QString recoUiRecognizeTypeBase::TOP_MSG_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/top_msg_large.png", +":/res/image/top_msg_large.png", +":/res/image/top_msg_large.png", +":/res/image/top_msg_large.png", +":/res/image/top_msg_large.png" +}; +const int recoUiRecognizeTypeBase::SWIP_CARD_WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {400, 746, 720, 746, 720}; +const int recoUiRecognizeTypeBase::SWIP_CARD_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {70, 104, 104, 105, 105}; +const QString recoUiRecognizeTypeBase::SWIP_CARD_DAY_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/swipe_card_day_mode_type1_large.png", +":/res/image/swipe_card_day_mode_type1_large.png", +":/res/image/swipe_card_day_mode_type1_large.png", +":/res/image/swipe_card_day_mode_type1_large.png", +":/res/image/swipe_card_day_mode_type1_large.png" +}; +const QString recoUiRecognizeTypeBase::SWIP_CARD_NIGHT_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/swipe_card_night_mode_type1_large.png", +":/res/image/swipe_card_night_mode_type1_large.png", +":/res/image/swipe_card_night_mode_type1_large.png", +":/res/image/swipe_card_night_mode_type1_large.png", +":/res/image/swipe_card_night_mode_type1_large.png" +}; + +recoUiRecognizeTypeBase::recoUiRecognizeTypeBase(bool isNightMode, bool hasPwdBtn, bool hasCallBtn, int type, QWidget *parent) : PageAcceptMouseAndTouch(parent), m_uiType(type) +{ + const bool hasFaceImg = (0 == type); + const bool hasAd = (1 == type); + const int recoMsgBgType = type; + + m_wgtBack = new QWidget(this); + m_wgtBack->setAutoFillBackground(true); + m_wgtBack->setFixedSize(UiConfig::GetInstance()->getUiWidth(), AD_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + + if(hasAd){ + m_widget_ad = new recoUiScreensaver(1, this); + m_widget_ad->resize(UiConfig::GetInstance()->getUiWidth(), AD_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + } + else{ + m_widget_ad = nullptr; + } + + if(!UiConfig::GetInstance()->isFuncNotSupport(FuncCardReaderUnderScreen)){ + qDebug() << "show swipe card area"; + m_wgtCardUnderScreen = new QWidget(this); + m_wgtCardUnderScreen->setAutoFillBackground(true); + m_wgtCardUnderScreen->setFixedSize(SWIP_CARD_WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()], + SWIP_CARD_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + } + else{ + m_wgtCardUnderScreen = nullptr; + } + slotShowRecoUiMask(3); //set night mode for ui init + + m_widget_reco = new RecoMsgWidget(hasFaceImg, UiConfig::GetInstance()->getLanguageType() != 0, recoMsgBgType, this); + + m_widget_result = new RecoTypeResultWidget(this); + + m_widget_msg = new MsgWidget(1, 1, Qt::white, this); + m_widget_msg->setFixedSize(UiConfig::GetInstance()->getUiWidth(), TOP_MSG_WIDGET_HEIGHT[UiConfig::GetInstance()->getScreenConfigIndex()]); + setMsgWidgetBg(0); + +#if 0 + m_wgtCallDial = new QWidget(this); + m_wgtCallDial->setAutoFillBackground(true); + m_wgtCallDial->setFixedSize(recoUiRecognize::PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()], + recoUiRecognize::PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + QPalette dialPal(m_wgtCallDial->palette()); + dialPal.setBrush(QPalette::Background,QBrush(QPixmap(recoUiRecognize::CALL_BTN[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_wgtCallDial->setPalette(dialPal); + if(!hasCallBtn){ + m_wgtCallDial->hide(); + } +#else + QPalette dialPal; + dialPal.setBrush(QPalette::Background,QBrush(QPixmap(":/res/image/grey_bg_large.png"))); + const int callWgtWidth = 400; + const int callWgtHeight = 128; + const int callWgtPosY = static_cast(UiConfig::GetInstance()->getUiHeight() * 0.6); + const int callWgtDevPosX = static_cast(UiConfig::GetInstance()->getUiWidth() * 0.55); + const int callWgtMngCenterPosX = -(callWgtDevPosX + callWgtWidth - UiConfig::GetInstance()->getUiWidth()); + QFont ft; + + m_wgtCallDialDev = new RoundedWidget(this); +#if 0 + dialPal.setColor(QPalette::WindowText, QColor(18, 165, 127)); +#else + dialPal.setColor(QPalette::WindowText,Qt::darkGray); + m_wgtCallDialDev->setDisabled(true); +#endif + m_wgtCallDialDev->setPalette(dialPal); + m_wgtCallDialDev->setAutoFillBackground(true); + m_wgtCallDialDev->setFixedSize(callWgtWidth, callWgtHeight); + m_wgtCallDialDev->move(callWgtDevPosX, callWgtPosY); + + QLabel* labelCallDevIcon = new QLabel(m_wgtCallDialDev); + labelCallDevIcon->setPixmap(QPixmap(":/res/image/call1_large.png")); + QLabel* labelCallDevText = new QLabel(tr("呼叫设备"), m_wgtCallDialDev); + labelCallDevText->setAlignment(Qt::AlignCenter); + ft.setPointSize(12); + labelCallDevText->setFont(ft); + + QHBoxLayout* hlayCallDev = new QHBoxLayout(); + hlayCallDev->setMargin(30); + hlayCallDev->addSpacing(10); + hlayCallDev->addWidget(labelCallDevIcon); + hlayCallDev->addWidget(labelCallDevText); + hlayCallDev->addStretch(); + m_wgtCallDialDev->setLayout(hlayCallDev); + if(!hasCallBtn){ + m_wgtCallDialDev->hide(); + } + + m_wgtCallMngCenter = new RoundedWidget(this); + dialPal.setColor(QPalette::WindowText, QColor(18, 150, 219)); + m_wgtCallMngCenter->setPalette(dialPal); + m_wgtCallMngCenter->setAutoFillBackground(true); + m_wgtCallMngCenter->setFixedSize(callWgtWidth, callWgtHeight); + m_wgtCallMngCenter->move(callWgtMngCenterPosX, callWgtPosY); + + QLabel* MngCenter = new QLabel(m_wgtCallMngCenter); + MngCenter->setPixmap(QPixmap(":/res/image/customer_service_large.png")); + QLabel* labelCallMngCenterText = new QLabel(tr("呼叫管理处"), m_wgtCallMngCenter); + labelCallMngCenterText->setFont(ft); + labelCallMngCenterText->setAlignment(Qt::AlignCenter); + QHBoxLayout* hlayCallMngCenter = new QHBoxLayout(); + hlayCallMngCenter->setMargin(30); + hlayCallMngCenter->addStretch(); + hlayCallMngCenter->addWidget(MngCenter); + hlayCallMngCenter->addWidget(labelCallMngCenterText); + //hlayCallMngCenter->addStretch(); + m_wgtCallMngCenter->setLayout(hlayCallMngCenter); + if(!hasCallBtn){ + m_wgtCallMngCenter->hide(); + } +#endif + QHBoxLayout* hlayBtn = new QHBoxLayout(); + m_wgtBtnPwd = new QWidget(this); + m_wgtBtnPwd->setAutoFillBackground(true); + m_wgtBtnPwd->setFixedSize(recoUiRecognize::PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()], + recoUiRecognize::PWD_BTN_W_H[UiConfig::GetInstance()->getScreenConfigIndex()]); + if(!hasPwdBtn){ + m_wgtBtnPwd->hide(); + } + QPalette pwdPal(m_wgtBtnPwd->palette()); + pwdPal.setBrush(QPalette::Background,QBrush(QPixmap(recoUiRecognize::PWD_BTN[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_wgtBtnPwd->setPalette(pwdPal); + hlayBtn->addWidget(m_wgtBtnPwd, 1, Qt::AlignTop | Qt::AlignRight); + + hlayBtn->setMargin(UiConfig::GetInstance()->getUiWidth() / 15); + + m_widget_cMsg = new CenterMsgWidget(); + //m_widget_cMsg->move((UiConfig::GetInstance()->getUiWidth() - CenterMsgWidget::WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()]) / 2, + // static_cast(UiConfig::GetInstance()->getUiHeight() * 0.3)); + m_widget_cMsg->hide(); + + m_vlay = new QVBoxLayout(); + m_vlay->setMargin(0); + m_vlay->setSpacing(0); + m_vlay->addWidget(m_widget_msg, 1, Qt::AlignTop); + m_vlay->addLayout(hlayBtn, 1); + m_vlay->addStretch(10); + if (m_wgtCardUnderScreen) { + m_vlay->addWidget(m_wgtCardUnderScreen, 1, Qt::AlignBottom | Qt::AlignCenter); + } + m_vlay->addWidget(m_widget_reco, 1, Qt::AlignBottom); + setLayout(m_vlay); + + slotShowRecoUiMask(isNightMode ? 3 : 1); +} + +recoUiRecognizeTypeBase::~recoUiRecognizeTypeBase() +{ + if(m_widget_cMsg){ + delete m_widget_cMsg; + } +} + +bool recoUiRecognizeTypeBase::eventFilter(QObject *watched, QEvent *event) +{ + if( watched == this){ + if(event->type() == QEvent::MouseButtonPress){ + qDebug() << "MouseButtonPress"; + emit signalScreenTouch(); + if(multiPressToSettingPage()){ + QPoint pos; + pos.setX(UiConfig::GetInstance()->getUiWidth() / 2); + pos.setY(UiConfig::GetInstance()->getUiHeight() / 2); + QCursor::setPos(pos); + } + } + else{ + return false; + } + } + else{ + return QWidget::eventFilter(watched, event); + } + + return false; +} + +bool recoUiRecognizeTypeBase::event(QEvent *event) +{ + switch( event->type() ){ + case QEvent::TouchBegin: + do{ + if(UiConfig::GetInstance()->getHardwareTesting()){ + break; + } + QList touch_list = static_cast(event)->touchPoints(); + QPoint mousePos = mapFromGlobal(QPoint(touch_list.at(0).pos().x(),touch_list.at(0).pos().y())); + if(!m_wgtBtnPwd->isHidden() && m_wgtBtnPwd->geometry().contains(mousePos)){ + m_backstageIf->playAudio(audioInputPwd); + slotPwdBtnClicked(); + break; + } +#if 0 // 设备对讲还有缺陷,暂不支持 + if(!m_wgtCallDialDev->isHidden() && m_wgtCallDialDev->geometry().contains(mousePos)){ + emit callDialButtonClicked(); + break; + } +#endif + if(!m_wgtCallMngCenter->isHidden() && m_wgtCallMngCenter->geometry().contains(mousePos)){ + emit callPlatformButtonClicked("管理处"); + break; + } + isTouched = true; + _preTime = QTime::currentTime(); + longPressToSettingPage(); + emit signalScreenTouch(); + }while(0); + event->accept(); + return true; + case QEvent::TouchUpdate: + event->accept(); + return true; + case QEvent::TouchEnd: + isTouched = false; + _preTime = QTime::currentTime(); + event->accept(); + return true; + default: + break; + } + return QWidget::event(event); +} + +bool recoUiRecognizeTypeBase::multiPressToSettingPage() +{ + bool bRet = false; + QTime time = QTime::currentTime(); + if(0 != m_clickCount) { + if( _preTime.msecsTo(time) > UiConfig::MOUSE_CLICK_INTERVAL_MAX) { + m_clickCount = 0; + } + } + if(0 == m_clickCount){ + if(m_backstageIf) + m_backstageIf->wakeUpFromScreenSaverOrScreenOff(); + } + + m_clickCount++; + _preTime = time; + + if(m_clickCount == UiConfig::MOUSE_CLICK_TIMES_TO_SETTING){ + m_clickCount = 0; + if(!UiConfig::GetInstance()->isTpAvailable()){ + emit signalChangePage(); + } + bRet = true; + } + return bRet; +} + +void recoUiRecognizeTypeBase::slotLongPressShowSetting() +{ + if(isTouched && _preTime.msecsTo(QTime::currentTime()) > (UiConfig::TOUCH_TIME_TO_SETTING - 200)){ + emit signalChangePage(); + } +} + +bool recoUiRecognizeTypeBase::longPressToSettingPage() +{ + if(m_backstageIf) + m_backstageIf->wakeUpFromScreenSaverOrScreenOff(); + QTimer::singleShot(UiConfig::TOUCH_TIME_TO_SETTING, this, SLOT(slotLongPressShowSetting())); + return true; +} + +void recoUiRecognizeTypeBase::slotsNoSuccessPage(int nPage) +{ + if(nPage >= GLOBAL_RECO_END_NO && nPage <= GLOBAL_RECO_SHOW_QRCODE){ + switch(nPage) + { + case GLOBAL_RECO_END_OK: + break; + case GLOBAL_RECO_END_NO: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextAuthFailed)); + break; + case GLOBAL_RECO_FACE_CARD_NOT_MATCH: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextUseOwnCertifi)); + break; + case GLOBAL_RECO_SWIPE_CARD: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextTapCard)); + break; + case GLOBAL_RECO_FACE_CAMERA: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextFaceCam)); + break; + case GLOBAL_RECO_NOT_PASS_TIME: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextNoEntryTime)); + break; + case GLOBAL_RECO_NEED_RECHECK: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("身份核验中")); + break; + case GLOBAL_RECO_PLATFORM_DISCONNECTED: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("服务器连接失败")); + break; + case GLOBAL_RECO_SWIPE_CARD_HERE: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请在此处刷卡")); + break; + case GLOBAL_RECO_HIDE_NAME_AREA: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, ""); + break; + case GLOBAL_RECO_NOT_LIVING: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请调整人脸角度")); + break; + case GLOBAL_RECO_SHOW_QRCODE: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷二维码")); + break; + case GLOBAL_RECO_UNAUTH_CARD: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("未授权卡片")); + break; + case GLOBAL_RECO_PLS_TAP_ID_CARD: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷身份证")); + break; + case GLOBAL_RECO_PLS_CHECK_STATIC: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请测试静电")); + break; + case GLOBAL_RECO_STATIC_ABNORMAL: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("静电测试异常")); + break; + case GLOBAL_RECO_SWIPE_ID_OR_HEALEH_CODE: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷身份证或扫码")); + break; + case GLOBAL_RECO_CHECKING: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("健康码查询中")); + break; + case GLOBAL_RECO_CHECK_FAILED: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("查询失败")); + break; + case GLOBAL_RECO_QRCODE_OVERDUE: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("二维码已过期")); + break; + case GLOBAL_RECO_NETWORK_ERROR: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("网络异常")); + break; + case GLOBAL_RECO_PLATFORM_ERROR: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("服务器异常")); + break; + case GLOBAL_RECO_REQUEST_OVERTIME: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("服务器请求超时")); + break; + case GLOBAL_RECO_SWIPE_TRIP_CARD: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷行程卡")); + break; + case GLOBAL_RECO_SHOW_HEALTH_CODE: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请扫健康码")); + break; + case GLOBAL_RECO_RESWIPE_TRIP_CARD: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请重刷行程卡")); + break; + case GLOBAL_RECO_SWIPE_ID_AND_TRIP_CARD: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("刷身份证扫行程卡")); + break; + case GLOBAL_RECO_TRIP_CARD_CHECKING: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("行程卡查询中")); + break; + case GLOBAL_RECO_SCAN_YUEJUMA: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请扫粤居码")); + break; + case GLOBAL_RECO_SCAN_YUEJUMA_OR_SWIPE_ID: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("请刷粤居码/身份证")); + break; + case GLOBAL_RECO_PATROL_OK: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("巡更成功")); + break; + case GLOBAL_RECO_PATROL_NOT_RIGHT_TIME: + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("非巡更时段")); + break; + default: + break; + } + } + else if(GLOBAL_RECO_ID_FAILED == nPage) { + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, tr("身份证核验失败")); + } + else if(GLOBAL_RECO_IN == nPage){ + uiReset(); + } + else if(GLOBAL_RECO_CHECK == nPage){ + } + else if(GLOBAL_RECO_MASK_REQ == nPage){ + m_widget_reco->showMaskResult(false, recoUiTextCfg(RecoUiTextCfg::TextNOMask)); + } + else if(GLOBAL_RECO_MASK_OK == nPage){ + m_widget_reco->showMaskResult(true, recoUiTextCfg(RecoUiTextCfg::TextMaskOk)); + } + else if(GLOBAL_RECO_TAKE_OFF_MASK == nPage){ + m_widget_reco->showMaskResult(false, tr("请摘下口罩")); + } + else if(GLOBAL_RECO_NO_ENTRY == nPage){ + //m_widget_msg->setMsgBtm(recoUiTextCfg(RecoUiTextCfg::TextNoEntry), true); + } + else if(GLOBAL_RECO_CLEAR_NO_ENTRY == nPage){ + //m_widget_msg->setMsgBtm(""); + } + else if(GLOBAL_RECO_CLOSE_SCANLINE == nPage){ + } + else if(GLOBAL_RECO_SHOW_QRCODE_RECO == nPage){ + } + else if(GLOBAL_RECO_SHOW_FACE_RECO == nPage){ + uiReset(); + } + + if (GLOBAL_RECO_NOT_LIVING == nPage || + GLOBAL_RECO_SWIPE_CARD == nPage || + GLOBAL_RECO_FACE_CAMERA == nPage) { + m_widget_result->showResult(2); + setMsgWidgetBg(1); + m_widget_reco->switchBg(3); + } +} + +void recoUiRecognizeTypeBase::slotsSuccessPage(const int nPage, const QString& name) +{ + if( GLOBAL_RECO_END_OK != nPage){ + return ; + } + m_name = name; + m_widget_reco->showIdentityResult((GLOBAL_RECO_STATE)nPage, recoUiTextCfg(RecoUiTextCfg::TextAllowPass)); +} + +void recoUiRecognizeTypeBase::slotsDrawScanner(const int nPage, const bool faceAvailable) +{ + if(!faceAvailable){ + uiReset(); + } +} + +void recoUiRecognizeTypeBase::slotsInteractionChange(const INTERACION_OPTION &interaction, int nSelectRes) +{ + if(OPTION_LOGO == interaction){ + QString logo; + if(0 == nSelectRes){ + logo = recoUiRecognize::LOGO_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]; + m_widget_msg->setLogo(logo); + } + else if(1 == nSelectRes){ + logo = ""; + m_widget_msg->setLogo(logo); + } + else if(2 == nSelectRes){ //自定义logo + if(m_backstageIf){ + char logoPath[256] = {'\0'}; + if(0 == m_backstageIf->getCustomLogo(logoPath, sizeof(logoPath))){ + logo = QString(logoPath); + m_widget_msg->setLogo(logo, true); + } + } + } + } +} + +void recoUiRecognizeTypeBase::slotShowNormalTemp(const float temp, const bool isC) +{ + m_widget_reco->showTempResult(recoUiTextCfg(RecoUiTextCfg::TextTemp), temp, true, isC); +} + +void recoUiRecognizeTypeBase::slotShowAbnormalTemp(const float temp, const bool isHigh, const bool isC) +{ + Q_UNUSED(isHigh); + m_widget_reco->showTempResult(recoUiTextCfg(RecoUiTextCfg::TextTemp), temp, false, isC); +} + +void recoUiRecognizeTypeBase::slotUpdateLogo(const int option) +{ + slotsInteractionChange(OPTION_LOGO, option); +} + +void recoUiRecognizeTypeBase::slotUpdatePlatformConnectionStatus(const int status) +{ + m_widget_msg->setNetworkStatus(status); +} + +void recoUiRecognizeTypeBase::slotsResetRecoUi() +{ + slotsDrawScanner(0, false); +} + +void recoUiRecognizeTypeBase::slotUpdateRecoUiIpDisplay(const bool switchStatus) +{ + if(switchStatus){ + if(m_backstageIf){ + char ip[16] = {0}; + int type = 0; + if(0 == m_backstageIf->getIP(ip, sizeof (ip), type)){ + m_widget_msg->updateIp(ip, type); + } + } + } + else { + m_widget_msg->updateIp(""); + } +} + +void recoUiRecognizeTypeBase::slotShowRecoUiMask(int maskType) +{ + if(maskType > 3){ + return; + } + if(1 == maskType){ //day mode + m_wgtBack->hide(); + if(1 == m_uiType){ + m_widget_ad->show(); + } + setCardReaderUnderScreenInstructions(false); + } + else if(3 == maskType){ //night mode + QPalette pal(m_wgtBack->palette()); + if(0 == m_uiType){ + pal.setBrush(QPalette::Background,QBrush(QPixmap(recoUiRecognize::DARK_FILL_LIGHT_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + else if(1 == m_uiType){ + pal.setColor(QPalette::Background, QColor(Qt::white)); + m_widget_ad->hide(); + } + setCardReaderUnderScreenInstructions(true); + m_wgtBack->setPalette(pal); + m_wgtBack->show(); + } + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiRecognizeTypeBase::slotNotiMsg(const int nPage, const QString& msg, int color) +{ + Q_UNUSED(nPage); + m_widget_msg->setMsgNoti(msg, color); +} + + +void recoUiRecognizeTypeBase::slotCenterMsg(const int nPage, const QString& msg) +{ + m_widget_cMsg->showMsg(msg, nPage); + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiRecognizeTypeBase::slotPwdBtnClicked() +{ + emit signalShowPwdPage(""); +} + +void recoUiRecognizeTypeBase::slotSetUserPwdButton(bool visible) +{ + if(visible){ + m_wgtBtnPwd->show(); + }else{ + m_wgtBtnPwd->hide(); + } +} + +void recoUiRecognizeTypeBase::slotShowFinalResult(bool pass) +{ + m_widget_result->showResult(static_cast(pass)); + m_widget_reco->switchBg(pass ? 1 : 2); + m_widget_reco->show(); + setMsgWidgetBg(1); + QCoreApplication::processEvents(); +} + +void recoUiRecognizeTypeBase::slotShowCallBtn(bool show) +{ + //m_wgtCallDial->setVisible(show); + m_wgtCallDialDev->setVisible(show); + m_wgtCallMngCenter->setVisible(show); +} + +void recoUiRecognizeTypeBase::slotShowRecoUiDevIdAndVer(bool show) +{ + m_widget_msg->showRecoUiDevIdAndVer(show); +} + +QString recoUiRecognizeTypeBase::recoUiTextCfg(RecoUiTextCfg::enTextType type) +{ + const QString texts[] = {tr("请刷脸通行"), m_name, tr("未经许可人员"), tr("禁止通行"), tr("未佩戴口罩"), + tr("口罩检测通过"), tr("体温:"), tr("请刷卡"), tr("请用本人证件"), tr("请正视镜头"), + tr("禁止通行时段")}; + if(RecoUiTextCfg::DisModeHide == UiConfig::GetInstance()->m_textCfg[type].m_mode){ + return ""; + } + else if(RecoUiTextCfg::DisModeCustom == UiConfig::GetInstance()->m_textCfg[type].m_mode){ + return UiConfig::GetInstance()->m_textCfg[type].m_cusText; + } + return texts[type]; +} + +void recoUiRecognizeTypeBase::uiReset() +{ + m_widget_reco->reset(); + m_widget_result->hide(); + setMsgWidgetBg(0); + //m_widget_msg->setMsgBtm(""); +} + +void recoUiRecognizeTypeBase::setMsgWidgetBg(int bgType) +{ + QPalette pal(m_widget_msg->palette()); + if(0 == bgType){ + pal.setBrush(QPalette::Background, QBrush(QPixmap(TOP_MSG_WIDGET_BG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + } + else if(1 == bgType){ + pal.setColor(QPalette::Background, QColor(0, 0, 0, 0)); + } + m_widget_msg->setPalette(pal); + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + +void recoUiRecognizeTypeBase::setCardReaderUnderScreenInstructions(bool isNightMode) +{ + if(nullptr == m_wgtCardUnderScreen){ + return; + } + + QPalette pal(m_wgtCardUnderScreen->palette()); + pal.setBrush(QPalette::Background,QBrush(QPixmap(isNightMode ? + SWIP_CARD_NIGHT_MODE_WIDGET_BG[UiConfig::GetInstance()->getScreenConfigIndex()] : + SWIP_CARD_DAY_MODE_WIDGET_BG[UiConfig::GetInstance()->getScreenConfigIndex()]))); + m_wgtCardUnderScreen->setPalette(pal); + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + + +recoUiRecognizeTypeColor::recoUiRecognizeTypeColor(bool isNightMode, bool hasPwdBtn, bool hasCallBtn, QWidget *parent) + : recoUiRecognizeTypeBase(isNightMode, hasPwdBtn, hasCallBtn, 0, parent) +{ +} + +int recoUiRecognizeTypeColor::setCamVideoWind() +{ + return m_backstageIf->recoUiTypeSwitch(0, 0, UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); +} + +void recoUiRecognizeTypeColor::slotShowRecoUiColorFaceSnapshot(const QString& path) +{ + m_widget_reco->showFacePic(path); +} + +void recoUiRecognizeTypeColor::slotShowRecoUiColorFaceSnapshot(const unsigned char* jpgDate, int len) +{ + m_widget_reco->showFacePic(jpgDate, len); +} + +void recoUiRecognizeTypeColor::setBackstageUiinterface(BackstageInterfaceForUi *interface) +{ + m_backstageIf = interface; + char buf[64] = {'\0'}; + m_backstageIf->getDeviceId(buf, sizeof(buf)); + QString devId{buf}; + memset(buf, 0, sizeof(buf)); + m_backstageIf->getAppVersion(buf, sizeof(buf)); + QString ver{buf}; + m_widget_msg->showDevInfo(devId, ver); + m_widget_msg->showRecoUiDevIdAndVer(m_backstageIf->getShowIdAndVerSw()); +} + + +const int recoUiRecognizeTypeAd::CAM_WIN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][4] = { + {94, 1052, 134, 216}, + {94, 1042, 140, 224}, + {94, 1052, 134, 216}, + {94, 1042, 140, 224}, + {94, 1052, 134, 216} +}; + +recoUiRecognizeTypeAd::recoUiRecognizeTypeAd(bool isNightMode, bool hasPwdBtn, bool hasCallBtn, QWidget *parent) : + recoUiRecognizeTypeBase(isNightMode, hasPwdBtn, hasCallBtn, 1, parent) +{ + connect(this, SIGNAL(signalUpdateScreenSaver()), m_widget_ad, SLOT(slotUpdateScreenSaver())); + connect(m_widget_ad, SIGNAL(signalCurrentChange(int)), this, SLOT(slotCurrentChange(int))); +} + +int recoUiRecognizeTypeAd::setCamVideoWind() +{ + return m_backstageIf->recoUiTypeSwitch(CAM_WIN[UiConfig::GetInstance()->getScreenConfigIndex()][0], + CAM_WIN[UiConfig::GetInstance()->getScreenConfigIndex()][1], + CAM_WIN[UiConfig::GetInstance()->getScreenConfigIndex()][2], + CAM_WIN[UiConfig::GetInstance()->getScreenConfigIndex()][3]); +} + +void recoUiRecognizeTypeAd::slotCurrentChange(int index) +{ + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } +} + + +void recoUiRecognizeTypeAd::setBackstageUiinterface(BackstageInterfaceForUi *interface) +{ + m_backstageIf = interface; + m_widget_ad->setBackstageUiinterface(interface); + char buf[64] = {'\0'}; + m_backstageIf->getDeviceId(buf, sizeof(buf)); + QString devId{buf}; + memset(buf, 0, sizeof(buf)); + m_backstageIf->getAppVersion(buf, sizeof(buf)); + QString ver{buf}; + m_widget_msg->showDevInfo(devId, ver); + m_widget_msg->showRecoUiDevIdAndVer(m_backstageIf->getShowIdAndVerSw()); +} + +void recoUiRecognizeTypeAd::updateAdWidget() +{ + //m_widget_ad->slotUpdateScreenSaver(); + emit signalUpdateScreenSaver(); +} + +void recoUiRecognizeTypeAd::setDndMode(bool dndMode, const std::chrono::system_clock::time_point &endTime) { + if (m_wgtCardUnderScreen != nullptr) { + m_wgtCardUnderScreen->setVisible(!dndMode); + } + if (m_widget_reco != nullptr) { + m_widget_reco->setDndMode(dndMode, endTime); + } +} diff --git a/Linguist/recoUi/recoUiRecognizeTypeBase.h b/Linguist/recoUi/recoUiRecognizeTypeBase.h new file mode 100644 index 0000000..9769b9e --- /dev/null +++ b/Linguist/recoUi/recoUiRecognizeTypeBase.h @@ -0,0 +1,230 @@ +#ifndef RECOUIRECOGNIZETYPEBASE_H +#define RECOUIRECOGNIZETYPEBASE_H + +#include +#include "UiTools.h" +#include "recoUiRecognize.h" +#include "recoUiScreensaver.h" + +class RecoResultWidget : public QWidget +{ + Q_OBJECT + +public: + static const int FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + static const QString RECO_OK_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString RECO_FAIL_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString RECO_WARN_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString MASK_OK_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString MASK_NULL_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString TEMP_OK_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString TEMP_ABN_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + RecoResultWidget(QWidget *parent = nullptr); + + void showIdentityResult(GLOBAL_RECO_STATE state, const QString& msg = QString()); + void showMaskResult(bool hasMask, const QString& msg); + void showTempResult(const QString& msg, float temp, bool isNormal, bool isC); + + void reset(); +private: + QLabel* m_label_identity_icon; + QLabel* m_label_identity_word; + QLabel* m_label_mask_icon; + QLabel* m_label_mask_word; + QLabel* m_label_temp_icon; + QLabel* m_label_temp_word; +}; + +class DndModeCountDownItem; + +class RecoMsgWidget : public QWidget +{ + Q_OBJECT + +public: + static const int TIME_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int DATE_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + static const int MSG_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int PIC_WIDGET_H_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString PIC_WIDGET_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + static const QString IDLE_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString OK_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString FAIL_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString WARN_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + static const QString T1_IDLE_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString T1_OK_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString T1_FAIL_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString T1_WARN_BG_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + RecoMsgWidget(bool hasFacePic, bool enTimeType, int bgImgType, QWidget *parent = nullptr); + + void showFacePic(const QString& picPath); + void showFacePic(const unsigned char* jpgDate, int len); + void facePicReset(); + + void showIdentityResult(GLOBAL_RECO_STATE state, const QString& msg = QString()); + void showMaskResult(bool hasMask, const QString& msg); + void showTempResult(const QString& msg, float temp, bool isNormal, bool isC); + void setDndMode(bool dndMode, const std::chrono::system_clock::time_point &endTime); + + void reset(); + void switchBg(int type); + +protected: + +private: + const int m_bgImgType; + QWidget* m_widget_pic; + QStackedWidget* m_stackWgt_msg; + RecoResultWidget* m_widget_result; + TimeWidget* m_widget_time; + DndModeCountDownItem *m_dndItem = nullptr; +}; + + +class RecoTypeResultWidget : public QWidget +{ + Q_OBJECT + +public: + static const QString RESULT_OK_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString RESULT_FAIL_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString RESULT_WARN_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit RecoTypeResultWidget(QWidget *parent = nullptr); + + void showResult(int type); + +protected: + +private: +}; + +class recoUiRecognizeTypeBase : public PageAcceptMouseAndTouch +{ + Q_OBJECT +public: + static const int TOP_MSG_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int AD_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString TOP_MSG_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int SWIP_CARD_WIDGET_WIDTH[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const int SWIP_CARD_WIDGET_HEIGHT[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString SWIP_CARD_DAY_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString SWIP_CARD_NIGHT_MODE_WIDGET_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit recoUiRecognizeTypeBase(bool isNightMode, bool hasPwdBtn, bool hasCallBtn, int type, QWidget *parent = nullptr); + virtual ~recoUiRecognizeTypeBase(); + virtual int setCamVideoWind() = 0; + +signals: + void signalChangePage(); + void signalShowPwdPage(const QString& name); + void signalScreenTouch(); + void callDialButtonClicked(); // 呼叫设备按钮 + void callPlatformButtonClicked(const QString &name); // 呼叫管理处 + +public slots: + void slotsNoSuccessPage(int nPage); + void slotsSuccessPage(const int nPage, const QString& name); + void slotsDrawScanner(const int nPage, const bool faceAvailable); + //void handleRecoResShowTime(); + void slotsInteractionChange(const INTERACION_OPTION& interaction, int nSelectRes); + void slotShowNormalTemp(const float temp, const bool isC); + void slotShowAbnormalTemp(const float temp, const bool isHigh, const bool isC); + void slotUpdateLogo(const int); + void slotUpdatePlatformConnectionStatus(const int); + void slotsResetRecoUi(); + //void slotShowQRCodeMsg(const int); + //void slotChangeRecoUiMode(); + //void slotTimerQRCodeScanline(); + //void slotQRCodeSwitchToStandbyStatusFromOvertimeStatus(); + void slotUpdateRecoUiIpDisplay(const bool); + //void slotShowFeatureUpdateProgress(const unsigned current, const unsigned all); + //void slotCloseFeatureUpdateProgress(); + void slotShowRecoUiMask(int maskType); + void slotNotiMsg(const int nPage, const QString& msg, int color); + void slotLongPressShowSetting(); + void slotCenterMsg(const int nPage, const QString& msg); + void slotPwdBtnClicked(); + void slotSetUserPwdButton(bool visible); + //void slotShowOrHideFaceFrame(bool show); + void slotShowFinalResult(bool pass); + void slotShowCallBtn(bool show); + void slotShowRecoUiDevIdAndVer(bool show); + +protected: + RecoMsgWidget* m_widget_reco = nullptr; + recoUiScreensaver* m_widget_ad; + MsgWidget* m_widget_msg; + QVBoxLayout *m_vlay = nullptr; + QWidget* m_wgtCardUnderScreen = nullptr; + +private: + const int m_uiType; + QWidget* m_wgtBack; + QWidget* m_wgtBtnPwd; + + CenterMsgWidget* m_widget_cMsg; + RecoTypeResultWidget* m_widget_result; + //QWidget* m_wgtCallDial; + RoundedWidget* m_wgtCallDialDev; + RoundedWidget* m_wgtCallMngCenter; + + QString m_name; + + int m_clickCount; + QTime _preTime; + bool isTouched; + + QString recoUiTextCfg(RecoUiTextCfg::enTextType type); + bool eventFilter(QObject *watched, QEvent *event); + bool event(QEvent *event); + bool multiPressToSettingPage(); + bool longPressToSettingPage(); + void uiReset(); + void setMsgWidgetBg(int bgType); + void setCardReaderUnderScreenInstructions(bool isNightMode); +}; + + +class recoUiRecognizeTypeColor : public recoUiRecognizeTypeBase +{ + Q_OBJECT +public: + explicit recoUiRecognizeTypeColor(bool isNightMode, bool hasPwdBtn, bool hasCallBtn, QWidget *parent = nullptr); + int setCamVideoWind(); + void setBackstageUiinterface(BackstageInterfaceForUi *interface); + +signals: + +public slots: + void slotShowRecoUiColorFaceSnapshot(const QString& path); + void slotShowRecoUiColorFaceSnapshot(const unsigned char* jpgDate, int len); + +private: +}; + +class recoUiRecognizeTypeAd : public recoUiRecognizeTypeBase +{ + Q_OBJECT +public: + static const int CAM_WIN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][4]; + explicit recoUiRecognizeTypeAd(bool isNightMode, bool hasPwdBtn, bool hasCallBtn, QWidget *parent = nullptr); + int setCamVideoWind(); + void setBackstageUiinterface(BackstageInterfaceForUi *interface); + void updateAdWidget(); + void setDndMode(bool dndMode, const std::chrono::system_clock::time_point &endTime); +signals: + void signalUpdateScreenSaver(); + +public slots: + void slotCurrentChange(int index); +}; + + +#endif // RECOUIRECOGNIZETYPEBASE_H diff --git a/Linguist/recoUi/recoUiScreensaver.cpp b/Linguist/recoUi/recoUiScreensaver.cpp new file mode 100644 index 0000000..44f84d8 --- /dev/null +++ b/Linguist/recoUi/recoUiScreensaver.cpp @@ -0,0 +1,288 @@ +#include "recoUiScreensaver.h" +#include +#include +#include +#include "UiTools.h" + + +BgLoadThread::BgLoadThread(QObject* parent) : QObject (parent) +{ + qDebug() << "BgLoadThread"; +} + +BgLoadThread::~BgLoadThread() +{ + qDebug() << "~BgLoadThread"; +} + +void BgLoadThread::slotloadBGs(const QStringList& pics, const QSize& bgSize) +{ + //qDebug() << "BgLoadThread::slotloadBGs"; + for (int i=0; isetAlignment(Qt::AlignCenter); + m_label_background->resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + qDebug() << "screensaver:" << pic; + QPixmap bg(pic); + if(!bg.isNull()){ + m_label_background->setPixmap(ScalePixmap(bg, QSize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()))); + } + QVBoxLayout* layout = new QVBoxLayout(); + layout->addWidget(m_label_background, 100, Qt::AlignCenter); + layout->setMargin(0); + setLayout(layout); + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); +} + +Screensaver::Screensaver(const QPixmap& pic, QWidget *parent) : QWidget (parent) +{ + QLabel* m_label_background = new QLabel(this); + m_label_background->resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + m_label_background->setPixmap(pic); + m_label_background->setAlignment(Qt::AlignCenter); + QVBoxLayout* layout = new QVBoxLayout(); + layout->addWidget(m_label_background, 100, Qt::AlignCenter); + layout->setMargin(0); + setLayout(layout); + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); +} + + +const QString recoUiScreensaver::AD_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/reco_ad_large.png", +":/res/image/reco_ad_large.png", +":/res/image/reco_ad_large.png", +":/res/image/reco_ad_large.png", +":/res/image/reco_ad_large.png" +}; + +const QString recoUiScreensaver::SCREENSAVER[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][DEFAULT_SCREENSAVER_QUANTITY] = { +{":/res/image/screensaver-600-1024.jpg", ":/res/image/screensaver_720_1280_1.jpg", ":/res/image/screensaver_720_1280_2.jpg"}, +{":/res/image/screensaver-800-1280.jpg", ":/res/image/screensaver_800_1280_1.jpg", ":/res/image/screensaver_800_1280_2.jpg"}, +{":/res/image/screensaver-720-1280.jpg", ":/res/image/screensaver_720_1280_1.jpg", ":/res/image/screensaver_720_1280_2.jpg"}, +{":/res/image/screensaver-800-1280.jpg", ":/res/image/screensaver_800_1280_1.jpg", ":/res/image/screensaver_800_1280_2.jpg"}, +{":/res/image/screensaver-720-1280.jpg", ":/res/image/screensaver_720_1280_1.jpg", ":/res/image/screensaver_720_1280_2.jpg"} +}; + +recoUiScreensaver::recoUiScreensaver(int sourceType, QWidget *parent) + : WidgetWithBackstageInterface(parent), m_sourceType(sourceType) +{ + qDebug() << "recoUiScreensaver()"; + + //setAttribute(Qt::WA_AcceptTouchEvents); //touch + //installEventFilter(this); //mouse click + + /* + m_label_logo = new QLabel(this); + QPixmap pm(":/res/image/home_logo.png"); + //pm = pm.scaled(50, 50, Qt::KeepAspectRatio); + m_label_logo->setPixmap(pm); + + m_label_time = new QLabel(this); + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::white); + m_label_time->setPalette(palette); + QFont ft; + ft.setPointSize(30); + m_label_time->setFont(ft); + + QHBoxLayout* hbLayout = new QHBoxLayout(); + hbLayout->addWidget(m_label_logo, 1, Qt::AlignLeft | Qt::AlignTop); + hbLayout->addWidget(m_label_time, 1, Qt::AlignRight | Qt::AlignTop); + hbLayout->setMargin(40); + + setAutoFillBackground(true); + + //pm_logo.scaled(469, 700, Qt::IgnoreAspectRatio); + //pm_logo.scaledToHeight(350, Qt::FastTransformation); + palette.setBrush(QPalette::Background,QBrush(QPixmap(":/res/image/screensaver-600-1024.jpg"))); + setPalette(palette); + + setLayout(hbLayout); + */ + QLabel* blackBg = new QLabel(this); + blackBg->resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + blackBg->setStyleSheet("QLabel{background:#000000;}"); + + m_stack_scPage = new QStackedWidget(this); + + QGridLayout* layout = new QGridLayout(); + layout->addWidget(blackBg, 0, 0); + layout->addWidget(m_stack_scPage, 0, 0); + layout->setMargin(0); + setLayout(layout); + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimer())); + connect(m_stack_scPage, SIGNAL(currentChanged(int)), this, SIGNAL(signalCurrentChange(int))); +} + +recoUiScreensaver::~recoUiScreensaver() +{ + qDebug() << "~recoUiScreensaver()"; + if(m_thLoadBg){ + m_thLoadBg->quit(); + m_thLoadBg->wait(); + } +} + +bool recoUiScreensaver::eventFilter(QObject *watched, QEvent *event) +{ + if( watched == this){ + if(event->type() == QEvent::MouseButtonPress){ + qDebug() << "recoUiScreensaver mouse press"; + if(m_backstageIf){ + qDebug() << "recoUiScreensaver wakeUpFromScreenSaverOrScreenOff"; + m_backstageIf->wakeUpFromScreenSaverOrScreenOff(); + } + } + } + else{ + return QWidget::eventFilter(watched, event); + } + + return false; +} + +bool recoUiScreensaver::event(QEvent *event) +{ + switch( event->type() ) + { + case QEvent::TouchBegin: + { + qDebug() << "recoUiScreensaver touch begin"; + if(m_backstageIf){ + m_backstageIf->wakeUpFromScreenSaverOrScreenOff(); + } + event->accept(); + return true; + + } + case QEvent::TouchUpdate: + { + event->accept(); + return true; + } + case QEvent::TouchEnd: + { + qDebug() << "recoUiScreensaver touch end"; + event->accept(); + return true; + } + default: + break; + } + return QWidget::event(event); +} + +void recoUiScreensaver::setBackstageUiinterface(BackstageInterfaceForUi *interface) +{ + m_backstageIf = interface; + slotUpdateScreenSaver(); +} + +void recoUiScreensaver::slotUpdateScreenSaver() +{ + qDebug() << "slotUpdateScreenSaver:" << m_sourceType; + if(m_isLoading){ + qDebug() << "bg is loading..."; + return; + } + stScreensaverCfg cfg; + if(0 == (0 == m_sourceType ? m_backstageIf->getScreenSaverConfig(cfg) : m_backstageIf->getRecoUiAdConfig(cfg))){ + m_iTimerInterval = cfg.interval * 1000; + m_timer->start(m_iTimerInterval); + qDebug() << "getScreenSaverConfig successed, time interval:" << m_iTimerInterval; + m_ilastBgQty = m_stack_scPage->count(); + qDebug() << "m_ilastBgQty:" << m_ilastBgQty; + qDebug() << "type:" << cfg.type << " qty:" << cfg.picQty; + QStringList pics; + QString picsCmp; + if(0 == cfg.type){ + //m_stack_scPage->addWidget(new Screensaver(UiConfig::GetInstance()->getScreenSaver(), this)); + if(0 == m_sourceType){ + picsCmp = SCREENSAVER[UiConfig::GetInstance()->getScreenConfigIndex()][UiConfig::GetInstance()->defaultScreensaver()]; + } + else{ + picsCmp = AD_IMG[UiConfig::GetInstance()->getScreenConfigIndex()]; + } + pics << picsCmp; + } + else if(1 == cfg.type){ + for (int i=0; igetUiWidth(), UiConfig::GetInstance()->getUiHeight())); + } +} + +void recoUiScreensaver::slotTimer() +{ + //qDebug() << "slotTimer"; + m_stack_scPage->setCurrentIndex(m_stack_scPage->currentIndex() < m_stack_scPage->count() - 1 ? m_stack_scPage->currentIndex() + 1 : 0); +} + +void recoUiScreensaver::slotOneBGReady(const QPixmap& pic) +{ + //qDebug() << "recoUiScreensaver::slotOneBGReady"; + m_stack_scPage->addWidget(new Screensaver(pic, this)); +} + +void recoUiScreensaver::slotAllBGDone() +{ + //qDebug() << "recoUiScreensaver::slotAllBGDone"; + if(m_ilastBgQty){ + for(int i=0; iwidget(0); + m_stack_scPage->removeWidget(widget); + widget->deleteLater(); + qDebug() << "delete bg:" << i; + } + } + if(m_stack_scPage->count() > 1){ + m_timer->start(m_iTimerInterval); + } + else { + m_timer->stop(); + } + m_isLoading = false; +} + +void recoUiScreensaver::startThread() +{ + if(m_thLoadBg){ + return; + } + m_thLoadBg= new QThread(); + m_oLoadBg = new BgLoadThread(); + m_oLoadBg->moveToThread(m_thLoadBg); + connect(m_thLoadBg,&QThread::finished,m_thLoadBg,&QObject::deleteLater); + connect(m_thLoadBg,&QThread::finished,m_oLoadBg,&QObject::deleteLater); + + connect(this,&recoUiScreensaver::signalLoadBGs,m_oLoadBg,&BgLoadThread::slotloadBGs); + connect(m_oLoadBg, SIGNAL(signalOneBGReady(const QPixmap&)), this, SLOT(slotOneBGReady(const QPixmap&))); + connect(m_oLoadBg, SIGNAL(signalAllBGDone()), this, SLOT(slotAllBGDone())); + m_thLoadBg->start(); +} + diff --git a/Linguist/recoUi/recoUiScreensaver.h b/Linguist/recoUi/recoUiScreensaver.h new file mode 100644 index 0000000..040ad55 --- /dev/null +++ b/Linguist/recoUi/recoUiScreensaver.h @@ -0,0 +1,77 @@ +#ifndef RECOUISCREENSAVER_H +#define RECOUISCREENSAVER_H + +#include +#include +#include "UiConfig.h" +#include "UiTools.h" +#include "QThread" + +class BgLoadThread : public QObject +{ + Q_OBJECT +public: + BgLoadThread(QObject* parent = nullptr); + ~BgLoadThread(); +public slots: + void slotloadBGs(const QStringList& pics, const QSize& bgSize); + + signals: + void signalOneBGReady(const QPixmap&); + void signalAllBGDone(); + +}; + +class Screensaver : public QWidget +{ + Q_OBJECT +public: + explicit Screensaver(const QString& pic, QWidget *parent = nullptr); + explicit Screensaver(const QPixmap& pic, QWidget *parent = nullptr); +}; + +class recoUiScreensaver : public WidgetWithBackstageInterface +{ + Q_OBJECT +public: + static const int DEFAULT_SCREENSAVER_QUANTITY = 3; + static const QString SCREENSAVER[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][DEFAULT_SCREENSAVER_QUANTITY]; + static const QString AD_IMG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + + explicit recoUiScreensaver(int sourceType, QWidget *parent = nullptr); + ~recoUiScreensaver(); + + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + +public slots: + void slotUpdateScreenSaver(); + void slotTimer(); + + void slotOneBGReady(const QPixmap&); + void slotAllBGDone(); + +private: + //QLabel* m_label_background; + //QLabel* m_label_logo; + //QLabel* m_label_time; + QStackedWidget* m_stack_scPage; + QTimer* m_timer; + int m_iTimerInterval; + + int m_ilastBgQty; + BgLoadThread* m_oLoadBg = nullptr; + QThread* m_thLoadBg = nullptr; + QString m_lastPics = "default"; + const int m_sourceType; + bool m_isLoading = false; + void startThread(); + + bool eventFilter(QObject *watched, QEvent *event); + bool event(QEvent *event); + +signals: + void signalLoadBGs(const QStringList&, const QSize& bgSize); + void signalCurrentChange(int index); +}; + +#endif // RECOUISCREENSAVER_H diff --git a/Linguist/recoUi/recoUiUnauthorized.cpp b/Linguist/recoUi/recoUiUnauthorized.cpp new file mode 100644 index 0000000..f1608a5 --- /dev/null +++ b/Linguist/recoUi/recoUiUnauthorized.cpp @@ -0,0 +1,209 @@ +#include "recoUiUnauthorized.h" +#include +#include +#include +#include +#include +#include + +recoUiUnauthorized::recoUiUnauthorized(QWidget *parent) : QWidget(parent) +{ + qDebug() << "recoUiUnauthorized()"; + + //title part + titleShow(LOGO_TIME); + + _label_Bottom = new QLabel(); + _label_Bottom->setObjectName("label_bottom"); + _label_Bottom->setStyleSheet("#label_bottom{background-color: #181f33;}"); + + QFont ft; + QPalette pa; + + m_label_msgUnahd = new QLabel(); + m_label_msgUnahd->setText(tr("软件未授权")); + ft.setPointSize(72); + m_label_msgUnahd->setFont(ft); + m_label_msgUnahd->setObjectName("label_tip"); + m_label_msgUnahd->setStyleSheet("#label_tip{color:#FF9c00;}"); +// pa.setColor(QPalette::WindowText,Qt::yellow); + m_label_msgUnahd->setPalette(pa); + + m_label_msg = new QLabel(); + m_label_msg->setText(tr("请联系平台管理员")); + ft.setPointSize(25); + m_label_msg->setFont(ft); + pa.setColor(QPalette::WindowText,Qt::white); + m_label_msg->setPalette(pa); + + m_btn_reCheck = new QPushButton(); + m_btn_reCheck->setText(tr("重新检测授权状态")); + m_btn_reCheck->setObjectName("pushButton_reCheck"); + m_btn_reCheck->setStyleSheet("#pushButton_reCheck{color:#FFFFFF; background-color:#949eba;}");//font-size:25px; + m_btn_reCheck->setMinimumHeight(30); + m_btn_sysSet = new QPushButton(); + m_btn_sysSet->setText(tr("进入系统设置")); + m_btn_sysSet->setObjectName("pushButton_sysSet"); + m_btn_sysSet->setStyleSheet("#pushButton_sysSet{color:#FFFFFF; background-color:#949eba;}");//font-size:25px; + m_btn_sysSet->setMinimumHeight(30); + + QHBoxLayout* hbLayout_btn = new QHBoxLayout(); + hbLayout_btn->addWidget(m_btn_reCheck/*, 1, Qt::AlignBaseline | Qt::AlignTop */); + hbLayout_btn->addSpacing(10); + hbLayout_btn->addWidget(m_btn_sysSet/*, 1, Qt::AlignBaseline | Qt::AlignTop */); + hbLayout_btn->setMargin(34); + + QVBoxLayout* vbLayout_msg = new QVBoxLayout(); + vbLayout_msg->addSpacing(72); + vbLayout_msg->addWidget(m_label_msgUnahd, 3, /*Qt::AlignBottom |*/ Qt::AlignCenter); + vbLayout_msg->addWidget(m_label_msg, 1, /*Qt::AlignBottom | */Qt::AlignCenter); + vbLayout_msg->addLayout(hbLayout_btn, 3); + vbLayout_msg->addSpacing(16); + _label_Bottom->setLayout(vbLayout_msg); + + QHBoxLayout *pHLayoutLabel = new QHBoxLayout(); + pHLayoutLabel->addWidget(_label_Bottom); + pHLayoutLabel->setMargin(0); + + QLabel *pLabelEmpty = new QLabel(); + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addLayout(_HLayoutTitle, 1); + vbLayout->addWidget(pLabelEmpty, 6); + vbLayout->addLayout(pHLayoutLabel, 3); + vbLayout->setMargin(0); +// vbLayout->addLayout(vbLayout_msg, 6); +// vbLayout->addLayout(hbLayout_btn, 4); +// vbLayout->setSpacing(80); + setLayout(vbLayout); + + //floor two + _widgetMainReco = new QWidget(this); + _widgetMainReco->setMinimumSize(476, 800); + m_label_iconUnahd = new QLabel(); + m_label_iconUnahd->setObjectName("label_iconUnahd"); + m_label_iconUnahd->setStyleSheet("#label_iconUnahd{min-width: 112px;min-height:112px;max-width: 112px;max-height: 112px;border-radius: 56px;\ + border-width: 0 0 0 0;background-color:#FF9c00;}"); + + QPixmap pm(":/res/image/unauthorized.png"); + QPixmap fitpixmap_faceIcon=pm.scaled(68, 68, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + fitpixmap_faceIcon = PixmapToRound(fitpixmap_faceIcon,34); + + m_label_iconUnahd->setPixmap(fitpixmap_faceIcon); + m_label_iconUnahd->setAlignment(Qt::AlignCenter); + + QLabel *pLabelTop = new QLabel(); + QLabel *pLabelBottom = new QLabel(); + + QVBoxLayout* pVLayoutIcon = new QVBoxLayout(); + pVLayoutIcon->addWidget(pLabelTop, 5); + pVLayoutIcon->addWidget(m_label_iconUnahd, 1, Qt::AlignHCenter); + pVLayoutIcon->addWidget(pLabelBottom, 2); + _widgetMainReco->setLayout(pVLayoutIcon); +} + +recoUiUnauthorized::~recoUiUnauthorized() +{ + qDebug() << "~recoUiUnauthorized()"; +} + +void recoUiUnauthorized::titleShow(recoUiUnauthorized::TITLE_LAYOUT titleIndex) +{ + if(titleIndex > LOGO_TIME) + { + return; + } + + //show logo + if( titleIndex == LOGO_MID ) + { + + } + else if(titleIndex == TIME_MID) //show time + { + + } + else + {/*show logo and time*/ +// _WidgetTitle = new QWidget(_widgetMainReco); + showRWLogo(":/res/image/ProjectSet_Intenet.png", NULL); + showTime(); + + _HLayoutTitle = new QHBoxLayout(); + _HLayoutTitle->addWidget(_labelRWIcon, 1,Qt::AlignCenter); + _HLayoutTitle->addWidget(_labelRWLogo, 10, Qt::AlignLeft); + _HLayoutTitle->addWidget(_labelTime, 1, Qt::AlignCenter); + } +} + +void recoUiUnauthorized::showRWLogo(QString icon, QString rw) +{ + //ICON + QPixmap pm(icon); + pm = pm.scaled(40, 40, Qt::KeepAspectRatio); + + _labelRWIcon = new QLabel(); + _labelRWIcon->setPixmap(pm); + _labelRWIcon->setObjectName("label_icon"); + + //LOGO + _labelRWLogo = new QLabel(); + _labelRWLogo->setObjectName("label_logo"); + _labelRWLogo->setText(tr("瑞为技术\nRECONOVA")); + _labelRWLogo->setStyleSheet("#label_logo{color:#FFFFFF;}"); +} + +void recoUiUnauthorized::showTime() +{ + QTime time = QTime::currentTime(); + QString timeStr = time.toString("hh:mm"); + _labelTime = new QLabel(); + _labelTime->setObjectName("label_time"); + _labelTime->setText(timeStr); + _labelTime->setStyleSheet("#label_time{color:#FFFFFF;font-size:30px}"); +} + +void recoUiUnauthorized::showRecoInfo(QString name, QString id, QString part) +{ + QLabel *pLabelName = new QLabel(_widgetReco); + QLabel *pLabelId = new QLabel(_widgetReco); + QLabel *pLabelPart = new QLabel(_widgetReco); + + pLabelName->setObjectName("label_name"); + pLabelId->setObjectName("label_id"); + pLabelPart->setObjectName("label_part"); + + pLabelName->setStyleSheet("#label_name{font-size:72px; color:#0ebcf8;}"); + pLabelId->setStyleSheet("#label_id{font-size:25px; color:#FFFFFF;}"); + pLabelPart->setStyleSheet("#label_part{font-size:25px; color:#FFFFFF;}"); + + pLabelName->setText(tr(name.toUtf8())); + pLabelId->setText(tr(id.toUtf8())); + pLabelPart->setText(tr(part.toUtf8())); + + QVBoxLayout *pVLayoutInfo = new QVBoxLayout(_widgetReco); + pVLayoutInfo->addWidget(pLabelName, 1, Qt::AlignCenter); + pVLayoutInfo->addWidget(pLabelId, 1, Qt::AlignCenter); + pVLayoutInfo->addWidget(pLabelPart, 1, Qt::AlignCenter); + pVLayoutInfo->setMargin(nSpace); +} + +QPixmap recoUiUnauthorized::PixmapToRound(QPixmap &src, int radius) +{ + if (src.isNull()) { + return QPixmap(); + } + + QSize size(2*radius, 2*radius); + QBitmap mask(size); + QPainter painter(&mask); + painter.setRenderHint(QPainter::Antialiasing); + painter.setRenderHint(QPainter::SmoothPixmapTransform); + painter.fillRect(0, 0, size.width(), size.height(), Qt::white); + painter.setBrush(QColor(0, 0, 0)); + painter.drawRoundedRect(0, 0, size.width(), size.height(), 99, 99); + + QPixmap image = src.scaled(size); + image.setMask(mask); + return image; +} diff --git a/Linguist/recoUi/recoUiUnauthorized.h b/Linguist/recoUi/recoUiUnauthorized.h new file mode 100644 index 0000000..ca1ebf9 --- /dev/null +++ b/Linguist/recoUi/recoUiUnauthorized.h @@ -0,0 +1,59 @@ +#ifndef RECOUIUNAUTHORIZED_H +#define RECOUIUNAUTHORIZED_H + +#include +#include +#include +#include + +class recoUiUnauthorized : public QWidget +{ + Q_OBJECT +public: + static constexpr int screenWidth = 600; + static constexpr int itemHeight = 41; + static constexpr int nSpace = 14; + +enum TITLE_LAYOUT{ + LOGO_MID = 0, + TIME_MID, + LOGO_TIME, + MAX +}; + +public: + explicit recoUiUnauthorized(QWidget *parent = 0); + ~recoUiUnauthorized(); + + void titleShow(TITLE_LAYOUT titleIndex); + +signals: + +public slots: + +private: + void showRWLogo(QString icon, QString rw); + void showTime(); + void showRecoInfo(QString name, QString id, QString part); + QPixmap PixmapToRound(QPixmap &src, int radius); + +private: + QLabel* _label_Bottom; + QLabel* m_label_iconUnahd; + QLabel* m_label_msgUnahd; + QLabel* m_label_msg; + QPushButton* m_btn_reCheck; + QPushButton* m_btn_sysSet; + + QWidget* _widgetMainReco; + QLabel* _labelRWIcon; + QLabel* _labelRWLogo; + QLabel* _labelTime; + QWidget* _widgetReco; + QLabel* _labelRecoRes; + QWidget* _WidgetTitle; + + QHBoxLayout* _HLayoutTitle; +}; + +#endif // RECOUIUNAUTHORIZED_H diff --git a/Linguist/setUi/settingUIProjectSet.cpp b/Linguist/setUi/settingUIProjectSet.cpp new file mode 100644 index 0000000..14f3285 --- /dev/null +++ b/Linguist/setUi/settingUIProjectSet.cpp @@ -0,0 +1,66 @@ +#include +#include +#include + +#include "settingUIProjectSet.h" +#include "settingUi.h" + +const int settingUIProjectSet::BtnQty = settingUi::PAGE_DEV_TEST - settingUi::PAGE_INFO; +const int settingUIProjectSet::FristPageIndex = settingUi::PAGE_INFO; + +settingUIProjectSet::settingUIProjectSet(QWidget *parent) : MyWidgetWithSubStyleColor(parent) +{ + qDebug() << "settingUIProjectSet()"; + //setStyleSheet(" background:rgb(240, 242, 245);");//border-width:0;border-style:outset; + //setFixedWidth(UiConfig::GetInstance()->getUiWidth()); + + const int btnWidth = ( UiConfig::GetInstance()->getUiWidth() - 4 * nSpace ) / 3; + const QSize btnSize(btnWidth, btnWidth); + const QString btnsName[BtnQty] = {":/res/image/ProjectSetCheckInfo.png", + ":/res/image/ProjectSetDevMng.png", + ":/res/image/ProjectSetFaceMng.png", + ":/res/image/ProjectSetAccMng.png", + ":/res/image/ProjectSetReco.png", + ":/res/image/ProjectSetSysMng.png", + ":/res/image/ProjectSetFastCfg.png", + ":/res/image/ProjectSetNetwork.png" + }; + QGridLayout* pLayout = new QGridLayout(); + m_pPushBtns = new QPushButton[BtnQty]; + int col = 0; + + for(int i = 0; i < BtnQty; i ++){ + m_pPushBtns[i].setParent(this); + settingUi* setUi = dynamic_cast(parent); + if(setUi){ + setPushButton(&m_pPushBtns[i], (*setUi)[static_cast(FristPageIndex + i)], btnsName[i], btnSize); + pLayout->addWidget(&m_pPushBtns[i], i / 3, col++); + if(3 == col){ + col = 0; + } + connect(&m_pPushBtns[i], SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + } + else { + qDebug() << "oooop!"; + } + } + pLayout->setSpacing(nSpace); + pLayout->setMargin(0); + + QLabel *pEmpty = new QLabel(this); + QVBoxLayout* _VLayout = new QVBoxLayout(); + _VLayout->addLayout(pLayout,3); + _VLayout->addWidget(pEmpty, 1); + _VLayout->setMargin(nSpace); + setLayout(_VLayout); +} + +void settingUIProjectSet::slotBtnClicked() +{ + for(int i = 0; i <= BtnQty; i ++){ + if(sender() == &m_pPushBtns[i]){ + emit pageSetSignal(i + FristPageIndex); + break; + } + } +} diff --git a/Linguist/setUi/settingUIProjectSet.h b/Linguist/setUi/settingUIProjectSet.h new file mode 100644 index 0000000..346dcf1 --- /dev/null +++ b/Linguist/setUi/settingUIProjectSet.h @@ -0,0 +1,31 @@ +#ifndef SETTINGUIPROJECTSET_H +#define SETTINGUIPROJECTSET_H + +#include + +#include "UiTools.h" +#include "UiConfig.h" + +class settingUIProjectSet : public MyWidgetWithSubStyleColor +{ + Q_OBJECT +public: + static constexpr int itemHeight = UiConfig::SETTING_PAGE_ITEM_HEIGHT; + static constexpr int nSpace = UiConfig::SETTING_PAGE_WIDGET_TO_FRAME; + +public: + explicit settingUIProjectSet(QWidget *parent = nullptr); + +signals: + void pageSetSignal(int nIndex, const QString = ""); + +public slots: + void slotBtnClicked(); + +private: + static const int BtnQty; + static const int FristPageIndex; + QPushButton *m_pPushBtns; +}; + +#endif // SETTINGUIPROJECTSET_H diff --git a/Linguist/setUi/settingUi.cpp b/Linguist/setUi/settingUi.cpp new file mode 100644 index 0000000..6fe6874 --- /dev/null +++ b/Linguist/setUi/settingUi.cpp @@ -0,0 +1,577 @@ +#include "settingUi.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include "UiTools.h" +#include "UiConfig.h" +#include "keyboard.h" + +settingUiTop::settingUiTop(QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + qDebug() << "settingUiTop()"; + + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::black); + + m_label_ip = new QLabel(this); + //m_label_ip->setText("IP:192.168.10.106"); + //m_label_ip->setMinimumSize(60, 30); + m_label_ip->setPalette(palette); + //IP项去掉,需求不要求 + m_label_ip->hide(); + + m_label_time = new QLabel(this); +// m_label_time->setText("10:12"); + m_label_time->setPalette(palette); + _timerUpdate = new TimerUpdate(m_label_time, this); + + m_btn_back = new QPushButton(this); + setButtonBackImage(m_btn_back, ":res/image/ProjectSet_return.png", 20, 40); + m_btn_back->setFixedWidth(UiConfig::GetInstance()->getUiWidth() / 10); + //m_btn_back->setStyleSheet("QPushButton:focus{outline: none;}"); + m_btn_back->setFocusPolicy(Qt::NoFocus); + + m_label_pageMsg = new QLabel(this); + m_label_pageMsg->setText("this is page title"); + m_label_pageMsg->setPalette(palette); + m_label_pageMsg->setAlignment(Qt::AlignCenter); + m_label_pageMsg->setMinimumWidth(UiConfig::GetInstance()->getUiWidth() / 3); + QFont ft; + ft.setPointSize(UiConfig::GetInstance()->getGlobalFontSize()); + m_label_pageMsg->setFont(ft); + + m_btn_rightSide = new QPushButton(this); + m_btn_rightSide->setFocusPolicy(Qt::NoFocus); + m_btn_rightSide->setStyleSheet("color:blue;" + "background-color: transparent;" + "border:none;"); + m_btn_rightSide->hide(); + + QHBoxLayout* hbLayout_top = new QHBoxLayout(); + hbLayout_top->addWidget(m_label_ip, 1, Qt::AlignLeft); + hbLayout_top->addWidget(m_label_time, 1, Qt::AlignRight); + + QHBoxLayout* hbLayoutMid = new QHBoxLayout(); + hbLayoutMid->addWidget(m_btn_back, 1, Qt::AlignLeft); + //hbLayoutMid->addWidget(m_label_pageMsg, 100, Qt::AlignCenter); + hbLayoutMid->addWidget(m_btn_rightSide, 1, Qt::AlignRight); + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addLayout(hbLayout_top); + vbLayout->addLayout(hbLayoutMid); + vbLayout->setContentsMargins(20, 10, 0, 10); + setLayout(vbLayout); + + //setStyleSheet("border-bottom: 3px solid #DFDDEB;"); + connect(m_btn_back, SIGNAL(clicked(bool)), this, SIGNAL(signalReturnBtnClicked())); + connect(m_btn_rightSide, SIGNAL(clicked(bool)), this, SIGNAL(signalRightSideBtnClicked())); +} + +settingUiTop::~settingUiTop() +{ + qDebug() << "~settingUiTop()"; + if(nullptr != _timerUpdate){ + delete _timerUpdate; + } +} + +void settingUiTop::update_Ip(const QString& str) +{ + if(m_label_ip){ + m_label_ip->setText(str); + } +} + +void settingUiTop::setRightSideBtn(bool isShow, const QString btnName) +{ + m_btn_rightSide->setText(btnName); + m_btn_rightSide->setVisible(isShow); +} + +void settingUiTop::slotShowPageMsg(const QString& msg) +{ + //qDebug() << "slotShowPageMsg:" << msg; + m_label_pageMsg->setText(msg); + m_label_pageMsg->move((UiConfig::GetInstance()->getUiWidth() - m_label_pageMsg->width()) / 2, + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.05)); +} + +void settingUi::showPage(int nIndex, const QString& title) +{ + qDebug() << "showPage:" << nIndex; + if( (PAGE_PROJECT > nIndex ) || ( nIndex >= PAGE_MAX ) ) + { + qDebug()<<"page index error : " << nIndex; + return; + } + if(m_stack_setPage->currentIndex() == nIndex){ + qDebug() << "same setting page!"; + return; + } + + //控制条右侧按钮存在与否 + if(m_map_rightBtnName.contains(nIndex)) + { + m_ctlBar->setRightSideBtn(true, m_map_rightBtnName[nIndex]); + }else + { + m_ctlBar->setRightSideBtn(false); + } + + bool needReset = nIndex > m_stack_setPage->currentIndex(); + if(nIndex == PAGE_DEV_MNG || nIndex == PAGE_DEV_MNG_BT_SPK || nIndex == PAGE_DEV_MNG_BT_LOCK || nIndex == PAGE_FACE_MNG) + {//设备管理页面和蓝牙页面,回退时也reset + needReset = true; + } + //qDebug() << "needReset:" << needReset << "nIndex:" << nIndex; + + m_stack_setPage->setCurrentIndex(nIndex); + QCoreApplication::processEvents(); + m_onIndexPage = (PAGE_PROJECT == nIndex); + emit signalShowPageMsg(title); + if(needReset){ + switch(nIndex){ + case PAGE_INFO: + m_infoPage->reset(); + break; + case PAGE_DEV_MNG: + m_devMngPage->reset(); + break; + case PAGE_FACE_MNG: + m_faceMngPage->reset(); + break; + case PAGE_ACCESS_MNG: + m_accMngPage->reset(); + break; + case PAGE_RECO: + m_recoSetPage->reset(); + break; + case PAGE_SYS_MNG: + m_sysMngPage->reset(); + break; + case PAGE_FAST_CFG_WIRE_NET: + m_fastCfgWireNet->reset(); + break; + case PAGE_DEV_TEST: + m_devTestPage->reset(); + break; + case PAGE_DEV_MNG_TIME: + m_devMngTimePage->reset(); + break; + case PAGE_DEV_MNG_NETWORK: + m_devMngNetworkPage->reset(); + break; + case PAGE_DEV_MNG_NET_WIRE: + m_devMngNetWirePage->reset(); + break; + case PAGE_DEV_MNG_NET_WIFI: + m_devMngNetWifiPage->reset(); + break; + case PAGE_DEV_MNG_NET_WIFI_ACC_POINT: + m_devMngNetWifiAccPointPage->reset(); + break; + case PAGE_DEV_MNG_NET_4G: + m_devMngNet4GPage->reset(); + break; + case PAGE_DEV_MNG_BT: + m_devMngBtPage->reset(); + break; + case PAGE_DEV_MNG_BT_SPK: + m_devMngBtSpkPage->reset(); + break; + case PAGE_DEV_MNG_BT_SPK_ACC_POINT: + m_devMngBtSpkAccPointPage->reset(); + break; + case PAGE_DEV_MNG_BT_LOCK: + m_devMngBtLockPage->reset(); + break; + case PAGE_DEV_MNG_BT_LOCK_ACC_POINT: + m_devMngBtLockAccPointPage->reset(); + break; + case PAGE_FACE_MNG_FACE: + m_faceMngFacePage->reset(); + break; + case PAGE_FACE_MNG_ACCESS_RECORD: + m_faceMngAccRedPage->reset(); + break; + case PAGE_FACE_MNG_ADD_PERSON: + m_addPersonPage->reset(); + break; + case PAGE_FACE_MNG_MODIFY_PERSON: + m_modifyPersonPage->reset(); + break; + case PAGE_FACE_MNG_SNAP_FACE: + m_snapFacePage->reset(); + break; + case PAGE_FAST_CFG_PARK: + m_fastCfgPark->reset(); + case PAGE_FAST_CFG_QRCODE: + m_fastCfgQrcode->reset(); + break; + default: + break; + } + } + qDebug() << "showPage end"; +} + +void settingUi::slotShowPage(int nIndex, const QString title) +{ + //qDebug() << "push index:" << m_stack_setPage->currentIndex() << "nIndex:" << nIndex; + m_pageIndex.push(m_stack_setPage->currentIndex()); + showPage(nIndex, "" != title ? title : SetPageName[nIndex]); + + keyboard::close(); +} + +void settingUi::slotReturnClicked() +{ + if(m_syncFlag){ + qDebug() << "slotReturnClicked return immediately"; + return; + } + m_syncFlag = true; + + if(m_stack_setPage->currentIndex() == PAGE_FACE_MNG_ADD_PERSON || + m_stack_setPage->currentIndex() == PAGE_FACE_MNG_MODIFY_PERSON){ + m_backstageIf->stopIdentyState(false, true); + } + else if(m_stack_setPage->currentIndex() == PAGE_FAST_CFG_QRCODE){ + UiConfig::GetInstance()->setFastCfgStatus(false); + } + + if(m_onIndexPage){ + emit signalShowRecoPage(); + } + else if(m_stack_setPage->currentIndex() == PAGE_DEV_TEST){ + m_stack_setPage->setCurrentIndex(PAGE_PROJECT); + emit signalShowRecoPage(); + UiConfig::GetInstance()->setDevTestStatus(false); + } + else{ + if(m_pageIndex.size()){ + int pageIndex = m_pageIndex.pop(); + //qDebug() << "pop index:" << pageIndex; + showPage(pageIndex, SetPageName[pageIndex]); + } + } + keyboard::close(); + m_syncFlag = false; +} + +void settingUi::slotRightSideBtnClicked() +{ + int index = m_stack_setPage->currentIndex(); + qDebug() << __PRETTY_FUNCTION__ << "currentIndex=" << index; + switch (index) { + case PAGE_FACE_MNG_FACE: + m_faceMngFacePage->clickBtn_addPerson(); + break; + case PAGE_FACE_MNG_MODIFY_PERSON: + m_modifyPersonPage->savePersonInfo(); + break; + default: + break; + } +} + +settingUi::settingUi(QWidget *parent) : WidgetWithBackstageInterface(parent), m_syncFlag(false) +{ + qDebug() << "settingUi()"; + QPalette pal = palette(); + pal.setColor(QPalette::Background, Qt::transparent); + setPalette(pal); + + m_ctlBar = new settingUiTop(this); + m_stack_setPage = new QStackedWidget(this); + + m_pProjectSetPage = new settingUIProjectSet(this); + int pageIndex = 1; + m_infoPage = new settingUiInfo(pageIndex++, this); + m_devMngPage = new settingUiDevMng(pageIndex++, this); + m_faceMngPage = new settingUiFaceMng(pageIndex++, this); + m_accMngPage = new settingUiAccMng(pageIndex++, this); + m_recoSetPage = new settingUiRecoSet(pageIndex++, this); + m_sysMngPage = new settingUiSysMng(pageIndex++, this); + m_fastCfgWireNet = new settingUiFastCfgWireNet(pageIndex++, this); + connect(m_fastCfgWireNet, SIGNAL(signalJumpPage(int)), this, SLOT(slotJumpPage(int))); + + m_devMngNetworkPage = new settingUiDevMngNetwork(pageIndex++, m_devMngPage); + connect(m_devMngNetworkPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + m_devTestPage = new settingUiDevTest(pageIndex++, this); + + //subPage + m_devMngTimePage = new settingUiDevMngTime(pageIndex++, m_devMngPage); + connect(m_devMngPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + + m_devMngNetWirePage = new settingUiDevMngNetWire(pageIndex++, m_devMngNetworkPage); + m_devMngNetWifiPage = new settingUiDevMngNetWifi(pageIndex++, m_devMngNetworkPage); + m_devMngNetWifiAccPointPage = new settingUiDevMngNetWifiAccPoint(pageIndex++, m_devMngNetWifiPage); + connect(m_devMngNetWifiPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + connect(m_devMngNetWifiAccPointPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + connect(m_devMngNetWifiAccPointPage, SIGNAL(signalReturn()), this, SLOT(slotReturnClicked())); + connect(m_devMngNetWifiAccPointPage, SIGNAL(signalUpdateConnectionStatus(QString, bool)), m_devMngNetWifiPage, + SLOT(slotUpdateConnectionStatus(QString, bool))); + + m_devMngNet4GPage = new settingUiDevMngNet4G(pageIndex++, m_devMngNetworkPage); + + m_devMngBtPage = new settingUiDevMngBt(pageIndex++, m_devMngPage); + connect(m_devMngBtPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + + m_devMngBtSpkPage = new settingUiDevMngBtSpk(pageIndex++, m_devMngPage); + m_devMngBtSpkAccPointPage = new settingUiDevMngBtSpkAccPoint(pageIndex++, m_devMngBtSpkPage); + connect(m_devMngBtSpkPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + connect(m_devMngBtSpkPage, SIGNAL(signalClickSet(BluetoothDev_t)), m_devMngBtSpkAccPointPage, SLOT(setAccPointInfo(BluetoothDev_t))); + connect(m_devMngBtSpkAccPointPage, SIGNAL(signalReturn()), this, SLOT(slotReturnClicked())); + + m_devMngBtLockPage = new settingUiDevMngBtLock(pageIndex++, m_devMngPage); + connect(m_devMngBtLockPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + m_devMngBtLockAccPointPage = new settingUiDevMngBtLockAccPoint(pageIndex++, m_devMngBtLockPage); + connect(m_devMngBtLockPage, SIGNAL(signalCurrentLock(const QString&)), m_devMngBtLockAccPointPage, SLOT(slotCurrentLock(const QString&))); + connect(m_devMngBtLockAccPointPage, SIGNAL(signalUpdataTitle(const QString)), m_ctlBar, SLOT(slotShowPageMsg(const QString))); + connect(m_devMngBtLockAccPointPage, SIGNAL(signalRefresh()), m_devMngBtLockPage, SLOT(slotRefresh())); + connect(m_devMngBtLockAccPointPage, SIGNAL(signalRefresh()), this, SLOT(slotReturnClicked())); + + m_map_rightBtnName[pageIndex] = QString(tr("添加人员")); + m_faceMngFacePage = new FaceDbPage(pageIndex++, m_faceMngPage); + m_faceMngAccRedPage = new AccessRecordPage(pageIndex++, m_faceMngPage); + connect(m_faceMngPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + connect(m_faceMngFacePage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + connect(m_devTestPage, SIGNAL(signalShowSettingUi()), parent, SLOT(slotShowSettingUi())); + + m_addPersonPage = new AddPersonPage(pageIndex++, m_faceMngFacePage); + m_map_rightBtnName[pageIndex] = QString(tr("保存")); + m_modifyPersonPage = new ModifyPersonPage(pageIndex++, m_faceMngFacePage); + m_snapFacePage = new SnapFacePage(pageIndex++, m_faceMngFacePage); + connect(m_addPersonPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + connect(m_modifyPersonPage, SIGNAL(signalShowPage(int, const QString)), this, SLOT(slotShowPage(int, const QString))); + connect(m_faceMngFacePage, SIGNAL(signalPersonInfo(stQueryPersonInfo &)), m_modifyPersonPage, SLOT(slotSetPersonInfo(stQueryPersonInfo &))); + connect(m_addPersonPage, SIGNAL(signalChangePersonDB()), m_faceMngFacePage, SLOT(slot_freshPage())); + connect(m_modifyPersonPage, SIGNAL(signalChangePersonDB()), m_faceMngFacePage, SLOT(slot_freshPage())); + connect(m_addPersonPage, SIGNAL(signalReturn()), this, SLOT(slotReturnClicked())); + connect(m_modifyPersonPage, SIGNAL(signalReturn()), this, SLOT(slotReturnClicked())); + connect(parent, SIGNAL(signalIcCardResult(const QString&)), m_addPersonPage, SLOT(slotIcCardResult(const QString&))); + connect(parent, SIGNAL(signalIcCardResult(const QString&)), m_modifyPersonPage, SLOT(slotIcCardResult(const QString&))); + connect(m_snapFacePage, SIGNAL(signalReturn()), this, SLOT(slotReturnClicked())); + connect(m_snapFacePage, SIGNAL(signalSnapFace(std::string &, std::string &)), m_addPersonPage, SLOT(slotSnapFace(std::string &, std::string &))); + + m_fastCfgPark = new settingUiFastCfgPark(pageIndex++, this); + connect(m_fastCfgPark, SIGNAL(signalJumpPage(int)), this, SLOT(slotJumpPage(int))); + m_fastCfgQrcode = new SettingUiQrcode(pageIndex++, this); + connect(parent, SIGNAL(signalCenterMsg(const int, const QString&)), m_fastCfgQrcode, SLOT(slotCenterMsg(const int, const QString&))); + connect(m_fastCfgQrcode, SIGNAL(signalExitSettingUi()), this, SLOT(slotExitSettingUi())); + connect(parent, SIGNAL(signalQrcodeFastCfgResult(bool)), m_fastCfgQrcode, SLOT(slotQrcodeFastCfgResult(bool))); + + m_shadowPage = nullptr; + if(!UiConfig::GetInstance()->isRkDevice()){ + m_shadowPage = new PureColorPage(0, 128); + } + +#if 0 //rk test + m_la = new QLabel(); + QPalette pal = palette(); + pal.setColor(QPalette::Background, QColor(128, 128, 128, 128)); + m_la->setPalette(pal); + m_la->resize(400, 680); + m_la->setPixmap(QPixmap(":/res/image/msg_box_bg_green.png")); +#endif + + //add需要根据枚举定义顺序增加 + m_stack_setPage->addWidget(m_pProjectSetPage); + m_stack_setPage->addWidget(m_infoPage); + m_stack_setPage->addWidget(m_devMngPage); + m_stack_setPage->addWidget(m_faceMngPage); + m_stack_setPage->addWidget(m_accMngPage); + m_stack_setPage->addWidget(m_recoSetPage); + m_stack_setPage->addWidget(m_sysMngPage); + m_stack_setPage->addWidget(m_fastCfgWireNet); + m_stack_setPage->addWidget(m_devMngNetworkPage); + + m_stack_setPage->addWidget(m_devTestPage); + + m_stack_setPage->addWidget(m_devMngTimePage); + m_stack_setPage->addWidget(m_devMngNetWirePage); + m_stack_setPage->addWidget(m_devMngNetWifiPage); + m_stack_setPage->addWidget(m_devMngNetWifiAccPointPage); + m_stack_setPage->addWidget(m_devMngNet4GPage); + m_stack_setPage->addWidget(m_devMngBtPage); + m_stack_setPage->addWidget(m_devMngBtSpkPage); + m_stack_setPage->addWidget(m_devMngBtSpkAccPointPage); + m_stack_setPage->addWidget(m_devMngBtLockPage); + m_stack_setPage->addWidget(m_devMngBtLockAccPointPage); + + m_stack_setPage->addWidget(m_faceMngFacePage); + m_stack_setPage->addWidget(m_faceMngAccRedPage); + + m_stack_setPage->addWidget(m_addPersonPage); + m_stack_setPage->addWidget(m_modifyPersonPage); + m_stack_setPage->addWidget(m_snapFacePage); + + m_stack_setPage->addWidget(m_fastCfgPark); + m_stack_setPage->addWidget(m_fastCfgQrcode); + + m_stack_setPage->setCurrentIndex(PAGE_PROJECT); + + m_onIndexPage = true; + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addWidget(m_ctlBar, 1); + vbLayout->addWidget(m_stack_setPage, 99); + vbLayout->setSpacing(0); + vbLayout->setMargin(0); + setLayout(vbLayout); + + connect(m_ctlBar, SIGNAL(signalReturnBtnClicked()), this, SLOT(slotReturnClicked())); + connect(this, SIGNAL(signalShowPageMsg(QString)), m_ctlBar, SLOT(slotShowPageMsg(QString))); + connect(m_ctlBar, SIGNAL(signalRightSideBtnClicked()), this, SLOT(slotRightSideBtnClicked())); + + connect(m_pProjectSetPage, SIGNAL(pageSetSignal(int, const QString)), this, SLOT(slotShowPage(int, const QString)) ); + + connect(parent, SIGNAL(signalDevTestMesAddrAndProdNoText(const QString&)), m_devTestPage, SLOT(slotDevTestMesAddrAndProdNoText(const QString&))); + connect(parent, SIGNAL(signalDevTestPcbSeqText(const QString&)), m_devTestPage, SLOT(slotDevTestPcbSeqText(const QString&))); + connect(parent, SIGNAL(signalDevTestConfigInfo(const QString&)), m_devTestPage, SLOT(slotDevTestConfigInfo(const QString&))); + qDebug() << "setting ui created!"; +} + +settingUi::~settingUi() +{ + qDebug() << "~settingUi()"; +} + +void settingUi::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + m_infoPage->setBackstageUiinterface(interface);qDebug() << "infoPage reset"; + m_devMngPage->setBackstageUiinterface(interface);qDebug() << "devMngPage reset"; + m_faceMngPage->setBackstageUiinterface(interface); + m_accMngPage->setBackstageUiinterface(interface); + m_recoSetPage->setBackstageUiinterface(interface); + m_sysMngPage->setBackstageUiinterface(interface); + m_fastCfgWireNet->setBackstageUiinterface(interface); + m_devTestPage->setBackstageUiinterface(interface); + + m_devMngTimePage->setBackstageUiinterface(interface); + m_devMngNetworkPage->setBackstageUiinterface(interface); + m_devMngNetWirePage->setBackstageUiinterface(interface); + m_devMngNetWifiPage->setBackstageUiinterface(interface); + m_devMngNetWifiAccPointPage->setBackstageUiinterface(interface); + m_devMngNet4GPage->setBackstageUiinterface(interface); + m_devMngBtPage->setBackstageUiinterface(interface); + m_devMngBtSpkPage->setBackstageUiinterface(interface); + m_devMngBtSpkAccPointPage->setBackstageUiinterface(interface); + m_devMngBtLockPage->setBackstageUiinterface(interface); + m_devMngBtLockAccPointPage->setBackstageUiinterface(interface); + + m_faceMngFacePage->setBackstageUiinterface(interface); + m_faceMngAccRedPage->setBackstageUiinterface(interface); + + m_addPersonPage->setBackstageUiinterface(interface); + m_modifyPersonPage->setBackstageUiinterface(interface); + m_snapFacePage->setBackstageUiinterface(interface); + + m_fastCfgPark->setBackstageUiinterface(interface); + m_fastCfgQrcode->setBackstageUiinterface(interface); + reset(); +} + +void settingUi::slotShowAddFacePage() +{ + //slotShowPage(PAGE_IMAGE); +} + +void settingUi::slotRestoreFactory() +{ + if(m_backstageIf){ + m_backstageIf->recoveryFactorySetting(); + } +} + +void settingUi::slotShowShadowPage(bool show) +{ + if(show){ + if(m_shadowPage){ + m_shadowPage->show(); + } + //m_la->show(); + } + else { + if(m_shadowPage){ + m_shadowPage->hide(); + } + //m_la->hide(); + } +} + +void settingUi::slotShowDevTestPage() +{ + showPage(PAGE_DEV_TEST, SetPageName[PAGE_DEV_TEST]); +} + +void settingUi::slotJumpPage(int pageIndex) +{ + const QObject* send = sender(); + if(send == m_fastCfgWireNet){ + qDebug() << "fastCfgWireNet:" << pageIndex; + m_pageIndex.push(m_stack_setPage->currentIndex()); + const int index = pageIndex + settingUiFastCfgPark::m_pageIndex; + showPage(index, SetPageName[index]); + } + else if(send == m_fastCfgPark){ + qDebug() << "m_fastCfgPark:" << pageIndex; + m_pageIndex.push(m_stack_setPage->currentIndex()); + const int index = pageIndex + SettingUiQrcode::m_pageIndex; + showPage(index, SetPageName[index]); + UiConfig::GetInstance()->setFastCfgStatus(true); + } +} + +void settingUi::slotExitSettingUi() +{ + m_stack_setPage->setCurrentWidget(m_pProjectSetPage); + m_pageIndex.clear(); + m_syncFlag = false; + emit signalShowRecoPage(); + UiConfig::GetInstance()->setFastCfgStatus(false); +} + +void settingUi::update_IpBar() +{ + if(nullptr == m_backstageIf){ + return; + } + const int nSize = 128; + char buf[nSize] = ""; + int type; + m_backstageIf->getIP(buf, nSize, type); + QString ipStr = buf; + m_ctlBar->update_Ip(ipStr); +} + +QString settingUi::operator [] (unsigned index) const +{ + QString ret; + if(index < (unsigned)SetPageName.size()){ + ret = SetPageName[index]; + } + return ret; +} + +#if 0 +void settingUi::showDevTestPage() +{ + showPage(PAGE_DEV_TEST, SetPageName[PAGE_DEV_TEST]); +} +#endif + +void settingUi::reset() +{ + qDebug() << "settingUi::reset()"; + update_IpBar(); + emit signalShowPageMsg(SetPageName[PAGE_PROJECT]); +} diff --git a/Linguist/setUi/settingUi.h b/Linguist/setUi/settingUi.h new file mode 100644 index 0000000..e82adf2 --- /dev/null +++ b/Linguist/setUi/settingUi.h @@ -0,0 +1,201 @@ +#ifndef SETTINGUI_H +#define SETTINGUI_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "UiTools.h" +#include "LineEditWithKeyboard.h" +#include "BackstageInterfaceForUi.h" +#include "UiConfig.h" + +#include "settingUIProjectSet.h" +#include "settingUiInfo.h" +#include "settingUiDevMng.h" +#include "settingUiFaceMng.h" +#include "settingUiAccMng.h" +#include "settingUiRecoSet.h" +#include "settingUiSysMng.h" +#include "settingUiDevTest.h" +#include "settingUiFastCfg.h" + + +class settingUiTop : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + explicit settingUiTop(QWidget *parent = nullptr); + ~settingUiTop(); + + void update_Ip(const QString& str); + void setRightSideBtn(bool isShow, const QString btnName = ""); +signals: + void signalReturnBtnClicked(); + void signalRightSideBtnClicked(); + +public slots: + void slotShowPageMsg(const QString&); + +private: + QLabel* m_label_ip; + QLabel* m_label_time; + QPushButton* m_btn_back; + QLabel* m_label_pageMsg; + QPushButton* m_btn_rightSide; + + TimerUpdate* _timerUpdate; +}; + +class settingUi : public WidgetWithBackstageInterface +{ + Q_OBJECT + +public: + enum enPageIndex { + PAGE_PROJECT = 0, + + PAGE_INFO, + PAGE_DEV_MNG, + PAGE_FACE_MNG, + PAGE_ACCESS_MNG, + PAGE_RECO, + PAGE_SYS_MNG, + PAGE_FAST_CFG_WIRE_NET, + PAGE_DEV_MNG_NETWORK, + + PAGE_DEV_TEST, //hidden page + + //subPage + PAGE_DEV_MNG_TIME, + PAGE_DEV_MNG_NET_WIRE, + PAGE_DEV_MNG_NET_WIFI, + PAGE_DEV_MNG_NET_WIFI_ACC_POINT, + PAGE_DEV_MNG_NET_4G, + PAGE_DEV_MNG_BT, + PAGE_DEV_MNG_BT_SPK, + PAGE_DEV_MNG_BT_SPK_ACC_POINT, + PAGE_DEV_MNG_BT_LOCK, + PAGE_DEV_MNG_BT_LOCK_ACC_POINT, + + PAGE_FACE_MNG_FACE, + PAGE_FACE_MNG_ACCESS_RECORD, + PAGE_FACE_MNG_ADD_PERSON, + PAGE_FACE_MNG_MODIFY_PERSON, + PAGE_FACE_MNG_SNAP_FACE, + + PAGE_FAST_CFG_PARK, + PAGE_FAST_CFG_QRCODE, + + PAGE_MAX + }; + +public: + settingUi(QWidget *parent = nullptr); + ~settingUi(); + void reset(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void update_IpBar(); + QString operator [] (unsigned index) const; + //void showDevTestPage(); + +signals: + void signalShowRecoPage(); + void signalShowPageMsg(const QString&); + void signalSetRecoUiForeheadWidgetVisable(const bool); + void signalChangeRecoUiMode(); //底下的页面开关二维码模式信号 + void signalUpdateRecoUiIpDisplay(const bool); //增加识别界面ip显示开关,更新信号 + +public slots: + void slotShowPage(int, const QString title); + void slotReturnClicked(); + void slotRightSideBtnClicked();//m_ctlBar 右侧按钮按下 + void slotShowAddFacePage(); + void slotRestoreFactory(); + void slotShowShadowPage(bool show); + void slotShowDevTestPage(); + void slotJumpPage(int pageIndex); + void slotExitSettingUi(); + +private: + const QVector SetPageName = {tr("操作"), + tr("信息查看"), + tr("设备管理"), + tr("人脸管理"), + tr("门禁管理"), + tr("识别设置"), + tr("系统管理"), + tr("快速配置"), + tr("网络设置"), + tr("设备检测"), + tr("时间设置"), + tr("有线网络"), + tr("无线网络"), + tr("无线网络接入"), + tr("4G网络"), + tr("蓝牙"), + tr("蓝牙音箱"), + tr("已配对蓝牙设置"), + tr("蓝牙门锁"), + tr("蓝牙门锁操作"), + tr("人脸库"), + tr("通行记录"), + tr("添加人员"), + tr("编辑人员"), + tr("拍照"), + tr("设备信息"), + tr("")}; + + QMap m_map_rightBtnName; + settingUiTop* m_ctlBar; + QStackedWidget* m_stack_setPage; + + settingUIProjectSet* m_pProjectSetPage; + settingUiInfo* m_infoPage; + settingUiDevMng* m_devMngPage; + settingUiFaceMng* m_faceMngPage; + settingUiAccMng* m_accMngPage; + settingUiRecoSet* m_recoSetPage; + settingUiSysMng* m_sysMngPage; + settingUiFastCfgWireNet* m_fastCfgWireNet; + + settingUiDevTest* m_devTestPage; + + settingUiDevMngTime* m_devMngTimePage; + settingUiDevMngNetwork* m_devMngNetworkPage; + settingUiDevMngNetWire* m_devMngNetWirePage; + settingUiDevMngNetWifi* m_devMngNetWifiPage; + settingUiDevMngNetWifiAccPoint* m_devMngNetWifiAccPointPage; + settingUiDevMngNet4G* m_devMngNet4GPage; + settingUiDevMngBt* m_devMngBtPage; + settingUiDevMngBtSpk* m_devMngBtSpkPage; + settingUiDevMngBtSpkAccPoint* m_devMngBtSpkAccPointPage; + settingUiDevMngBtLock* m_devMngBtLockPage; + settingUiDevMngBtLockAccPoint* m_devMngBtLockAccPointPage; + + FaceDbPage* m_faceMngFacePage; + AccessRecordPage* m_faceMngAccRedPage; + AddPersonPage *m_addPersonPage; + ModifyPersonPage *m_modifyPersonPage; + SnapFacePage *m_snapFacePage; + + settingUiFastCfgPark* m_fastCfgPark; + SettingUiQrcode* m_fastCfgQrcode; + + PureColorPage *m_shadowPage; + + //是否在设置索引页面,是的话返回便退出设置页面 + bool m_onIndexPage; + QStack m_pageIndex; + bool m_syncFlag; + + void showPage(int nIndex, const QString& title); +}; + + +#endif // SETTINGUI_H diff --git a/Linguist/setUi/settingUiAccMng.cpp b/Linguist/setUi/settingUiAccMng.cpp new file mode 100644 index 0000000..148063f --- /dev/null +++ b/Linguist/setUi/settingUiAccMng.cpp @@ -0,0 +1,355 @@ +#include "settingUiAccMng.h" +#include +#include "UiConfig.h" + + +int settingUiAccMng::m_pageIndex = 0; +settingUiAccMng::settingUiAccMng(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("开锁延迟(秒)"), "x", myListWidget::enPropertyMoreArrow), + SetOpn(tr("开锁时间(秒)"), "x", myListWidget::enPropertyMoreArrow), + SetOpn(tr("开锁信号"), "xxxxx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("反向通行"), "xxxxx", static_cast(myListWidget::enPropertySwitch| myListWidget::enPropertyIndent1)), + SetOpn(tr("RS485"), "xx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("RS485协议1设备地址(0-255)"), "xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("静电测试范围"), "xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("GPIO4接口"), "xx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("GPIO5接口"), "xx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("门超时报警(秒)"), "xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("防拆报警"), "", myListWidget::enPropertySwitch), + SetOpn(tr("防拆报警信号"), "xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiAccMng()"; +} + +settingUiAccMng::~settingUiAccMng() +{ + qDebug() << "~settingUiAccMng()"; +} + +void settingUiAccMng::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + reset(); +} + +void settingUiAccMng::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + for(int i = 0; i < config.size(); i ++){ + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + switch(i){ + case enAccOpenDelay: + str = QString::number(m_backstageIf->getUnlockDelay()); + break; + case enAccOpenTime: + str = QString::number(m_backstageIf->getUnlockTime()); + break; + case enAccOpenSig: + str = OpenSig[m_backstageIf->getUnlockSig()]; + break; + #if 0 + case enAccAlmSig: + str = AlarmSig[m_backstageIf->getWarningSig()]; + break; + #endif + case enAccRs485: + str = Rs485Cfg[m_backstageIf->getRs485Cfg()]; + break; + case enAccRs485Prot1Addr: + str = (m_backstageIf->getRs485Prot1Addr() >= 0 ? QString::number(m_backstageIf->getRs485Prot1Addr()) : tr("(未设置)")); + break; + case enAccGPIO4: + str = GPIOCfg[m_backstageIf->getGpio4Cfg()]; + break; + case enAccGPIO5: + str = GPIOCfg[m_backstageIf->getGpio5Cfg()]; + break; + case enAccDoorCloseOvertime: + str = QString::number(m_backstageIf->getDoorCloseOvertime()); + break; + case enAccAntiDemolitionSw: + wdt->updateIcon(m_backstageIf->getAntiDemolitionSw() ? ":/res/image/on.png" : ":/res/image/off.png"); + break; + case enAccAntiDemolitionOutput: + str = AntiDemolitionOutput[m_backstageIf->getAntiDemolitionOutput()]; + break; + case enAccRs485ReverseAccessSw: { + wdt->updateIcon(m_backstageIf->getReverseAccessSw() ? ":/res/image/on.png" : ":/res/image/off.png"); + break; + } + default: + break; + } + wdt->updateLabel(str); + } + + controlListWidgetItemShow(m_backstageIf->getRs485Cfg() == 1, enAccRs485Prot1Addr); //协议1显示设置 + controlListWidgetItemShow(m_backstageIf->getRs485Cfg() == 3, enAccRs485Prot3Cfg); //协议3显示设置 + controlListWidgetItemShow(m_backstageIf->getAntiDemolitionSw(), enAccAntiDemolitionOutput); + controlListWidgetItemShow(m_backstageIf->getGpio4Cfg() == 1 || m_backstageIf->getGpio5Cfg() == 1, enAccDoorCloseOvertime); + controlListWidgetItemShow(m_backstageIf->getUnlockSig() == UnlockSigRs485, enAccRs485ReverseAccessSw); +} + +void settingUiAccMng::slotItemClicked(QListWidgetItem* item) +{ + if(nullptr == m_backstageIf){ + #ifndef DEBUG_MODE + return; + #endif + } + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + switch(row){ + case enAccOpenDelay: + case enAccOpenTime: + case enAccRs485Prot1Addr: + case enAccDoorCloseOvertime: + { + int currentValue = 10; + int min = 0; + int max = 100; + QString tip; + + if(enAccOpenDelay == row){ + currentValue = m_backstageIf->getUnlockDelay(); + min = 0; + max = 10; + }else if(enAccOpenTime == row){ + currentValue = m_backstageIf->getUnlockTime(); + min = 1; + max = 10; + }else if(enAccRs485Prot1Addr == row){ + currentValue = 0;//m_backstageIf->getRs485Prot1Addr(); + min = 0; + max = 255; + }else if(enAccDoorCloseOvertime == row){ + currentValue = m_backstageIf->getDoorCloseOvertime(); + min = 1; + max = 300; + } + + SliderDialog dlg(currentValue, min, max, tip, parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + int valueSet = dlg.getValueSet(); + if(enAccOpenDelay == row){ + m_backstageIf->setUnlockDelay(valueSet); + }else if(enAccOpenTime == row){ + m_backstageIf->setUnlockTime(valueSet); + }else if(enAccRs485Prot1Addr == row){ + m_backstageIf->setRs485Prot1Addr(valueSet); + }else if(enAccDoorCloseOvertime == row){ + m_backstageIf->setDoorCloseOvertime(valueSet); + } + wdt->updateLabel(QString::number(valueSet)); + } + } + break; + case enAccOpenSig: + //case enAccAlmSig: + case enAccRs485: + case enAccGPIO4: + case enAccGPIO5: + case enAccAntiDemolitionOutput:{ + int choosed = 0; + + QVector options; + if(enAccOpenSig == row){ + options = OpenSig; + if(UiConfig::GetInstance()->isFuncNotSupport(FuncWg42)){ + options.remove(4); + } + choosed = static_cast(m_backstageIf->getUnlockSig()); + } + #if 0 + else if(enAccAlmSig == row){ + options = AlarmSig; + choosed = static_cast(m_backstageIf->getWarningSig()); + } + #endif + else if(enAccRs485 == row){ + options = Rs485Cfg; + choosed = static_cast(m_backstageIf->getRs485Cfg()); + }else if(enAccGPIO4 == row){ + options = GPIOCfg; + choosed = static_cast(m_backstageIf->getGpio4Cfg()); + }else if(enAccGPIO5 == row){ + options = GPIOCfg; + choosed = static_cast(m_backstageIf->getGpio5Cfg()); + }else if(enAccAntiDemolitionOutput == row){ + options = AntiDemolitionOutput; + choosed = static_cast(m_backstageIf->getAntiDemolitionOutput()); + } + + RadioBtnChooseDialog dlg(options, parent()->parent(), choosed); + if(dlg.exec() == QDialog::Accepted){ + int newChoosed = dlg.getChoosedIndex(); + if(newChoosed != choosed){ + if(enAccOpenSig == row){ + if(1 == newChoosed && + (1 == m_backstageIf->getAntiDemolitionOutput()) ){//1 == m_backstageIf->getWarningSig() || + InfoDialog(tr("本地继电器已使用"), parent()->parent()).exec(); + }else { + m_backstageIf->setUnlockSig(static_cast(newChoosed)); + wdt->updateLabel(options[newChoosed]); + controlListWidgetItemShow(m_backstageIf->getUnlockSig() == UnlockSigRs485, enAccRs485ReverseAccessSw); + } + } + #if 0 + else if(enAccAlmSig == row){ + if(1 == newChoosed && + (1 == m_backstageIf->getUnlockSig() || 1 == m_backstageIf->getAntiDemolitionOutput()) ){ + InfoDialog(tr("本地继电器已使用"), parent()->parent()).exec(); + }else{ + m_backstageIf->setWarningSig(newChoosed); + wdt->updateLabel(options[newChoosed]); + } + } + #endif + else if(enAccRs485 == row){ + m_backstageIf->setRs485Cfg(newChoosed); + wdt->updateLabel(options[newChoosed]); + QListWidgetItem* pItem = m_listWidget->item(enAccRs485Prot1Addr); + myListWidget* swWidget = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(swWidget){ + swWidget->updateLabel((m_backstageIf->getRs485Prot1Addr() >= 0 ? QString::number(m_backstageIf->getRs485Prot1Addr()) : tr("(未设置)"))); + } + + controlListWidgetItemShow(1 == newChoosed, enAccRs485Prot1Addr); //协议1显示地址 + controlListWidgetItemShow(3 == newChoosed, enAccRs485Prot3Cfg); + if(1 == newChoosed){ + InfoDialog(tr("请注意设置RS485协议1设备地址"), parent()->parent()).exec(); + } + }else if(enAccGPIO4 == row){ + if(0 != newChoosed && m_backstageIf->getAntiDemolitionSw() && 2 == m_backstageIf->getAntiDemolitionOutput()){ + InfoDialog(tr("GPIO4已设置为防拆报警输出,请重新设置!"), parent()->parent()).exec(); + }else if(1 == newChoosed && 1 == m_backstageIf->getGpio5Cfg()){ + InfoDialog(tr("GPIO5已设置为门磁,请重新设置!"), parent()->parent()).exec(); + }else if(2 == newChoosed && 2 == m_backstageIf->getGpio5Cfg()){ + InfoDialog(tr("GPIO5已设置为消防信号,请重新设置!"), parent()->parent()).exec(); + }else{ + m_backstageIf->setGpio4Cfg(newChoosed); + wdt->updateLabel(options[newChoosed]); + controlListWidgetItemShow(1 == m_backstageIf->getGpio4Cfg() || 1 == m_backstageIf->getGpio5Cfg(), enAccDoorCloseOvertime); + } + }else if(enAccGPIO5 == row){ + if(0 != newChoosed && m_backstageIf->getAntiDemolitionSw() && 3 == m_backstageIf->getAntiDemolitionOutput()){ + InfoDialog(tr("GPIO5已设置为防拆报警输出,请重新设置!"), parent()->parent()).exec(); + }else if(1 == newChoosed && 1 == m_backstageIf->getGpio4Cfg()){ + InfoDialog(tr("GPIO4已设置为门磁,请重新设置!"), parent()->parent()).exec(); + }else if(2 == newChoosed && 2 == m_backstageIf->getGpio4Cfg()){ + InfoDialog(tr("GPIO4已设置为消防信号,请重新设置!"), parent()->parent()).exec(); + }else{ + m_backstageIf->setGpio5Cfg(newChoosed); + wdt->updateLabel(options[newChoosed]); + controlListWidgetItemShow(1 == m_backstageIf->getGpio4Cfg() || 1 == m_backstageIf->getGpio5Cfg(), enAccDoorCloseOvertime); + } + }else if(enAccAntiDemolitionOutput == row){ + if(1 == newChoosed && 1 == m_backstageIf->getUnlockSig()){//1 == m_backstageIf->getWarningSig() || + InfoDialog(tr("本地继电器已被使用,请重新设置!"), parent()->parent()).exec(); + }else if(2 == newChoosed && 0 != m_backstageIf->getGpio4Cfg()){ + InfoDialog(tr("GPIO4已设置为信号输入,请重新设置!"), parent()->parent()).exec(); + }else if(3 == newChoosed && 0 != m_backstageIf->getGpio5Cfg()){ + InfoDialog(tr("GPIO5已设置为信号输入,请重新设置!"), parent()->parent()).exec(); + }else { + m_backstageIf->setAntiDemolitionOutput(newChoosed); + wdt->updateLabel(options[newChoosed]); + } + } + } + } + } + break; + #if 0 + case enAccRs485Prot1Addr: + { + if(0 == m_backstageIf->getRs485Prot1Addr()){ + bool settingFailed = true; + do{ + LineEditInputDialog dlg(config[enAccRs485Prot1Addr].m_sOpn, parent()->parent()); + if(dlg.exec() == QDialog::Accepted){ + const QString strInput = dlg.getRow(0); + do{ + bool isDigi = false; + int input = strInput.toInt(&isDigi); + if(!isDigi){ + break; + } + if(0 == m_backstageIf->setRs485Prot1Addr(input)){ + wdt->updateLabel(strInput); + settingFailed = false; + } + }while(0); + } + else { + settingFailed = false; + } + if(settingFailed){ + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + } + }while(settingFailed); + } + } + break; + #endif + case enAccRs485Prot3Cfg: + { + const QStringList titles{tr("手部"), tr("脚部")}; + const QVector sels{{"100KΩ-10MΩ", "750KΩ-10MΩ", "750KΩ-35MΩ", tr("不检测")}, + {"100KΩ-35MΩ", "750KΩ-100MΩ", "750KΩ-1000MΩ", tr("不检测")}}; + ComSelectDialog dlg(titles, sels, parent()->parent()); + int handCfg = 0; + int feetCfg = 0; + m_backstageIf->getRs485Prot3Cfg(handCfg, feetCfg); + dlg.setRow(0, handCfg); + dlg.setRow(1, feetCfg); + if(dlg.exec() == QDialog::Accepted){ + m_backstageIf->setRs485Prot3Cfg(dlg.getRow(0), dlg.getRow(1)); + } + } + break; + case enAccAntiDemolitionSw: + { + bool setting_value = false; + if(enAccAntiDemolitionSw == row){ + setting_value = static_cast(m_backstageIf->getAntiDemolitionSw()); + } + + setting_value = static_cast(!setting_value); + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + + if(enAccAntiDemolitionSw == row){ + controlListWidgetItemShow(setting_value, enAccAntiDemolitionOutput); + m_backstageIf->setAntiDemolitionSw(setting_value); + if(!setting_value){ + m_backstageIf->setAntiDemolitionOutput(0);//防止在配置输出信号项功能时与防拆输出冲突 + } + } + } + break; + case enAccRs485ReverseAccessSw: { + bool setting_value = m_backstageIf->getReverseAccessSw(); + setting_value = !setting_value; + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + m_backstageIf->setReverseAccessSw(setting_value); + break; + } + default: + break; + } + +} + diff --git a/Linguist/setUi/settingUiAccMng.h b/Linguist/setUi/settingUiAccMng.h new file mode 100644 index 0000000..0d2b45d --- /dev/null +++ b/Linguist/setUi/settingUiAccMng.h @@ -0,0 +1,76 @@ +#ifndef SETTINGUIACCMNG_H +#define SETTINGUIACCMNG_H + +#include +#include "UiTools.h" + +class settingUiAccMng : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + enAccOpenDelay, + enAccOpenTime, + enAccOpenSig, + enAccRs485ReverseAccessSw, // RS485反向通行 + //enAccAlmSig, + enAccRs485, + enAccRs485Prot1Addr, + enAccRs485Prot3Cfg, + enAccGPIO4, + enAccGPIO5, + enAccDoorCloseOvertime, + enAccAntiDemolitionSw, + enAccAntiDemolitionOutput, + }enAcc; + + static int m_pageIndex; + + explicit settingUiAccMng(int pageIndex, QWidget *parent = nullptr); + ~settingUiAccMng(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + +public slots: + void slotItemClicked(QListWidgetItem* item); + +private: + const QVector OpenSig{ + tr("禁用"), + tr("本地继电器"), + tr("韦根26"), + tr("韦根34"), + tr("韦根42"), + tr("RS485") + }; + + const QVector AlarmSig{ + tr("禁用"), + tr("本地继电器") + }; + + const QVector Rs485Cfg{ + tr("禁用"), + tr("协议1"), + tr("协议2"), + tr("协议3") + }; + + const QVector GPIOCfg{ + tr("禁用"), + tr("门磁"), + tr("消防信号") + }; + + const QVector AntiDemolitionOutput{ + tr("无"), + tr("本地继电器"), + tr("GPIO4"), + tr("GPIO5") + }; +}; + +#endif // SETTINGUIACCMNG_H diff --git a/Linguist/setUi/settingUiDevMng.cpp b/Linguist/setUi/settingUiDevMng.cpp new file mode 100644 index 0000000..5f901cb --- /dev/null +++ b/Linguist/setUi/settingUiDevMng.cpp @@ -0,0 +1,2897 @@ +#include "settingUiDevMng.h" +#include +#include +#include +#include "UiConfig.h" +#include "rw_zlog.h" + +int settingUiDevMng::m_pageIndex = 0; +settingUiDevMng::settingUiDevMng(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("界面显示IP"), "", myListWidget::enPropertySwitch), + SetOpn(tr("界面显示ID及版本号"), "", myListWidget::enPropertySwitch), + SetOpn(tr("音量控制"), "xx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("亮度控制"), "xx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("进入屏保时间(秒)"), "xx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("熄屏等待时间(秒)"), "xx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("时间设置"), "", myListWidget::enPropertyMoreArrow), + //SetOpn(tr("网络设置"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("蓝牙"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("动态底库"), "", myListWidget::enPropertySwitch), + SetOpn(tr("通行密码"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("禁用工程页面"), "", myListWidget::enPropertySwitch), + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMng()"; +#if 0//蓝牙功能暂时隐藏 + controlListWidgetItemShow(false, DEV_MNG_BLUETOOTH); +#endif +} + +settingUiDevMng::~settingUiDevMng() +{ + qDebug() << "~settingUiDevMng()"; +} + +void settingUiDevMng::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + reset(); +} + +void settingUiDevMng::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + switch(i) + { + case DEV_MNG_SHOW_IP: + case DEV_MNG_SHOW_ID_VER: + { + bool switch_option = false; + if(DEV_MNG_SHOW_IP == i){ + switch_option = m_backstageIf->getIpShowSw(); + }else if(DEV_MNG_SHOW_ID_VER == i){ + switch_option = m_backstageIf->getShowIdAndVerSw(); + } + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + case DEV_MNG_SET_VOLUMN:qDebug() << "DEV_MNG_SET_VOLUMN"; + str = QString::number(m_backstageIf->getVolume()); + break; + case DEV_MNG_SET_BRIGHTNESS:qDebug() << "DEV_MNG_SET_BRIGHTNESS"; + str = QString::number(m_backstageIf->getLcdBrightness()); + break; +#if 0 + case DEV_MNG_SCREENSAVER: + case DEV_MNG_SCREENOFF: + { + int standbyTime = m_backstageIf->getStandbyTime(); + if(0 == standbyTime){ + str = tr("永不"); + } + else{ + str = QString::number(standbyTime); + if(DEV_MNG_SCREENOFF == i){ + int screenoffTime = m_backstageIf->getCloseScreenTime(); + str = (0 == screenoffTime ? tr("永不") : QString::number(screenoffTime)); + } + } + } + break; +#else + case DEV_MNG_SCREENSAVER:qDebug() << "DEV_MNG_SCREENSAVER"; + { + int standbyTime = m_backstageIf->getStandbyTime(); + str = (0 == standbyTime ? tr("永不") : QString::number(standbyTime)); + } + break; + case DEV_MNG_SCREENOFF:qDebug() << "DEV_MNG_SCREENOFF"; + { + int screenoffTime = m_backstageIf->getCloseScreenTime(); + str = (0 == screenoffTime ? tr("永不") : QString::number(screenoffTime)); + } + break; +#endif + case DEV_MNG_SET_TIME:qDebug() << "DEV_MNG_SET_TIME"; + break; + #if 0 + case DEV_MNG_SET_NETWORK: + break; + #endif + case DEV_MNG_PASSWORD:qDebug() << "DEV_MNG_PASSWORD"; + if(UiConfig::GetInstance()->isTpAvailable()){ + int pwdType = 0; + std::string pwd; + if(0 == m_backstageIf->getDevPwd(pwdType, pwd)){ + //qDebug() << "password type:" << pwdType << ", password:" << QString(pwd.c_str()); + str = pwd.empty() ? tr("(未设置)") : pwd.c_str(); + } + } + else{ + qDebug() << "has no TP, hide password"; + controlListWidgetItemShow(false, DEV_MNG_PASSWORD); + } + break; + case DEV_MNG_BLUETOOTH:qDebug() << "DEV_MNG_BLUETOOTH"; + { + qDebug() << "get bt switch"; + bool btSwitch = false; + m_backstageIf->getBtSwitch(btSwitch); + str = btSwitch ? tr("已开启") : tr("已关闭"); + qDebug() << "bt switch:" << btSwitch; + } + break; + case DEV_MNG_OPEN_DYNAMICFEATURE: + { + bool switch_option = m_backstageIf->getDynamicFeatureSw(); + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + case DEV_MNG_DEV_SETTING_DISABLE: + wdt->updateIcon(m_backstageIf->getDisableDevSettingSw() ? ":/res/image/on.png" : ":/res/image/off.png"); + break; + default: + break; + } + wdt->updateLabel(str); + } +} + +void settingUiDevMng::slotItemClicked(QListWidgetItem* item) +{ + if(nullptr == m_backstageIf){ +#ifndef DEBUG_MODE + return; +#endif + } + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + switch(row){ + case DEV_MNG_SHOW_IP: + case DEV_MNG_DEV_SETTING_DISABLE: + case DEV_MNG_SHOW_ID_VER: + { + bool setting_value = false; + if(DEV_MNG_SHOW_IP == row){ + setting_value = static_cast(m_backstageIf->getIpShowSw()); + }else if(DEV_MNG_DEV_SETTING_DISABLE == row){ + setting_value = static_cast(m_backstageIf->getDisableDevSettingSw()); + }else if(DEV_MNG_SHOW_ID_VER == row){ + setting_value = static_cast(m_backstageIf->getShowIdAndVerSw()); + } + setting_value = static_cast(!setting_value); + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + if(DEV_MNG_SHOW_IP == row){ + m_backstageIf->setIpShowSw(setting_value); + }else if(DEV_MNG_DEV_SETTING_DISABLE == row){ + do{ + if(setting_value){ + QuestionDialog dlg(tr("打开此开关后,设备将无法进入工程页面,\n是否确认打开?"), parent()->parent()); + if(QDialog::Accepted != dlg.exec()){ + wdt->updateIcon(":/res/image/off.png"); + break; + } + } + m_backstageIf->setDisableDevSettingSw(setting_value); + }while(0); + }else if(DEV_MNG_SHOW_ID_VER == row){ + m_backstageIf->setShowIdAndVerSw(setting_value); + } + } + break; + + case DEV_MNG_SET_VOLUMN: + case DEV_MNG_SET_BRIGHTNESS: + case DEV_MNG_SCREENSAVER: + case DEV_MNG_SCREENOFF: + { + int currentValue = 10; + int min = 0; + int max = 100; + QString tip("this is a line of prompt text"); +#ifndef DEBUG_MODE + if(DEV_MNG_SET_VOLUMN == row){ + currentValue = m_backstageIf->getVolume(); + min = 0; + max = 100; + tip.clear(); + } + else if(DEV_MNG_SET_BRIGHTNESS == row){ + currentValue = m_backstageIf->getLcdBrightness(); + min = 0; + max = 100; + tip.clear(); + } + else if(DEV_MNG_SCREENSAVER == row){ + currentValue = m_backstageIf->getStandbyTime(); + min = 0; + max = 60; + tip = tr("设置为0时永不进入待机"); + } + else if(DEV_MNG_SCREENOFF == row){ + currentValue = m_backstageIf->getCloseScreenTime(); + min = 0; + max = 60; + tip = tr("设置为0时永不进入熄屏"); //设置为0或者不进入待机时永不进入熄屏 + } +#endif + SliderDialog dlg(currentValue, min, max, tip, parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString str("valueSet"); + int valueSet = dlg.getValueSet(); +#ifndef DEBUG_MODE + if(DEV_MNG_SET_VOLUMN == row){ + m_backstageIf->setVolume(valueSet); + str = QString::number(valueSet); + } + else if(DEV_MNG_SET_BRIGHTNESS == row){ + m_backstageIf->setLcdBrightness(valueSet); + str = QString::number(valueSet); + } +#if 0 + else if(DEV_MNG_SCREENSAVER == row){ + m_backstageIf->setStandbyTime(valueSet); + myListWidget* wdtScreenOff = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_SCREENOFF))); + if(0 == valueSet){ + str = tr("永不"); + if(wdtScreenOff != nullptr){ + wdtScreenOff->updateLabel(str); + } + } + else{ + str = QString::number(valueSet); + int screenoffTime = m_backstageIf->getCloseScreenTime(); + if(wdtScreenOff != nullptr){ + wdtScreenOff->updateLabel(0 == screenoffTime ? tr("永不") : QString::number(screenoffTime)); + } + } + } + else if(DEV_MNG_SCREENOFF == row){ + m_backstageIf->setCloseScreenTime(valueSet); + str = (0 == m_backstageIf->getStandbyTime() || 0 == valueSet ? tr("永不") : QString::number(valueSet)); + } +#else + else if(DEV_MNG_SCREENSAVER == row){ + m_backstageIf->setStandbyTime(valueSet); + str = (0 == valueSet ? tr("永不") : QString::number(valueSet)); + } + else if(DEV_MNG_SCREENOFF == row){ + m_backstageIf->setCloseScreenTime(valueSet); + str = (0 == valueSet ? tr("永不") : QString::number(valueSet)); + } +#endif + +#endif + wdt->updateLabel(str); + } + } + break; + case DEV_MNG_SET_TIME: + emit signalShowPage(settingUiDevMngTime::m_pageIndex); + break; + #if 0 + case DEV_MNG_SET_NETWORK: + emit signalShowPage(settingUiDevMngNetwork::m_pageIndex); + break; + #endif + case DEV_MNG_BLUETOOTH: + emit signalShowPage(settingUiDevMngBt::m_pageIndex); + break; + case DEV_MNG_OPEN_DYNAMICFEATURE: + { + bool setting_value = !(m_backstageIf->getDynamicFeatureSw()); + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + m_backstageIf->setDynamicFeatureSw(setting_value); + } + break; + case DEV_MNG_PASSWORD: + { + int pwdType = 0; + std::string pwd; + if(0 == m_backstageIf->getDevPwd(pwdType, pwd)){ + if(1 == pwdType){ //设备本地配置密码 + bool settingFailed = true; + do{ + LineEditInputDialog dlg(config[DEV_MNG_PASSWORD].m_sOpn, parent()->parent()); + if(dlg.exec() == QDialog::Accepted){ + const QString strInput = dlg.getRow(0); + do{ + if(strInput.length()){ + if(strInput.length() < 4 || strInput.length() > 10){ + break; + } + + bool isDigi = false; + strInput.toInt(&isDigi); + if(!isDigi){ + break; + } + } + if(0 == m_backstageIf->setLocalDevPwd(strInput.toStdString())){ + wdt->updateLabel(strInput.isEmpty() ? tr("(未设置)") : strInput); + settingFailed = false; + } + }while(0); + } + else { + settingFailed = false; + } + if(settingFailed){ + InfoDialog(tr("密码为4-10位数字,设置有误,请重新输入!"), parent()->parent()).exec(); + } + }while(settingFailed); + } + else if(2 == pwdType){ //平台配置密码 + InfoDialog(tr("平台下发的通行密码,如需修改请前往平台操作"), parent()->parent()).exec(); + } + } + } + break; + default: + break; + } +} + + +int settingUiDevMngTime::m_pageIndex = 0; +settingUiDevMngTime::settingUiDevMngTime(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("NTP获取时间"), "", myListWidget::enPropertySwitch), + SetOpn(tr("NTP服务器"), "xxxxxxxxxxxxxxxxxxxxxxx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("校时间隔(小时)"), "x", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("时区"), "UTC+8亚洲/北京/xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("手动设置"), "xxxx-xx-xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)) + }, parent), m_msgDlg(nullptr) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngTime()"; +} + +settingUiDevMngTime::~settingUiDevMngTime() +{ + qDebug() << "~settingUiDevMngTime()"; +} + +void settingUiDevMngTime::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + reset(); +} + +void settingUiDevMngTime::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + const int iBufSize = 256; + char buf[iBufSize] = {'\0'}; + switch(i) + { + case DEV_MNG_TIME_NTP_SW: + { + bool switch_option = false; + if(DEV_MNG_TIME_NTP_SW == i){ + switch_option = m_backstageIf->getNtpServerSw(); + } + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + case DEV_MNG_TIME_NTP_SERVER: + { + if(0 == m_backstageIf->getNtpServerAddr(buf, iBufSize)){ + str = buf; + } + /* + str += ":"; + int port = m_backstageIf->getNtpServerPort(); + if(port >= 0){ + str += QString::number(port); + } + */ + } + break; + case DEV_MNG_TIME_NTP_INTERVAL: + str = QString::number(m_backstageIf->getNtpCheckInterval()); + break; + case DEV_MNG_TIME_NTP_TIME_ZONE: + if(0 == m_backstageIf->getNtpTimeZone(buf, iBufSize)){ + for(int j = 0; j < TimeZoneSet.length(); j++){ + if(TimeZoneSet[j] == buf){ + str = TimeZone[j]; + break; + } + } + } + break; + case DEV_MNG_TIME_MANUAL: + str = QDateTime::currentDateTime().toString("yyyy-MM-dd"); // hh:mm + break; + default: + break; + } + wdt->updateLabel(str); + } + if(m_backstageIf->getNtpServerSw()){ + controlListWidgetItemShow(false, DEV_MNG_TIME_MANUAL); + controlListWidgetItemShow(true, DEV_MNG_TIME_NTP_SERVER); + controlListWidgetItemShow(true, DEV_MNG_TIME_NTP_INTERVAL); + controlListWidgetItemShow(true, DEV_MNG_TIME_NTP_TIME_ZONE); + } + else{ + controlListWidgetItemShow(true, DEV_MNG_TIME_MANUAL); + controlListWidgetItemShow(false, DEV_MNG_TIME_NTP_SERVER); + controlListWidgetItemShow(false, DEV_MNG_TIME_NTP_INTERVAL); + controlListWidgetItemShow(false, DEV_MNG_TIME_NTP_TIME_ZONE); + } +} + +void settingUiDevMngTime::slotItemClicked(QListWidgetItem* item) +{ + if(nullptr == m_backstageIf){ +#ifndef DEBUG_MODE + return; +#endif + } + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + switch(row){ + case DEV_MNG_TIME_NTP_SW: + { + bool setting_value = false; +#ifndef DEBUG_MODE + if(DEV_MNG_TIME_NTP_SW == row){ + setting_value = static_cast(m_backstageIf->getNtpServerSw()); + } +#endif + setting_value = static_cast(!setting_value); + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); +#ifndef DEBUG_MODE + if(DEV_MNG_TIME_NTP_SW == row){ + m_backstageIf->setNtpServerSw(setting_value); + if(setting_value){ + controlListWidgetItemShow(true, DEV_MNG_TIME_NTP_SERVER); + controlListWidgetItemShow(true, DEV_MNG_TIME_NTP_INTERVAL); + controlListWidgetItemShow(true, DEV_MNG_TIME_NTP_TIME_ZONE); + controlListWidgetItemShow(false, DEV_MNG_TIME_MANUAL); + } + else{ + controlListWidgetItemShow(false, DEV_MNG_TIME_NTP_SERVER); + controlListWidgetItemShow(false, DEV_MNG_TIME_NTP_INTERVAL); + controlListWidgetItemShow(false, DEV_MNG_TIME_NTP_TIME_ZONE); + controlListWidgetItemShow(true, DEV_MNG_TIME_MANUAL); + } + ntpTimeCorrect(); + } +#endif + } + break; + + case DEV_MNG_TIME_NTP_SERVER: + case DEV_MNG_TIME_NTP_INTERVAL: + { + bool settingFailed = true; + do{ + QStringList strs; + if(DEV_MNG_TIME_NTP_SERVER == row){ + strs << config[row].m_sOpn; + } + else if(DEV_MNG_TIME_NTP_INTERVAL == row){ + strs << config[row].m_sOpn; + } + LineEditInputDialog dlg(strs, parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString str; + do{ + if(DEV_MNG_TIME_NTP_SERVER == row){ + /* + bool isDigi = false; + int valueSet = dlg.getRow(1).toInt(&isDigi); + if(isDigi){ + if(valueSet < 0 || valueSet > 65535){ + break; + } + } + */ + if("" == dlg.getRow(0)){ + break; + } +#ifndef DEBUG_MODE + if(m_backstageIf){ + m_backstageIf->setNtpServerAddr(const_cast(dlg.getRow(0).toStdString().c_str())); + //m_backstageIf->setNtpServerPort(valueSet); + str = dlg.getRow(0);// + ":" + dlg.getRow(1); + wdt->updateLabel(str); + ntpTimeCorrect(); + } +#endif + } + else if(DEV_MNG_TIME_NTP_INTERVAL == row){ + bool isDigi = false; + int valueSet = dlg.getRow(0).toInt(&isDigi); + if(!isDigi || (valueSet < 0 || valueSet > 1000000)){ + break; + } +#ifndef DEBUG_MODE + if(m_backstageIf){ + m_backstageIf->setNtpCheckInterval(valueSet); + str = QString::number(valueSet); + wdt->updateLabel(str); + ntpTimeCorrect(); + } +#endif + } + settingFailed = false; + }while(0); + } + else { + settingFailed = false; + } + if(settingFailed) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + } + }while(settingFailed); + } + break; + + case DEV_MNG_TIME_NTP_TIME_ZONE: + { + int choosed = 0; + const QVector& opts = TimeZone; + if(DEV_MNG_TIME_NTP_TIME_ZONE == row){ +#ifndef DEBUG_MODE + const int iBufSize = 256; + char buf[iBufSize] = {'\0'}; + if(0 == m_backstageIf->getNtpTimeZone(buf, iBufSize)){ + for(int i = 0; i < TimeZoneSet.length(); i++){ + if(TimeZoneSet[i] == buf){ + choosed = i; + break; + } + } + } +#endif + } + + ItemChooseDialog dlg(opts, choosed, parent()->parent()); + if(QDialog::Accepted == dlg.exec()) + { + int newChoosed = dlg.getChoosedIndex(); + if(newChoosed != choosed){ + qDebug() << "newChoosed:" << newChoosed; + if(DEV_MNG_TIME_NTP_TIME_ZONE == row){ +#ifndef DEBUG_MODE + m_backstageIf->setNtpTimeZone(const_cast(TimeZoneSet[newChoosed].toStdString().c_str())); + ntpTimeCorrect(); +#endif + wdt->updateLabel(opts[newChoosed]); + } + } + } + } + break; + case DEV_MNG_TIME_MANUAL: + { + DateTimeDialog dateTimeDlg(QDateTime::currentDateTime(), parent()->parent()); + if(dateTimeDlg.exec() == QDialog::Accepted) + { + m_backstageIf->setDateTime(dateTimeDlg.getValueSet().toString("yyyy-MM-dd hh:mm").toStdString().c_str()); + wdt->updateLabel(dateTimeDlg.getValueSet().toString("yyyy-MM-dd")); + } + } + break; + default: + break; + } +} + +void settingUiDevMngTime::ntpTimeCorrect() +{ + QTimer::singleShot(1000, this, SLOT(slotShowProcessing())); + if(m_backstageIf->getNtpServerSw()){ + if(nullptr == m_msgDlg){ + m_msgDlg = new MsgDialog(tr("处理中,请稍候..."), parent()->parent()); + m_msgDlg->exec(); + } + } +} + +void settingUiDevMngTime::slotShowProcessing() +{ + int ret = m_backstageIf->ntpTimeCorrect(); + if(m_msgDlg){ + delete m_msgDlg; + m_msgDlg = nullptr; + } + if(0 != ret){ + InfoDialog(tr("NTP校时失败,请检查!"), parent()->parent()).exec(); + } +} + + +int settingUiDevMngNetwork::m_pageIndex = 0; +settingUiDevMngNetwork::settingUiDevMngNetwork(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("有线网络"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("无线网络"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("4G网络"), "", myListWidget::enPropertyMoreArrow) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngNetwork()"; +} + +settingUiDevMngNetwork::~settingUiDevMngNetwork() +{ + qDebug() << "~settingUiDevMngNetwork()"; +} + +void settingUiDevMngNetwork::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; +} + +void settingUiDevMngNetwork::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + + if(UiConfig::GetInstance()->isFuncNotSupport(FuncWifi)){ + controlListWidgetItemShow(false, DEV_MNG_NETWORK_WIFI); + } + + stNet4G netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNet4G)); + if(0 != m_backstageIf->getNet4GCfg(netCfg)){ + InfoDialog(tr("获取4G网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + controlListWidgetItemShow(netCfg.available, DEV_MNG_NETWORK_4G); +} + +void settingUiDevMngNetwork::slotItemClicked(QListWidgetItem* item) +{ + if(nullptr == m_backstageIf){ +#ifndef DEBUG_MODE + return; +#endif + } + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + switch(row){ + case DEV_MNG_NETWORK_WIRE: + emit signalShowPage(settingUiDevMngNetWire::m_pageIndex); + break; + case DEV_MNG_NETWORK_WIFI: + emit signalShowPage(settingUiDevMngNetWifi::m_pageIndex); + break; + case DEV_MNG_NETWORK_4G: + emit signalShowPage(settingUiDevMngNet4G::m_pageIndex); + break; + default: + break; + } +} + + +int settingUiDevMngNetWire::m_pageIndex = 0; +settingUiDevMngNetWire::settingUiDevMngNetWire(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("启用有线网络"), "", myListWidget::enPropertySwitch), + SetOpn(tr("DHCP"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("手动配置"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("设备IP"), "xxx.xxx.xxx.xxx", myListWidget::enPropertyIndent1), + SetOpn(tr("子网掩码"), "xxx.xxx.xxx.xxx", myListWidget::enPropertyIndent1), + SetOpn(tr("设备网关"), "xxx.xxx.xxx.xxx", myListWidget::enPropertyIndent1), + SetOpn(tr("DNS服务器"), "xxx.xxx.xxx.xxx", myListWidget::enPropertyIndent1) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngNetWire()"; +} + +settingUiDevMngNetWire::~settingUiDevMngNetWire() +{ + qDebug() << "~settingUiDevMngNetWire()"; +} + +void settingUiDevMngNetWire::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + //reset(); +} + +void settingUiDevMngNetWire::reset() +{ + stNetWire netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWire)); + if(0 != m_backstageIf->getNetWireCfg(netCfg)){ + InfoDialog(tr("获取有线网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + switch(i){ + case DEV_MNG_NET_WIRE_SW: + case DEV_MNG_NET_WIRE_DHCP: + { + bool switch_option = false; + if(DEV_MNG_NET_WIRE_SW == i){ + switch_option = netCfg.cfg.enable; + } + else if(DEV_MNG_NET_WIRE_DHCP == i){ + switch_option = netCfg.cfg.type; + } + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + case DEV_MNG_NET_WIRE_MAN_CFG: + break; + case DEV_MNG_NET_WIRE_IP: + str = netCfg.cfg.ip; + break; + case DEV_MNG_NET_WIRE_MASK: + str = netCfg.cfg.mask; + break; + case DEV_MNG_NET_WIRE_GW: + str = netCfg.cfg.gw; + break; + case DEV_MNG_NET_WIRE_DNS: + str = netCfg.cfg.dns; + break; + default: + break; + } + wdt->updateLabel(str); + } + + controlListWidgetItemShow(netCfg.cfg.enable, DEV_MNG_NET_WIRE_DHCP); + controlListWidgetItemShow(netCfg.cfg.enable, DEV_MNG_NET_WIRE_MAN_CFG); + controlListWidgetItemShow(netCfg.cfg.enable, DEV_MNG_NET_WIRE_IP); + controlListWidgetItemShow(netCfg.cfg.enable, DEV_MNG_NET_WIRE_MASK); + controlListWidgetItemShow(netCfg.cfg.enable, DEV_MNG_NET_WIRE_GW); + controlListWidgetItemShow(netCfg.cfg.enable, DEV_MNG_NET_WIRE_DNS); + + if(netCfg.cfg.enable){ + controlListWidgetItemShow(!netCfg.cfg.type, DEV_MNG_NET_WIRE_MAN_CFG); + } +} + +bool settingUiDevMngNetWire::setStaticNetworkPara(const stNetWire& curNetCfg) +{ + stNetWire netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWire)); + netCfg.cfg.enable = true; + netCfg.cfg.type = 0; + + bool ret = false; + bool settingFailed = true; + do{ + QList strs; + strs << config[DEV_MNG_NET_WIRE_IP].m_sOpn + << config[DEV_MNG_NET_WIRE_MASK].m_sOpn + << config[DEV_MNG_NET_WIRE_GW].m_sOpn + << config[DEV_MNG_NET_WIRE_DNS].m_sOpn; + + IpInputBarDialog dlg(strs, {true, true, false, false}, {false, true, false, false}, parent()->parent()); +#if 0 + dlg.fillRow(0, curNetCfg.cfg.ip); + dlg.fillRow(1, curNetCfg.cfg.mask); + dlg.fillRow(2, curNetCfg.cfg.gw); + dlg.fillRow(3, curNetCfg.cfg.dns); +#endif + if (dlg.exec() == QDialog::Accepted) { + strcpy(netCfg.cfg.ip, dlg.getRow(0).toStdString().c_str()); + strcpy(netCfg.cfg.mask, dlg.getRow(1).toStdString().c_str()); + strcpy(netCfg.cfg.gw, dlg.getRow(2).toStdString().c_str()); + strcpy(netCfg.cfg.dns, dlg.getRow(3).toStdString().c_str()); + + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if (0 == m_backstageIf->setNetWireCfg(netCfg)) { + settingFailed = false; + auto wdgIp = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIRE_IP))); + if (wdgIp != nullptr) { + wdgIp->updateLabel(netCfg.cfg.ip); + } + auto wdgMask = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIRE_MASK))); + if (wdgMask != nullptr) { + wdgMask->updateLabel(netCfg.cfg.mask); + } + auto wdgGw = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIRE_GW))); + if (wdgGw != nullptr) { + wdgGw->updateLabel(netCfg.cfg.gw); + } + auto wdgDns = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIRE_DNS))); + if (wdgDns != nullptr) { + wdgDns->updateLabel(netCfg.cfg.dns); + } + ret = true; + } else { + InfoDialog(tr("设置有线网络失败,请重试!"), parent()->parent()).exec(); + } + } else { + settingFailed = false; + } + }while(settingFailed); + return ret; +} + +void settingUiDevMngNetWire::slotItemClicked(QListWidgetItem* item) +{ + if(nullptr == m_backstageIf){ +#ifndef DEBUG_MODE + return; +#endif + } + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + stNetWire netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWire)); +#ifndef DEBUG_MODE + if(0 == m_backstageIf->getNetWireCfg(netCfg)){ +#endif + switch(row){ + case DEV_MNG_NET_WIRE_SW: + case DEV_MNG_NET_WIRE_DHCP: + { + bool setting_value = false; + QString que; + if(DEV_MNG_NET_WIRE_SW == row){ + setting_value = netCfg.cfg.enable; + que = (setting_value ? tr("您确定要禁用有线网络吗?") : tr("您确定要启用有线网络吗?")); + QuestionDialog dlg(que, parent()->parent()); + if(QDialog::Accepted != dlg.exec()){ + break; + } + setting_value = static_cast(!setting_value); + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if(0 == m_backstageIf->setNetWireEnable(setting_value)){ + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + controlListWidgetItemShow(setting_value, DEV_MNG_NET_WIRE_DHCP); + controlListWidgetItemShow(setting_value ? 0 == netCfg.cfg.type : false, DEV_MNG_NET_WIRE_MAN_CFG); + controlListWidgetItemShow(setting_value, DEV_MNG_NET_WIRE_IP); + controlListWidgetItemShow(setting_value, DEV_MNG_NET_WIRE_MASK); + controlListWidgetItemShow(setting_value, DEV_MNG_NET_WIRE_GW); + controlListWidgetItemShow(setting_value, DEV_MNG_NET_WIRE_DNS); + } + else { + InfoDialog(tr("设置有线网络失败,请重试!"), parent()->parent()).exec(); + } + } + else if(DEV_MNG_NET_WIRE_DHCP == row){ + setting_value = static_cast(netCfg.cfg.type); + que = (setting_value ? tr("您确定要禁用DHCP吗?") : tr("您确定要启用DHCP吗?")); + QuestionDialog dlg(que, parent()->parent()); + if(QDialog::Accepted != dlg.exec()){ + break; + } + if(setting_value){ //is dhcp now, need to input static network config + if(!setStaticNetworkPara(netCfg)){ + break; + } + } + setting_value = static_cast(!setting_value); + int ret = 0; + if(setting_value){ //switch from static to dhcp + netCfg.cfg.type = static_cast(setting_value); + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + ret = m_backstageIf->setNetWireCfg(netCfg); + if(0 == ret){ //refresh + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + myListWidget* wdgIp = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIRE_IP))); + if(wdgIp != nullptr){ + wdgIp->updateLabel(""); + } + myListWidget* wdgMask = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIRE_MASK))); + if(wdgMask != nullptr){ + wdgMask->updateLabel(""); + } + myListWidget* wdgGw = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIRE_GW))); + if(wdgGw != nullptr){ + wdgGw->updateLabel(""); + } + myListWidget* wdgDns = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIRE_DNS))); + if(wdgDns != nullptr){ + wdgDns->updateLabel(""); + } + } + else { + InfoDialog(tr("设置有线网络失败,请重试!"), parent()->parent()).exec(); + } + } + else { + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + } + if(0 == ret){ + controlListWidgetItemShow(!setting_value, DEV_MNG_NET_WIRE_MAN_CFG); + } + } + } + break; + case DEV_MNG_NET_WIRE_MAN_CFG: + setStaticNetworkPara(netCfg); + break; + default: + break; + } +#ifndef DEBUG_MODE + } +#endif +} + + +int settingUiDevMngNetWifi::m_pageIndex = 0; +settingUiDevMngNetWifi::settingUiDevMngNetWifi(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("启用"), "", myListWidget::enPropertySwitch), + SetOpn(tr("AP模式"), "", static_cast(myListWidget::enPropertySwitch | myListWidget::enPropertyIndent1)), + SetOpn(tr("其它网络"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("重新搜索"), "", myListWidget::enPropertyIndent1), + SetOpn(tr("热点密码"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngNetWifi()"; +} + +settingUiDevMngNetWifi::~settingUiDevMngNetWifi() +{ + qDebug() << "~settingUiDevMngNetWifi()"; +} + +void settingUiDevMngNetWifi::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + //reset(); +} + +void settingUiDevMngNetWifi::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + stNetWifi netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWifi)); + if(0 != m_backstageIf->getNetWifiCfg(netCfg)){ + InfoDialog(tr("获取无线网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + switch(i) + { + case DEV_MNG_NET_WIFI_SW: + case DEV_MNG_NET_AP_SW: + { + bool switch_option = false; + if(DEV_MNG_NET_WIFI_SW == i){ + switch_option = netCfg.cfg.enable; + }else if(DEV_MNG_NET_AP_SW == i){ + switch_option = netCfg.enableAp; + } + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + case DEV_MNG_NET_WIFI_ASSIGN: + break; + case DEV_MNG_NET_WIFI_SEARCH: + break; + case DEV_MNG_NET_AP_PWD: + str = netCfg.apPwd; + break; + default: + break; + } + wdt->updateLabel(str); + } + + if(netCfg.cfg.enable){ + if(!netCfg.enableAp){ + wifiSearch(); + } + controlListWidgetItemShow(!netCfg.enableAp, DEV_MNG_NET_WIFI_ASSIGN); + controlListWidgetItemShow(!netCfg.enableAp, DEV_MNG_NET_WIFI_SEARCH); + controlListWidgetItemShow(netCfg.enableAp, DEV_MNG_NET_AP_PWD); + }else{ + clearSsidList(); + controlListWidgetItemShow(false, DEV_MNG_NET_WIFI_ASSIGN); + controlListWidgetItemShow(false, DEV_MNG_NET_WIFI_SEARCH); + controlListWidgetItemShow(false, DEV_MNG_NET_AP_SW); + controlListWidgetItemShow(false, DEV_MNG_NET_AP_PWD); + } + +#if 0 //test + for(int i=0; i<30; i++) + { + QListWidgetItem* pItem = new QListWidgetItem(m_listWidget); + QWidget* wifiListwidget = nullptr; + if(i < 29){ + wifiListwidget = new WifiListWidget(QString("ssid") + QString::number(i), i % 2, 100, m_listWidget); + } + else { + wifiListwidget = new myListWidget(SetOpn(), m_listWidget); + } + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, wifiListwidget); + m_listWidget->setStyleSheet("QListWidget::item{border-top: 1px solid #DFDDEB;}"); + } +#endif +} + +void settingUiDevMngNetWifi::slotUpdateConnectionStatus(QString ssid, bool connected) +{ + qDebug() << "slotUpdateConnectionStatus"; + for(int i=m_ssidPosIndex; icount(); i++){ + WifiListWidget* wifi = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(i))); + if(wifi == nullptr){ + qDebug() << "get WifiListWidget failed!"; + break; + } + if(wifi->getSsid() == ssid){ + qDebug() << "wifi->getSsid():" << wifi->getSsid(); + if(connected){ + wifi->updateStatus(connected); + } + else { + wifi->clearStatus(); + } + } + } +} + +void settingUiDevMngNetWifi::wifiSearch() +{ + clearSsidList(); + //slotShowSsidList(); + + stNetWifi netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWifi)); + if(m_backstageIf){ + if(0 != m_backstageIf->getNetWifiCfg(netCfg)){ + //return; //TODO + } + + const int ssidListSize = 64; + stAccPoint ssidList[ssidListSize]; + MsgDialog msgdlg(tr("搜索中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + + bool isTargetSsidFindable = false; + //bool isSearchRetNotNuLL = false; + int ret = m_backstageIf->getSsidList(ssidList, ssidListSize); + if (ret > 0) { + for(int i=0; isetSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, wifiListwidget); + //m_listWidget->setStyleSheet("QListWidget::item{border-top: 1px solid #DFDDEB;}"); + if(QString(ssidList[i].ssid) == netCfg.ssid){ + isTargetSsidFindable = true; + if (netCfg.isConnected) ((WifiListWidget *)wifiListwidget)->updateStatus(netCfg.isConnected); + } + } + } + if(!isTargetSsidFindable && netCfg.isConnected){ //if target ssid is not findable but connected, show it + QListWidgetItem* pItem = new QListWidgetItem(); + QWidget* wifiListwidget = new WifiListWidget(netCfg.ssid, netCfg.isConnected, "none" != QString(netCfg.encType), -1, true, m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, wifiListwidget); + //m_listWidget->setStyleSheet("QListWidget::item{border-top: 1px solid #DFDDEB;}"); + m_listWidget->insertItem(m_ssidPosIndex, pItem); + } + } +} + +//void settingUiDevMngNetWifi::showSsidList() +//{ +//} + +void settingUiDevMngNetWifi::slotItemClicked(QListWidgetItem* item) +{ + if(nullptr == m_backstageIf){ + return; + } + int row = m_listWidget->currentRow(); + + switch(row){ + case DEV_MNG_NET_WIFI_SW: + case DEV_MNG_NET_AP_SW: + { + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + qDebug() << "get myListWidget failed!"; + return; + } + stNetWifi netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWifi)); + if(0 != m_backstageIf->getNetWifiCfg(netCfg)){ + InfoDialog(tr("获取无线网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + + if(DEV_MNG_NET_WIFI_SW == row){ + bool setting_value = netCfg.cfg.enable; + QString que = (setting_value ? tr("您确定要禁用无线网络吗?") : tr("您确定要启用无线网络吗?")); + QuestionDialog dlg(que, parent()->parent()); + if(QDialog::Accepted != dlg.exec()){ + break; + } + + setting_value = static_cast(!setting_value); + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if(0 == m_backstageIf->setNetWifiEnable(setting_value)){ + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + if(setting_value){ + controlListWidgetItemShow(!netCfg.enableAp, DEV_MNG_NET_WIFI_ASSIGN); + controlListWidgetItemShow(!netCfg.enableAp, DEV_MNG_NET_WIFI_SEARCH); + controlListWidgetItemShow(netCfg.enableAp, DEV_MNG_NET_AP_SW); + controlListWidgetItemShow(netCfg.enableAp, DEV_MNG_NET_AP_PWD); + if(!netCfg.enableAp){ + wifiSearch(); + } + }else { + controlListWidgetItemShow(false, DEV_MNG_NET_WIFI_ASSIGN); + controlListWidgetItemShow(false, DEV_MNG_NET_WIFI_SEARCH); + controlListWidgetItemShow(false, DEV_MNG_NET_AP_SW); + controlListWidgetItemShow(false, DEV_MNG_NET_AP_PWD); + clearSsidList(); + } + }else { + InfoDialog(tr("设置无线网络失败,请重试!"), parent()->parent()).exec(); + } + }else if(DEV_MNG_NET_AP_SW == row){ + bool setting_value = netCfg.enableAp; + QString que = (setting_value ? tr("您确定要关闭AP模式吗?") : tr("您确定要启用AP模式吗?")); + QuestionDialog dlg(que, parent()->parent()); + if(QDialog::Accepted != dlg.exec()){ + break; + } + setting_value = static_cast(!setting_value); + if(setting_value && strlen(netCfg.apPwd) == 0){ + do{ + LineEditInputDialog dlg(tr("热点密码"), parent()->parent()); + if(dlg.exec() == QDialog::Accepted){ + const QString strInput = dlg.getRow(0); + if(strInput.length() >= 8 && strInput.length() <= 16){ + snprintf(netCfg.apPwd, sizeof(netCfg.apPwd), strInput.toStdString().c_str()); + break; + }else{ + InfoDialog(tr("密码长度为8-16位字符!"), parent()->parent()).exec(); + } + }else{ + return; + } + }while(true); + } + netCfg.enableAp = setting_value; + netCfg.isAPCfg = true; + if(0 == m_backstageIf->setNetWifiCfg(netCfg)){ + if(netCfg.enableAp){ + clearSsidList(); + } + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + controlListWidgetItemShow(!netCfg.enableAp, DEV_MNG_NET_WIFI_ASSIGN); + controlListWidgetItemShow(!netCfg.enableAp, DEV_MNG_NET_WIFI_SEARCH); + auto wdgIp = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_AP_PWD))); + if (wdgIp != nullptr) { + wdgIp->updateLabel(netCfg.apPwd); + } + controlListWidgetItemShow(netCfg.enableAp, DEV_MNG_NET_AP_PWD); + InfoDialog(tr("设置成功!"), parent()->parent()).exec(); + }else { + InfoDialog(tr("设置失败,请重试!"), parent()->parent()).exec(); + } + } + } + break; + case DEV_MNG_NET_WIFI_ASSIGN: + { + WifiAccPointDialog accPointDlg(parent()->parent()); + //accPointDlg.fillRow(0, "RW-5F"); //TODO debug + //accPointDlg.fillRow(1, "RW@sz=B103#"); + if(accPointDlg.exec() == QDialog::Accepted) + { +#ifndef DEBUG_MODE + stNetWifi netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWifi)); + if(0 != m_backstageIf->getNetWifiCfg(netCfg)){ + InfoDialog(tr("获取无线网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + netCfg.cfg.type = 1; + snprintf(netCfg.ssid, sizeof (netCfg.ssid), accPointDlg.getRow(0).toStdString().c_str()); + snprintf(netCfg.encType, sizeof (netCfg.encType), accPointDlg.getEncType().toStdString().c_str()); + snprintf(netCfg.pwd, sizeof (netCfg.pwd), accPointDlg.getRow(1).toStdString().c_str()); + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if(0 == m_backstageIf->setNetWifiCfg(netCfg)){ + //InfoDialog(tr("设置成功!"), parent()->parent()).exec(); + bool updateSsidList = false; + do{ + stNetWire netWireCfg; + memset(reinterpret_cast(&netWireCfg), 0, sizeof(stNetWire)); + if(0 != m_backstageIf->getNetWireCfg(netWireCfg)){ + break; + } + if(!netWireCfg.cfg.enable){ + updateSsidList = true; + break; + } + QuestionDialog dlg(tr("无线网络连接成功,是否禁用有线网络?"), parent()->parent()); + if(QDialog::Accepted == dlg.exec()){ + if(0 == m_backstageIf->setNetWireEnable(false)){ + updateSsidList = true; + }else{ + InfoDialog(tr("禁用有线网络失败,请重试!"), parent()->parent()).exec(); + } + } + }while(0); + if(updateSsidList){ + clearSsidList(); + QListWidgetItem* pItem = new QListWidgetItem(m_listWidget); + QWidget* wifiListwidget = new WifiListWidget(netCfg.ssid, true, "none" != QString(netCfg.encType), -1, true, m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, wifiListwidget); + } + }else { + InfoDialog(tr("设置无线网络失败,请重试!"), parent()->parent()).exec(); + } +#endif + } + } + break; + case DEV_MNG_NET_WIFI_SEARCH: + wifiSearch(); + break; + case DEV_MNG_NET_AP_PWD:{ + stNetWifi netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWifi)); + if(0 != m_backstageIf->getNetWifiCfg(netCfg)){ + InfoDialog(tr("获取无线网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + do{ + LineEditInputDialog dlg(tr("热点密码"), parent()->parent()); + if(dlg.exec() == QDialog::Accepted){ + const QString strInput = dlg.getRow(0); + if(strInput.length() >= 8 && strInput.length() <= 16){ + snprintf(netCfg.apPwd, sizeof(netCfg.apPwd), strInput.toStdString().c_str()); + break; + }else{ + InfoDialog(tr("密码长度为8-16位字符!"), parent()->parent()).exec(); + } + }else{ + return; + } + }while(true); + if(0 == m_backstageIf->setNetWifiCfg(netCfg)){ + auto wdgIp = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_AP_PWD))); + if (wdgIp != nullptr) { + wdgIp->updateLabel(netCfg.apPwd); + } + InfoDialog(tr("设置成功!"), parent()->parent()).exec(); + }else { + InfoDialog(tr("设置失败,请重试!"), parent()->parent()).exec(); + } + }break; + default: + if(row >= m_ssidPosIndex && row < m_listWidget->count()){ + WifiListWidget* wifiWdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wifiWdt == nullptr){ + qDebug() << "get WifiListWidget failed!"; + return; + } + if(wifiWdt->isConnected() || wifiWdt->isTargetNet()){ + emit signalShowPage(settingUiDevMngNetWifiAccPoint::m_pageIndex, wifiWdt->getSsid()); + } + else { + stNetWifi netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWifi)); + if(wifiWdt->getLockStatus()){ + PasswordDialog pwd_check(wifiWdt->getSsid(), tr("请输入密码"), UiConfig::NO_OPERATION_OVERTIME_RETURN * 1000, parent()->parent()); //TODO, "RW@sz=B103#" + int ret = pwd_check.exec(); + if(QDialog::Accepted == ret){ + if(m_backstageIf){ + if(0 != m_backstageIf->getNetWifiCfg(netCfg)){ + InfoDialog(tr("获取无线网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + netCfg.cfg.type = 1; + snprintf(netCfg.encType, sizeof (netCfg.encType), "wpa"); + snprintf(netCfg.ssid, sizeof (netCfg.ssid), wifiWdt->getSsid().toStdString().c_str()); + snprintf(netCfg.pwd, sizeof (netCfg.pwd), pwd_check.getPwd().toStdString().c_str()); + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if(0 == m_backstageIf->setNetWifiCfg(netCfg)){ + //InfoDialog(tr("连接成功!"), parent()->parent()).exec(); + bool updateConnectionFlag = false; + do{ + stNetWire netWireCfg; + memset(reinterpret_cast(&netWireCfg), 0, sizeof(stNetWire)); + if(0 != m_backstageIf->getNetWireCfg(netWireCfg)){ + break; + } + if(!netWireCfg.cfg.enable){ + updateConnectionFlag = true; + break; + } + QuestionDialog dlg(tr("无线网络连接成功,是否禁用有线网络?"), parent()->parent()); + if(QDialog::Accepted == dlg.exec()){ + if(0 == m_backstageIf->setNetWireEnable(false)){ + updateConnectionFlag = true; + } + else{ + InfoDialog(tr("禁用有线网络失败,请重试!"), parent()->parent()).exec(); + } + } + } + while(0); + if(updateConnectionFlag){ + //clean connected wifi flag + for (int i = m_ssidPosIndex; i < m_listWidget->count(); i++) { + WifiListWidget* wifi = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(i))); + if(wifi == nullptr){ + qDebug() << "get WifiListWidget failed!"; + break; + } + if(wifi->isConnected() || wifi->isTargetNet()){ + wifi->clearStatus(); + } + } + wifiWdt->updateStatus(true); + } + } + else { + InfoDialog(tr("连接无线网络失败,请重试!"), parent()->parent()).exec(); + } + } + } + } + else { + netCfg.cfg.enable = true; + netCfg.cfg.type = 1; + snprintf(netCfg.ssid, sizeof (netCfg.ssid), wifiWdt->getSsid().toStdString().c_str()); + snprintf(netCfg.encType, sizeof (netCfg.encType), "none"); + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if(0 == m_backstageIf->setNetWifiCfg(netCfg)){ + InfoDialog(tr("连接成功!"), parent()->parent()).exec(); + } + else { + InfoDialog(tr("连接无线网络失败,请重试!"), parent()->parent()).exec(); + } + } + } + } + break; + } +} + +//void settingUiDevMngNetWifi::slotShowSsidList() +//{ + //showSsidList(); +//} + +void settingUiDevMngNetWifi::clearSsidList() +{ + int itemQty = m_listWidget->count(); + qDebug() << "clearSsidList itemQty:" << itemQty; + for(int i=0; itakeItem(m_ssidPosIndex); + delete pItem; + } +} + +int settingUiDevMngNetWifiAccPoint::m_pageIndex = 0; +settingUiDevMngNetWifiAccPoint::settingUiDevMngNetWifiAccPoint(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("连接此网络"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("忽略此网络"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("自动获取"), "", myListWidget::enPropertySwitch), + SetOpn(tr("手动配置"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("设备IP"), "xxx.xxx.xxx.xxx", myListWidget::enPropertyNull), + SetOpn(tr("子网掩码"), "xxx.xxx.xxx.xxx", myListWidget::enPropertyNull), + SetOpn(tr("设备网关"), "xxx.xxx.xxx.xxx", myListWidget::enPropertyNull), + SetOpn(tr("DNS服务器"), "xxx.xxx.xxx.xxx", myListWidget::enPropertyNull) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngNetWifiAccPoint()"; +} + +settingUiDevMngNetWifiAccPoint::~settingUiDevMngNetWifiAccPoint() +{ + qDebug() << "~settingUiDevMngNetWifiAccPoint()"; +} + +void settingUiDevMngNetWifiAccPoint::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + //reset(); +} + +void settingUiDevMngNetWifiAccPoint::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + stNetWifi netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWifi)); + if(0 != m_backstageIf->getNetWifiCfg(netCfg)){ + InfoDialog(tr("获取无线网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + switch(i) + { + case DEV_MNG_NET_WIFI_AP_CONNECT: + break; + case DEV_MNG_NET_WIFI_AP_FORGET: + break; + + case DEV_MNG_NET_WIFI_AP_DHCP: + { + bool switch_option = false; + if(DEV_MNG_NET_WIFI_AP_DHCP == i){ + switch_option = netCfg.cfg.type; + } + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + case DEV_MNG_NET_WIFI_AP_MAN_CFG: + break; + case DEV_MNG_NET_WIFI_AP_IP: + str = netCfg.cfg.ip; + break; + case DEV_MNG_NET_WIFI_AP_MASK: + str = netCfg.cfg.mask; + break; + case DEV_MNG_NET_WIFI_AP_GW: + str = netCfg.cfg.gw; + break; + case DEV_MNG_NET_WIFI_AP_DNS: + str = netCfg.cfg.dns; + break; + default: + break; + } + wdt->updateLabel(str); + } + controlListWidgetItemShow(!netCfg.isConnected, DEV_MNG_NET_WIFI_AP_CONNECT); + controlListWidgetItemShow(!netCfg.cfg.type, DEV_MNG_NET_WIFI_AP_MAN_CFG); +} + +bool settingUiDevMngNetWifiAccPoint::setStaticNetworkPara(const stNetWifi& curNetCfg) +{ + stNetWifi netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWifi)); +#if 1 + if(0 != m_backstageIf->getNetWifiCfg(netCfg)){ + InfoDialog(tr("获取无线网络配置失败,请重试!"), parent()->parent()).exec(); + return false; + } +#else + netCfg.cfg.enable = true; +#endif + netCfg.cfg.type = 0; + + bool ret = false; + bool settingFailed = true; + do{ + QStringList strs; + strs << config[DEV_MNG_NET_WIFI_AP_IP].m_sOpn + << config[DEV_MNG_NET_WIFI_AP_MASK].m_sOpn + << config[DEV_MNG_NET_WIFI_AP_GW].m_sOpn + << config[DEV_MNG_NET_WIFI_AP_DNS].m_sOpn; + + IpInputBarDialog dlg(strs, {true, true, false, false}, {false, true, false, false}, parent()->parent()); +#if 0 + dlg.fillRow(0, curNetCfg.cfg.ip); + dlg.fillRow(1, curNetCfg.cfg.mask); + dlg.fillRow(2, curNetCfg.cfg.gw); + dlg.fillRow(3, curNetCfg.cfg.dns); +#endif + if (dlg.exec() == QDialog::Accepted) { +#if 0 + int i = 0; + for(i=0; i<4; i++){ + if(i <= 1 && "" == dlg.getRow(i)){ + InfoDialog(0 == i ? tr("IP设置不能为空!") : tr("子网掩码设置不能为空!"), parent()->parent()).exec(); + break; + } + } +#endif + strcpy(netCfg.cfg.ip, dlg.getRow(0).toStdString().c_str()); + strcpy(netCfg.cfg.mask, dlg.getRow(1).toStdString().c_str()); + strcpy(netCfg.cfg.gw, dlg.getRow(2).toStdString().c_str()); + strcpy(netCfg.cfg.dns, dlg.getRow(3).toStdString().c_str()); + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if (0 == m_backstageIf->setNetWifiCfg(netCfg)) { + settingFailed = false; + auto wdgIp = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIFI_AP_IP))); + if (wdgIp != nullptr) { + wdgIp->updateLabel(netCfg.cfg.ip); + } + auto wdgMask = + dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIFI_AP_MASK))); + if (wdgMask != nullptr) { + wdgMask->updateLabel(netCfg.cfg.mask); + } + auto wdgGw = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIFI_AP_GW))); + if (wdgGw != nullptr) { + wdgGw->updateLabel(netCfg.cfg.gw); + } + auto wdgDns = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIFI_AP_DNS))); + if (wdgDns != nullptr) { + wdgDns->updateLabel(netCfg.cfg.dns); + } + ret = true; + } else { + InfoDialog(tr("设置无线网络失败,请重试!"), parent()->parent()).exec(); + } + } else { + settingFailed = false; + } + }while(settingFailed); + return ret; +} + +void settingUiDevMngNetWifiAccPoint::slotItemClicked(QListWidgetItem* item) +{ + if(nullptr == m_backstageIf){ +#ifndef DEBUG_MODE + return; +#endif + } + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + stNetWifi netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNetWifi)); +#ifndef DEBUG_MODE + if(0 != m_backstageIf->getNetWifiCfg(netCfg)){ + InfoDialog(tr("获取无线网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } +#endif + switch(row){ + case DEV_MNG_NET_WIFI_AP_CONNECT: + { + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if(0 == m_backstageIf->setNetWifiCfg(netCfg)){ + stNetWire netWireCfg; + memset(reinterpret_cast(&netWireCfg), 0, sizeof(stNetWire)); + if(0 != m_backstageIf->getNetWireCfg(netWireCfg)){ + break; + } + if(!netWireCfg.cfg.enable){ + emit signalUpdateConnectionStatus(netCfg.ssid, true); + break; + } + QuestionDialog dlg(tr("无线网络连接成功,是否禁用有线网络?"), parent()->parent()); + if(QDialog::Accepted == dlg.exec()){ + if(0 == m_backstageIf->setNetWireEnable(false)){ + controlListWidgetItemShow(false, DEV_MNG_NET_WIFI_AP_CONNECT); + emit signalUpdateConnectionStatus(netCfg.ssid, true); + } + else{ + InfoDialog(tr("禁用有线网络失败,请重试!"), parent()->parent()).exec(); + } + } + } + else { + InfoDialog(tr("连接无线网络失败,请重试!"), parent()->parent()).exec(); + } + } + break; + case DEV_MNG_NET_WIFI_AP_FORGET: + { +#ifndef DEBUG_MODE + QuestionDialog dlg(tr("您确定要忽略此网络吗?"), parent()->parent()); + if(QDialog::Accepted != dlg.exec()){ + break; + } + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if(0 == m_backstageIf->claerNetWifiCfg()){ + //InfoDialog(tr("设置成功!"), parent()->parent()).exec(); + emit signalUpdateConnectionStatus(netCfg.ssid, false); + emit signalReturn(); + } + else { + InfoDialog(tr("设置无线网络失败,请重试!"), parent()->parent()).exec(); + } +#endif + } + break; + case DEV_MNG_NET_WIFI_AP_DHCP: + { + bool setting_value = false; + QString que; +#ifndef DEBUG_MODE + if(DEV_MNG_NET_WIFI_AP_DHCP == row){ + setting_value = static_cast(netCfg.cfg.type); + que = (setting_value ? tr("您确定要关闭自动获取吗?") : tr("您确定要打开自动获取吗?")); + QuestionDialog dlg(que, parent()->parent()); + if(QDialog::Accepted != dlg.exec()){ + break; + } + if(setting_value){ //is dhcp now, need to input static network config + if(!setStaticNetworkPara(netCfg)){ + break; + } + } + } +#endif + setting_value = static_cast(!setting_value); +#ifndef DEBUG_MODE + if(DEV_MNG_NET_WIFI_AP_DHCP == row){ + int ret = 0; + if(setting_value){ //switch from static to dhcp + netCfg.cfg.type = static_cast(setting_value); + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + ret = m_backstageIf->setNetWifiCfg(netCfg); + if(0 == ret){ //refresh + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + myListWidget* wdgIp = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIFI_AP_IP))); + if(wdgIp != nullptr){ + wdgIp->updateLabel(""); + } + myListWidget* wdgMask = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIFI_AP_MASK))); + if(wdgMask != nullptr){ + wdgMask->updateLabel(""); + } + myListWidget* wdgGw = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIFI_AP_GW))); + if(wdgGw != nullptr){ + wdgGw->updateLabel(""); + } + myListWidget* wdgDns = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_WIFI_AP_DNS))); + if(wdgDns != nullptr){ + wdgDns->updateLabel(""); + } + } + else { + InfoDialog(tr("设置无线网络失败,请重试!"), parent()->parent()).exec(); + } + } + else { + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + } + if(0 == ret){ + if(setting_value){ + controlListWidgetItemShow(false, DEV_MNG_NET_WIFI_AP_MAN_CFG); + } + else { + controlListWidgetItemShow(true, DEV_MNG_NET_WIFI_AP_MAN_CFG); + } + } + } +#endif + } + break; + + case DEV_MNG_NET_WIFI_AP_MAN_CFG: + setStaticNetworkPara(netCfg); + break; + default: + break; + } +} + + +int settingUiDevMngNet4G::m_pageIndex = 0; +settingUiDevMngNet4G::settingUiDevMngNet4G(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("启用"), "", myListWidget::enPropertySwitch), + SetOpn(tr("SIM卡信息"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("重启4G网络"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1 | myListWidget::enPropertyRedWord)) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngNet4G()"; +} + +settingUiDevMngNet4G::~settingUiDevMngNet4G() +{ + qDebug() << "~settingUiDevMngNet4G()"; +} + +void settingUiDevMngNet4G::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + //reset(); +} + +void settingUiDevMngNet4G::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + stNet4G netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNet4G)); + if(0 != m_backstageIf->getNet4GCfg(netCfg)){ + InfoDialog(tr("获取4G网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + switch(i) + { + case DEV_MNG_NET_4G_SW: + { + bool switch_option = false; + if(DEV_MNG_NET_4G_SW == i){ + switch_option = netCfg.enable; + } + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + case DEV_MNG_NET_4G_PROVIDER: + if(netCfg.provider < net4GProvider.size()){ + str = net4GProvider[netCfg.provider]; + } + break; + case DEV_MNG_NET_4G_REBOOT: + break; + default: + break; + } + wdt->updateLabel(str); + } + + controlListWidgetItemShow(netCfg.enable, DEV_MNG_NET_4G_PROVIDER); + controlListWidgetItemShow(netCfg.enable, DEV_MNG_NET_4G_REBOOT); +} + +void settingUiDevMngNet4G::slotItemClicked(QListWidgetItem* item) +{ + if(nullptr == m_backstageIf){ +#ifndef DEBUG_MODE + return; +#endif + } + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + stNet4G netCfg; + memset(reinterpret_cast(&netCfg), 0, sizeof(stNet4G)); + if(0 != m_backstageIf->getNet4GCfg(netCfg)){ + InfoDialog(tr("获取4G网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + switch(row){ + case DEV_MNG_NET_4G_SW: + { + bool setting_value = false; + QString que; + if(DEV_MNG_NET_4G_SW == row){ + setting_value = netCfg.enable; + que = (setting_value ? tr("您确定要禁用4G网络吗?") : tr("您确定要启用4G网络吗?")); + QuestionDialog dlg(que, parent()->parent()); + if(QDialog::Accepted != dlg.exec()){ + break; + } + setting_value = static_cast(!setting_value); + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if(0 == m_backstageIf->setNet4GEnable(setting_value)){ + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + controlListWidgetItemShow(setting_value, DEV_MNG_NET_4G_PROVIDER); + controlListWidgetItemShow(setting_value, DEV_MNG_NET_4G_REBOOT); + if(setting_value){ + if(0 == m_backstageIf->getNet4GCfg(netCfg)){ + myListWidget* wdtProvider = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(DEV_MNG_NET_4G_PROVIDER))); + if(nullptr == wdtProvider){ + return; + } + QString provider; + if(netCfg.provider < net4GProvider.size()){ + provider = net4GProvider[netCfg.provider]; + } + wdtProvider->updateLabel(provider); + } + else{ + InfoDialog(tr("获取4G网络配置失败,请重试!"), parent()->parent()).exec(); + return; + } + } + } + else { + InfoDialog(tr("设置4G网络失败,请重试!"), parent()->parent()).exec(); + } + } + } + break; + + case DEV_MNG_NET_4G_PROVIDER: + break; + + case DEV_MNG_NET_4G_REBOOT: + { +#ifndef DEBUG_MODE + QuestionDialog dlg(tr("您确定要重启4G网络吗?"), parent()->parent()); + if(QDialog::Accepted != dlg.exec()){ + break; + } + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + if(0 == m_backstageIf->reboot4G()){ + InfoDialog(tr("重启成功!"), parent()->parent()).exec(); + } + else { + InfoDialog(tr("重启4G网络失败,请重试!"), parent()->parent()).exec(); + } +#endif + } + break; + default: + break; + } +} + + +int settingUiDevMngBt::m_pageIndex = 0; +settingUiDevMngBt::settingUiDevMngBt(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("启用"), "", myListWidget::enPropertySwitch), + SetOpn(tr("蓝牙音箱"), "bt speaker", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("蓝牙门锁"), "bt lock", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngBt()"; +} + +void settingUiDevMngBt::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; +} + +void settingUiDevMngBt::reset() +{ + BluetoothStat_t bluetoothStat; + m_backstageIf->getBtAllInfo(bluetoothStat); + + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + switch(i) + { + case DEV_MNG_BT_ENABLE: + wdt->updateIcon(bluetoothStat.isEnable ? ":/res/image/on.png" : ":/res/image/off.png"); + break; + case DEV_MNG_BT_SPK: + break; + case DEV_MNG_BT_LOCK: + break; + default: + break; + } + wdt->updateLabel(str); + } + + controlListWidgetItemShow(bluetoothStat.isEnable, DEV_MNG_BT_SPK); + controlListWidgetItemShow(bluetoothStat.isEnable, DEV_MNG_BT_LOCK); +} + +void settingUiDevMngBt::slotItemClicked(QListWidgetItem* item) +{ + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + switch(row){ + case DEV_MNG_BT_ENABLE: + { + MsgDialog msgdlg0(tr("处理中,请稍候..."), parent()->parent()); + msgdlg0.show(); + QCoreApplication::processEvents(); + + BluetoothStat_t bluetoothStat; + m_backstageIf->getBtAllInfo(bluetoothStat); + bool setting_value = bluetoothStat.isEnable; + setting_value = static_cast(!setting_value); + + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + m_backstageIf->btSetSwitch(setting_value); + controlListWidgetItemShow(setting_value, DEV_MNG_BT_SPK); + controlListWidgetItemShow(setting_value, DEV_MNG_BT_LOCK); + } + break; + case DEV_MNG_BT_SPK: + emit signalShowPage(settingUiDevMngBtSpk::m_pageIndex); + break; + case DEV_MNG_BT_LOCK: + emit signalShowPage(settingUiDevMngBtLock::m_pageIndex); + break; + default: + break; + } +} + + +int settingUiDevMngBtSpk::m_pageIndex = 0; +settingUiDevMngBtSpk::settingUiDevMngBtSpk(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + //SetOpn(tr("启用"), "", myListWidget::enPropertySwitch), + SetOpn(tr("设备名称"), "Bluetooth-cai", static_cast(myListWidget::enPropertyMoreArrow)), + SetOpn(tr("已配对设备"), "", myListWidget::enPropertyNull), + SetOpn(tr("可用设备"), "", myListWidget::enPropertyNull) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngBtSpk()"; + m_pairedItemCnt = 0; + m_availdItemCnt = 0; + m_btDevName = "Bluetooth"; + m_btIsEnable = false; + + QListWidgetItem* pItem; + myListWidget* wdt; + pItem = m_listWidget->item(DEV_MNG_BULETOOTH_AVAILABLE_DEV); + wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + wdt->updateIcon(":/res/image/refresh_large.png", 40, 40); + +} + +settingUiDevMngBtSpk::~settingUiDevMngBtSpk() +{ + qDebug() << "~settingUiDevMngBtSpk()"; +} + +void settingUiDevMngBtSpk::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; +} + +void settingUiDevMngBtSpk::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + + BluetoothStat_t bluetoothStat; + m_backstageIf->getBtAllInfo(bluetoothStat); + m_btDevName = bluetoothStat.devName; + m_btIsEnable = bluetoothStat.isEnable; + //m_btPairedList = bluetoothStat.pairedDev; + //m_btAvailList = bluetoothStat.availableDev; + + //bool isBluetoothEnable = m_backstageIf->getParamBluetoothEnable(); + QListWidgetItem* pItem; + myListWidget* wdt; +#if 0 + pItem = m_listWidget->item(DEV_MNG_BULETOOTH_ENABLE); + wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + wdt->updateIcon(m_btIsEnable ? ":/res/image/on.png" : ":/res/image/off.png"); +#endif + + //set name text + pItem = m_listWidget->item(DEV_MNG_BULETOOTH_DEVNAME); + wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + wdt->updateLabel(QString::fromStdString(m_btDevName)); + + if(1) //m_btIsEnable + { + //1.show fixed item + controlListWidgetItemShow(true, DEV_MNG_BULETOOTH_DEVNAME); + controlListWidgetItemShow(true, DEV_MNG_BULETOOTH_HISTORY_DEV); + controlListWidgetItemShow(true, DEV_MNG_BULETOOTH_AVAILABLE_DEV + m_pairedItemCnt); + //2.reset item + resetPaireItem(bluetoothStat.pairedDev); + QCoreApplication::processEvents();//提前处理ui + //下面的操作耗时,增加提示 + MsgDialog msgdlg(tr("搜索中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents();//处理qt事件,刷新ui +// list btAvailList; +// m_backstageIf->btScan(btAvailList); + resetAvailItem(bluetoothStat.availableDev/*btAvailList*/); + }else + { + //1.clear item + clearPaireItem(); + clearAvailItem(); + //2.hide fixed item + controlListWidgetItemShow(false, DEV_MNG_BULETOOTH_DEVNAME); + controlListWidgetItemShow(false, DEV_MNG_BULETOOTH_HISTORY_DEV); + controlListWidgetItemShow(false, DEV_MNG_BULETOOTH_AVAILABLE_DEV + m_pairedItemCnt); + } +} + +void settingUiDevMngBtSpk::clearPaireItem() +{ + for(int i=0; iitem(DEV_MNG_BULETOOTH_HISTORY_DEV + 1); + BtListWidget *wdt = dynamic_cast(m_listWidget->itemWidget(pItem2)); + BluetoothDev_t btDev; + wdt->getDevInfo(btDev); + LOGD("m_pairedItemCnt=%d: %s, %s, %d", m_pairedItemCnt, btDev.id.c_str(), btDev.name.c_str(), btDev.devStat); +#endif + QListWidgetItem* pItem = m_listWidget->takeItem(DEV_MNG_BULETOOTH_HISTORY_DEV + 1); + delete pItem; + } + m_pairedItemCnt = 0; +} + +void settingUiDevMngBtSpk::clearAvailItem() +{ + for(int i=0; itakeItem(DEV_MNG_BULETOOTH_AVAILABLE_DEV + 1 + m_pairedItemCnt); + delete pItem; + } + + m_availdItemCnt = 0; +} + +void settingUiDevMngBtSpk::addPairedItem(BluetoothDev_t &btDev) +{ + QListWidgetItem* pItem = new QListWidgetItem(); + BtListWidget* btListwidget = new BtListWidget(btDev/*, true*/); + connect(btListwidget, SIGNAL(signalClickSet(BluetoothDev_t)), this, SLOT(slotBtDevSet(BluetoothDev_t))); + + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->insertItem(m_pairedItemCnt + DEV_MNG_BULETOOTH_HISTORY_DEV + 1, pItem); + m_listWidget->setItemWidget(pItem, btListwidget); + m_pairedItemCnt++; + + LOGD("m_pairedItemCnt=%d: %s, %s, %d", m_pairedItemCnt, btDev.id.c_str(), btDev.name.c_str(), btDev.devStat); +} + +void settingUiDevMngBtSpk::addPairedItem(BtListWidget *pBtListWidget) +{ + QListWidgetItem* pItem = new QListWidgetItem(); + connect(pBtListWidget, SIGNAL(signalClickSet(BluetoothDev_t)), this, SLOT(slotBtDevSet(BluetoothDev_t))); + + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->insertItem(m_pairedItemCnt + DEV_MNG_BULETOOTH_HISTORY_DEV + 1, pItem); + m_listWidget->setItemWidget(pItem, pBtListWidget); + m_pairedItemCnt++; +} + +void settingUiDevMngBtSpk::addPairedItem(list &btDevList) +{ + for(auto it = btDevList.begin(); it!=btDevList.end(); it++) + { + addPairedItem(*it); + } +} + +void settingUiDevMngBtSpk::addAvailItem(BluetoothDev_t &btDev) +{ + QListWidgetItem* pItem = new QListWidgetItem(); + BtListWidget* btListwidget = new BtListWidget(btDev/*, false*/); + + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->insertItem(m_availdItemCnt + DEV_MNG_BULETOOTH_AVAILABLE_DEV + 1 + m_pairedItemCnt, pItem); + m_listWidget->setItemWidget(pItem, btListwidget); + m_availdItemCnt++; + //LOGD("m_availdItemCnt=%d: %s, %s, %d", m_availdItemCnt, btDev.id.c_str(), btDev.name.c_str(), btDev.devStat); +} + +void settingUiDevMngBtSpk::addAvailItem(BtListWidget *pBtListWidget) +{ + QListWidgetItem* pItem = new QListWidgetItem(); + + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->insertItem(m_availdItemCnt + DEV_MNG_BULETOOTH_AVAILABLE_DEV + 1 + m_pairedItemCnt, pItem); + m_listWidget->setItemWidget(pItem, pBtListWidget); + m_availdItemCnt++; +} + +void settingUiDevMngBtSpk::addAvailItem(list &btDevList) +{ + for(auto it = btDevList.begin(); it!=btDevList.end(); it++) + { + addAvailItem(*it); + } +} + +int settingUiDevMngBtSpk::deletePairedItem(int row) +{ + if(row > DEV_MNG_BULETOOTH_HISTORY_DEV && + row <= DEV_MNG_BULETOOTH_HISTORY_DEV + m_pairedItemCnt) + { + QListWidgetItem* pItem = m_listWidget->takeItem(row); + delete pItem; + m_pairedItemCnt--; + return 0; + }else + { + return -1; + } +} + +int settingUiDevMngBtSpk::deleteAvaidItem(int row) +{ + if(row > DEV_MNG_BULETOOTH_AVAILABLE_DEV + m_pairedItemCnt && + row <= DEV_MNG_BULETOOTH_AVAILABLE_DEV + m_pairedItemCnt + m_availdItemCnt) + { + QListWidgetItem* pItem = m_listWidget->takeItem(row); + delete pItem; + m_availdItemCnt--; + return 0; + }else + { + return -1; + } + +} + +void settingUiDevMngBtSpk::resetPaireItem(list &btDevList) +{ + //1.clear old item + clearPaireItem(); + + //2.add item + addPairedItem(btDevList); +} + +void settingUiDevMngBtSpk::resetAvailItem(list &btDevList) +{ + //1.clear old item + clearAvailItem(); + + //2.add item + addAvailItem(btDevList); +} + +void settingUiDevMngBtSpk::slotItemClicked(QListWidgetItem * item) +{ + if(nullptr == m_backstageIf){ + return; + } + + int row = m_listWidget->currentRow(); + LOGD("slotItemClicked: row=%d", row); + +#if 0 + if(row == DEV_MNG_BULETOOTH_ENABLE) + { + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + + m_btIsEnable = !m_btIsEnable; + wdt->updateIcon(m_btIsEnable ? ":/res/image/on.png" : ":/res/image/off.png"); + + //下面的操作耗时,增加提示 + MsgDialog msgdlg0(tr("处理中,请稍候..."), parent()->parent()); + msgdlg0.show(); + QCoreApplication::processEvents();//处理qt事件,刷新ui + + m_backstageIf->btSetSwitch(m_btIsEnable); + if(m_btIsEnable) + { + //1.get bt info + BluetoothStat_t bluetoothStat; + m_backstageIf->getBtAllInfo(bluetoothStat); + m_btDevName = bluetoothStat.devName; + + //2.set name text + QListWidgetItem* pItem_name = m_listWidget->item(DEV_MNG_BULETOOTH_DEVNAME);; + myListWidget* pWidget_name = dynamic_cast(m_listWidget->itemWidget(pItem_name)); + pWidget_name->updateLabel(QString::fromStdString(m_btDevName)); + + //3.show fixed item + controlListWidgetItemShow(true, DEV_MNG_BULETOOTH_DEVNAME); + controlListWidgetItemShow(true, DEV_MNG_BULETOOTH_HISTORY_DEV); + controlListWidgetItemShow(true, DEV_MNG_BULETOOTH_AVAILABLE_DEV + m_pairedItemCnt); + + //4.reset item + resetPaireItem(bluetoothStat.pairedDev); + QCoreApplication::processEvents();//提前处理ui + + //下面的操作耗时,增加提示 + MsgDialog msgdlg1(tr("搜索中,请稍候..."), parent()->parent()); + msgdlg1.show(); + QCoreApplication::processEvents();//处理qt事件,刷新ui +// list btAvailList; +// m_backstageIf->btScan(btAvailList); + resetAvailItem(bluetoothStat.availableDev); + }else + { + //1.clear item + clearPaireItem(); + clearAvailItem(); + //2.show fixed item + controlListWidgetItemShow(false, DEV_MNG_BULETOOTH_DEVNAME); + controlListWidgetItemShow(false, DEV_MNG_BULETOOTH_HISTORY_DEV); + controlListWidgetItemShow(false, DEV_MNG_BULETOOTH_AVAILABLE_DEV + m_pairedItemCnt); + } + }else +#endif + if(row == DEV_MNG_BULETOOTH_DEVNAME) + { + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + + //QString itemName = config[DEV_MNG_BULETOOTH_DEVNAME].m_sOpn; + QString itemName = "设备名称"; + LineEditInputDialog dlg(itemName, parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString setStr = dlg.getRow(0); + if(setStr.isEmpty()) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + }else + { + wdt->updateLabel(setStr); + m_backstageIf->btSetName(setStr.toStdString()); + } + } + }else if(row > DEV_MNG_BULETOOTH_HISTORY_DEV && + row <= DEV_MNG_BULETOOTH_HISTORY_DEV + m_pairedItemCnt) + { + LOGD("click paired item"); + BtListWidget* btListWidget = dynamic_cast(m_listWidget->itemWidget(item)); + if(btListWidget == nullptr){ + return; + } + BluetoothDev_t btDev; + btListWidget->getDevInfo(btDev); + + if(btDev.devStat == BlueToothDevStat_connected){ + QString showText = tr("此操作将会断开您与以下设备的连接:
") + QString::fromStdString(btDev.name); + QuestionDialog dlg(showText, parent()->parent(), tr("确定")); + if(QDialog::Accepted == dlg.exec()){ + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents();//处理qt事件,刷新ui + + //断开连接 + m_backstageIf->btDisConnect(btDev.id); + + //更改item状态为已配对 + btDev.devStat = BlueToothDevStat_paired; + btListWidget->updateDev(btDev); + } + }else if(btDev.devStat == BlueToothDevStat_paired){ + QString showText = tr("要与以下设备连接:
") + QString::fromStdString(btDev.name); + QuestionDialog dlg(showText, parent()->parent(), tr("连接")); + if(QDialog::Accepted == dlg.exec()){ + //更改该item的状态为连接中... + btDev.devStat = BlueToothDevStat_connecting; + btListWidget->updateDev(btDev); + QCoreApplication::processEvents();//提前处理ui + + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents();//处理qt事件,刷新ui + //蓝牙连接 + if(0 == m_backstageIf->btConnect(btDev.id)) + { + //更改item状态为已连接 + btDev.devStat = BlueToothDevStat_connected; + btListWidget->updateDev(btDev); + }else + { + //更改item状态为已匹配 + btDev.devStat = BlueToothDevStat_paired; + btListWidget->updateDev(btDev); + //连接失败提示框 + InfoDialog(tr("蓝牙连接失败,请重试!"), parent()->parent()).exec(); + } + + //蓝牙连接接口调用完,可能会导致其他已连接的蓝牙状态发生变化,所以这里重新获取已配对蓝牙列表 + list pairedDev; + m_backstageIf->getBtPairedDev(pairedDev); + resetPaireItem(pairedDev); + } + + } + }else if(row == DEV_MNG_BULETOOTH_AVAILABLE_DEV + m_pairedItemCnt) + { + //搜索刷新 + LOGD("click refresh"); + MsgDialog msgdlg(tr("搜索中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents();//处理qt事件,刷新ui + list btAvailList; + m_backstageIf->getBtAvailDev(btAvailList); + //m_backstageIf->btScan(btAvailList); + resetAvailItem(btAvailList); + }else if(row > DEV_MNG_BULETOOTH_AVAILABLE_DEV + m_pairedItemCnt && + row <= DEV_MNG_BULETOOTH_AVAILABLE_DEV + m_pairedItemCnt + m_availdItemCnt) + { + LOGD("click availd item"); + BtListWidget* btListWidget = dynamic_cast(m_listWidget->itemWidget(item)); + if(btListWidget == nullptr){ + return; + } + BluetoothDev_t btDev; + btListWidget->getDevInfo(btDev); + + if(btDev.devStat == BlueToothDevStat_idle) + { + QString showText = tr("要与以下设备配对:
") + QString::fromStdString(btDev.name); + QuestionDialog dlg(showText, parent()->parent(), tr("配对")); + if(QDialog::Accepted == dlg.exec()){ + //配对 + //更改该item的状态为匹配中... + btDev.devStat = BlueToothDevStat_pairing; + btListWidget->updateDev(btDev); + QCoreApplication::processEvents();//提前处理ui + + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents();//处理qt事件,刷新ui + + if(0 == m_backstageIf->btPaire(btDev.id)) + {//success + //删除该item, + deleteAvaidItem(row); + //在已配对设备添加一个连接中的item + btDev.devStat = BlueToothDevStat_connecting; + BtListWidget* newBtListwidget = new BtListWidget(btDev); + addPairedItem(newBtListwidget); + + QCoreApplication::processEvents();//处理qt事件,刷新ui + + //蓝牙连接 + if(0 == m_backstageIf->btConnect(btDev.id)) + { + //更改item状态为已连接 + btDev.devStat = BlueToothDevStat_connected; + newBtListwidget->updateDev(btDev); + }else + { + //更改item状态为已匹配 + btDev.devStat = BlueToothDevStat_paired; + newBtListwidget->updateDev(btDev); + //连接失败提示框 + InfoDialog(tr("蓝牙连接失败,请重试!"), parent()->parent()).exec(); + } + + //蓝牙连接接口调用完,可能会导致其他已连接的蓝牙状态发生变化,所以这里重新获取已配对蓝牙列表 + list pairedDev; + m_backstageIf->getBtPairedDev(pairedDev); + resetPaireItem(pairedDev); + }else + {//failed + //更改item状态为空闲 + btDev.devStat = BlueToothDevStat_idle; + btListWidget->updateDev(btDev); + //配对失败提示框 + InfoDialog(tr("蓝牙配对失败,请重试!"), parent()->parent()).exec(); + } + } + } + } + +} + +void settingUiDevMngBtSpk::slotBtDevSet(BluetoothDev_t btDevInfo) +{ + LOGD("slotBtDevSet"); + emit signalClickSet(btDevInfo); + emit signalShowPage(settingUiDevMngBtSpkAccPoint::m_pageIndex, QString::fromStdString(btDevInfo.name)); +} + +int settingUiDevMngBtSpkAccPoint::m_pageIndex = 0; +settingUiDevMngBtSpkAccPoint::settingUiDevMngBtSpkAccPoint(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("重命名"), "xxx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("取消配对"), "", myListWidget::enPropertyNull), + + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngBtSpkAccPoint()"; +} + +settingUiDevMngBtSpkAccPoint::~settingUiDevMngBtSpkAccPoint() +{ + +} + +void settingUiDevMngBtSpkAccPoint::setBackstageUiinterface(BackstageInterfaceForUi *interface) +{ + m_backstageIf = interface; + //reset(); +} + +void settingUiDevMngBtSpkAccPoint::reset() +{ + +} + +void settingUiDevMngBtSpkAccPoint::slotItemClicked(QListWidgetItem *item) +{ + if(nullptr == m_backstageIf){ + return; + } + int row = m_listWidget->currentRow(); + LOGD("slotItemClicked: row=%d", row); + + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + switch(row){ + case DEV_MNG_BULETOOTH_ACCPOINTE_RENAME: + { + QString itemName = config[row].m_sOpn; + LineEditInputDialog dlg(itemName, parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString setStr = dlg.getRow(0); + if(setStr.isEmpty()) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + }else + { + wdt->updateLabel(setStr); + //重命名 + m_backstageIf->btRenameDev(m_btDev.id, setStr.toStdString()); + } + } + } + break; + + case DEV_MNG_BULETOOTH_ACCPOINTE_CANCLE: + { + QuestionDialog dlg(tr("您确定要取消此设备的配对"), parent()->parent()); + if(QDialog::Accepted == dlg.exec()){ + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents();//处理qt事件,刷新ui + + //取消配对 + m_backstageIf->btDisPaire(m_btDev.id); + + //回退页面 + emit signalReturn(); + } + } + break; + + default: + break; + } +} + +void settingUiDevMngBtSpkAccPoint::setAccPointInfo(const BluetoothDev_t &rBlueDev) +{ + m_btDev = rBlueDev; + + QListWidgetItem* pItem; + myListWidget* wdt; + pItem = m_listWidget->item(DEV_MNG_BULETOOTH_ACCPOINTE_RENAME); + wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + wdt->updateLabel(QString::fromStdString(m_btDev.name)); +} + + +int settingUiDevMngBtLock::m_pageIndex = 0; +settingUiDevMngBtLock::settingUiDevMngBtLock(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("启用"), "", myListWidget::enPropertySwitch), + SetOpn(tr("添加蓝牙门锁"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngBtLock()"; + + QListWidgetItem* pItem = m_listWidget->item(DEV_MNG_BT_LOCK_ADD); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + wdt->updateIcon(":/res/image/add3.png", 40, 40); +} + +void settingUiDevMngBtLock::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; +} + +void settingUiDevMngBtLock::reset() +{ + BtDoorLock cfg; + m_backstageIf->getBtLockCfg(cfg); + qDebug() << "cfg.qty:" << cfg.qty; + + QListWidgetItem* pItem = m_listWidget->item(DEV_MNG_BT_LOCK_ENABLE); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + wdt->updateIcon(cfg.isEnable ? ":/res/image/on.png" : ":/res/image/off.png"); + + if(cfg.isEnable){ + showBtLockList(cfg); + } + else{ + clearBtLockList(); + controlListWidgetItemShow(false, DEV_MNG_BT_LOCK_ADD); + } +} + +void settingUiDevMngBtLock::slotItemClicked(QListWidgetItem* item) +{ + BtDoorLock cfg; + m_backstageIf->getBtLockCfg(cfg); + qDebug() << "enable:" << cfg.isEnable; + + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + switch(row){ + case DEV_MNG_BT_LOCK_ENABLE: + { + MsgDialog msgdlg(tr("处理中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents(); + + cfg.isEnable = static_cast(!cfg.isEnable); + qDebug() << "now enable:" << cfg.isEnable; + wdt->updateIcon(cfg.isEnable ? ":/res/image/on.png" : ":/res/image/off.png"); + controlListWidgetItemShow(cfg.isEnable, DEV_MNG_BT_LOCK_ADD); + if(0 == m_backstageIf->setBtLockCfg(cfg)){ + if(cfg.isEnable){ + showBtLockList(cfg); + } + else{ + clearBtLockList(); + } + } + } + break; + case DEV_MNG_BT_LOCK_ADD: + { + bool settingFailed = true; + QString posiInput; + QString macInput; + do{ + QList strs; + strs << tr("厂商名称") << tr("房间名") << tr("MAC地址"); + LineEditInputDialog dlg(strs, parent()->parent()); + dlg.fillRow(0, "博雅讯", true); + dlg.fillRow(1, posiInput); + dlg.fillRow(2, macInput); + if(dlg.exec() == QDialog::Accepted){ + posiInput = dlg.getRow(1); + macInput = dlg.getRow(2).toUpper(); + qDebug() << "mac:" << macInput; + do{ + if(posiInput.isEmpty()){ + InfoDialog(tr("房间名不能为空!"), parent()->parent()).exec(); + break; + }else if(posiInput.length() > 32){ + InfoDialog(tr("房间名请控制在32个字符以内!"), parent()->parent()).exec(); + break; + } + bool macConflict = false; + for(int i=0; iparent()).exec(); + macConflict = true; + break; + } + } + if(macConflict){ + break; + } + cfg.manufacturer.push_back(1); + cfg.position.push_back(posiInput.toStdString()); + cfg.mac.push_back(macInput.toStdString()); + cfg.qty++; + if(0 == m_backstageIf->setBtLockCfg(cfg)){ + addBtLock(posiInput); + controlListWidgetItemShow(cfg.qty < 5, DEV_MNG_BT_LOCK_ADD); + settingFailed = false; + } + }while(0); + } + else { + settingFailed = false; + } + }while(settingFailed); + } + break; + default: + if(row >= DEV_MNG_BT_LOCK_BUTT && row < (m_listWidget->count())){ + wdt = dynamic_cast(m_listWidget->itemWidget(item)); + emit signalShowPage(settingUiDevMngBtLockAccPoint::m_pageIndex, wdt->getOptionLabel()); + emit signalCurrentLock(QString(cfg.mac.at(row - DEV_MNG_BT_LOCK_BUTT).c_str())); + } + break; + } +} + +void settingUiDevMngBtLock::slotRefresh() +{ + reset(); +} + + +void settingUiDevMngBtLock::clearBtLockList() +{ + int itemQty = m_listWidget->count(); + qDebug() << "clearBtLockList itemQty:" << itemQty; + for(int i=0; itakeItem(DEV_MNG_BT_LOCK_BUTT); + delete pItem; + } +} + +void settingUiDevMngBtLock::addBtLock(const QString& position) +{ + QListWidgetItem* pItem = new QListWidgetItem(m_listWidget); + myListWidget* lockWidget = new myListWidget(myListWidget::SetOpnCfg(position, "", + static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), m_listWidget); + lockWidget->setLeftIcon(":/res/image/bt_lock.png", 40, 40); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, lockWidget); +} + +void settingUiDevMngBtLock::showBtLockList(const BtDoorLock& cfg) +{ + clearBtLockList(); + for(int i=0; i{ + SetOpn(tr("门锁信息"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("电量(0-100)"), "", myListWidget::enPropertyNull), + SetOpn(tr("删除门锁"), "", myListWidget::enPropertyRedWord) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiDevMngBluetoothAccPoint()"; + + QListWidgetItem* pItem = m_listWidget->item(DEV_MNG_BT_LOCK_BATTERY); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + wdt->updateIcon(":/res/image/refresh_large.png", 40, 40); + + pItem = m_listWidget->item(DEV_MNG_BT_LOCK_DELETE); + wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + wdt->updateIcon(":/res/image/del.png", 40, 40); +} + +void settingUiDevMngBtLockAccPoint::setBackstageUiinterface(BackstageInterfaceForUi *interface) +{ + m_backstageIf = interface; +} + +void settingUiDevMngBtLockAccPoint::reset() +{ + +} + +void settingUiDevMngBtLockAccPoint::slotItemClicked(QListWidgetItem *item) +{ + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + BtDoorLock cfg; + m_backstageIf->getBtLockCfg(cfg); + switch(row){ + case DEV_MNG_BT_LOCK_INFO: + { + bool settingFailed = true; + QString posiFillStr = m_position; + QString macFillStr = m_mac; + do{ + QList strs; + strs << tr("产商名称") << tr("房间名") << tr("MAC地址"); + LineEditInputDialog dlg(strs, parent()->parent()); + dlg.fillRow(0, "博雅讯", true); + dlg.fillRow(1, posiFillStr); + dlg.fillRow(2, macFillStr); + if(dlg.exec() == QDialog::Accepted){ + const QString posiInput = dlg.getRow(1); + const QString macInput = dlg.getRow(2).toUpper(); + do{ + posiFillStr = posiInput; + macFillStr = macInput; + qDebug() << "mac:" << macInput; + if(posiInput.isEmpty()){ + InfoDialog(tr("房间名不能为空!"), parent()->parent()).exec(); + break; + }else if(posiInput.length() > 32){ + InfoDialog(tr("房间名请控制在32个字符以内!"), parent()->parent()).exec(); + break; + } + bool macConflict = false; + for(int i=0; iparent()).exec(); + macConflict = true; + break; + } + } + if(macConflict){ + break; + } + for(int i=0; isetBtLockCfg(cfg)){ + m_manufacturer = 0; + m_position = posiInput; + m_mac = macInput; + emit signalUpdataTitle(m_position); + settingFailed = false; + } + }while(0); + } + else { + settingFailed = false; + } + }while(settingFailed); + } + break; + + case DEV_MNG_BT_LOCK_BATTERY: + getRemainingBatPwr(); + break; + case DEV_MNG_BT_LOCK_DELETE: + { + QuestionDialog dlg(tr("您确定要删除此门锁吗?"), parent()->parent(), tr("删除")); + if(QDialog::Accepted == dlg.exec()){ + for(int i=0; isetBtLockCfg(cfg)){ + emit signalRefresh(); + } + } + } + break; + default: + break; + } +} + +void settingUiDevMngBtLockAccPoint::slotCurrentLock(const QString& lock) +{ + qDebug() << "lock mac:" << lock; + BtDoorLock cfg; + m_backstageIf->getBtLockCfg(cfg); + for(int i=0; iparent()); + msgdlg.show(); + QCoreApplication::processEvents(); + int pwr = m_backstageIf->getBtLockRemainingBatPwr(m_mac.toStdString()); + QListWidgetItem* pItem = m_listWidget->item(DEV_MNG_BT_LOCK_BATTERY); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + wdt->updateLabel(pwr >= 0 ? QString::number(pwr) : tr("(未知)")); +} + diff --git a/Linguist/setUi/settingUiDevMng.h b/Linguist/setUi/settingUiDevMng.h new file mode 100644 index 0000000..84e1182 --- /dev/null +++ b/Linguist/setUi/settingUiDevMng.h @@ -0,0 +1,470 @@ +#ifndef SETTINGUIDEVMNG_H +#define SETTINGUIDEVMNG_H + +#include +#include "UiTools.h" + +class settingUiDevMng : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_SHOW_IP, + DEV_MNG_SHOW_ID_VER, + DEV_MNG_SET_VOLUMN, + DEV_MNG_SET_BRIGHTNESS, + DEV_MNG_SCREENSAVER, + DEV_MNG_SCREENOFF, + DEV_MNG_SET_TIME, + //DEV_MNG_SET_NETWORK, + DEV_MNG_BLUETOOTH, + DEV_MNG_OPEN_DYNAMICFEATURE,//动态底库 + DEV_MNG_PASSWORD, + DEV_MNG_DEV_SETTING_DISABLE + }DEV_MNG_E; + + static int m_pageIndex; + + explicit settingUiDevMng(int pageIndex, QWidget *parent = nullptr); + ~settingUiDevMng(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + +public slots: + void slotItemClicked(QListWidgetItem*); + +private: + +}; + +class settingUiDevMngTime : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_TIME_NTP_SW, + DEV_MNG_TIME_NTP_SERVER, + DEV_MNG_TIME_NTP_INTERVAL, + DEV_MNG_TIME_NTP_TIME_ZONE, + DEV_MNG_TIME_MANUAL + }DEV_MNG_TIME_E; + + static int m_pageIndex; + + explicit settingUiDevMngTime(int pageIndex, QWidget *parent = nullptr); + ~settingUiDevMngTime(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: +public slots: + void slotItemClicked(QListWidgetItem*); + void slotShowProcessing(); + +private: + + const QVector TimeZone = {tr("UTC-11太平洋/中途岛"), + tr("UTC-9:30太平洋/马克萨斯"), + tr("UTC-9美国/安克雷奇"), + tr("UTC-8美国/道森"), + tr("UTC-7美国/博伊西"), + tr("UTC-6美国/巴伊亚州_班德拉斯"), + tr("UTC-5美国/多伦多"), + tr("UTC-4美国/安圭拉"), + tr("UTC-3:30美国/圣约翰斯"), + tr("UTC-3美国/阿拉瓜那"), + tr("UTC-2美国/诺罗尼亚"), + tr("UTC-1美国/斯科比斯松"), + tr("UTC+0欧洲/里斯本/伦敦"), + tr("UTC+1欧洲/阿姆斯特丹"), + tr("UTC+2亚洲/大马士革"), + tr("UTC+3亚洲/科威特"), + tr("UTC+3:30亚洲/德黑兰"), + tr("UTC+4印度/毛里求斯"), + tr("UTC+4:30亚洲/喀布尔"), + tr("UTC+5印度/马尔代夫"), + tr("UTC+5:30亚洲/科伦坡"), + tr("UTC+5:45亚洲/加德满都"), + tr("UTC+6印度/查戈斯"), + tr("UTC+6:30亚洲/仰光"), + tr("UTC+7亚洲/曼谷"), + tr("UTC+8亚洲/北京/台北"), + tr("UTC+8:45澳大利亚/尤克拉"), + tr("UTC+9亚洲/首尔/东京"), + tr("UTC+9:30澳大利亚/达尔文"), + tr("UTC+10澳大利亚/墨尔本"), + tr("UTC+10:30澳大利亚/领主豪"), + tr("UTC+11太平洋/瓜达尔卡纳尔岛"), + tr("UTC+12太平洋/奥克兰"), + tr("UTC+12:45太平洋/查塔姆"), + tr("UTC+13太平洋/阿皮亚"), + tr("UTC+14太平洋/基里蒂马蒂)") + }; + + const QVector TimeZoneSet = {"Pacific/Midway", + "Pacific/Marquesas", + "America/Anchorage", + "America/Dawson", + "America/Boise", + "America/Bahia_Banderas", + "America/Toronto", + "America/Anguilla", + "America/St_Johns", + "America/Araguaina", + "America/Noronha", + "America/Scoresbysund", + "right/Europe/London", + "right/Europe/Amsterdam", + "Asia/Damascus", + "Asia/Kuwait", + "Asia/Tehran", + "Indian/Mauritius", + "Asia/Kabul", + "Indian/Maldives", + "Asia/Colombo", + "Asia/Kathmandu", + "Indian/Chagos", + "Asia/Rangoon", + "Asia/Bangkok", + "Asia/Shanghai", + "Australia/Eucla", + "Asia/Tokyo", + "Australia/Darwin", + "Australia/Melbourne", + "Australia/Lord_Howe", + "Pacific/Guadalcanal", + "Pacific/Auckland", + "Pacific/Chatham", + "Pacific/Apia", + "Pacific/Kiritimati"}; + + MsgDialog* m_msgDlg; + void ntpTimeCorrect(); +}; + +class settingUiDevMngNetwork : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_NETWORK_WIRE, + DEV_MNG_NETWORK_WIFI, + DEV_MNG_NETWORK_4G + }DEV_MNG_WIRE_NET_E; + + static int m_pageIndex; + + explicit settingUiDevMngNetwork(int pageIndex, QWidget *parent = nullptr); + ~settingUiDevMngNetwork(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: +public slots: + void slotItemClicked(QListWidgetItem*); + +private: + +}; + + +class settingUiDevMngNetWire : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_NET_WIRE_SW, + DEV_MNG_NET_WIRE_DHCP, + DEV_MNG_NET_WIRE_MAN_CFG, + DEV_MNG_NET_WIRE_IP, + DEV_MNG_NET_WIRE_MASK, + DEV_MNG_NET_WIRE_GW, + DEV_MNG_NET_WIRE_DNS + }DEV_MNG_WIRE_NET_E; + + static int m_pageIndex; + + explicit settingUiDevMngNetWire(int pageIndex, QWidget *parent = nullptr); + ~settingUiDevMngNetWire(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: +public slots: + void slotItemClicked(QListWidgetItem*); + +private: + bool setStaticNetworkPara(const stNetWire& curNetCfg); +}; + +class settingUiDevMngNetWifi : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_NET_WIFI_SW, + DEV_MNG_NET_AP_SW, + DEV_MNG_NET_WIFI_ASSIGN, + DEV_MNG_NET_WIFI_SEARCH, + DEV_MNG_NET_AP_PWD, + + DEV_MNG_NET_BUTT + }DEV_MNG_NET_WIFI_E; + + static int m_pageIndex; + + explicit settingUiDevMngNetWifi(int pageIndex, QWidget *parent = nullptr); + ~settingUiDevMngNetWifi(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: +public slots: + void slotItemClicked(QListWidgetItem*); + void slotUpdateConnectionStatus(QString ssid, bool connected); + +private: + void clearSsidList(); + void wifiSearch(); + const int m_ssidPosIndex = DEV_MNG_NET_BUTT; +}; + +class settingUiDevMngNetWifiAccPoint : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_NET_WIFI_AP_CONNECT, + DEV_MNG_NET_WIFI_AP_FORGET, + DEV_MNG_NET_WIFI_AP_DHCP, + DEV_MNG_NET_WIFI_AP_MAN_CFG, + DEV_MNG_NET_WIFI_AP_IP, + DEV_MNG_NET_WIFI_AP_MASK, + DEV_MNG_NET_WIFI_AP_GW, + DEV_MNG_NET_WIFI_AP_DNS + }DEV_MNG_NET_WIFI_E; + + static int m_pageIndex; + + explicit settingUiDevMngNetWifiAccPoint(int pageIndex, QWidget *parent = nullptr); + ~settingUiDevMngNetWifiAccPoint(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + void signalUpdateConnectionStatus(QString ssid, bool connected); + void signalReturn(); + +public slots: + void slotItemClicked(QListWidgetItem*); + +private: + bool setStaticNetworkPara(const stNetWifi& curNetCfg); +}; + +class settingUiDevMngNet4G : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_NET_4G_SW, + DEV_MNG_NET_4G_PROVIDER, + DEV_MNG_NET_4G_REBOOT + }DEV_MNG_NET_WIFI_E; + + static int m_pageIndex; + + explicit settingUiDevMngNet4G(int pageIndex, QWidget *parent = nullptr); + ~settingUiDevMngNet4G(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: +public slots: + void slotItemClicked(QListWidgetItem*); + +private: + const QVector net4GProvider{ + tr("未插卡"),tr("中国移动"),tr("中国电信"),tr("中国联通"),tr("4G启动中...") + }; +}; + +class settingUiDevMngBt : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_BT_ENABLE, + DEV_MNG_BT_SPK, + DEV_MNG_BT_LOCK + }DEV_MNG_BT_E; + + static int m_pageIndex; + + explicit settingUiDevMngBt(int pageIndex, QWidget *parent = nullptr); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: +public slots: + void slotItemClicked(QListWidgetItem*); + +private: +}; + +class settingUiDevMngBtSpk : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + //DEV_MNG_BULETOOTH_ENABLE, + DEV_MNG_BULETOOTH_DEVNAME, + DEV_MNG_BULETOOTH_HISTORY_DEV, + DEV_MNG_BULETOOTH_AVAILABLE_DEV, + }DEV_MNG_BULETOOTH_E; + + static int m_pageIndex; + + explicit settingUiDevMngBtSpk(int pageIndex, QWidget *parent = nullptr); + ~settingUiDevMngBtSpk(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +private: + void clearPaireItem(); + void clearAvailItem(); + + void addPairedItem(BluetoothDev_t &btDev); + void addPairedItem(BtListWidget *pBtListWidget); + void addPairedItem(list &btDevList); + + void addAvailItem(BluetoothDev_t &btDev); + void addAvailItem(BtListWidget *pBtListWidget); + void addAvailItem(list &btDevList); + + int deletePairedItem(int row); + int deleteAvaidItem(int row); + void resetPaireItem(list &btDevList); + void resetAvailItem(list &btDevList); +signals: + void signalClickSet(BluetoothDev_t btDevInfo); + +public slots: + void slotItemClicked(QListWidgetItem*); + void slotBtDevSet(BluetoothDev_t btDevInfo); + +private: + int m_pairedItemCnt = 0; + int m_availdItemCnt = 0; +#if 1 + string m_btDevName; + bool m_btIsEnable; + //list m_btPairedList; + //list m_btAvailList; +#endif +}; + +class settingUiDevMngBtSpkAccPoint : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_BULETOOTH_ACCPOINTE_RENAME, + DEV_MNG_BULETOOTH_ACCPOINTE_CANCLE + }DEV_MNG_BULETOOTH_ACCPOINTE_E; + + static int m_pageIndex; + + explicit settingUiDevMngBtSpkAccPoint(int pageIndex, QWidget *parent = nullptr); + ~settingUiDevMngBtSpkAccPoint(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + void signalReturn(); + +public slots: + void slotItemClicked(QListWidgetItem*); + void setAccPointInfo(const BluetoothDev_t &rBlueDev); +private: + BluetoothDev_t m_btDev; +}; + +class settingUiDevMngBtLock : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_BT_LOCK_ENABLE, + DEV_MNG_BT_LOCK_ADD, + DEV_MNG_BT_LOCK_BUTT + }DEV_MNG_BT_LOCK_E; + + static int m_pageIndex; + + explicit settingUiDevMngBtLock(int pageIndex, QWidget *parent = nullptr); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + void signalCurrentLock(const QString& lock); + +public slots: + void slotItemClicked(QListWidgetItem*); + void slotRefresh(); + +private: + void clearBtLockList(); + void addBtLock(const QString& position); + void showBtLockList(const BtDoorLock& cfg); +}; + +class settingUiDevMngBtLockAccPoint : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + DEV_MNG_BT_LOCK_INFO, + DEV_MNG_BT_LOCK_BATTERY, + DEV_MNG_BT_LOCK_DELETE, + DEV_MNG_BT_LOCK_BUTT + }DEV_MNG_BT_LOCK_E; + + static int m_pageIndex; + + explicit settingUiDevMngBtLockAccPoint(int pageIndex, QWidget *parent = nullptr); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + void signalUpdataTitle(const QString& title); + void signalRefresh(); + +public slots: + void slotItemClicked(QListWidgetItem*); + void slotCurrentLock(const QString& lock); + +private: + int m_manufacturer; + QString m_position; + QString m_mac; + + void getRemainingBatPwr(); +}; + + +#endif // SETTINGUIDEVMNG_H diff --git a/Linguist/setUi/settingUiDevTest.cpp b/Linguist/setUi/settingUiDevTest.cpp new file mode 100644 index 0000000..eace4da --- /dev/null +++ b/Linguist/setUi/settingUiDevTest.cpp @@ -0,0 +1,695 @@ +#include "settingUiDevTest.h" +#include +#include +#include +#include +#include +#include "rw_zlog.h" +#include "common_utils.h" +#include "dev_version.h" + +int settingUiDevTest::m_pageIndex = 0; +settingUiDevTest::settingUiDevTest(int pageIndex, QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + m_pageIndex = pageIndex; + + QVBoxLayout* vlayAuto = new QVBoxLayout(); + m_gbAuto = new QGroupBox("自动检测", this); + m_gbAuto->setLayout(vlayAuto); + + m_btnTest = new QPushButton("立即检测", this); + m_btnTest->setFixedSize(UiConfig::GetInstance()->getUiWidth() / 8, UiConfig::GetInstance()->getUiWidth() / 12); + m_btnTest->setFlat(true); + connect(m_btnTest, &QPushButton::clicked, this, &settingUiDevTest::slotBtnClicked); + //m_btnTest->setStyleSheet("background-color:rgb(24, 144, 255);border-radius:50px;focus{padding:-1;}"); + m_btnTest->setStyleSheet("QPushButton {" + "border: 0px;" + "border-radius:10px;" + "background-color:rgb(24, 144, 255);" + "focus{outline: none;}" + "}" + "QPushButton:hover { " + "background-color:rgb(24, 144, 255);" + "}" + "QPushButton:pressed {" + "background-color:rgb(222, 222, 222);" + "}"); + vlayAuto->addWidget(m_btnTest, 1, Qt::AlignCenter); + + QGridLayout* glayAutoTestItems = new QGridLayout(); + glayAutoTestItems->setMargin(0); + //glayAutoTestItems->setColumnStretch(0, 98); + //glayAutoTestItems->setColumnStretch(1, 1); + //glayAutoTestItems->setColumnStretch(1, 98); + int row = 0; + int col = 0; + QLabel* testOpn = new QLabel("检测项", this); + glayAutoTestItems->addWidget(testOpn, row, col++, Qt::AlignCenter); + QLabel* testStatus = new QLabel("结果", this); + glayAutoTestItems->addWidget(testStatus, row, col++, Qt::AlignRight); + QLabel* operation = new QLabel("操作", this); + glayAutoTestItems->addWidget(operation, row, col++, Qt::AlignRight); + row++; + col = 0; + const QString style = "QPushButton {" + "border: 0px;" + "border-radius:4px;" + "background-color:rgb(6, 119, 194);" + "focus{outline: none;}" + "}" + "QPushButton:hover { " + "background-color:rgb(6, 119, 194);" + "}" + "QPushButton:pressed {" + "background-color:rgb(222, 222, 222);" + "}"; + for(const auto& testItem : m_autoTest){ + QLabel* itemName = new QLabel(testItem, this); + itemName->adjustSize(); + m_labelsAutoTestItem.push_back(itemName); + glayAutoTestItems->addWidget(itemName, row, col++, Qt::AlignCenter); + QLabel* testRes = new QLabel(this); + m_labelsAutoTestRes.push_back(testRes); + glayAutoTestItems->addWidget(testRes, row, col++); + QPushButton* retest = new QPushButton("复测", this); + connect(retest, &QPushButton::clicked, this, &settingUiDevTest::slotBtnClicked); + retest->setStyleSheet(style); + m_btnsAutoTestRetest.push_back(retest); + glayAutoTestItems->addWidget(retest, row, col++, Qt::AlignCenter); + row++; + col = 0; + } + vlayAuto->addLayout(glayAutoTestItems); + vlayAuto->addStretch(5); + + + QVBoxLayout* vlayMal = new QVBoxLayout(); + m_gbMal = new QGroupBox("人工检测", this); + m_gbMal->setLayout(vlayMal); + row = 0; + col = 0; + QGridLayout* glayMalTestItems = new QGridLayout(); + glayMalTestItems->setSpacing(5); + for(const auto& testItem : m_malTest){ + QLabel* itemName = new QLabel(testItem, this); + m_labelsMalTestItem.push_back(itemName); + glayMalTestItems->addWidget(itemName, row, col++, 1, 2); + QLabel* testRes = new QLabel(this); + m_labelsMalTestRes.push_back(testRes); + glayMalTestItems->addWidget(testRes, row, col++, Qt::AlignRight); + QPushButton* retest = new QPushButton("检测", this); + connect(retest, &QPushButton::clicked, this, &settingUiDevTest::slotBtnClicked); + retest->setStyleSheet(style); + m_btnsMalTest.push_back(retest); + glayMalTestItems->addWidget(retest, row, col++, Qt::AlignRight); + row++; + col = 0; + } + vlayMal->addLayout(glayMalTestItems); + + QLabel* labelNtp = new QLabel("NTP", this); + glayMalTestItems->addWidget(labelNtp, row, col++); + + col++;//放到第三列 + m_btnNtp = new QPushButton("校时", this); + m_btnNtp->setStyleSheet(style); + connect(m_btnNtp, &QPushButton::clicked, this, &settingUiDevTest::slotBtnClicked); + glayMalTestItems->addWidget(m_btnNtp, row, col++); + row++; + col = 0; + + + QVBoxLayout* vlayAgeing = new QVBoxLayout(); + QGroupBox* m_gbAgeing = new QGroupBox("老化", this); + m_gbAgeing->setLayout(vlayAgeing); + + QHBoxLayout* hlayAgeing = new QHBoxLayout(); + QLabel* labelAgeing = new QLabel("老化(小时)", this); + hlayAgeing->addWidget(labelAgeing); + m_editAgeing = new LineEditWithKeyboard(this); + m_editAgeing->setStyleSheet("QLineEdit {border : 1px solid blue;}"); + hlayAgeing->addWidget(m_editAgeing); + m_btnAgeing = new QPushButton("开始", this); + connect(m_btnAgeing, &QPushButton::clicked, this, &settingUiDevTest::slotBtnClicked); + m_btnAgeing->setStyleSheet(style); + hlayAgeing->addWidget(m_btnAgeing); + vlayAgeing->addLayout(hlayAgeing); + + QLabel* labelAgeingTip = new QLabel(this); + labelAgeingTip->setWordWrap(true); + labelAgeingTip->setText(QString("%1").arg("提示::") + "
" + + QString("%1").arg("1.开始老化后,满足老化时间,手动关掉老""化开关,恢复出厂设置,才可退出老化模式;") + "
" + + QString("%1").arg("2.老化时间时断电,之后再次上电,重新开始计时进行老化;") + "
" + + QString("%1").arg("3.老化测试结束后,功能测试完成,需恢复出厂设置") ); + vlayAgeing->addWidget(labelAgeingTip, 1, Qt::AlignLeft); + + + QVBoxLayout* vlayDev = new QVBoxLayout(); + m_gbDev = new QGroupBox("MAC烧录", this); + m_gbDev->setLayout(vlayDev); + + QLabel* labelSoftVer = new QLabel("软件版本", this); + vlayDev->addWidget(labelSoftVer, 1, Qt::AlignLeft); + m_editSoftVer = new QLineEdit(this); + m_editSoftVer->setMinimumWidth(UiConfig::GetInstance()->getUiWidth() / 3); + m_editSoftVer->setReadOnly(true); + m_editSoftVer->setStyleSheet("QLineEdit {border : 1px solid blue;}"); + vlayDev->addWidget(m_editSoftVer, 1, Qt::AlignLeft); + + QLabel* labelDevCfg = new QLabel("设备配置信息", this); + vlayDev->addWidget(labelDevCfg, 1, Qt::AlignLeft); + m_editDevCfg = new QLineEdit(this); + m_editDevCfg->setMinimumWidth(UiConfig::GetInstance()->getUiWidth() / 3); + m_editDevCfg->setReadOnly(true); + m_editDevCfg->setStyleSheet("QLineEdit {border : 1px solid blue;}"); + vlayDev->addWidget(m_editDevCfg, 1, Qt::AlignLeft); + + QLabel* labelMes = new QLabel("MES服务器地址及工单信息", this); + vlayDev->addWidget(labelMes, 1, Qt::AlignLeft); + m_editMesAddrAndProdNo = new QLineEdit(this); + m_editMesAddrAndProdNo->setMinimumWidth(UiConfig::GetInstance()->getUiWidth() / 3); + m_editMesAddrAndProdNo->setReadOnly(true); + m_editMesAddrAndProdNo->setStyleSheet("QLineEdit {border : 1px solid blue;}"); + vlayDev->addWidget(m_editMesAddrAndProdNo, 1, Qt::AlignLeft); + + QLabel* labelDevCode = new QLabel("设备条码", this); + vlayDev->addWidget(labelDevCode, 1, Qt::AlignLeft); + m_editPcbSeq = new QLineEdit(this); + m_editPcbSeq->setMinimumWidth(UiConfig::GetInstance()->getUiWidth() / 3); + m_editPcbSeq->setReadOnly(true); + m_editPcbSeq->setStyleSheet("QLineEdit {border : 1px solid blue;}"); + vlayDev->addWidget(m_editPcbSeq, 1, Qt::AlignLeft); + + QLabel* labelMac = new QLabel("MAC", this); + vlayDev->addWidget(labelMac, 1, Qt::AlignLeft); + m_editMac = new QLineEdit(this); + m_editMac->setMinimumWidth(UiConfig::GetInstance()->getUiWidth() / 3); + m_editMac->setReadOnly(true); + m_editMac->setStyleSheet("QLineEdit {border : 1px solid blue;}"); + vlayDev->addWidget(m_editMac, 1, Qt::AlignLeft); + + vlayDev->setSpacing(5); + + QVBoxLayout* vlayOperation = new QVBoxLayout(); + QGroupBox* m_gbOperation = new QGroupBox("操作", this); + m_gbOperation->setLayout(vlayOperation); + + + m_btnReboot = new QPushButton("手动重启", this); + connect(m_btnReboot, &QPushButton::clicked, this, &settingUiDevTest::slotBtnClicked); + m_btnReboot->setStyleSheet(style); + vlayOperation->addWidget(m_btnReboot, 1, Qt::AlignCenter); + + m_btnRecover = new QPushButton("恢复出厂设置", this); + connect(m_btnRecover, &QPushButton::clicked, this, &settingUiDevTest::slotBtnClicked); + m_btnRecover->setStyleSheet(style); + vlayOperation->addWidget(m_btnRecover, 1, Qt::AlignCenter); + + QVBoxLayout* vlayLeft = new QVBoxLayout(); + vlayLeft->addWidget(m_gbAuto, 1, Qt::AlignTop); + vlayLeft->addWidget(m_gbDev, 1, Qt::AlignTop); + vlayLeft->addStretch(5); + + QVBoxLayout* vlayRight = new QVBoxLayout(); + vlayRight->addWidget(m_gbMal, 1, Qt::AlignTop); + vlayRight->addWidget(m_gbAgeing, 1, Qt::AlignTop); + vlayRight->addWidget(m_gbOperation, 1, Qt::AlignTop); + vlayRight->addStretch(5); + + QHBoxLayout* hlay = new QHBoxLayout(); + hlay->addLayout(vlayLeft); + hlay->addLayout(vlayRight); + + setLayout(hlay); + setStyleSheet(QString("font-size:%1px;background-color:rgb(200, 200, 200);" + "border-radius:8px;padding:2px 4px;focus{outline: none;}") + .arg(QString::number(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + + m_timer = new QTimer(this); + connect(m_timer, &QTimer::timeout, [this]{delete m_colorScreen; + if(m_colorIndex >= color.size()){ + m_colorIndex = 0; + m_timer->stop(); + showSelectionWin(enMalTestLcd); + return; + } + m_colorScreen = new PureColorPage(color[m_colorIndex++]); + m_colorScreen->show();}); +} + +void settingUiDevTest::reset() +{ + m_backstageIf->stopIdentyState(true, false); + + //const int btnSize = m_btnsMalTest.at(0)->width(); + const int btnSize = UiConfig::GetInstance()->getUiWidth() / 15; + m_btnNtp->setFixedSize(btnSize, btnSize); + m_btnAgeing->setFixedSize(btnSize, btnSize); + for(int i=0; isetFixedSize(btnSize, btnSize); + } + for(int i=0; isetFixedSize(btnSize, btnSize); + } + + std::string mac; + if(m_backstageIf->getKeyDataMac(mac) > 0){ + m_editMac->setText(mac.c_str()); + } + std::string hours; + if(m_backstageIf->isAgeing(hours)){ + m_editAgeing->setText(hours.c_str()); + m_btnAgeing->setText("结束"); + //m_gbAuto->setEnabled(false); + //m_gbDev->setEnabled(false); + m_btnTest->setEnabled(false); + for(int i=0; isetEnabled(false); + } + for(int i=0; isetEnabled(false); + } + m_btnNtp->setEnabled(false); + m_btnRecover->setEnabled(false); + m_btnReboot->setEnabled(false); + } + else{ + m_editAgeing->setText("8"); + m_btnAgeing->setText("开始"); + //m_gbAuto->setEnabled(true); + //m_gbDev->setEnabled(true); + m_btnTest->setEnabled(true); + for(int i=0; isetEnabled(true); + } + for(int i=0; isetEnabled(true); + } + m_btnNtp->setEnabled(true); + m_btnRecover->setEnabled(true); + m_btnReboot->setEnabled(true); + } + for(auto& item : m_labelsAutoTestRes){ + item->clear(); + } + + const int iBufSize = 64; + char buf[iBufSize] = {'\0'}; + if(0 == m_backstageIf->getAppVersion(buf, iBufSize)){ + m_editSoftVer->setText(buf); + buf[strlen("FG_B0xx")] = '\0'; + if(!QString(buf).contains("B045")){ + m_labelsAutoTestItem.at(enAutoTestSerial1)->hide(); + m_labelsAutoTestRes.at(enAutoTestSerial1)->hide(); + m_btnsAutoTestRetest.at(enAutoTestSerial1)->hide(); + } + } + //if(0 == m_backstageIf->getHardwareConfig(buf, iBufSize)){ + std::string hardware; + if(m_backstageIf->getKeyDataHardware(hardware) > 0){ + refreshUiByHardwareConfig(hardware.c_str()); + } + + emit signalShowSettingUi(); +} + +void settingUiDevTest::slotDevTestMesAddrAndProdNoText(const QString& text) +{ + m_editMesAddrAndProdNo->setText(text); + if(!m_editPcbSeq->text().isEmpty()){ + QTimer::singleShot(100, this, [this]{ + std::string mac; + if(0 == m_backstageIf->getMacFromMes(m_editMesAddrAndProdNo->text().toStdString().c_str(), + m_editPcbSeq->text().toStdString().c_str(), mac)){ + m_editMac->setText(mac.c_str()); + } + else{ + InfoDialog("获取mac地址失败,请重试!").exec(); + }}); + } +} + +void settingUiDevTest::slotDevTestPcbSeqText(const QString& text) +{ + m_editPcbSeq->setText(text); + if(!m_editMesAddrAndProdNo->text().isEmpty()){ + QTimer::singleShot(100, this, [this]{ + std::string mac; + if(0 == m_backstageIf->getMacFromMes(m_editMesAddrAndProdNo->text().toStdString().c_str(), + m_editPcbSeq->text().toStdString().c_str(), mac)){ + m_editMac->setText(mac.c_str()); + } + else{ + InfoDialog("获取mac地址失败,请重试!").exec(); + }}); + } +} + +void settingUiDevTest::slotDevTestConfigInfo(const QString& text) +{ + if(text.isEmpty()){ + return; + } + + std::string hardware; + if(m_backstageIf->getKeyDataHardware(hardware) < 0){ + return; + } + + do{ + if(hardware.length() && hardware != text.toStdString()){ + QString que{"设备已有配置信息:"}; + que += hardware.c_str(); + que += "\n"; + que += "是否更新为:"; + que += text; + + QuestionDialog dlg(que, nullptr, "是的"); + if(QDialog::Rejected == dlg.exec()){ + break; + } + QCoreApplication::processEvents(); + } + + if(hardware == text.toStdString()){ + break; + } + + m_backstageIf->setKeyDataHardwareAndUpdataFunction(text.toStdString()); + refreshUiByHardwareConfig(text); + }while(0); +} + + +void settingUiDevTest::slotClosed() +{ + //m_draw->hide(); + showSelectionWin(enMalTestTp); +} + + +void settingUiDevTest::slotBtnClicked() +{ + int index = 0; + const QVector>funcsAuto{std::bind(&BackstageInterfaceForUi::isWiegandIoTestOk, m_backstageIf), + std::bind(&BackstageInterfaceForUi::isRelayAndGpioTestOk, m_backstageIf), + std::bind(&BackstageInterfaceForUi::isRs485TestOk, m_backstageIf), + std::bind(&BackstageInterfaceForUi::isWifiTestOk, m_backstageIf), + std::bind(&BackstageInterfaceForUi::isRtcTestOk, m_backstageIf), + //std::bind(&BackstageInterfaceForUi::isWireEthTestOk, m_backstageIf), + //std::bind(&BackstageInterfaceForUi::is4gTestOk, m_backstageIf), + std::bind(&BackstageInterfaceForUi::isReaderUnderScreenTestOk, m_backstageIf), + std::bind(&BackstageInterfaceForUi::isSerial1TestOk, m_backstageIf) + //std::bind(&BackstageInterfaceForUi::isIdModuleInfoUploaded, m_backstageIf) + }; + const QVector>funcsMal{std::bind([this]{m_colorScreen = new PureColorPage(color[m_colorIndex++]); + m_colorScreen->show();m_timer->start(2000);}), + std::bind(&settingUiDevTest::doMicrophoneTest, this), + std::bind([this]{m_backstageIf->speakerTest(); + showSelectionWin(enMalTestSpeaker);}), + std::bind([this]{if(!m_draw){ + m_draw = new DrawPage(UiConfig::GetInstance()->getUiWidth(), + UiConfig::GetInstance()->getUiHeight()); + connect(m_draw, SIGNAL(signalClosed()), this, SLOT(slotClosed())); + m_draw->show();}else{m_draw->show();}}), + std::bind([this]{static_cast(this->parent()->parent())->hide(); + QTimer::singleShot(100,this,[this]{ + m_backstageIf->irCamTest(); + static_cast(this->parent()->parent())->show(); + showSelectionWin(enMalTestIrCam);});}), + std::bind([this]{static_cast(this->parent()->parent())->hide(); + QTimer::singleShot(100,this,[this]{ + m_backstageIf->irLedTest(); + static_cast(this->parent()->parent())->show(); + showSelectionWin(enMalTestIrLed);});}) + }; + const int size = m_btnsAutoTestRetest.at(0)->height() * 0.6; + QPixmap pmOk(":/res/image/ok_small.png"); + pmOk = pmOk.scaled(size, size); + QPixmap pmFailed(":/res/image/fail2_large.png"); + pmFailed = pmFailed.scaled(size, size); + + const QObject* send = sender(); + if (send == m_btnTest) { + int testItemNum = 0; + for(auto& item : m_labelsAutoTestRes){ + if(!item->isHidden()){ + item->clear(); + testItemNum++; + } + } + ProgressWidget pw("自动检测中..."); + pw.setFixedSize(UiConfig::GetInstance()->getUiWidth() / 2, UiConfig::GetInstance()->getUiHeight() / 6); + pw.move((UiConfig::GetInstance()->getUiWidth() - pw.width()) / 2, (UiConfig::GetInstance()->getUiHeight() - pw.height()) / 2); + pw.show(); + int curTestItem = 1; + for(auto& item : m_labelsAutoTestRes){ + if(!item->isHidden()){ + pw.setMsg(curTestItem++, testItemNum); + QCoreApplication::processEvents(); + m_labelsAutoTestRes[index]->setPixmap(funcsAuto.at(index)() ? pmOk : pmFailed); + QCoreApplication::processEvents(); + } + index++; + } + } + else if (send == m_btnNtp) { + int ret = 0; + { + m_backstageIf->setNtpServerSw(true); + + #if 0 //测试代码 + QString testText("192.168.100.250/B045220509-40"); + std::string ip = getMesSeverIpFromText(testText); + LOGI("expect 1 %d", utils::isValidIp(ip)); + QString testText1(""); + ip = getMesSeverIpFromText(testText1); + LOGI("expect 0 %d", utils::isValidIp(ip)); + QString testText2("abc"); + ip = getMesSeverIpFromText(testText2); + LOGI("expect 0 %d", utils::isValidIp(ip)); + #endif + std::string mesServerIp = getMesSeverIpFromText(m_editMesAddrAndProdNo->text()); + #if 0 //工装ntp校时不依赖mes server ip + if(!utils::isValidIp(mesServerIp)) + { + InfoDialog("MES服务器地址无效,请重新扫码").exec(); + return; + } + #endif + + #if 0 + ProgressWidget pw("NTP校时中..."); + pw.setFixedSize(UiConfig::GetInstance()->getUiWidth() / 2, UiConfig::GetInstance()->getUiHeight() / 6); + pw.move((UiConfig::GetInstance()->getUiWidth() - pw.width()) / 2, (UiConfig::GetInstance()->getUiHeight() - pw.height()) / 2); + pw.show(); + #else + MsgDialog msgdlg("NTP校时中..."); + msgdlg.show(); + #endif + QCoreApplication::processEvents(); + ret = m_backstageIf->ntpTimeCorrectForDevTest(mesServerIp); + } + InfoDialog(0 == ret ? "NTP校时成功" : "NTP校时失败,请检查网络!").exec(); + } + else if (send == m_btnAgeing) { + if(m_btnAgeing->text() == "开始"){ + unsigned hours = m_editAgeing->text().toUInt(); + if(hours > 0){ + m_backstageIf->ageingTest(hours); + m_btnAgeing->setText("结束"); + m_btnTest->setEnabled(false); + for(int i=0; isetEnabled(false); + } + for(int i=0; isetEnabled(false); + } + m_btnNtp->setEnabled(false); + m_btnRecover->setEnabled(false); + m_btnReboot->setEnabled(false); + } + } + else if(m_btnAgeing->text() == "结束"){ + m_backstageIf->ageingTest(0); + m_btnAgeing->setText("开始"); + m_btnTest->setEnabled(true); + for(int i=0; isetEnabled(true); + } + for(int i=0; isetEnabled(true); + } + m_btnNtp->setEnabled(true); + m_btnRecover->setEnabled(true); + m_btnReboot->setEnabled(true); + //在工装界面结束老化,会恢复人脸识别,需要重新停止识别,并且延迟一段时间停止保证在恢复之后执行 + QTimer::singleShot(200, this, [this]{m_backstageIf->stopIdentyState(true, false);}); + } + } + else if (send == m_btnRecover || send == m_btnReboot) { + QString que; + QString btnText; + if(send == m_btnReboot){ + que = tr("您确定重新启动FaceTick吗?"); + btnText = tr("重新启动"); + } + else if(send == m_btnRecover){ + que = tr("您确定恢复出厂设置吗?"); + btnText = tr("恢复"); + } + QuestionDialog dlg(que, nullptr, btnText); + if(QDialog::Accepted == dlg.exec()){ + if(send == m_btnRecover){ + qDebug() << "recoveryFactorySetting"; + m_backstageIf->recoveryFactorySetting(); + } + PureColorPage* black = new PureColorPage(0); + black->show(); + QTimer::singleShot(1000, this, [this]{qDebug() << "devReboot";m_backstageIf->devReboot();}); + } + } + else { + index = 0; + for(auto& btn : m_btnsAutoTestRetest){ + if(send == btn){ + m_labelsAutoTestRes[index]->clear(); + MsgDialog msgdlg("检测中..."); + msgdlg.show(); + QCoreApplication::processEvents(); + m_labelsAutoTestRes[index]->setPixmap(funcsAuto.at(index)() ? pmOk : pmFailed); + return; + } + index++; + } + + index = 0; + for(auto& btn : m_btnsMalTest){ + if(send == btn){ + btn->setEnabled(false); + //InfoDialog(QString("通过要求:\n") + m_malTestTips.at(index)).exec(); + QCoreApplication::processEvents(); + funcsMal.at(index)(); + btn->setEnabled(true); + return; + } + index++; + } + } +} + +void settingUiDevTest::showSelectionWin(int testIndex) { + const int size = m_btnsMalTest.at(0)->height() * 0.6; + QPixmap pmOk(":/res/image/ok_small.png"); + pmOk = pmOk.scaled(size, size); + QPixmap pmFailed(":/res/image/fail2_large.png"); + pmFailed = pmFailed.scaled(size, size); + SelectionDialog dlg(m_malTestTips.at(testIndex), "不通过", "通过"); + + auto manufacturer = DevVersion::getInstance()->getManu(); + if (testIndex == enMalTestAuidoSwitch) { + m_labelsMalTestRes.at(enMalTestSpeaker)->setPixmap(dlg.selecion() == 1 ? pmOk : pmFailed); + } else if (testIndex == enMalTestSpeaker && + (manufacturer == Manu_E::ManuRWRk1109V05)) { // V05以上 板载喇叭测试成功后,再测试外部音频输出 + if (dlg.selecion() == 1) { + doAuidoSwitchTest(); + } else { + m_labelsMalTestRes.at(testIndex)->setPixmap(pmFailed); + } + } else { + + m_labelsMalTestRes.at(testIndex)->setPixmap(dlg.selecion() == 1 ? pmOk : pmFailed); + } +} + +void settingUiDevTest::doMicrophoneTest() { + m_backstageIf->microphoneTest(true); + SelectionDialog dlg("录音中,请面对设备屏幕70CM说话", "", "录音结束并播放录音"); + if (dlg.selecion() == 1) { + m_backstageIf->microphoneTest(false); + showSelectionWin(enMalTestMicrophone); + } else { + const int size = m_btnsMalTest.at(0)->height() * 0.6; + QPixmap pmFailed(":/res/image/fail2_large.png"); + pmFailed = pmFailed.scaled(size, size); + m_labelsMalTestRes.at(enMalTestSpeaker)->setPixmap(pmFailed); + } +} + +void settingUiDevTest::doAuidoSwitchTest() { + SelectionDialog dlg("请接入外部音响,并将开关拨至正确位置", "", "已完成"); + if (dlg.selecion() == 1) { + m_backstageIf->audioSwitchTest(); + showSelectionWin(enMalTestAuidoSwitch); + } else { + const int size = m_btnsMalTest.at(0)->height() * 0.6; + QPixmap pmFailed(":/res/image/fail2_large.png"); + pmFailed = pmFailed.scaled(size, size); + m_labelsMalTestRes.at(enMalTestSpeaker)->setPixmap(pmFailed); + } +} + +void settingUiDevTest::refreshUiByHardwareConfig(const QString& hardware) +{ + m_editDevCfg->setText(hardware); + + //HW300102 0 1 C1 1 01H + bool hasReaderUnderScreen = (hardware[8] == '2'); + if(hasReaderUnderScreen){//注意测试项索引 + m_labelsAutoTestItem.at(enAutoTestReaderUnderScreen)->show(); + m_labelsAutoTestRes.at(enAutoTestReaderUnderScreen)->show(); + m_btnsAutoTestRetest.at(enAutoTestReaderUnderScreen)->show(); + } + else{ + m_labelsAutoTestItem.at(enAutoTestReaderUnderScreen)->hide(); + m_labelsAutoTestRes.at(enAutoTestReaderUnderScreen)->hide(); + m_btnsAutoTestRetest.at(enAutoTestReaderUnderScreen)->hide(); + } + bool hasWifi = (hardware[9] == '2'); + if(hasWifi){//注意测试项索引 + m_labelsAutoTestItem.at(enAutoTestWifi)->show(); + m_labelsAutoTestRes.at(enAutoTestWifi)->show(); + m_btnsAutoTestRetest.at(enAutoTestWifi)->show(); + } + else{ + m_labelsAutoTestItem.at(enAutoTestWifi)->hide(); + m_labelsAutoTestRes.at(enAutoTestWifi)->hide(); + m_btnsAutoTestRetest.at(enAutoTestWifi)->hide(); + } + bool hasTp = (hardware[12] == '1'); + if(hasTp){//注意测试项索引 + m_labelsMalTestItem.at(enMalTestTp)->show(); + m_labelsMalTestRes.at(enMalTestTp)->show(); + m_btnsMalTest.at(enMalTestTp)->show(); + } + else{ + m_labelsMalTestItem.at(enMalTestTp)->hide(); + m_labelsMalTestRes.at(enMalTestTp)->hide(); + m_btnsMalTest.at(enMalTestTp)->hide(); + } + + auto manufacturer = DevVersion::getInstance()->getManu(); + if (manufacturer == Manu_E::ManuRWRk1109V05) { + m_malTest[enMalTestSpeaker] = "喇叭/音频输出"; + } else { + m_malTest[enMalTestSpeaker] = "喇叭"; + } + m_labelsMalTestItem.at(enMalTestSpeaker)->setText(m_malTest.at(enMalTestSpeaker)); +} + +std::string settingUiDevTest::getMesSeverIpFromText(const QString& text) +{ + //text 例"192.168.100.250:8080/B045220509-40" "192.168.100.250/B045220509-40" + + QString mesServerIp(""); + if(!text.isEmpty()) + { + QStringList list = text.split("/"); + QStringList strList = list[0].split(":"); + mesServerIp = strList[0]; + } + LOGI("mesServerIp %s", mesServerIp.toStdString().c_str()); + //qDebug()<<"mesServerIp "< +#include + + +class settingUiDevTest : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + enum{ + enAutoTestWg, + enAutoTestRelayAndGpio, + enAutoTestRs485, + enAutoTestWifi, + enAutoTestRtc, + enAutoTestReaderUnderScreen, + enAutoTestSerial1, + //enAutoTestIdModuleInfoUpload + }; + enum{ + enMalTestLcd, + enMalTestMicrophone, // 麦克风测试 + enMalTestSpeaker, + enMalTestTp, + enMalTestIrCam, + enMalTestIrLed, + enMalTestAuidoSwitch, // 测试外部 韦根输出、音频输出 GPIO切换功能 + }; + static int m_pageIndex; + + explicit settingUiDevTest(int pageIndex, QWidget *parent = nullptr); + void reset(); + +signals: + void signalShowSettingUi(); + +public slots: + void slotBtnClicked(); + void slotDevTestMesAddrAndProdNoText(const QString& text); + void slotDevTestPcbSeqText(const QString& text); + void slotDevTestConfigInfo(const QString& text); + void slotClosed(); + +protected: + void doAuidoSwitchTest(); + void doMicrophoneTest(); + +private: + const QStringList m_autoTest = {"韦根输入输出", "继电器和GPIO", "RS485", "WIFI", "实时时钟", "屏下刷卡", "板载uart3"};//, "NFC模块上报ID", "有线网络", "4G模块" + QStringList m_malTest = {"显示屏", "麦克风", "喇叭", "触摸屏", "红外镜头", "红外补光灯"}; + const QStringList m_malTestTips = {"屏幕显示白色、黑色、灰色、\n红色、绿色、蓝色,屏幕无条纹,\n无坏点,无闪烁,无色差", + "播放内容完整,声音清晰,无噪音", + "喇叭播放测试语音,声音清晰、无噪音", + "触摸屏画线无异常", + "红外镜头成像清晰", + "红外镜头画面有明暗交替变化", + "外部喇叭播放测试语音,声音清晰、无噪音", + }; + const int FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {30, 35, 35, 23, 23}; + const QVector color{0xFFFFFF, 0, 0xDDDDDD, 0xFF0000, 0xFF00, 0xFF}; + + QGroupBox* m_gbAuto; + QPushButton* m_btnTest; + QVector m_labelsAutoTestItem; + QVector m_labelsAutoTestRes; + QVector m_btnsAutoTestRetest; + + + QGroupBox* m_gbMal; + QVector m_labelsMalTestItem; + QVector m_labelsMalTestRes; + QVector m_btnsMalTest; + + QPushButton* m_btnNtp; + + QPushButton* m_btnAgeing; + LineEditWithKeyboard* m_editAgeing; + + QPushButton* m_btnRecover; + + QGroupBox* m_gbDev; + QLineEdit* m_editSoftVer; + QLineEdit* m_editDevCfg; + QLineEdit* m_editMesAddrAndProdNo; + QLineEdit* m_editPcbSeq; + QLineEdit* m_editMac; + QPushButton* m_btnReboot; + + QTimer* m_timer = nullptr; + PureColorPage* m_colorScreen = nullptr; + int m_colorIndex = 0; + DrawPage* m_draw = nullptr; + + void showSelectionWin(int testIndex); + void refreshUiByHardwareConfig(const QString& hardware); + std::string getMesSeverIpFromText(const QString& text); +}; + +#endif // SETTINGUIDEVTEST_H diff --git a/Linguist/setUi/settingUiFaceMng.cpp b/Linguist/setUi/settingUiFaceMng.cpp new file mode 100644 index 0000000..1cc51f7 --- /dev/null +++ b/Linguist/setUi/settingUiFaceMng.cpp @@ -0,0 +1,984 @@ +#include "settingUiFaceMng.h" +#include +#include "UiConfig.h" +#include +#include "recoUiRecognize.h" +int settingUiFaceMng::m_pageIndex = 0; +settingUiFaceMng::settingUiFaceMng(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("人脸库(人)"), "xxxxx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("通行记录(条)"), "xxxxxx", myListWidget::enPropertyMoreArrow) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiFaceMng()"; +} + +settingUiFaceMng::~settingUiFaceMng() +{ + qDebug() << "~settingUiFaceMng()"; +} + +void settingUiFaceMng::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + reset(); +} + +void settingUiFaceMng::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + switch(i) + { + case enFaceDb: + str = QString::number(m_backstageIf->getRegisterNum()); + break; + case enAccessRecord: + str = QString::number(m_backstageIf->getAccessRecordQty()); + break; + default: + break; + } + wdt->updateLabel(str); + } +} + +void settingUiFaceMng::slotItemClicked(QListWidgetItem* item) +{ + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + switch(row){ + case enFaceDb: + emit signalShowPage(FaceDbPage::m_pageIndex); + break; + case enAccessRecord: + emit signalShowPage(AccessRecordPage::m_pageIndex); + break; + default: + break; + } +} + +int FaceDbPage::m_pageIndex = 0; +FaceDbPage::FaceDbPage(int pageIndex, QWidget *parent) : PersonMsgUiPage(parent) +{ + qDebug() << "FaceDbPage"; + m_pageIndex = pageIndex; + QLabel* label = new QLabel(tr("未搜索到相关人员"), m_stackWgt); + label->setAlignment(Qt::AlignHCenter); + m_stackWgt->addWidget(label); +} + +void FaceDbPage::reset() +{ + slotTextChanged(""); + m_editSearch[enSearchOpnName]->clear(); +} + +void FaceDbPage::clickBtn_addPerson() +{ + emit signalShowPage(AddPersonPage::m_pageIndex); +} + +void FaceDbPage::slotTextChanged(const QString& text) +{ + int searchOpnIndex = 0; + if(sender() == m_editSearch[enSearchOpnName]){ + searchOpnIndex = static_cast(enSearchOpnName); + qDebug() << "FaceDbPage text change:" << text; + m_sSearchName = text; + } + else if(sender() == m_editSearch[enSearchOpnTime]){ + searchOpnIndex = static_cast(enSearchOpnTime); + m_sSearchtime = text; + } + + qDebug() << "m_sSearchName:" << m_sSearchName; + + if(m_backstageIf){ + unsigned personQty = m_backstageIf->queryPerson(m_sSearchName.toStdString().c_str()); + //qDebug() << "queryPerson ret:" << personQty; + if(personQty){ + showFaceMsg(0); + m_stackWgt->setCurrentIndex(0); + setPageControlBarHide(personQty <= m_itemQty, 1, static_cast(!!(personQty % m_itemQty) + (personQty / m_itemQty)), 1); + } + else { + m_stackWgt->setCurrentIndex(1); + setPageControlBarHide(true); + } + } + if("" != text){ + m_btnClearSearch[searchOpnIndex]->show(); + m_labelTip[searchOpnIndex]->hide(); + } + else { + m_btnClearSearch[searchOpnIndex]->hide(); + m_labelTip[searchOpnIndex]->show(); + } +} + +void FaceDbPage::showFaceMsg(int pageIndex) +{ + if(nullptr == m_backstageIf){ + return; + } + stQueryPersonInfo person[m_itemQty]; +#if 0 + for(unsigned j=0; jqueryPerson(m_sSearchName.toStdString().c_str(), pageIndex, person, static_cast(m_itemQty)); + QVector msgs; + if(personReadQty){ + for(unsigned i=0; i opns{{person[i].name.c_str(), PersonMsgUiPage::MsgOpnProp::enPropertyBold}, + {QString(person[i].expTime.c_str()).lastIndexOf("3000") >= 0 ? tr("有效期:永久有效") : QString(person[i].expTime.c_str()), + PersonMsgUiPage::MsgOpnProp::enPropertyGreyWord}, + {person[i].regTime.c_str(), PersonMsgUiPage::MsgOpnProp::enPropertyGreyWord}}; + msgs.append(PersonMsgUiPage::MsgSet(person[i].imgPath.c_str(), opns)); + } +#if 0 + if(personReadQty < m_itemQty){ + msgs.append(PersonMsgUiPage::MsgSet("", QVector())); + } +#endif + } + showMsg(msgs); +} + +void FaceDbPage::slotBtnClicked() +{ + PersonMsgUiPage::slotBtnClicked(); + showFaceMsg(m_toPageNum - 1); +} + +void FaceDbPage::slotSliderReleased() +{ + PersonMsgUiPage::slotSliderReleased(); + showFaceMsg(m_toPageNum - 1); +} + +void FaceDbPage::slotItemClicked(QListWidgetItem *item) +{ + int row = m_listWidget->currentRow(); + qDebug() << __PRETTY_FUNCTION__ << " row=" << row; + + if(row < 5) + { + emit signalPersonInfo(m_person[row]); + emit signalShowPage(ModifyPersonPage::m_pageIndex); + } +} + +void FaceDbPage::slot_freshPage() +{ + qDebug() << __PRETTY_FUNCTION__; + //数据库更新,刷新最后一次的页面 + if(nullptr == m_backstageIf){ + return; + } + + unsigned personQty = m_backstageIf->queryPerson(m_sSearchName.toStdString().c_str()); + //qDebug() << "queryPerson ret:" << personQty; + if(personQty){ + int maxPageNum = !!(personQty % m_itemQty) + (personQty / m_itemQty); + int showPageIndex = m_lastPageIndex < maxPageNum ? m_lastPageIndex : (maxPageNum-1); + showFaceMsg(showPageIndex); + m_stackWgt->setCurrentIndex(0); + setPageControlBarHide(personQty <= m_itemQty, 1, maxPageNum, showPageIndex+1); + } + else { + m_stackWgt->setCurrentIndex(1); + setPageControlBarHide(true); + } +} + +int AccessRecordPage::m_pageIndex = 0; +AccessRecordPage::AccessRecordPage(int pageIndex, QWidget *parent) : PersonMsgUiPage(parent) +{ + qDebug() << "AccessRecordPage"; + m_pageIndex = pageIndex; + QLabel* label = new QLabel(tr("未搜索到相关通行记录"), m_stackWgt); + label->setAlignment(Qt::AlignHCenter); + m_stackWgt->addWidget(label); + showMoreSearchOpn(); +} + +void AccessRecordPage::slotTextChanged(const QString& text) +{ + int searchOpnIndex = 0; + if(sender() == m_editSearch[enSearchOpnName]){ + searchOpnIndex = static_cast(enSearchOpnName); + qDebug() << "AccessRecordPage name text change:" << text; + m_sSearchName = text; + } + else if(sender() == m_editSearch[enSearchOpnTime]){ + searchOpnIndex = static_cast(enSearchOpnTime); + qDebug() << "AccessRecordPage time text change:" << text; + m_sSearchtime = text; + } + + if(m_backstageIf){ + unsigned recordQty = m_backstageIf->queryAccessRecord("" != m_sSearchName.toStdString() ? m_sSearchName.toStdString().c_str() : nullptr, + "" != m_sSearchtime.toStdString() ? m_sSearchtime.toStdString().c_str() : nullptr); + //qDebug() << "recordQty ret:" << recordQty; + if(recordQty){ + showAccessRecordMsg(0); + m_stackWgt->setCurrentIndex(0); + setPageControlBarHide(recordQty <= m_itemQty, 1, static_cast(!!(recordQty % m_itemQty) + (recordQty / m_itemQty)), 1); + } + else { + m_stackWgt->setCurrentIndex(1); + setPageControlBarHide(true); + } + } + if("" != text){ + m_btnClearSearch[searchOpnIndex]->show(); + m_labelTip[searchOpnIndex]->hide(); + } + else { + m_btnClearSearch[searchOpnIndex]->hide(); + m_labelTip[searchOpnIndex]->show(); + } +} + +void AccessRecordPage::showAccessRecordMsg(int pageIndex) +{ + if(nullptr == m_backstageIf){ + return; + } + stQueryAccRedInfo record[m_itemQty]; + for(unsigned j=0; jqueryAccessRecord("" != m_sSearchName.toStdString() ? m_sSearchName.toStdString().c_str() : nullptr, + "" != m_sSearchtime.toStdString() ? m_sSearchtime.toStdString().c_str() : nullptr, + pageIndex, record, static_cast(m_itemQty)); + QVector msgs; + for(unsigned i=0; i opns{ + {record[i].name, PersonMsgUiPage::MsgOpnProp::enPropertyBold}, + {record[i].accessTime, PersonMsgUiPage::MsgOpnProp::enPropertyGreyWord}, + {record[i].allowPass ? tr("通过") : tr("不通过"), + record[i].allowPass ? PersonMsgUiPage::MsgOpnProp::enPropertyGreenWord : PersonMsgUiPage::MsgOpnProp::enPropertyRedWord} + }; + msgs.append(PersonMsgUiPage::MsgSet(record[i].imgPath, opns)); + } +#if 0 + if(recordQty < m_itemQty){ + msgs.append(PersonMsgUiPage::MsgSet("", QVector())); + } +#endif + showMsg(msgs); +} + +void AccessRecordPage::slotBtnClicked() +{ + PersonMsgUiPage::slotBtnClicked(); + if(sender() == m_btnPrePage || sender() == m_btnNextPage){ + qDebug() << "slotBtnClicked : page num" << m_toPageNum; + showAccessRecordMsg(m_toPageNum - 1); + } +} + +void AccessRecordPage::slotSliderReleased() +{ + PersonMsgUiPage::slotSliderReleased(); + qDebug() << "slotSliderReleased : page num" << m_toPageNum; + showAccessRecordMsg(m_toPageNum - 1); +} + +void AccessRecordPage::reset() +{ + m_sSearchtime = ""; + slotTextChanged(""); + m_editSearch[enSearchOpnName]->clear(); + m_editSearch[enSearchOpnTime]->clear(); +} + +RegisterPersonPage::RegisterPersonPage(QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + m_listWidget = new QListWidget(this); + m_listWidget->setFrameStyle(QFrame::NoFrame); + m_listWidget->setCursor(QCursor(Qt::PointingHandCursor)); + m_listWidget->setFocusPolicy(Qt::NoFocus); + m_listWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + m_listWidget->setSpacing(0); + m_listWidget->setStyleSheet("QListWidget{border-width:0;border-style:outset; background:rgb(255, 255, 255);border-top: 1px solid #DFDDEB;}" + "QListWidget::item{border-bottom: 1px solid #DFDDEB;}" + "QListWidget::Item:hover{background:transparent;}" + "QListWidget::item:selected{background:transparent; }"); + m_listWidget->setFixedSize(UiConfig::GetInstance()->getUiWidth(), static_cast(UiConfig::GetInstance()->getUiHeight() / 0.6)); + connect(m_listWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(slotItemClicked(QListWidgetItem*))); + + //图片 + m_picWidget = new QWidget(this); + m_picLabel = new QLabel(m_picWidget); + m_picLabel->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() / 4), static_cast(UiConfig::GetInstance()->getUiHeight() / 10)); + //m_picLabel->setStyleSheet("background-color: white;"); + QLabel *label_pic = new QLabel("*人脸图片", m_picWidget); + QHBoxLayout* picWidgetLayout = new QHBoxLayout(); + //QSpacerItem* hSpace1 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + picWidgetLayout->addWidget(label_pic); + picWidgetLayout->addWidget(m_picLabel, 0, Qt::AlignRight); + m_picWidget->setLayout(picWidgetLayout); + //QPixmap faceImg(":/res/image/add.png"); + QPixmap faceImg(":/res/image/add.jpg"); + m_picLabel->setPixmap(ScalePixmap2Label(faceImg, *m_picLabel)); + //m_picLabel->setFixedSize(104, 105); + //m_picLabel->setPixmap(faceImg); + //m_picLabel->setPixmap(ScalePixmap(faceImg, QSize(m_picLabel->width()-1, m_picLabel->height()-1))); + + //授权期限选择 + m_deadlineChoiceWidget = new QWidget(this); + m_deadlineBtnGrp = new QButtonGroup(m_deadlineChoiceWidget); + QLabel *label_choice = new QLabel("*授权", m_deadlineChoiceWidget); + + m_durableBtn = new QRadioButton(m_deadlineChoiceWidget); + m_durableBtn->setText(tr("永久授权")); + m_durableBtn->setStyleSheet(QString("QRadioButton::indicator { width: %1px; height: %2px; }") + .arg(UiConfig::GetInstance()->getUiHeight() / 30) + .arg(UiConfig::GetInstance()->getUiHeight() / 30)); + m_durableBtn->setStyleSheet("QRadioButton::indicator:unchecked{image: url(:/res/image/select_1.png);}" + "QRadioButton::indicator:checked{image: url(:/res/image/select_2.png);}"); + m_durableBtn->setFocusPolicy(Qt::NoFocus); + m_nondurableBtn = new QRadioButton(m_deadlineChoiceWidget); + m_nondurableBtn->setText(tr("非永久授权")); + m_nondurableBtn->setStyleSheet(QString("QRadioButton::indicator { width: %1px; height: %2px; }") + .arg(UiConfig::GetInstance()->getUiHeight() / 30) + .arg(UiConfig::GetInstance()->getUiHeight() / 30)); + m_nondurableBtn->setStyleSheet("QRadioButton::indicator:unchecked{image: url(:/res/image/select_1.png);}" + "QRadioButton::indicator:checked{image: url(:/res/image/select_2.png);}"); + m_nondurableBtn->setFocusPolicy(Qt::NoFocus); + m_deadlineBtnGrp->addButton(m_durableBtn, 0); + m_deadlineBtnGrp->addButton(m_nondurableBtn, 1); + m_durableBtn->setChecked(true); + QHBoxLayout* deadlineChoiceLayout = new QHBoxLayout(); + deadlineChoiceLayout->addWidget(label_choice); + deadlineChoiceLayout->addWidget(m_durableBtn); + deadlineChoiceLayout->addWidget(m_nondurableBtn); + m_deadlineChoiceWidget->setLayout(deadlineChoiceLayout); + connect(m_deadlineBtnGrp, SIGNAL(buttonClicked(int)), this, SLOT(slotDeadlineBtnClicked(int))); + + m_nameWidget = new myListWidget(myListWidget::SetOpnCfg(tr("*姓名"), "", myListWidget::enPropertyMoreArrow)); + m_deadlineWidget = new myListWidget(myListWidget::SetOpnCfg(tr("*授权截至日期"), "", myListWidget::enPropertyMoreArrow)); + m_jobNumWidget = new myListWidget(myListWidget::SetOpnCfg(tr("工号"), "", myListWidget::enPropertyMoreArrow)); + m_phoneNumWidget = new myListWidget(myListWidget::SetOpnCfg(tr("手机号"), "", myListWidget::enPropertyMoreArrow)); + m_idCardWidget = new myListWidget(myListWidget::SetOpnCfg(tr("身份证号"), "", myListWidget::enPropertyMoreArrow)); + m_icCardWidget = new myListWidget(myListWidget::SetOpnCfg(tr("IC卡/NFC"), "", myListWidget::enPropertyMoreArrow)); + + QListWidgetItem* pItem; + pItem = new QListWidgetItem(m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 8, UiConfig::GetInstance()->getUiHeight() / 8)); + m_listWidget->setItemWidget(pItem, m_picWidget); + + pItem = new QListWidgetItem(m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, m_nameWidget); + + pItem = new QListWidgetItem(m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, m_deadlineChoiceWidget); + + pItem = new QListWidgetItem(m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, m_deadlineWidget); + + pItem = new QListWidgetItem(m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, m_jobNumWidget); + + pItem = new QListWidgetItem(m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, m_phoneNumWidget); + + pItem = new QListWidgetItem(m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, m_idCardWidget); + pItem = new QListWidgetItem(m_listWidget); + pItem->setSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, m_icCardWidget); + + m_bottomBtn = new QPushButton(this); + m_bottomBtn->setFocusPolicy(Qt::NoFocus); + m_bottomBtn->setMinimumSize(UiConfig::GetInstance()->getUiWidth() / 3, UiConfig::GetInstance()->getUiHeight() / 15); + //m_bottomBtn->setMinimumWidth(UiConfig::GetInstance()->getUiWidth() / 3); + m_bottomBtn->setStyleSheet("color:white;" + "background-color: blue;" + "border:none;" + "border-radius: 3px"); + + QLabel *tip = new QLabel(this); + tip->setText("

可以刷卡写入IC卡

"); + QHBoxLayout* hbLayout = new QHBoxLayout(); + QSpacerItem* hSpace1 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + QSpacerItem* hSpace2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + hbLayout->addItem(hSpace1); + hbLayout->addWidget(m_bottomBtn); + hbLayout->addItem(hSpace2); + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addWidget(m_listWidget, 0, Qt::AlignCenter); + vbLayout->addWidget(tip); + vbLayout->addLayout(hbLayout, 1); + vbLayout->setSpacing(20); + vbLayout->setMargin(10); + setLayout(vbLayout); + + m_listWidget->setItemHidden(m_listWidget->item(PERSON_ITEM_DEADLINE), true); +} + +void RegisterPersonPage::slotSetPersonInfo(stQueryPersonInfo &personInfo) +{ + m_personInfo = personInfo; + m_snapFeature.clear(); + m_snapPicPath.clear(); + refreshUi(); +} + +void RegisterPersonPage::slotSnapFace(string &feature, string &picPath) +{ + m_snapFeature = feature; + m_snapPicPath = picPath; + + m_picLabel->clear(); + QPixmap faceImg(m_snapPicPath.c_str()); + m_picLabel->setPixmap(ScalePixmap2Label(faceImg, *m_picLabel)); +} + +void RegisterPersonPage::slotIcCardResult(const QString &icCard) +{ + m_icCardWidget->updateLabel(icCard); +} + +void RegisterPersonPage::clearPersonInfo() +{ + m_personInfo.clear(); + m_snapFeature.clear(); + m_snapPicPath.clear(); + refreshUi(); +} + +void RegisterPersonPage::refreshUi() +{ + m_picLabel->clear(); + if(m_personInfo.imgPath.empty()) + { + //QPixmap faceImg(":/res/image/add.png"); + QPixmap faceImg(":/res/image/add.jpg"); + m_picLabel->setPixmap(ScalePixmap2Label(faceImg, *m_picLabel)); + }else + { + QPixmap faceImg(m_personInfo.imgPath.c_str()); + m_picLabel->setPixmap(ScalePixmap2Label(faceImg, *m_picLabel)); + } + + bool isDurable = (m_personInfo.expTime.empty() || + QString(m_personInfo.expTime.c_str()).lastIndexOf("3000") >= 0) ? true : false; + isDurable ? m_durableBtn->setChecked(true) : m_nondurableBtn->setChecked(true); + m_listWidget->setItemHidden(m_listWidget->item(PERSON_ITEM_DEADLINE), isDurable); + m_deadlineWidget->updateLabel(isDurable ? "" : m_personInfo.expTime.c_str()); + + m_nameWidget->updateLabel(m_personInfo.name.c_str()); + m_jobNumWidget->updateLabel(m_personInfo.jobNum.c_str()); + m_phoneNumWidget->updateLabel(m_personInfo.phoneNum.c_str()); + m_idCardWidget->updateLabel(m_personInfo.idNum.c_str()); + m_icCardWidget->updateLabel(m_personInfo.icNum.c_str()); +} + +#if 0 +void RegisterPersonPage::setInfo(dbspace::rwFeatInfo *pFeatInfo, dbspace::rwPersonInfo *pPersonInfo) +{ +#if 0 + m_featInfo.clear(); + m_personInfo.clear(); + if(pFeatInfo != nullptr) + { + m_featInfo = *pFeatInfo; + } + if(pFeatInfo != nullptr) + { + m_personInfo = *pPersonInfo; + } +#endif +} +#endif + +void RegisterPersonPage::slotItemClicked(QListWidgetItem *item) +{ + int row = m_listWidget->currentRow(); + //dynamic_cast(m_listWidget->itemWidget(item)); + //QWidget* pItemWidget = m_listWidget->itemWidget(item); + qDebug() << __PRETTY_FUNCTION__ << "row=" << row; + + switch (row) { +#if 0 + case PERSON_ITEM_PIC: + //turn to snap photo page + emit signalShowPage(SnapFacePage::m_pageIndex); + break; +#endif + case PERSON_ITEM_NAME: + { + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + + LineEditInputDialog dlg(wdt->getOpnLabelString(), parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString setStr = dlg.getRow(0); +#if 0 + if(setStr.isEmpty()) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + }else +#endif + { + wdt->updateLabel(setStr); + } + } + } + break; +#if 0 + case PERSON_ITEM_DEADLINE_CHOICE: + break; +#endif + case PERSON_ITEM_DEADLINE: + { + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + + //QDateTime::fromString(wdt->getLabelString(), "yyyy-MM-dd hh:mm"); + //DateTimeDialog dateTimeDlg(QDateTime::currentDateTime(), parent()->parent()); + DateTimeDialog dateTimeDlg(wdt->getLabelString().isEmpty() ? QDateTime::currentDateTime() : QDateTime::fromString(wdt->getLabelString(), "yyyy-MM-dd hh:mm"), parent()->parent()); + if(dateTimeDlg.exec() == QDialog::Accepted) + { + wdt->updateLabel(dateTimeDlg.getValueSet().toString("yyyy-MM-dd hh:mm")); + } + } + break; + + case PERSON_ITEM_JOB_NUM: + { + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + + LineEditInputDialog dlg(wdt->getOpnLabelString(), parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString setStr = dlg.getRow(0); +#if 0 + if(setStr.isEmpty()) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + }else +#endif + { + wdt->updateLabel(setStr); + } + } + } + break; + + case PERSON_ITEM_PHONE_NUM: + { + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + + LineEditInputDialog dlg(wdt->getOpnLabelString(), parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString setStr = dlg.getRow(0); +#if 0 + if(setStr.isEmpty()) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + }else +#endif + { + wdt->updateLabel(setStr); + } + } + } + break; + + case PERSON_ITEM_ID_CARD: + { + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + + LineEditInputDialog dlg(wdt->getOpnLabelString(), parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString setStr = dlg.getRow(0); +#if 0 + if(setStr.isEmpty()) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + }else +#endif + { + wdt->updateLabel(setStr); + } + } + } + break; + + case PERSON_ITEM_IC_CARD: + { + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + + LineEditInputDialog dlg(wdt->getOpnLabelString(), parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString setStr = dlg.getRow(0); +#if 0 + if(setStr.isEmpty()) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + }else +#endif + { + wdt->updateLabel(setStr); + } + } + } + break; + + default: + break; + } +} + +void RegisterPersonPage::slotDeadlineBtnClicked(int id) +{ + qDebug() << __PRETTY_FUNCTION__ << "id=" << id; + if(id == 0) + { + m_listWidget->setItemHidden(m_listWidget->item(PERSON_ITEM_DEADLINE), true); + }else if(id == 1) + { + m_listWidget->setItemHidden(m_listWidget->item(PERSON_ITEM_DEADLINE), false); + } +} + +int AddPersonPage::m_pageIndex = 0; +AddPersonPage::AddPersonPage(int pageIndex, QWidget *parent) : RegisterPersonPage(parent) +{ + qDebug() << "AddPersonPage"; + m_pageIndex = pageIndex; + m_bottomBtn->setText(tr("确认添加")); + connect(m_bottomBtn, SIGNAL(clicked(bool)), this, SLOT(slotAddPerson())); +} + +void AddPersonPage::reset() +{ + clearPersonInfo(); + m_backstageIf->startIdentyState(false, true); +} + +void AddPersonPage::slotItemClicked(QListWidgetItem *item) +{ + int row = m_listWidget->currentRow(); + //dynamic_cast(m_listWidget->itemWidget(item)); + //QWidget* pItemWidget = m_listWidget->itemWidget(item); + qDebug() << __PRETTY_FUNCTION__ << "row=" << row; + + switch (row) { + case PERSON_ITEM_PIC: + //turn to snap photo page + emit signalShowPage(SnapFacePage::m_pageIndex); + break; + default: + break; + } + + RegisterPersonPage::slotItemClicked(item); +} + +void AddPersonPage::slotAddPerson() +{ + qDebug() << __PRETTY_FUNCTION__; + if(nullptr == m_backstageIf){ + return; + } + + QString showText = tr("确定新增人员?"); + QuestionDialog dlg(showText, parent()->parent(), tr("确定")); + if(QDialog::Accepted != dlg.exec()){ + return; + } + + stQueryPersonInfo personInfo; + //personInfo.personId = m_personInfo.personId; + personInfo.name = m_nameWidget->getLabelString().toStdString(); + personInfo.expTime = m_durableBtn->isChecked() ? std::string("3000-12-31 00:00") : m_deadlineWidget->getLabelString().toStdString();; + personInfo.idNum = m_idCardWidget->getLabelString().toStdString(); + personInfo.icNum = m_icCardWidget->getLabelString().toStdString(); + personInfo.jobNum = m_jobNumWidget->getLabelString().toStdString(); + personInfo.phoneNum = m_phoneNumWidget->getLabelString().toStdString(); + + personInfo.imgPath = m_snapPicPath; + personInfo.feature = m_snapFeature; + + if(personInfo.name.empty() || personInfo.expTime.empty() || + personInfo.imgPath.empty() || personInfo.feature.empty()) + { + InfoDialog(tr("请补全*信息!"), parent()->parent()).exec(); + return; + } + + int ret = m_backstageIf->addPerson(personInfo); + if(ret == 0) + { + emit signalChangePersonDB(); + emit signalReturn(); + }else + { + qDebug() << __PRETTY_FUNCTION__ << "addPerson err:" << ret; + if(ret == -99) + { + InfoDialog(tr("注册失败,已达到最大注册人数!"), parent()->parent()).exec(); + }else if(ret == -6) + { + InfoDialog(tr("IC卡号重复!"), parent()->parent()).exec(); + }else if(ret == -5) + { + InfoDialog(tr("注册人员失败,请重新抓拍!"), parent()->parent()).exec(); + }else if (ret == -7) + { + InfoDialog(tr("身份证号已存在!"), parent()->parent()).exec(); + }else + { + InfoDialog(tr("注册人员失败!"), parent()->parent()).exec(); + } + } +} + +int ModifyPersonPage::m_pageIndex = 0; +ModifyPersonPage::ModifyPersonPage(int pageIndex, QWidget *parent) : RegisterPersonPage(parent) +{ + qDebug() << "ModifyPersonPage"; + m_pageIndex = pageIndex; + m_bottomBtn->setText(tr("删除人员")); + connect(m_bottomBtn, SIGNAL(clicked(bool)), this, SLOT(slotDelPerson())); +} + +void ModifyPersonPage::reset() +{ + m_backstageIf->startIdentyState(false, true); +} + +void ModifyPersonPage::savePersonInfo() +{ + qDebug() << __PRETTY_FUNCTION__; + if(nullptr == m_backstageIf){ + return; + } + + QString showText = tr("确定更改人员信息?"); + QuestionDialog dlg(showText, parent()->parent(), tr("确定")); + if(QDialog::Accepted != dlg.exec()){ + return; + } + + stQueryPersonInfo personInfo; + personInfo.personId = m_personInfo.personId; + personInfo.name = m_nameWidget->getLabelString().toStdString(); + personInfo.expTime = m_durableBtn->isChecked() ? std::string("3000-12-31 00:00") : m_deadlineWidget->getLabelString().toStdString();; + personInfo.idNum = m_idCardWidget->getLabelString().toStdString(); + personInfo.icNum = m_icCardWidget->getLabelString().toStdString(); + personInfo.jobNum = m_jobNumWidget->getLabelString().toStdString(); + personInfo.phoneNum = m_phoneNumWidget->getLabelString().toStdString(); + + if(personInfo.name.empty() || personInfo.expTime.empty()) + { + InfoDialog(tr("请补全*信息!"), parent()->parent()).exec(); + return; + } + + int ret = m_backstageIf->modifyPerson(personInfo); + if(ret == 0) + { + emit signalChangePersonDB(); + emit signalReturn(); + }else + { + qDebug() << __PRETTY_FUNCTION__ << "modifyPerson err:" << ret; + if(ret == -2) + { + InfoDialog(tr("无效的姓名!"), parent()->parent()).exec(); + }else if(ret == -3) + { + InfoDialog(tr("IC卡号重复!"), parent()->parent()).exec(); + }else if(ret == -6) + { + InfoDialog(tr("身份证号已存在!"), parent()->parent()).exec(); + }else + { + InfoDialog(tr("更改人员信息失败,人员或已被删除!"), parent()->parent()).exec(); + emit signalChangePersonDB(); + //emit signalReturn(); + } + } +} + +void ModifyPersonPage::slotDelPerson() +{ + qDebug() << __PRETTY_FUNCTION__; + if(nullptr == m_backstageIf){ + return; + } + + QString showText = tr("确定删除改人员?"); + QuestionDialog dlg(showText, parent()->parent(), tr("确定")); + if(QDialog::Accepted != dlg.exec()){ + return; + } + + m_backstageIf->delPerson(m_personInfo.personId); + emit signalChangePersonDB(); + emit signalReturn(); +} + +const QString SnapFacePage::BG_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/face-small.png", +":/res/image/jinggong-face-middle.png", +":/res/image/face_720_1280.png", +":/res/image/jinggong-face-middle.png", +":/res/image/face_720_1280.png" +}; + +int SnapFacePage::m_pageIndex = 0; +SnapFacePage::SnapFacePage(int pageIndex, QWidget *parent) : WidgetWithBackstageInterface(parent) +{ + qDebug() << "SnapFacePage"; + m_pageIndex = pageIndex; + + m_btn_snap = new QPushButton(this); + m_btn_snap->setFocusPolicy(Qt::NoFocus); + int radius_w = (UiConfig::GetInstance()->getUiWidth() * 0.2) / 2; + int radius_h = (UiConfig::GetInstance()->getUiHeight() * 0.1) / 2; + int radius = min(radius_w, radius_h); + m_btn_snap->setFixedSize(radius*2, radius*2); + m_btn_snap->setStyleSheet(QString("background-color: white;" + "border-radius: %1px;").arg(radius)); + m_btn_snap->setText(tr("拍照")); + connect(m_btn_snap, SIGNAL(clicked(bool)), this, SLOT(slotSnapBtnClicked())); +#if 0 + m_btn_snap->move((UiConfig::GetInstance()->getUiWidth() - m_btn_snap->width()) / 2, + UiConfig::GetInstance()->getUiHeight()*0.95 - m_btn_snap->height() ); +#endif + + QHBoxLayout* hbLayout = new QHBoxLayout(); + QSpacerItem* hSpace1 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + QSpacerItem* hSpace2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + hbLayout->addItem(hSpace1); + hbLayout->addWidget(m_btn_snap); + hbLayout->addItem(hSpace2); + + QSpacerItem* vSpace1 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addItem(vSpace1); + vbLayout->addLayout(hbLayout); + //vbLayout->setSpacing(20); + //vbLayout->setMargin(10); + setLayout(vbLayout); + + setAutoFillBackground(true); + //setStyleSheet("background-color: transparent;"); +#if 0 + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + QPalette pal = palette(); + pal.setColor(QPalette::Background, QColor(0x00,0xff,0x00,0x00)); + setPalette(pal); + //QPalette palette(this->palette()); + //palette.setColor(QPalette::WindowText,Qt::black); +#endif +#if 1 + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::white); + //palette.setBrush(QPalette::Window,QBrush(QPixmap(CenterMsgWidget::BG_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + palette.setBrush(QPalette::Window,QBrush(QPixmap(BG_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + setPalette(palette); +#endif + //setWindowOpacity(1); + //setAttribute(Qt::WA_TranslucentBackground, true); +} + +void SnapFacePage::reset() +{ + //vo显示设置 + if(nullptr == m_backstageIf){ + return; + } + + m_backstageIf->recoUiTypeSwitch(0, 0, UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); +} + +void SnapFacePage::slotSnapBtnClicked() +{ + qDebug() << __PRETTY_FUNCTION__; + if(nullptr == m_backstageIf){ + return; + } +#if 0 + MsgDialog msgdlg(tr("抓拍人脸中,请稍候..."), parent()->parent()); + msgdlg.show(); + QCoreApplication::processEvents();//处理qt事件,刷新ui +#endif + std::string feature; + std::string savePath("/tmp/test.jpg"); + int ret = m_backstageIf->snapFace(feature, savePath); + qDebug() << __PRETTY_FUNCTION__ << "ret=" << ret; + if(ret !=0) + { + InfoDialog(tr("抓拍人脸失败,请重拍!"), parent()->parent()).exec(); + }else + { + emit signalSnapFace(feature, savePath); + emit signalReturn(); + } +} diff --git a/Linguist/setUi/settingUiFaceMng.h b/Linguist/setUi/settingUiFaceMng.h new file mode 100644 index 0000000..e7d6fd3 --- /dev/null +++ b/Linguist/setUi/settingUiFaceMng.h @@ -0,0 +1,183 @@ +#ifndef SETTINGUIFACEMNG_H +#define SETTINGUIFACEMNG_H + +#include +#include "UiTools.h" +#include "UiConfig.h" + +class settingUiFaceMng : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + enFaceDb, + enAccessRecord + }enFaceMng; + + static int m_pageIndex; + explicit settingUiFaceMng(int pageIndex, QWidget *parent = nullptr); + ~settingUiFaceMng(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + +public slots: + void slotItemClicked(QListWidgetItem* item); + +private: + +}; + +class FaceDbPage : public PersonMsgUiPage +{ + Q_OBJECT +public: + static int m_pageIndex; + explicit FaceDbPage(int pageIndex, QWidget *parent = nullptr); + void reset(); + void clickBtn_addPerson(); + +protected: + + +signals: + void signalShowPage(int, const QString title = ""); + void signalPersonInfo(stQueryPersonInfo &personInfo); +protected slots: + void slotTextChanged(const QString& text); + virtual void slotBtnClicked(); + virtual void slotSliderReleased(); + virtual void slotItemClicked(QListWidgetItem *item); + void slot_freshPage(); +private: + void showFaceMsg(int pageIndex); + +private: + stQueryPersonInfo m_person[5]; + int m_lastPageIndex = 0; +}; + +class AccessRecordPage : public PersonMsgUiPage +{ + Q_OBJECT +public: + static int m_pageIndex; + explicit AccessRecordPage(int pageIndex, QWidget *parent = nullptr); + void reset(); + +protected: +protected slots: + void slotTextChanged(const QString& text); + virtual void slotBtnClicked(); + virtual void slotSliderReleased(); + +private: + void showAccessRecordMsg(int pageIndex); +}; + +class RegisterPersonPage : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + typedef enum + { + PERSON_ITEM_PIC = 0, + PERSON_ITEM_NAME, + PERSON_ITEM_DEADLINE_CHOICE, + PERSON_ITEM_DEADLINE, + PERSON_ITEM_JOB_NUM, + PERSON_ITEM_PHONE_NUM, + PERSON_ITEM_ID_CARD, + PERSON_ITEM_IC_CARD, + }PERSON_ITEM_E; + //static int m_pageIndex; + explicit RegisterPersonPage(QWidget *parent = nullptr); + //virtual void reset(); + + void clearPersonInfo(); + void refreshUi(); +signals: + void signalShowPage(int, const QString title = ""); + void signalReturn(); + void signalChangePersonDB(); + +protected slots: + virtual void slotItemClicked(QListWidgetItem *item); + void slotDeadlineBtnClicked(int id); + void slotSetPersonInfo(stQueryPersonInfo &personInfo); + void slotSnapFace(std::string &feature, std::string &picPath); + void slotIcCardResult(const QString& icCard); + +protected: + QListWidget *m_listWidget; + QWidget *m_picWidget; + QLabel *m_picLabel; + + QWidget *m_deadlineChoiceWidget; + QButtonGroup *m_deadlineBtnGrp; + QRadioButton *m_durableBtn; + QRadioButton *m_nondurableBtn; + + myListWidget *m_nameWidget; + myListWidget *m_deadlineWidget; + myListWidget *m_jobNumWidget; + myListWidget *m_phoneNumWidget; + myListWidget *m_idCardWidget; + myListWidget *m_icCardWidget; + QPushButton *m_bottomBtn; + //bool m_isPicChange = false; + //bool m_isPersonInfoChange = false; + stQueryPersonInfo m_personInfo; + std::string m_snapFeature; + std::string m_snapPicPath; + //dbspace::rwFeatInfo m_featInfo; + //dbspace::rwPersonInfo m_personInfo; +}; + +class AddPersonPage : public RegisterPersonPage +{ + Q_OBJECT +public: + static int m_pageIndex; + explicit AddPersonPage(int pageIndex, QWidget *parent = nullptr); + void reset(); + +public slots: + virtual void slotItemClicked(QListWidgetItem *item); + void slotAddPerson(); +}; + +class ModifyPersonPage : public RegisterPersonPage +{ + Q_OBJECT +public: + static int m_pageIndex; + explicit ModifyPersonPage(int pageIndex, QWidget *parent = nullptr); + void reset(); + void savePersonInfo(); +public slots: + void slotDelPerson(); +}; + +class SnapFacePage : public WidgetWithBackstageInterface +{ + Q_OBJECT +public: + static const QString BG_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static int m_pageIndex; + explicit SnapFacePage(int pageIndex, QWidget *parent = nullptr); + void reset(); + +signals: + void signalReturn(); + void signalSnapFace(std::string &feature, std::string &picPath); +public slots: + void slotSnapBtnClicked(); + +private: + QPushButton *m_btn_snap; +}; + +#endif // SETTINGUIFACEMNG_H diff --git a/Linguist/setUi/settingUiFastCfg.cpp b/Linguist/setUi/settingUiFastCfg.cpp new file mode 100644 index 0000000..643632b --- /dev/null +++ b/Linguist/setUi/settingUiFastCfg.cpp @@ -0,0 +1,343 @@ +#include "settingUiFastCfg.h" +#include "UiConfig.h" +#include + +const int NEXT_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {28, 42, 42, 16, 16}; + +int settingUiFastCfgWireNet::m_pageIndex = 0; +settingUiFastCfgWireNet::settingUiFastCfgWireNet(int pageIndex, QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + m_pageIndex = pageIndex; + + QFont ft; + ft.setPointSize(NEXT_BTN_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + //QLabel* title = new QLabel(tr("有线网络配置"), this); + //title->setFont(ft); + + m_wireNet = new settingUiDevMngNetWire(0, this); + m_wireNet->setFixedSize(UiConfig::GetInstance()->getUiWidth(), static_cast(UiConfig::GetInstance()->getUiHeight() * 0.7)); + + m_btnNext = new QPushButton(tr("下一步"), this); + m_btnNext->setFixedSize(UiConfig::GetInstance()->getUiWidth() / 3, + UiConfig::GetInstance()->getUiWidth() / 6); + m_btnNext->setFont(ft); + m_btnNext->setStyleSheet("QPushButton {" + "border: 0px;" + "border-radius:10px;" + "background-color:rgb(24, 144, 255);" + "focus{outline: none;}" + "}" + "QPushButton:hover { " + "background-color:rgb(24, 144, 255);" + "}" + "QPushButton:pressed {" + "background-color:rgb(222, 222, 222);" + "}"); + connect(m_btnNext, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QVBoxLayout* bLay = new QVBoxLayout(); + //bLay->addWidget(title, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addWidget(m_wireNet, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addStretch(1); + bLay->addWidget(m_btnNext, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addStretch(1); + bLay->setMargin(0); + bLay->setSpacing(0); + setLayout(bLay); +} + +void settingUiFastCfgWireNet::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + m_wireNet->setBackstageUiinterface(interface); +} + +void settingUiFastCfgWireNet::reset() +{ + m_wireNet->reset(); +} + +void settingUiFastCfgWireNet::slotBtnClicked() +{ + emit signalJumpPage(0); //need page enum +} + + + +int settingUiPark::m_pageIndex = 0; +settingUiPark::settingUiPark(QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("设备位置"), "(设备具体安装位置)", myListWidget::enPropertyMoreArrow) + }, parent) +{ +} + +void settingUiPark::reset() +{ + qDebug() << "reset"; + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + + QString str; + const int iBufSize = 128; + char buf[iBufSize] = {'\0'}; + switch(i) + { + case FAST_CFG_DEV_POSI: + { + std::string posiStr; + m_backstageIf->getDevPosi(posiStr); + str = (posiStr.empty() ? tr("(未设置)") : posiStr.c_str()); + } + break; +#if 0 + case FAST_CFG_PARK_INFO: + { + std::string infoStr; + m_backstageIf->getParkInfo(infoStr); + str = (infoStr.empty() ? tr("(未设置)") : infoStr.c_str()); + } + break; + + case FAST_CFG_SERVER: + if(0 == m_backstageIf->getServerAddr(buf, iBufSize)){ + str = buf; + } + break; +#endif + default: + break; + } + wdt->updateLabel(str); + } +} + +void settingUiPark::slotItemClicked(QListWidgetItem* item) +{ + const int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + switch(row){ + //case FAST_CFG_PARK_INFO: + case FAST_CFG_DEV_POSI: + { + bool settingFailed = true; + do{ + LineEditInputDialog dlg(config.at(row).m_sOpn, parent()->parent()); + if(dlg.exec() == QDialog::Accepted){ + const QString strInput = dlg.getRow(0); + do{ +#if 0 + if(row == FAST_CFG_PARK_INFO){ + if(0 == strInput.length()){ + InfoDialog(tr("园区信息不能为空"), parent()->parent()).exec(); + break; + } + else if(strInput.length() > 32){ + InfoDialog(tr("园区信息不能超过32个字符"), parent()->parent()).exec(); + break; + } + if(0 == m_backstageIf->setParkInfo(strInput.toStdString())){ + wdt->updateLabel(strInput); + settingFailed = false; + } + } + else +#endif + if(row == FAST_CFG_DEV_POSI){ + if(strInput.length() > 32){ + InfoDialog(tr("设备位置不能超过32个字符"), parent()->parent()).exec(); + break; + } + if(0 == m_backstageIf->setDevPosi(strInput.toStdString())){ + wdt->updateLabel(strInput.isEmpty() ? tr("(未设置)") : strInput); + settingFailed = false; + } + } + }while(0); + } + else { + settingFailed = false; + } + }while(settingFailed); + } + break; +#if 0 + case FAST_CFG_SERVER: + { + bool settingFailed = true; + do{ + QList strs; + if(FAST_CFG_SERVER == row){ + strs << tr("服务器地址:") << tr("端口:"); + } + LineEditInputDialog dlg(strs, parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString str; + do{ + if(FAST_CFG_SERVER == row){ + if("" != dlg.getRow(0) && "" != dlg.getRow(1)){ + bool isDigi = false; + int valueSet = dlg.getRow(1).toInt(&isDigi); + if( (!isDigi) || (valueSet < 0 || valueSet > 65535)){ + break; + } + if(m_backstageIf){ + str = dlg.getRow(0) + ":" + dlg.getRow(1); + m_backstageIf->setServerAddr(const_cast(str.toStdString().c_str())); + wdt->updateLabel(str); + settingFailed = false; + } + } + } + }while(0); + } + else { + settingFailed = false; + } + if(settingFailed) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + } + }while(settingFailed); + } + break; +#endif + default: + break; + } +} + + +int settingUiFastCfgPark::m_pageIndex = 0; +settingUiFastCfgPark::settingUiFastCfgPark(int pageIndex, QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + m_pageIndex = pageIndex; + + QFont ft; + ft.setPointSize(NEXT_BTN_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + + m_park = new settingUiPark(this); + m_park->setFixedSize(UiConfig::GetInstance()->getUiWidth(), static_cast(UiConfig::GetInstance()->getUiHeight() * 0.7)); + + m_btnNext = new QPushButton(tr("下一步"), this); + m_btnNext->setFixedSize(UiConfig::GetInstance()->getUiWidth() / 3, + UiConfig::GetInstance()->getUiWidth() / 6); + m_btnNext->setFont(ft); + m_btnNext->setStyleSheet("QPushButton {" + "border: 0px;" + "border-radius:10px;" + "background-color:rgb(24, 144, 255);" + "focus{outline: none;}" + "}" + "QPushButton:hover { " + "background-color:rgb(24, 144, 255);" + "}" + "QPushButton:pressed {" + "background-color:rgb(222, 222, 222);" + "}"); + connect(m_btnNext, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QVBoxLayout* bLay = new QVBoxLayout(); + //bLay->addWidget(title, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addWidget(m_park, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addStretch(1); + bLay->addWidget(m_btnNext, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addStretch(1); + bLay->setMargin(0); + bLay->setSpacing(0); + setLayout(bLay); +} + +void settingUiFastCfgPark::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + m_park->setBackstageUiinterface(interface); +} + +void settingUiFastCfgPark::reset() +{ + m_park->reset(); +} + +void settingUiFastCfgPark::slotBtnClicked() +{ + emit signalJumpPage(0); //need page enum +} + +const int SettingUiQrcode::TIP_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {24, 38, 38, 14, 14}; +const QString SettingUiQrcode::BG_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = { +":/res/image/qrcode_middle.png", +":/res/image/qrcode_large.png", +":/res/image/qrcode_middle.png", +":/res/image/qrcode_large.png", +":/res/image/qrcode_middle.png" +}; + +int SettingUiQrcode::m_pageIndex = 0; +SettingUiQrcode::SettingUiQrcode(int pageIndex, QWidget *parent) : WidgetWithBackstageInterface(parent) +{ + m_pageIndex = pageIndex; + + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); + setAutoFillBackground(true); + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::white); + palette.setBrush(QPalette::Window,QBrush(QPixmap(BG_RES_FILE[UiConfig::GetInstance()->getScreenConfigIndex()]))); + setPalette(palette); + + QLabel* tip = new QLabel(tr("请将配置二维码对准扫码框"), this); + QFont ft; + ft.setPointSize(TIP_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + tip->setFont(ft); + QVBoxLayout* bLay = new QVBoxLayout(); + bLay->addWidget(tip, 1, Qt::AlignHCenter); + bLay->addStretch(9); + setLayout(bLay); + + m_widget_cMsg = new CenterMsgWidget(this); + m_widget_cMsg->move((UiConfig::GetInstance()->getUiWidth() - CenterMsgWidget::WIDGET_WIDTH[UiConfig::GetInstance()->getScreenConfigIndex()]) / 2, + static_cast(UiConfig::GetInstance()->getUiHeight() * 0.2)); + m_widget_cMsg->hide(); +} + +void SettingUiQrcode::reset() +{ + qDebug() << __PRETTY_FUNCTION__; + //vo显示设置 + if(nullptr == m_backstageIf){ + return; + } + + m_backstageIf->recoUiTypeSwitch(0, 0, UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); +} + +void SettingUiQrcode::slotCenterMsg(const int nPage, const QString& msg) +{ + m_widget_cMsg->showMsg(msg, nPage); + if(UiConfig::GetInstance()->isRkDevice()){ + update(); + } + //qDebug() << "slotCenterMsg:" << msg; + //if(!msg.isEmpty()){ + //QTimer::singleShot(10000, this, [this]{qDebug() << "SettingUiQrcode slotQrcodeCfgSuccessed";emit signalExitSettingUi();}); + //} +} + +void SettingUiQrcode::slotQrcodeFastCfgResult(bool isSuccessed) +{ + qDebug() << "slotQrcodeFastCfgResult:" << isSuccessed; + if(isSuccessed){ + QTimer::singleShot(10000, this, [this]{qDebug() << "SettingUiQrcode slotQrcodeCfgSuccessed";emit signalExitSettingUi();}); + } +} + + diff --git a/Linguist/setUi/settingUiFastCfg.h b/Linguist/setUi/settingUiFastCfg.h new file mode 100644 index 0000000..0cf4a4c --- /dev/null +++ b/Linguist/setUi/settingUiFastCfg.h @@ -0,0 +1,91 @@ +#ifndef SETTINGUIFASTCFG_H +#define SETTINGUIFASTCFG_H + +#include "settingUiDevMng.h" +#include "recoUiRecognize.h" + + + +class settingUiFastCfgWireNet : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + static int m_pageIndex; + explicit settingUiFastCfgWireNet(int pageIndex, QWidget *parent = nullptr); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + void signalJumpPage(int pageIndex); + +public slots: + void slotBtnClicked(); + +private: + settingUiDevMngNetWire* m_wireNet; + QPushButton* m_btnNext; +}; + +class settingUiPark : public SettingUiPage +{ + Q_OBJECT +public: + enum{ + FAST_CFG_DEV_POSI +#if 0 + FAST_CFG_PARK_INFO, + FAST_CFG_SERVER +#endif + }; + static int m_pageIndex; + explicit settingUiPark(QWidget *parent = nullptr); + void reset(); + +signals: + +public slots: + void slotItemClicked(QListWidgetItem*); +}; + +class settingUiFastCfgPark : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + static int m_pageIndex; + explicit settingUiFastCfgPark(int pageIndex, QWidget *parent = nullptr); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + void signalJumpPage(int pageIndex); + +public slots: + void slotBtnClicked(); + +private: + settingUiPark* m_park; + QPushButton* m_btnNext; +}; + +class SettingUiQrcode : public WidgetWithBackstageInterface +{ + Q_OBJECT +public: + static int m_pageIndex; + static const int TIP_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + static const QString BG_RES_FILE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + explicit SettingUiQrcode(int pageIndex, QWidget *parent = nullptr); + void reset(); +signals: + void signalExitSettingUi(); + +public slots: + void slotCenterMsg(const int nPage, const QString& msg); + void slotQrcodeFastCfgResult(bool isSuccessed); + +private: + CenterMsgWidget* m_widget_cMsg; +}; + + +#endif // SETTINGUIFASTCFG_H diff --git a/Linguist/setUi/settingUiInfo.cpp b/Linguist/setUi/settingUiInfo.cpp new file mode 100644 index 0000000..42e099f --- /dev/null +++ b/Linguist/setUi/settingUiInfo.cpp @@ -0,0 +1,120 @@ +#include "settingUiInfo.h" +#include +#include "UiConfig.h" + + +int settingUiInfo::m_pageIndex = 0; +settingUiInfo::settingUiInfo(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("设备编码"), "FTxxxxxxxxxxxx"), + SetOpn(tr("软件版本"), "FG_B020_V100R001Bxxx"), + SetOpn(tr("硬件配置"), "HWxxxxxxxxxxxxxx"), + SetOpn(tr("MAC地址"), "xx:xx:xx:xx:xx"), + SetOpn(tr("设备IP"), "xxx.xxx.xxx.xxx"), + SetOpn(tr("屏下NFC ID"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + SetOpn(tr("拓展NFC ID"), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), + SetOpn(tr("总容量(GB)"), "xx"), + SetOpn(tr("可用容量(GB)"), "x"), + SetOpn(tr("注册人数"), "xxxxx"), + SetOpn(tr("未上传通行记录"), "xxxxxx") + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiInfo()"; +} + +settingUiInfo::~settingUiInfo() +{ + qDebug() << "~settingUiInfo()"; +} + +void settingUiInfo::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + reset(); +} + +void settingUiInfo::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + const int iBufSize = 64; + char buf[iBufSize] = {'\0'}; + switch(i) + { + case INFO_CHECK_DEV_ID:qDebug() << "INFO_CHECK_DEV_ID"; + if(0 == m_backstageIf->getDeviceId(buf, iBufSize)){ + str = QString(buf); + } + break; + case INFO_CHECK_SOFT_VERSION:qDebug() << "INFO_CHECK_SOFT_VERSION"; + if(0 == m_backstageIf->getAppVersion(buf, iBufSize)){ + str = QString(buf); + } + break; + case INFO_CHECK_HARD_VERSION:qDebug() << "INFO_CHECK_HARD_VERSION"; + if(0 == m_backstageIf->getHardwareConfig(buf, iBufSize)){ + str = QString(buf); + } + break; + case INFO_CHECK_MAC:qDebug() << "INFO_CHECK_MAC"; + if(0 == m_backstageIf->getEthMac(buf, iBufSize)){ + str = QString(buf); + } + break; + case INFO_CHECK_IP:qDebug() << "INFO_CHECK_IP"; + { + int type = 0; + if(0 == m_backstageIf->getIP(buf, iBufSize, type)){ + str = QString(buf); + } + } + break; + case INFO_UNDER_SCREEN_NFC_MODULE_ID:qDebug() << "INFO_UNDER_SCREEN_NFC_MODULE_ID"; + str = QString::fromStdString(m_backstageIf->getUnderScreenNfcModuleId()); + break; + + case INFO_EXTEND_NFC_MODULE_ID:qDebug() << "INFO_EXTEND_NFC_MODULE_ID"; + str = QString::fromStdString(m_backstageIf->getExtendNfcModuleId()); + break; + case INFO_CHECK_SPACE_TOTAL:qDebug() << "INFO_CHECK_SPACE_TOTAL"; + { + float free = 0; + int total = 0; + if(0 == m_backstageIf->getStorSpace(total, free)){ + str = QString::number(total); + } + } + break; + case INFO_CHECK_SPACE_FREE:qDebug() << "INFO_CHECK_SPACE_FREE"; + { + float free = 0; + int total = 0; + if(0 == m_backstageIf->getStorSpace(total, free)){ + str.setNum(free, 'f', 1); + } + } + break; + case INFO_CHECK_PERSON_REG:qDebug() << "INFO_CHECK_PERSON_REG"; + str = QString::number(m_backstageIf->getRegisterNum()); + break; + case INFO_CHECK_NOT_UP_ACC_RED_QTY:qDebug() << "INFO_CHECK_NOT_UP_ACC_RED_QTY"; + str = QString::number(m_backstageIf->getAccessRecordNotUpload()); + break; + default: + break; + } + wdt->updateLabel(str); + } +} + + diff --git a/Linguist/setUi/settingUiInfo.h b/Linguist/setUi/settingUiInfo.h new file mode 100644 index 0000000..499728f --- /dev/null +++ b/Linguist/setUi/settingUiInfo.h @@ -0,0 +1,42 @@ +#ifndef SETTINGUIINFO_H +#define SETTINGUIINFO_H + +#include +#include "UiTools.h" + +class settingUiInfo : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + INFO_CHECK_DEV_ID, + INFO_CHECK_SOFT_VERSION, + INFO_CHECK_HARD_VERSION, + INFO_CHECK_MAC, + INFO_CHECK_IP, + INFO_UNDER_SCREEN_NFC_MODULE_ID, + INFO_EXTEND_NFC_MODULE_ID, + INFO_CHECK_SPACE_TOTAL, + INFO_CHECK_SPACE_FREE, + INFO_CHECK_PERSON_REG, + INFO_CHECK_NOT_UP_ACC_RED_QTY + }INFO_CHECK_E; + + static int m_pageIndex; + + explicit settingUiInfo(int pageIndex, QWidget *parent = nullptr); + ~settingUiInfo(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + +public slots: + void slotItemClicked(QListWidgetItem* item){Q_UNUSED(item);} + +private: + +}; + +#endif // SETTINGUIINFO_H diff --git a/Linguist/setUi/settingUiRecoSet.cpp b/Linguist/setUi/settingUiRecoSet.cpp new file mode 100644 index 0000000..87c4ae1 --- /dev/null +++ b/Linguist/setUi/settingUiRecoSet.cpp @@ -0,0 +1,296 @@ +#include "settingUiRecoSet.h" +#include +#include "UiConfig.h" + + +int settingUiRecoSet::m_pageIndex = 0; +settingUiRecoSet::settingUiRecoSet(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("身份核验"), "", myListWidget::enPropertySwitch), + SetOpn(tr("活体检测"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("人脸识别阈值"), "xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("人脸识别自定义阈值(0-100):"), "xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("居民二代身份证"), "", static_cast(myListWidget::enPropertySwitch | myListWidget::enPropertyIndent1)), + SetOpn(tr("口罩检测"), "", myListWidget::enPropertySwitch), + SetOpn(tr("未戴口罩禁止通行"), "", static_cast(myListWidget::enPropertySwitch | myListWidget::enPropertyIndent1)), + SetOpn(tr("健康码核验"), "", myListWidget::enPropertySwitch), + SetOpn(tr("允许无人脸核验"), "", static_cast(myListWidget::enPropertySwitch | myListWidget::enPropertyIndent1)), + SetOpn(tr("允许陌生人通行"), "", static_cast(myListWidget::enPropertySwitch | myListWidget::enPropertyIndent1)), + SetOpn(tr("核验通行条件"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiRecoSet()"; +} + +settingUiRecoSet::~settingUiRecoSet() +{ + qDebug() << "~settingUiRecoSet()"; +} + +void settingUiRecoSet::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + reset(); +} + +void settingUiRecoSet::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + switch(i) + { + case enRecoIdeSw: + case enRecoMaskSw: + case enRecoNoMaskNoPassSw: + case enRecoLiveSw: + case enRecoIDFaceVerify: + case enHealthCodeSw: + case enHealthCodeNoFaceRequiredSw: + case enHealthCodeAllowStrangerSw: + { + bool switch_option = false; + if(enRecoIdeSw == i){ + switch_option = m_backstageIf->getIdentificationSw(); + }else if(enRecoMaskSw == i){ + switch_option = m_backstageIf->getMaskCheckSwitch(); + }else if(enRecoNoMaskNoPassSw == i){ + switch_option = m_backstageIf->getNoMaskNoPassSwitch(); + }else if(enRecoLiveSw == i){ + switch_option = m_backstageIf->getLivingBodySw(); + }else if(enRecoIDFaceVerify == i){ + switch_option = m_backstageIf->getIDFaceVerifySw(); + }else if(enHealthCodeSw == i){ + switch_option = m_backstageIf->getHealthCodeSw(); + }else if(enHealthCodeNoFaceRequiredSw == i){ + switch_option = m_backstageIf->getHealthCodeNoFaceRequired(); + }else if(enHealthCodeAllowStrangerSw == i){ + switch_option = m_backstageIf->getHealthCodeAllowStranger(); + } + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + + case enRecoIdeThreCustom: + str = QString::number(m_backstageIf->getCustomSimilarity()); + break; + case enRecoIdeThre: + { + enSimilarityTh opt = m_backstageIf->getSimilarityTh(); + str = RecoSimThre[static_cast(opt)]; + } + break; + // case enRecoLiveThre: + // str = LivingThre[static_cast(m_backstageIf->getLivingBodyTh())]; + // break; + default: + break; + } + wdt->updateLabel(str); + } + controlListWidgetItemShow(m_backstageIf->getIdentificationSw(), enRecoLiveSw); + //controlListWidgetItemShow(m_backstageIf->getIdentificationSw(), enRecoLiveThre); + controlListWidgetItemShow(m_backstageIf->getIdentificationSw(), enRecoIdeThre); + controlListWidgetItemShow(m_backstageIf->getIdentificationSw() ? SimilarityThCustom == m_backstageIf->getSimilarityTh() : false, enRecoIdeThreCustom); + controlListWidgetItemShow(m_backstageIf->getIdentificationSw(), enRecoIDFaceVerify); + controlListWidgetItemShow(m_backstageIf->getMaskCheckSwitch(), enRecoNoMaskNoPassSw); + controlListWidgetItemShow(m_backstageIf->getHealthCodeSw(), enHealthCodeNoFaceRequiredSw); + controlListWidgetItemShow(m_backstageIf->getHealthCodeSw(), enHealthCodeAllowStrangerSw); + controlListWidgetItemShow(m_backstageIf->getHealthCodeSw(), enHealthCodePassCfg); +} + +void settingUiRecoSet::slotItemClicked(QListWidgetItem* item) +{ + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + switch(row){ + case enRecoIdeSw: + case enRecoMaskSw: + case enRecoNoMaskNoPassSw: + case enRecoLiveSw: + case enRecoIDFaceVerify: + case enHealthCodeSw: + case enHealthCodeNoFaceRequiredSw: + case enHealthCodeAllowStrangerSw: + { + bool setting_value = false; + + if(enRecoIdeSw == row){ + setting_value = static_cast(m_backstageIf->getIdentificationSw()); + } + else if(enRecoMaskSw == row){ + setting_value = static_cast(m_backstageIf->getMaskCheckSwitch()); + } + else if(enRecoNoMaskNoPassSw == row){ + setting_value = static_cast(m_backstageIf->getNoMaskNoPassSwitch()); + } + else if(enRecoLiveSw == row){ + setting_value = static_cast(m_backstageIf->getLivingBodySw()); + } + else if(enRecoIDFaceVerify == row){ + setting_value = static_cast(m_backstageIf->getIDFaceVerifySw()); + } + else if(enHealthCodeSw == row){ + setting_value = m_backstageIf->getHealthCodeSw(); + } + else if(enHealthCodeNoFaceRequiredSw == row){ + setting_value = m_backstageIf->getHealthCodeNoFaceRequired(); + } + else if(enHealthCodeAllowStrangerSw == row){ + setting_value = m_backstageIf->getHealthCodeAllowStranger(); + } + + setting_value = static_cast(!setting_value); + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + + if(enRecoIdeSw == row){ + m_backstageIf->setIdentificationSw(setting_value); + controlListWidgetItemShow(setting_value, enRecoLiveSw); + //controlListWidgetItemShow(setting_value, enRecoLiveThre); + controlListWidgetItemShow(setting_value, enRecoIdeThre); + controlListWidgetItemShow(setting_value, enRecoIDFaceVerify); + controlListWidgetItemShow(setting_value ? SimilarityThCustom == m_backstageIf->getSimilarityTh() : false, enRecoIdeThreCustom); + } + else if(enRecoMaskSw == row){ + m_backstageIf->setMaskCheckSwitch(setting_value); + controlListWidgetItemShow(setting_value, enRecoNoMaskNoPassSw); + } + else if(enRecoNoMaskNoPassSw == row){ + m_backstageIf->setNoMaskNoPassSwitch(setting_value); + } + else if(enRecoLiveSw == row){ + m_backstageIf->setLivingBodySw(setting_value); + } + else if(enRecoIDFaceVerify == row){ + m_backstageIf->setIDFaceVerifySw(setting_value); + } + else if(enHealthCodeSw == row){ + m_backstageIf->setHealthCodeSw(setting_value); + controlListWidgetItemShow(setting_value, enHealthCodeNoFaceRequiredSw); + controlListWidgetItemShow(setting_value, enHealthCodeAllowStrangerSw); + controlListWidgetItemShow(setting_value, enHealthCodePassCfg); + if(setting_value){ + myListWidget* wdg = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(enRecoIdeSw))); + if(wdg){wdg->updateIcon(":/res/image/on.png");} + wdg = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(enRecoIDFaceVerify))); + if(wdg){wdg->updateIcon(":/res/image/on.png");} + } + } + else if(enHealthCodeNoFaceRequiredSw == row){ + m_backstageIf->setHealthCodeNoFaceRequired(setting_value); + } + else if(enHealthCodeAllowStrangerSw == row){ + m_backstageIf->setHealthCodeAllowStranger(setting_value); + } + + } + break; + case enRecoIdeThreCustom: + { + int currentValue = 10; + int min = 0; + int max = 100; + QString tip("this is a line of prompt text"); +#ifndef DEBUG_MODE + if(enRecoIdeThreCustom == row){ + currentValue = m_backstageIf->getCustomSimilarity(); + min = 0; + max = 100; + tip.clear(); + } +#endif + SliderDialog dlg(currentValue, min, max, tip, parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString str("valueSet"); + int valueSet = dlg.getValueSet(); +#ifndef DEBUG_MODE + if(enRecoIdeThreCustom == row){ + m_backstageIf->setCustomSimilarity(valueSet); + str = QString::number(valueSet); + } +#endif + wdt->updateLabel(str); + } + } + break; + case enRecoIdeThre: + { + int choosed = 0; + QVector& options = const_cast&>(RecoSimThre); + if(enRecoIdeThre == row){ + choosed = static_cast(m_backstageIf->getSimilarityTh()); + } + #if 0 + else if(enRecoLiveThre == row){ + options = LivingThre; + choosed = static_cast(m_backstageIf->getLivingBodyTh()); + } + #endif + RadioBtnChooseDialog dlg(options, parent()->parent(), choosed); + if(dlg.exec() == QDialog::Accepted){ + int newChoosed = dlg.getChoosedIndex(); + if(newChoosed != choosed){ + if(enRecoIdeThre == row){ + m_backstageIf->setSimilarityTh(static_cast(newChoosed)); + if(SimilarityThCustom == static_cast(newChoosed)){ + //重新获取当前的阈值显示到条目上,因为当前是从别的档位切换过来的,阈值已经改变,设计的问题:只保存一个当前阈值,没有单独保存自定义的阈值 + QListWidgetItem* pItem = m_listWidget->item(enRecoIdeThreCustom); + myListWidget* swWidget = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(swWidget != nullptr){ + swWidget->updateLabel(QString::number(m_backstageIf->getCustomSimilarity())); + } + controlListWidgetItemShow(true, enRecoIdeThreCustom); + } + else{ + controlListWidgetItemShow(false, enRecoIdeThreCustom); + } + } + #if 0 + else if(enRecoLiveThre == row){ + m_backstageIf->setLivingBodyTh(static_cast(newChoosed)); + } + #endif + wdt->updateLabel(options[newChoosed]); + } + } + } + break; + case enHealthCodePassCfg: + { + const QStringList titles{"健康码色", "核酸检测", "行程信息", "疫苗"}; + const QVector sels{{"无限制", "仅绿码可通行", "绿码、黄码可通行", "绿码、黄码、红码可通行"}, + {"无限制", "限24小时内阴性", "限48小时内阴性", "限72小时内阴性", "限阴性"}, + {"无限制", "限14天内未到过中高风险地区"}, + {"无限制", "限至少打了第1针", "限至少打了第2针", "限至少打了第3针"} }; + ComSelectDialog dlg(titles, sels, parent()->parent()); + int codeColorCfg; + int c19tCfg; + int tripCfg; + int abtCfg; + m_backstageIf->getHealthCodePassCfg(codeColorCfg, c19tCfg, tripCfg, abtCfg); + dlg.setRow(0, codeColorCfg); + dlg.setRow(1, c19tCfg); + dlg.setRow(2, tripCfg); + dlg.setRow(3, abtCfg); + if(dlg.exec() == QDialog::Accepted){ + m_backstageIf->setHealthCodePassCfg(dlg.getRow(0), dlg.getRow(1), dlg.getRow(2), dlg.getRow(3)); + } + } + break; + default: + break; + } +} diff --git a/Linguist/setUi/settingUiRecoSet.h b/Linguist/setUi/settingUiRecoSet.h new file mode 100644 index 0000000..672af81 --- /dev/null +++ b/Linguist/setUi/settingUiRecoSet.h @@ -0,0 +1,56 @@ +#ifndef SETTINGUIRECOSET_H +#define SETTINGUIRECOSET_H + +#include +#include "UiTools.h" + +class settingUiRecoSet : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + enRecoIdeSw, + enRecoLiveSw, + //enRecoLiveThre, + enRecoIdeThre, + enRecoIdeThreCustom, + enRecoIDFaceVerify, + enRecoMaskSw, + enRecoNoMaskNoPassSw, + enHealthCodeSw, + enHealthCodeNoFaceRequiredSw, + enHealthCodeAllowStrangerSw, + enHealthCodePassCfg, + }enRecoSet; + + static int m_pageIndex; + + explicit settingUiRecoSet(int pageIndex, QWidget *parent = nullptr); + ~settingUiRecoSet(); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + void reset(); + +signals: + +protected slots: + void slotItemClicked(QListWidgetItem* item); + +private: + + const QVector RecoSimThre = { + tr("宽松"), + tr("一般"), + tr("适中"), + tr("严格"), + tr("极严格"), + tr("自定义") + }; + + const QVector LivingThre = { + tr("宽松"), + tr("一般"), + tr("严格") + }; +}; +#endif // SETTINGUIRECOSET_H diff --git a/Linguist/setUi/settingUiSysMng.cpp b/Linguist/setUi/settingUiSysMng.cpp new file mode 100644 index 0000000..ab30d4d --- /dev/null +++ b/Linguist/setUi/settingUiSysMng.cpp @@ -0,0 +1,308 @@ +#include +#include "settingUiSysMng.h" +#include "UiConfig.h" + + +int settingUiSysMng::m_pageIndex = 0; +settingUiSysMng::settingUiSysMng(int pageIndex, QWidget *parent) + : SettingUiPage(QVector{ + SetOpn(tr("设备语言"), "xxxxx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("数据加密"), "", myListWidget::enPropertySwitch), + SetOpn(tr("自动重启"), "", myListWidget::enPropertySwitch), + SetOpn(tr("自动重启时间"), "xx:xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("自动重启间隔(天)"), "xx", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyIndent1)), + SetOpn(tr("手动重启"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("服务器"), "xxxxxxxxxxxx:xxxx", myListWidget::enPropertyMoreArrow), + SetOpn(tr("数据清空"), "", myListWidget::enPropertyMoreArrow), + SetOpn(tr("恢复出厂设置"), "", static_cast(myListWidget::enPropertyMoreArrow | myListWidget::enPropertyRedWord)) + }, parent) +{ + m_pageIndex = pageIndex; + qDebug() << "settingUiSysMng()"; +} + +settingUiSysMng::~settingUiSysMng() +{ + qDebug() << "~settingUiSysMng()"; +} + +void settingUiSysMng::setBackstageUiinterface(BackstageInterfaceForUi *interface) +{ + m_backstageIf = interface; + reset(); +} + +void settingUiSysMng::reset() +{ + if(nullptr == m_backstageIf){ + return; + } + for(int i = 0; i < config.size(); i ++) + { + QListWidgetItem* pItem = m_listWidget->item(i); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(pItem)); + if(wdt == nullptr){ + return; + } + QString str; + const int iBufSize = 64; + char buf[iBufSize] = {'\0'}; + switch(i) + { + case SYS_MNG_LANGUAGE: + { + int lang = static_cast(m_backstageIf->getLanguage()); + if(lang >= 0 && lang < Language.size()){ + str = Language[lang]; + } + } + break; + case SYS_MNG_AUTO_REBOOT: + { + bool switch_option = false; + if(SYS_MNG_AUTO_REBOOT == i){ + switch_option = m_backstageIf->getAutoRebootSw(); + } + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + case SYS_MNG_AUTO_REBOOT_TIME: + if(0 == m_backstageIf->getAutoRebootTime(buf, iBufSize)){ + str = QString(buf); + } + break; + case SYS_MNG_AUTO_REBOOT_INTERVAL: + str = QString::number(m_backstageIf->getAutoRebootInterval()); + break; + case SYS_MNG_SERVER_ADDR: + if(0 == m_backstageIf->getServerAddr(buf, iBufSize)){ + str = QString(buf); + } + break; + case SYS_MNG_DATA_ENCRYPT:qDebug() << "SYS_MNG_DATA_ENCRYPT"; + { + bool switch_option = m_backstageIf->getDataEncryptSw(); + wdt->updateIcon(switch_option ? ":/res/image/on.png" : ":/res/image/off.png"); + } + break; + default: + break; + } + wdt->updateLabel(str); + } + controlListWidgetItemShow(m_backstageIf->getAutoRebootSw(), SYS_MNG_AUTO_REBOOT_TIME); + controlListWidgetItemShow(m_backstageIf->getAutoRebootSw(), SYS_MNG_AUTO_REBOOT_INTERVAL); + controlListWidgetItemShow(!UiConfig::GetInstance()->isFuncNotSupport(FuncDataEncrypt), SYS_MNG_DATA_ENCRYPT); +} + +void settingUiSysMng::slotItemClicked(QListWidgetItem* item) +{ + if(nullptr == m_backstageIf){ +#ifndef DEBUG_MODE + return; +#endif + } + int row = m_listWidget->currentRow(); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + switch(row){ + case SYS_MNG_LANGUAGE: + { + int choosed = 0; + const QVector& opts = Language; + if(SYS_MNG_LANGUAGE == row){ +#ifndef DEBUG_MODE + choosed = static_cast(m_backstageIf->getLanguage()); +#endif + } + + RadioBtnChooseDialog dlg(opts, parent()->parent(), choosed, &LanguageSup, ""); + if(QDialog::Accepted == dlg.exec()) + { + int newChoosed = dlg.getChoosedIndex(); + qDebug() << "newChoosed:" << newChoosed; + if(newChoosed != choosed){ + QuestionDialog queDlg(tr("您需要重新启动设备以设置并切换语言"), parent()->parent(), tr("重新启动")); + if(QDialog::Accepted == queDlg.exec()){ +#ifndef DEBUG_MODE + m_backstageIf->setLanguage(newChoosed); + PureColorPage* black = new PureColorPage(0); + black->show(); + QTimer::singleShot(1000, this, SLOT(slotSysReboot())); + //m_backstageIf->devReboot(); +#endif + wdt->updateLabel(opts[newChoosed]); + } + } + } + } + break; + + case SYS_MNG_DATA_ENCRYPT: + { + bool setting_value = !(m_backstageIf->getDataEncryptSw()); + QuestionDialog queDlg(setting_value ? tr("您确定要开启数据加密吗?若确定设备将重启!") : tr("您确定要关闭数据加密吗?若确定设备将重启!"), parent()->parent()); + if(QDialog::Accepted == queDlg.exec()){ + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); + m_backstageIf->setDataEncryptSw(setting_value); + QTimer::singleShot(1000, this, SLOT(slotSysReboot())); + } + } + break; + + case SYS_MNG_AUTO_REBOOT: + { + bool setting_value = false; +#ifndef DEBUG_MODE + if(SYS_MNG_AUTO_REBOOT == row){ + setting_value = static_cast(m_backstageIf->getAutoRebootSw()); + } +#endif + setting_value = static_cast(!setting_value); + wdt->updateIcon(setting_value ? ":/res/image/on.png" : ":/res/image/off.png"); +#ifndef DEBUG_MODE + if(SYS_MNG_AUTO_REBOOT == row){ + m_backstageIf->setAutoRebootSw(setting_value); + controlListWidgetItemShow(setting_value, SYS_MNG_AUTO_REBOOT_TIME); + controlListWidgetItemShow(setting_value, SYS_MNG_AUTO_REBOOT_INTERVAL); + } +#endif + } + break; + case SYS_MNG_AUTO_REBOOT_TIME: + { + const int iBufSize = 64; + char buf[iBufSize] = {'\0'}; + if(0 == m_backstageIf->getAutoRebootTime(buf, iBufSize)){ + QDateTime dateTime(QDateTime::currentDateTime()); + dateTime.setTime(QTime().fromString(QString(buf), "hh:mm")); + DateTimeDialog timeDlg(dateTime, parent()->parent(), false); + if(timeDlg.exec() == QDialog::Accepted){ + m_backstageIf->setAutoRebootTime(timeDlg.getValueSet().toString("hh:mm").toStdString().c_str()); + wdt->updateLabel(timeDlg.getValueSet().toString("hh:mm")); + } + } + } + break; + case SYS_MNG_AUTO_REBOOT_INTERVAL: + { + int currentValue = 10; + int min = 0; + int max = 100; + QString tip("this is a line of prompt text"); +#ifndef DEBUG_MODE + if(SYS_MNG_AUTO_REBOOT_INTERVAL == row){ + currentValue = m_backstageIf->getAutoRebootInterval(); + min = 1; + max = 100; + tip.clear(); + } +#endif + SliderDialog dlg(currentValue, min, max, tip, parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString str("valueSet"); + int valueSet = dlg.getValueSet(); +#ifndef DEBUG_MODE + if(SYS_MNG_AUTO_REBOOT_INTERVAL == row){ + m_backstageIf->setAutoRebootInterval(valueSet); + str = QString::number(valueSet); + } +#endif + wdt->updateLabel(str); + } + } + break; + case SYS_MNG_SERVER_ADDR: + { + bool settingFailed = true; + do{ + QStringList strs; + if(SYS_MNG_SERVER_ADDR == row){ + strs << tr("服务器地址:") << tr("端口:"); + } + LineEditInputDialog dlg(strs, parent()->parent()); + if(dlg.exec() == QDialog::Accepted) + { + QString str; + do{ + if(SYS_MNG_SERVER_ADDR == row){ + if("" != dlg.getRow(0) && "" != dlg.getRow(1)){ + bool isDigi = false; + int valueSet = dlg.getRow(1).toInt(&isDigi); + if( (!isDigi) || (valueSet < 0 || valueSet > 65535)){ + break; + } + if(m_backstageIf){ + str = dlg.getRow(0) + ":" + dlg.getRow(1); + m_backstageIf->setServerAddr(const_cast(str.toStdString().c_str())); + wdt->updateLabel(str); + settingFailed = false; + } + } + } + }while(0); + } + else { + settingFailed = false; + } + if(settingFailed) + { + InfoDialog(tr("设置有误,请重新输入!"), parent()->parent()).exec(); + } + }while(settingFailed); + } + break; + + case SYS_MNG_MAN_REBOOT: + case SYS_MNG_CLEAR_DATA: + case SYS_MNG_RESTORE: + { + QString que; + QString btnText; + if(SYS_MNG_MAN_REBOOT == row){ + que = tr("您确定重新启动FaceTick吗?"); + btnText = tr("重新启动"); + } + else if(SYS_MNG_CLEAR_DATA == row){ + que = tr("您确定清空数据吗?"); + btnText = tr("清空数据"); + } + else if(SYS_MNG_RESTORE == row){ + que = tr("您确定恢复出厂设置吗?"); + btnText = tr("恢复"); + } + QuestionDialog dlg(que, parent()->parent(), btnText); + if(QDialog::Accepted == dlg.exec()){ +#ifndef DEBUG_MODE + if(SYS_MNG_MAN_REBOOT == row){ + PureColorPage* black = new PureColorPage(0); + black->show(); + QTimer::singleShot(1000, this, SLOT(slotSysReboot())); + //m_backstageIf->devReboot(); + } + else if(SYS_MNG_CLEAR_DATA == row){ + m_backstageIf->cleanData(); + } + else if(SYS_MNG_RESTORE == row){ + m_backstageIf->recoveryFactorySetting(); + //create a black page before sys reboot + PureColorPage* black = new PureColorPage(0); + black->show(); + QTimer::singleShot(1000, this, SLOT(slotSysReboot())); + } +#endif + } + } + break; + default: + break; + } +} + +void settingUiSysMng::slotSysReboot() +{ + m_backstageIf->devReboot(); +} diff --git a/Linguist/setUi/settingUiSysMng.h b/Linguist/setUi/settingUiSysMng.h new file mode 100644 index 0000000..a13d313 --- /dev/null +++ b/Linguist/setUi/settingUiSysMng.h @@ -0,0 +1,55 @@ +#ifndef SETTINGUISYSMNG_H +#define SETTINGUISYSMNG_H + +#include +#include "UiTools.h" +#include "UiConfig.h" + +class settingUiSysMng : public SettingUiPage +{ + Q_OBJECT +public: + typedef enum + { + SYS_MNG_LANGUAGE, + SYS_MNG_DATA_ENCRYPT, + SYS_MNG_AUTO_REBOOT, + SYS_MNG_AUTO_REBOOT_TIME, + SYS_MNG_AUTO_REBOOT_INTERVAL, + SYS_MNG_MAN_REBOOT, + SYS_MNG_SERVER_ADDR, + SYS_MNG_CLEAR_DATA, + SYS_MNG_RESTORE + }SYS_MNG_E; + + static int m_pageIndex; + + explicit settingUiSysMng(int pageIndex, QWidget *parent = nullptr); + ~settingUiSysMng(); + void setBackstageUiinterface(BackstageInterfaceForUi *interface); + void reset(); + +signals: + +public slots: + void slotItemClicked(QListWidgetItem*); + void slotSysReboot(); + +private: + //简 繁 英 日 韩 西班牙 泰 葡萄牙 意大利 希伯来 法 德 土耳其 匈牙利 + const QVector Language{"简体中文", "繁體中文", "English", "日本語", "한국어.", + "Español", "ภาษาไทย", "Português", "Italiano", "היברית", + "Français", "Deutsch", "Türkçe", "Magyar"}; + #ifdef __HIMIX200__ + const QVector LanguageSup = {true, true, true, true, true, + true, true, true, true, true, + true, true, true, true}; + #else + const QVector LanguageSup = {true, true, true, true, true, + false, false, false, true, false, + false, false, false, false}; + #endif +}; + + +#endif // SETTINGUISYSMNG_H diff --git a/Linguist/setupUi/SetupUi.cpp b/Linguist/setupUi/SetupUi.cpp new file mode 100644 index 0000000..1703c7d --- /dev/null +++ b/Linguist/setupUi/SetupUi.cpp @@ -0,0 +1,364 @@ +#include "SetupUi.h" +#include "UiConfig.h" +#include +#include +#include +#include +static const int FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {24, 38, 38, 14, 14}; +SetupUiProtoDoc::SetupUiProtoDoc(QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + QLabel* doc = new QLabel(this); + doc->setWordWrap(true); + doc->setText(tr("这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档" + "这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档" + "这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档" + "这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档" + "这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档" + "这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档" + "这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档这是协议文档")); + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(doc); + setLayout(vlay); +} + +SetupUiPrivacyDoc::SetupUiPrivacyDoc(QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ +#if 0 + QTextEdit* doc = new QTextEdit(this); + doc->setReadOnly(true); + doc->verticalScrollBar()->hide(); + // QScroller::grabGesture(doc, QScroller::LeftMouseButtonGesture); + //doc->setVerticalScrollMode(QListWidget::ScrollPerPixel); + //doc->setWordWrap(true); +#else + QLabel* doc = new QLabel(this); + doc->setWordWrap(true); +#endif + doc->setText(tr("这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档" + "这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档" + "这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档" + "这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档" + "这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档这是隐私文档")); + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addWidget(doc); + setLayout(vlay); +} + +const int SetupUiConfig::JUMP_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {17, 27, 27, 10, 10}; +SetupUiConfig::SetupUiConfig(QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + QFont ft; + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + + QPalette palette; + palette.setColor(QPalette::ButtonText,QColor(15, 116, 248, 0xFF)); + + QLabel* label0 = new QLabel(tr("配置方式"), this); + label0->setFont(ft); + + const QString btnStyle{"QPushButton {" + "border: 0px;" + "border-radius:10px;" + "background-color:rgb(24, 144, 255);" + "focus{outline: none;}" + "}" + "QPushButton:hover { " + "background-color:rgb(24, 144, 255);" + "}" + "QPushButton:pressed {" + "background-color:rgb(222, 222, 222);" + "}"}; + m_btnQrcode = new QPushButton(tr("二维码配置"), this); + //m_btnQrcode->setIcon(QIcon(":/res/image/setup_qrcode_large.png")); + //m_btnQrcode->setToolButtonStyle(Qt::Qt::ToolButtonTextBesideIcon); + m_btnQrcode->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.75), + static_cast(UiConfig::GetInstance()->getUiWidth() * 0.37)); + m_btnQrcode->setFocusPolicy(Qt::NoFocus); + m_btnQrcode->setFont(ft); + m_btnQrcode->setStyleSheet(btnStyle); + connect(m_btnQrcode, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + m_btnManual = new QPushButton(tr("手动配置"), this); + //m_btnManual->setIcon(QIcon(":/res/image/setup_manual_large.png")); + m_btnManual->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.75), + static_cast(UiConfig::GetInstance()->getUiWidth() * 0.37)); + m_btnManual->setFocusPolicy(Qt::NoFocus); + m_btnManual->setFont(ft); + m_btnManual->setStyleSheet(btnStyle); + connect(m_btnManual, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + m_btnSkip = new QPushButton(tr("跳过"), this); + m_btnSkip->setFocusPolicy(Qt::NoFocus); + ft.setPointSize(JUMP_BTN_FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + m_btnSkip->setFont(ft); + m_btnSkip->setFlat(true); + m_btnSkip->setStyleSheet("border: 0px"); + //m_btnSkip->setFocusPolicy(Qt::NoFocus); + connect(m_btnSkip, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QVBoxLayout* bLay = new QVBoxLayout(); + bLay->addWidget(label0, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addWidget(m_btnQrcode, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addWidget(m_btnManual, 80, Qt::AlignCenter | Qt::AlignTop); + bLay->addWidget(m_btnSkip, 1, Qt::AlignRight | Qt::AlignBottom); + bLay->setSpacing(UiConfig::GetInstance()->getUiHeight() / 30); + bLay->setContentsMargins(UiConfig::GetInstance()->getUiWidth() / 20, + UiConfig::GetInstance()->getUiHeight() / 20, + UiConfig::GetInstance()->getUiWidth() / 20, + UiConfig::GetInstance()->getUiHeight() / 10); + setLayout(bLay); +} + +void SetupUiConfig::slotBtnClicked() +{ + const QObject* btn = sender(); + if(btn == m_btnQrcode){ + emit signalJumpPage(0); //need page enum + } + else if(btn == m_btnManual){ + emit signalJumpPage(1); + } + else if(btn == m_btnSkip){ + emit signalSetupDone(); + } +} + +SetupUiStart::SetupUiStart(QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + QFont ft; + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + + QPalette palette; + palette.setColor(QPalette::ButtonText,QColor(15, 116, 248, 0xFF)); + + QLabel* label0 = new QLabel(tr("请仔细阅读以下内容"), this); + label0->setFont(ft); + + m_btnProtocol = new QPushButton(tr("《XXXX协议》"), this); + m_btnProtocol->setPalette(palette); + m_btnProtocol->setFlat(true); + m_btnProtocol->setFont(ft); + m_btnProtocol->setFocusPolicy(Qt::NoFocus); + m_btnProtocol->setStyleSheet("border: 0px"); + connect(m_btnProtocol, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + m_btnPrivacy = new QPushButton(tr("《XX隐私声明》"), this); + m_btnPrivacy->setPalette(palette); + m_btnPrivacy->setFlat(true); + m_btnPrivacy->setFont(ft); + m_btnPrivacy->setFocusPolicy(Qt::NoFocus); + m_btnPrivacy->setStyleSheet("border: 0px"); + connect(m_btnPrivacy, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + m_rbAgree = new QRadioButton(tr("我已阅读并同意以上协议"), this); + m_rbAgree->setFocusPolicy(Qt::NoFocus); + m_rbAgree->setStyleSheet("QRadioButton::indicator:unchecked{image: url(:/res/image/select_1.png);}" + "QRadioButton::indicator:checked{image: url(:/res/image/select_2.png);}"); + connect(m_rbAgree, SIGNAL(pressed()), this, SLOT(slotRadioButtonPressed())); + + m_btnStart = new QPushButton(tr("开始使用"), this); + m_btnStart->setFixedSize(UiConfig::GetInstance()->getUiWidth() / 3, + UiConfig::GetInstance()->getUiWidth() / 6); + m_btnStart->setFont(ft); + m_btnStart->setFocusPolicy(Qt::NoFocus); + m_btnStart->setEnabled(false); + m_btnStart->setStyleSheet("QPushButton {" + "border: 0px;" + "border-radius:10px;" + "background-color:rgb(24, 144, 255);" + "focus{outline: none;}" + "}" + "QPushButton:hover { " + "background-color:rgb(24, 144, 255);" + "}" + "QPushButton:pressed {" + "background-color:rgb(222, 222, 222);" + "}"); + connect(m_btnStart, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QVBoxLayout* bLay = new QVBoxLayout(); + bLay->addWidget(label0, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addWidget(m_btnProtocol, 1, Qt::AlignCenter | Qt::AlignTop); + bLay->addWidget(m_btnPrivacy, 80, Qt::AlignCenter | Qt::AlignTop); + bLay->addWidget(m_rbAgree, 1, Qt::AlignCenter | Qt::AlignBottom); + bLay->addWidget(m_btnStart, 1, Qt::AlignCenter | Qt::AlignBottom); + bLay->setSpacing(UiConfig::GetInstance()->getUiHeight() / 30); + bLay->setContentsMargins(UiConfig::GetInstance()->getUiWidth() / 20, + UiConfig::GetInstance()->getUiHeight() / 20, + UiConfig::GetInstance()->getUiWidth() / 20, + UiConfig::GetInstance()->getUiHeight() / 10); + setLayout(bLay); +} + +void SetupUiStart::slotRadioButtonPressed() +{ + m_btnStart->setEnabled(!m_rbAgree->isChecked()); +} + +void SetupUiStart::slotBtnClicked() +{ + const QObject* btn = sender(); + if(btn == m_btnProtocol){ + emit signalJumpPage(0); //need page enum + } + else if(btn == m_btnPrivacy){ + emit signalJumpPage(1); + } + else if(btn == m_btnStart){ + emit signalJumpPage(2); + m_rbAgree->setChecked(false); + m_btnStart->setEnabled(false); + } +} + +SetupUiTop::SetupUiTop(QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + m_btnBack = new QPushButton(this); + setButtonBackImage(m_btnBack, ":res/image/ProjectSet_return.png", 37, 61); + //m_btnBack->setFixedWidth(UiConfig::GetInstance()->getUiWidth() / 10); + m_btnBack->setFocusPolicy(Qt::NoFocus); + m_btnBack->hide(); + connect(m_btnBack, SIGNAL(clicked()), this, SIGNAL(signalReturnBtnClicked())); + + QHBoxLayout* hLay = new QHBoxLayout(); + hLay->addWidget(m_btnBack, 1, Qt::AlignLeft); + hLay->setContentsMargins(UiConfig::GetInstance()->getUiWidth() / 15, + UiConfig::GetInstance()->getUiHeight() / 40, 0, + UiConfig::GetInstance()->getUiHeight() / 80); + setLayout(hLay); +} + +void SetupUiTop::hideBackBtn(bool hide) +{ + if(hide){ + m_btnBack->hide(); + } + else{ + m_btnBack->show(); + } +} + + +SetupUi::SetupUi(QWidget *parent) : WidgetWithBackstageInterface(parent) +{ + QPalette pal = palette(); + pal.setColor(QPalette::Background, Qt::transparent); + setPalette(pal); + + m_topbar = new SetupUiTop(this); + m_topbar->setAttribute(Qt::WA_TranslucentBackground); + m_topbar->setFixedHeight(UiConfig::GetInstance()->getUiHeight() / 12); + connect(m_topbar, SIGNAL(signalReturnBtnClicked()), this, SLOT(slotBtnClicked())); + + QFont ft; + ft.setPointSize(FONT_SIZE[UiConfig::GetInstance()->getScreenConfigIndex()]); + + m_stackPages = new QStackedWidget(this); + + m_pageStart = new SetupUiStart(this); + connect(m_pageStart, SIGNAL(signalJumpPage(int)), this, SLOT(slotJumpPage(int))); + m_stackPages->addWidget(m_pageStart); + + m_pageProt = new SetupUiProtoDoc(this); + m_stackPages->addWidget(m_pageProt); + + m_pagePriv= new SetupUiPrivacyDoc(this); + m_stackPages->addWidget(m_pagePriv); + + m_pageConfig = new SetupUiConfig(this); + connect(m_pageConfig, SIGNAL(signalJumpPage(int)), this, SLOT(slotJumpPage(int))); + connect(m_pageConfig, SIGNAL(signalSetupDone()), this, SLOT(slotSetupDone())); + m_stackPages->addWidget(m_pageConfig); + + m_pageQrcode = new SettingUiQrcode(0, this); + m_stackPages->addWidget(m_pageQrcode); + connect(parent, SIGNAL(signalCenterMsg(const int, const QString&)), m_pageQrcode, SLOT(slotCenterMsg(const int, const QString&))); + connect(parent, SIGNAL(signalQrcodeFastCfgResult(bool)), m_pageQrcode, SLOT(slotQrcodeFastCfgResult(bool))); + connect(m_pageQrcode, SIGNAL(signalExitSettingUi()), this, SLOT(slotSetupDone())); + + + m_pageManualNet = new settingUiFastCfgWireNet(0, this); + connect(m_pageManualNet, SIGNAL(signalJumpPage(int)), this, SLOT(slotJumpPage(int))); + m_stackPages->addWidget(m_pageManualNet); + + m_pageManualPark = new settingUiFastCfgPark(0, this); +#if 0 + connect(m_pageManualPark, SIGNAL(signalSetupDone()), this, SLOT(slotSetupDone())); +#else + connect(m_pageManualPark, SIGNAL(signalJumpPage(int)), this, SLOT(slotJumpPage(int))); +#endif + + m_stackPages->addWidget(m_pageManualPark); + + + QVBoxLayout* bLay = new QVBoxLayout(); + bLay->addWidget(m_topbar); + bLay->addWidget(m_stackPages); + bLay->setSpacing(0); + bLay->setMargin(0); + setLayout(bLay); + //hide protocol page until doc done + m_stackPages->setCurrentIndex(3); + //hide protocol page until doc done end +} + +void SetupUi::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; + m_pageStart->setBackstageUiinterface(interface); + m_pageQrcode->setBackstageUiinterface(interface); + m_pageManualNet->setBackstageUiinterface(interface); + m_pageManualPark->setBackstageUiinterface(interface); +} + +void SetupUi::slotSetupDone() +{ + m_backstageIf->setSetupAlreadyFlag(); + emit signalSetupDone(); + UiConfig::GetInstance()->setFastCfgStatus(false); +} + + +void SetupUi::slotBtnClicked() +{ + const QObject* btn = sender(); + if(m_pagePath.size()){ + m_stackPages->setCurrentIndex(m_pagePath.pop()); + } + //hide protocol page until doc done + if(3 == m_stackPages->currentIndex()){ + m_topbar->hideBackBtn(true); + } + //hide protocol page until doc done end +} + +void SetupUi::slotJumpPage(int pageIndex) +{ + m_pagePath.push(m_stackPages->currentIndex()); + const QObject* page = sender(); + if(page == m_pageStart){ + m_stackPages->setCurrentIndex(pageIndex + 1);//1:pageIndexOffset for this page + + } + else if(page == m_pageConfig){ + m_stackPages->setCurrentIndex(pageIndex + 4);//4:pageIndexOffset for this page + qDebug() << "page index:" << pageIndex; + if(pageIndex == 0){ //qrcode config + UiConfig::GetInstance()->setFastCfgStatus(true); + } + else if(pageIndex == 1){//manual cfg, need enum + m_pageManualNet->reset(); + } + } + else if(page == m_pageManualNet){ + m_stackPages->setCurrentIndex(pageIndex + 6);//6:pageIndexOffset for this page + m_pageManualPark->reset(); + } + else if(page == m_pageManualPark){ + m_stackPages->setCurrentIndex(4);//to qrcode page, need enum + UiConfig::GetInstance()->setFastCfgStatus(true); + } + m_topbar->hideBackBtn(false); +} + + diff --git a/Linguist/setupUi/SetupUi.h b/Linguist/setupUi/SetupUi.h new file mode 100644 index 0000000..657ea75 --- /dev/null +++ b/Linguist/setupUi/SetupUi.h @@ -0,0 +1,109 @@ +#ifndef SETUPUI_H +#define SETUPUI_H + +#include "UiTools.h" +#include +#include +#include "settingUiFastCfg.h" + +class SetupUiProtoDoc : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + explicit SetupUiProtoDoc(QWidget *parent = nullptr); +}; + +class SetupUiPrivacyDoc : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + explicit SetupUiPrivacyDoc(QWidget *parent = nullptr); +}; + +class SetupUiStart : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + explicit SetupUiStart(QWidget *parent = nullptr); + +signals: + void signalJumpPage(int pageIndex); + +public slots: + void slotRadioButtonPressed(); + void slotBtnClicked(); + +private: + QPushButton* m_btnProtocol; + QPushButton* m_btnPrivacy; + QRadioButton* m_rbAgree; + QPushButton* m_btnStart; +}; + +class SetupUiConfig : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + static const int JUMP_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY]; + explicit SetupUiConfig(QWidget *parent = nullptr); + +signals: + void signalSetupDone(); + void signalJumpPage(int pageIndex); + +public slots: + void slotBtnClicked(); + +private: + QPushButton* m_btnQrcode; + QPushButton* m_btnManual; + QPushButton* m_btnSkip; +}; + +class SetupUiTop : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + explicit SetupUiTop(QWidget *parent = nullptr); + void hideBackBtn(bool hide); + +signals: + void signalReturnBtnClicked(); + +public slots: + +private: + QPushButton* m_btnBack; +}; + +class SetupUi : public WidgetWithBackstageInterface +{ + Q_OBJECT +public: + explicit SetupUi(QWidget *parent = nullptr); + void setBackstageUiinterface(BackstageInterfaceForUi* interface); + +signals: + void signalSetupDone(); + +public slots: + void slotBtnClicked(); + void slotSetupDone(); + void slotJumpPage(int pageIndex); + +private: + SetupUiTop* m_topbar; + QStackedWidget* m_stackPages; + QStack m_pagePath; + + SetupUiStart* m_pageStart; + SetupUiProtoDoc* m_pageProt; + SetupUiPrivacyDoc* m_pagePriv; + SetupUiConfig* m_pageConfig; + SettingUiQrcode* m_pageQrcode; + settingUiFastCfgWireNet* m_pageManualNet; + settingUiFastCfgPark* m_pageManualPark; + +}; + +#endif // SETUPUI_H diff --git a/Linguist/utility/AsyncEvent.h b/Linguist/utility/AsyncEvent.h new file mode 100644 index 0000000..ebb7621 --- /dev/null +++ b/Linguist/utility/AsyncEvent.h @@ -0,0 +1,28 @@ +#ifndef __ASYNCEVENT_H__ +#define __ASYNCEVENT_H__ + +#include "rw_zlog.h" +#include +#include +#include + +class AsyncEvent : public QEvent { +public: + using Functor = std::function; + AsyncEvent(Functor &&functor) + : QEvent(static_cast(QEvent::registerEventType())), m_functor(std::forward(functor)) { + } + + ~AsyncEvent() { + if (QCoreApplication::closingDown()) { + LOGW("QCoreApplication closed,skip handle task."); + return; + } + if (m_functor) m_functor(); + } + +private: + Functor m_functor; +}; + +#endif // __ASYNCEVENT_H__ \ No newline at end of file diff --git a/Linguist/utility/DndModeCountDownItem.cpp b/Linguist/utility/DndModeCountDownItem.cpp new file mode 100644 index 0000000..29ed5a7 --- /dev/null +++ b/Linguist/utility/DndModeCountDownItem.cpp @@ -0,0 +1,64 @@ +#include "DndModeCountDownItem.h" +#include "rw_zlog.h" +#include +#include +#include + +DndModeCountDownItem::DndModeCountDownItem(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) { + m_label = new QLabel(this); + QFont font; + m_label->setMargin(0); + font.setPointSize(20); + m_label->setFont(font); + + auto hint = new QLabel(this); + font.setPointSize(12); + hint->setFont(font); + hint->setText("后结束"); + hint->setMargin(0); + + auto layout = new QHBoxLayout(this); + layout->addWidget(m_label); + layout->addWidget(hint); + layout->setContentsMargins(0, 0, 0, 0); + layout->setSpacing(0); + + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText, Qt::black); + setPalette(palette); +} + +void DndModeCountDownItem::setEndTime(const std::chrono::system_clock::time_point &endTime) { + auto now = std::chrono::system_clock::now(); + m_endTime = endTime; + if (m_endTime > now) { + if (m_timerId < 0) m_timerId = startTimer(500); + } else { + if (m_timerId >= 0) { + killTimer(m_timerId); + m_timerId = -1; + } + } +} + +void DndModeCountDownItem::timerEvent(QTimerEvent *event) { + constexpr int SencondsOfMinute = 60; + constexpr int SencondsOfHour = SencondsOfMinute * 60; + constexpr int SencondsOfDay = SencondsOfHour * 24; + + using namespace std::chrono; + auto now = system_clock::now(); + int duration = duration_cast(m_endTime - now).count(); + if (duration <= 0) { + killTimer(m_timerId); + m_timerId = -1; + } + + int days = duration / SencondsOfDay; + int hours = (duration - days * SencondsOfDay) / SencondsOfHour; + int minutes = (duration - days * SencondsOfDay - hours * SencondsOfHour) / SencondsOfMinute; + int sec = (duration - days * SencondsOfDay - hours * SencondsOfHour - minutes * SencondsOfMinute); + + m_label->setText( + QString("%1:%2:%3").arg(hours, 2, 10, QLatin1Char('0')).arg(minutes, 2, 10, QLatin1Char('0')).arg(sec, 2, 10, QLatin1Char('0'))); +} \ No newline at end of file diff --git a/Linguist/utility/DndModeCountDownItem.h b/Linguist/utility/DndModeCountDownItem.h new file mode 100644 index 0000000..2e27f15 --- /dev/null +++ b/Linguist/utility/DndModeCountDownItem.h @@ -0,0 +1,23 @@ +#ifndef __DNDMODECOUNTDOWNITEM_H__ +#define __DNDMODECOUNTDOWNITEM_H__ + +#include +#include + +class QLabel; + +class DndModeCountDownItem : public QWidget { + Q_OBJECT +public: + DndModeCountDownItem(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); + void setEndTime(const std::chrono::system_clock::time_point &endTime); + +protected: + void timerEvent(QTimerEvent *event) final; + +private: + QLabel *m_label = nullptr; + std::chrono::system_clock::time_point m_endTime; + int m_timerId = -1; +}; +#endif // __DNDMODECOUNTDOWNITEM_H__ \ No newline at end of file diff --git a/Linguist/utility/SwitchControl.cpp b/Linguist/utility/SwitchControl.cpp new file mode 100644 index 0000000..07b4adf --- /dev/null +++ b/Linguist/utility/SwitchControl.cpp @@ -0,0 +1,155 @@ +#include +#include +#include "SwitchControl.h" + +SwitchControl::SwitchControl(QWidget *parent) + : QWidget(parent), + m_bChecked(false), + m_background(Qt::black), + m_checkedColor(0, 150, 136), + m_disabledColor(190, 190, 190), + m_thumbColor(Qt::white), + m_radius(8.0), + m_nHeight(16), + m_nMargin(3) +{ + // 鼠标滑过光标形状 - 手型 + setCursor(Qt::PointingHandCursor); + + // 连接信号槽 + connect(&m_timer, SIGNAL(timeout()), this, SLOT(onTimeout())); +} + +// 绘制开关 +void SwitchControl::paintEvent(QPaintEvent *event) +{ + Q_UNUSED(event); + + QPainter painter(this); + painter.setPen(Qt::NoPen); + painter.setRenderHint(QPainter::Antialiasing); + + QPainterPath path; + QColor background; + QColor thumbColor; + qreal dOpacity; + if (isEnabled()) { // 可用状态 + if (m_bChecked) { // 打开状态 + background = m_checkedColor; + thumbColor = m_checkedColor; + dOpacity = 0.600; + } else { //关闭状态 + background = m_background; + thumbColor = m_thumbColor; + dOpacity = 0.800; + } + } else { // 不可用状态 + background = m_background; + dOpacity = 0.260; + thumbColor = m_disabledColor; + } + // 绘制大椭圆 + painter.setBrush(background); + painter.setOpacity(dOpacity); + path.addRoundedRect(QRectF(m_nMargin, m_nMargin, width() - 2 * m_nMargin, height() - 2 * m_nMargin), m_radius, m_radius); + painter.drawPath(path.simplified()); + + // 绘制小椭圆 + painter.setBrush(thumbColor); + painter.setOpacity(1.0); + painter.drawEllipse(QRectF(m_nX - (m_nHeight / 2), m_nY - (m_nHeight / 2), height(), height())); +} + +// 鼠标按下事件 +void SwitchControl::mousePressEvent(QMouseEvent *event) +{ + if (isEnabled()) { + if (event->buttons() & Qt::LeftButton) { + event->accept(); + } else { + event->ignore(); + } + } +} + +// 鼠标释放事件 - 切换开关状态、发射toggled()信号 +void SwitchControl::mouseReleaseEvent(QMouseEvent *event) +{ + if (isEnabled()) { + if ((event->type() == QMouseEvent::MouseButtonRelease) && (event->button() == Qt::LeftButton)) { + event->accept(); + m_bChecked = !m_bChecked; + emit toggled(m_bChecked); + emit signal_clicked(m_bChecked); + m_timer.start(10); + } else { + event->ignore(); + } + } +} + +// 大小改变事件 +void SwitchControl::resizeEvent(QResizeEvent *event) +{ + m_nX = m_nHeight / 2; + m_nY = m_nHeight / 2; + QWidget::resizeEvent(event); +} + +// 默认大小 +QSize SwitchControl::sizeHint() const +{ + return minimumSizeHint(); +} + +// 最小大小 +QSize SwitchControl::minimumSizeHint() const +{ + return QSize(2 * (m_nHeight + m_nMargin), m_nHeight + 2 * m_nMargin); +} + +// 切换状态 - 滑动 +void SwitchControl::onTimeout() +{ + if (m_bChecked) { + m_nX += 1; + if (m_nX >= width() - m_nHeight) + m_timer.stop(); + } else { + m_nX -= 1; + if (m_nX <= m_nHeight / 2) + m_timer.stop(); + } + update(); +} + +// 返回开关状态 - 打开:true 关闭:false +bool SwitchControl::isToggled() const +{ + return m_bChecked; +} + +// 设置开关状态 +void SwitchControl::setToggle(bool checked) +{ + m_bChecked = checked; + m_timer.start(10); +} + +// 设置背景颜色 +void SwitchControl::setBackgroundColor(QColor color) +{ + m_background = color; +} + +// 设置选中颜色 +void SwitchControl::setCheckedColor(QColor color) +{ + m_checkedColor = color; +} + +// 设置不可用颜色 +void SwitchControl::setDisbaledColor(QColor color) +{ + m_disabledColor = color; +} diff --git a/Linguist/utility/SwitchControl.h b/Linguist/utility/SwitchControl.h new file mode 100644 index 0000000..6bc2a24 --- /dev/null +++ b/Linguist/utility/SwitchControl.h @@ -0,0 +1,69 @@ +#ifndef SWITCH_CONTROL +#define SWITCH_CONTROL + +#include +#include + +class SwitchControl : public QWidget +{ + Q_OBJECT + +public: + explicit SwitchControl(QWidget *parent = nullptr); + + // 返回开关状态 - 打开:true 关闭:false + bool isToggled() const; + + // 设置开关状态 + void setToggle(bool checked); + + // 设置背景颜色 + void setBackgroundColor(QColor color); + + // 设置选中颜色 + void setCheckedColor(QColor color); + + // 设置不可用颜色 + void setDisbaledColor(QColor color); + +protected: + // 绘制开关 + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + + // 鼠标按下事件 + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + + // 鼠标释放事件 - 切换开关状态、发射toggled()信号 + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + + // 大小改变事件 + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + + // 缺省大小 + QSize sizeHint() const Q_DECL_OVERRIDE; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + +signals: + // 状态改变时,发射信号 + void toggled(bool checked); + void signal_clicked(bool state); + +private slots: + // 状态切换时,用于产生滑动效果 + void onTimeout(); + +private: + bool m_bChecked; // 是否选中 + QColor m_background; // 背景颜色 + QColor m_checkedColor; // 选中颜色 + QColor m_disabledColor; // 不可用颜色 + QColor m_thumbColor; // 拇指颜色 + qreal m_radius; // 圆角 + qreal m_nX; // x点坐标 + qreal m_nY; // y点坐标 + qint16 m_nHeight; // 高度 + qint16 m_nMargin; // 外边距 + QTimer m_timer; // 定时器 +}; + +#endif // SWITCH_CONTROL diff --git a/Linguist/utility/UiTools.cpp b/Linguist/utility/UiTools.cpp new file mode 100644 index 0000000..9f0debb --- /dev/null +++ b/Linguist/utility/UiTools.cpp @@ -0,0 +1,3146 @@ +#include "UiTools.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "UiConfig.h" +#include "rw_zlog.h" +#include "ScopeGuard.h" + +WidgetWithBackstageInterface::WidgetWithBackstageInterface(QWidget *parent) : QWidget(parent), m_backstageIf(nullptr) +{ +} + +WidgetWithBackstageInterface::~WidgetWithBackstageInterface() +{ +} + +void WidgetWithBackstageInterface::setBackstageUiinterface(BackstageInterfaceForUi* interface) +{ + m_backstageIf = interface; +} + +CustomDialog::CustomDialog(const QString& okBtnText, QObject *bgWidget, const QString& cancelBtnText, int timeout) : QDialog(), m_timeout(timeout) +{ + dialogWidth = static_cast(UiConfig::GetInstance()->getUiWidth() * 0.8); + dialogHeight = static_cast(UiConfig::GetInstance()->getUiHeight() * 0.2); + resize(dialogWidth, dialogHeight); + + QPalette palette(this->palette()); + hbtmLayout = new QHBoxLayout(); + + if("" != cancelBtnText){ + m_btn_cancle = new QPushButton(this); + m_btn_cancle->setFixedSize(dialogWidth / 2, dialogHeight / 4); + m_btn_cancle->setText(cancelBtnText); + palette.setColor(QPalette::ButtonText,QColor(92, 89, 93, 255)); + m_btn_cancle->setPalette(palette); + m_btn_cancle->setStyleSheet("background-color: transparent;border-top: 1px solid #DFDDEB;border-right: 1px solid #DFDDEB;"); + connect(m_btn_cancle, SIGNAL(clicked(bool)), this, SLOT(slotCancleBtnClicked())); + + hbtmLayout->addWidget(m_btn_cancle); + } + + if("" != okBtnText){ + m_btn_ok = new QPushButton(this); + m_btn_ok->setDefault(true); + if("" != cancelBtnText){ + m_btn_ok->setFixedSize(dialogWidth / 2, dialogHeight / 4); + m_btn_ok->setStyleSheet("background-color: transparent;border-top: 1px solid #DFDDEB;border-left: 1px solid #DFDDEB;"); + } + else { + m_btn_ok->setFixedSize(dialogWidth, dialogHeight / 4); + m_btn_ok->setStyleSheet("background-color: transparent;border-top: 1px solid #DFDDEB;"); + } + m_btn_ok->setText(okBtnText); + palette.setColor(QPalette::ButtonText,QColor(15, 116, 248, 0xFF)); + m_btn_ok->setPalette(palette); + connect(m_btn_ok, SIGNAL(clicked(bool)), this, SLOT(slotConfirmBtnClicked())); + + hbtmLayout->addWidget(m_btn_ok); + } + + hbtmLayout->setSpacing(0); + hbtmLayout->setMargin(0); + + if(nullptr != bgWidget){ + connect(this, SIGNAL(signalShowShadowPage(bool)), bgWidget, SLOT(slotShowShadowPage(bool))); + emit signalShowShadowPage(true); + } + + if(m_timeout){ + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(slotCancleBtnClicked()) ); + m_timer->start(m_timeout); + } + +} + +CustomDialog::~CustomDialog() +{ + emit signalShowShadowPage(false); +} + +void CustomDialog::slotCancleBtnClicked() +{ + done(Rejected); +} + +void CustomDialog::slotConfirmBtnClicked() +{ + done(Accepted); +} + +void CustomDialog::paintEvent(QPaintEvent *event) +{ + /* + //圆角 + QBitmap bmp(this->size()); + bmp.fill(); + QPainter p(&bmp); + p.setPen(Qt::NoPen); + p.setBrush(Qt::black); + p.drawRoundedRect(bmp.rect(),10,10); + setMask(bmp); + + //绘制边框 + QStyleOption opt; + opt.initFrom(this); + QPainter pr(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &pr, this);//绘制样式 + */ + + QPainter painter(this); + if(UiConfig::GetInstance()->isRkDevice()){ + painter.fillRect(this->rect(), QColor(UiConfig::SUB_STYLE_COLOR_RED, UiConfig::SUB_STYLE_COLOR_GREEN, UiConfig::SUB_STYLE_COLOR_BLUE, UiConfig::SUB_STYLE_COLOR_TRAN)); + } + else{ + painter.fillRect(this->rect(), QColor(UiConfig::MAIN_STYLE_COLOR_RED, UiConfig::MAIN_STYLE_COLOR_GREEN, UiConfig::MAIN_STYLE_COLOR_BLUE, UiConfig::MAIN_STYLE_COLOR_TRAN)); + } + return QWidget::paintEvent(event); +} + +bool CustomDialog::eventFilter(QObject *watched, QEvent *event) +{ + if( watched == this){ + if(event->type() == QEvent::MouseButtonPress){ + qDebug() << "CustomDialog mouse clicked"; + if(m_timeout){ + m_timer->start(m_timeout); + } + } + } + else{ + return QWidget::eventFilter(watched, event); + } + return false; +} + +bool CustomDialog::event(QEvent *event) +{ + switch( event->type() ) + { + case QEvent::TouchBegin: + qDebug() << "CustomDialog touch begin"; + event->accept(); + if(m_timeout){ + m_timer->start(m_timeout); + } + //return true; + break; + case QEvent::TouchUpdate: + qDebug() << "CustomDialog touch update"; + event->accept(); + //return true; + break; + case QEvent::TouchEnd: + qDebug() << "CustomDialog touch end"; + event->accept(); + if(m_timeout){ + m_timer->start(m_timeout); + } + //return true; + break; + default: + break; + } + return QWidget::event(event); +} + +#if 1 +PasswordDialog::PasswordDialog(const QString& title, const QString& tip1, int timeout, QObject *bgWidget, const QString& pwd, const QString& tip0, + const QString& okBtn, const QString& cancelBtn) : CustomDialog (okBtn, bgWidget, cancelBtn, timeout), m_bgWidget(bgWidget) +{ + setAttribute(Qt::WA_AcceptTouchEvents); + + QVBoxLayout* vbLayout = new QVBoxLayout(); + + const int fontSize = UiConfig::GetInstance()->getGlobalFontSize(); + QFont ft; + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,QColor(92, 89, 93, 255)); + if(!tip0.isNull()){ + QLabel *labelTip0 = new QLabel(this); + labelTip0->setText(tip0); + ft.setPointSize(static_cast(fontSize * 0.7)); + labelTip0->setFont(ft); + labelTip0->setPalette(palette); + vbLayout->addWidget(labelTip0, 1, Qt::AlignLeft); + } + + QLabel *m_label_msg = new QLabel(this); + m_label_msg->setText(title); + ft.setPointSize(fontSize); + m_label_msg->setFont(ft); + vbLayout->addWidget(m_label_msg, 2, Qt::AlignCenter); + + QLabel *labelTip1 = new QLabel(this); + labelTip1->setText(tip1); + labelTip1->setPalette(palette); + ft.setPointSize(static_cast(fontSize * 0.7)); + labelTip1->setFont(ft); + vbLayout->addWidget(labelTip1, 1, Qt::AlignCenter); + + m_lineEdit_pwd = new LineEditWithKeyboard(this); + keyboard::GetInstance(m_lineEdit_pwd); + if(!pwd.isEmpty()){ + m_lineEdit_pwd->setText(pwd); + } + + m_lineEdit_pwd->setEchoMode(QLineEdit::Password); + m_lineEdit_pwd->setFixedSize(dialogWidth / 2, dialogHeight / 4); + palette.setColor(QPalette::Text,QColor(92, 89, 93, 255)); //0x94, 0x9e, 0xba, 0xFF + m_lineEdit_pwd->setPalette(palette); + m_lineEdit_pwd->setStyleSheet("background:transparent;border-width:0;border-style:outset"); + //m_lineEdit_pwd->setStyleSheet("m_lineEdit_pwd{border-bottom:1px solid #648EC9;}");//background-color: transparent; + + m_btn_visable = new QPushButton(this); + setButtonBackImage(m_btn_visable, ":res/image/eye-close.png", 30, 30); + #if 0 + m_btn_factory = new QPushButton(this); + m_btn_factory->setText(tr("恢复出厂")); + palette.setColor(QPalette::ButtonText,QColor(0x94, 0x9e, 0xba, 0xFF)); + m_btn_factory->setPalette(palette); + m_btn_factory->setStyleSheet("QPushButton{background-color: transparent ;" + "border:0px;border-left:1px ;border-right:1px ;border-top:1px }"); + #endif + + QHBoxLayout* hbLayout_pwd = new QHBoxLayout(); + hbLayout_pwd->addWidget(m_lineEdit_pwd); + hbLayout_pwd->addWidget(m_btn_visable); + hbLayout_pwd->setContentsMargins(dialogWidth / 4, 0, 0, 0); + + vbLayout->addLayout(hbLayout_pwd, 1); + #if 0 + vbLayout->addWidget(m_btn_factory, 1, Qt::AlignLeft | Qt::AlignTop); + #endif + vbLayout->addLayout(hbtmLayout, 1); + vbLayout->setSpacing(10); + vbLayout->setMargin(0); + setLayout(vbLayout); + setWindowTitle(tr("工程密码")); + + connect(m_btn_visable, SIGNAL(clicked(bool)), this, SLOT(slotPwdVisableBtnClicked())); + #if 0 + connect(m_btn_factory, SIGNAL(clicked(bool)), this, SLOT(slotRestoreBtnClicked())); + #endif +} + +PasswordDialog::~PasswordDialog() +{ +} + +void PasswordDialog::slotPwdVisableBtnClicked() +{ + if(m_mode){ + m_lineEdit_pwd->setEchoMode(QLineEdit::Password); + setButtonBackImage(m_btn_visable, ":res/image/eye-close.png", 30, 30); + }else{ + m_lineEdit_pwd->setEchoMode(QLineEdit::Normal); + setButtonBackImage(m_btn_visable, ":res/image/eye-open.png", 30, 30); + } + m_mode = !m_mode; +} + +void PasswordDialog::slotRestoreBtnClicked() +{ + QuestionDialog dlg(tr("您确定恢复出厂设置吗?"), m_bgWidget, tr("恢复")); + if(QDialog::Accepted == dlg.exec()){ + qDebug() << "factory reset!"; + emit signalRestoreFactory(); + } +} + +void PasswordDialog::slotConfirmBtnClicked() +{ + m_pwd = m_lineEdit_pwd->text(); + CustomDialog::slotConfirmBtnClicked(); +} + +const QString& PasswordDialog::getPwd() const +{ + return m_pwd; +} + +RadioBtnChooseDialog::RadioBtnChooseDialog(const QVector& labels, QObject *bgWidget, const int choose, const QVector *config, const QString& title) : CustomDialog(tr("确定"), bgWidget), m_chooseIndex(choose) +{ + qDebug() << "RadioBtnChooseDialog::RadioBtnChooseDialog()"; + //setWindowFlag(Qt::WindowCloseButtonHint); + //QPalette palette(this->palette()); + //palette.setColor(QPalette::WindowText,QColor(0x0e, 0xbc, 0xf8, 0xFF)); + vLayout = new QVBoxLayout(); + if(title != ""){ + m_label_title = new QLabel(this); + m_label_title->setText(title); + //m_label_title->setPalette(palette); + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->addWidget(m_label_title, 1, Qt::AlignLeft); + vLayout->addLayout(hLayout); + } + + m_option_num = labels.size(); + m_rdo = new QRadioButton[m_option_num]; + for(int i = 0; i < m_option_num; i ++) + { + QWidget* widget = new QWidget(this); + if(labels[i] != ""){ + QLabel* label = new QLabel(this); + label->setText(labels[i]); + //label->setPalette(palette); + widget = label; + } + m_rdo[i].setStyleSheet("QRadioButton::indicator:unchecked{image: url(:/res/image/select_1.png);}" + "QRadioButton::indicator:checked{image: url(:/res/image/select_2.png);}"); + m_rdo[i].setFocusPolicy(Qt::NoFocus); + // "QRadioButton::indicator:checked{image: url(:/res/image/select_2.png);width: 30px;height: 30px;}"); + connect(m_rdo + i, SIGNAL(pressed()), this, SLOT(slotRadioButtonPressed())); + + if(nullptr != config){ + if(false == (*config)[i]){ + widget->hide(); + m_rdo[i].hide(); + continue; + } + } + + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->addWidget(widget, 1, Qt::AlignLeft); + hLayout->addWidget(m_rdo + i, 1, Qt::AlignRight); + hLayout->setContentsMargins(dialogWidth / 10, dialogHeight / 10, dialogWidth / 10, dialogHeight / 10); + vLayout->addLayout(hLayout); + vLayout->setSpacing(0); + } + if(choose < m_option_num) + m_rdo[choose].setChecked(true); + + vLayout->addLayout(hbtmLayout, 1); + vLayout->setMargin(0); + vLayout->setSpacing(5); + setLayout(vLayout); +} + +RadioBtnChooseDialog::~RadioBtnChooseDialog() +{ + qDebug() << "RadioBtnChooseDialog::~RadioBtnChooseDialog()"; + delete [] m_rdo; +} + +void RadioBtnChooseDialog::slotRadioButtonPressed() +{ + for(int i = 0; i < m_option_num; i++) + { + if(sender() == static_cast(m_rdo + i)) + { + m_chooseIndex = i; + break; + } + } +} + +int RadioBtnChooseDialog::getChoosedIndex() const +{ + return m_chooseIndex; +} + +QuestionDialog::QuestionDialog(const QString& question, QObject *bgWidget, const QString& btnText) : CustomDialog(btnText, bgWidget) +{ + QLabel* labelQues = new QLabel(this); + labelQues->setWordWrap(true); + labelQues->setText(question); + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->addWidget(labelQues, 90, Qt::AlignCenter); + vLayout->addLayout(hbtmLayout); + vLayout->setSpacing(dialogHeight / 5); + vLayout->setContentsMargins(0, dialogHeight / 10, 0, 0); + setLayout(vLayout); +} + +InfoDialog::InfoDialog(const QString& info, QObject *bgWidget, const QString& btnText, int timeout) : CustomDialog(btnText, bgWidget, "", timeout) +{ + QLabel* labelInfo = new QLabel(this); + labelInfo->setWordWrap(true); + labelInfo->setText(info); + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->addWidget(labelInfo, 90, Qt::AlignCenter); + vLayout->addLayout(hbtmLayout); + vLayout->setSpacing(dialogHeight / 5); + vLayout->setContentsMargins(0, dialogHeight / 10, 0, 0); + setLayout(vLayout); +} + +SliderDialog::SliderDialog(int current, int min, int max, const QString& tip, QObject *bgWidget) : CustomDialog (tr("确定"), bgWidget) +{ + m_labelCurrent = new QLabel(this); + m_labelCurrent->setText(QString::number(current)); + + QLabel* labelMin = new QLabel(this); + labelMin->setText(QString::number(min)); + + QLabel* labelMax = new QLabel(this); + labelMax->setText(QString::number(max)); + + m_slider = new QSlider(this); + m_slider->setOrientation(Qt::Horizontal); + m_slider->setMinimumHeight(UiConfig::GetInstance()->isRkDevice() ? 44 :60); + m_slider->setMinimum(min); + m_slider->setMaximum(max); + m_slider->setValue(current); + //m_slider->setSingleStep(10); + //m_slider->setGeometry(30,this->height()-28,200,25); + m_slider->setStyleSheet("QSlider::handle:horizontal{width:48px;background-color:rgb(255,255,255);margin:-22px 0px -22px 0px;border-radius:24px;}" + "QSlider::groove:horizontal{height:4px;background-color:rgb(219,219,219);}" + "QSlider::add-page:horizontal{background-color:rgb(219,219,219);}" + "QSlider::sub-page:horizontal{background-color:rgb(26,217,110);}"); + QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; + effect->setOffset(4,4); + effect->setColor(QColor(0,0,0,50)); + effect->setBlurRadius(10); + m_slider->setGraphicsEffect(effect); + connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int))); + + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->addWidget(labelMin, 1); + hLayout->addWidget(m_slider, 30); + hLayout->addWidget(labelMax, 1); + hLayout->setMargin(20); + hLayout->setSpacing(10); + + QLabel* m_labelTip = new QLabel(this); + m_labelTip->setText(tip); + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,QColor(92, 89, 93, 255)); + m_labelTip->setPalette(palette); + #if 0 + QFont ft; + ft.setPointSize(static_cast(15)); + m_labelTip->setFont(ft); + #endif + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addWidget(m_labelCurrent, 3, Qt::AlignCenter); + vbLayout->addLayout(hLayout, 7); + vbLayout->addWidget(m_labelTip, 1, Qt::AlignCenter); + vbLayout->addLayout(hbtmLayout, 2); + vbLayout->setSpacing(10); + vbLayout->setMargin(0); + setLayout(vbLayout); + //setWindowTitle(tr("音量设置")); + m_iCurrent = current; +}; + +SliderDialog::~SliderDialog() +{ +} + +void SliderDialog::slotValueChanged(int value) +{ + m_iCurrent = value; + m_labelCurrent->setText(QString::number(value)); +} + +int SliderDialog::getValueSet() const +{ + return m_iCurrent; +} + +DateTimeDialog::DateTimeDialog(const QDateTime& dateTime, QObject *bgWidget, bool needDate, bool needTime) : CustomDialog (tr("确定"), bgWidget) +{ + m_dateTimeSet = new QDateTimeEdit(this); + m_dateTimeSet->setDateTime(QDateTime::currentDateTime()); + //m_dateTimeSet->setCalendarPopup(true); + QString format; + if(needDate){ + format += "yyyy-MM-dd"; + } + if(needTime){ + format += needDate ? " " : ""; + format += "HH:mm"; + } + m_dateTimeSet->setDisplayFormat(format); + m_dateTimeSet->setFixedSize(static_cast(dialogWidth * 0.8), static_cast(dialogHeight * 0.5)); + m_dateTimeSet->setFrame(false); + m_dateTimeSet->setAlignment(Qt::AlignCenter); + QFont ft; + //ft.setPointSize(static_cast(dialogWidth * 0.05)); + ft.setPointSize(static_cast(m_dateTimeSet->font().pointSize() * 1.4)); + m_dateTimeSet->setFont(ft); + m_dateTimeSet->setDateTime(dateTime); + /* + m_dateTimeSet->setStyleSheet("QDateTimeEdit::up-button,QTimeEdit::up-button,QDoubleSpinBox::up-button,QSpinBox::up-button" + "{subcontrol-origin:border;subcontrol-position:right;image: url(:res/image/up.png);};" + "QDateTimeEdit::down-button,QTimeEdit::down-button,QDoubleSpinBox::down-button,QSpinBox::down-button" + "{subcontrol-origin:border;subcontrol-position:left;image: url(:res/image/down.png); }"); + m_dateTimeSet->setStyleSheet("QDateTimeEdit::up-button{background-image:url(:res/image/up.png);width: 55px;height: 40px;}" + "QDateTimeEdit::down-button{background-image:url(:res/image/down.png);width: 55px;height: 40px;}"); + */ + + m_dateTimeSet->setStyleSheet("background-color:transparent;"); + + QLabel* m_labelTip = new QLabel(this); + m_labelTip->setText(tr("点击对应时间项设置")); + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,QColor(92, 89, 93, 255)); + m_labelTip->setPalette(palette); + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addWidget(m_dateTimeSet, 3, Qt::AlignCenter); + vbLayout->addWidget(m_labelTip, 1, Qt::AlignCenter); + vbLayout->addLayout(hbtmLayout, 2); + vbLayout->setSpacing(10); + vbLayout->setMargin(0); + setLayout(vbLayout); + + m_dateTimeSet->setCurrentSectionIndex(0); +} + +QDateTime DateTimeDialog::getValueSet() const +{ + return m_dataTimeVal; +} + +void DateTimeDialog::slotConfirmBtnClicked() +{ + m_dataTimeVal = m_dateTimeSet->dateTime(); + CustomDialog::slotConfirmBtnClicked(); +} + +void LineEditInputDialog::init(const QStringList& labels) +{ + //setWindowFlag(Qt::WindowCloseButtonHint); + + //QPalette palette(this->palette()); + //palette.setColor(QPalette::WindowText,QColor(0x0e, 0xbc, 0xf8, 0xFF)); + + vLayout = new QVBoxLayout(); + formLayout = new QFormLayout(); + m_rowNum = labels.size(); + qDebug() << "row num:" << m_rowNum; + m_editRow = new LineEditWithKeyboard[m_rowNum]; + m_stringRowInput = new QString[m_rowNum]; + for(int i = 0; i < m_rowNum; i ++){ + QLabel* rowLabel = new QLabel(this); + rowLabel->setText(labels[i]); + //rowLabel->setPalette(palette); + + m_editRow[i].setStyleSheet("QLineEdit{border-bottom:1px solid #648EC9;}"); + //palette.setColor(QPalette::Text,QColor(0x0e, 0xbc, 0xf8, 0xFF)); + //m_editRow[i].setPalette(palette); + //m_editRow[i].setStyleSheet("QLineEdit{background-color: transparent ;border:2px solid #0ebcf8;}"); + + formLayout->addRow(rowLabel, m_editRow + i); + } + + //formLayout->setSpacing(30); + formLayout->setContentsMargins(30, 50, 30, 30); + + vLayout->addLayout(formLayout, 8); + vLayout->addLayout(hbtmLayout, 1); + + vLayout->setMargin(0); + vLayout->setSpacing(10); + setLayout(vLayout); + + move((UiConfig::GetInstance()->getUiWidth() - dialogWidth) / 2, UiConfig::GetInstance()->getUiHeight() / 3); +} + +LineEditInputDialog::LineEditInputDialog(const QStringList& labels, QObject *bgWidget, const QString& confirBtm) : + CustomDialog(confirBtm, bgWidget), m_rowNum(0) +{ + qDebug() << "LineEditInputDialog::LineEditInputDialog()"; + init(labels); +} + +LineEditInputDialog::LineEditInputDialog(const QString& label, QObject *bgWidget, const QString& confirBtm) : + CustomDialog(confirBtm, bgWidget), m_rowNum(0) +{ + qDebug() << "LineEditInputDialog()"; + QList labels = QList() << label; + init(labels); +} + +LineEditInputDialog::~LineEditInputDialog() +{ + qDebug() << "~LineEditInputDialog()"; + delete []m_editRow; + delete []m_stringRowInput; +} + +QString LineEditInputDialog::getRow(const int row) const +{ + return (row < m_rowNum ? m_stringRowInput[row] : ""); +} + +void LineEditInputDialog::fillRow(const int row, const QString& str, bool readOnly) +{ + if(row < m_rowNum){ + m_editRow[row].setText(str); + if(readOnly){ + m_editRow[row].setEnabled(false); + //m_editRow[row].setReadOnly(readOnly); + } + } +} + +void LineEditInputDialog::slotConfirmBtnClicked() +{ + for(int i = 0; i < m_rowNum; i ++) + { + m_stringRowInput[i] = m_editRow[i].text(); + } + CustomDialog::slotConfirmBtnClicked(); +} + + +ComSelectDialog::ComSelectDialog(const QStringList& titles, const QVector& sels, + QObject *bgWidget, const QString& confirBtm) : + CustomDialog(confirBtm, bgWidget), m_rowNum(0) +{ + qDebug() << "ComSelectDialog()"; + + vLayout = new QVBoxLayout(); + formLayout = new QFormLayout(); + m_rowNum = titles.size(); + qDebug() << "row num:" << m_rowNum; + + for(int i = 0; i < m_rowNum; i ++){ + QComboBox* cbSel = new QComboBox(this); + m_cbSels.push_back(cbSel); + formLayout->addRow(titles.at(i), cbSel); + if(i < sels.size()){ + for(const auto& sel : sels.at(i)){ + cbSel->addItem(sel); + } + } + } + + //formLayout->setSpacing(30); + formLayout->setContentsMargins(30, 50, 30, 30); + + vLayout->addLayout(formLayout, 8); + vLayout->addLayout(hbtmLayout, 1); + + vLayout->setMargin(0); + vLayout->setSpacing(10); + setLayout(vLayout); + + move((UiConfig::GetInstance()->getUiWidth() - dialogWidth) / 2, UiConfig::GetInstance()->getUiHeight() / 3); +} + +ComSelectDialog::~ComSelectDialog() +{ + qDebug() << "~ComSelectDialog()"; +} + +int ComSelectDialog::getRow(int row) const +{ + return (row < m_rowNum ? m_cbSels.at(row)->currentIndex() : -1); +} + +void ComSelectDialog::setRow(int row, int set, bool readOnly) +{ + if(row < m_rowNum && set < m_cbSels.at(row)->count()){ + m_cbSels[row]->setCurrentIndex(set); + if(readOnly){ + m_cbSels[row]->setEnabled(false); + } + } +} + + +MsgDialog::MsgDialog(const QString& msg, QObject *bgWidget) : CustomDialog("", bgWidget, "") +{ + QLabel* labelInfo = new QLabel(this); + labelInfo->setText(msg); + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->addWidget(labelInfo, 90, Qt::AlignCenter); + vLayout->setMargin(0); + setLayout(vLayout); +} + +void IpInputDialog::slotTextChanged(const QString & t) +{ + const QObject* send = sender(); + for(int i=0; i 255){ + InfoDialog(QObject::tr("请指定一个介于0和255之间的值")).exec(); + list[j] = "255"; + m_editRow[i].setText(list[0] + "." + list[1] + "." + list[2] + "." + list[3]); + QString posiStr; + for(int k=0; k& items, int choose, QWidget *parent) : SettingUiPage(items, parent), m_chooseIndex(choose) +{ +#if 0 + const QString QSS_VerticalScrollBar( "" + "QScrollBar:vertical{" //垂直滑块整体 + "min-width:55px;" + "background:rgba(255, 255, 255, 1);" //背景色 #FFFFFF + "padding-top:0px;" //上预留位置(放置向上箭头) + "padding-bottom:0px;" //下预留位置(放置向下箭头) + "padding-left:0px;" //左预留位置(美观) + "padding-right:0px;" //右预留位置(美观) + "border-left:0px solid grey;}"//左分割线 #d7d7d7 + "QScrollBar::handle:vertical{"//滑块样式 + "background:rgba(219, 219, 219, 1);" //滑块颜色 + "border-radius:4px;" //边角圆润 + "}" //滑块最大高度max-height:20px; + "QScrollBar::handle:vertical:hover{"//鼠标触及滑块样式 + "background:rgba(219, 219, 219, 1);}" //滑块颜色 + "QScrollBar::add-line:vertical{"//向下箭头样式 + "background:url(:res/image/down.png) center no-repeat;}" + "QScrollBar::sub-line:vertical{"//向上箭头样式 + "background:url(:res/image/up.png) center no-repeat;}" + ""); + + m_listWidget->verticalScrollBar()->setStyleSheet(QSS_VerticalScrollBar); +#else + m_listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); +#endif + m_listWidget->setCurrentRow(m_chooseIndex); + + QScroller::grabGesture(m_listWidget, QScroller::LeftMouseButtonGesture); + m_listWidget->setVerticalScrollMode(QListWidget::ScrollPerPixel); + + QString style = styleSheet() + "background:rgb("; + style += QString::number(UiConfig::SUB_STYLE_COLOR_RED); + style += ", "; + style += QString::number(UiConfig::SUB_STYLE_COLOR_GREEN); + style += ", "; + style += QString::number(UiConfig::SUB_STYLE_COLOR_BLUE); + style += ");}"; + m_listWidget->setStyleSheet(style); +} + +void ItemChoosePage::slotItemClicked(QListWidgetItem* item) +{ + myListWidget* wdtPre = dynamic_cast(m_listWidget->itemWidget(m_listWidget->item(m_chooseIndex))); + if(wdtPre == nullptr){ + return; + } + wdtPre->updateIcon(""); + myListWidget* wdt = dynamic_cast(m_listWidget->itemWidget(item)); + if(wdt == nullptr){ + return; + } + wdt->updateIcon(":/res/image/select_2.png"); + m_chooseIndex = m_listWidget->currentRow(); +} + +int ItemChoosePage::getChoosedIndex() const +{ + return m_chooseIndex; +} + +ItemChooseDialog::ItemChooseDialog(const QVector& items, int choose, QObject *bgWidget) : + CustomDialog(tr("确定"), bgWidget) +{ + QVector opns; + int i = 0; + for(auto &item : items){ + opns.append(ItemChoosePage::SetOpn(item, "", i == choose ? myListWidget::enProperty::enPropertyTick : myListWidget::enProperty::enPropertyNull)); + i++; + } + m_ItemsPage = new ItemChoosePage(opns, choose, this); + m_ItemsPage->setFixedSize(width(), static_cast(UiConfig::GetInstance()->getUiHeight() * 0.8)); + vLayout = new QVBoxLayout(); + vLayout->addWidget(m_ItemsPage, 100, Qt::AlignTop); + vLayout->addLayout(hbtmLayout, 1); + vLayout->setMargin(0); + vLayout->setSpacing(0); + setLayout(vLayout); + resize(width(), static_cast(UiConfig::GetInstance()->getUiHeight() * 0.8)); +} + +ItemChooseDialog::~ItemChooseDialog() +{ +} + +int ItemChooseDialog::getChoosedIndex() const +{ + return m_ItemsPage->getChoosedIndex(); +} + +CalendarDialog::CalendarDialog(bool isEn, QObject *bgWidget) : CustomDialog (tr("确定"), bgWidget) +{ + m_wgtCal = new QCalendarWidget(this); + m_wgtCal->setFixedWidth(dialogWidth); + m_wgtCal->adjustSize(); + qDebug() << "isEn:" << isEn; + m_wgtCal->setLocale(isEn ? QLocale::English : QLocale::Chinese); + m_wgtCal->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader); + m_wgtCal->setSelectedDate(QDate::currentDate()); + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addWidget(m_wgtCal, 3, Qt::AlignCenter); + vbLayout->addLayout(hbtmLayout, 2); + vbLayout->setSpacing(10); + vbLayout->setMargin(0); + setLayout(vbLayout); +} + +QDate CalendarDialog::getDateChoose() const +{ + return m_date; +} + +void CalendarDialog::slotConfirmBtnClicked() +{ + m_date = m_wgtCal->selectedDate(); + CustomDialog::slotConfirmBtnClicked(); +} + +LineEditWithDialog::LineEditWithDialog(int dialogType, QObject *bgWidget, QWidget *parent) : + QLineEdit(parent), m_dialogType(dialogType), m_bgWidget(bgWidget) +{ +} + +LineEditWithDialog::~LineEditWithDialog() +{qDebug() << "~LineEditWithDialog";} + +void LineEditWithDialog::mousePressEvent(QMouseEvent *event) +{ + qDebug() << "LineEditWithDialog::mousePressEvent"; + QLineEdit::mousePressEvent(event); + switch(m_dialogType) + { + case 0: + { + CalendarDialog cal(0 != UiConfig::GetInstance()->getLanguageType(), m_bgWidget); + cal.setFocus(); + cal.setFocusPolicy(Qt::StrongFocus); + if(cal.exec() == QDialog::Accepted) + { + setText(cal.getDateChoose().toString("yyyy-MM-dd")); + } + } + break; + default: + break; + } +} +#endif + +MyMessageBox::MyMessageBox() +{ + //设置按钮背景色和字体颜色 + //setStyleSheet("QPushButton { background-color: rgb(15, 188, 248); color: rgb(85, 255, 0);}"); + setStyleSheet("QPushButton { background-color: rgb(15, 188, 248);}"); +} + +void MyMessageBox::showEvent(QShowEvent* event) +{ + QWidget *textField = findChild("qt_msgBoxbox_label"); + if(textField != nullptr) + { + textField -> setMinimumSize(200, 50);//可设置消息对话框大小,默认太小 + } + QMessageBox::showEvent(event); +} + +void MyMessageBox::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + painter.fillRect(this->rect(), QColor(0x18, 0x1f, 0x33,/*0x1f, 0x28, 0x41,*/ 255)); //QColor最后一个参数代表背景的透明度 + return QWidget::paintEvent(event); +} + +void setLineEditFontColor(QLineEdit* edit, const QColor& color) +{ + QPalette p = edit->palette(); + p.setColor(QPalette::Active, QPalette::Text, color); + p.setColor(QPalette::Inactive, QPalette::Text, color); + edit->setPalette(p); +} + +void setLineEditStyle(QLineEdit* edit) +{ + edit->setReadOnly(true); + edit->setFrame(false); + edit->setMaximumWidth(100); + + QPalette p = edit->palette(); + p.setColor(QPalette::Active, QPalette::Base, Qt::lightGray); + p.setColor(QPalette::Inactive, QPalette::Base, Qt::lightGray); + edit->setPalette(p); + + //edit->setText("xxxx"); + edit->setAlignment(Qt::AlignCenter); +} + +void setButtonBackImage(QPushButton *button, const QString image, int sizeW, int sizeH) +{ + QPixmap pixmap(image); + if(sizeW !=0 && sizeH != 0){ + pixmap=pixmap.scaled(163,163).scaled(sizeW, sizeH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + button->setIconSize(QSize(sizeW, sizeH)); + } + button->setIcon(QIcon(pixmap)); + button->setFlat(true); + button->setStyleSheet("border: 0px"); + button->setCursor(QCursor(Qt::PointingHandCursor)); + button->setFocusPolicy(Qt::NoFocus); +} + +QListWidgetItem* setListWidgetItem(QListWidgetItem* item, const QString text, const QString image) +{ + if(text != "") + item->setText(text); + if(image != "") + item->setIcon(QIcon(image)); + + item->setSizeHint(QSize(120, 90)); + item->setTextAlignment(Qt::AlignCenter); + item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + return item; +} + +myListWidget::myListWidget(const SetOpnCfg& cfg, QWidget* parent) : QWidget(parent) +{ + if(cfg.m_sOpn != "" || cfg.m_sVal != "" || cfg.m_prop != myListWidget::enPropertyNull) + { + m_hbLayout = new QHBoxLayout(); + if(enProperty::enPropertyIndent1 & cfg.m_prop){ + m_hbLayout->addSpacing(UiConfig::GetInstance()->getUiWidth() / 20); + m_layoutObjQty++; + m_hasIndent = true; + } + + m_label_leftIcon = new QLabel(this); + m_layoutObjQty++; + + m_label_left = new QLabel(this); + m_layoutObjQty++; + m_label_left->setText(cfg.m_sOpn); + if(enProperty::enPropertyRedWord & cfg.m_prop){ + m_label_left->setStyleSheet("color:red;font-size:30px;"); + }else { + m_label_left->setStyleSheet("color:black;font-size:30px;");//background-color: rgb(225, 225, 225); + } + m_hbLayout->addWidget(m_label_left, 20, Qt::AlignLeft); + + m_label_right = new QLabel(this); + m_layoutObjQty++; + m_label_right->setText(cfg.m_sVal); + m_label_right->setStyleSheet("color:gray;font-size:30px;"); + m_hbLayout->addWidget(m_label_right, 1, Qt::AlignRight); + + m_label_icon = new QLabel(this); + m_layoutObjQty++; + QPixmap pm; + QString icon; + if(enPropertySwitch & cfg.m_prop){ + icon = ":/res/image/off.png"; + pm.load(icon); + }else if(enProperty::enPropertyMoreArrow & cfg.m_prop){ + icon = ":/res/image/pageNext.png"; + pm.load(icon); + //pm = pm.scaled(30, 40, Qt::KeepAspectRatio); + }else if(enProperty::enPropertyTick & cfg.m_prop){ + icon = ":/res/image/select_2.png"; + pm.load(icon); + } + + m_label_icon->setPixmap(pm); + m_hbLayout->addWidget(m_label_icon, 1, Qt::AlignRight); + m_hbLayout->setContentsMargins(20, 20, 40, 20); + setLayout(m_hbLayout); + } + else{ + setEnabled(false); + } +} + +void myListWidget::updateLabel(const QString& val) +{ + if(m_label_right) + m_label_right->setText(val); +} + +void myListWidget::setLeftIcon(const QString& icon, int scale_w, int scale_h) +{ + QPixmap pm(icon); + if(0!=scale_w && 0!=scale_h){ + pm = pm.scaled(scale_w, scale_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + } + m_label_leftIcon->setPixmap(pm); + qDebug() << "before m_hbLayout->count():" << m_hbLayout->count(); + if(m_hbLayout->count() < m_layoutObjQty){ + m_hbLayout->insertWidget(m_hasIndent ? 1 : 0, m_label_leftIcon, 1, Qt::AlignLeft); + } + qDebug() << "after m_hbLayout->count():" << m_hbLayout->count(); +} + +void myListWidget::updateIcon(const QString& icon, int scale_w, int scale_h) +{ + if(m_label_icon){ + QPixmap pm(icon); + //pm = pm.scaled(40, 40, Qt::KeepAspectRatio); + if(0!=scale_w && 0!=scale_h){ + pm = pm.scaled(scale_w, scale_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + } + + m_label_icon->setPixmap(pm); + } +} + +myListWidget::~myListWidget() +{ + //qDebug() << "~myListWidget()"; +} + +const QString myListWidget::getLabelString() const +{ + return m_label_right->text(); +} + +const QString myListWidget::getOpnLabelString() const +{ + return m_label_left->text(); +} + +const QString myListWidget::getOptionLabel() const +{ + return m_label_left->text(); +} +void setLanguage(QApplication& app, const QString& languageFile) +{ + static QTranslator m_translator; + do{ + if(languageFile.contains(".qm")){ + //m_translator->load(":/res/language/A038_TC.qm"); + m_translator.load(languageFile); + } + else { + break; + } + + if(!m_translator.isEmpty()) + { + app.installTranslator(&m_translator); + } + else { + qDebug() << "language is empty!"; + } + }while(0); +} + +void setFont(QApplication& app, const QString& ttf, const int fontSize, const int nLanguageType) +{ + QString fontFile = ttf; + if(6 == nLanguageType){//泰文 + fontFile += "thai.ttf"; + } + else { + fontFile += "DroidSansFallback.ttf";//中文 + } + int id = QFontDatabase::addApplicationFont(fontFile); + QFontDatabase::addApplicationFont(ttf + "pingfang.ttf"); + QString msyh = QFontDatabase::applicationFontFamilies (id).at(0); + + QFont font(msyh, fontSize); //8 + //qDebug()<setMinimumSize(btnWidth, btnWidth); + + //圆角 + pPushButton->setStyleSheet("background-color: rgb(255, 255, 255);border-radius:10px;padding:2px 4px;focus{outline: none;}"); + //"{background-color:#FF0000;border-radius:4px;text-align: bottom;color:#000000;}" + + _pVBoxLayoutDevice = new QVBoxLayout(pPushButton); + _pLabelIcon = new QLabel(pPushButton); + QPixmap pm(icon); + if(UiConfig::GetInstance()->isRkDevice()){ + //pm = pm.scaledToWidth(btnWidth / 3, Qt::SmoothTransformation); + pm = pm.scaled(btnWidth / 3.5, btnWidth / 3.5, Qt::KeepAspectRatio); //TODO, special for rk right now + } + else{ + pm = pm.scaled(btnWidth / 3, btnWidth / 3, Qt::KeepAspectRatio); + } + _pLabelIcon->setPixmap(pm); + _pVBoxLayoutDevice->addWidget(_pLabelIcon, 2, Qt::AlignCenter); + + QLabel *btmName = new QLabel(pPushButton); + btmName->setText(tip); + _pVBoxLayoutDevice->addWidget(btmName, 1, Qt::AlignCenter); + + _pVBoxLayoutDevice->setAlignment(Qt::AlignCenter); + + pPushButton->setFocusPolicy(Qt::NoFocus); +} + +setPushButton::~setPushButton() +{ + +} + +MyWidgetWithSubStyleColor::MyWidgetWithSubStyleColor(QWidget *parent) : WidgetWithBackstageInterface(parent) +{ +#if 0 + setCursor(QCursor(Qt::BlankCursor)); +#endif +} + +void MyWidgetWithSubStyleColor::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + painter.fillRect(this->rect(), QColor(UiConfig::SUB_STYLE_COLOR_RED, UiConfig::SUB_STYLE_COLOR_GREEN, UiConfig::SUB_STYLE_COLOR_BLUE, UiConfig::SUB_STYLE_COLOR_TRAN)); //QColor最后一个参数代表背景的透明度 + return QWidget::paintEvent(event); +} + +MyWidgetWithMainStyleColor::MyWidgetWithMainStyleColor(QWidget *parent) : WidgetWithBackstageInterface(parent) +{ +#if 0 + setCursor(QCursor(Qt::BlankCursor)); +#endif +} + +void MyWidgetWithMainStyleColor::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + painter.fillRect(this->rect(), QColor(UiConfig::MAIN_STYLE_COLOR_RED, UiConfig::MAIN_STYLE_COLOR_GREEN, UiConfig::MAIN_STYLE_COLOR_BLUE, UiConfig::MAIN_STYLE_COLOR_TRAN)); //QColor最后一个参数代表背景的透明度 + return QWidget::paintEvent(event); +} + +PageAcceptMouseAndTouch::PageAcceptMouseAndTouch(QWidget *parent) : WidgetWithBackstageInterface(parent) +{ + setAttribute(Qt::WA_AcceptTouchEvents); //touch + installEventFilter(this); //mouse click + +#if 0 + setCursor(QCursor(Qt::BlankCursor)); +#endif +} + +bool PageAcceptMouseAndTouch::eventFilter(QObject *watched, QEvent *event) +{ + if( watched == this){ + if(event->type() == QEvent::MouseButtonPress){ + qDebug() << "mouse clicked"; + } + } + else{ + return QWidget::eventFilter(watched, event); + } + return false; +} + + +bool PageAcceptMouseAndTouch::event(QEvent *event) +{ + #if 0 + switch( event->type() ) + { + case QEvent::TouchBegin: + qDebug() << "touch begin"; + event->accept(); + return true; + case QEvent::TouchUpdate: + event->accept(); + return true; + case QEvent::TouchEnd: + qDebug() << "touch end"; + event->accept(); + return true; + default: + break; + } + #endif + return QWidget::event(event); + +} + + +TimerUpdate::TimerUpdate(QLabel *pLabel, QWidget *parent) + : QWidget(parent), _labelTime(pLabel), _labelDate(nullptr), m_timeType(0), m_dateType(0), m_weekType(0) +{ + _timerID = startTimer(500); +} + +TimerUpdate::TimerUpdate(QLabel* labelTime, QLabel* labelDate, QWidget *parent, int timeType, int dateType, int weekType) : + QWidget(parent), _labelTime(labelTime), _labelDate(labelDate), m_timeType(timeType), m_dateType(dateType), m_weekType(weekType) +{ + _timerID = startTimer(500); +} + +TimerUpdate::~TimerUpdate() +{ + if(0 != _timerID){ + killTimer(_timerID); + } +} + +void TimerUpdate::timerEvent(QTimerEvent *event) +{ + if(event->timerId() == _timerID) + { + const QDateTime dateTime = QDateTime::currentDateTime(); + const QString time = dateTime.toString("hh:mm:ss"); + if(time == "00:00:00"){ + emit signalNewDay(); + } + if(!m_enableUpdate){ + //qDebug() << "dont update"; + return; + } + + if(_labelTime){ + QString timeStr; + if(0 == m_timeType){ + timeStr = time.left(5); + }else if(1 == m_timeType){ + timeStr = time; + } + if(_labelTime->text() != timeStr){ + _labelTime->setText(timeStr); +#if 1 + if(UiConfig::GetInstance()->isRkDevice()){ + if(parent()){ + dynamic_cast(parent())->update(); + } + if(parent()->parent()){ + dynamic_cast(parent()->parent())->update(); + } + } +#endif + } + } + if(_labelDate){ + QString dateStr; + if(0 == m_dateType){ + dateStr = dateTime.toString("yyyy/MM/dd "); + }else if(1 == m_dateType){ + dateStr = dateTime.toString("yyyy-MM-dd "); + } + + if(1 == m_weekType){ + dateStr += dateTime.toString("ddd"); + }else if(2 == m_weekType){ + QLocale locale = QLocale::Chinese; + dateStr += locale.toString(dateTime, "ddd"); + } + if(_labelDate->text() != dateStr){ + _labelDate->setText(dateStr); +#if 1 + if(UiConfig::GetInstance()->isRkDevice()){ + if(parent()){ + dynamic_cast(parent())->update(); + } + if(parent()->parent()){ + dynamic_cast(parent()->parent())->update(); + } + } +#endif + } + } + } +} + +void TimerUpdate::enableUpdate(bool enable) +{ + m_enableUpdate = enable; +} + +QPixmap PixmapToRound(QPixmap &src, int radius) +{ + if (src.isNull()) { + return QPixmap(); + } + + QSize size(2*radius, 2*radius); + QBitmap mask(size); + QPainter painter(&mask); + painter.setRenderHint(QPainter::Antialiasing); + painter.setRenderHint(QPainter::SmoothPixmapTransform); + painter.fillRect(0, 0, size.width(), size.height(), Qt::white); + painter.setBrush(QColor(0, 0, 0)); + painter.drawRoundedRect(0, 0, size.width(), size.height(), 99, 99); + + QPixmap image = src.scaled(size); + image.setMask(mask); + return image; +} + + +MyLineEdit::MyLineEdit(QWidget *parent):QLineEdit(parent) +{ + +} + +MyLineEdit::~MyLineEdit() +{ + +} + +void MyLineEdit::mousePressEvent(QMouseEvent *event) +{ + if( event->button() == Qt::LeftButton ) + { + emit clicked(); + } +} + +QImage ScaleImage(const QImage& image, const QSize& size) +{ + double dWidthRatio = 1.0 * image.size().width() / size.width(); + double dHeightRatio = 1.0 * image.size().height() / size.height(); + return dWidthRatio>dHeightRatio ? image.scaledToWidth(size.width(), Qt::SmoothTransformation) : image.scaledToHeight(size.height(), Qt::SmoothTransformation); +} + +QImage ScaleImage2Label(const QImage& qImage, const QLabel& label) +{ + return ScaleImage(qImage, label.size()); +} + +QPixmap ScalePixmap(const QPixmap& pixmap, const QSize& size) +{ +#if 0 + return QPixmap::fromImage(ScaleImage(QImage(pixmap.toImage()), size)); +#else + double dWidthRatio = 1.0 * pixmap.size().width() / size.width(); + double dHeightRatio = 1.0 * pixmap.size().height() / size.height(); + return dWidthRatio>dHeightRatio ? pixmap.scaledToWidth(size.width(), Qt::SmoothTransformation) : pixmap.scaledToHeight(size.height(), Qt::SmoothTransformation); +#endif +} + +QPixmap ScalePixmap2Label(const QPixmap& pixmap, const QLabel& label) +{ + return ScalePixmap(pixmap, label.size()); +} + +FourListWidget::FourListWidget(const QString &left, const QString &right, + const QString &btnText, const QString &icon, QWidget *parent) : QWidget(parent) +{ + QHBoxLayout* hbLayout = new QHBoxLayout(); + + m_label_left = new QLabel(this); + m_label_left->setText(left); + m_label_left ->setStyleSheet("color:white"); //background-color: rgb(250, 0, 0); font-size:60px; + hbLayout->addWidget(m_label_left, 20, Qt::AlignLeft); + + m_label_right = new QLabel(this); + m_label_icon = new QLabel(this); + m_btn_mid = new QPushButton(this); + + QPixmap pm(icon); + if(right != QString("")) + { + m_label_right->setText(right); + m_label_right ->setStyleSheet("color:white"); + hbLayout->addWidget(m_label_right, 1, Qt::AlignRight); + pm = pm.scaled(20, 20, Qt::KeepAspectRatio); + } + else + { + pm = pm.scaled(40, 40, Qt::KeepAspectRatio); + } + m_label_icon->setPixmap(pm); + m_btn_mid->setObjectName("pushbutton_test"); + m_btn_mid->setStyleSheet("#pushbutton_test{background-color: #0ebcf8;color: #FFFFFF}"); + m_btn_mid->setText(btnText); + + hbLayout->addWidget(m_btn_mid, 1, Qt::AlignRight); + hbLayout->addWidget(m_label_icon, 1, Qt::AlignRight); + + hbLayout->setMargin(1); + setLayout(hbLayout); +} + +FourListWidget::~FourListWidget() +{ + if(nullptr != m_label_left) + { + delete m_label_left; + m_label_left = nullptr; + } + + if(nullptr != m_label_right) + { + delete m_label_right; + m_label_right = nullptr; + } + + if(nullptr != m_label_icon) + { + delete m_label_icon; + m_label_icon = nullptr; + } + + if(nullptr != m_btn_mid) + { + delete m_btn_mid; + m_btn_mid = nullptr; + } +} + +void FourListWidget::updateLabel(const QString &label) +{ + if(m_label_right) + m_label_right->setText(label); +} + +void FourListWidget::updateBtnText(const QString &text) +{ + if(m_btn_mid) + { + m_btn_mid->setText(text); + } +} + +QPushButton *FourListWidget::getPushButton() +{ + return m_btn_mid; +} + +const QString FourListWidget::getLabelString() const +{ + return m_label_right->text(); +} + +SwitchListWidget::SwitchListWidget(const QString &left, const QString &right, const QString &icon, QWidget *parent) +{ + Q_UNUSED(parent); + QHBoxLayout* hbLayout = new QHBoxLayout(); + + m_label_left = new QLabel(this); + m_label_left->setText(left); + m_label_left ->setStyleSheet("color:white"); //background-color: rgb(250, 0, 0); font-size:60px; + hbLayout->addWidget(m_label_left, 20, Qt::AlignLeft); + + m_label_right = new QLabel(this); + m_label_icon = new QLabel(this); + QPixmap pm(icon); + if(right != QString("")) + { + m_label_right->setText(right); + m_label_right ->setStyleSheet("color:white"); + hbLayout->addWidget(m_label_right, 1, Qt::AlignRight); + pm = pm.scaled(20, 20, Qt::KeepAspectRatio); + } + else + { + pm = pm.scaled(30, 30, Qt::KeepAspectRatio); + } + m_label_icon->setPixmap(pm); + hbLayout->addWidget(m_label_icon, 1, Qt::AlignRight); + + hbLayout->setMargin(1); + setLayout(hbLayout); +} + +SwitchListWidget::~SwitchListWidget() +{ + +} + +void SwitchListWidget::updateLabel(const QString &label) +{ + if(m_label_right) + m_label_right->setText(label); +} + +void SwitchListWidget::updateIcon(const QString& icon) +{ + if(m_label_icon) + { + QPixmap pm(icon); + pm = pm.scaled(30, 30, Qt::KeepAspectRatio); + m_label_icon->setPixmap(pm); + } +} + +void SwitchListWidget::updateIcon(bool bFlag) +{ + if(m_label_icon) + { + QPixmap pm(bFlag ? ":/res/image/on.png" : ":/res/image/off.png"); + pm = pm.scaled(30, 30, Qt::KeepAspectRatio); + m_label_icon->setPixmap(pm); + m_Res = bFlag; + } +} + +bool SwitchListWidget::getSwitchRes() +{ + return m_Res; +} + +const QString SwitchListWidget::getLabelString() const +{ + return m_label_right->text(); +} + +LocalFourListWidget::LocalFourListWidget(const QString& left, const QString& mid, + const QString& right, const QString& icon, QWidget*parent) : QWidget(parent) +{ + QHBoxLayout* hbLayout = new QHBoxLayout(); + + m_label_left = new QLabel(this); + m_label_left->setText(left); + m_label_left ->setStyleSheet("color:white"); //background-color: rgb(250, 0, 0); font-size:60px; + hbLayout->addWidget(m_label_left, 20, Qt::AlignLeft); + + m_label_mid = new QLabel(this); + m_label_mid->setText(mid); + m_label_mid ->setStyleSheet("color:white"); + hbLayout->addWidget(m_label_mid, 1, Qt::AlignRight); + + m_label_right = new QLabel(this); + m_label_right->setText(right); + m_label_right ->setStyleSheet("color:white"); + hbLayout->addWidget(m_label_right, 1, Qt::AlignRight); + + m_label_icon = new QLabel(this); + + if(!icon.isEmpty()) + { + QPixmap pm(icon); + pm = pm.scaled(20, 20, Qt::KeepAspectRatio); + m_label_icon->setPixmap(pm); + hbLayout->addWidget(m_label_icon, 1, Qt::AlignRight); + } + + hbLayout->setMargin(1); + setLayout(hbLayout); +} + +LocalFourListWidget::~LocalFourListWidget() +{ + if(nullptr != m_label_left) + { + delete m_label_left; + m_label_left = nullptr; + } + + if(nullptr != m_label_mid) + { + delete m_label_mid; + m_label_mid = nullptr; + } + + if(nullptr != m_label_right) + { + delete m_label_right; + m_label_right = nullptr; + } + + if(nullptr != m_label_icon) + { + delete m_label_icon; + m_label_icon = nullptr; + } + +} + +void LocalFourListWidget::updateLabel(const QString &label) +{ + if(m_label_mid) + m_label_mid->setText(label); +} + +void LocalFourListWidget::updateRight(const QString &text) +{ + if(m_label_right) + { + m_label_right->setText(text); + } +} + +void LocalFourListWidget::updateIcon(const QString& icon) +{ + if(m_label_icon) + { + QPixmap pm(icon); + pm = pm.scaled(30, 30, Qt::KeepAspectRatio); + + m_label_icon->setPixmap(pm); + } +} + +const QString LocalFourListWidget::getLabelString() const +{ + return m_label_mid->text(); +} + +bool checkip(const QString& ip) +{ + QRegExp rx2("^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$"); + //QRegExp rx2("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b"); + //QRegExp rx2("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)"); + if( !rx2.exactMatch(ip) ) + { + return false; + } + return true; +} + +bool checkMask(const QString& mask) +{ + QRegExp rx2("^(254|252|248|240|224|192|128|0)\\.0\\.0\\.0|255\\.(254|252|248|240|224|192|128|0)\\.0\\.0|255\\.255\\.(254|252|248|240|224|192|128|0)\\.0|255\\.255\\.255\\.(254|252|248|240|224|192|128|0)$"); + if( !rx2.exactMatch(mask) ) + { + return false; + } + return true; +} + + +//判断是否在同一网段 +bool isSameNetwork(const QString& ip, const QString& mask, const QString& gateway) +{ + QStringList ipList = ip.split('.',QString::SkipEmptyParts); + QStringList maskList = mask.split('.',QString::SkipEmptyParts); + QStringList gatewayList = gateway.split('.',QString::SkipEmptyParts); + bool ok = true; + for(int i = 0;i < 4;i++) { + if ((ipList[i].toInt(&ok,10) & maskList[i].toInt(&ok,10)) != + (gatewayList[i].toInt(&ok,10) & maskList[i].toInt(&ok,10))) { + return false; + } + } + return true; +} + +static bool getIpFromDialogInput(const QString& lineEdit, const QString& initIp, QString& newIp, bool(*pCheckFunc)(const QString&), QObject *bgWidget) +{ + bool ret = false; + bool settingFailed = true; + do + { + LineEditInputDialog dlg(lineEdit, bgWidget); + dlg.fillRow(0, initIp); + if(dlg.exec() == QDialog::Accepted) + { + do{ + if(!((*pCheckFunc)(dlg.getRow(0)))) + { + break; + } + newIp = dlg.getRow(0); + settingFailed = false; + ret = true; + }while(0); + } + else { + settingFailed = false; + } + if(settingFailed) + { + InfoDialog(QObject::tr("设置有误,请重新输入!"), bgWidget, QObject::tr("知道了")).exec(); + } + }while(settingFailed); + return ret; +} + +bool getIpFromUserInput(const QString& lineEdit, const QString& initIp, QString& newIp, QObject *bgWidget) +{ + return getIpFromDialogInput(lineEdit, initIp, newIp, checkip, bgWidget); +} + +bool getMaskFromUserInput(const QString& lineEdit, const QString& initIp, QString& newIp, QObject *bgWidget) +{ + return getIpFromDialogInput(lineEdit, initIp, newIp, checkMask, bgWidget); +} + +bool getNumFromUserInput(const QString& lineEdit, const QString& initNum, QString& newValue, const int min, const int max, QObject *bgWidget) +{ + bool ret = false; + bool settingFailed = true; + do + { + LineEditInputDialog dlg(lineEdit, bgWidget); + if(!initNum.isEmpty()) + { + dlg.fillRow(0, initNum); + } + if(dlg.exec() == QDialog::Accepted) + { + bool isDigi = false; + int valueSet = dlg.getRow(0).toInt(&isDigi); + if(isDigi){ + do{ + if(valueSet < min || valueSet > max){ + break; + } + newValue = QString::number(valueSet); //转换数字回字符串,去掉无效字符 + settingFailed = false; + ret = true; + }while(0); + } + } + else { + settingFailed = false; + } + if(settingFailed) + { + InfoDialog(QObject::tr("设置有误,请重新输入!"), bgWidget).exec(); + } + }while(settingFailed); + return ret; +} + +QString GBK2UTF8(const QString &inStr) +{ + QTextCodec *gbk = QTextCodec::codecForName("GB18030"); + //QTextCodec *utf8 = QTextCodec::codecForName("UTF-8"); + + QString g2u = gbk->toUnicode(gbk->fromUnicode(inStr)); // gbk convert utf8 + return g2u; +} + +QString UTF82GBK(const QString &inStr) +{ + QTextCodec *gbk = QTextCodec::codecForName("GB18030"); + //QTextCodec *utf8 = QTextCodec::codecForName("UTF-8"); + + QString utf2gbk = gbk->toUnicode(inStr.toLocal8Bit()); + return utf2gbk; +} + +std::string gbk2utf8(const QString &inStr) +{ + return GBK2UTF8(inStr).toStdString(); +} + +QString utf82gbk(const std::string &inStr) +{ + QString str = QString::fromStdString(inStr); + + return UTF82GBK(str); +} + +void gbkToUtf8(char *gbkstr) +{ +QTextCodec *gbk = QTextCodec::codecForName("GB18030"); +QTextCodec *utf8 = QTextCodec::codecForName("UTF-8"); + +//创建str指针,开辟另一控件储存转换后的UTF-8编码 +char *str = utf8->fromUnicode(gbk->toUnicode(gbkstr)).data(); + +//将原字符数组清空 +char *clear = gbkstr; //将原字符数组地址附给指针clear,使gbkstr指向地址不作改变 +while(*clear != 0x00) //0x00是“空”的意思,也就是' ' +{ + *clear = 0x00; + clear++; //后移一位,继续判断 +} + +//复制(覆盖)到原字符数组 +strcpy(gbkstr,str); +} + +ProgressWidget::ProgressWidget(const QString& title) +{ + m_label_title = new QLabel(this); + m_label_title->setText(title); + m_label_title->setAlignment(Qt::AlignCenter); + m_label_msg = new QLabel(this); + m_label_msg->setAlignment(Qt::AlignCenter); + m_slider_progess = new QSlider(this); + m_slider_progess->setOrientation(Qt::Horizontal); + m_slider_progess->setMaximumHeight(20); + m_slider_progess->setMinimum(0); + m_slider_progess->setMaximum(100); + m_slider_progess->setStyleSheet(" \ + QSlider::add-page:Horizontal\ + { \ + background-color: rgb(87, 97, 106);\ + height:4px;\ + }\ + QSlider::sub-page:Horizontal \ + {\ + background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(231,80,229, 255), stop:1 rgba(7,208,255, 255));\ + height:4px;\ + }\ + QSlider::groove:Horizontal \ + {\ + background:transparent;\ + height:6px;\ + }\ + QSlider::handle:Horizontal \ + {\ + height: 30px;\ + width:8px;\ + border-image: url(:/images/ic_music_thumb.png);\ + margin: -8 0px; \ + } \ + "); + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->addWidget(m_label_title); + vLayout->addWidget(m_label_msg); + vLayout->addWidget(m_slider_progess); + setLayout(vLayout); +} + +ProgressWidget::~ProgressWidget() +{ + +} + +void ProgressWidget::setMsg(const unsigned current, const unsigned all) +{ + m_label_msg->setText(QString::number(current) + "/" + QString::number(all)); + m_slider_progess->setValue(static_cast(static_cast(current) / all * 100)); +} + +PureColorPage::PureColorPage(unsigned color, unsigned char tran, bool drawRect, QWidget* parent) : PageAcceptMouseAndTouch(parent) +{ + m_color = color; + m_tran = tran; + m_drawRect = drawRect; + #if 1 + QPalette pal = palette(); + pal.setColor(QPalette::Background, QColor((m_color >> 16) & 0xFF, (m_color >> 8) & 0xFF, m_color & 0xFF, m_tran)); + setPalette(pal); + #endif + resize(UiConfig::GetInstance()->getUiWidth(), UiConfig::GetInstance()->getUiHeight()); +} + +PureColorPage::~PureColorPage() +{ +} + +void PureColorPage::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); +#if 0 + painter.fillRect(this->rect(), QColor((m_color >> 16) & 0xFF, (m_color >> 8) & 0xFF, m_color & 0xFF, m_tran)); +#endif + if(m_drawRect){ + painter.setPen(Qt::red); + QRectF rectangle(UiConfig::GetInstance()->getUiWidth() / 24, UiConfig::GetInstance()->getUiWidth() / 24, + UiConfig::GetInstance()->getUiWidth() / 24, UiConfig::GetInstance()->getUiWidth() / 24); + painter.drawRect(rectangle); + } + return QWidget::paintEvent(event); +} + +SettingUiPage::SettingUiPage(const QVector& cfg, QWidget *parent) : MyWidgetWithMainStyleColor(parent), config(cfg) +{ + //qDebug() << "SettingUiPage config size: " << config.size(); + m_listWidget = new QListWidget(this); + m_listWidget->setFrameStyle(QFrame::NoFrame); + m_listWidget->setCursor(QCursor(Qt::PointingHandCursor)); + m_listWidget->setFocusPolicy(Qt::NoFocus); + m_listWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + m_listWidget->setSpacing(0); + m_listWidget->setStyleSheet("QListWidget{border-width:0;border-style:outset; background:rgb(255, 255, 255);border-top: 1px solid #DFDDEB;}" + "QListWidget::item{border-bottom: 1px solid #DFDDEB;}" + "QListWidget::Item:hover{background:transparent;}" + "QListWidget::item:selected{background:transparent; }" + /*"QListWidget::item:selected:!active{border-width:0px; }"*/); + for(int i=0; isetSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 12, UiConfig::GetInstance()->getUiHeight() / 12)); + m_listWidget->setItemWidget(pItem, mylistwidget); + //m_listWidget->setStyleSheet("QListWidget::item{border-top: 1px solid #DFDDEB;}"); +#if 0 + m_listWidget->setStyleSheet("QListWidget{border-top: 1px solid #DFDDEB;}" + "QListWidget::item{border-bottom: 1px solid #DFDDEB;}"); +#endif + + } + + connect(m_listWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(slotItemClicked(QListWidgetItem*))); + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addWidget(m_listWidget); + vbLayout->setMargin(0); + setLayout(vbLayout); + + m_listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + QScroller::grabGesture(m_listWidget, QScroller::LeftMouseButtonGesture); + m_listWidget->setVerticalScrollMode(QListWidget::ScrollPerPixel); +} + +void SettingUiPage::controlListWidgetItemShow(const bool sw, int option) +{ + QListWidgetItem* pItem = m_listWidget->item(option); + m_listWidget->setItemHidden(pItem, static_cast(!static_cast(sw))); +} + +MsgListWidgetItem::MsgListWidgetItem(QWidget* parent) : QWidget(parent) +{ + labelMsg.resize(m_msgOpnQty); + + labelPic = new QLabel(this); + labelPic->setFixedSize(static_cast(UiConfig::GetInstance()->getUiWidth() / 4), static_cast(UiConfig::GetInstance()->getUiHeight() / 10)); + labelPic->setAlignment(Qt::AlignCenter); + + QVBoxLayout* vLayout = new QVBoxLayout(); + for(auto &la : labelMsg){ + la = new QLabel(this); + la->setMinimumHeight(labelPic->height() / 4); + vLayout->addWidget(la, 1, Qt::AlignLeft); + } + vLayout->setMargin(5); + vLayout->setSpacing(static_cast(labelPic->height() * 0.3)); + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->addWidget(labelPic); + hLayout->addLayout(vLayout, 100); + hLayout->setSpacing(5); + hLayout->setMargin(5); + setLayout(hLayout); +} + +MsgListWidgetItem::~MsgListWidgetItem() +{ +} + +void MsgListWidgetItem::showMsg(const QString& pic, const QVector& msgs) +{ + labelPic->clear(); + for(auto &opn : labelMsg){ + opn->clear(); + } + + if("" != pic){ + QPixmap faceImg(pic); + labelPic->setPixmap(ScalePixmap2Label(faceImg, *labelPic)); + } + for(int i=0; isetText(msgs[i].m_sMsg); + if(enPropertyBold & msgs[i].m_eProp){ + QFont ft; + ft.setBold(true); + labelMsg[i]->setFont(ft); + } + if(enPropertyGreyWord & msgs[i].m_eProp){ + labelMsg[i]->setStyleSheet("color:grey;font-size:30px;"); + } + else if(enPropertyGreenWord & msgs[i].m_eProp){ + labelMsg[i]->setStyleSheet("color:green;font-size:30px;"); + } + else if(enPropertyRedWord & msgs[i].m_eProp){ + labelMsg[i]->setStyleSheet("color:red;font-size:30px;"); + } + } +} + +PersonMsgUiPage::PersonMsgUiPage(QWidget *parent) : MyWidgetWithMainStyleColor(parent) +{ + m_listWidget = new QListWidget(this); + m_listWidget->setFrameStyle(QFrame::NoFrame); + m_listWidget->setCursor(QCursor(Qt::PointingHandCursor)); + m_listWidget->setFocusPolicy(Qt::NoFocus); + m_listWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + m_listWidget->setSpacing(0); + m_listWidget->setStyleSheet("QListWidget{border-width:0;border-style:outset; background:rgb(255, 255, 255);border-top: 1px solid #DFDDEB;}" + "QListWidget::item{border-bottom: 1px solid #DFDDEB;}" + "QListWidget::Item:hover{background:transparent;}" + "QListWidget::item:selected{background:transparent; }" + /*"QListWidget::item:selected:!active{border-width:0px; }"*/); + connect(m_listWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(slotItemClicked(QListWidgetItem*))); + + const QString tips[SEARCH_OPN_QTY] = {tr("请输入人员姓名"), tr("请选择通行时间")}; + const QString moreBtnIcon[SEARCH_OPN_QTY] = {":res/image/down.png", ":res/image/display.png"}; + QGridLayout* glayout = new QGridLayout(); + glayout->setColumnStretch(0, 10); + glayout->setColumnStretch(1, 1); + glayout->setContentsMargins(20, 5, 20, 5); + glayout->setSpacing(5); + for (int i=0; iparent(), this); + } + m_editSearch[i]->setFixedHeight(static_cast(UiConfig::GetInstance()->getUiHeight() / 20)); + m_editSearch[i]->setStyleSheet("background-color: lightgrey;border-width:0;border-style:outset"); + m_editSearch[i]->setTextMargins(40, 0, 40, 0); + //QPalette p = m_editSearch[i]->palette(); + //p.setColor(QPalette::Active, QPalette::Base, palette().color(QPalette::Active, QPalette::Background)); + //p.setColor(QPalette::Inactive, QPalette::Base, palette().color(QPalette::Inactive, QPalette::Background)); + //m_editSearch[i]->setPalette(p); + connect(m_editSearch[i], SIGNAL(textChanged(const QString&)), this, SLOT(slotTextChanged(const QString&))); + if(enSearchOpnName != i){ + m_editSearch[i]->hide(); + } + + QLabel *searchIcon = new QLabel(this); + const int searchIconWidth = static_cast(m_editSearch[i]->height() * 0.8); + searchIcon->setMaximumSize(searchIconWidth, searchIconWidth); + searchIcon->setCursor(QCursor(Qt::ArrowCursor)); + QPixmap search(":res/image/search.png"); + //searchIcon->setPixmap(search.scaled(searchIconWidth, searchIconWidth, Qt::KeepAspectRatio)); + searchIcon->setPixmap(search); + + m_labelTip[i] = new QLabel(this); + m_labelTip[i]->setText(tips[i]); + QPalette labelple = m_labelTip[i]->palette(); + labelple.setColor(QPalette::Active, QPalette::Text, Qt::gray); + labelple.setColor(QPalette::Inactive, QPalette::Text, Qt::gray); + m_labelTip[i]->setPalette(labelple); + m_labelTip[i]->setStyleSheet("background-color:transparent;font-size:20px;"); + + m_btnClearSearch[i] = new QPushButton(this); + setButtonBackImage(m_btnClearSearch[i], ":res/image/close.png", 30, 30); + connect(m_btnClearSearch[i], SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + m_btnClearSearch[i]->hide(); + + QSpacerItem *spaceItem = new QSpacerItem(700, 40, QSizePolicy::Expanding); + QHBoxLayout *editLayout = new QHBoxLayout(); + editLayout->setContentsMargins(5, 0, 5, 0); + editLayout->addWidget(searchIcon, 1, Qt::AlignLeft); + editLayout->addWidget(m_labelTip[i], 1, Qt::AlignLeft); + editLayout->addSpacerItem(spaceItem); + editLayout->addWidget(m_btnClearSearch[i], 100, Qt::AlignRight); + editLayout->setSpacing(10); + m_editSearch[i]->setLayout(editLayout); + if(enSearchOpnName != i){ + m_editSearch[i]->setReadOnly(true); + } + + glayout->addWidget(m_editSearch[i], i, 0); + if(enSearchOpnName == i){ + m_btnMore = new QPushButton(this); + setButtonBackImage(m_btnMore, ":res/image/down.png", 55, 40); + connect(m_btnMore, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + m_btnMore->setEnabled(false); + glayout->addWidget(m_btnMore, i, 1); + } + } + + m_stackWgt = new QStackedWidget(this); + m_stackWgt->addWidget(m_listWidget); + m_stackWgt->setFixedSize(UiConfig::GetInstance()->getUiWidth(), static_cast(UiConfig::GetInstance()->getUiHeight() / 0.6)); + + m_labelPage = new QLabel(this); + m_labelMin = new QLabel(this); + m_labelMax = new QLabel(this); + + m_btnPrePage = new QPushButton(this); + setButtonBackImage(m_btnPrePage, ":res/image/left.png", 37, 61); + connect(m_btnPrePage, SIGNAL(clicked(bool)), this, SLOT(slotBtnClicked())); + + m_btnNextPage = new QPushButton(this); + setButtonBackImage(m_btnNextPage, ":res/image/right.png", 37, 61); + connect(m_btnNextPage, SIGNAL(clicked(bool)), this, SLOT(slotBtnClicked())); + + m_sliderPage = new QSlider(this); + m_sliderPage->setOrientation(Qt::Horizontal); + + m_sliderPage->setMinimumWidth(static_cast(UiConfig::GetInstance()->getUiWidth() * 0.5)); + //m_sliderPage->setMinimum(min); + //m_sliderPage->setMaximum(max); + //m_sliderPage->setValue(current); + //m_sliderPage->setSingleStep(10); + //m_sliderPage->setGeometry(30,this->height()-28,200,25); + + if(UiConfig::GetInstance()->isRkDevice()){ + m_sliderPage->setMaximumHeight(44); + m_sliderPage->setStyleSheet("QSlider::handle:horizontal{width:48px;background-color:rgb(255,255,255);margin:-22px 0px -22px 0px;border-radius:24px;}" + "QSlider::groove:horizontal{height:32px;background-color:rgb(219,219,219);}" + "QSlider::add-page:horizontal{background-color:rgb(219,219,219);}" + "QSlider::sub-page:horizontal{background-color:rgb(26,217,110);}"); + } + else{ + m_sliderPage->setMinimumHeight(60); + m_sliderPage->setStyleSheet("QSlider::handle:horizontal{width:48px;background-color:rgb(255,255,255);margin:-22px 0px -22px 0px;border-radius:24px;}" + "QSlider::groove:horizontal{height:48px;background-color:rgb(219,219,219);}" + "QSlider::add-page:horizontal{background-color:rgb(219,219,219);}" + "QSlider::sub-page:horizontal{background-color:rgb(26,217,110);}"); + } + + QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; + effect->setOffset(4,4); + effect->setColor(QColor(0,0,0,50)); + effect->setBlurRadius(10); + m_sliderPage->setGraphicsEffect(effect); + connect(m_sliderPage, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int))); + connect(m_sliderPage, SIGNAL(sliderReleased()), this, SLOT(slotSliderReleased())); + + QHBoxLayout* hlay = new QHBoxLayout(); + hlay->addWidget(m_btnPrePage, 1, Qt::AlignLeft); + hlay->addWidget(m_labelMin, 15, Qt::AlignCenter); + hlay->addWidget(m_sliderPage, 70, Qt::AlignCenter); + hlay->addWidget(m_labelMax, 15, Qt::AlignCenter); + hlay->addWidget(m_btnNextPage, 1, Qt::AlignRight); + hlay->setSpacing(20); + hlay->setMargin(30); + + QVBoxLayout* vbLay = new QVBoxLayout(); + vbLay->addWidget(m_labelPage, 1, Qt::AlignCenter); + vbLay->addLayout(hlay, 1); + vbLay->setSpacing(0); + vbLay->setMargin(5); + + QVBoxLayout* vbLayout = new QVBoxLayout(); + vbLayout->addLayout(glayout, 1); + vbLayout->addWidget(m_stackWgt, 80, Qt::AlignCenter); + vbLayout->addLayout(vbLay, 1); + vbLayout->setSpacing(20); + vbLayout->setMargin(10); + setLayout(vbLayout); + + for(unsigned i=0; isetSizeHint(QSize(UiConfig::GetInstance()->getUiHeight() / 8, UiConfig::GetInstance()->getUiHeight() / 8)); + m_listWidget->setItemWidget(pItem, listwidgetItem); + //m_listWidget->setStyleSheet("QListWidget::item{border-top: 1px solid #DFDDEB;}"); + m_listWidget->setItemHidden(pItem, true); + } + + setPageControlBarHide(true); +} + +void PersonMsgUiPage::showMsg(const QVector& msgs) +{ + for(int i = 0; i < static_cast(m_itemQty); i++){ + if(i(m_listWidget->itemWidget(m_listWidget->item(i)))->showMsg(msgs[i].m_sPic, msgs[i].m_vMsgs); + m_listWidget->setItemHidden(m_listWidget->item(i), false); + } + else { + m_listWidget->setItemHidden(m_listWidget->item(i), true); + } + } +} + +void PersonMsgUiPage::clearMsg() +{ + for(unsigned i = 0; i < m_itemQty/* + 1*/; i++){ + m_listWidget->setItemHidden(m_listWidget->item(static_cast(i)), true); + } +} + +void PersonMsgUiPage::setPageControlBarHide(bool hide, int min, int max, int current) +{ + if(hide){ + m_labelPage->hide(); + m_labelMin->hide(); + m_labelMax->hide(); + m_btnPrePage->hide(); + m_btnNextPage->hide(); + m_sliderPage->hide(); + } + else { + m_sliderPage->setMinimum(min); + m_sliderPage->setMaximum(max); + m_sliderPage->setValue(current); + m_labelPage->setText(QString::number(current)); + m_labelMin->setText(QString::number(min)); + m_labelMax->setText(QString::number(max)); + m_labelPage->show(); + m_labelMin->show(); + m_labelMax->show(); + m_btnPrePage->show(); + m_btnNextPage->show(); + m_sliderPage->show(); + m_btnPrePage->setEnabled(current - min); + m_btnNextPage->setEnabled(max - current); + } +} + +void PersonMsgUiPage::showMoreSearchOpn() +{ + m_btnMore->setEnabled(true); +} + +void PersonMsgUiPage::slotValueChanged(int value) +{ + m_labelPage->setText(QString::number(value)); +} + +void PersonMsgUiPage::slotBtnClicked() +{ + for (int i=0; iclear(); + return; + } + } + + if(sender() == m_btnMore){ + static bool sw = false; + if(sw){ + m_editSearch[enSearchOpnTime]->hide(); + setButtonBackImage(m_btnMore, ":res/image/down.png", 55, 40); + } + else { + m_editSearch[enSearchOpnTime]->show(); + setButtonBackImage(m_btnMore, ":res/image/up.png", 55, 40); + } + m_editSearch[enSearchOpnTime]->clear(); + m_sSearchtime = ""; + sw = !sw; + return; + } + else if(sender() == m_btnPrePage){ + qDebug() << "pre btn clicked"; + m_toPageNum = m_labelPage->text().toInt() - 1; + } + else if(sender() == m_btnNextPage){ + qDebug() << "next btn clicked"; + m_toPageNum = m_labelPage->text().toInt() + 1; + } + m_btnPrePage->setEnabled(m_toPageNum > 1); + m_btnNextPage->setEnabled(m_toPageNum < m_sliderPage->maximum()); + m_labelPage->setText(QString::number(m_toPageNum)); + m_sliderPage->setValue(m_toPageNum); +} + +void PersonMsgUiPage::slotItemClicked(QListWidgetItem *item) +{ + return; +} + +void PersonMsgUiPage::slotSliderReleased() +{ + m_toPageNum = m_labelPage->text().toInt(); + m_btnPrePage->setEnabled(m_toPageNum > 1); + m_btnNextPage->setEnabled(m_toPageNum < m_sliderPage->maximum()); +} + +WifiListWidget::WifiListWidget(const QString& ssid, bool connected, bool withLock, int sigLevel, bool isTargetNet, QWidget* parent) : + QWidget (parent), m_isLock(withLock), m_isTargetNet(isTargetNet), m_isConnected(connected) +{ + QHBoxLayout* hLay = new QHBoxLayout(); + m_label_conn = new QLabel(this); + if(connected){ + QPixmap pm(":/res/image/wifi_connected.png"); + m_label_conn->setPixmap(pm); + } + hLay->addWidget(m_label_conn, 1, Qt::AlignLeft); + m_label_ssid = new QLabel(this); + m_label_ssid->setText(ssid); + hLay->addWidget(m_label_ssid, 90, Qt::AlignLeft); + + if(withLock){ + QLabel* lock = new QLabel(this); + QPixmap pm(":/res/image/wifi_lock.png"); + lock->setPixmap(pm); + hLay->addWidget(lock, 1, Qt::AlignRight); + } + QPixmap pm; + QLabel* labelSigLevel = new QLabel(this); + if(sigLevel >= 0){ + QString wifiIcon; + if(sigLevel <= 34){ + wifiIcon = ":/res/image/wifi1.png"; + } + else if(sigLevel <= 49){ + wifiIcon = ":/res/image/wifi2.png"; + } + else if(sigLevel <= 69){ + wifiIcon = ":/res/image/wifi3.png"; + } + else{ + wifiIcon = ":/res/image/wifi4.png"; + } + pm.load(wifiIcon); + //pm = pm.scaled(44, 44); + labelSigLevel->setPixmap(pm); + } + hLay->addWidget(labelSigLevel, 1, Qt::AlignRight); + + QLabel* labelNext = new QLabel(this); + pm.load(":/res/image/pageNext.png"); + labelNext->setPixmap(pm); + hLay->addWidget(labelNext, 1, Qt::AlignRight); + hLay->setSpacing(10); + hLay->setContentsMargins(20, 20, 40, 20); + setLayout(hLay); +} + +WifiListWidget::~WifiListWidget() +{ + +} + +void WifiListWidget::updateStatus(bool connected) +{ + if(connected){ + QPixmap pm(":/res/image/wifi_connected.png"); + m_label_conn->setPixmap(pm); + } + else { + m_label_conn->clear(); + } + m_isConnected = connected; + if(m_isConnected){ + m_isTargetNet = true; + } +} + +QString WifiListWidget::getSsid() const +{ + return m_label_ssid->text(); +} + +bool WifiListWidget::isTargetNet() const +{ + return m_isTargetNet; +} + +bool WifiListWidget::isConnected() const +{ + return m_isConnected; +} + +bool WifiListWidget::getLockStatus() const +{ + return m_isLock; +} + +void WifiListWidget::clearStatus() +{ + m_isTargetNet = false; + updateStatus(false); +} + + +WifiAccPointDialog::WifiAccPointDialog(QObject *bgWidget) : LineEditInputDialog(QList{tr("名称"), tr("密码")}, bgWidget, tr("加入")) +{ + qDebug() << "WifiAccPointDialog"; + QLabel* label = new QLabel(this); + label->setText(tr("加密方式")); + m_comBox_encType = new QComboBox(this); + QStringList strList; + strList<<"none"<<"wep"<<"WPA-PSK/WPA2-PSK"; + m_comBox_encType->addItems(strList); + formLayout->insertRow(1, label, m_comBox_encType); +} + +WifiAccPointDialog::~WifiAccPointDialog() +{ + qDebug() << "~WifiAccPointDialog"; +} + +void WifiAccPointDialog::slotConfirmBtnClicked() +{ + m_sEncType = m_comBox_encType->currentText(); + LineEditInputDialog::slotConfirmBtnClicked(); +} + +QString WifiAccPointDialog::getEncType() const +{ + return m_sEncType; +} + +int GrabFullScreen(const QString& picName, int rotate) +{ + QMatrix matrix; + matrix.rotate(rotate); + return QGuiApplication::primaryScreen()->grabWindow(0).transformed(matrix, Qt::SmoothTransformation).save(picName, "jpg"); +} + +QPasswordLineEdit::QPasswordLineEdit(QWidget *parent, const QString& ch, int timeout) : QLineEdit(parent), m_ch(ch), m_Timeout(timeout) +{ + connect(this,SIGNAL(cursorPositionChanged(int,int)),this,SLOT(DisplayPasswordAfterEditSlot(int,int))); + //connect(this,SIGNAL(textEdited(const QString&)),this,SLOT(GetRealTextSlot(const QString&))); + + if(UiConfig::GetInstance()->isRkDevice()){ + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(DisplayPasswordSlot())); + } +} + +QPasswordLineEdit::~QPasswordLineEdit() +{ +} + +void QPasswordLineEdit::DisplayPasswordAfterEditSlot(int oldPos,int newPos) +{ + if(oldPos>=0 && newPos>=0 ){ + if(newPos>oldPos){ + if(UiConfig::GetInstance()->isRkDevice()){ + m_timer->start(m_Timeout); + } + else{ + QTimer::singleShot(m_Timeout,this,SLOT(DisplayPasswordSlot())); + } + }else{ + setCursorPosition(oldPos); + } + } +} +void QPasswordLineEdit::DisplayPasswordSlot() +{ + setText(GetMaskString()); + if(UiConfig::GetInstance()->isRkDevice()){ + m_timer->stop(); + } +} +void QPasswordLineEdit::GetRealTextSlot(const QString& text) +{ + if(text.count()>m_LastCharCount){ + m_LineEditText.append(text.right(1)); + }else if(text.count()){ + m_LineEditText.remove(m_LineEditText.count()-1,1); + } + m_LastCharCount = m_LineEditText.count(); +} + +QString QPasswordLineEdit::GetPassword() const +{ + return m_LineEditText; +} +void QPasswordLineEdit::SetTimeout(int msec) +{ + m_Timeout = msec; +} +int QPasswordLineEdit::GetTimeout() const +{ + return m_Timeout; +} + +QString QPasswordLineEdit::GetMaskString() +{ + QString ret; + for(int i=0; isetFixedWidth(w / 4); + m_btnClear->move(w / 8 * 1, 50); + m_btnClear->setText("reset"); + m_btnClear->setStyleSheet("QPushButton{border:none;background:transparent;}"); + //m_btnClear->setFlat(true); + + m_btnExit = new QPushButton(this); + m_btnExit->setFixedWidth(w / 4); + m_btnExit->move(w / 8 * 5, 50); + m_btnExit->setText("exit"); + m_btnExit->setStyleSheet("QPushButton{border:none;background:transparent;}"); + + QPalette pal = palette(); + pal.setColor(QPalette::Background, QColor(255, 255, 255, 255)); + setPalette(pal); + setAutoFillBackground(true); + + m_current.points.clear(); + connect(m_btnClear, SIGNAL(clicked()), this, SLOT(slotClearBtnClicked())); + connect(m_btnExit, SIGNAL(clicked()), this, SLOT(slotExitBtnClicked())); +} + +void DrawPage::mousePressEvent(QMouseEvent *evt) +{ + m_current.points.append(evt->pos()); +} + +void DrawPage::mouseMoveEvent(QMouseEvent *evt) +{ + append(evt->pos()); + update(); +} + +void DrawPage::mouseReleaseEvent(QMouseEvent *evt) +{ + append(evt->pos()); + + m_drawList.append(m_current); + m_current.points.clear(); + + update(); +} + +void DrawPage::append(QPoint p) +{ + m_current.points.append(p); +} + +void DrawPage::paintEvent(QPaintEvent *) +{ + QPainter painter(this); + + for(int i=0; i= 2) + { + painter.setPen(QPen(Qt::black)); + painter.setBrush(QBrush(Qt::black)); + + for(int i=0; isetPlaceholderText(tr("请输入您的密码")); + m_editPwd->setReadOnly(true); + + m_btnConfirm = new QPushButton(this); + m_btnConfirm->setText(tr("确认")); + connect(m_btnConfirm, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + m_btnBackspace = new QPushButton(this); + m_btnBackspace->setText(tr("删除")); + connect(m_btnBackspace, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + m_btnClear = new QPushButton(this); + m_btnClear->setText(tr("清空")); + connect(m_btnClear, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + m_btnBack = new QPushButton(this); + m_btnBack->setText(tr("返回")); + connect(m_btnBack, SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + + QHBoxLayout* hlayTop = new QHBoxLayout(); + hlayTop->addWidget(m_btnBack); + hlayTop->addWidget(m_editPwd); + + QGridLayout* glayMid = new QGridLayout(); + for(int i=0; isetText(QString::number(i)); + connect(m_btnsNum[i], SIGNAL(clicked()), this, SLOT(slotBtnClicked())); + if(i > 0){ + const int pos = i - 1; + glayMid->addWidget(m_btnsNum[i], pos / 3, pos % 3); + } + } + glayMid->addWidget(m_btnClear, 3, 0); + glayMid->addWidget(m_btnsNum[0], 3, 1); + glayMid->addWidget(m_btnBackspace, 3, 2); + + QHBoxLayout* hlayBtm = new QHBoxLayout(); + hlayBtm->addWidget(m_btnConfirm); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addLayout(hlayTop); + vlay->addLayout(glayMid); + vlay->addLayout(hlayBtm); + setLayout(vlay); +} + +void UserPwdDialog::slotBtnClicked() +{ + const QObject* send = sender(); + if (send == m_btnConfirm) { + m_pwd = m_editPwd->text(); + //m_editPwd->clear(); + //hide(); + done(Accepted); + } + else if (send == m_btnBackspace) { + QString text = m_editPwd->text(); + if(text.size()){ + m_editPwd->setText(text.left(text.size() - 1)); + } + } + else if (send == m_btnClear) { + m_editPwd->clear(); + } + else if (send == m_btnBack) { + m_pwd = m_editPwd->text(); + //m_editPwd->clear(); + //hide(); + done(Rejected); + } + else{ + for(int i=0; isetText(m_editPwd->text() + m_btnsNum[i]->text()); + break; + } + } + } +} + + +RoundedWidget::RoundedWidget(QWidget *parent) : QWidget(parent) +{ +} + +void RoundedWidget::paintEvent(QPaintEvent *event) +{ + //圆角 + QBitmap bmp(this->size()); + bmp.fill(); + QPainter p(&bmp); + p.setPen(Qt::NoPen); + p.setBrush(Qt::black); + p.drawRoundedRect(bmp.rect(),20,20); + setMask(bmp); + + //绘制边框 + QStyleOption opt; + opt.initFrom(this); + QPainter pr(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &pr, this);//绘制样式 + + return QWidget::paintEvent(event); +} + + +StyleItemChooseDialog::StyleItemChooseDialog(const QString& title, const QStringList& items, BackstageInterfaceForUi* backstageIf) + : CustomDialog (tr("确定"), nullptr, tr("取消")), m_backstageIf(backstageIf) +{ + dialogWidth = static_cast(UiConfig::GetInstance()->getUiWidth() * 0.7); + double scale = 0.1 * (2 + items.size()); + scale = scale > 0.8 ? 0.8 : scale; + dialogHeight = static_cast(UiConfig::GetInstance()->getUiHeight() * scale); + resize(dialogWidth, dialogHeight); + + QLabel* tle = new QLabel(title, this); + + m_listWidget = new QListWidget(this); + m_listWidget->setFrameStyle(QFrame::NoFrame); + m_listWidget->setCursor(QCursor(Qt::PointingHandCursor)); + m_listWidget->setFocusPolicy(Qt::NoFocus); + m_listWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + m_listWidget->setSpacing(static_cast(dialogHeight * 0.03)); + m_listWidget->setStyleSheet("QListWidget{border-width:0;border-style:outset; background:transparent;}" + "QListWidget::Item{background:rgb(182, 182, 182);border-radius:10px;padding:2px 4px;}" + "QListWidget::Item:hover{background:rgb(255, 255, 255);border-radius:10px;padding:2px 4px;}" + "QListWidget::item:selected{background:rgb(70, 132, 198);border-radius:10px;padding:2px 4px;}" + "QListWidget::item:selected:!active{background:rgb(70, 132, 198);border-width:0px;border-radius:10px;padding:2px 4px;}"); + m_listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + QScroller::grabGesture(m_listWidget, QScroller::LeftMouseButtonGesture); + m_listWidget->setVerticalScrollMode(QListWidget::ScrollPerPixel); + m_listWidget->setFixedSize(dialogWidth, static_cast(dialogHeight * 0.7)); + + m_listWidget->addItems(items); + + //QFont ft; + for (int i=0; icount(); i++) { + //ft.setPointSize(static_cast(m_listWidget->item(i)->font().pointSize() * 2)); + //m_listWidget->item(i)->setFont(ft); + m_listWidget->item(i)->setTextAlignment(0x0084); + m_listWidget->item(i)->setSizeHint(QSize(dialogWidth, static_cast(UiConfig::GetInstance()->getUiHeight() * 0.05))); + } + m_listWidget->setCurrentRow(0); + + connect(m_listWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(slotItemClicked(QListWidgetItem*))); + + QVBoxLayout* vLay = new QVBoxLayout(); + vLay->addWidget(tle, 1, Qt::AlignCenter); + vLay->addWidget(m_listWidget, 90, Qt::AlignCenter); + //vLay->setMargin(0); + vLay->setContentsMargins(0, static_cast(dialogHeight * 0.1), 0, 0); + vLay->setSpacing(static_cast(dialogHeight * 0.1)); + vLay->addLayout(hbtmLayout); + setLayout(vLay); + + //支持圆角边框 + setStyleSheet("background-color:rgb(255, 255, 255);border-radius:10px;padding:2px 4px;focus{outline: none;}"); + //setStyleSheet("QWidget{background-color:gray;border-top-left-radius:15px;border-top-right-radius:5px;}"); + setAttribute(Qt::WA_TranslucentBackground);//设置窗口背景透明 + setWindowFlags(Qt::FramelessWindowHint); //设置无边框窗口 + + if(m_timer == nullptr){ + m_timer = new QTimer(this); + } + connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); + m_timer->start(TIMEOUT); +} + +StyleItemChooseDialog::~StyleItemChooseDialog() +{ + +} + +void StyleItemChooseDialog::paintEvent(QPaintEvent *event) +{ + //支持圆角边框 + QStyleOption opt; + opt.initFrom(this); + QPainter pr(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &pr, this);//绘制样式 + + return QWidget::paintEvent(event); +} + +void StyleItemChooseDialog::slotItemClicked(QListWidgetItem* item) +{ + Q_UNUSED(item); + m_chooseIndex = m_listWidget->currentRow(); + m_timeCnt = 0; + m_timer->start(TIMEOUT); +} + +int StyleItemChooseDialog::getChoosedIndex() const +{ + return m_chooseIndex; +} + +void StyleItemChooseDialog::slotTimeout() +{ + m_timeCnt++; + qDebug() << "slotTimeout:" << m_timeCnt; + if(m_timeCnt <= (PROC_OVERTIME - BACKSTAGE_PROC_OVERTIME + 1) ){//后台运行时间增加1s,确保界面选择了的情况下后台不会发送超时 + m_backstageIf->resetDecisionCenterTimer(); + } + else if(m_timeCnt >= PROC_OVERTIME){ + m_timer->stop(); + done(Rejected); + } +} + +SelectionDialog::SelectionDialog(const QString& tips, const QString& sel0, const QString& sel1, QObject *bgWidget) + : CustomDialog(sel1, bgWidget, sel0) +{ + QLabel* labelQues = new QLabel(this); + labelQues->setWordWrap(true); + labelQues->setText(tips); + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->addWidget(labelQues, 90, Qt::AlignCenter); + vLayout->addLayout(hbtmLayout); + vLayout->setSpacing(dialogHeight / 5); + vLayout->setContentsMargins(0, dialogHeight / 10, 0, 0); + setLayout(vLayout); + if(QDialog::Accepted == exec()){ + m_sel = 1; + } +} + +int SelectionDialog::selecion() const +{ + return m_sel; +} + + +TimeWidget::TimeWidget(bool enType, int timeSize, int dateSize, QWidget *parent) : QWidget(parent) +{ + QLabel* time = new QLabel(this); + QFont ft; + ft.setPointSize(timeSize); + time->setFont(ft); + + QLabel* date = new QLabel(this); + ft.setPointSize(dateSize); + date->setFont(ft); + + m_timerUpdate = new TimerUpdate(time, date, this, 1, 0, enType ? 1 : 2); + //Q_UNUSED(timerUpdate); + + QPalette palette(this->palette()); + palette.setColor(QPalette::WindowText,Qt::black); + setPalette(palette); + + QVBoxLayout* vlay = new QVBoxLayout(); + vlay->addStretch(10); + vlay->addWidget(time, 1, Qt::AlignCenter); + vlay->addWidget(date, 1, Qt::AlignCenter); + vlay->addStretch(10); + setLayout(vlay); +} + +void TimeWidget::enableUpdate(bool enable) +{ + m_timerUpdate->enableUpdate(enable); +} + + +DateTimeWidgetClassical::DateTimeWidgetClassical(int fontSize, QWidget *parent) : QWidget(parent) +{ + QFont ft; + ft.setPointSize(fontSize); + + QLabel* date = new QLabel(this); + date->setFont(ft); + + QLabel* time = new QLabel(this); + time->setFont(ft); + + TimerUpdate* timerUpdate = new TimerUpdate(time, date, this, 1, 1); + connect(timerUpdate, SIGNAL(signalNewDay()), this, SIGNAL(signalNewDay())); + + QHBoxLayout* hlay = new QHBoxLayout(); + hlay->addWidget(date, 1, Qt::AlignLeft); + hlay->addWidget(time, 1, Qt::AlignRight); + hlay->setMargin(0); + setLayout(hlay); +} + +//BtListWidget::BtListWidget(const QString &devId, const QString &devName, bool isPaired, int devStat) +BtListWidget::BtListWidget(BluetoothDev_t &rBtDev/*, bool isPaired*/) +{ + m_btDev = rBtDev; + //m_isPaired = isPaired; + + m_label_dev = new QLabel(this); + m_label_btIcon= new QLabel(this); + m_pushButton_set = new QPushButton(this); + connect(m_pushButton_set, SIGNAL(clicked()), this, SLOT(slotBtnSetClick())); + + QHBoxLayout* hLay = new QHBoxLayout(); + hLay->addWidget(m_label_btIcon, 1, Qt::AlignLeft); + hLay->addWidget(m_label_dev, 90, Qt::AlignLeft); + hLay->addWidget(m_pushButton_set, 1, Qt::AlignRight); + hLay->setSpacing(10); + hLay->setContentsMargins(20, 20, 40, 20); + setLayout(hLay); + + refreshWidget(); +} + +BtListWidget::~BtListWidget() +{ + +} + +void BtListWidget::refreshWidget() +{ + QPixmap pm; + if(m_btDev.devStat == BlueToothDevStat_connected) + { + pm.load(":/res/image/bt_blue_large.png"); + }else + { + pm.load(":/res/image/bt_black_large.png"); + } + m_label_btIcon->setPixmap(pm.scaled(45, 45, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + + QString showTextStr; + switch (m_btDev.devStat) { + case BlueToothDevStat_idle: + case BlueToothDevStat_paired: + showTextStr = QString("

%1

").arg(QString::fromStdString(m_btDev.name)); + break; + case BlueToothDevStat_pairing://匹配中 + showTextStr = QString("

%1
正在匹配中...

").arg(QString::fromStdString(m_btDev.name)); + break; + case BlueToothDevStat_connecting://连接中 + showTextStr = QString("

%1
正在连接中...

").arg(QString::fromStdString(m_btDev.name)); + break; + case BlueToothDevStat_connected://已连接 + showTextStr = QString("

%1
已连接

").arg(QString::fromStdString(m_btDev.name)); + break; + default: + showTextStr = QString("%1").arg(QString::fromStdString(m_btDev.name)); + break; + } + m_label_dev->setText(showTextStr); + //m_label_dev->setStyleSheet("background-color:yellow"); + m_label_dev->setAttribute(Qt::WA_TransparentForMouseEvents, true);//观察到设置html文本时,属性发生变化 + + setButtonBackImage(m_pushButton_set, ":/res/image/gear_large.png"); + + if(/*m_isPaired*/m_btDev.devStat >= BlueToothDevStat_paired){ + m_pushButton_set->setVisible(true); + }else{ + m_pushButton_set->setVisible(false); + } +} + +void BtListWidget::getDevInfo(BluetoothDev_t &dev) +{ + dev=m_btDev; +} + +void BtListWidget::updateDev(BluetoothDev_t &rBtDev) +{ + m_btDev = rBtDev; + + refreshWidget(); +} + +void BtListWidget::slotBtnSetClick() +{ + LOGD("slotBtnSetClick: %s", m_btDev.name.c_str()); + emit signalClickSet(m_btDev); +} + +IpInputBar::IpInputBar(bool isMask, QWidget *parent) : QWidget(parent), m_isMask(isMask) { + QHBoxLayout *hlay = new QHBoxLayout(); + hlay->setMargin(5); + hlay->setSpacing(5); + for (int i = 0; i < 4; i++) { + LineEditWithKeyboard *edit = new LineEditWithKeyboard(this); + edit->setFixedWidth(60); + edit->setStyleSheet("QLineEdit { background: transparent; border: none; border-bottom: 1px solid black; }"); + connect(edit, SIGNAL(textChanged(const QString &)), this, SLOT(slotTextChanged(const QString &))); + connect(edit, SIGNAL(signalBackspacePressed()), this, SLOT(slotBackspacePressed())); + m_edits.push_back(edit); + hlay->addWidget(edit); + if (i < 3) { + hlay->addWidget(new QLabel(".", this)); + } + } + setLayout(hlay); +} + +void IpInputBar::slotBackspacePressed() { + LineEditWithKeyboard *edit = dynamic_cast(sender()); + int editIndex = 0; + for (int i = 0; i < 4; i++) { + if (edit == m_edits.at(i)) { + editIndex = i; + break; + } + } + if (editIndex != 0 && edit->cursorPosition() == 0) { + keyboard::GetInstance(m_edits.at(editIndex - 1)); + } +} + +void IpInputBar::slotTextChanged(const QString &t) { + qDebug() << "text:" << t; + if (t.isEmpty()) { + return; + } + bool ok = false; + int value = t.toInt(&ok); + if (!ok) { + value = -1; + } + LineEditWithKeyboard *edit = dynamic_cast(sender()); + int editIndex = 0; + for (int i = 0; i < 4; i++) { + if (edit == m_edits.at(i)) { + editIndex = i; + break; + } + } + do { + bool inputOk = false; + ON_SCOPE_EXIT([&] { + if (inputOk) { + if (t.size() >= 3 && editIndex != 3) { + keyboard::GetInstance(m_edits.at(editIndex + 1)); + } + } + }); + QString lastChar{t.at(t.size() - 1)}; + if (value < 0 && editIndex != 3 && (lastChar == "." || lastChar == "·")) { + keyboard::GetInstance(m_edits.at(editIndex + 1)); + break; + } + QString errorTip; + if (!m_isMask && editIndex == 0) { + if (value >= 1 && value <= 223) { + inputOk = true; + return; + } + errorTip = tr("请指定一个介于1和223之间的值"); + } else { + if (value >= 0 && value <= 255) { + inputOk = true; + return; + } + errorTip = tr("请指定一个介于0和255之间的值"); + } + InfoDialog(errorTip).exec(); + } while (0); + edit->setText(edit->text().remove(edit->cursorPosition() - 1, 1)); +} + +bool IpInputBar::isEmpty() const { + for (const auto &e : m_edits) { + if (!e->text().isEmpty()) { + return false; + } + } + return true; +} + +QString IpInputBar::getIp() const { + return m_edits.at(0)->text() + "." + m_edits.at(1)->text() + "." + m_edits.at(2)->text() + "." + + m_edits.at(3)->text(); +} + +IpInputBarDialog::IpInputBarDialog(const QStringList &options, const QVector &required, + const QVector &isMask, QObject *bgWidget) + : CustomDialog(tr("确定"), bgWidget), m_required(required) { + QVBoxLayout *vLayout = new QVBoxLayout(); + int i = 0; + for (const auto &s : options) { + QHBoxLayout *hLayBar = new QHBoxLayout(); + hLayBar->setSpacing(10); + hLayBar->addWidget(new QLabel(s, this), 10, Qt::AlignLeft); + IpInputBar *bar = new IpInputBar(isMask.size() > i ? isMask.at(i) : false, this); + bar->setFixedHeight(dialogHeight / 4); + hLayBar->addWidget(bar, 1, Qt::AlignRight); + m_bars.push_back(bar); + vLayout->addLayout(hLayBar); + i++; + } + vLayout->addStretch(); + vLayout->addLayout(hbtmLayout, 1); + vLayout->setMargin(20); + vLayout->setSpacing(10); + setLayout(vLayout); + + setFixedSize(dialogWidth, static_cast(dialogHeight * 1.5)); + move((UiConfig::GetInstance()->getUiWidth() - dialogWidth) / 2, UiConfig::GetInstance()->getUiHeight() / 3); +} + +void IpInputBarDialog::slotConfirmBtnClicked() { + for (int i = 0; i < m_bars.size(); i++) { + const bool needCheck = !m_bars.at(i)->isEmpty() || i >= m_required.size() || m_required.at(i); + if (needCheck && !checkip(m_bars.at(i)->getIp())) { + InfoDialog(tr("设置有误,请重新输入!")).exec(); + return; + } + } + CustomDialog::slotConfirmBtnClicked(); +} + +QString IpInputBarDialog::getRow(int row) const { + if (row >= m_bars.size()) { + return ""; + } + return m_bars.at(row)->isEmpty() ? "" : m_bars.at(row)->getIp(); +} + +QString SearchBarCandidate::getCurrentChooseText() +{ + return m_listWidget->currentItem()->text(); +} + +void SearchBarCandidate::slotItemClicked(QListWidgetItem* item) +{ + ItemChoosePage::slotItemClicked(item); + emit signalItemChoosed(m_listWidget->currentRow()); +} + +ImgPlayer::ImgPlayer(int width, int height, QWidget *parent) : QWidget(parent), m_width(width), m_height(height) +{ + setFixedSize(m_width, m_height); + m_targetRct = QRectF(0.0, 0.0, m_width, m_height); +} + +void ImgPlayer::paintEvent(QPaintEvent * event) +{ + QPainter painter(this); + painter.drawImage(m_targetRct, m_img); +} + +void ImgPlayer::slotImgLoad(QImage img) +{ + m_img = img.scaled(m_width, m_height); + update(); +} + diff --git a/Linguist/utility/UiTools.h b/Linguist/utility/UiTools.h new file mode 100644 index 0000000..ed1a870 --- /dev/null +++ b/Linguist/utility/UiTools.h @@ -0,0 +1,994 @@ +#ifndef UITOOLS_H +#define UITOOLS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "LineEditWithKeyboard.h" +#include "BackstageInterfaceForUi.h" + +class WidgetWithBackstageInterface : public QWidget +{ +protected: + BackstageInterfaceForUi* m_backstageIf; + +public: + WidgetWithBackstageInterface(QWidget *parent = nullptr); + virtual ~WidgetWithBackstageInterface(); + virtual void setBackstageUiinterface(BackstageInterfaceForUi* interface); + //virtual void reset() = 0; +}; + +class PageAcceptMouseAndTouch : public WidgetWithBackstageInterface +{ +public: + explicit PageAcceptMouseAndTouch(QWidget *parent = nullptr); + +private: + bool eventFilter(QObject *watched, QEvent *event); + bool event(QEvent *event); +}; + +class PureColorPage : public PageAcceptMouseAndTouch +{ + Q_OBJECT +public: + explicit PureColorPage(unsigned int color, unsigned char tran = 255, bool drawRect = false, QWidget *parent = nullptr); + ~PureColorPage(); + +signals: +public slots: +private: + unsigned m_color; + unsigned char m_tran; + bool m_drawRect; + + void paintEvent(QPaintEvent *event); +}; + +class MyWidgetWithMainStyleColor : public WidgetWithBackstageInterface +{ +public: + explicit MyWidgetWithMainStyleColor(QWidget *parent = nullptr); + void paintEvent(QPaintEvent *event); +}; + +class MyWidgetWithSubStyleColor : public WidgetWithBackstageInterface +{ +public: + explicit MyWidgetWithSubStyleColor(QWidget *parent = nullptr); + void paintEvent(QPaintEvent *event); +}; + +class CustomDialog : public QDialog +{ + Q_OBJECT +public: + explicit CustomDialog(const QString& okBtnText, QObject *bgWidget = nullptr, const QString& cancelBtnText = tr("取消"), int timeout = 0); + virtual ~CustomDialog(); + +signals: + void signalShowShadowPage(bool show); + +public slots: + void slotCancleBtnClicked(); + virtual void slotConfirmBtnClicked(); + +protected: + QHBoxLayout* hbtmLayout; + int dialogWidth; + int dialogHeight; + + PureColorPage* m_wBg; + QTimer *m_timer = nullptr; + +private: + QPushButton* m_btn_ok = nullptr; + QPushButton* m_btn_cancle = nullptr; + const int m_timeout = 0; + + void paintEvent(QPaintEvent *event); + bool eventFilter(QObject *watched, QEvent *event); + bool event(QEvent *event); +}; + +#if 1 +class PasswordDialog : public CustomDialog +{ + Q_OBJECT + +public: + PasswordDialog(const QString& title, const QString& tip1, int timeout, QObject *bgWidget = nullptr, const QString& pwd = "", + const QString& tip0 = QString(), const QString& okBtn = tr("确定"), const QString& cancelBtn = tr("取消")); + virtual ~PasswordDialog(); + const QString& getPwd() const; + +public slots: + void slotPwdVisableBtnClicked(); + void slotRestoreBtnClicked(); + void slotConfirmBtnClicked(); + +signals: + void signalRestoreFactory(); + +private: + LineEditWithKeyboard* m_lineEdit_pwd; + QPushButton* m_btn_visable; + QPushButton* m_btn_factory; + QObject *m_bgWidget; + + QString m_pwd; + int m_mode = 0; +}; + +class QuestionDialog : public CustomDialog +{ + Q_OBJECT +public: + explicit QuestionDialog(const QString& question, QObject *bgWidget = nullptr, const QString& btnText = tr("确定")); + +signals: +public slots: +}; + +class InfoDialog : public CustomDialog +{ + Q_OBJECT +public: + explicit InfoDialog(const QString& info, QObject *bgWidget = nullptr, const QString& btnText = tr("知道了"), int timeout = 0); + +signals: +public slots: +}; + +class SliderDialog : public CustomDialog +{ + Q_OBJECT +public: + explicit SliderDialog(int current, int min, int max, const QString& tip, QObject *bgWidget = nullptr); + ~SliderDialog(); + int getValueSet() const; + +signals: +public slots: + void slotValueChanged(int value); + +private: + QLabel* m_labelCurrent; + QSlider* m_slider; + int m_iCurrent; +}; + +class DateTimeDialog : public CustomDialog +{ + Q_OBJECT +public: + explicit DateTimeDialog(const QDateTime& dateTime, QObject *bgWidget = nullptr, bool needDate = true, bool needTime = true); + QDateTime getValueSet() const; + +signals: +public slots: + void slotConfirmBtnClicked(); + +private: + QDateTimeEdit* m_dateTimeSet; + QDateTime m_dataTimeVal; +}; + +class RadioBtnChooseDialog : public CustomDialog +{ + Q_OBJECT + +protected: + QLabel* m_label_title; + QRadioButton* m_rdo; + QVBoxLayout* vLayout; + +public: + explicit RadioBtnChooseDialog(const QVector& labels, QObject *bgWidget = nullptr, const int choose = 0, const QVector *config = nullptr, const QString& title = ""); + virtual ~RadioBtnChooseDialog(); + int getChoosedIndex() const; + +public slots: + void slotRadioButtonPressed(); + +private: + int m_option_num; + int m_chooseIndex; +}; + +class LineEditInputDialog : public CustomDialog +{ + Q_OBJECT + +protected: + QFormLayout* formLayout; + QVBoxLayout* vLayout; + + LineEditWithKeyboard* m_editRow; + QString* m_stringRowInput; + int m_rowNum; + +protected slots: + void slotConfirmBtnClicked(); + +public: + LineEditInputDialog(const QStringList& labels, QObject *bgWidget = nullptr, const QString& confirBtm = tr("确定")); + LineEditInputDialog(const QString& label, QObject *bgWidget = nullptr, const QString& confirBtm = tr("确定")); + virtual ~LineEditInputDialog(); + + QString getRow(const int) const ; + void fillRow(const int, const QString&, bool readOnly = false); + +private: + void init(const QStringList& labels); +}; + +class MsgDialog : public CustomDialog +{ + Q_OBJECT +public: + explicit MsgDialog(const QString& msg, QObject *bgWidget = nullptr); +}; + +class ComSelectDialog : public CustomDialog +{ + Q_OBJECT + +protected: + QFormLayout* formLayout; + QVBoxLayout* vLayout; + + QVector m_cbSels; + int m_rowNum; + +protected slots: + +public: + ComSelectDialog(const QStringList& titles, const QVector& sels, QObject *bgWidget = nullptr, const QString& confirBtm = tr("确定")); + virtual ~ComSelectDialog(); + + int getRow(int) const ; + void setRow(int row, int set, bool readOnly = false); + +private: +}; + +class IpInputDialog : public LineEditInputDialog +{ + Q_OBJECT + +protected: + +protected slots: + void slotTextChanged(const QString &); + void slotConfirmBtnClicked(); + +public: + IpInputDialog(const QStringList& ips, QObject *bgWidget = nullptr, const QString& confirBtm = tr("确定")); + IpInputDialog(const QString& ip, QObject *bgWidget = nullptr, const QString& confirBtm = tr("确定")); + virtual ~IpInputDialog(); + +private: +}; +#endif + +class MyMessageBox : public QMessageBox +{ +public: + MyMessageBox(); + +protected: + void showEvent(QShowEvent* event); + void paintEvent(QPaintEvent *event); +}; + +class myListWidget : public QWidget +{ +public: + typedef enum + { + enSwitch, + enMoreArrow, + enRedWord, + enTick, + enIndent1 + }_enProp; + + typedef enum + { + enPropertyNull, + enPropertySwitch = 1 << enSwitch, + enPropertyMoreArrow = 1 << enMoreArrow, + enPropertyRedWord = 1 << enRedWord, + enPropertyTick = 1 << enTick, + enPropertyIndent1 = 1 << enIndent1 + }enProperty; + + class SetOpnCfg + { + public: + const QString m_sOpn; + const QString m_sVal; + const enProperty m_prop; + SetOpnCfg(const QString& opn, const QString& val, const enProperty prop) : m_sOpn(opn), m_sVal(val), m_prop(prop){} + SetOpnCfg(const QString& opn, const QString& val) : m_sOpn(opn), m_sVal(val), m_prop(myListWidget::enPropertyNull){} + SetOpnCfg(const QString& opn) : m_sOpn(opn), m_sVal(""), m_prop(myListWidget::enPropertyNull){} + SetOpnCfg() : m_sOpn(""), m_sVal(""), m_prop(myListWidget::enPropertyNull){} + SetOpnCfg& operator= (const SetOpnCfg& obj){Q_UNUSED(obj) return *this;} + }; + + myListWidget(const SetOpnCfg& cfg, QWidget* parent = nullptr); + ~myListWidget(); + + void updateLabel(const QString& val); + void updateIcon(const QString& icon, int scale_w=0, int scale_h=0); + void setLeftIcon(const QString& icon, int scale_w, int scale_h); + const QString getLabelString() const; + const QString getOpnLabelString() const; + const QString getOptionLabel() const; + +private: + QLabel* m_label_leftIcon; + QLabel* m_label_left; + QLabel* m_label_right; + QLabel* m_label_icon; + QHBoxLayout* m_hbLayout; + int m_layoutObjQty = 0; + bool m_hasIndent = false; +}; + +class SwitchListWidget : public QWidget +{ +private: + QLabel* m_label_left; + QLabel* m_label_right; + QLabel* m_label_icon; + + bool m_Res; + +public: + SwitchListWidget(const QString& left, const QString& right, const QString& icon, QWidget*parent); + ~SwitchListWidget(); + + void updateLabel(const QString& label); + void updateIcon(const QString& icon); + void updateIcon(bool bFlag); + bool getSwitchRes(); + const QString getLabelString() const; +}; + +class FourListWidget : public QWidget +{ +private: + QLabel* m_label_left; + QLabel* m_label_right; + QLabel* m_label_icon; + QPushButton* m_btn_mid; + +public: + FourListWidget(const QString& left, const QString& right, const QString& btnText, const QString& icon, QWidget*parent); + ~FourListWidget(); + + void updateLabel(const QString& label); + void updateIcon(const QString& icon); + void updateBtnText(const QString& text); + + QPushButton* getPushButton(); + + const QString getLabelString() const; +}; + +class setPushButton : public QWidget +{ +public: + setPushButton(QPushButton* pPushButton, const QString& tip, const QString& icon, const QSize& size); + ~setPushButton(); + +private: + QVBoxLayout* _pVBoxLayoutDevice; + QLabel* _pLabelIcon; +}; + +void setLanguage(QApplication&, const QString&); +void setFont(QApplication& app, const QString&, const int fontSize, const int); + +void setLineEditFontColor(QLineEdit* edit, const QColor& color); +void setLineEditStyle(QLineEdit* edit); +void setButtonBackImage(QPushButton *button, QString image, int sizeW = 0, int sizeH = 0); +QListWidgetItem* setListWidgetItem(QListWidgetItem* item, const QString text = "", const QString image = ""); + +class TimerUpdate : public QWidget +{ + Q_OBJECT +public: + explicit TimerUpdate(QLabel* pLabel, QWidget *parent = nullptr); + TimerUpdate(QLabel* labelTime, QLabel* labelDate, QWidget *parent = nullptr, int timeType = 0, int dateType = 0, int weekType = 0); + ~TimerUpdate(); + void timerEvent(QTimerEvent *event); + void enableUpdate(bool enable); + +signals: + void signalNewDay(); + +private: + int _timerID; + QLabel* _labelTime; + QLabel* _labelDate; + int m_timeType; + int m_dateType; + int m_weekType; + + bool m_enableUpdate = true; + + void init(); +}; + +QPixmap PixmapToRound(QPixmap &src, int radius); +QImage ScaleImage(const QImage& image, const QSize& size); +QImage ScaleImage2Label(const QImage& qImage, const QLabel& label); +QPixmap ScalePixmap(const QPixmap& pixmap, const QSize& size); +QPixmap ScalePixmap2Label(const QPixmap& pixmap, const QLabel& label); + +class MyLineEdit:public QLineEdit +{ + Q_OBJECT + public: + explicit MyLineEdit(QWidget *parent = nullptr); + ~MyLineEdit(); + protected: + //添加并重写鼠标点击事件函数 + virtual void mousePressEvent(QMouseEvent *event); + signals: + //点击信号函数 + void clicked(); +}; + +class LocalFourListWidget : public QWidget +{ +private: + QLabel* m_label_left; + QLabel* m_label_mid; + QLabel* m_label_right; + QLabel* m_label_icon; + + +public: + LocalFourListWidget(const QString& left, const QString& mid, const QString& right, const QString& icon, QWidget*parent); + + ~LocalFourListWidget(); + + void updateLabel(const QString& label); + + void updateRight(const QString& text); + + void updateIcon(const QString& icon); + + const QString getLabelString() const; +}; + +bool checkip(const QString& ip); +bool checkMask(const QString& mask); + +//判断是否在同一网段 +bool isSameNetwork(const QString& ip, const QString& mask, const QString& gateway); + +bool getIpFromUserInput(const QString& lineEdit, const QString& initIp, QString& newIp, QObject *bgWidget = nullptr); +bool getMaskFromUserInput(const QString& lineEdit, const QString& initIp, QString& newIp, QObject *bgWidget = nullptr); +bool getNumFromUserInput(const QString& lineEdit, const QString& initNum, QString& newValue, const int min, const int max, QObject *bgWidget = nullptr); + +QString GBK2UTF8(const QString &inStr); +QString UTF82GBK(const QString &inStr); +std::string gbk2utf8(const QString &inStr); +QString utf82gbk(const std::string &inStr); +void gbkToUtf8(char *gbkstr); + +class ProgressWidget : public QWidget +{ +public: + explicit ProgressWidget(const QString& title); + ~ProgressWidget(); + void setMsg(const unsigned current, const unsigned all); + +private: + QLabel* m_label_title; + QLabel* m_label_msg; + QSlider* m_slider_progess; +}; + +class SettingUiPage : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + typedef myListWidget::SetOpnCfg SetOpn; + explicit SettingUiPage(const QVector& config, QWidget *parent = nullptr); + +protected: + const QVector config; + QListWidget* m_listWidget; + + void controlListWidgetItemShow(const bool sw, int option); + +signals: + void signalShowPage(int, const QString title = ""); + +protected slots: + virtual void slotItemClicked(QListWidgetItem* item) = 0; +}; + +class MsgListWidgetItem : public QWidget +{ +public: + typedef enum + { + enBold, + enGreyWord, + enGreenWord, + enRedWord + }_enProp; + + typedef enum + { + enPropertyNull, + enPropertyBold = 1 << enBold, + enPropertyGreyWord = 1 << enGreyWord, + enPropertyGreenWord = 1 << enGreenWord, + enPropertyRedWord = 1 << enRedWord + }enProperty; + + typedef struct + { + QString m_sMsg; + enProperty m_eProp; + }stMsgOpn; + + class MsgSet + { + public: + const QString m_sPic; + const QVector m_vMsgs; + MsgSet() : m_sPic(""){} + MsgSet(const QString& pic, const QVector& msgs) : m_sPic(pic), m_vMsgs(msgs){} + MsgSet& operator=(const MsgSet& obj){Q_UNUSED(obj) return *this;} + }; + + MsgListWidgetItem(QWidget* parent); + ~MsgListWidgetItem(); + + void showMsg(const QString& pic, const QVector& msgs); +private: + const int m_msgOpnQty = 4; + + QLabel* labelPic; + QVector labelMsg; +}; + +class PersonMsgUiPage : public MyWidgetWithMainStyleColor +{ + Q_OBJECT +public: + typedef MsgListWidgetItem::stMsgOpn MsgOpn; + typedef MsgListWidgetItem::enProperty MsgOpnProp; + typedef MsgListWidgetItem::MsgSet MsgSet; + + const unsigned m_itemQty = 5; + + explicit PersonMsgUiPage(QWidget *parent = nullptr); + void showMsg(const QVector& msgs); + void clearMsg(); + void setPageControlBarHide(bool hide, int min = 0, int max = 0, int current = 0); + void showMoreSearchOpn(); + +protected: + #define SEARCH_OPN_QTY 2 + enum{ + enSearchOpnName, + enSearchOpnTime + }; + QLineEdit* m_editSearch[SEARCH_OPN_QTY]; + QPushButton* m_btnClearSearch[SEARCH_OPN_QTY]; + QLabel* m_labelTip[SEARCH_OPN_QTY]; + QPushButton* m_btnMore; + + QStackedWidget* m_stackWgt; + QListWidget* m_listWidget; + QLabel* m_labelPage; + QLabel* m_labelMin; + QLabel* m_labelMax; + QPushButton* m_btnPrePage; + QPushButton* m_btnNextPage; + QSlider* m_sliderPage; + + int m_toPageNum; + QString m_sSearchName; + QString m_sSearchtime; + +protected slots: + virtual void slotTextChanged(const QString& text) = 0; + virtual void slotBtnClicked(); + virtual void slotSliderReleased() = 0; + virtual void slotItemClicked(QListWidgetItem *item); + void slotValueChanged(int value); +}; + +class ItemChoosePage : public SettingUiPage +{ + Q_OBJECT +public: + explicit ItemChoosePage(const QVector& config, int choose, QWidget *parent = nullptr); + int getChoosedIndex() const; + +public slots: + void slotItemClicked(QListWidgetItem*); + +private: + int m_chooseIndex; +}; + +class ItemChooseDialog : public CustomDialog +{ + Q_OBJECT + +protected: + ItemChoosePage* m_ItemsPage; + QVBoxLayout* vLayout; + +public: + explicit ItemChooseDialog(const QVector& items, const int choose, QObject *bgWidget = nullptr); + virtual ~ItemChooseDialog(); + int getChoosedIndex() const; + +public slots: +}; + +class CalendarDialog : public CustomDialog +{ + Q_OBJECT +public: + explicit CalendarDialog(bool isEn, QObject *bgWidget = nullptr); + QDate getDateChoose() const; + +signals: +public slots: + void slotConfirmBtnClicked(); + +private: + QCalendarWidget* m_wgtCal; + QDate m_date; +}; + +class LineEditWithDialog : public QLineEdit +{ + Q_OBJECT +public: + LineEditWithDialog(int dialogType, QObject *bgWidget = nullptr, QWidget *parent = nullptr); + ~LineEditWithDialog(); +protected: + void mousePressEvent(QMouseEvent *event); + +signals: + +private: + int m_dialogType; + QObject *m_bgWidget; +}; + +class WifiListWidget : public QWidget +{ +public: + WifiListWidget(const QString& ssid, bool connected, bool withLock, int sigLevel, bool isTargetNet, QWidget* parent); + ~WifiListWidget(); + + void updateStatus(bool connected); + QString getSsid() const; + bool isTargetNet() const; + bool isConnected() const; + bool getLockStatus() const; + void clearStatus(); + +private: + QLabel* m_label_conn; + QLabel* m_label_ssid; + const bool m_isLock; + bool m_isTargetNet; + bool m_isConnected; +}; + +class WifiAccPointDialog : public LineEditInputDialog +{ + Q_OBJECT + +private slots: + void slotConfirmBtnClicked(); + +public: + WifiAccPointDialog(QObject *bgWidget = nullptr); + virtual ~WifiAccPointDialog(); + + QString getEncType() const; + +private: + QComboBox* m_comBox_encType; + QString m_sEncType; +}; + +int GrabFullScreen(const QString& picName, int rotate = 0); + +class DrawPage : public QWidget +{ + Q_OBJECT + + struct DrawPara + { + QList points; + }; + + QPushButton* m_btnClear; + QPushButton* m_btnExit; + + QList m_drawList; + DrawPara m_current; + + void draw(QPainter& painter, DrawPara& param); + void append(QPoint p); + +signals: + void signalClosed(); + +protected: + void mousePressEvent(QMouseEvent *evt); + void mouseMoveEvent(QMouseEvent *evt); + void mouseReleaseEvent(QMouseEvent *evt); + void paintEvent(QPaintEvent *); + +public slots: + void slotClearBtnClicked(); + void slotExitBtnClicked(); + +public: + DrawPage(int w, int h, QWidget *parent = 0); + ~DrawPage(); +}; + +class UserPwdDialog : public QDialog +{ + Q_OBJECT +public: + QString m_pwd; + explicit UserPwdDialog(); + +signals: +public slots: + void slotBtnClicked(); + +private: + enum{NUM_BTNS_QTY = 10}; + QLineEdit* m_editPwd; + QPushButton* m_btnsNum[NUM_BTNS_QTY]; + QPushButton* m_btnBack; + QPushButton* m_btnClear; + QPushButton* m_btnBackspace; + QPushButton* m_btnConfirm; +}; + +class QPasswordLineEdit : public QLineEdit +{ + Q_OBJECT + +public: + QPasswordLineEdit(QWidget *parent, const QString& ch = "•", int timeout = 300); + ~QPasswordLineEdit(); +private slots: + void DisplayPasswordAfterEditSlot(int,int); + void DisplayPasswordSlot(); + void GetRealTextSlot(const QString&); + +public: + QString GetPassword() const; + void SetTimeout(int msec); + int GetTimeout() const; + +private: + QString GetMaskString(); + +private: + const QString m_ch; + int m_Timeout; + QString m_LineEditText; + int m_LastCharCount = 0; + QTimer* m_timer; +}; + +class RoundedWidget : public QWidget +{ + Q_OBJECT + +public: + explicit RoundedWidget(QWidget *parent = nullptr); + +private: + void paintEvent(QPaintEvent *event); +}; + +class StyleItemChooseDialog : public CustomDialog +{ + Q_OBJECT + +protected: + +public: + explicit StyleItemChooseDialog(const QString& title, const QStringList& items, BackstageInterfaceForUi* backstageIf); + virtual ~StyleItemChooseDialog(); + int getChoosedIndex() const; + +public slots: + void slotItemClicked(QListWidgetItem* item); + void slotTimeout(); + +private: + enum{ + TIMEOUT = 1000, + BACKSTAGE_PROC_OVERTIME = 5, + PROC_OVERTIME = 10 + }; + BackstageInterfaceForUi* m_backstageIf; + QListWidget* m_listWidget; + int m_chooseIndex = 0; + int m_timeCnt = 0; + + void paintEvent(QPaintEvent *event); +}; + +class SelectionDialog : public CustomDialog +{ + Q_OBJECT +public: + explicit SelectionDialog(const QString& tips, const QString& sel0, const QString& sel1, QObject *bgWidget = nullptr); + int selecion() const; +signals: +public slots: + +private: + int m_sel = 0; +}; + +class TimeWidget : public QWidget +{ + Q_OBJECT +public: + explicit TimeWidget(bool enType, int timeSize, int dateSize, QWidget *parent = nullptr); + void enableUpdate(bool enable); + +public slots: + +private: + TimerUpdate* m_timerUpdate; +}; + +class DateTimeWidgetClassical : public QWidget +{ + Q_OBJECT +public: + explicit DateTimeWidgetClassical(int fontSize, QWidget *parent = nullptr); + +signals: + void signalNewDay(); +}; + +class BtListWidget : public QWidget +{ + Q_OBJECT +public: + //BtListWidget(const QString& devId, const QString& devName, bool isPaired, int devStat); + BtListWidget(BluetoothDev_t &rBtDev/*, bool isPaired = false*/); + ~BtListWidget(); + + void refreshWidget(); + void getDevInfo(BluetoothDev_t &dev); + void updateDev(BluetoothDev_t &rBtDev); + +signals: + void signalClickSet(BluetoothDev_t btDev); + +public slots: + void slotBtnSetClick(); + +private: + QLabel* m_label_btIcon = nullptr; + QLabel* m_label_dev = nullptr; + //QLabel* m_label_pairedIcon; + //QLabel* m_label_stat; + QPushButton *m_pushButton_set = nullptr; +#if 0 + QString m_devId;//设备唯一标识 + QString m_devName; + int m_devStat; +#endif + BluetoothDev_t m_btDev; + //bool m_isPaired;//是否已配对的蓝牙设备 + +}; + +class IpInputBar : public QWidget { + Q_OBJECT + +public: + IpInputBar(bool isMask, QWidget *parent = nullptr); + bool isEmpty() const; + QString getIp() const; + +protected slots: + void slotTextChanged(const QString &t); + void slotBackspacePressed(); + +private: + const bool m_isMask; + QVector m_edits; +}; + +class IpInputBarDialog : public CustomDialog { + Q_OBJECT + +public: + IpInputBarDialog(const QStringList &options, const QVector &required, const QVector &isMask, + QObject *bgWidget); + QString getRow(int row) const; + +protected slots: + void slotConfirmBtnClicked(); + +private: + QVector m_bars; + const QVector m_required; +}; + +class SearchBarCandidate : public ItemChoosePage +{ + Q_OBJECT +public: + using ItemChoosePage::ItemChoosePage; + QString getCurrentChooseText(); + +signals: + void signalItemChoosed(int); + +public slots: + void slotItemClicked(QListWidgetItem*); +}; + +class ImgPlayer : public QWidget +{ + Q_OBJECT +public: + ImgPlayer(int width, int height, QWidget *parent = nullptr); + +signals: + +public slots: + void slotImgLoad(QImage); + +private: + QImage m_img; + int m_width; + int m_height; + QRectF m_targetRct; + + void paintEvent(QPaintEvent *); +}; + +#endif // _UITOOLS_H_