|
|
@ -12,31 +12,105 @@ static CfgItermCache cfgcache; |
|
|
|
|
|
|
|
bool Page_muSettings::isBelongThisPage(int page) { return page == PAGE; } |
|
|
|
|
|
|
|
void Page_muSettings::OnPageLoad(OnPageLoadContext*cxt) { //
|
|
|
|
void Page_muSettings::updatePage() { |
|
|
|
UIS->setVal(PAGE, ob_muSettings_bleCliName, "testData"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_irun0, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_irun1, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_irun2, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_irun3, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pumpCoef0, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pumpCoef1, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pumpCoef2, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pumpCoef3, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pipeLen0, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pipeLen1, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pipeLen2, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_pipeLen3, "1"); |
|
|
|
UIS->setVal(PAGE, ob_muSettings_addAcidVel, "1"); |
|
|
|
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)); |
|
|
|
} |
|
|
|
|
|
|
|
void Page_muSettings::OnPageLoad(OnPageLoadContext* cxt) { //
|
|
|
|
updatePage(); |
|
|
|
}; |
|
|
|
|
|
|
|
void Page_muSettings::OnInputFieldContentChange(uint8_t bid, const char* text) { UIS->setVal(PAGE, bid, text); } |
|
|
|
void Page_muSettings::OnInputFieldContentChange(uint8_t bid, const char* text) { |
|
|
|
/***********************************************************************************************************************
|
|
|
|
* irunx * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
if (bid == ob_muSettings_irun0) { |
|
|
|
setMxIRun(0, atoi(text)); |
|
|
|
UIS->setVal(bid, getMxIRun(0)); |
|
|
|
} else if (bid == ob_muSettings_irun1) { |
|
|
|
setMxIRun(1, atoi(text)); |
|
|
|
UIS->setVal(bid, getMxIRun(1)); |
|
|
|
} else if (bid == ob_muSettings_irun2) { |
|
|
|
setMxIRun(2, atoi(text)); |
|
|
|
UIS->setVal(bid, getMxIRun(2)); |
|
|
|
} else if (bid == ob_muSettings_irun3) { |
|
|
|
setMxIRun(3, atoi(text)); |
|
|
|
UIS->setVal(bid, getMxIRun(3)); |
|
|
|
} |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* pumpCoef * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pumpCoef0) { |
|
|
|
setMotorMLPR(0, atof(text)); |
|
|
|
UIS->setVal(bid, zfmt("%.1f", getMotorMLPR(0))); |
|
|
|
} else if (bid == ob_muSettings_pumpCoef1) { |
|
|
|
setMotorMLPR(1, atof(text)); |
|
|
|
UIS->setVal(bid, zfmt("%.1f", getMotorMLPR(1))); |
|
|
|
} else if (bid == ob_muSettings_pumpCoef2) { |
|
|
|
setMotorMLPR(2, atof(text)); |
|
|
|
UIS->setVal(bid, zfmt("%.1f", getMotorMLPR(2))); |
|
|
|
} else if (bid == ob_muSettings_pumpCoef3) { |
|
|
|
setMotorMLPR(3, atof(text)); |
|
|
|
UIS->setVal(bid, zfmt("%.1f", getMotorMLPR(3))); |
|
|
|
} |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* pipeLen * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pipeLen0) { |
|
|
|
CS->setcfg(kcfg_pipeLengthML, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
} |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pipeLen1) { |
|
|
|
CS->setcfg(kcfg_pipeLengthML, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
} |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pipeLen2) { |
|
|
|
CS->setcfg(kcfg_pipeLengthML, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
} |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_pipeLen3) { |
|
|
|
CS->setcfg(kcfg_pipeLengthML, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pipeLengthML)); |
|
|
|
} |
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
|
* addAcidVel * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
|
|
|
|
else if (bid == ob_muSettings_addAcidVel) { |
|
|
|
CS->setcfg(kcfg_pumpDefVel, text); |
|
|
|
UIS->setVal(bid, getCfgStr(kcfg_pumpDefVel)); |
|
|
|
} |
|
|
|
|
|
|
|
updatePage(); |
|
|
|
} |
|
|
|
void Page_muSettings::OnButton(uint8_t bid, uint8_t val) { |
|
|
|
static CfgItermCache usrpasswdcache; |
|
|
|
ZLOGI(TAG, "bid:%d", bid); |
|
|
|
if (bid == ob_muSettings_bleScan) { |
|
|
|
ZLOGI(TAG, "bleScan"); |
|
|
|
} else if (bid == ob_muSettings_bak) { |
|
|
|
if (bid == ob_muSettings_bak) { |
|
|
|
UIS->chpage(GSM->getMenuPage()); |
|
|
|
} else if (bid == ob_muSettings_bleScan) { |
|
|
|
ZLOGI(TAG, "bleScan"); |
|
|
|
} |
|
|
|
}; |
|
|
|
|