diff --git a/src/Client/BattlefieldExplorationSystem b/src/Client/BattlefieldExplorationSystem index c694091b..75c35cf2 100755 Binary files a/src/Client/BattlefieldExplorationSystem and b/src/Client/BattlefieldExplorationSystem differ diff --git a/src/Client/forms/main/MainWindow.ui b/src/Client/forms/main/MainWindow.ui index f353952a..26e32409 100644 --- a/src/Client/forms/main/MainWindow.ui +++ b/src/Client/forms/main/MainWindow.ui @@ -577,293 +577,7 @@ border-radius: 1px; - - - - 12 - - - - - - - - 0 - 38 - - - - - 13 - 75 - true - - - - 无人机视角 - - - - - - - - 30 - 30 - - - - - 30 - 30 - - - - border-image: url(:/image/res/image/location.svg); - - - - - - - - - - - - - - - 0 - 38 - - - - - 13 - 75 - true - - - - 机器狗视角 - - - - - - - - 30 - 30 - - - - - 30 - 30 - - - - border-image: url(:/image/res/image/health.svg); - - - - - - - - - - - - - - - 0 - 38 - - - - - 13 - 75 - true - - - - 机器狗建图 - - - - - - - - 30 - 30 - - - - - 30 - 30 - - - - border-image: url(:/image/res/image/soldier.svg); - - - - - - - - - - - - 6 - - - 6 - - - - - - 0 - 38 - - - - - 11 - 75 - true - - - - 🧭 智能导航 - - - - - - - - 0 - 38 - - - - - 11 - 75 - true - - - - 🔊 情报传达 - - - - - - - - - - 0 - 38 - - - - - 13 - 75 - true - - - - 人脸识别 - - - - - - - - 30 - 30 - - - - - 30 - 30 - - - - border-image: url(:/image/res/image/infomation.svg); - - - - - - - - - - - - - - - 0 - 38 - - - - - 13 - 75 - true - - - - 人脸跟随 - - - - - - - - 30 - 30 - - - - - 30 - 30 - - - - border-image: url(:/image/res/image/infomation.svg); - - - - - - - - - - - - + diff --git a/src/Client/include/ui/main/MainWindow.h b/src/Client/include/ui/main/MainWindow.h index 52d3aca8..64452ee1 100644 --- a/src/Client/include/ui/main/MainWindow.h +++ b/src/Client/include/ui/main/MainWindow.h @@ -170,25 +170,9 @@ private slots: */ void onRobotLocationClicked(); - /** - * @brief 无人机视图按钮点击槽函数 - */ - void onUAVViewClicked(); - - /** - * @brief 机器人视图按钮点击槽函数 - */ - void onRobotViewClicked(); - - /** - * @brief 机器人地图绘制按钮点击槽函数 - */ - void onRobotMappingClicked(); + - /** - * @brief 智能导航按钮点击槽函数 - */ - void onSmartNavigationClicked(); + /** * @brief 情报传达按钮点击槽函数 diff --git a/src/Client/src/ui/components/RightFunctionPanel.cpp b/src/Client/src/ui/components/RightFunctionPanel.cpp index d934c2d5..8cd921af 100644 --- a/src/Client/src/ui/components/RightFunctionPanel.cpp +++ b/src/Client/src/ui/components/RightFunctionPanel.cpp @@ -290,81 +290,66 @@ void RightFunctionPanel::setupIntelligenceModule() m_intelligenceCard = new ModuleCard("📡 情报传输", "📡", this); m_intelligenceCard->setObjectName("ModuleCard"); m_intelligenceCard->setProperty("data-module", "intelligence"); - - // 情报传达说明 - 统一样式 - QLabel *descLabel = new QLabel("🎯 远程控制系统"); - descLabel->setObjectName("intelligence-description"); - descLabel->setAlignment(Qt::AlignCenter); - descLabel->setStyleSheet( - "color: #2196F3; " - "font-size: 14px; " - "font-weight: bold; " - "padding: 10px; " - "margin-bottom: 8px;" - ); - m_intelligenceCard->addContent(descLabel); - - // 按钮布局容器 - 增加间距 + + // 按钮布局容器 - 优化间距和布局 QWidget *buttonWidget = new QWidget(); QVBoxLayout *buttonLayout = new QVBoxLayout(buttonWidget); - buttonLayout->setSpacing(20); // 12px → 20px 增强分离感 - buttonLayout->setContentsMargins(8, 12, 8, 12); // 增加容器边距 + buttonLayout->setSpacing(16); // 设置合理的按钮间距 + buttonLayout->setContentsMargins(12, 16, 12, 16); // 优化容器边距 - // 主要功能:音频控制按钮 - 提升优先级 + // 音频控制按钮 - 优化尺寸 m_voiceCallBtn = new QPushButton("🔊 音频控制模块"); m_voiceCallBtn->setObjectName("FunctionBtn"); m_voiceCallBtn->setProperty("class", "primary-large"); - m_voiceCallBtn->setMinimumHeight(65); // 55px → 65px 突出主要功能 + m_voiceCallBtn->setMinimumHeight(55); // 统一按钮高度 + m_voiceCallBtn->setMaximumHeight(55); // 限制最大高度,防止拉伸 m_voiceCallBtn->setStyleSheet( "QPushButton {" " background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0," " stop:0 #2196F3, stop:1 #1976D2);" // 统一蓝色主题 " color: white;" - " font-size: 17px;" // 16px → 17px 提升可读性 + " font-size: 16px;" " font-weight: bold;" " border: 2px solid #2196F3;" " border-radius: 8px;" - " padding: 16px;" // 12px → 16px 统一内边距 + " padding: 12px 16px;" "}" "QPushButton:hover {" " background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0," " stop:0 #1976D2, stop:1 #1565C0);" " border-color: #1976D2;" - " transform: translateY(-1px);" // 添加微妙的悬停效果 "}" "QPushButton:pressed {" " background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0," " stop:0 #1565C0, stop:1 #0D47A1);" - " transform: translateY(0px);" "}" ); - // 辅助功能:面部灯光控制按钮 - 降低优先级 + // 灯光控制按钮 - 优化尺寸 m_faceLightBtn = new QPushButton("💡 灯光控制模块"); m_faceLightBtn->setObjectName("FunctionBtn"); - m_faceLightBtn->setProperty("class", "secondary-medium"); // primary-large → secondary-medium - m_faceLightBtn->setMinimumHeight(50); // 55px → 50px 体现次要地位 + m_faceLightBtn->setProperty("class", "secondary-medium"); + m_faceLightBtn->setMinimumHeight(55); // 统一按钮高度 + m_faceLightBtn->setMaximumHeight(55); // 限制最大高度,防止拉伸 m_faceLightBtn->setStyleSheet( "QPushButton {" " background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0," " stop:0 #607D8B, stop:1 #455A64);" // 橙红色 → 中性灰蓝色 " color: white;" - " font-size: 15px;" // 16px → 15px 体现层次差异 + " font-size: 16px;" " font-weight: bold;" " border: 2px solid #607D8B;" " border-radius: 8px;" - " padding: 16px;" // 统一内边距 + " padding: 12px 16px;" "}" "QPushButton:hover {" " background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0," " stop:0 #546E7A, stop:1 #37474F);" " border-color: #546E7A;" - " transform: translateY(-1px);" "}" "QPushButton:pressed {" " background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0," " stop:0 #37474F, stop:1 #263238);" - " transform: translateY(0px);" "}" ); @@ -374,19 +359,6 @@ void RightFunctionPanel::setupIntelligenceModule() buttonLayout->addWidget(m_voiceCallBtn); buttonLayout->addWidget(m_faceLightBtn); m_intelligenceCard->addContent(buttonWidget); - - // 功能介绍 - 统一样式和间距 - QLabel *featureLabel = new QLabel("• SSH双跳连接\n• 音频播放控制\n• 面部灯光控制\n• 实时状态监控"); - featureLabel->setObjectName("feature-list"); - featureLabel->setAlignment(Qt::AlignLeft); - featureLabel->setStyleSheet( - "color: #90A4AE; " // #b0b0b0 → #90A4AE 与主题更协调 - "font-size: 12px; " - "padding: 12px 10px; " // 增加上下边距 - "line-height: 1.5; " // 提升行高可读性 - "margin-top: 8px;" - ); - m_intelligenceCard->addContent(featureLabel); m_mainLayout->addWidget(m_intelligenceCard); } diff --git a/src/Client/src/ui/main/MainWindow.cpp b/src/Client/src/ui/main/MainWindow.cpp index 27d9fe8c..2092914e 100644 --- a/src/Client/src/ui/main/MainWindow.cpp +++ b/src/Client/src/ui/main/MainWindow.cpp @@ -312,11 +312,8 @@ void MainWindow::connectSignals() { // 连接按钮信号 // 注意:原有的重复设备管理按钮信号已被移除 - connect(m_ui->UAVview, &QPushButton::clicked, this, &MainWindow::onUAVViewClicked); - connect(m_ui->robotView, &QPushButton::clicked, this, &MainWindow::onRobotViewClicked); - connect(m_ui->robotMapping, &QPushButton::clicked, this, &MainWindow::onRobotMappingClicked); - connect(m_ui->smartNavigation, &QPushButton::clicked, this, &MainWindow::onSmartNavigationClicked); - connect(m_ui->intelligence, &QPushButton::clicked, this, &MainWindow::onIntelligenceClicked); + + // DeviceListPanel信号已在setupDeviceListPanel中连接 @@ -791,28 +788,9 @@ void MainWindow::onRobotLocationClicked() QMessageBox::information(this, "机器人定位", "机器人定位功能正在开发中,暂时无法使用"); } -void MainWindow::onUAVViewClicked() -{ - SystemLogger::getInstance()->logInfo("无人机视角请求"); - - // 启动视觉识别系统Web服务 - startVisionWebService(); -} -void MainWindow::onRobotViewClicked() -{ - QMessageBox::information(this, "机器人视图", "机器人视图功能正在开发中,暂时无法使用"); -} -void MainWindow::onRobotMappingClicked() -{ - QMessageBox::information(this, "机器人建图", "机器人建图功能正在开发中,暂时无法使用"); -} -void MainWindow::onSmartNavigationClicked() -{ - QMessageBox::information(this, "智能导航", "智能导航功能正在开发中,暂时无法使用"); -} void MainWindow::onIntelligenceClicked() { @@ -1276,47 +1254,9 @@ void MainWindow::onExportReport() void MainWindow::fixMainButtonLayout() { - // 修复主要功能按钮的布局问题 - if (!m_ui->UAVview || !m_ui->robotView || !m_ui->robotMapping || !m_ui->smartNavigation) { - qWarning() << "某些主要功能按钮未找到,跳过布局修复"; - return; - } - - // 设置按钮属性的通用函数 - auto setupButton = [](QPushButton* button, const QString& text, const QString& tooltip, int fontSize = 12) { - if (!button) return; - - // 设置尺寸 - button->setMinimumSize(140, 45); - button->setMaximumHeight(45); - button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - - // 设置文本和提示 - button->setText(text); - button->setToolTip(tooltip); - - // 设置字体 - QFont font = button->font(); - font.setPointSize(fontSize); - font.setBold(true); - button->setFont(font); - }; - - // 设置四个主要按钮的属性 - setupButton(m_ui->UAVview, "🚁 无人机视角", "查看无人机实时视频流和飞行状态"); - setupButton(m_ui->robotView, "🐕 机器狗视角", "查看机器狗实时视频流和运动状态"); - setupButton(m_ui->robotMapping, "🗺️ 机器狗建图", "启动机器狗SLAM建图功能"); - setupButton(m_ui->smartNavigation, "🧭 智能导航", "启动智能路径规划和自主导航"); - - // 设置情报传达按钮 - if (m_ui->intelligence) { - setupButton(m_ui->intelligence, "🔊 情报传达", "语音情报传达和通信功能", 11); - m_ui->intelligence->setMinimumHeight(40); - m_ui->intelligence->setMaximumHeight(40); - } - - qDebug() << "主要功能按钮布局修复完成"; - SystemLogger::getInstance()->logInfo("主要功能按钮布局修复完成"); + // 主要功能按钮已移除,布局修复不再需要 + qDebug() << "主要功能按钮已移除,跳过布局修复"; + SystemLogger::getInstance()->logInfo("主要功能按钮已移除,跳过布局修复"); } void MainWindow::initializeModernStyles() @@ -1327,26 +1267,9 @@ void MainWindow::initializeModernStyles() // 应用现代军事主题 styleManager->applyTheme(ModernStyleManager::ThemeType::ModernMilitary); - // 应用主要按钮样式 - if (m_ui->UAVview) { - styleManager->applyButtonStyle(m_ui->UAVview, ModernStyleManager::ButtonStyle::Primary); - } - if (m_ui->robotView) { - styleManager->applyButtonStyle(m_ui->robotView, ModernStyleManager::ButtonStyle::Primary); - } - if (m_ui->robotMapping) { - styleManager->applyButtonStyle(m_ui->robotMapping, ModernStyleManager::ButtonStyle::Info); - } - if (m_ui->smartNavigation) { - styleManager->applyButtonStyle(m_ui->smartNavigation, ModernStyleManager::ButtonStyle::Success); - } - - if (m_ui->intelligence) { - styleManager->applyButtonStyle(m_ui->intelligence, ModernStyleManager::ButtonStyle::Warning); - } // 应用设备面板样式 if (m_deviceListPanel) {