From 9d560e858800ad47b718fdd273e6a1e4a2d53d11 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 26 Nov 2024 16:29:32 +0800 Subject: [PATCH] update --- README.md | 3 +++ usrc/uicontroler/page/popwin_page.cpp | 10 +++++----- usrc/uicontroler/ui_controler.cpp | 12 ++++++++---- usrc/uicontroler/ui_controler.hpp | 7 ++++--- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d6d60f0..6f6bf55 100644 --- a/README.md +++ b/README.md @@ -56,4 +56,7 @@ UI 量产时注意事项: 1. 量产时,需要注意注意掉显示密码的相关日志 + + 2. 如果从屏幕读取状态失败,则自动重启设备 + ``` diff --git a/usrc/uicontroler/page/popwin_page.cpp b/usrc/uicontroler/page/popwin_page.cpp index b68e2dd..9846fc7 100644 --- a/usrc/uicontroler/page/popwin_page.cpp +++ b/usrc/uicontroler/page/popwin_page.cpp @@ -147,7 +147,7 @@ class PopWinPage : public IPageProcesser { UIControler::ins()->setTxt(thisPage, ob_popwin_info, info->info); UIControler::ins()->sendcmd("p[%d].b[%d].pco=%d", thisPage, ob_popwin_info, 0 /*黑色*/); - UIControler::ins()->vis(ob_popwin_canclekey, 0); + visEx(ob_popwin_canclekey, 0); } else if (info->type == UI_POP_WIN_TYPE_WARNING_INFO) { // 警告消息 @@ -157,7 +157,7 @@ class PopWinPage : public IPageProcesser { UIControler::ins()->setTxt(thisPage, ob_popwin_info, info->info); UIControler::ins()->sendcmd("p[%d].b[%d].pco=%d", thisPage, ob_popwin_info, 63488 /*红色*/); - UIControler::ins()->vis(ob_popwin_canclekey, 0); + visEx(ob_popwin_canclekey, 0); } else if (info->type == UI_POP_WIN_TYPE_CONFIRM) { // 确认(可被取消) @@ -167,7 +167,7 @@ class PopWinPage : public IPageProcesser { UIControler::ins()->setTxt(thisPage, ob_popwin_info, info->info); UIControler::ins()->sendcmd("p[%d].b[%d].pco=%d", thisPage, ob_popwin_info, 0 /*黑色*/); - UIControler::ins()->vis(ob_popwin_canclekey, 1); + visEx(ob_popwin_canclekey, 1); } else if (info->type == UI_POP_WIN_TYPE_FATAL_ERROR) { // 警告消息 updateTitle(info->type, displayNum); @@ -176,8 +176,8 @@ class PopWinPage : public IPageProcesser { UIControler::ins()->setTxt(thisPage, ob_popwin_info, info->info); UIControler::ins()->sendcmd("p[%d].b[%d].pco=%d", thisPage, ob_popwin_info, 63488 /*红色*/); - UIControler::ins()->vis(ob_popwin_canclekey, 0); - UIControler::ins()->vis(ob_popwin_confirmkey, 0); + visEx(ob_popwin_canclekey, 0); + visEx(ob_popwin_confirmkey, 0); } } diff --git a/usrc/uicontroler/ui_controler.cpp b/usrc/uicontroler/ui_controler.cpp index 15d5b1f..1920e1d 100644 --- a/usrc/uicontroler/ui_controler.cpp +++ b/usrc/uicontroler/ui_controler.cpp @@ -12,7 +12,7 @@ using namespace iflytop; #define TAG "UIScheduler" -#define MODULE_DEBUG 0 +#define MODULE_DEBUG 1 #define UART_RX_OVERTIME 5 #define CMD_OVERTIME 50 @@ -104,7 +104,7 @@ void UIControler::startSchedule() { tjc_packet_type_t packetType = (tjc_packet_type_t)packet.data[0]; auto* processer = TJCEventProcesserMgr::findProcesser((tjc_packet_type_t)packetType); - ZLOGI(TAG, "[eventprocess-thread]: rx_event:%s(%d)", tjc::pt2str(packetType), packetType); + // ZLOGI(TAG, "[eventprocess-thread]: rx_event:%s(%d)", tjc::pt2str(packetType), packetType); if (processer != nullptr) { processer->process(packet.data, packet.datalen, &event_cache); @@ -382,9 +382,13 @@ bool UIControler::visEx(uint8_t pid, uint8_t bid, bool val) { do { if (!component->isPosInited) { suc = readFiledAsInt(pid, bid, "x", &component->oldPosX); - if (!suc) break; + if (!suc) { + ZLOGE(TAG, "fatal error, reboot"); + } suc = readFiledAsInt(pid, bid, "y", &component->oldPosY); - if (!suc) break; + if (!suc) { + ZLOGE(TAG, "fatal error, reboot"); + } } if (val) { diff --git a/usrc/uicontroler/ui_controler.hpp b/usrc/uicontroler/ui_controler.hpp index 7ade592..ee5e743 100644 --- a/usrc/uicontroler/ui_controler.hpp +++ b/usrc/uicontroler/ui_controler.hpp @@ -147,9 +147,6 @@ class UIControler { * UTILS * ***********************************************************************************************************************/ - bool vis(uint16_t bid, int32_t val); // 不支持跨页面隐藏 - void setTouchEnableState(uint8_t bid, uint8_t enable); // 不支持跨页面隐藏 - bool visEx(uint8_t pid, uint8_t bid, bool val); // 通过搬移组件实现跨页面隐藏 bool movePicToXY(uint8_t pid, uint8_t bid, int32_t x, int32_t y); bool movePicTo(uint8_t pid, uint8_t bid, uint8_t toBid); @@ -162,6 +159,10 @@ class UIControler { void callUsrEventCb(UIEvent* event); bool _readFiledAsInt(uint8_t pid, uint8_t bid, const char* valName, int32_t* val); + + private: + bool vis(uint16_t bid, int32_t val); // 不支持跨页面隐藏 + void setTouchEnableState(uint8_t bid, uint8_t enable); // 不支持跨页面隐藏 }; class UILoadingCxt {