|
|
@ -33,20 +33,20 @@ static bool m_scaning; |
|
|
|
bool Page_muSettings::isBelongThisPage(int page) { return page == PAGE; } |
|
|
|
|
|
|
|
void Page_muSettings::updatePage() { |
|
|
|
UIS->setVal(PAGE, ob_muSettings_bleCliName, getCfgStr(kcfg_bleClientName)); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_irun0, zitoa(getMxIRun(0))); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_irun1, zitoa(getMxIRun(1))); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_irun2, zitoa(getMxIRun(2))); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_irun3, zitoa(getMxIRun(3))); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pumpCoef0, zfmt("%.1f", getMotorMLPR(0))); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pumpCoef1, zfmt("%.1f", getMotorMLPR(1))); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pumpCoef2, zfmt("%.1f", getMotorMLPR(2))); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pumpCoef3, zfmt("%.1f", getMotorMLPR(3))); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pipeLen0, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pipeLen1, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pipeLen2, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pipeLen3, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_addAcidVel, getCfgStr(kcfg_pumpDefVel)); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_bleCliName, getCfgStr(kcfg_bleClientName)); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_irun0, zitoa(getMxIRun(0))); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_irun1, zitoa(getMxIRun(1))); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_irun2, zitoa(getMxIRun(2))); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_irun3, zitoa(getMxIRun(3))); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_pumpCoef0, zfmt("%.1f", getMotorMLPR(0))); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_pumpCoef1, zfmt("%.1f", getMotorMLPR(1))); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_pumpCoef2, zfmt("%.1f", getMotorMLPR(2))); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_pumpCoef3, zfmt("%.1f", getMotorMLPR(3))); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_pipeLen0, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_pipeLen1, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_pipeLen2, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_pipeLen3, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_addAcidVel, getCfgStr(kcfg_pumpDefVel)); |
|
|
|
} |
|
|
|
|
|
|
|
void Page_muSettings::OnPageLoad(OnPageLoadContext* cxt) { //
|
|
|
@ -55,7 +55,7 @@ void Page_muSettings::OnPageLoad(OnPageLoadContext* cxt) { // |
|
|
|
void Page_muSettings::OnAppEvent(AppEvent_t* event) { |
|
|
|
if (event->type == kAppEvent_BleConnectEvent) { |
|
|
|
ZLOGI(TAG, "ble connect success"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_bleCliName, "绑定成功"); |
|
|
|
UIS->setTxt(PAGE, ob_muSettings_bleCliName, "绑定成功"); |
|
|
|
CS->setcfgAndFlush(kcfg_bleClientName, event->d.bleName); |
|
|
|
m_scaning = false; |
|
|
|
} |
|
|
@ -67,16 +67,16 @@ void Page_muSettings::OnInputFieldContentChange(uint8_t bid, const char* text) { |
|
|
|
***********************************************************************************************************************/ |
|
|
|
if (bid == ob_muSettings_irun0) { |
|
|
|
setMxIRun(0, atoi(text)); |
|
|
|
UIS->setVal(bid, getMxIRun(0)); |
|
|
|
UIS->setTxt(bid, zfmt("%d", getMxIRun(0))); |
|
|
|
} else if (bid == ob_muSettings_irun1) { |
|
|
|
setMxIRun(1, atoi(text)); |
|
|
|
UIS->setVal(bid, getMxIRun(1)); |
|
|
|
UIS->setTxt(bid, zfmt("%d", getMxIRun(1))); |
|
|
|
} else if (bid == ob_muSettings_irun2) { |
|
|
|
setMxIRun(2, atoi(text)); |
|
|
|
UIS->setVal(bid, getMxIRun(2)); |
|
|
|
UIS->setTxt(bid, zfmt("%d", getMxIRun(2))); |
|
|
|
} else if (bid == ob_muSettings_irun3) { |
|
|
|
setMxIRun(3, atoi(text)); |
|
|
|
UIS->setVal(bid, getMxIRun(3)); |
|
|
|
UIS->setTxt(bid, zfmt("%d", getMxIRun(3))); |
|
|
|
} |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
@ -85,16 +85,16 @@ void Page_muSettings::OnInputFieldContentChange(uint8_t bid, const char* text) { |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pumpCoef0) { |
|
|
|
setMotorMLPR(0, atof(text)); |
|
|
|
UIS->setVal(bid, zfmt("%.1f", getMotorMLPR(0))); |
|
|
|
UIS->setTxt(bid, zfmt("%.1f", getMotorMLPR(0))); |
|
|
|
} else if (bid == ob_muSettings_pumpCoef1) { |
|
|
|
setMotorMLPR(1, atof(text)); |
|
|
|
UIS->setVal(bid, zfmt("%.1f", getMotorMLPR(1))); |
|
|
|
UIS->setTxt(bid, zfmt("%.1f", getMotorMLPR(1))); |
|
|
|
} else if (bid == ob_muSettings_pumpCoef2) { |
|
|
|
setMotorMLPR(2, atof(text)); |
|
|
|
UIS->setVal(bid, zfmt("%.1f", getMotorMLPR(2))); |
|
|
|
UIS->setTxt(bid, zfmt("%.1f", getMotorMLPR(2))); |
|
|
|
} else if (bid == ob_muSettings_pumpCoef3) { |
|
|
|
setMotorMLPR(3, atof(text)); |
|
|
|
UIS->setVal(bid, zfmt("%.1f", getMotorMLPR(3))); |
|
|
|
UIS->setTxt(bid, zfmt("%.1f", getMotorMLPR(3))); |
|
|
|
} |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
@ -103,22 +103,22 @@ void Page_muSettings::OnInputFieldContentChange(uint8_t bid, const char* text) { |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pipeLen0) { |
|
|
|
CS->setcfg(kcfg_pipeLengthML, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setTxt(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
} |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pipeLen1) { |
|
|
|
CS->setcfg(kcfg_pipeLengthML, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setTxt(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
} |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pipeLen2) { |
|
|
|
CS->setcfg(kcfg_pipeLengthML, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setTxt(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
} |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pipeLen3) { |
|
|
|
CS->setcfg(kcfg_pipeLengthML, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
UIS->setTxt(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
} |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
@ -127,7 +127,7 @@ void Page_muSettings::OnInputFieldContentChange(uint8_t bid, const char* text) { |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_addAcidVel) { |
|
|
|
CS->setcfg(kcfg_pumpDefVel, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pumpDefVel)); |
|
|
|
UIS->setTxt(bid, getCfgStr(kcfg_pumpDefVel)); |
|
|
|
} |
|
|
|
|
|
|
|
updatePage(); |
|
|
@ -144,7 +144,7 @@ void Page_muSettings::OnButton(uint8_t bid, uint8_t val) { |
|
|
|
} else if (bid == ob_muSettings_bleScan) { |
|
|
|
ZLOGI(TAG, "bleScan"); |
|
|
|
bool suc = RCTRL->startScan(BLENAME, true); |
|
|
|
if (suc) UIS->setVal(PAGE, ob_muSettings_bleCliName, "扫描中..."); |
|
|
|
if (suc) UIS->setTxt(PAGE, ob_muSettings_bleCliName, "扫描中..."); |
|
|
|
m_scaning = true; |
|
|
|
} |
|
|
|
}; |
|
|
|