51 lines
1.3 KiB
C++
51 lines
1.3 KiB
C++
#ifndef CHASSISPAGE_H
|
|
#define CHASSISPAGE_H
|
|
|
|
#include "base.h"
|
|
#include <QVector>
|
|
#include <QSet>
|
|
|
|
class TitleBar;
|
|
class StatusStrip;
|
|
class AlarmBanner;
|
|
class DataCard;
|
|
class ParamControl;
|
|
class QPushButton;
|
|
class QTimer;
|
|
|
|
// ===================== ⑥ 机器人底盘界面 =====================
|
|
class ChassisPage : public BasePage
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ChassisPage(AppContext* ctx, QWidget* parent = nullptr);
|
|
|
|
protected:
|
|
void showEvent(QShowEvent* ev) override; // 进入页面即切至行车模式
|
|
|
|
private slots:
|
|
void refresh();
|
|
void updateModeGating();
|
|
void onSpeedChanged(double v);
|
|
void onSpeedSaved();
|
|
|
|
private:
|
|
QPushButton* makeDirButton(const QString& text, const QString& dir);
|
|
void sendDirCommand(); // 按当前按住的方向组合下发(档位与转向可同时)
|
|
|
|
TitleBar* m_titleBar = nullptr;
|
|
StatusStrip* m_statusStrip = nullptr;
|
|
AlarmBanner* m_banner = nullptr;
|
|
DataCard* m_washCard = nullptr;
|
|
DataCard* m_armCard = nullptr;
|
|
DataCard* m_gasCard = nullptr;
|
|
DataCard* m_chassisCard = nullptr;
|
|
ParamControl* m_speed = nullptr;
|
|
QTimer* m_saveTimer = nullptr;
|
|
int m_chassisFieldFault = -1;
|
|
QVector<QPushButton*> m_dirButtons;
|
|
QSet<QString> m_heldDirs; // 当前按住的方向,可多键同时按
|
|
};
|
|
|
|
#endif // CHASSISPAGE_H
|