#include "manualcleanpage.h" #include "paramcontrol.h" #include "udpcommunication.h" #include "confirmdialog.h" #include #include "global.h" ManualCleanPage::ManualCleanPage(AppContext* ctx, QWidget* parent) : WashBasePage(ctx, "手动消除", "洗消(手动消除)", parent) { double flow = ctx->getDouble(ctx->keyPumpFlow(), 20); m_pumpFlow = new ParamControl("柱塞泵流量", "L/min", 0.5, 0.0, 100.0, true, false, this); m_pumpFlow->setValue(flow); connect(m_pumpFlow, &ParamControl::saveClicked, this, [this]() { this->ctx()->setDouble(this->ctx()->keyPumpFlow(), m_pumpFlow->value()); this->ctx()->comm()->sendSetParam(this->ctx()->keyPumpFlow(), m_pumpFlow->value()); ConfirmDialog::toast(this, "已保存"); }); paramsLayout()->addWidget(m_pumpFlow); } void ManualCleanPage::resetFactory() { // 出厂值 20 m_pumpFlow->setValue(20); ctx()->setDouble(ctx()->keyPumpFlow(), 20); ConfirmDialog::toast(this, "已恢复出厂值"); }