增加通讯协议

This commit is contained in:
xu
2026-10-14 09:59:42 +08:00
parent 32878a9a80
commit 950e9e6c9e
102 changed files with 5538 additions and 2679 deletions
+7 -10
View File
@@ -2,15 +2,14 @@
#define TITLEBAR_H
#include <QWidget>
#include <QTimer>
#include "uart.h"
class QLabel;
class QPushButton;
class AppContext;
class LedIndicator;
// ===================== 顶条组件(高 98px) =====================
// 左侧“通信状态:●正常/异常”,中央页面标题,右侧时间 + 软急停按钮
// 左侧“车载端通信:●正常/异常”,中央页面标题,右侧“遥控器:●正常/断开 + 电量”
class TitleBar : public QWidget
{
Q_OBJECT
@@ -18,19 +17,17 @@ public:
explicit TitleBar(AppContext* ctx, QWidget* parent = nullptr);
void setTitle(const QString& title);
void setEstopVisible(bool visible);
private slots:
void updateEstop();
void updateTime();
void onRcLink(bool ok);
void onRcFrame(const RcFrame& f);
private:
AppContext* m_ctx;
LedIndicator* m_comm;
LedIndicator* m_comm = nullptr;
LedIndicator* m_rc = nullptr;
QLabel* m_rcBat = nullptr;
QLabel* m_title = nullptr;
QLabel* m_time = nullptr;
QPushButton* m_estop = nullptr;
QTimer* m_clock = nullptr;
};
#endif // TITLEBAR_H