Files
QT_wuhan_YT/pages/washpage.h
T
2026-10-16 09:06:03 +08:00

84 lines
2.6 KiB
C++

#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;
// ===================== 洗消页(⑨消除作业 / ⑩消毒作业 共用) =====================
// 自包含页面:三列骨架、中央洗消卡、右侧启停与参数区、底部指示灯条都在本文件里。
// 两个页面只差 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();
private:
void updateGating();
void updateLeds(); // 底栏指示灯(启停 / 泵 / 液位低 / 球阀 / 系统故障)
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_ledD1 = nullptr;
LedIndicator* m_ledD2 = nullptr;
// 底部第二行:两路液位低(协议里 A_LiquidLevel_Low / B_LiquidLevel_Low 本就是两个位)
LedIndicator* m_ledLevelA = nullptr;
LedIndicator* m_ledLevelB = 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;
};
#endif // WASHPAGE_H