diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index adb54ce..1eb30e0 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/uappbase/service/config_index.hpp b/uappbase/service/config_index.hpp
index e96e7d6..01ff1df 100644
--- a/uappbase/service/config_index.hpp
+++ b/uappbase/service/config_index.hpp
@@ -21,7 +21,7 @@ typedef struct {
const char *initval;
} cfg_iterm_info_t;
-#define CFG_MAX_INDEX 58
+#define CFG_MAX_INDEX 61
const char *cfgName(int32_t index);
cfg_iterm_type_t cfgType(int32_t index);
diff --git a/usrc/service/page/submenu/Page_muSettings.cpp b/usrc/service/page/submenu/Page_muSettings.cpp
index 969590f..e1d22d0 100644
--- a/usrc/service/page/submenu/Page_muSettings.cpp
+++ b/usrc/service/page/submenu/Page_muSettings.cpp
@@ -69,7 +69,10 @@ void Page_muSettings::updatePage() {
UIS->setTxt(PAGE, ob_muSettings_pumpCoef1, zfmt("%.4f", getMotorMLPR(1)));
UIS->setTxt(PAGE, ob_muSettings_pumpCoef2, zfmt("%.4f", getMotorMLPR(2)));
UIS->setTxt(PAGE, ob_muSettings_pumpCoef3, zfmt("%.4f", getMotorMLPR(3)));
- UIS->setTxt(PAGE, ob_muSettings_pipeLen0, getCfgStr(kcfg_pipeLengthML));
+ UIS->setTxt(PAGE, ob_muSettings_pipeLen0, zfmt("%.2f", getCfgPipeLengthML(0)));
+ UIS->setTxt(PAGE, ob_muSettings_pipeLen1, zfmt("%.2f", getCfgPipeLengthML(1)));
+ UIS->setTxt(PAGE, ob_muSettings_pipeLen2, zfmt("%.2f", getCfgPipeLengthML(2)));
+ UIS->setTxt(PAGE, ob_muSettings_pipeLen3, zfmt("%.2f", getCfgPipeLengthML(3)));
// TODO:改成4个输入框
UIS->setTxt(PAGE, ob_muSettings_addAcidVel0, zitoa(getMxRunRPM(0)));
UIS->setTxt(PAGE, ob_muSettings_addAcidVel1, zitoa(getMxRunRPM(1)));
@@ -138,9 +141,32 @@ void Page_muSettings::OnInputFieldContentChange(uint8_t bid, const char* text) {
* pipeLen *
***********************************************************************************************************************/
+ if (bid == ob_muSettings_pipeLen0 || bid == ob_muSettings_pipeLen1 || bid == ob_muSettings_pipeLen2 || bid == ob_muSettings_pipeLen3) {
+ float len = atof(text);
+ if (len < 0.1) {
+ UIS->alert("管道长度不能小于0.1");
+ return;
+ }
+ }
+
if (bid == ob_muSettings_pipeLen0) {
- CS->setcfg(kcfg_pipeLengthML, text);
- UIS->setTxt(bid, getCfgStr(kcfg_pipeLengthML));
+ CS->setcfg(kcfg_pipeLengthML0, text);
+ UIS->setTxt(bid, zfmt("%.2f", getCfgPipeLengthML(0)));
+ }
+
+ if (bid == ob_muSettings_pipeLen1) {
+ CS->setcfg(kcfg_pipeLengthML1, text);
+ UIS->setTxt(bid, zfmt("%.2f", getCfgPipeLengthML(1)));
+ }
+
+ if (bid == ob_muSettings_pipeLen2) {
+ CS->setcfg(kcfg_pipeLengthML2, text);
+ UIS->setTxt(bid, zfmt("%.2f", getCfgPipeLengthML(2)));
+ }
+
+ if (bid == ob_muSettings_pipeLen3) {
+ CS->setcfg(kcfg_pipeLengthML3, text);
+ UIS->setTxt(bid, zfmt("%.2f", getCfgPipeLengthML(3)));
}
/***********************************************************************************************************************
diff --git a/usrc/service/pump_ctrl_service.cpp b/usrc/service/pump_ctrl_service.cpp
index 4e21855..c960104 100644
--- a/usrc/service/pump_ctrl_service.cpp
+++ b/usrc/service/pump_ctrl_service.cpp
@@ -68,8 +68,10 @@ void PumpCtrlService::updateMotorSetting() {
void PumpCtrlService::stop() {
ZLOGI(TAG, "stop");
+ stopAll();
m_thread.stop();
stopAll();
+
ZLOGI(TAG, "stop finish");
}
@@ -214,7 +216,7 @@ void PumpCtrlService::doMoveOnce() {
cur_motor->stop();
cur_motor->setXACTUAL(0);
if (pumpselect) {
- cur_motor->moveBy(-(int32_t)(getPumpAppendMl(i)* 1000) , getMxRunRPM(i));
+ cur_motor->moveBy(-(int32_t)(getPumpAppendMl(i) * 1000), getMxRunRPM(i));
}
}
diff --git a/usrc/service/remote_controler_event_processer.cpp b/usrc/service/remote_controler_event_processer.cpp
index 405ba83..50346e5 100644
--- a/usrc/service/remote_controler_event_processer.cpp
+++ b/usrc/service/remote_controler_event_processer.cpp
@@ -41,6 +41,7 @@ void RemoteControlerEventProcesser::initialize() {
AppEventBus::ins()->pushEvent(appevent);
} else if (packet->cmd == kzble_report_disconnect_event) {
GSM->setRemoterS(false);
+ PUMPCS->stop();
}
// ZLOGI(TAG, "TRACE process ble report end");
});
@@ -92,6 +93,11 @@ void RemoteControlerEventProcesser::processKeyEventFromRemoter(hand_acid_remoter
* @brief 如果当前设备处于工作中,则无论什么按键都是停止工作
*/
+ if (PUMPCS->isWorking()) {
+ PUMPCS->stop();
+ RCTRL->setRemoterState(GSM->getRunMode(), PUMPCS->isWorking());
+ }
+
if (UIS->getNowPage() == pg_muPumpTest) {
ZLOGW(TAG, "now page is in pump test, remote key event process by pumpTestPage");
return;
@@ -106,35 +112,30 @@ void RemoteControlerEventProcesser::processKeyEventFromRemoter(hand_acid_remoter
return;
}
- if (PUMPCS->isWorking()) {
- PUMPCS->stop();
- RCTRL->setRemoterState(GSM->getRunMode(), PUMPCS->isWorking());
- } else {
- if (keyEvent == hand_acid_remoter_kevent_add_liquid) {
- //
- if (!GSM->isHasPumpSelect()) {
- UIS->alert("请至少选中一个泵机");
- return;
- }
-
- if (GSM->getRunMode() == khand_acid_m_jog_mode) {
- PUMPCS->moveOnce();
- } else if (GSM->getRunMode() == khand_acid_m_continuous_mode) {
- PUMPCS->autoMoveMutiTimes();
- }
- } else if (keyEvent == hand_acid_remoter_kevent_change_next_mode) {
- // 修改工作模式
- 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);
- }
- } else if (keyEvent == hand_acid_remoter_kevent_reflux) {
- // 回流
- PUMPCS->reflux();
- } else if (keyEvent == hand_acid_remoter_kevent_preFilling) {
- // 管路填充
- PUMPCS->acidPrefilling();
+ if (keyEvent == hand_acid_remoter_kevent_add_liquid) {
+ //
+ if (!GSM->isHasPumpSelect()) {
+ UIS->alert("请至少选中一个泵机");
+ return;
+ }
+
+ if (GSM->getRunMode() == khand_acid_m_jog_mode) {
+ PUMPCS->moveOnce();
+ } else if (GSM->getRunMode() == khand_acid_m_continuous_mode) {
+ PUMPCS->autoMoveMutiTimes();
+ }
+ } else if (keyEvent == hand_acid_remoter_kevent_change_next_mode) {
+ // 修改工作模式
+ 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);
}
+ } else if (keyEvent == hand_acid_remoter_kevent_reflux) {
+ // 回流
+ PUMPCS->reflux();
+ } else if (keyEvent == hand_acid_remoter_kevent_preFilling) {
+ // 管路填充
+ PUMPCS->acidPrefilling();
}
}