#ifndef DEBUGMAINTAINPAGE_H #define DEBUGMAINTAINPAGE_H #include "base.h" class TitleBar; class AlarmBanner; class DataCard; class LedIndicator; class ParamControl; class QPushButton; class QLabel; class QCheckBox; // ===================== ⑪ 调试维护界面 ===================== class DebugMaintainPage : public BasePage { Q_OBJECT public: explicit DebugMaintainPage(AppContext* ctx, QWidget* parent = nullptr); void setReturnPage(PageId id) { m_returnPage = id; } private slots: void refresh(); private: // 单个球阀组:控制开/关 + 开启到位 + 关闭到位 + 故障提示 QWidget* makeValveGroup(int valve); // 单个泵组:转速调节 + 启动/停止 QWidget* makePumpGroup(const QString& pump, const QString& name); TitleBar* m_titleBar = nullptr; AlarmBanner* m_warn = nullptr; DataCard* m_chassisCard = nullptr; DataCard* m_armCard = nullptr; DataCard* m_gasCard = nullptr; DataCard* m_washCard = nullptr; // 球阀 QPushButton* m_valve1Btn = nullptr; QPushButton* m_valve2Btn = nullptr; LedIndicator* m_v1Open = nullptr; LedIndicator* m_v1Close = nullptr; LedIndicator* m_v2Open = nullptr; LedIndicator* m_v2Close = nullptr; QLabel* m_valveFault1 = nullptr; QLabel* m_valveFault2 = nullptr; // 泵 ParamControl* m_airRpm = nullptr; ParamControl* m_plungerRpm = nullptr; ParamControl* m_leafRpm = nullptr; QPushButton* m_airStart = nullptr; QPushButton* m_airStop = nullptr; QPushButton* m_plungerStart = nullptr; QPushButton* m_plungerStop = nullptr; QPushButton* m_leafStart = nullptr; QPushButton* m_leafStop = nullptr; // 泵上电指示灯(在各自泵组的按钮行左侧,由 makePumpGroup 填)+ 底部的两路液位低 LedIndicator* m_ledPlunger = nullptr; LedIndicator* m_ledAir = nullptr; LedIndicator* m_ledLeaf = nullptr; LedIndicator* m_ledLevelA = nullptr; // A组分/清水液位低 LedIndicator* m_ledLevelB = nullptr; // B组分液位低 // 是否收到过车端遥测:未收到时球阀到位灯保持“开启=灰、关闭=红”的缺省显示 bool m_telemetrySeen = false; // 球阀“开启/关闭故障”是**超时未到位**推出来的——协议里没有这两个故障信号, // 球阀下行只有 MBV_Dn_Sta 一个到位位(关闭到位由它取反得到)。 // 下发指令时记下时刻与想要的阀位;kValveFaultMs 内反馈还没变成想要的样子就判故障, // 反馈对上(到位)或重新下发指令则解除。cmdMs 为 0 表示当前没有待确认的指令。 qint64 m_v1CmdMs = 0; qint64 m_v2CmdMs = 0; int m_v1WantOpen = 0; // 最后一次指令想要的阀位:0=关闭 1=开启 int m_v2WantOpen = 0; bool m_v1Fault = false; bool m_v2Fault = false; // “返回”去向:本页有两个入口(系统首页 / 作业选择),由 MainWindow 记录来源后原路返回 PageId m_returnPage = PageJob; }; #endif // DEBUGMAINTAINPAGE_H