|
|
@ -109,15 +109,19 @@ void Page_main::OnInputFieldContentChange(uint8_t bid, const char* text) { |
|
|
|
else if (bid == ob_main_acidname0) { |
|
|
|
ZLOGI(TAG, "acidname0:%s", text); |
|
|
|
CS->setcfgAndFlush(kcfg_acidChooseName0, text); |
|
|
|
UIS->setVal(PAGE, bid, text); |
|
|
|
} else if (bid == ob_main_acidname1) { |
|
|
|
ZLOGI(TAG, "acidname1:%s", text); |
|
|
|
CS->setcfgAndFlush(kcfg_acidChooseName1, text); |
|
|
|
UIS->setVal(PAGE, bid, text); |
|
|
|
} else if (bid == ob_main_acidname2) { |
|
|
|
ZLOGI(TAG, "acidname2:%s", text); |
|
|
|
CS->setcfgAndFlush(kcfg_acidChooseName2, text); |
|
|
|
UIS->setVal(PAGE, bid, text); |
|
|
|
} else if (bid == ob_main_acidname3) { |
|
|
|
ZLOGI(TAG, "acidname3:%s", text); |
|
|
|
CS->setcfgAndFlush(kcfg_acidChooseName3, text); |
|
|
|
UIS->setVal(PAGE, bid, text); |
|
|
|
} |
|
|
|
|
|
|
|
// 设置加酸间隔
|
|
|
@ -125,13 +129,11 @@ void Page_main::OnInputFieldContentChange(uint8_t bid, const char* text) { |
|
|
|
int32_t distrIntervalSecond = atoi(text); |
|
|
|
if (distrIntervalSecond <= 0) { |
|
|
|
UIS->alert("酸液间隔时间不能小于0"); |
|
|
|
UIS->setVal(PAGE, ob_main_RunModeVal, CS->getStr(kcfg_distrInterval, &cfgcache)); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (distrIntervalSecond > 30) { |
|
|
|
UIS->alert("酸液间隔时间不能大于30"); |
|
|
|
UIS->setVal(PAGE, ob_main_RunModeVal, CS->getStr(kcfg_distrInterval, &cfgcache)); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -167,14 +169,15 @@ void Page_main::OnButton(uint8_t bid, uint8_t val) { |
|
|
|
void Page_main::processAcidevalUpdateEvent(uint8_t bid, const char* text, int ch, config_index_t cfgid) { |
|
|
|
float add_ml = atof(text); |
|
|
|
if (add_ml < 0) { |
|
|
|
UIS->setVal(PAGE, bid, CS->getStr(cfgid, &cfgcache)); // 恢复数值
|
|
|
|
UIS->alert("设定值不能小于0"); |
|
|
|
return; |
|
|
|
} else if (add_ml > CS->getInt(kcfg_echDitrUpLi)) { |
|
|
|
UIS->setVal(PAGE, bid, CS->getStr(cfgid, &cfgcache)); // 恢复数值
|
|
|
|
UIS->alert(fmt("设定值不能大于%d", CS->getInt(kcfg_echDitrUpLi))); |
|
|
|
return; |
|
|
|
} |
|
|
|
ZLOGI(TAG, "set acid ch%d:%s", ch, text); |
|
|
|
CS->setcfgAndFlush(cfgid, text); //
|
|
|
|
char reformattext[20]; |
|
|
|
sprintf(reformattext, "%.1f", add_ml); |
|
|
|
ZLOGI(TAG, "set acid ch%d:%s", ch, reformattext); |
|
|
|
UIS->setVal(PAGE, bid, reformattext); |
|
|
|
CS->setcfgAndFlush(cfgid, reformattext); //
|
|
|
|
} |