diff --git a/src/Client/src/ui/main/MainWindow.cpp b/src/Client/src/ui/main/MainWindow.cpp index 4c306f0b..302b32a4 100644 --- a/src/Client/src/ui/main/MainWindow.cpp +++ b/src/Client/src/ui/main/MainWindow.cpp @@ -56,8 +56,7 @@ MainWindow::MainWindow(QWidget *parent) , m_leftPanelSplitter(nullptr) , m_intelligenceUI(nullptr) , m_faceLightControl(nullptr) - // , m_droneControlDialog(nullptr) - // , m_robotDogControlDialog(nullptr) + , m_robotDogControlDialog(nullptr) { m_ui->setupUi(this); @@ -83,14 +82,10 @@ MainWindow::~MainWindow() delete m_faceLightControl; m_faceLightControl = nullptr; } - // if (m_droneControlDialog) { - // delete m_droneControlDialog; - // m_droneControlDialog = nullptr; - // } - // if (m_robotDogControlDialog) { - // delete m_robotDogControlDialog; - // m_robotDogControlDialog = nullptr; - // } + if (m_robotDogControlDialog) { + delete m_robotDogControlDialog; + m_robotDogControlDialog = nullptr; + } delete m_ui; } @@ -1371,14 +1366,18 @@ void MainWindow::onRobotDogControlRequested() { SystemLogger::getInstance()->logInfo("机器狗控制请求"); - // 暂时使用简单的消息框来测试功能 - QMessageBox::information(this, "机器狗控制", - "机器狗控制界面功能正在开发中...\n" - "将包含以下功能:\n" - "• 运动控制(前进、后退、转向)\n" - "• 姿态控制(站立、趴下、跳跃)\n" - "• 地图建构和导航\n" - "• 视觉识别和跟踪\n" - "• 设备状态监控"); + // 创建机器狗控制对话框(如果还没有创建) + if (!m_robotDogControlDialog) { + m_robotDogControlDialog = new RobotDogControlDialog(this); + + // 连接信号(如果需要的话) + // connect(m_robotDogControlDialog, &RobotDogControlDialog::someSignal, + // this, &MainWindow::someSlot); + } + + // 显示对话框 + m_robotDogControlDialog->show(); + m_robotDogControlDialog->raise(); + m_robotDogControlDialog->activateWindow(); }