diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 23da28a..4bab941 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,11 +5,7 @@ -<<<<<<< HEAD -======= - ->>>>>>> 541bbd702f91cfcdab14987942eadb80efe961b0 @@ -20,11 +16,7 @@ -<<<<<<< HEAD -======= - ->>>>>>> 541bbd702f91cfcdab14987942eadb80efe961b0 diff --git a/stm32components b/stm32components index 6a1cbb0..90f08ae 160000 --- a/stm32components +++ b/stm32components @@ -1 +1 @@ -Subproject commit 6a1cbb0c87d2440d011f74f52a4a80691521542f +Subproject commit 90f08ae581ffe8686182f18ef9502ea6a08ac54b diff --git a/ui/hand_acid_mainboard_ui.HMI b/ui/hand_acid_mainboard_ui.HMI index 8c983dc..0558a2e 100644 Binary files a/ui/hand_acid_mainboard_ui.HMI and b/ui/hand_acid_mainboard_ui.HMI differ diff --git a/ui/hand_acid_mainboard_ui.tft b/ui/hand_acid_mainboard_ui.tft index d267fc9..b05ca26 100644 Binary files a/ui/hand_acid_mainboard_ui.tft and b/ui/hand_acid_mainboard_ui.tft differ diff --git a/ui/ui.h b/ui/ui.h index 7857139..1cac361 100644 --- a/ui/ui.h +++ b/ui/ui.h @@ -107,8 +107,8 @@ #define ob_home_weekArr 45 #define ob_home_m0 46 #define ob_home_tc0 47 -#define ob_home_p1 48 -#define ob_home_t0 49 +#define ob_home_blebattery 48 +#define ob_home_blebatlevl 49 //navi.objs #define ob_navi_navi 0 #define ob_navi_bak 1 diff --git a/ui/usrui.h b/ui/usrui.h index a3f1cd9..e69de29 100644 --- a/ui/usrui.h +++ b/ui/usrui.h @@ -1,4 +0,0 @@ -#pragma once - -#define pic_jog_mode 26 -#define pic_continuous_mode 27 diff --git a/usrc/apphardware/apphardware.cpp b/usrc/apphardware/apphardware.cpp index db72605..3cc5ff6 100644 --- a/usrc/apphardware/apphardware.cpp +++ b/usrc/apphardware/apphardware.cpp @@ -81,11 +81,21 @@ void AppHardware::initialize() { ZLOGI(TAG, "motor3 initialize TMC51X0:%x", MOTO3.readICVersion()); ZLOGI(TAG, "motor4 initialize TMC51X0:%x", MOTO4.readICVersion()); + + MOTO1.setGlobalScale(64); + MOTO2.setGlobalScale(64); + MOTO3.setGlobalScale(64); + MOTO4.setGlobalScale(64); + + + MOTO1.setIHOLD_IRUN(10, 31, 100); MOTO2.setIHOLD_IRUN(10, 31, 100); MOTO3.setIHOLD_IRUN(10, 31, 100); MOTO4.setIHOLD_IRUN(10, 31, 100); + + MOTO1.setScale(1000); MOTO2.setScale(1000); MOTO3.setScale(1000); diff --git a/usrc/db/dao/acid_ch_cfg_dao.cpp b/usrc/db/dao/acid_ch_cfg_dao.cpp index 9c78f28..1238d76 100644 --- a/usrc/db/dao/acid_ch_cfg_dao.cpp +++ b/usrc/db/dao/acid_ch_cfg_dao.cpp @@ -49,7 +49,7 @@ void AcidChCfgDao::init() { tabledata->item[i].mLPR = 1.0; // 电机 mlpr tabledata->item[i].pumpDefVel = PUMPDEFVEL; // 泵机默认速度r/min RPM tabledata->item[i].pipeLengthML = 35.5; // 酸液管路长度 - tabledata->item[i].irun = 22; // 电机 irun + tabledata->item[i].irun = 10; // 电机 irun // #define CH0APPENDML 0.2 // #define CH1APPENDML 0.2 diff --git a/usrc/db/dao/user_dao.cpp b/usrc/db/dao/user_dao.cpp index 55067f4..b746ff4 100644 --- a/usrc/db/dao/user_dao.cpp +++ b/usrc/db/dao/user_dao.cpp @@ -274,7 +274,7 @@ const char** UserDao::getUsrNameTable() { memset(nameTable, 0, sizeof(nameTable)); for (int i = 0; i < MAX_USR_NUM; i++) { if (usr_table_data->user[i].effective) { - sprintf(nameTableCache[i], "%-20s", usr_table_data->user[i].name); + sprintf(nameTableCache[i], "%s", usr_table_data->user[i].name); nameTable[i] = nameTableCache[i]; // nameTable[i] = usr_table_data->user[i].name; } else { diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 1c2231f..d39cee2 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -20,7 +20,7 @@ #define HARDWARE_VERSION 1 // 硬件版本 #define PROJECT "hand_acid_main_board" // 工程名称 -#define APP_VERSION VERSION(3, 0, 2) +#define APP_VERSION VERSION(3, 0, 3) #define APP_VERSION_MAIN ((APP_VERSION >> 16) & 0xff) #define APP_VERSION_SUB ((APP_VERSION >> 8) & 0xff) #define APP_VERSION_FIX (APP_VERSION & 0xff) diff --git a/usrc/service/remote_controler_event_processer.cpp b/usrc/service/remote_controler_event_processer.cpp index 3a07414..c565362 100644 --- a/usrc/service/remote_controler_event_processer.cpp +++ b/usrc/service/remote_controler_event_processer.cpp @@ -105,11 +105,7 @@ void RemoteControlerEventProcesser::processKeyEventInHomePage(hand_acid_remoter_ * @brief 修改工作模式 */ - if (GSM->getRunMode() == khand_acid_m_jog_mode) { - GSM->setRunMode(khand_acid_m_continuous_mode); - } else if (GSM->getRunMode() == khand_acid_m_continuous_mode) { - GSM->setRunMode(khand_acid_m_jog_mode); - } + ZLOGW(TAG,"手柄修改模式的功能已经被禁用,只允许在屏幕修改模式"); } else if (keyEvent == hand_acid_remoter_kevent_preFilling) { /** * @brief 预充酸液 diff --git a/usrc/uicontroler/page/home_page.cpp b/usrc/uicontroler/page/home_page.cpp index d69c253..0328f64 100644 --- a/usrc/uicontroler/page/home_page.cpp +++ b/usrc/uicontroler/page/home_page.cpp @@ -126,6 +126,22 @@ class HomePage : public IPageProcesser { } else if (bid == ob_home_MenuButton) { UIS->chpage(pg_navi, true); } + + /** + * @brief 模式切换 + */ + if (bid == ob_home_RunModeVal || bid == ob_home_RunMode) { + if (PUMPCS->isWorking()) { + UIS->popWarningWin("工作中,请稍后再操作"); + return; + } + + if (GSM->getRunMode() == khand_acid_m_jog_mode) { + GSM->setRunMode(khand_acid_m_continuous_mode); + } else if (GSM->getRunMode() == khand_acid_m_continuous_mode) { + GSM->setRunMode(khand_acid_m_jog_mode); + } + } } virtual void onAppEvent(AppEvent* event) override { if (event->type == kAE_RemoterHeartEvent) { @@ -228,8 +244,8 @@ class HomePage : public IPageProcesser { UIControler::ins()->setPicturePicNum(thisPage, ob_home_RemoterS, ob_home_RemoterS1); } else { UIControler::ins()->setPicturePicNum(thisPage, ob_home_RemoterS, ob_home_RemoterS0); - UIControler::ins()->movePicOutOfScreen(thisPage, 48); - UIControler::ins()->movePicOutOfScreen(thisPage, 49); + UIControler::ins()->movePicOutOfScreen(thisPage, ob_home_blebattery); + UIControler::ins()->movePicOutOfScreen(thisPage, ob_home_blebatlevl); } } @@ -240,15 +256,15 @@ class HomePage : public IPageProcesser { } bool bleIsConnected = GStateMgr::ins()->getRemoterS(); if (bleIsConnected) { - UIControler::ins()->movePicToXY(thisPage, 48, 646, 28); - UIControler::ins()->movePicToXY(thisPage, 49, 647, 24); + UIControler::ins()->movePicToXY(thisPage, ob_home_blebattery, 646, 28); // 电池图标 + UIControler::ins()->movePicToXY(thisPage, ob_home_blebatlevl, 647, 24); // 电池电量 if (heart_info.charge_flag != POWER_STDBY && power_val == 100) { power_val = 99; } - UIControler::ins()->setTxt(thisPage, 49, "%d", power_val); + UIControler::ins()->setTxt(thisPage, ob_home_blebatlevl, "%d", power_val); } else { - UIControler::ins()->movePicOutOfScreen(thisPage, 48); - UIControler::ins()->movePicOutOfScreen(thisPage, 49); + UIControler::ins()->movePicOutOfScreen(thisPage, ob_home_blebattery); + UIControler::ins()->movePicOutOfScreen(thisPage, ob_home_blebatlevl); } if (heart_info.charge_flag == POWER_NORMAL) { power_val = 0; diff --git a/usrc/uicontroler/page/mupage/muCHSetting_page.cpp b/usrc/uicontroler/page/mupage/muCHSetting_page.cpp index da4b160..d36282a 100644 --- a/usrc/uicontroler/page/mupage/muCHSetting_page.cpp +++ b/usrc/uicontroler/page/mupage/muCHSetting_page.cpp @@ -51,6 +51,7 @@ static cfgbid_table_iterm_t* CH_APPEND_ML_BIND_CFG; static void Page_muPumpTest_onTimer(const void* tid); #define PRECISION "%.2f" +#define MLPR_BIND_CFG_PRECISION "%.4f" static const char* fmt(const char* txt, ...) { static char buf[256]; @@ -68,11 +69,11 @@ class MuChSetting : public IPageProcesser { virtual void initialize() override { IPageProcesser::initialize(); - intCfg(0, &ACID_CHOOS_ENAME_BIND_CFG, "通道名称", AcidChCfgDao::getCfg(0)->acidChooseName, "", false); + intCfg(0, &ACID_CHOOS_ENAME_BIND_CFG, "酸液名称", AcidChCfgDao::getCfg(0)->acidChooseName, "", false); intCfg(1, &IRUN_BIND_CFG, "IRUN", fmt("%d", AcidChCfgDao::getCfg(0)->irun), "", false); - intCfg(2, &PUMP_DEF_VEL_BIND_CFG, "速度", fmt("%d", AcidChCfgDao::getCfg(0)->pumpDefVel), "r/min", false); - intCfg(3, &PIPE_LENGTH_ML_BIND_CFG, "管路长度", fmt(PRECISION, AcidChCfgDao::getCfg(0)->pipeLengthML), "ml", false); - intCfg(4, &MLPR_BIND_CFG, "转速转换系数", fmt(PRECISION, AcidChCfgDao::getCfg(0)->mLPR), "", false); + intCfg(2, &PUMP_DEF_VEL_BIND_CFG, "蠕动泵转速", fmt("%d", AcidChCfgDao::getCfg(0)->pumpDefVel), "r/min", false); + intCfg(3, &PIPE_LENGTH_ML_BIND_CFG, "管路预充液体体积", fmt(MLPR_BIND_CFG_PRECISION, AcidChCfgDao::getCfg(0)->pipeLengthML), "ml", false); + intCfg(4, &MLPR_BIND_CFG, "转换系数(体积/转数)", fmt(PRECISION, AcidChCfgDao::getCfg(0)->mLPR), "", false); intCfg(5, &CH_APPEND_ML_BIND_CFG, "防滴液体积", fmt(PRECISION, AcidChCfgDao::getCfg(0)->chAppendMl), "ml", false); osTimerDef(statiUpdateTimer, Page_muPumpTest_onTimer); @@ -146,8 +147,7 @@ class MuChSetting : public IPageProcesser { } else if (PIPE_LENGTH_ML_BIND_CFG && bid == PIPE_LENGTH_ML_BIND_CFG->cfgbid) { // 管路长度 UIControler::ins()->popNumKeyBoard(thisPage, bid, 4, fmt(PRECISION, AcidChCfgDao::getCfg(0)->pipeLengthML)); } else if (MLPR_BIND_CFG && bid == MLPR_BIND_CFG->cfgbid) { // 转速转换系数 - UIControler::ins()->popNumKeyBoard(thisPage, bid, 4, fmt(PRECISION, AcidChCfgDao::getCfg(0)->mLPR)); - + UIControler::ins()->popNumKeyBoard(thisPage, bid, 7, fmt(MLPR_BIND_CFG_PRECISION, AcidChCfgDao::getCfg(0)->mLPR)); } else if (CH_APPEND_ML_BIND_CFG && bid == CH_APPEND_ML_BIND_CFG->cfgbid) { // 防滴液体积 UIControler::ins()->popNumKeyBoard(thisPage, bid, 4, fmt(PRECISION, AcidChCfgDao::getCfg(0)->chAppendMl)); } diff --git a/usrc/uicontroler/ui_controler.cpp b/usrc/uicontroler/ui_controler.cpp index e568090..44e7c9a 100644 --- a/usrc/uicontroler/ui_controler.cpp +++ b/usrc/uicontroler/ui_controler.cpp @@ -205,7 +205,7 @@ bool UIControler::readFiledAsInt(uint8_t pid, uint8_t bid, const char* filedName return true; } ZLOGW(TAG, "readFiledAsInt pid:%d bid:%d %s failed retry %d", pid, bid, filedName, i); - osDelay(600); + osDelay(1000); } ZLOGE(TAG, "readFiledAsInt %s failed", filedName); return false; @@ -344,7 +344,7 @@ void UIControler::sendcmd(const char* format, ...) { } void UIControler::sendcmd(const char* format, va_list args) { - static char buf[256]; + static char buf[1024]; memset(buf, 0, sizeof(buf)); vsprintf(buf, format, args); @@ -353,7 +353,7 @@ void UIControler::sendcmd(const char* format, va_list args) { #endif uint8_t len = strlen(buf); - if (len > (256 - 3)) { + if (len > (1024 - 3)) { ZLOGI(TAG, "sendcmd too long"); return; } @@ -419,7 +419,7 @@ bool UIControler::visEx(uint8_t pid, uint8_t bid, bool val) { if (!component->isPosInited) { suc = readFiledAsInt(pid, bid, "x", &component->oldPosX); if (!suc) { - for (size_t i = 0; i < 10; i++) { + for (size_t i = 0; i < 3; i++) { ZLOGE(TAG, "fatal error, reboot"); osDelay(1000); } @@ -427,7 +427,7 @@ bool UIControler::visEx(uint8_t pid, uint8_t bid, bool val) { } suc = readFiledAsInt(pid, bid, "y", &component->oldPosY); if (!suc) { - for (size_t i = 0; i < 10; i++) { + for (size_t i = 0; i < 3; i++) { ZLOGE(TAG, "fatal error, reboot"); osDelay(1000); } @@ -532,7 +532,7 @@ void UIControler::popNumKeyBoard(uint8_t fromPid, uint8_t fromBid, int limitLeng void UIControler::popKeyBMutSel(uint8_t fromPid, uint8_t fromBid, int selectvalindex, const char** selectvals) { zlock_guard lg(m_cmdlock); - static char contentbus[128]; + static char contentbus[512]; memset(contentbus, 0, sizeof(contentbus)); for (int i = 0;; i++) { // \r\n 拼接字符串数组