diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index adb54ce..c0c67e3 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/ui/exp_pages/keyPasswd.page b/ui/exp_pages/keyPasswd.page deleted file mode 100644 index 16204f1..0000000 Binary files a/ui/exp_pages/keyPasswd.page and /dev/null differ diff --git a/ui/exp_pages/keybdA.page b/ui/exp_pages/keybdA.page deleted file mode 100644 index 802ceca..0000000 Binary files a/ui/exp_pages/keybdA.page and /dev/null differ diff --git a/ui/exp_pages/keybdAP.page b/ui/exp_pages/keybdAP.page deleted file mode 100644 index 3bc9e95..0000000 Binary files a/ui/exp_pages/keybdAP.page and /dev/null differ diff --git a/ui/exp_pages/keybdB.page b/ui/exp_pages/keybdB.page deleted file mode 100644 index 472591a..0000000 Binary files a/ui/exp_pages/keybdB.page and /dev/null differ diff --git a/ui/exp_pages/muBleHandSett.page b/ui/exp_pages/muBleHandSett.page deleted file mode 100644 index 694f76e..0000000 Binary files a/ui/exp_pages/muBleHandSett.page and /dev/null differ diff --git a/ui/exp_pages/muMotorSett.page b/ui/exp_pages/muMotorSett.page deleted file mode 100644 index 86d10e8..0000000 Binary files a/ui/exp_pages/muMotorSett.page and /dev/null differ diff --git a/ui/exp_pages/muPumpSett.page b/ui/exp_pages/muPumpSett.page deleted file mode 100644 index 014ab87..0000000 Binary files a/ui/exp_pages/muPumpSett.page and /dev/null differ diff --git a/ui/exp_pages/muSetting.page b/ui/exp_pages/muSetting.page deleted file mode 100644 index 8f74f12..0000000 Binary files a/ui/exp_pages/muSetting.page and /dev/null differ diff --git a/usrc/uicontroler/page/demo_page_cpp b/usrc/uicontroler/page/demo_page_cpp new file mode 100644 index 0000000..e0538e4 --- /dev/null +++ b/usrc/uicontroler/page/demo_page_cpp @@ -0,0 +1,41 @@ + +#include "db/dao/user_dao.hpp" +#include "uappbase/apphal/apphal.hpp" +#include "ui/ui.h" +#include "uicontroler/base/page_processer.hpp" +// +#include "db/dao/acid_ch_cfg_dao.hpp" +#include "db/dao/device_setting_dao.hpp" +// +#include "service/pump_ctrl_service.hpp" + +namespace iflytop { +using namespace std; +#define TAG "MuIntervalPage" + +class MuIntervalPage : public IPageProcesser { + private: + + public: + MuIntervalPage() : IPageProcesser(TAG, pg_muInterval) {} + + virtual void initialize() override { + IPageProcesser::initialize(); + syncState(); + } + + private: + virtual void OnPageLoad(OnPageLoadContext* cxt) { return; }; + virtual void OnBackKey() { return; }; + virtual void OnInputFieldContentChange(uint8_t bid, const char* text) { return; }; + virtual void OnButton(uint8_t bid, uint8_t val) { return; }; + virtual void OnDoubleStateButton(uint8_t bid, uint8_t val) { return; }; + virtual void OnAppEvent(AppEvent_t* event) { return; }; + + void syncState() {} +}; + +// 实例化Page, 使其自动注册 +static MuIntervalPage instance; +} // namespace iflytop + diff --git a/usrc/uicontroler/page/muInterval_page.cpp b/usrc/uicontroler/page/muInterval_page.cpp new file mode 100644 index 0000000..f9670ad --- /dev/null +++ b/usrc/uicontroler/page/muInterval_page.cpp @@ -0,0 +1,64 @@ + +#include "db/dao/user_dao.hpp" +#include "uappbase/apphal/apphal.hpp" +#include "ui/ui.h" +#include "uicontroler/base/page_processer.hpp" +// +#include "db/dao/acid_ch_cfg_dao.hpp" +#include "db/dao/device_setting_dao.hpp" +// +#include "service/pump_ctrl_service.hpp" + +namespace iflytop { +using namespace std; +#define TAG "MuIntervalPage" + +class MuIntervalPage : public IPageProcesser { + private: + public: + MuIntervalPage() : IPageProcesser(TAG, pg_muInterval) {} + + virtual void initialize() override { + IPageProcesser::initialize(); + syncState(); + } + + private: + virtual void OnPageLoad(OnPageLoadContext* cxt) { + syncState(); + return; + }; + /** + * @brief 返回上一页 + */ + virtual void OnBackKey() { UIControler::ins()->chpage(pg_navi); }; + + + virtual void OnInputFieldContentChange(uint8_t bid, const char* text) { + if (bid == ob_muInterval_stAcidInte) { + float distrIntervalSSecond = atof(text); + if (distrIntervalSSecond <= 0) { + UIS->popWarningWin("酸液间隔时间不能小于0"); + UIS->setTxt(pageId, ob_muInterval_stAcidInte, "%.1f", DeviceSettingDao::get()->distrIntervalS); + return; + } + + if (distrIntervalSSecond > 30) { + UIS->popWarningWin("酸液间隔时间不能大于30"); + UIS->setTxt(pageId, ob_muInterval_stAcidInte, "%.1f", DeviceSettingDao::get()->distrIntervalS); + return; + } + DeviceSettingDao::updatedistrIntervalS(distrIntervalSSecond); + UIS->setTxt(pageId, bid, zfmt("%.1f", distrIntervalSSecond)); + } + }; + virtual void OnButton(uint8_t bid, uint8_t val) { return; }; + virtual void OnDoubleStateButton(uint8_t bid, uint8_t val) { return; }; + virtual void OnAppEvent(AppEvent_t* event) { return; }; + + void syncState() { UIS->setTxt(pageId, ob_muInterval_stAcidInte, "%.1f", DeviceSettingDao::get()->distrIntervalS); } +}; + +// 实例化Page, 使其自动注册 +static MuIntervalPage instance; +} // namespace iflytop diff --git a/usrc/uicontroler/page/navi_page.cpp b/usrc/uicontroler/page/navi_page.cpp index 9dd8db2..9483db1 100644 --- a/usrc/uicontroler/page/navi_page.cpp +++ b/usrc/uicontroler/page/navi_page.cpp @@ -93,7 +93,7 @@ class NaviPage : public IPageProcesser { ZLOGI(TAG, "on muButton muIndex=%d ", muIndex); if (buttonIndex < m_menuTotalNum) { - // UIControler::ins()->chpage(m_muInfo[buttonIndex].page); + UIControler::ins()->chpage(m_muInfo[buttonIndex].page); } } } diff --git a/usrc/uicontroler/page/popwin_page.cpp b/usrc/uicontroler/page/popwin_page.cpp index ac2f7fd..5547b23 100644 --- a/usrc/uicontroler/page/popwin_page.cpp +++ b/usrc/uicontroler/page/popwin_page.cpp @@ -63,19 +63,23 @@ class PopWinPage : public IPageProcesser { virtual void OnDoubleStateButton(uint8_t bid, uint8_t val) override {} virtual void OnAppEvent(AppEvent_t* event) override {} + void updateTitle(UIPopWinType_t type, int messageNum) { + if (type == UI_POP_WIN_TYPE_INFO) { + UIControler::ins()->setTxt(pageId, ob_popwin_t1, "消息(%d)", messageNum); + } else if (type == UI_POP_WIN_TYPE_WARNING_INFO) { + UIControler::ins()->setTxt(pageId, ob_popwin_t1, "警告(%d)", messageNum); + } else if (type == UI_POP_WIN_TYPE_CONFIRM) { + UIControler::ins()->setTxt(pageId, ob_popwin_t1, "消息(%d)", messageNum); + } else if (type == UI_POP_WIN_TYPE_FATAL_ERROR) { + UIControler::ins()->setTxt(pageId, ob_popwin_t1, "警告(%d)", messageNum); + } + } + void updatePopWindowsInfo(UIPopInfo_t* info) { - int num = UIPublicState::getPopInfoNum(); - if (num != displayNum) { - displayNum = num; - if (info->type == UI_POP_WIN_TYPE_INFO) { - UIControler::ins()->setTxt(pageId, ob_popwin_t1, "消息(%d)", displayNum + 1); - } else if (info->type == UI_POP_WIN_TYPE_WARNING_INFO) { - UIControler::ins()->setTxt(pageId, ob_popwin_t1, "警告(%d)", displayNum + 1); - } else if (info->type == UI_POP_WIN_TYPE_CONFIRM) { - UIControler::ins()->setTxt(pageId, ob_popwin_t1, "消息(%d)", displayNum + 1); - } else if (info->type == UI_POP_WIN_TYPE_FATAL_ERROR) { - UIControler::ins()->setTxt(pageId, ob_popwin_t1, "警告(%d)", displayNum + 1); - } + int remind = UIPublicState::getPopInfoNum(); + if (remind + 1 != displayNum) { + displayNum = remind + 1; + updateTitle(info->type, displayNum); } } @@ -85,12 +89,12 @@ class PopWinPage : public IPageProcesser { } handupInfoFlag = true; - displayNum = UIPublicState::getPopInfoNum(); + displayNum = UIPublicState::getPopInfoNum() + 1; UIControler::ins()->chpage(pg_popwin); if (info->type == UI_POP_WIN_TYPE_INFO) { // 消息 - UIControler::ins()->setTxt(pageId, ob_popwin_t1, "消息(%d)", displayNum + 1); + updateTitle(info->type, displayNum); UIControler::ins()->sendcmd("p[%d].b[%d].pco=%d", pageId, ob_popwin_t1, 10591 /*蓝色*/); UIControler::ins()->setTxt(pageId, ob_popwin_info, info->info); @@ -100,7 +104,7 @@ class PopWinPage : public IPageProcesser { } else if (info->type == UI_POP_WIN_TYPE_WARNING_INFO) { // 警告消息 - UIControler::ins()->setTxt(pageId, ob_popwin_t1, "警告(%d)", displayNum + 1); + updateTitle(info->type, displayNum); UIControler::ins()->sendcmd("p[%d].b[%d].pco=%d", pageId, ob_popwin_t1, 63488 /*红色*/); UIControler::ins()->setTxt(pageId, ob_popwin_info, info->info); @@ -110,7 +114,7 @@ class PopWinPage : public IPageProcesser { } else if (info->type == UI_POP_WIN_TYPE_CONFIRM) { // 确认(可被取消) - UIControler::ins()->setTxt(pageId, ob_popwin_t1, "消息(%d)", displayNum + 1); + updateTitle(info->type, displayNum); UIControler::ins()->sendcmd("p[%d].b[%d].pco=%d", pageId, ob_popwin_t1, 10591 /*蓝色*/); UIControler::ins()->setTxt(pageId, ob_popwin_info, info->info); @@ -119,7 +123,7 @@ class PopWinPage : public IPageProcesser { UIControler::ins()->vis(ob_popwin_canclekey, 1); } else if (info->type == UI_POP_WIN_TYPE_FATAL_ERROR) { // 警告消息 - UIControler::ins()->setTxt(pageId, ob_popwin_t1, "警告(%d)", displayNum + 1); + updateTitle(info->type, displayNum); UIControler::ins()->sendcmd("p[%d].b[%d].pco=%d", pageId, ob_popwin_t1, 63488 /*红色*/); UIControler::ins()->setTxt(pageId, ob_popwin_info, info->info);