diff --git a/README.md b/README.md index 276f00d..910f0de 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ TODO: 2. 添加恢复出厂设置按键,且恢复出厂设置按键按下后,需要根用户二次确认。 3. 转换比设置错误可能到只泵机不转 4. 修改muSetting名为 muAdvanced + 5. 添加审计功能 + 6. 添加自动unlogin功能 ``` diff --git a/ui/usrui.h b/ui/usrui.h new file mode 100644 index 0000000..14c8406 --- /dev/null +++ b/ui/usrui.h @@ -0,0 +1,4 @@ +#pragma once + +#define pic_jog_mode 34 +#define pic_continuous_mode 35 \ No newline at end of file diff --git a/usrc/service/front_end_controler.cpp b/usrc/service/front_end_controler.cpp index 36a950a..02000bc 100644 --- a/usrc/service/front_end_controler.cpp +++ b/usrc/service/front_end_controler.cpp @@ -112,14 +112,13 @@ void FrontEndControler::startSchedule() { ZLOGD(TAG, "page change from %d to %d frompoppage %d", m_lastPage, m_nowPage, m_isInPopWin); #endif m_isInPopWin = false; - + callUsrEventCb(&event_cache); if (input_file_event_cache_state) { callUsrEventCb(&input_file_event_cache); input_file_event_cache_state = false; } - } else if (tjc::kpt_on_promopt_page_load == packetType) { event_cache.eventId = packetType; event_cache.pid = packet.data[1]; @@ -519,4 +518,6 @@ void FrontEndControler::setEnumComponentState(uint8_t pid, uint8_t bid, int32_t // 枚举类型使用动画组件 sendcmd("p[%d].b[%d].tim=%d", pid, bid, state * 50); } +void FrontEndControler::setPic(uint8_t pid, uint8_t bid, int32_t picNum) { sendcmd("p[%d].b[%d].pic=%d", pid, bid, picNum); } + void FrontEndControler::setAph(uint8_t pid, uint8_t bid, int32_t state) { sendcmd("p[%d].b[%d].aph=%d", pid, bid, state); } diff --git a/usrc/service/front_end_controler.hpp b/usrc/service/front_end_controler.hpp index c66372c..3f1a3c3 100644 --- a/usrc/service/front_end_controler.hpp +++ b/usrc/service/front_end_controler.hpp @@ -83,6 +83,8 @@ class FrontEndControler { void setTouchEnableState(uint8_t bid, uint8_t enable); void setEnumComponentState(uint8_t pid, uint8_t bid, int32_t state); + void setPic(uint8_t pid, uint8_t bid, int32_t picNum); + void setAph(uint8_t pid, uint8_t bid, int32_t state); // 组件透明度,最大127,设置为0则隐藏组件 void sendcmd(const char* format, ...); diff --git a/usrc/service/page/Page_login.cpp b/usrc/service/page/Page_login.cpp index ef2a074..c2b6545 100644 --- a/usrc/service/page/Page_login.cpp +++ b/usrc/service/page/Page_login.cpp @@ -70,6 +70,12 @@ void Page_login::OnLoginButtonClick(uint8_t bid, const char* userName, const cha UIS->alert("用户不存在"); return; } + if(strlen(curUsrPasswd) == 0){ + UIS->setTxt(PAGE, OBJ(txtPasswd), ""); + UIS->alert("密码为空"); + return; + } + if (strcmp(curUsrPasswd, passwd) != 0) { UIS->setTxt(PAGE, OBJ(txtPasswd), ""); UIS->alert("密码错误"); diff --git a/usrc/service/page/Page_main.cpp b/usrc/service/page/Page_main.cpp index 47d6a19..6b5548c 100644 --- a/usrc/service/page/Page_main.cpp +++ b/usrc/service/page/Page_main.cpp @@ -1,6 +1,7 @@ #include "Page_main.hpp" #include "service\pump_ctrl_service.hpp" +#include "ui/usrui.h" using namespace iflytop; #define PAGE pg_main @@ -28,6 +29,12 @@ static CfgItermCache cfgcache; */ void Page_main::updateRunModeState() { // 更新底部状态栏 + if ((int32_t)GSM->getRunMode() == khand_acid_m_jog_mode) { + UIS->setPic(PAGE, ob_main_RunMode, pic_jog_mode); + } else { + UIS->setPic(PAGE, ob_main_RunMode, pic_continuous_mode); + } + UIS->setEnumComponentState(PAGE, ob_main_RunMode, (int32_t)GSM->getRunMode()); // 运行模式 if (GSM->getRunMode() == khand_acid_m_jog_mode) { UIS->vis(ob_main_RunModeVal, 0);