#ifndef WASHPAGE_H #define WASHPAGE_H #include "base.h" class TitleBar; class AlarmBanner; class DataCard; class LedIndicator; class ParamControl; class QPushButton; class QLabel; class QVBoxLayout; class QTimer; // ===================== 洗消页(⑨消除作业 / ⑩消毒作业 共用) ===================== // 自包含页面:三列骨架、中央洗消卡、右侧启停与参数区、底部指示灯条都在本文件里。 // 两个页面只差 mode(标题、洗消标识、参数项及出厂值),调整布局改这一处即可。 class WashPage : public BasePage { Q_OBJECT public: enum Mode { Clean, Disinfect }; explicit WashPage(AppContext* ctx, Mode mode, QWidget* parent = nullptr); private slots: void onStart(); void onStop(); void onBack(); void onFactory(); void refresh(); void rotateFaults(); private: void updateGating(); void resetFactory(); void refreshPumpValues(); // 刷新底部三个泵的数值 QString washModeTag() const; // "clean" / "disinfect" Mode m_mode; TitleBar* m_titleBar = nullptr; AlarmBanner* m_banner = nullptr; DataCard* m_chassisCard = nullptr; DataCard* m_armCard = nullptr; DataCard* m_gasCard = nullptr; DataCard* m_washCard = nullptr; QPushButton* m_start = nullptr; QPushButton* m_stop = nullptr; QPushButton* m_back = nullptr; QPushButton* m_factory = nullptr; QVBoxLayout* m_paramsLayout = nullptr; // 参数:消除用柱塞泵流量;消毒用发泡倍数 / 泡沫比例 / 空压机流量 ParamControl* m_pumpFlow = nullptr; ParamControl* m_foamRatio = nullptr; ParamControl* m_foamPercent = nullptr; ParamControl* m_airFlow = nullptr; // 底部指示灯 LedIndicator* m_ledRun = nullptr; LedIndicator* m_ledPlunger = nullptr; LedIndicator* m_ledAir = nullptr; LedIndicator* m_ledLeaf = nullptr; LedIndicator* m_ledLevel = nullptr; LedIndicator* m_ledD1 = nullptr; LedIndicator* m_ledD2 = nullptr; LedIndicator* m_ledFault = nullptr; // 底部第二行:三个泵的当前流量值 QLabel* m_valPlunger = nullptr; QLabel* m_valAir = nullptr; QLabel* m_valLeaf = nullptr; // 中央洗消卡字段索引 int m_fMode = -1, m_fLevelA = -1, m_fLevelFoam = -1; int m_fFlowA = -1, m_fFlowB = -1, m_fGasFlow = -1; int m_fPress = -1, m_fAirPress = -1, m_fFoam = -1; int m_fAirFault = -1, m_fPlungerFault = -1; QTimer* m_faultTimer = nullptr; int m_faultIndex = 0; }; #endif // WASHPAGE_H