Merge branch 'huaijin' of https://bdgit.educoder.net/pp3xivymc/Software_Architecture into huaijin
commit
35c10d7e33
@ -0,0 +1,98 @@
|
||||
# Details
|
||||
|
||||
Date : 2025-06-29 17:36:53
|
||||
|
||||
Directory /home/hzk/Software_Architecture
|
||||
|
||||
Total : 83 files, 15656 codes, 1748 comments, 3324 blanks, all 20728 lines
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [.claude/settings.local.json](/.claude/settings.local.json) | JSON | 19 | 0 | 0 | 19 |
|
||||
| [README.md](/README.md) | Markdown | 1 | 0 | 2 | 3 |
|
||||
| [design-geimi.html](/design-geimi.html) | HTML | 414 | 14 | 39 | 467 |
|
||||
| [design.html](/design.html) | HTML | 955 | 9 | 142 | 1,106 |
|
||||
| [prompt.md](/prompt.md) | Markdown | 142 | 0 | 113 | 255 |
|
||||
| [src/Client/.claude/settings.local.json](/src/Client/.claude/settings.local.json) | JSON | 43 | 0 | 0 | 43 |
|
||||
| [src/Client/.promptx/memory/declarative.md](/src/Client/.promptx/memory/declarative.md) | Markdown | 90 | 0 | 25 | 115 |
|
||||
| [src/Client/.promptx/pouch.json](/src/Client/.promptx/pouch.json) | JSON | 404 | 0 | 1 | 405 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-designer-simple/qt-ui-designer-simple.role.md](/src/Client/.promptx/resource/domain/qt-ui-designer-simple/qt-ui-designer-simple.role.md) | Markdown | 36 | 0 | 4 | 40 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-designer/execution/design-documentation-process.execution.md](/src/Client/.promptx/resource/domain/qt-ui-designer/execution/design-documentation-process.execution.md) | Markdown | 79 | 0 | 12 | 91 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-designer/execution/qt-ui-design-workflow.execution.md](/src/Client/.promptx/resource/domain/qt-ui-designer/execution/qt-ui-design-workflow.execution.md) | Markdown | 87 | 0 | 18 | 105 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-designer/knowledge/design-documentation-methods.knowledge.md](/src/Client/.promptx/resource/domain/qt-ui-designer/knowledge/design-documentation-methods.knowledge.md) | Markdown | 33 | 0 | 13 | 46 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-designer/knowledge/qt-ui-expertise.knowledge.md](/src/Client/.promptx/resource/domain/qt-ui-designer/knowledge/qt-ui-expertise.knowledge.md) | Markdown | 56 | 0 | 16 | 72 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-designer/qt-ui-designer.role.md](/src/Client/.promptx/resource/domain/qt-ui-designer/qt-ui-designer.role.md) | Markdown | 16 | 0 | 2 | 18 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-designer/thought/documentation-expression.thought.md](/src/Client/.promptx/resource/domain/qt-ui-designer/thought/documentation-expression.thought.md) | Markdown | 64 | 0 | 13 | 77 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-designer/thought/ui-design-thinking.thought.md](/src/Client/.promptx/resource/domain/qt-ui-designer/thought/ui-design-thinking.thought.md) | Markdown | 59 | 0 | 12 | 71 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-developer/qt-ui-developer.role.md](/src/Client/.promptx/resource/domain/qt-ui-developer/qt-ui-developer.role.md) | Markdown | 126 | 0 | 23 | 149 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-optimizer/execution/layout-enhancement-process.execution.md](/src/Client/.promptx/resource/domain/qt-ui-optimizer/execution/layout-enhancement-process.execution.md) | Markdown | 249 | 0 | 40 | 289 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-optimizer/execution/ui-optimization-workflow.execution.md](/src/Client/.promptx/resource/domain/qt-ui-optimizer/execution/ui-optimization-workflow.execution.md) | Markdown | 224 | 0 | 32 | 256 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-optimizer/knowledge/qt-ui-optimization-expertise.knowledge.md](/src/Client/.promptx/resource/domain/qt-ui-optimizer/knowledge/qt-ui-optimization-expertise.knowledge.md) | Markdown | 412 | 0 | 70 | 482 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-optimizer/qt-ui-optimizer.role.md](/src/Client/.promptx/resource/domain/qt-ui-optimizer/qt-ui-optimizer.role.md) | Markdown | 15 | 0 | 0 | 15 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-optimizer/thought/aesthetic-enhancement.thought.md](/src/Client/.promptx/resource/domain/qt-ui-optimizer/thought/aesthetic-enhancement.thought.md) | Markdown | 73 | 0 | 15 | 88 |
|
||||
| [src/Client/.promptx/resource/domain/qt-ui-optimizer/thought/ui-optimization-thinking.thought.md](/src/Client/.promptx/resource/domain/qt-ui-optimizer/thought/ui-optimization-thinking.thought.md) | Markdown | 66 | 0 | 14 | 80 |
|
||||
| [src/Client/.promptx/resource/project.registry.json](/src/Client/.promptx/resource/project.registry.json) | JSON | 220 | 0 | 1 | 221 |
|
||||
| [src/Client/.qtc_clangd/compile_commands.json](/src/Client/.qtc_clangd/compile_commands.json) | JSON | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/CLAUDE.md](/src/Client/CLAUDE.md) | Markdown | 188 | 0 | 47 | 235 |
|
||||
| [src/Client/android/AndroidManifest.xml](/src/Client/android/AndroidManifest.xml) | XML | 25 | 0 | 3 | 28 |
|
||||
| [src/Client/android/res/drawable/splash.xml](/src/Client/android/res/drawable/splash.xml) | XML | 13 | 0 | 0 | 13 |
|
||||
| [src/Client/android/res/values/styles.xml](/src/Client/android/res/values/styles.xml) | XML | 6 | 0 | 0 | 6 |
|
||||
| [src/Client/doc/README.md](/src/Client/doc/README.md) | Markdown | 89 | 0 | 29 | 118 |
|
||||
| [src/Client/doc/database/database_design.md](/src/Client/doc/database/database_design.md) | Markdown | 196 | 0 | 44 | 240 |
|
||||
| [src/Client/doc/database/database_schema.sql](/src/Client/doc/database/database_schema.sql) | MS SQL | 126 | 13 | 13 | 152 |
|
||||
| [src/Client/doc/database/updated_database_schema.sql](/src/Client/doc/database/updated_database_schema.sql) | MS SQL | 160 | 17 | 15 | 192 |
|
||||
| [src/Client/doc/git/git_branch_strategy.md](/src/Client/doc/git/git_branch_strategy.md) | Markdown | 237 | 0 | 64 | 301 |
|
||||
| [src/Client/doc/planning/code_refactor_plan.md](/src/Client/doc/planning/code_refactor_plan.md) | Markdown | 224 | 0 | 42 | 266 |
|
||||
| [src/Client/doc/planning/functional_modules_specification.md](/src/Client/doc/planning/functional_modules_specification.md) | Markdown | 175 | 0 | 49 | 224 |
|
||||
| [src/Client/doc/planning/project_structure_plan.md](/src/Client/doc/planning/project_structure_plan.md) | Markdown | 428 | 0 | 58 | 486 |
|
||||
| [src/Client/doc/planning/refactor_impact_assessment.md](/src/Client/doc/planning/refactor_impact_assessment.md) | Markdown | 204 | 0 | 65 | 269 |
|
||||
| [src/Client/doc/planning/task.md](/src/Client/doc/planning/task.md) | Markdown | 297 | 0 | 72 | 369 |
|
||||
| [src/Client/doc/reports/code_refactor_summary.md](/src/Client/doc/reports/code_refactor_summary.md) | Markdown | 153 | 0 | 44 | 197 |
|
||||
| [src/Client/doc/reports/phase1_completion_report.md](/src/Client/doc/reports/phase1_completion_report.md) | Markdown | 137 | 0 | 33 | 170 |
|
||||
| [src/Client/doc/reports/phase3_completion_report.md](/src/Client/doc/reports/phase3_completion_report.md) | Markdown | 200 | 0 | 62 | 262 |
|
||||
| [src/Client/doc/technical/phase3_ui_refactor_plan.md](/src/Client/doc/technical/phase3_ui_refactor_plan.md) | Markdown | 264 | 0 | 76 | 340 |
|
||||
| [src/Client/doc/technical/system_log_design.md](/src/Client/doc/technical/system_log_design.md) | Markdown | 251 | 0 | 71 | 322 |
|
||||
| [src/Client/doc/ui-optimization/color_scheme_unification_report.md](/src/Client/doc/ui-optimization/color_scheme_unification_report.md) | Markdown | 152 | 0 | 41 | 193 |
|
||||
| [src/Client/doc/ui-optimization/css_compatibility_fix_report.md](/src/Client/doc/ui-optimization/css_compatibility_fix_report.md) | Markdown | 175 | 0 | 36 | 211 |
|
||||
| [src/Client/doc/ui-optimization/military_ui_optimization_summary.md](/src/Client/doc/ui-optimization/military_ui_optimization_summary.md) | Markdown | 196 | 0 | 48 | 244 |
|
||||
| [src/Client/doc/ui-optimization/right_panel_ui_optimization_report.md](/src/Client/doc/ui-optimization/right_panel_ui_optimization_report.md) | Markdown | 200 | 0 | 51 | 251 |
|
||||
| [src/Client/doc/ui-optimization/ui_issues_fix_report.md](/src/Client/doc/ui-optimization/ui_issues_fix_report.md) | Markdown | 156 | 0 | 49 | 205 |
|
||||
| [src/Client/doc/ui_design/right_panel_design_spec.md](/src/Client/doc/ui_design/right_panel_design_spec.md) | Markdown | 290 | 0 | 58 | 348 |
|
||||
| [src/Client/doc/ui_design/right_panel_implementation.cpp](/src/Client/doc/ui_design/right_panel_implementation.cpp) | C++ | 521 | 31 | 130 | 682 |
|
||||
| [src/Client/doc/ui_optimization_menubar_statusbar.md](/src/Client/doc/ui_optimization_menubar_statusbar.md) | Markdown | 157 | 0 | 41 | 198 |
|
||||
| [src/Client/doc/ui_optimization_summary.md](/src/Client/doc/ui_optimization_summary.md) | Markdown | 99 | 0 | 32 | 131 |
|
||||
| [src/Client/include/ui/components/DeviceCard.h](/src/Client/include/ui/components/DeviceCard.h) | C++ | 137 | 205 | 53 | 395 |
|
||||
| [src/Client/include/ui/components/DeviceListPanel.h](/src/Client/include/ui/components/DeviceListPanel.h) | C++ | 110 | 224 | 62 | 396 |
|
||||
| [src/Client/include/ui/components/RightFunctionPanel.h](/src/Client/include/ui/components/RightFunctionPanel.h) | C++ | 102 | 179 | 51 | 332 |
|
||||
| [src/Client/include/ui/components/SystemLogPanel.h](/src/Client/include/ui/components/SystemLogPanel.h) | C++ | 67 | 104 | 31 | 202 |
|
||||
| [src/Client/include/ui/dialogs/DeviceDialog.h](/src/Client/include/ui/dialogs/DeviceDialog.h) | C++ | 49 | 83 | 24 | 156 |
|
||||
| [src/Client/include/ui/main/MainWindow.h](/src/Client/include/ui/main/MainWindow.h) | C++ | 88 | 207 | 55 | 350 |
|
||||
| [src/Client/include/utils/SystemLogger.h](/src/Client/include/utils/SystemLogger.h) | C++ | 49 | 104 | 25 | 178 |
|
||||
| [src/Client/res/html/map.html](/src/Client/res/html/map.html) | HTML | 375 | 16 | 41 | 432 |
|
||||
| [src/Client/res/image/UAV.svg](/src/Client/res/image/UAV.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/res/image/health.png.svg](/src/Client/res/image/health.png.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/res/image/health.svg](/src/Client/res/image/health.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/res/image/infomation.svg](/src/Client/res/image/infomation.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/res/image/location.svg](/src/Client/res/image/location.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/res/image/map.svg](/src/Client/res/image/map.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/res/image/mapbtn.svg](/src/Client/res/image/mapbtn.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/res/image/robotbtn.svg](/src/Client/res/image/robotbtn.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/res/image/soldier.svg](/src/Client/res/image/soldier.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/res/image/tab.svg](/src/Client/res/image/tab.svg) | XML | 1 | 0 | 0 | 1 |
|
||||
| [src/Client/run_app.sh](/src/Client/run_app.sh) | Shell Script | 10 | 6 | 4 | 20 |
|
||||
| [src/Client/setup_database.sql](/src/Client/setup_database.sql) | MS SQL | 41 | 7 | 7 | 55 |
|
||||
| [src/Client/src/main.cpp](/src/Client/src/main.cpp) | C++ | 27 | 3 | 7 | 37 |
|
||||
| [src/Client/src/ui/components/DeviceCard.cpp](/src/Client/src/ui/components/DeviceCard.cpp) | C++ | 576 | 79 | 110 | 765 |
|
||||
| [src/Client/src/ui/components/DeviceListPanel.cpp](/src/Client/src/ui/components/DeviceListPanel.cpp) | C++ | 971 | 106 | 186 | 1,263 |
|
||||
| [src/Client/src/ui/components/RightFunctionPanel.cpp](/src/Client/src/ui/components/RightFunctionPanel.cpp) | C++ | 748 | 58 | 151 | 957 |
|
||||
| [src/Client/src/ui/components/SystemLogPanel.cpp](/src/Client/src/ui/components/SystemLogPanel.cpp) | C++ | 374 | 41 | 61 | 476 |
|
||||
| [src/Client/src/ui/dialogs/DeviceDialog.cpp](/src/Client/src/ui/dialogs/DeviceDialog.cpp) | C++ | 510 | 60 | 96 | 666 |
|
||||
| [src/Client/src/ui/main/MainWindow.cpp](/src/Client/src/ui/main/MainWindow.cpp) | C++ | 1,022 | 165 | 214 | 1,401 |
|
||||
| [src/Client/src/utils/SystemLogger.cpp](/src/Client/src/utils/SystemLogger.cpp) | C++ | 120 | 17 | 21 | 158 |
|
||||
| [src/Client/代码规范.md](/src/Client/%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83.md) | Markdown | 638 | 0 | 143 | 781 |
|
||||
| [技术博客_战场探索系统.md](/%E6%8A%80%E6%9C%AF%E5%8D%9A%E5%AE%A2_%E6%88%98%E5%9C%BA%E6%8E%A2%E7%B4%A2%E7%B3%BB%E7%BB%9F.md) | Markdown | 429 | 0 | 102 | 531 |
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
@ -0,0 +1,15 @@
|
||||
# Diff Details
|
||||
|
||||
Date : 2025-06-29 17:36:53
|
||||
|
||||
Directory /home/hzk/Software_Architecture
|
||||
|
||||
Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
|
@ -0,0 +1,19 @@
|
||||
# Diff Summary
|
||||
|
||||
Date : 2025-06-29 17:36:53
|
||||
|
||||
Directory /home/hzk/Software_Architecture
|
||||
|
||||
Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
@ -0,0 +1,22 @@
|
||||
Date : 2025-06-29 17:36:53
|
||||
Directory : /home/hzk/Software_Architecture
|
||||
Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines
|
||||
|
||||
Languages
|
||||
+----------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+----------+------------+------------+------------+------------+------------+
|
||||
+----------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+------+------------+------------+------------+------------+------------+
|
||||
+------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+----------+----------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+----------+----------+------------+------------+------------+------------+
|
||||
| Total | | 0 | 0 | 0 | 0 |
|
||||
+----------+----------+------------+------------+------------+------------+
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,82 @@
|
||||
# Summary
|
||||
|
||||
Date : 2025-06-29 17:36:53
|
||||
|
||||
Directory /home/hzk/Software_Architecture
|
||||
|
||||
Total : 83 files, 15656 codes, 1748 comments, 3324 blanks, all 20728 lines
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| Markdown | 42 | 7,363 | 0 | 1,781 | 9,144 |
|
||||
| C++ | 16 | 5,471 | 1,666 | 1,277 | 8,414 |
|
||||
| HTML | 3 | 1,744 | 39 | 222 | 2,005 |
|
||||
| JSON | 5 | 687 | 0 | 2 | 689 |
|
||||
| MS SQL | 3 | 327 | 37 | 35 | 399 |
|
||||
| XML | 13 | 54 | 0 | 3 | 57 |
|
||||
| Shell Script | 1 | 10 | 6 | 4 | 20 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 83 | 15,656 | 1,748 | 3,324 | 20,728 |
|
||||
| . (Files) | 5 | 1,941 | 23 | 398 | 2,362 |
|
||||
| .claude | 1 | 19 | 0 | 0 | 19 |
|
||||
| src | 77 | 13,696 | 1,725 | 2,926 | 18,347 |
|
||||
| src/Client | 77 | 13,696 | 1,725 | 2,926 | 18,347 |
|
||||
| src/Client (Files) | 4 | 877 | 13 | 201 | 1,091 |
|
||||
| src/Client/.claude | 1 | 43 | 0 | 0 | 43 |
|
||||
| src/Client/.promptx | 18 | 2,309 | 0 | 311 | 2,620 |
|
||||
| src/Client/.promptx (Files) | 1 | 404 | 0 | 1 | 405 |
|
||||
| src/Client/.promptx/memory | 1 | 90 | 0 | 25 | 115 |
|
||||
| src/Client/.promptx/resource | 16 | 1,815 | 0 | 285 | 2,100 |
|
||||
| src/Client/.promptx/resource (Files) | 1 | 220 | 0 | 1 | 221 |
|
||||
| src/Client/.promptx/resource/domain | 15 | 1,595 | 0 | 284 | 1,879 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer | 7 | 394 | 0 | 86 | 480 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer (Files) | 1 | 16 | 0 | 2 | 18 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer-simple | 1 | 36 | 0 | 4 | 40 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer/execution | 2 | 166 | 0 | 30 | 196 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer/knowledge | 2 | 89 | 0 | 29 | 118 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer/thought | 2 | 123 | 0 | 25 | 148 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-developer | 1 | 126 | 0 | 23 | 149 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer | 6 | 1,039 | 0 | 171 | 1,210 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer (Files) | 1 | 15 | 0 | 0 | 15 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer/execution | 2 | 473 | 0 | 72 | 545 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer/knowledge | 1 | 412 | 0 | 70 | 482 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer/thought | 2 | 139 | 0 | 29 | 168 |
|
||||
| src/Client/.qtc_clangd | 1 | 1 | 0 | 0 | 1 |
|
||||
| src/Client/android | 3 | 44 | 0 | 3 | 47 |
|
||||
| src/Client/android (Files) | 1 | 25 | 0 | 3 | 28 |
|
||||
| src/Client/android/res | 2 | 19 | 0 | 0 | 19 |
|
||||
| src/Client/android/res/drawable | 1 | 13 | 0 | 0 | 13 |
|
||||
| src/Client/android/res/values | 1 | 6 | 0 | 0 | 6 |
|
||||
| src/Client/doc | 24 | 5,087 | 61 | 1,223 | 6,371 |
|
||||
| src/Client/doc (Files) | 3 | 345 | 0 | 102 | 447 |
|
||||
| src/Client/doc/database | 3 | 482 | 30 | 72 | 584 |
|
||||
| src/Client/doc/git | 1 | 237 | 0 | 64 | 301 |
|
||||
| src/Client/doc/planning | 5 | 1,328 | 0 | 286 | 1,614 |
|
||||
| src/Client/doc/reports | 3 | 490 | 0 | 139 | 629 |
|
||||
| src/Client/doc/technical | 2 | 515 | 0 | 147 | 662 |
|
||||
| src/Client/doc/ui-optimization | 5 | 879 | 0 | 225 | 1,104 |
|
||||
| src/Client/doc/ui_design | 2 | 811 | 31 | 188 | 1,030 |
|
||||
| src/Client/include | 7 | 602 | 1,106 | 301 | 2,009 |
|
||||
| src/Client/include/ui | 6 | 553 | 1,002 | 276 | 1,831 |
|
||||
| src/Client/include/ui/components | 4 | 416 | 712 | 197 | 1,325 |
|
||||
| src/Client/include/ui/dialogs | 1 | 49 | 83 | 24 | 156 |
|
||||
| src/Client/include/ui/main | 1 | 88 | 207 | 55 | 350 |
|
||||
| src/Client/include/utils | 1 | 49 | 104 | 25 | 178 |
|
||||
| src/Client/res | 11 | 385 | 16 | 41 | 442 |
|
||||
| src/Client/res/html | 1 | 375 | 16 | 41 | 432 |
|
||||
| src/Client/res/image | 10 | 10 | 0 | 0 | 10 |
|
||||
| src/Client/src | 8 | 4,348 | 529 | 846 | 5,723 |
|
||||
| src/Client/src (Files) | 1 | 27 | 3 | 7 | 37 |
|
||||
| src/Client/src/ui | 6 | 4,201 | 509 | 818 | 5,528 |
|
||||
| src/Client/src/ui/components | 4 | 2,669 | 284 | 508 | 3,461 |
|
||||
| src/Client/src/ui/dialogs | 1 | 510 | 60 | 96 | 666 |
|
||||
| src/Client/src/ui/main | 1 | 1,022 | 165 | 214 | 1,401 |
|
||||
| src/Client/src/utils | 1 | 120 | 17 | 21 | 158 |
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
@ -0,0 +1,168 @@
|
||||
Date : 2025-06-29 17:36:53
|
||||
Directory : /home/hzk/Software_Architecture
|
||||
Total : 83 files, 15656 codes, 1748 comments, 3324 blanks, all 20728 lines
|
||||
|
||||
Languages
|
||||
+--------------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+--------------+------------+------------+------------+------------+------------+
|
||||
| Markdown | 42 | 7,363 | 0 | 1,781 | 9,144 |
|
||||
| C++ | 16 | 5,471 | 1,666 | 1,277 | 8,414 |
|
||||
| HTML | 3 | 1,744 | 39 | 222 | 2,005 |
|
||||
| JSON | 5 | 687 | 0 | 2 | 689 |
|
||||
| MS SQL | 3 | 327 | 37 | 35 | 399 |
|
||||
| XML | 13 | 54 | 0 | 3 | 57 |
|
||||
| Shell Script | 1 | 10 | 6 | 4 | 20 |
|
||||
+--------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+-----------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+-----------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 83 | 15,656 | 1,748 | 3,324 | 20,728 |
|
||||
| . (Files) | 5 | 1,941 | 23 | 398 | 2,362 |
|
||||
| .claude | 1 | 19 | 0 | 0 | 19 |
|
||||
| src | 77 | 13,696 | 1,725 | 2,926 | 18,347 |
|
||||
| src/Client | 77 | 13,696 | 1,725 | 2,926 | 18,347 |
|
||||
| src/Client (Files) | 4 | 877 | 13 | 201 | 1,091 |
|
||||
| src/Client/.claude | 1 | 43 | 0 | 0 | 43 |
|
||||
| src/Client/.promptx | 18 | 2,309 | 0 | 311 | 2,620 |
|
||||
| src/Client/.promptx (Files) | 1 | 404 | 0 | 1 | 405 |
|
||||
| src/Client/.promptx/memory | 1 | 90 | 0 | 25 | 115 |
|
||||
| src/Client/.promptx/resource | 16 | 1,815 | 0 | 285 | 2,100 |
|
||||
| src/Client/.promptx/resource (Files) | 1 | 220 | 0 | 1 | 221 |
|
||||
| src/Client/.promptx/resource/domain | 15 | 1,595 | 0 | 284 | 1,879 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer | 7 | 394 | 0 | 86 | 480 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer (Files) | 1 | 16 | 0 | 2 | 18 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer-simple | 1 | 36 | 0 | 4 | 40 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer/execution | 2 | 166 | 0 | 30 | 196 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer/knowledge | 2 | 89 | 0 | 29 | 118 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-designer/thought | 2 | 123 | 0 | 25 | 148 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-developer | 1 | 126 | 0 | 23 | 149 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer | 6 | 1,039 | 0 | 171 | 1,210 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer (Files) | 1 | 15 | 0 | 0 | 15 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer/execution | 2 | 473 | 0 | 72 | 545 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer/knowledge | 1 | 412 | 0 | 70 | 482 |
|
||||
| src/Client/.promptx/resource/domain/qt-ui-optimizer/thought | 2 | 139 | 0 | 29 | 168 |
|
||||
| src/Client/.qtc_clangd | 1 | 1 | 0 | 0 | 1 |
|
||||
| src/Client/android | 3 | 44 | 0 | 3 | 47 |
|
||||
| src/Client/android (Files) | 1 | 25 | 0 | 3 | 28 |
|
||||
| src/Client/android/res | 2 | 19 | 0 | 0 | 19 |
|
||||
| src/Client/android/res/drawable | 1 | 13 | 0 | 0 | 13 |
|
||||
| src/Client/android/res/values | 1 | 6 | 0 | 0 | 6 |
|
||||
| src/Client/doc | 24 | 5,087 | 61 | 1,223 | 6,371 |
|
||||
| src/Client/doc (Files) | 3 | 345 | 0 | 102 | 447 |
|
||||
| src/Client/doc/database | 3 | 482 | 30 | 72 | 584 |
|
||||
| src/Client/doc/git | 1 | 237 | 0 | 64 | 301 |
|
||||
| src/Client/doc/planning | 5 | 1,328 | 0 | 286 | 1,614 |
|
||||
| src/Client/doc/reports | 3 | 490 | 0 | 139 | 629 |
|
||||
| src/Client/doc/technical | 2 | 515 | 0 | 147 | 662 |
|
||||
| src/Client/doc/ui-optimization | 5 | 879 | 0 | 225 | 1,104 |
|
||||
| src/Client/doc/ui_design | 2 | 811 | 31 | 188 | 1,030 |
|
||||
| src/Client/include | 7 | 602 | 1,106 | 301 | 2,009 |
|
||||
| src/Client/include/ui | 6 | 553 | 1,002 | 276 | 1,831 |
|
||||
| src/Client/include/ui/components | 4 | 416 | 712 | 197 | 1,325 |
|
||||
| src/Client/include/ui/dialogs | 1 | 49 | 83 | 24 | 156 |
|
||||
| src/Client/include/ui/main | 1 | 88 | 207 | 55 | 350 |
|
||||
| src/Client/include/utils | 1 | 49 | 104 | 25 | 178 |
|
||||
| src/Client/res | 11 | 385 | 16 | 41 | 442 |
|
||||
| src/Client/res/html | 1 | 375 | 16 | 41 | 432 |
|
||||
| src/Client/res/image | 10 | 10 | 0 | 0 | 10 |
|
||||
| src/Client/src | 8 | 4,348 | 529 | 846 | 5,723 |
|
||||
| src/Client/src (Files) | 1 | 27 | 3 | 7 | 37 |
|
||||
| src/Client/src/ui | 6 | 4,201 | 509 | 818 | 5,528 |
|
||||
| src/Client/src/ui/components | 4 | 2,669 | 284 | 508 | 3,461 |
|
||||
| src/Client/src/ui/dialogs | 1 | 510 | 60 | 96 | 666 |
|
||||
| src/Client/src/ui/main | 1 | 1,022 | 165 | 214 | 1,401 |
|
||||
| src/Client/src/utils | 1 | 120 | 17 | 21 | 158 |
|
||||
+-----------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+-----------------------------------------------------------------------------------------------------------------------------------------+--------------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+-----------------------------------------------------------------------------------------------------------------------------------------+--------------+------------+------------+------------+------------+
|
||||
| /home/hzk/Software_Architecture/.claude/settings.local.json | JSON | 19 | 0 | 0 | 19 |
|
||||
| /home/hzk/Software_Architecture/README.md | Markdown | 1 | 0 | 2 | 3 |
|
||||
| /home/hzk/Software_Architecture/design-geimi.html | HTML | 414 | 14 | 39 | 467 |
|
||||
| /home/hzk/Software_Architecture/design.html | HTML | 955 | 9 | 142 | 1,106 |
|
||||
| /home/hzk/Software_Architecture/prompt.md | Markdown | 142 | 0 | 113 | 255 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.claude/settings.local.json | JSON | 43 | 0 | 0 | 43 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/memory/declarative.md | Markdown | 90 | 0 | 25 | 115 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/pouch.json | JSON | 404 | 0 | 1 | 405 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-designer-simple/qt-ui-designer-simple.role.md | Markdown | 36 | 0 | 4 | 40 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-designer/execution/design-documentation-process.execution.md | Markdown | 79 | 0 | 12 | 91 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-designer/execution/qt-ui-design-workflow.execution.md | Markdown | 87 | 0 | 18 | 105 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-designer/knowledge/design-documentation-methods.knowledge.md | Markdown | 33 | 0 | 13 | 46 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-designer/knowledge/qt-ui-expertise.knowledge.md | Markdown | 56 | 0 | 16 | 72 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-designer/qt-ui-designer.role.md | Markdown | 16 | 0 | 2 | 18 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-designer/thought/documentation-expression.thought.md | Markdown | 64 | 0 | 13 | 77 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-designer/thought/ui-design-thinking.thought.md | Markdown | 59 | 0 | 12 | 71 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-developer/qt-ui-developer.role.md | Markdown | 126 | 0 | 23 | 149 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-optimizer/execution/layout-enhancement-process.execution.md | Markdown | 249 | 0 | 40 | 289 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-optimizer/execution/ui-optimization-workflow.execution.md | Markdown | 224 | 0 | 32 | 256 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-optimizer/knowledge/qt-ui-optimization-expertise.knowledge.md | Markdown | 412 | 0 | 70 | 482 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-optimizer/qt-ui-optimizer.role.md | Markdown | 15 | 0 | 0 | 15 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-optimizer/thought/aesthetic-enhancement.thought.md | Markdown | 73 | 0 | 15 | 88 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/domain/qt-ui-optimizer/thought/ui-optimization-thinking.thought.md | Markdown | 66 | 0 | 14 | 80 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.promptx/resource/project.registry.json | JSON | 220 | 0 | 1 | 221 |
|
||||
| /home/hzk/Software_Architecture/src/Client/.qtc_clangd/compile_commands.json | JSON | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/CLAUDE.md | Markdown | 188 | 0 | 47 | 235 |
|
||||
| /home/hzk/Software_Architecture/src/Client/android/AndroidManifest.xml | XML | 25 | 0 | 3 | 28 |
|
||||
| /home/hzk/Software_Architecture/src/Client/android/res/drawable/splash.xml | XML | 13 | 0 | 0 | 13 |
|
||||
| /home/hzk/Software_Architecture/src/Client/android/res/values/styles.xml | XML | 6 | 0 | 0 | 6 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/README.md | Markdown | 89 | 0 | 29 | 118 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/database/database_design.md | Markdown | 196 | 0 | 44 | 240 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/database/database_schema.sql | MS SQL | 126 | 13 | 13 | 152 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/database/updated_database_schema.sql | MS SQL | 160 | 17 | 15 | 192 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/git/git_branch_strategy.md | Markdown | 237 | 0 | 64 | 301 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/planning/code_refactor_plan.md | Markdown | 224 | 0 | 42 | 266 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/planning/functional_modules_specification.md | Markdown | 175 | 0 | 49 | 224 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/planning/project_structure_plan.md | Markdown | 428 | 0 | 58 | 486 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/planning/refactor_impact_assessment.md | Markdown | 204 | 0 | 65 | 269 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/planning/task.md | Markdown | 297 | 0 | 72 | 369 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/reports/code_refactor_summary.md | Markdown | 153 | 0 | 44 | 197 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/reports/phase1_completion_report.md | Markdown | 137 | 0 | 33 | 170 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/reports/phase3_completion_report.md | Markdown | 200 | 0 | 62 | 262 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/technical/phase3_ui_refactor_plan.md | Markdown | 264 | 0 | 76 | 340 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/technical/system_log_design.md | Markdown | 251 | 0 | 71 | 322 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/ui-optimization/color_scheme_unification_report.md | Markdown | 152 | 0 | 41 | 193 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/ui-optimization/css_compatibility_fix_report.md | Markdown | 175 | 0 | 36 | 211 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/ui-optimization/military_ui_optimization_summary.md | Markdown | 196 | 0 | 48 | 244 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/ui-optimization/right_panel_ui_optimization_report.md | Markdown | 200 | 0 | 51 | 251 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/ui-optimization/ui_issues_fix_report.md | Markdown | 156 | 0 | 49 | 205 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/ui_design/right_panel_design_spec.md | Markdown | 290 | 0 | 58 | 348 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/ui_design/right_panel_implementation.cpp | C++ | 521 | 31 | 130 | 682 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/ui_optimization_menubar_statusbar.md | Markdown | 157 | 0 | 41 | 198 |
|
||||
| /home/hzk/Software_Architecture/src/Client/doc/ui_optimization_summary.md | Markdown | 99 | 0 | 32 | 131 |
|
||||
| /home/hzk/Software_Architecture/src/Client/include/ui/components/DeviceCard.h | C++ | 137 | 205 | 53 | 395 |
|
||||
| /home/hzk/Software_Architecture/src/Client/include/ui/components/DeviceListPanel.h | C++ | 110 | 224 | 62 | 396 |
|
||||
| /home/hzk/Software_Architecture/src/Client/include/ui/components/RightFunctionPanel.h | C++ | 102 | 179 | 51 | 332 |
|
||||
| /home/hzk/Software_Architecture/src/Client/include/ui/components/SystemLogPanel.h | C++ | 67 | 104 | 31 | 202 |
|
||||
| /home/hzk/Software_Architecture/src/Client/include/ui/dialogs/DeviceDialog.h | C++ | 49 | 83 | 24 | 156 |
|
||||
| /home/hzk/Software_Architecture/src/Client/include/ui/main/MainWindow.h | C++ | 88 | 207 | 55 | 350 |
|
||||
| /home/hzk/Software_Architecture/src/Client/include/utils/SystemLogger.h | C++ | 49 | 104 | 25 | 178 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/html/map.html | HTML | 375 | 16 | 41 | 432 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/UAV.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/health.png.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/health.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/infomation.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/location.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/map.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/mapbtn.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/robotbtn.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/soldier.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/res/image/tab.svg | XML | 1 | 0 | 0 | 1 |
|
||||
| /home/hzk/Software_Architecture/src/Client/run_app.sh | Shell Script | 10 | 6 | 4 | 20 |
|
||||
| /home/hzk/Software_Architecture/src/Client/setup_database.sql | MS SQL | 41 | 7 | 7 | 55 |
|
||||
| /home/hzk/Software_Architecture/src/Client/src/main.cpp | C++ | 27 | 3 | 7 | 37 |
|
||||
| /home/hzk/Software_Architecture/src/Client/src/ui/components/DeviceCard.cpp | C++ | 576 | 79 | 110 | 765 |
|
||||
| /home/hzk/Software_Architecture/src/Client/src/ui/components/DeviceListPanel.cpp | C++ | 971 | 106 | 186 | 1,263 |
|
||||
| /home/hzk/Software_Architecture/src/Client/src/ui/components/RightFunctionPanel.cpp | C++ | 748 | 58 | 151 | 957 |
|
||||
| /home/hzk/Software_Architecture/src/Client/src/ui/components/SystemLogPanel.cpp | C++ | 374 | 41 | 61 | 476 |
|
||||
| /home/hzk/Software_Architecture/src/Client/src/ui/dialogs/DeviceDialog.cpp | C++ | 510 | 60 | 96 | 666 |
|
||||
| /home/hzk/Software_Architecture/src/Client/src/ui/main/MainWindow.cpp | C++ | 1,022 | 165 | 214 | 1,401 |
|
||||
| /home/hzk/Software_Architecture/src/Client/src/utils/SystemLogger.cpp | C++ | 120 | 17 | 21 | 158 |
|
||||
| /home/hzk/Software_Architecture/src/Client/代码规范.md | Markdown | 638 | 0 | 143 | 781 |
|
||||
| /home/hzk/Software_Architecture/技术博客_战场探索系统.md | Markdown | 429 | 0 | 102 | 531 |
|
||||
| Total | | 15,656 | 1,748 | 3,324 | 20,728 |
|
||||
+-----------------------------------------------------------------------------------------------------------------------------------------+--------------+------------+------------+------------+------------+
|
||||
@ -0,0 +1,16 @@
|
||||
<role>
|
||||
<personality>
|
||||
@!thought://remember
|
||||
@!thought://recall
|
||||
@!thought://academic-writing
|
||||
@!thought://project-reflection
|
||||
</personality>
|
||||
<principle>
|
||||
@!execution://academic-report-writing
|
||||
@!execution://grade-optimization
|
||||
</principle>
|
||||
<knowledge>
|
||||
@!knowledge://software-engineering-education
|
||||
@!knowledge://technical-documentation
|
||||
</knowledge>
|
||||
</role>
|
||||
@ -0,0 +1,17 @@
|
||||
<role>
|
||||
<personality>
|
||||
@!thought://remember
|
||||
@!thought://recall
|
||||
@!thought://project-analysis
|
||||
@!thought://educational-guidance
|
||||
</personality>
|
||||
<principle>
|
||||
@!execution://project-explanation-workflow
|
||||
@!execution://academic-presentation
|
||||
</principle>
|
||||
<knowledge>
|
||||
@!knowledge://qt-architecture
|
||||
@!knowledge://code-analysis-techniques
|
||||
@!knowledge://academic-evaluation-standards
|
||||
</knowledge>
|
||||
</role>
|
||||
@ -0,0 +1,109 @@
|
||||
<thought>
|
||||
<exploration>
|
||||
## 教育指导的多元化探索
|
||||
|
||||
### 学习者需求分析
|
||||
- **知识背景**:学习者的技术基础和经验水平
|
||||
- **学习目标**:项目验收、技术提升、知识拓展
|
||||
- **认知风格**:视觉型、听觉型、动手型学习偏好
|
||||
- **时间约束**:可用学习时间和紧急程度
|
||||
|
||||
### 教学内容层次化
|
||||
- **基础概念层**:核心技术概念、基本原理
|
||||
- **应用实践层**:具体实现方法、代码示例
|
||||
- **深度理解层**:设计思想、架构理念
|
||||
- **拓展延伸层**:相关技术、发展趋势
|
||||
|
||||
### 教学方法多样化
|
||||
- **图形化教学**:架构图、流程图、时序图
|
||||
- **案例化教学**:具体代码案例、实际问题解决
|
||||
- **对比化教学**:不同方案对比、优劣分析
|
||||
- **互动化教学**:问答式引导、启发式思考
|
||||
|
||||
### 验收准备策略
|
||||
- **关键点梳理**:项目的核心技术点和创新点
|
||||
- **问题预演**:可能的提问和回答准备
|
||||
- **演示准备**:功能演示和代码展示
|
||||
- **文档整理**:技术文档、设计文档的完善
|
||||
</exploration>
|
||||
|
||||
<reasoning>
|
||||
## 教育指导的系统性推理
|
||||
|
||||
### 学习效果最大化
|
||||
- **认知负载理论**:合理控制信息量,避免认知过载
|
||||
- **建构主义学习**:基于已有知识构建新的理解
|
||||
- **多元智能理论**:适应不同的学习风格和智能类型
|
||||
- **元认知策略**:培养学习者的自我反思和监控能力
|
||||
|
||||
### 知识传递优化
|
||||
- **由浅入深**:从简单概念到复杂系统的渐进式学习
|
||||
- **理论实践结合**:概念解释与代码实例相结合
|
||||
- **问题驱动**:通过解决实际问题来驱动学习
|
||||
- **反馈循环**:及时反馈和调整教学策略
|
||||
|
||||
### 验收成功策略
|
||||
- **亮点突出**:重点展示项目的技术亮点和创新点
|
||||
- **逻辑清晰**:按照清晰的逻辑结构组织讲解内容
|
||||
- **深度适中**:既要有技术深度,又要避免过于复杂
|
||||
- **自信表达**:通过充分理解建立自信的表达能力
|
||||
</reasoning>
|
||||
|
||||
<challenge>
|
||||
## 教育指导中的关键挑战
|
||||
|
||||
### 复杂性管理挑战
|
||||
- 如何将复杂的技术概念简化而不失准确性?
|
||||
- 如何在有限时间内覆盖足够的知识深度?
|
||||
- 如何平衡理论学习和实践应用?
|
||||
|
||||
### 个性化教学挑战
|
||||
- 如何适应不同学习者的知识背景差异?
|
||||
- 如何调整教学节奏以匹配学习者的接受能力?
|
||||
- 如何激发学习者的主动学习兴趣?
|
||||
|
||||
### 验收准备挑战
|
||||
- 如何预测评审者可能关注的技术点?
|
||||
- 如何在短时间内建立对项目的深度理解?
|
||||
- 如何处理验收过程中的突发问题?
|
||||
|
||||
### 知识转化挑战
|
||||
- 如何将技术理解转化为清晰的表达?
|
||||
- 如何将代码细节转化为架构思维?
|
||||
- 如何将学习成果转化为实际能力?
|
||||
</challenge>
|
||||
|
||||
<plan>
|
||||
## 教育指导的实施计划
|
||||
|
||||
### 学习路径设计
|
||||
```mermaid
|
||||
graph TD
|
||||
A[项目概览] --> B[技术栈理解]
|
||||
B --> C[架构分析]
|
||||
C --> D[核心模块深入]
|
||||
D --> E[代码细节解析]
|
||||
E --> F[质量评估]
|
||||
F --> G[亮点总结]
|
||||
G --> H[验收准备]
|
||||
```
|
||||
|
||||
### 教学策略组合
|
||||
1. **概念先行**:先建立整体概念框架
|
||||
2. **实例跟进**:用具体代码实例验证概念
|
||||
3. **对比强化**:通过对比加深理解
|
||||
4. **总结升华**:将具体知识抽象为一般原理
|
||||
|
||||
### 验收辅导流程
|
||||
1. **知识盘点**:梳理已掌握和待学习的知识点
|
||||
2. **重点突破**:针对薄弱环节进行重点辅导
|
||||
3. **模拟演练**:模拟验收场景进行练习
|
||||
4. **反馈优化**:根据练习效果调整策略
|
||||
|
||||
### 学习效果评估
|
||||
- **理解深度检查**:通过提问检验理解程度
|
||||
- **表达能力评估**:评估技术表达的清晰度
|
||||
- **问题解决能力**:测试面对新问题的应对能力
|
||||
- **自信程度评估**:评估学习者的自信心建立情况
|
||||
</plan>
|
||||
</thought>
|
||||
@ -0,0 +1,17 @@
|
||||
<role>
|
||||
<personality>
|
||||
@!thought://remember
|
||||
@!thought://recall
|
||||
@!thought://visual-design
|
||||
@!thought://creative-thinking
|
||||
</personality>
|
||||
<principle>
|
||||
@!execution://poster-design-process
|
||||
@!execution://visual-communication
|
||||
</principle>
|
||||
<knowledge>
|
||||
@!knowledge://graphic-design
|
||||
@!knowledge://military-tech-aesthetics
|
||||
@!knowledge://project-presentation
|
||||
</knowledge>
|
||||
</role>
|
||||
@ -0,0 +1,130 @@
|
||||
<execution>
|
||||
<constraint>
|
||||
## 学术标准约束
|
||||
- **评审导向**:必须符合学术评审的期望和标准
|
||||
- **理论基础**:改进方案必须有坚实的理论基础
|
||||
- **创新要求**:需要体现一定的技术创新和思考深度
|
||||
- **文档要求**:必须有完整的技术文档和说明
|
||||
- **可重现性**:改进过程和结果必须可重现
|
||||
</constraint>
|
||||
|
||||
<rule>
|
||||
## 学术标准强制规则
|
||||
- **理论支撑**:每个重要改进都必须有理论依据
|
||||
- **对比分析**:必须提供改进前后的对比分析
|
||||
- **最佳实践**:必须体现行业最佳实践的应用
|
||||
- **创新亮点**:必须突出技术创新和优化亮点
|
||||
- **完整文档**:必须提供完整的技术文档
|
||||
</rule>
|
||||
|
||||
<guideline>
|
||||
## 学术导向指导原则
|
||||
- **深度优于广度**:重点突出几个核心优化点
|
||||
- **理论结合实践**:将理论知识应用到实际项目中
|
||||
- **创新性思考**:体现独特的技术见解和创新
|
||||
- **工程化思维**:展现系统性的工程化思考
|
||||
- **学术价值**:确保改进具有学术研究价值
|
||||
</guideline>
|
||||
|
||||
<process>
|
||||
## 学术标准执行流程
|
||||
|
||||
### 学术价值识别
|
||||
```mermaid
|
||||
mindmap
|
||||
root((学术价值))
|
||||
技术创新
|
||||
设计模式应用
|
||||
算法优化
|
||||
架构改进
|
||||
工程实践
|
||||
最佳实践应用
|
||||
质量管理
|
||||
项目管理
|
||||
理论应用
|
||||
软件工程理论
|
||||
设计原则
|
||||
质量模型
|
||||
文档完善
|
||||
技术文档
|
||||
设计文档
|
||||
评估报告
|
||||
```
|
||||
|
||||
### 学术标准实施框架
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[理论研究] --> B[方案设计]
|
||||
B --> C[实施验证]
|
||||
C --> D[效果评估]
|
||||
D --> E[文档整理]
|
||||
E --> F[学术报告]
|
||||
|
||||
A1[文献调研] --> A
|
||||
A2[理论分析] --> A
|
||||
B1[创新设计] --> B
|
||||
B2[可行性分析] --> B
|
||||
C1[渐进实施] --> C
|
||||
C2[测试验证] --> C
|
||||
D1[量化分析] --> D
|
||||
D2[对比评估] --> D
|
||||
E1[技术文档] --> E
|
||||
E2[过程记录] --> E
|
||||
F1[成果总结] --> F
|
||||
F2[价值阐述] --> F
|
||||
```
|
||||
|
||||
### 学术评审准备
|
||||
1. **技术亮点提炼**
|
||||
- 识别项目中的技术创新点
|
||||
- 总结应用的设计模式和最佳实践
|
||||
- 量化改进效果和性能提升
|
||||
|
||||
2. **理论基础阐述**
|
||||
- 说明改进方案的理论依据
|
||||
- 引用相关的学术文献和标准
|
||||
- 展示对软件工程理论的理解
|
||||
|
||||
3. **工程价值体现**
|
||||
- 展示系统性的工程化思维
|
||||
- 体现对软件质量的深入理解
|
||||
- 展现项目管理和质量管理能力
|
||||
|
||||
4. **文档体系完善**
|
||||
- 技术设计文档
|
||||
- 代码质量评估报告
|
||||
- 改进实施过程记录
|
||||
- 效果验证和对比分析
|
||||
</process>
|
||||
|
||||
<criteria>
|
||||
## 学术标准评价指标
|
||||
|
||||
### 技术深度指标
|
||||
- ✅ **设计模式应用** 至少3种经典模式的正确应用
|
||||
- ✅ **架构设计质量** 体现良好的架构设计思维
|
||||
- ✅ **代码质量提升** 量化的质量改进指标
|
||||
- ✅ **性能优化效果** 可测量的性能提升
|
||||
- ✅ **最佳实践体现** 行业标准和最佳实践的应用
|
||||
|
||||
### 创新性指标
|
||||
- ✅ **技术创新点** 至少2个有价值的技术创新
|
||||
- ✅ **解决方案独特性** 体现独特的技术见解
|
||||
- ✅ **优化思路新颖性** 创新的优化思路和方法
|
||||
- ✅ **工程化创新** 在工程实践中的创新应用
|
||||
|
||||
### 学术价值指标
|
||||
- ✅ **理论应用深度** 软件工程理论的深入应用
|
||||
- ✅ **文档完整性** 完整的技术文档体系
|
||||
- ✅ **可重现性** 改进过程和结果的可重现性
|
||||
- ✅ **学习价值** 对其他开发者的学习参考价值
|
||||
- ✅ **评审认可度** 获得导师和专家的积极评价
|
||||
|
||||
### 工程质量指标
|
||||
- ✅ **代码规范性** 严格遵循编码规范
|
||||
- ✅ **测试覆盖率** 关键模块测试覆盖率≥80%
|
||||
- ✅ **文档覆盖率** 公共接口文档覆盖率≥90%
|
||||
- ✅ **维护性提升** 代码可维护性指数提升≥30%
|
||||
- ✅ **扩展性改进** 系统扩展性的显著改善
|
||||
</criteria>
|
||||
</execution>
|
||||
@ -0,0 +1,425 @@
|
||||
# 项目架构知识体系
|
||||
|
||||
## Qt项目标准架构
|
||||
|
||||
### 目录结构最佳实践
|
||||
```
|
||||
BattlefieldExplorationSystem/
|
||||
├── src/ # 源代码目录
|
||||
│ ├── core/ # 核心业务逻辑
|
||||
│ │ ├── database/ # 数据库相关
|
||||
│ │ ├── network/ # 网络通信
|
||||
│ │ └── algorithms/ # 核心算法
|
||||
│ ├── ui/ # 用户界面
|
||||
│ │ ├── main/ # 主窗口
|
||||
│ │ ├── dialogs/ # 对话框
|
||||
│ │ └── components/ # UI组件
|
||||
│ ├── utils/ # 工具类
|
||||
│ └── main.cpp # 程序入口
|
||||
├── include/ # 头文件目录
|
||||
│ ├── core/ # 核心头文件
|
||||
│ ├── ui/ # UI头文件
|
||||
│ └── utils/ # 工具头文件
|
||||
├── resources/ # 资源文件
|
||||
│ ├── images/ # 图片资源
|
||||
│ ├── qml/ # QML文件
|
||||
│ ├── styles/ # 样式文件
|
||||
│ └── translations/ # 翻译文件
|
||||
├── tests/ # 测试代码
|
||||
│ ├── unit/ # 单元测试
|
||||
│ ├── integration/ # 集成测试
|
||||
│ └── ui/ # UI测试
|
||||
├── docs/ # 文档目录
|
||||
│ ├── api/ # API文档
|
||||
│ ├── design/ # 设计文档
|
||||
│ └── user/ # 用户文档
|
||||
├── build/ # 构建输出
|
||||
├── CMakeLists.txt # CMake配置
|
||||
└── README.md # 项目说明
|
||||
```
|
||||
|
||||
### 模块化架构设计
|
||||
```cpp
|
||||
// 核心模块接口定义
|
||||
namespace Core {
|
||||
class IDatabase {
|
||||
public:
|
||||
virtual ~IDatabase() = default;
|
||||
virtual bool connect(const QString& connectionString) = 0;
|
||||
virtual bool execute(const QString& query) = 0;
|
||||
virtual QVariant getValue(const QString& key) = 0;
|
||||
};
|
||||
|
||||
class INetworkManager {
|
||||
public:
|
||||
virtual ~INetworkManager() = default;
|
||||
virtual void sendRequest(const QNetworkRequest& request) = 0;
|
||||
virtual void setProxy(const QNetworkProxy& proxy) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
// UI模块接口定义
|
||||
namespace UI {
|
||||
class IMainWindow {
|
||||
public:
|
||||
virtual ~IMainWindow() = default;
|
||||
virtual void showMessage(const QString& message) = 0;
|
||||
virtual void updateStatus(const QString& status) = 0;
|
||||
};
|
||||
|
||||
class IDevicePanel {
|
||||
public:
|
||||
virtual ~IDevicePanel() = default;
|
||||
virtual void addDevice(const DeviceInfo& info) = 0;
|
||||
virtual void removeDevice(const QString& deviceId) = 0;
|
||||
virtual void updateDevice(const DeviceInfo& info) = 0;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## 分层架构模式
|
||||
|
||||
### 三层架构实现
|
||||
```cpp
|
||||
// 表示层 (Presentation Layer)
|
||||
class MainWindow : public QMainWindow, public UI::IMainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MainWindow(std::shared_ptr<BusinessLogic> logic,
|
||||
QWidget *parent = nullptr);
|
||||
|
||||
void showMessage(const QString& message) override;
|
||||
void updateStatus(const QString& status) override;
|
||||
|
||||
private slots:
|
||||
void onDeviceAdded(const DeviceInfo& info);
|
||||
void onDeviceRemoved(const QString& deviceId);
|
||||
|
||||
private:
|
||||
std::shared_ptr<BusinessLogic> m_businessLogic;
|
||||
Ui::MainWindow *ui;
|
||||
};
|
||||
|
||||
// 业务逻辑层 (Business Logic Layer)
|
||||
class BusinessLogic : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BusinessLogic(std::shared_ptr<Core::IDatabase> database,
|
||||
std::shared_ptr<Core::INetworkManager> network);
|
||||
|
||||
void addDevice(const DeviceInfo& info);
|
||||
void removeDevice(const QString& deviceId);
|
||||
QList<DeviceInfo> getAllDevices() const;
|
||||
|
||||
signals:
|
||||
void deviceAdded(const DeviceInfo& info);
|
||||
void deviceRemoved(const QString& deviceId);
|
||||
void errorOccurred(const QString& error);
|
||||
|
||||
private:
|
||||
std::shared_ptr<Core::IDatabase> m_database;
|
||||
std::shared_ptr<Core::INetworkManager> m_network;
|
||||
QList<DeviceInfo> m_devices;
|
||||
};
|
||||
|
||||
// 数据访问层 (Data Access Layer)
|
||||
class DatabaseManager : public QObject, public Core::IDatabase {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DatabaseManager(QObject *parent = nullptr);
|
||||
|
||||
bool connect(const QString& connectionString) override;
|
||||
bool execute(const QString& query) override;
|
||||
QVariant getValue(const QString& key) override;
|
||||
|
||||
// 特定业务方法
|
||||
bool saveDevice(const DeviceInfo& info);
|
||||
DeviceInfo loadDevice(const QString& deviceId);
|
||||
QList<DeviceInfo> loadAllDevices();
|
||||
|
||||
private:
|
||||
QSqlDatabase m_database;
|
||||
QString m_connectionString;
|
||||
};
|
||||
```
|
||||
|
||||
### MVC模式在Qt中的应用
|
||||
```cpp
|
||||
// Model - 数据模型
|
||||
class DeviceModel : public QAbstractTableModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DeviceModel(QObject *parent = nullptr);
|
||||
|
||||
// QAbstractTableModel接口实现
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const override;
|
||||
|
||||
// 业务方法
|
||||
void addDevice(const DeviceInfo& info);
|
||||
void removeDevice(int row);
|
||||
void updateDevice(int row, const DeviceInfo& info);
|
||||
|
||||
private:
|
||||
QList<DeviceInfo> m_devices;
|
||||
};
|
||||
|
||||
// View - 视图
|
||||
class DeviceView : public QTableView {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DeviceView(QWidget *parent = nullptr);
|
||||
|
||||
void setDeviceModel(DeviceModel *model);
|
||||
|
||||
signals:
|
||||
void deviceSelected(const DeviceInfo& info);
|
||||
void deviceDoubleClicked(const DeviceInfo& info);
|
||||
|
||||
private slots:
|
||||
void onSelectionChanged(const QItemSelection &selected,
|
||||
const QItemSelection &deselected);
|
||||
void onDoubleClicked(const QModelIndex &index);
|
||||
};
|
||||
|
||||
// Controller - 控制器
|
||||
class DeviceController : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DeviceController(DeviceModel *model, DeviceView *view,
|
||||
QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void addDevice();
|
||||
void removeDevice();
|
||||
void editDevice();
|
||||
void refreshDevices();
|
||||
|
||||
private slots:
|
||||
void onDeviceSelected(const DeviceInfo& info);
|
||||
void onDeviceDoubleClicked(const DeviceInfo& info);
|
||||
|
||||
private:
|
||||
DeviceModel *m_model;
|
||||
DeviceView *m_view;
|
||||
DeviceInfo m_selectedDevice;
|
||||
};
|
||||
```
|
||||
|
||||
## 依赖注入和控制反转
|
||||
|
||||
### 依赖注入容器
|
||||
```cpp
|
||||
// 简单的依赖注入容器
|
||||
class DIContainer {
|
||||
public:
|
||||
template<typename Interface, typename Implementation>
|
||||
void registerSingleton() {
|
||||
m_singletons[typeid(Interface).name()] =
|
||||
[]() -> std::shared_ptr<void> {
|
||||
return std::make_shared<Implementation>();
|
||||
};
|
||||
}
|
||||
|
||||
template<typename Interface>
|
||||
std::shared_ptr<Interface> resolve() {
|
||||
auto it = m_singletons.find(typeid(Interface).name());
|
||||
if (it != m_singletons.end()) {
|
||||
return std::static_pointer_cast<Interface>(it->second());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<std::string, std::function<std::shared_ptr<void>()>> m_singletons;
|
||||
};
|
||||
|
||||
// 使用示例
|
||||
void setupDependencies(DIContainer& container) {
|
||||
container.registerSingleton<Core::IDatabase, DatabaseManager>();
|
||||
container.registerSingleton<Core::INetworkManager, NetworkManager>();
|
||||
container.registerSingleton<BusinessLogic, BusinessLogic>();
|
||||
}
|
||||
```
|
||||
|
||||
### 工厂模式实现
|
||||
```cpp
|
||||
// 抽象工厂
|
||||
class UIComponentFactory {
|
||||
public:
|
||||
virtual ~UIComponentFactory() = default;
|
||||
virtual std::unique_ptr<QWidget> createButton(const QString& text) = 0;
|
||||
virtual std::unique_ptr<QWidget> createLabel(const QString& text) = 0;
|
||||
virtual std::unique_ptr<QDialog> createDialog(const QString& title) = 0;
|
||||
};
|
||||
|
||||
// 具体工厂实现
|
||||
class ModernUIFactory : public UIComponentFactory {
|
||||
public:
|
||||
std::unique_ptr<QWidget> createButton(const QString& text) override {
|
||||
auto button = std::make_unique<QPushButton>(text);
|
||||
button->setStyleSheet(
|
||||
"QPushButton {"
|
||||
" background-color: #007ACC;"
|
||||
" color: white;"
|
||||
" border: none;"
|
||||
" padding: 8px 16px;"
|
||||
" border-radius: 4px;"
|
||||
"}"
|
||||
"QPushButton:hover {"
|
||||
" background-color: #005A9E;"
|
||||
"}"
|
||||
);
|
||||
return button;
|
||||
}
|
||||
|
||||
std::unique_ptr<QWidget> createLabel(const QString& text) override {
|
||||
auto label = std::make_unique<QLabel>(text);
|
||||
label->setStyleSheet(
|
||||
"QLabel {"
|
||||
" color: #333333;"
|
||||
" font-size: 14px;"
|
||||
"}"
|
||||
);
|
||||
return label;
|
||||
}
|
||||
|
||||
std::unique_ptr<QDialog> createDialog(const QString& title) override {
|
||||
auto dialog = std::make_unique<QDialog>();
|
||||
dialog->setWindowTitle(title);
|
||||
dialog->setStyleSheet(
|
||||
"QDialog {"
|
||||
" background-color: #F5F5F5;"
|
||||
"}"
|
||||
);
|
||||
return dialog;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## 配置管理和插件架构
|
||||
|
||||
### 配置管理系统
|
||||
```cpp
|
||||
class ConfigurationManager : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static ConfigurationManager& instance();
|
||||
|
||||
void loadConfiguration(const QString& configFile);
|
||||
void saveConfiguration(const QString& configFile);
|
||||
|
||||
template<typename T>
|
||||
T getValue(const QString& key, const T& defaultValue = T{}) const {
|
||||
return m_settings.value(key, QVariant::fromValue(defaultValue)).value<T>();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void setValue(const QString& key, const T& value) {
|
||||
m_settings.setValue(key, QVariant::fromValue(value));
|
||||
emit configurationChanged(key);
|
||||
}
|
||||
|
||||
signals:
|
||||
void configurationChanged(const QString& key);
|
||||
|
||||
private:
|
||||
ConfigurationManager() = default;
|
||||
QSettings m_settings;
|
||||
};
|
||||
```
|
||||
|
||||
### 插件架构设计
|
||||
```cpp
|
||||
// 插件接口
|
||||
class IPlugin {
|
||||
public:
|
||||
virtual ~IPlugin() = default;
|
||||
virtual QString name() const = 0;
|
||||
virtual QString version() const = 0;
|
||||
virtual bool initialize() = 0;
|
||||
virtual void shutdown() = 0;
|
||||
virtual QWidget* createWidget() = 0;
|
||||
};
|
||||
|
||||
// 插件管理器
|
||||
class PluginManager : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static PluginManager& instance();
|
||||
|
||||
void loadPlugins(const QString& pluginDir);
|
||||
void unloadPlugins();
|
||||
|
||||
QList<IPlugin*> getPlugins() const;
|
||||
IPlugin* getPlugin(const QString& name) const;
|
||||
|
||||
signals:
|
||||
void pluginLoaded(IPlugin* plugin);
|
||||
void pluginUnloaded(const QString& name);
|
||||
|
||||
private:
|
||||
QList<QPluginLoader*> m_loaders;
|
||||
QList<IPlugin*> m_plugins;
|
||||
};
|
||||
```
|
||||
|
||||
## 线程和并发架构
|
||||
|
||||
### 线程池管理
|
||||
```cpp
|
||||
class ThreadPoolManager : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static ThreadPoolManager& instance();
|
||||
|
||||
template<typename Func>
|
||||
QFuture<void> submitTask(Func&& func) {
|
||||
return QtConcurrent::run(&m_threadPool, std::forward<Func>(func));
|
||||
}
|
||||
|
||||
template<typename Func, typename Result = std::invoke_result_t<Func>>
|
||||
QFuture<Result> submitTaskWithResult(Func&& func) {
|
||||
return QtConcurrent::run(&m_threadPool, std::forward<Func>(func));
|
||||
}
|
||||
|
||||
void setMaxThreadCount(int maxThreads);
|
||||
int maxThreadCount() const;
|
||||
|
||||
private:
|
||||
ThreadPoolManager() = default;
|
||||
QThreadPool m_threadPool;
|
||||
};
|
||||
```
|
||||
|
||||
### 异步操作封装
|
||||
```cpp
|
||||
class AsyncOperation : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
template<typename Func>
|
||||
static QFuture<void> execute(Func&& operation) {
|
||||
auto promise = std::make_shared<QPromise<void>>();
|
||||
auto future = promise->future();
|
||||
|
||||
QtConcurrent::run([promise, operation = std::forward<Func>(operation)]() {
|
||||
try {
|
||||
operation();
|
||||
promise->finish();
|
||||
} catch (...) {
|
||||
promise->setException(std::current_exception());
|
||||
}
|
||||
});
|
||||
|
||||
return future;
|
||||
}
|
||||
|
||||
template<typename Func, typename Result = std::invoke_result_t<Func>>
|
||||
static QFuture<Result> executeWithResult(Func&& operation) {
|
||||
return QtConcurrent::run(std::forward<Func>(operation));
|
||||
}
|
||||
};
|
||||
```
|
||||
@ -0,0 +1,18 @@
|
||||
<role>
|
||||
<personality>
|
||||
@!thought://remember
|
||||
@!thought://recall
|
||||
@!thought://qt-code-analysis
|
||||
@!thought://quality-assessment
|
||||
</personality>
|
||||
<principle>
|
||||
@!execution://qt-code-optimization
|
||||
@!execution://quality-improvement
|
||||
@!execution://academic-standards
|
||||
</principle>
|
||||
<knowledge>
|
||||
@!knowledge://qt-cpp-expertise
|
||||
@!knowledge://code-quality-standards
|
||||
@!knowledge://project-architecture
|
||||
</knowledge>
|
||||
</role>
|
||||
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
||||
@ -0,0 +1,121 @@
|
||||
#ifndef INTELLIGENCEUI_H
|
||||
#define INTELLIGENCEUI_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QProcess>
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
#include <QComboBox>
|
||||
#include <QTextEdit>
|
||||
#include <QProgressBar>
|
||||
#include <QFileDialog>
|
||||
#include <QTimer>
|
||||
#include <QMediaRecorder>
|
||||
#include <QAudioRecorder>
|
||||
#include <QAudioInput>
|
||||
#include <QAudioFormat>
|
||||
#include <QUrl>
|
||||
#include <QDir>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class IntelligenceUI;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class IntelligenceUI : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
IntelligenceUI(QWidget *parent = nullptr);
|
||||
~IntelligenceUI();
|
||||
|
||||
private slots:
|
||||
// 播放音频按钮
|
||||
void on_playSelectedAudio_clicked();
|
||||
|
||||
// 杀死wsaudio进程按钮
|
||||
void on_killWSAudio_clicked();
|
||||
|
||||
// 刷新音频文件列表
|
||||
void on_refreshAudioList_clicked();
|
||||
|
||||
// 保存SSH连接设置
|
||||
void on_saveSshSettings_clicked();
|
||||
|
||||
// 上传并播放
|
||||
void on_browseButton_clicked();
|
||||
void on_uploadAndPlayButton_clicked();
|
||||
void onFileUploadFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
|
||||
// SSH进程处理
|
||||
void onSshProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void onSshProcessError(QProcess::ProcessError error);
|
||||
|
||||
// 新增录制功能相关槽函数
|
||||
void on_recordButton_clicked();
|
||||
void on_stopRecordButton_clicked();
|
||||
void on_playRecordedButton_clicked();
|
||||
|
||||
// 录制相关处理
|
||||
void onRecordingFinished();
|
||||
void onRecordingError(QMediaRecorder::Error error);
|
||||
void updateAudioLevel();
|
||||
|
||||
// 新增TTS功能相关槽函数
|
||||
void on_generateTtsButton_clicked();
|
||||
void on_playTtsButton_clicked();
|
||||
void onTtsGenerationFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
|
||||
private:
|
||||
Ui::IntelligenceUI *ui;
|
||||
QProcess *sshProcess;
|
||||
QProcess *fileTransferProcess;
|
||||
QString currentCommand;
|
||||
|
||||
// SSH连接信息
|
||||
QString m_sshHost;
|
||||
QString m_sshUser;
|
||||
QString m_sshPassword;
|
||||
|
||||
// 本地文件路径
|
||||
QString m_localAudioPath;
|
||||
|
||||
// 录制相关
|
||||
QAudioRecorder *audioRecorder;
|
||||
QAudioInput *audioInput;
|
||||
QTimer *volumeTimer;
|
||||
QString recordedFilePath;
|
||||
|
||||
// TTS相关
|
||||
QProcess *ttsProcess;
|
||||
QString ttsOutputPath;
|
||||
|
||||
// 核心方法
|
||||
void executeSSHCommand(const QString &command, const QString &description);
|
||||
//qxq:
|
||||
void killWSAudioProcess();
|
||||
void playAudioFile(const QString &audioFile);
|
||||
void refreshAudioFileList();
|
||||
void updateSshSettings();
|
||||
|
||||
// UI设置
|
||||
void setupUI();
|
||||
void updateStatus(const QString &message, bool isError = false);
|
||||
|
||||
// 录制相关私有方法
|
||||
void setupAudioRecorder();
|
||||
void updateRecordingStatus(const QString &status);
|
||||
void enableRecordingControls(bool recording);
|
||||
|
||||
// TTS相关私有方法
|
||||
void setupTTS();
|
||||
void updateTtsStatus(const QString &status);
|
||||
};
|
||||
|
||||
#endif // INTELLIGENCEUI_H
|
||||
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
||||
@ -0,0 +1,634 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>IntelligenceUI</class>
|
||||
<widget class="QMainWindow" name="IntelligenceUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>900</width>
|
||||
<height>800</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>情报传达系统 - UnitreeGo1</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QMainWindow {
|
||||
background-color: rgb(24, 33, 45);
|
||||
}
|
||||
|
||||
QPushButton {
|
||||
background-color: rgb(30, 44, 62);
|
||||
color: rgb(220, 230, 240);
|
||||
border: 2px solid rgba(82, 194, 242, 0.5);
|
||||
border-radius: 8px;
|
||||
padding: 12px 20px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
min-height: 35px;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
background-color: rgb(50, 70, 95);
|
||||
border: 2px solid rgba(82, 194, 242, 0.8);
|
||||
}
|
||||
|
||||
QPushButton:pressed {
|
||||
background-color: rgb(40, 60, 85);
|
||||
border: 2px solid rgba(82, 194, 242, 1.0);
|
||||
}
|
||||
|
||||
QLabel {
|
||||
color: rgb(220, 230, 240);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
QComboBox {
|
||||
background-color: rgb(30, 44, 62);
|
||||
color: rgb(220, 230, 240);
|
||||
border: 2px solid rgba(82, 194, 242, 0.5);
|
||||
border-radius: 5px;
|
||||
padding: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
QTextEdit {
|
||||
background-color: rgb(15, 22, 32);
|
||||
color: rgb(220, 230, 240);
|
||||
border: 2px solid rgba(82, 194, 242, 0.3);
|
||||
border-radius: 5px;
|
||||
font-family: "Courier New", monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
QProgressBar {
|
||||
border: 2px solid rgba(82, 194, 242, 0.5);
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
background-color: rgb(30, 44, 62);
|
||||
color: rgb(220, 230, 240);
|
||||
}
|
||||
|
||||
QProgressBar::chunk {
|
||||
background-color: rgba(82, 194, 242, 0.8);
|
||||
border-radius: 3px;
|
||||
}</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="titleLabel">
|
||||
<property name="text">
|
||||
<string>🔊 情报传达系统</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel {
|
||||
color: rgb(82, 194, 242);
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
padding: 20px;
|
||||
background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 rgba(82, 194, 242, 0.1),
|
||||
stop:1 rgba(45, 120, 180, 0.1));
|
||||
border: 2px solid rgba(82, 194, 242, 0.3);
|
||||
border-radius: 10px;
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="sshSettingsGroup">
|
||||
<property name="title">
|
||||
<string>SSH 连接设置</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: rgb(220, 230, 240);
|
||||
border: 1px solid rgba(82, 194, 242, 0.4);
|
||||
border-radius: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
QGroupBox::title {
|
||||
subcontrol-origin: margin;
|
||||
subcontrol-position: top center;
|
||||
padding: 0 10px;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelIp">
|
||||
<property name="text">
|
||||
<string>目标 IP:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEditIp">
|
||||
<property name="text">
|
||||
<string>192.168.123.13</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelUsername">
|
||||
<property name="text">
|
||||
<string>用户名:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEditUsername">
|
||||
<property name="text">
|
||||
<string>unitree</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelPassword">
|
||||
<property name="text">
|
||||
<string>密码:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEditPassword">
|
||||
<property name="text">
|
||||
<string>123</string>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="saveSshSettings">
|
||||
<property name="text">
|
||||
<string>保存并应用设置</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="deviceLabel">
|
||||
<property name="text">
|
||||
<string>当前目标: 192.168.123.13 (UnitreeGo1)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(160, 170, 180); font-size: 16px;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="audioSelectionLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="audioLabel">
|
||||
<property name="text">
|
||||
<string>选择音频文件:</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-size: 16px; font-weight: bold;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="audioComboBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>warning.wav</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>alert.wav</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>emergency.wav</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>notification.wav</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshAudioList">
|
||||
<property name="text">
|
||||
<string>刷新列表</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="controlButtonsLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="playSelectedAudio">
|
||||
<property name="text">
|
||||
<string>🔊 播放选定音频</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color: rgb(45, 125, 65);
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
background-color: rgb(65, 145, 85);
|
||||
}
|
||||
|
||||
QPushButton:pressed {
|
||||
background-color: rgb(55, 135, 75);
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="killWSAudio">
|
||||
<property name="text">
|
||||
<string>🔧 解除音频占用</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color: rgb(165, 85, 45);
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
background-color: rgb(185, 105, 65);
|
||||
}
|
||||
|
||||
QPushButton:pressed {
|
||||
background-color: rgb(175, 95, 55);
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="uploadAudioGroup">
|
||||
<property name="title">
|
||||
<string>自定义音频制作</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="recordLabel">
|
||||
<property name="text">
|
||||
<string>🎤 录制语音:</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-size: 14px; font-weight: bold; color: rgb(82, 194, 242);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="recordLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="recordButton">
|
||||
<property name="text">
|
||||
<string>🎤 开始录制</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color: rgb(45, 125, 65);
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
background-color: rgb(65, 145, 85);
|
||||
}
|
||||
|
||||
QPushButton:pressed {
|
||||
background-color: rgb(55, 135, 75);
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="stopRecordButton">
|
||||
<property name="text">
|
||||
<string>⏹ 停止录制</string>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color: rgb(165, 85, 45);
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
background-color: rgb(185, 105, 65);
|
||||
}
|
||||
|
||||
QPushButton:pressed {
|
||||
background-color: rgb(175, 95, 55);
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="playRecordedButton">
|
||||
<property name="text">
|
||||
<string>▶ 试听录音</string>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="recordStatusLabel">
|
||||
<property name="text">
|
||||
<string>录制状态: 就绪</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(160, 170, 180); font-size: 12px;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="volumeMeter">
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QProgressBar {
|
||||
border: 1px solid rgba(82, 194, 242, 0.5);
|
||||
border-radius: 3px;
|
||||
background-color: rgb(30, 44, 62);
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
QProgressBar::chunk {
|
||||
background-color: rgba(45, 200, 45, 0.8);
|
||||
border-radius: 2px;
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="orLabel">
|
||||
<property name="text">
|
||||
<string>或者</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(160, 170, 180); font-size: 12px; margin: 10px;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="ttsLabel">
|
||||
<property name="text">
|
||||
<string>🗣 文字转语音:</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-size: 14px; font-weight: bold; color: rgb(82, 194, 242);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="ttsTextEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>输入要转换为语音的文字内容...</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(30, 44, 62); border: 1px solid rgba(82, 194, 242, 0.3); border-radius: 3px; padding: 5px;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="ttsLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="voiceComboBox">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(30, 44, 62); border: 1px solid rgba(82, 194, 242, 0.3); border-radius: 3px; padding: 3px;</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>标准女声</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>标准男声</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>儿童声</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="generateTtsButton">
|
||||
<property name="text">
|
||||
<string>🎵 生成语音</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color: rgb(85, 125, 165);
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
background-color: rgb(105, 145, 185);
|
||||
}
|
||||
|
||||
QPushButton:pressed {
|
||||
background-color: rgb(95, 135, 175);
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="playTtsButton">
|
||||
<property name="text">
|
||||
<string>▶ 试听TTS</string>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="ttsStatusLabel">
|
||||
<property name="text">
|
||||
<string>TTS状态: 就绪</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(160, 170, 180); font-size: 12px;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="orLabel2">
|
||||
<property name="text">
|
||||
<string>或者</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(160, 170, 180); font-size: 12px; margin: 10px;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="uploadLabel">
|
||||
<property name="text">
|
||||
<string>📁 上传文件:</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-size: 14px; font-weight: bold; color: rgb(82, 194, 242);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="uploadFileLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="filePathLineEdit">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>请选择一个.wav音频文件...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="browseButton">
|
||||
<property name="text">
|
||||
<string>浏览...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="uploadAndPlayButton">
|
||||
<property name="text">
|
||||
<string>⬆️ 上传并播放</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="logLabel">
|
||||
<property name="text">
|
||||
<string>执行日志:</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-size: 16px; font-weight: bold;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="logTextEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>900</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
||||
@ -1,152 +0,0 @@
|
||||
-- CasualtySightPlus 数据库表结构
|
||||
-- 数据库: Client
|
||||
-- 创建日期: 2025-06-18
|
||||
|
||||
USE Client;
|
||||
|
||||
-- 1. UAV设备表 (无人机)
|
||||
CREATE TABLE IF NOT EXISTS uav_devices (
|
||||
id VARCHAR(50) PRIMARY KEY,
|
||||
name VARCHAR(100) NOT NULL DEFAULT 'UAV设备',
|
||||
state INT DEFAULT 0 COMMENT '设备状态: 0=离线, 1=在线, 2=工作中, 3=错误',
|
||||
ip VARCHAR(15),
|
||||
port INT,
|
||||
longitude DOUBLE,
|
||||
latitude DOUBLE,
|
||||
signal_strength INT DEFAULT 0 COMMENT '信号强度 0-100',
|
||||
last_heartbeat TIMESTAMP NULL COMMENT '最后心跳时间',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
INDEX idx_state (state),
|
||||
INDEX idx_location (longitude, latitude)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='无人机设备表';
|
||||
|
||||
-- 2. Dog机器人表 (地面机器人)
|
||||
CREATE TABLE IF NOT EXISTS dog_devices (
|
||||
id VARCHAR(50) PRIMARY KEY,
|
||||
name VARCHAR(100) NOT NULL DEFAULT '地面机器人',
|
||||
state INT DEFAULT 0 COMMENT '设备状态: 0=离线, 1=在线, 2=工作中, 3=错误',
|
||||
ip VARCHAR(15),
|
||||
port INT,
|
||||
longitude DOUBLE,
|
||||
latitude DOUBLE,
|
||||
signal_strength INT DEFAULT 0 COMMENT '信号强度 0-100',
|
||||
last_heartbeat TIMESTAMP NULL COMMENT '最后心跳时间',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
INDEX idx_state (state),
|
||||
INDEX idx_location (longitude, latitude)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='地面机器人设备表';
|
||||
|
||||
-- 3. 伤员记录表
|
||||
CREATE TABLE IF NOT EXISTS injury_records (
|
||||
id VARCHAR(50) PRIMARY KEY,
|
||||
rank INT COMMENT '伤员等级',
|
||||
longitude DOUBLE,
|
||||
latitude DOUBLE,
|
||||
flag INT DEFAULT 1 COMMENT '有效标志: 0=无效, 1=有效',
|
||||
severity INT DEFAULT 0 COMMENT '严重程度: 0=轻微, 1=中等, 2=严重, 3=危重',
|
||||
description TEXT COMMENT '伤情描述',
|
||||
discovered_by VARCHAR(50) COMMENT '发现设备ID',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
INDEX idx_flag (flag),
|
||||
INDEX idx_severity (severity),
|
||||
INDEX idx_location (longitude, latitude)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='伤员记录表';
|
||||
|
||||
-- 4. 系统配置表
|
||||
CREATE TABLE IF NOT EXISTS system_config (
|
||||
config_key VARCHAR(100) PRIMARY KEY,
|
||||
config_value TEXT,
|
||||
config_type VARCHAR(20) DEFAULT 'string' COMMENT '配置类型: string, int, float, boolean, json',
|
||||
description VARCHAR(500),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统配置表';
|
||||
|
||||
-- 5. 用户会话表
|
||||
CREATE TABLE IF NOT EXISTS user_sessions (
|
||||
session_id VARCHAR(100) PRIMARY KEY,
|
||||
user_name VARCHAR(50),
|
||||
login_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
last_activity TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
ip_address VARCHAR(45),
|
||||
user_agent TEXT,
|
||||
status INT DEFAULT 1 COMMENT '会话状态: 0=已注销, 1=活跃',
|
||||
INDEX idx_user (user_name),
|
||||
INDEX idx_status (status)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户会话表';
|
||||
|
||||
-- 6. 设备操作日志表
|
||||
CREATE TABLE IF NOT EXISTS device_operation_logs (
|
||||
log_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
device_id VARCHAR(50),
|
||||
device_type VARCHAR(20) COMMENT '设备类型: uav, dog',
|
||||
operation VARCHAR(50) COMMENT '操作类型: connect, disconnect, control, move',
|
||||
operation_result VARCHAR(20) DEFAULT 'success' COMMENT '操作结果: success, failed, timeout',
|
||||
operator VARCHAR(50) COMMENT '操作员',
|
||||
operation_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
details JSON COMMENT '操作详细信息',
|
||||
INDEX idx_device (device_id),
|
||||
INDEX idx_operation_time (operation_time),
|
||||
INDEX idx_device_type (device_type)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设备操作日志表';
|
||||
|
||||
-- 插入默认系统配置
|
||||
INSERT INTO system_config (config_key, config_value, config_type, description) VALUES
|
||||
('app.version', '2.0.0', 'string', '应用程序版本'),
|
||||
('app.theme', 'military', 'string', '默认主题'),
|
||||
('database.connection_timeout', '30000', 'int', '数据库连接超时时间(毫秒)'),
|
||||
('ui.auto_refresh_interval', '5000', 'int', '界面自动刷新间隔(毫秒)'),
|
||||
('ui.device_card_style', 'modern', 'string', '设备卡片样式'),
|
||||
('map.default_center_lat', '39.9', 'float', '地图默认中心纬度'),
|
||||
('map.default_center_lon', '116.4', 'float', '地图默认中心经度'),
|
||||
('map.default_zoom', '12', 'int', '地图默认缩放级别'),
|
||||
('device.heartbeat_interval', '10000', 'int', '设备心跳间隔(毫秒)'),
|
||||
('device.connection_timeout', '30000', 'int', '设备连接超时(毫秒)')
|
||||
ON DUPLICATE KEY UPDATE
|
||||
config_value = VALUES(config_value),
|
||||
updated_at = CURRENT_TIMESTAMP;
|
||||
|
||||
-- 为兼容现有代码,创建旧表名的视图
|
||||
CREATE OR REPLACE VIEW uavdatabase AS
|
||||
SELECT
|
||||
id,
|
||||
state,
|
||||
ip,
|
||||
port,
|
||||
longitude as lon,
|
||||
latitude as lat
|
||||
FROM uav_devices;
|
||||
|
||||
CREATE OR REPLACE VIEW dogdatabase AS
|
||||
SELECT
|
||||
id,
|
||||
state,
|
||||
ip,
|
||||
port,
|
||||
longitude as lon,
|
||||
latitude as lat
|
||||
FROM dog_devices;
|
||||
|
||||
CREATE OR REPLACE VIEW injurydatabase AS
|
||||
SELECT
|
||||
id,
|
||||
rank as injuryrank,
|
||||
longitude as lon,
|
||||
latitude as lat,
|
||||
flag
|
||||
FROM injury_records;
|
||||
|
||||
-- 显示创建的表
|
||||
SHOW TABLES;
|
||||
|
||||
-- 显示表结构概要
|
||||
SELECT
|
||||
TABLE_NAME as '表名',
|
||||
TABLE_COMMENT as '说明',
|
||||
TABLE_ROWS as '记录数'
|
||||
FROM information_schema.TABLES
|
||||
WHERE TABLE_SCHEMA = 'Client'
|
||||
ORDER BY TABLE_NAME;
|
||||
@ -1,486 +0,0 @@
|
||||
# CasualtySightPlus 项目结构重构规划
|
||||
|
||||
## 当前项目结构分析
|
||||
|
||||
### 现有目录结构
|
||||
```
|
||||
Client/
|
||||
├── include/ # 头文件目录
|
||||
│ ├── DogDatabase.h
|
||||
│ ├── InjuryAnalysisUI.h
|
||||
│ ├── InjuryDatabase.h
|
||||
│ ├── UAVDatabase.h
|
||||
│ ├── guidingui.h
|
||||
│ └── injurydisiplayui.h
|
||||
├── src/ # 源码目录
|
||||
│ ├── DogDatabase.cpp
|
||||
│ ├── InjuryAnalysisUI.cpp
|
||||
│ ├── InjuryDatabase.cpp
|
||||
│ ├── UAVDatabase.cpp
|
||||
│ ├── guidingui.cpp
|
||||
│ ├── injurydisiplayui.cpp
|
||||
│ └── main.cpp
|
||||
├── ui/ # UI表单文件
|
||||
│ ├── InjuryAnalysisUI.ui
|
||||
│ ├── guidingui.ui
|
||||
│ └── injurydisiplayui.ui
|
||||
├── res/ # 资源文件
|
||||
│ ├── html/
|
||||
│ ├── icon/
|
||||
│ ├── image/
|
||||
│ └── qml/
|
||||
├── build/ # 构建目录
|
||||
└── AudioModule/ # 音频模块
|
||||
```
|
||||
|
||||
### 现有数据库架构分析
|
||||
|
||||
#### 1. UAVDatabase (无人机数据库)
|
||||
- **连接方式**: 已使用MySQL (`QMYSQL`)
|
||||
- **表结构**: `uavdatabase` 表
|
||||
- id (VARCHAR)
|
||||
- state (INT)
|
||||
- ip (VARCHAR)
|
||||
- port (INT)
|
||||
- lon (DOUBLE)
|
||||
- lat (DOUBLE)
|
||||
- **连接信息**: 数据库名: `fly_land_database`, 用户: `root`
|
||||
|
||||
#### 2. DogDatabase (地面机器人数据库)
|
||||
- **连接方式**: 已使用MySQL (`QMYSQL`)
|
||||
- **表结构**: `dogdatabase` 表
|
||||
- id (VARCHAR)
|
||||
- state (INT)
|
||||
- ip (VARCHAR)
|
||||
- port (INT)
|
||||
- lon (DOUBLE)
|
||||
- lat (DOUBLE)
|
||||
- **单例模式**: 线程安全实现
|
||||
|
||||
#### 3. InjuryDatabase (伤员信息数据库)
|
||||
- **连接方式**: 已使用MySQL (`QMYSQL`)
|
||||
- **表结构**: `injurydatabase` 表
|
||||
- id (VARCHAR)
|
||||
- injuryrank (INT)
|
||||
- lon (DOUBLE)
|
||||
- lat (DOUBLE)
|
||||
- flag (INT)
|
||||
|
||||
## 重构后的项目结构规划
|
||||
|
||||
### 新的目录结构
|
||||
```
|
||||
Client/
|
||||
├── src/
|
||||
│ ├── core/ # 核心业务逻辑
|
||||
│ │ ├── database/ # 数据库层
|
||||
│ │ │ ├── managers/ # 数据库管理器
|
||||
│ │ │ ├── models/ # 数据模型
|
||||
│ │ │ └── connections/ # 连接管理
|
||||
│ │ ├── services/ # 业务服务层
|
||||
│ │ └── utils/ # 工具类
|
||||
│ ├── ui/ # 用户界面层
|
||||
│ │ ├── main/ # 主界面
|
||||
│ │ ├── components/ # 可复用组件
|
||||
│ │ │ ├── DeviceCard/ # 设备卡片组件
|
||||
│ │ │ ├── StatusPanel/ # 状态面板组件
|
||||
│ │ │ └── MapViewer/ # 地图显示组件
|
||||
│ │ ├── dialogs/ # 对话框
|
||||
│ │ └── widgets/ # 自定义Widget
|
||||
│ ├── resources/ # 资源文件
|
||||
│ │ ├── styles/ # 样式文件
|
||||
│ │ ├── themes/ # 主题配置
|
||||
│ │ ├── images/ # 图片资源
|
||||
│ │ ├── icons/ # 图标资源
|
||||
│ │ ├── qml/ # QML文件
|
||||
│ │ └── html/ # HTML文件
|
||||
│ └── main.cpp
|
||||
├── include/ # 公共头文件
|
||||
├── forms/ # UI表单文件 (.ui)
|
||||
├── build/ # 构建输出目录
|
||||
├── config/ # 配置文件
|
||||
├── docs/ # 项目文档
|
||||
├── tests/ # 测试文件
|
||||
└── scripts/ # 构建脚本
|
||||
```
|
||||
|
||||
### 数据库层重构规划
|
||||
|
||||
#### 1. 连接管理器 (ConnectionManager)
|
||||
```cpp
|
||||
// src/core/database/connections/ConnectionManager.h
|
||||
class ConnectionManager {
|
||||
public:
|
||||
static ConnectionManager* getInstance();
|
||||
QSqlDatabase getConnection(const QString& connectionName = "default");
|
||||
bool initialize(const DatabaseConfig& config);
|
||||
void cleanup();
|
||||
|
||||
private:
|
||||
QMap<QString, QSqlDatabase> m_connections;
|
||||
DatabaseConfig m_config;
|
||||
};
|
||||
```
|
||||
|
||||
#### 2. 数据库配置管理
|
||||
```cpp
|
||||
// src/core/database/DatabaseConfig.h
|
||||
struct DatabaseConfig {
|
||||
QString host = "localhost";
|
||||
int port = 3306;
|
||||
QString database = "fly_land_database";
|
||||
QString username = "root";
|
||||
QString password;
|
||||
int maxConnections = 10;
|
||||
int connectionTimeout = 30000;
|
||||
};
|
||||
```
|
||||
|
||||
#### 3. 基础数据访问对象 (BaseDAO)
|
||||
```cpp
|
||||
// src/core/database/BaseDAO.h
|
||||
template<typename T>
|
||||
class BaseDAO {
|
||||
public:
|
||||
virtual bool insert(const T& entity) = 0;
|
||||
virtual bool update(const T& entity) = 0;
|
||||
virtual bool deleteById(const QString& id) = 0;
|
||||
virtual T findById(const QString& id) = 0;
|
||||
virtual QList<T> findAll() = 0;
|
||||
virtual QList<T> findByCondition(const QString& condition) = 0;
|
||||
|
||||
protected:
|
||||
QSqlDatabase getDatabase();
|
||||
bool executeQuery(const QString& sql, const QVariantList& params = {});
|
||||
};
|
||||
```
|
||||
|
||||
#### 4. 改进的数据模型
|
||||
```cpp
|
||||
// src/core/database/models/UAVModel.h
|
||||
struct UAVModel {
|
||||
QString id;
|
||||
QString name;
|
||||
int state;
|
||||
QString ip;
|
||||
int port;
|
||||
double longitude;
|
||||
double latitude;
|
||||
int signalStrength;
|
||||
QDateTime lastHeartbeat;
|
||||
QDateTime createdAt;
|
||||
QDateTime updatedAt;
|
||||
|
||||
// 序列化支持
|
||||
QJsonObject toJson() const;
|
||||
static UAVModel fromJson(const QJsonObject& json);
|
||||
};
|
||||
```
|
||||
|
||||
### UI组件重构规划
|
||||
|
||||
#### 1. 设备卡片组件 (DeviceCard)
|
||||
```cpp
|
||||
// src/ui/components/DeviceCard/DeviceCard.h
|
||||
class DeviceCard : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DeviceCard(QWidget* parent = nullptr);
|
||||
void setDevice(const DeviceInfo& device);
|
||||
void updateStatus(DeviceStatus status);
|
||||
void setCardStyle(CardStyle style);
|
||||
|
||||
signals:
|
||||
void deviceSelected(const QString& deviceId);
|
||||
void controlRequested(const QString& deviceId);
|
||||
void locationRequested(const QString& deviceId);
|
||||
|
||||
private:
|
||||
void setupUI();
|
||||
void updateStatusIndicator();
|
||||
void applyCardStyle();
|
||||
|
||||
private:
|
||||
DeviceInfo m_device;
|
||||
QLabel* m_nameLabel;
|
||||
QLabel* m_statusLabel;
|
||||
QLabel* m_ipLabel;
|
||||
QLabel* m_locationLabel;
|
||||
QProgressBar* m_signalBar;
|
||||
QPushButton* m_detailsBtn;
|
||||
QPushButton* m_controlBtn;
|
||||
QPushButton* m_locateBtn;
|
||||
};
|
||||
```
|
||||
|
||||
#### 2. 状态面板组件 (StatusPanel)
|
||||
```cpp
|
||||
// src/ui/components/StatusPanel/StatusPanel.h
|
||||
class StatusPanel : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit StatusPanel(QWidget* parent = nullptr);
|
||||
void addStatusItem(const QString& name, const QVariant& value);
|
||||
void updateStatusItem(const QString& name, const QVariant& value);
|
||||
void setUpdateInterval(int msec);
|
||||
|
||||
private slots:
|
||||
void refreshStatus();
|
||||
|
||||
private:
|
||||
QTimer* m_refreshTimer;
|
||||
QMap<QString, QLabel*> m_statusLabels;
|
||||
QVBoxLayout* m_layout;
|
||||
};
|
||||
```
|
||||
|
||||
#### 3. 主界面重构 (MainWindow)
|
||||
```cpp
|
||||
// src/ui/main/MainWindow.h
|
||||
class MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MainWindow(QWidget* parent = nullptr);
|
||||
|
||||
private slots:
|
||||
void onDeviceSelected(const QString& deviceId);
|
||||
void onStatusChanged(const QString& deviceId, DeviceStatus status);
|
||||
void refreshDeviceList();
|
||||
|
||||
private:
|
||||
void setupUI();
|
||||
void setupMenus();
|
||||
void setupStatusBar();
|
||||
void setupDockWidgets();
|
||||
void connectSignals();
|
||||
|
||||
private:
|
||||
DeviceListWidget* m_deviceList;
|
||||
MapViewerWidget* m_mapViewer;
|
||||
StatusPanel* m_statusPanel;
|
||||
QDockWidget* m_deviceDock;
|
||||
QDockWidget* m_statusDock;
|
||||
};
|
||||
```
|
||||
|
||||
### 样式系统规划
|
||||
|
||||
#### 1. 主题管理器 (ThemeManager)
|
||||
```cpp
|
||||
// src/core/ui/ThemeManager.h
|
||||
class ThemeManager : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Theme { Light, Dark, Military };
|
||||
|
||||
static ThemeManager* getInstance();
|
||||
void setTheme(Theme theme);
|
||||
Theme currentTheme() const;
|
||||
QString getStyleSheet(const QString& component) const;
|
||||
|
||||
signals:
|
||||
void themeChanged(Theme theme);
|
||||
|
||||
private:
|
||||
void loadTheme(Theme theme);
|
||||
QMap<QString, QString> m_styleSheets;
|
||||
Theme m_currentTheme;
|
||||
};
|
||||
```
|
||||
|
||||
#### 2. 样式配置文件结构
|
||||
```
|
||||
src/resources/styles/
|
||||
├── themes/
|
||||
│ ├── dark.qss # 深色主题
|
||||
│ ├── light.qss # 浅色主题
|
||||
│ └── military.qss # 军事主题
|
||||
├── components/
|
||||
│ ├── device_card.qss # 设备卡片样式
|
||||
│ ├── status_panel.qss # 状态面板样式
|
||||
│ ├── main_window.qss # 主窗口样式
|
||||
│ └── buttons.qss # 按钮样式
|
||||
└── common/
|
||||
├── colors.qss # 颜色定义
|
||||
├── fonts.qss # 字体定义
|
||||
└── animations.qss # 动画效果
|
||||
```
|
||||
|
||||
## 配置文件管理
|
||||
|
||||
### 1. 应用配置 (AppConfig)
|
||||
```json
|
||||
// config/app.json
|
||||
{
|
||||
"application": {
|
||||
"name": "CasualtySightPlus",
|
||||
"version": "2.0.0",
|
||||
"theme": "military",
|
||||
"language": "zh_CN"
|
||||
},
|
||||
"database": {
|
||||
"host": "localhost",
|
||||
"port": 3306,
|
||||
"name": "fly_land_database",
|
||||
"username": "root",
|
||||
"pool_size": 10,
|
||||
"connection_timeout": 30000
|
||||
},
|
||||
"ui": {
|
||||
"window_size": [1400, 900],
|
||||
"device_card_style": "modern",
|
||||
"auto_refresh_interval": 5000,
|
||||
"animation_enabled": true
|
||||
},
|
||||
"map": {
|
||||
"default_center": [39.9, 116.4],
|
||||
"default_zoom": 12,
|
||||
"tile_server": "amap"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 设备模板配置
|
||||
```json
|
||||
// config/device_templates.json
|
||||
{
|
||||
"uav_templates": [
|
||||
{
|
||||
"name": "侦察机模板",
|
||||
"type": "reconnaissance",
|
||||
"default_settings": {
|
||||
"max_altitude": 500,
|
||||
"max_speed": 50,
|
||||
"camera_resolution": "1080p"
|
||||
}
|
||||
}
|
||||
],
|
||||
"robot_templates": [
|
||||
{
|
||||
"name": "巡逻机器人模板",
|
||||
"type": "patrol",
|
||||
"default_settings": {
|
||||
"max_speed": 5,
|
||||
"sensor_range": 50,
|
||||
"battery_capacity": 8000
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 构建系统改进
|
||||
|
||||
### 1. 更新的 .pro 文件结构
|
||||
```pro
|
||||
# CasualtySightPlus.pro
|
||||
QT += core gui widgets quickwidgets positioning
|
||||
QT += multimedia multimediawidgets
|
||||
QT += webenginewidgets webchannel
|
||||
QT += sql charts network
|
||||
|
||||
CONFIG += c++17
|
||||
|
||||
# 版本信息
|
||||
VERSION = 2.0.0
|
||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||
|
||||
# 包含路径
|
||||
INCLUDEPATH += \
|
||||
include \
|
||||
src/core \
|
||||
src/ui \
|
||||
AudioModule
|
||||
|
||||
# 构建目录
|
||||
OBJECTS_DIR = build/obj
|
||||
MOC_DIR = build/moc
|
||||
UI_DIR = build/ui
|
||||
RCC_DIR = build/rcc
|
||||
DESTDIR = build/bin
|
||||
|
||||
# 预编译头文件
|
||||
PRECOMPILED_HEADER = src/core/pch.h
|
||||
|
||||
# 源文件组织
|
||||
include(src/core/core.pri)
|
||||
include(src/ui/ui.pri)
|
||||
include(AudioModule/audio.pri)
|
||||
|
||||
# 资源文件
|
||||
RESOURCES += \
|
||||
resources/resources.qrc \
|
||||
resources/styles/styles.qrc \
|
||||
resources/themes/themes.qrc
|
||||
|
||||
# 安装规则
|
||||
target.path = /opt/CasualtySightPlus/bin
|
||||
config.files = config/*
|
||||
config.path = /opt/CasualtySightPlus/config
|
||||
INSTALLS += target config
|
||||
```
|
||||
|
||||
### 2. 模块化 .pri 文件
|
||||
```pro
|
||||
# src/core/core.pri
|
||||
HEADERS += \
|
||||
$$PWD/database/ConnectionManager.h \
|
||||
$$PWD/database/BaseDAO.h \
|
||||
$$PWD/database/models/UAVModel.h \
|
||||
$$PWD/database/models/DogModel.h \
|
||||
$$PWD/database/models/InjuryModel.h \
|
||||
$$PWD/services/DeviceService.h \
|
||||
$$PWD/utils/Logger.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/database/ConnectionManager.cpp \
|
||||
$$PWD/database/BaseDAO.cpp \
|
||||
$$PWD/database/models/UAVModel.cpp \
|
||||
$$PWD/database/models/DogModel.cpp \
|
||||
$$PWD/database/models/InjuryModel.cpp \
|
||||
$$PWD/services/DeviceService.cpp \
|
||||
$$PWD/utils/Logger.cpp
|
||||
```
|
||||
|
||||
## 迁移策略
|
||||
|
||||
### 阶段1: 准备工作
|
||||
1. 创建新的目录结构
|
||||
2. 设置构建环境
|
||||
3. 创建基础框架类
|
||||
|
||||
### 阶段2: 数据库层迁移
|
||||
1. 实现新的数据库连接管理
|
||||
2. 迁移现有数据模型
|
||||
3. 创建改进的DAO类
|
||||
4. 测试数据库操作
|
||||
|
||||
### 阶段3: UI组件重构
|
||||
1. 创建新的设备卡片组件
|
||||
2. 重构主界面布局
|
||||
3. 实现样式主题系统
|
||||
4. 迁移现有功能
|
||||
|
||||
### 阶段4: 集成和测试
|
||||
1. 集成所有模块
|
||||
2. 全面功能测试
|
||||
3. 性能优化
|
||||
4. 文档更新
|
||||
|
||||
## 风险评估
|
||||
|
||||
### 技术风险
|
||||
- **数据库迁移风险**: 中等 - 现有数据库结构已经使用MySQL
|
||||
- **UI兼容性风险**: 低 - 使用标准Qt组件
|
||||
- **性能风险**: 低 - 改进的架构应该提升性能
|
||||
|
||||
### 时间风险
|
||||
- **开发周期**: 预计4-5周
|
||||
- **测试时间**: 额外1周
|
||||
- **文档编写**: 额外几天
|
||||
|
||||
### 缓解策略
|
||||
1. 分阶段实施,确保每个阶段都有可工作的版本
|
||||
2. 保持现有数据库结构兼容性
|
||||
3. 充分的单元测试和集成测试
|
||||
4. 详细的代码审查和文档
|
||||
@ -1,682 +0,0 @@
|
||||
// RightFunctionPanel.h
|
||||
#ifndef RIGHTFUNCTIONPANEL_H
|
||||
#define RIGHTFUNCTIONPANEL_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QGridLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QFrame>
|
||||
#include <QProgressBar>
|
||||
#include <QSlider>
|
||||
|
||||
class ModuleCard : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ModuleCard(const QString &title, const QString &icon, QWidget *parent = nullptr);
|
||||
void addContent(QWidget *content);
|
||||
|
||||
private:
|
||||
QVBoxLayout *m_contentLayout;
|
||||
QLabel *m_titleLabel;
|
||||
};
|
||||
|
||||
class DeviceCard : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DeviceCard(const QString &name, const QString &iconPath, QWidget *parent = nullptr);
|
||||
void setStatus(const QString &status, const QColor &color);
|
||||
void setActive(bool active);
|
||||
|
||||
signals:
|
||||
void deviceSelected(const QString &deviceName);
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private:
|
||||
QString m_deviceName;
|
||||
QLabel *m_iconLabel;
|
||||
QLabel *m_nameLabel;
|
||||
QLabel *m_statusLabel;
|
||||
bool m_isActive = false;
|
||||
};
|
||||
|
||||
class RightFunctionPanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RightFunctionPanel(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
// 战场探索信号
|
||||
void startMapping();
|
||||
void stopMapping();
|
||||
void startNavigation();
|
||||
void stopNavigation();
|
||||
void startPhotoTransmission();
|
||||
void stopPhotoTransmission();
|
||||
void startPersonRecognition();
|
||||
void stopPersonRecognition();
|
||||
|
||||
// 情报传输信号
|
||||
void startVoiceCall();
|
||||
void endVoiceCall();
|
||||
void muteCall(bool muted);
|
||||
void setCallVolume(int volume);
|
||||
|
||||
// 敌情统计信号
|
||||
void refreshEnemyStats();
|
||||
void exportReport();
|
||||
void requestAIAnalysis();
|
||||
|
||||
public slots:
|
||||
void updateEnemyStats(int totalEnemies, const QString &threatLevel);
|
||||
void updateDeviceStatus(const QString &deviceName, bool online, int battery);
|
||||
|
||||
private slots:
|
||||
void onDeviceSelected(const QString &deviceName);
|
||||
void onMappingToggle();
|
||||
void onNavigationToggle();
|
||||
void onPhotoTransmissionToggle();
|
||||
void onPersonRecognitionToggle();
|
||||
void onVoiceCallToggle();
|
||||
void onRefreshStats();
|
||||
void onAIAnalysis();
|
||||
|
||||
private:
|
||||
void setupUI();
|
||||
void setupBattlefieldExplorationModule();
|
||||
void setupIntelligenceModule();
|
||||
void setupEnemyStatsModule();
|
||||
void applyStyles();
|
||||
|
||||
// UI组件
|
||||
QVBoxLayout *m_mainLayout;
|
||||
|
||||
// 战场探索模块
|
||||
ModuleCard *m_explorationCard;
|
||||
DeviceCard *m_robotDogCard;
|
||||
DeviceCard *m_droneCard;
|
||||
QPushButton *m_mappingBtn;
|
||||
QPushButton *m_navigationBtn;
|
||||
QPushButton *m_photoBtn;
|
||||
QPushButton *m_recognitionBtn;
|
||||
QString m_selectedDevice;
|
||||
|
||||
// 情报传输模块
|
||||
ModuleCard *m_intelligenceCard;
|
||||
QPushButton *m_voiceCallBtn;
|
||||
QPushButton *m_muteBtn;
|
||||
QSlider *m_volumeSlider;
|
||||
QLabel *m_callStatusLabel;
|
||||
bool m_isInCall = false;
|
||||
|
||||
// 敌情统计模块
|
||||
ModuleCard *m_statsCard;
|
||||
QLabel *m_totalEnemiesLabel;
|
||||
QLabel *m_threatLevelLabel;
|
||||
QPushButton *m_refreshBtn;
|
||||
QPushButton *m_aiAnalysisBtn;
|
||||
QPushButton *m_exportBtn;
|
||||
};
|
||||
|
||||
#endif // RIGHTFUNCTIONPANEL_H
|
||||
|
||||
// RightFunctionPanel.cpp
|
||||
#include "RightFunctionPanel.h"
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
|
||||
// ModuleCard实现
|
||||
ModuleCard::ModuleCard(const QString &title, const QString &icon, QWidget *parent)
|
||||
: QFrame(parent)
|
||||
{
|
||||
setObjectName("ModuleCard");
|
||||
setFrameStyle(QFrame::StyledPanel);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setSpacing(12);
|
||||
layout->setContentsMargins(12, 12, 12, 12);
|
||||
|
||||
// 标题栏
|
||||
QHBoxLayout *headerLayout = new QHBoxLayout();
|
||||
QLabel *iconLabel = new QLabel();
|
||||
iconLabel->setObjectName("ModuleIcon");
|
||||
iconLabel->setText(icon); // 使用Unicode图标或设置图片
|
||||
iconLabel->setFixedSize(20, 20);
|
||||
|
||||
m_titleLabel = new QLabel(title);
|
||||
m_titleLabel->setObjectName("ModuleTitle");
|
||||
|
||||
headerLayout->addWidget(iconLabel);
|
||||
headerLayout->addWidget(m_titleLabel);
|
||||
headerLayout->addStretch();
|
||||
|
||||
layout->addLayout(headerLayout);
|
||||
|
||||
// 内容区域
|
||||
m_contentLayout = new QVBoxLayout();
|
||||
m_contentLayout->setSpacing(8);
|
||||
layout->addLayout(m_contentLayout);
|
||||
}
|
||||
|
||||
void ModuleCard::addContent(QWidget *content)
|
||||
{
|
||||
m_contentLayout->addWidget(content);
|
||||
}
|
||||
|
||||
// DeviceCard实现
|
||||
DeviceCard::DeviceCard(const QString &name, const QString &iconPath, QWidget *parent)
|
||||
: QFrame(parent), m_deviceName(name)
|
||||
{
|
||||
setObjectName("DeviceCard");
|
||||
setFrameStyle(QFrame::StyledPanel);
|
||||
setCursor(Qt::PointingHandCursor);
|
||||
setFixedHeight(80);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setAlignment(Qt::AlignCenter);
|
||||
layout->setSpacing(4);
|
||||
|
||||
m_iconLabel = new QLabel();
|
||||
m_iconLabel->setObjectName("DeviceIcon");
|
||||
m_iconLabel->setFixedSize(32, 32);
|
||||
m_iconLabel->setAlignment(Qt::AlignCenter);
|
||||
// 设置图标,这里用文字代替
|
||||
m_iconLabel->setText(name.contains("机器狗") ? "🐕" : "🚁");
|
||||
|
||||
m_nameLabel = new QLabel(name);
|
||||
m_nameLabel->setObjectName("DeviceName");
|
||||
m_nameLabel->setAlignment(Qt::AlignCenter);
|
||||
|
||||
m_statusLabel = new QLabel("离线");
|
||||
m_statusLabel->setObjectName("DeviceStatus");
|
||||
m_statusLabel->setAlignment(Qt::AlignCenter);
|
||||
|
||||
layout->addWidget(m_iconLabel);
|
||||
layout->addWidget(m_nameLabel);
|
||||
layout->addWidget(m_statusLabel);
|
||||
}
|
||||
|
||||
void DeviceCard::setStatus(const QString &status, const QColor &color)
|
||||
{
|
||||
m_statusLabel->setText(status);
|
||||
m_statusLabel->setStyleSheet(QString("color: %1;").arg(color.name()));
|
||||
}
|
||||
|
||||
void DeviceCard::setActive(bool active)
|
||||
{
|
||||
m_isActive = active;
|
||||
update();
|
||||
}
|
||||
|
||||
void DeviceCard::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
emit deviceSelected(m_deviceName);
|
||||
}
|
||||
QFrame::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void DeviceCard::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QFrame::paintEvent(event);
|
||||
|
||||
if (m_isActive) {
|
||||
QPainter painter(this);
|
||||
painter.setPen(QPen(QColor("#2E5D31"), 2));
|
||||
painter.drawRect(rect().adjusted(1, 1, -1, -1));
|
||||
}
|
||||
}
|
||||
|
||||
// RightFunctionPanel实现
|
||||
RightFunctionPanel::RightFunctionPanel(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
setupUI();
|
||||
applyStyles();
|
||||
}
|
||||
|
||||
void RightFunctionPanel::setupUI()
|
||||
{
|
||||
m_mainLayout = new QVBoxLayout(this);
|
||||
m_mainLayout->setSpacing(12);
|
||||
m_mainLayout->setContentsMargins(16, 16, 16, 16);
|
||||
|
||||
// 面板标题
|
||||
QLabel *titleLabel = new QLabel("功能面板");
|
||||
titleLabel->setObjectName("PanelTitle");
|
||||
titleLabel->setAlignment(Qt::AlignCenter);
|
||||
m_mainLayout->addWidget(titleLabel);
|
||||
|
||||
setupBattlefieldExplorationModule();
|
||||
setupIntelligenceModule();
|
||||
setupEnemyStatsModule();
|
||||
|
||||
m_mainLayout->addStretch();
|
||||
}
|
||||
|
||||
void RightFunctionPanel::setupBattlefieldExplorationModule()
|
||||
{
|
||||
m_explorationCard = new ModuleCard("战场探索", "🔍", this);
|
||||
|
||||
// 设备选择
|
||||
QHBoxLayout *deviceLayout = new QHBoxLayout();
|
||||
m_robotDogCard = new DeviceCard("机器狗", "robot_dog.png", this);
|
||||
m_droneCard = new DeviceCard("无人机", "drone.png", this);
|
||||
|
||||
connect(m_robotDogCard, &DeviceCard::deviceSelected, this, &RightFunctionPanel::onDeviceSelected);
|
||||
connect(m_droneCard, &DeviceCard::deviceSelected, this, &RightFunctionPanel::onDeviceSelected);
|
||||
|
||||
deviceLayout->addWidget(m_robotDogCard);
|
||||
deviceLayout->addWidget(m_droneCard);
|
||||
|
||||
QWidget *deviceWidget = new QWidget();
|
||||
deviceWidget->setLayout(deviceLayout);
|
||||
m_explorationCard->addContent(deviceWidget);
|
||||
|
||||
// 功能按钮
|
||||
QGridLayout *buttonLayout = new QGridLayout();
|
||||
m_mappingBtn = new QPushButton("自主建图");
|
||||
m_navigationBtn = new QPushButton("导航避障");
|
||||
m_photoBtn = new QPushButton("照片传输");
|
||||
m_recognitionBtn = new QPushButton("人物识别");
|
||||
|
||||
// 设置按钮样式类名
|
||||
m_mappingBtn->setObjectName("FunctionBtn");
|
||||
m_navigationBtn->setObjectName("FunctionBtn");
|
||||
m_photoBtn->setObjectName("FunctionBtn");
|
||||
m_recognitionBtn->setObjectName("FunctionBtn");
|
||||
|
||||
buttonLayout->addWidget(m_mappingBtn, 0, 0);
|
||||
buttonLayout->addWidget(m_navigationBtn, 0, 1);
|
||||
buttonLayout->addWidget(m_photoBtn, 1, 0);
|
||||
buttonLayout->addWidget(m_recognitionBtn, 1, 1);
|
||||
|
||||
connect(m_mappingBtn, &QPushButton::clicked, this, &RightFunctionPanel::onMappingToggle);
|
||||
connect(m_navigationBtn, &QPushButton::clicked, this, &RightFunctionPanel::onNavigationToggle);
|
||||
connect(m_photoBtn, &QPushButton::clicked, this, &RightFunctionPanel::onPhotoTransmissionToggle);
|
||||
connect(m_recognitionBtn, &QPushButton::clicked, this, &RightFunctionPanel::onPersonRecognitionToggle);
|
||||
|
||||
QWidget *buttonWidget = new QWidget();
|
||||
buttonWidget->setLayout(buttonLayout);
|
||||
m_explorationCard->addContent(buttonWidget);
|
||||
|
||||
m_mainLayout->addWidget(m_explorationCard);
|
||||
}
|
||||
|
||||
void RightFunctionPanel::setupIntelligenceModule()
|
||||
{
|
||||
m_intelligenceCard = new ModuleCard("情报传输", "📡", this);
|
||||
|
||||
// 通话控制
|
||||
QHBoxLayout *callLayout = new QHBoxLayout();
|
||||
m_voiceCallBtn = new QPushButton("开始通话");
|
||||
m_muteBtn = new QPushButton("静音");
|
||||
m_voiceCallBtn->setObjectName("FunctionBtn");
|
||||
m_muteBtn->setObjectName("FunctionBtn");
|
||||
m_muteBtn->setEnabled(false);
|
||||
|
||||
callLayout->addWidget(m_voiceCallBtn);
|
||||
callLayout->addWidget(m_muteBtn);
|
||||
|
||||
connect(m_voiceCallBtn, &QPushButton::clicked, this, &RightFunctionPanel::onVoiceCallToggle);
|
||||
|
||||
QWidget *callWidget = new QWidget();
|
||||
callWidget->setLayout(callLayout);
|
||||
m_intelligenceCard->addContent(callWidget);
|
||||
|
||||
// 音量控制
|
||||
QHBoxLayout *volumeLayout = new QHBoxLayout();
|
||||
QLabel *volumeLabel = new QLabel("音量:");
|
||||
m_volumeSlider = new QSlider(Qt::Horizontal);
|
||||
m_volumeSlider->setRange(0, 100);
|
||||
m_volumeSlider->setValue(70);
|
||||
|
||||
volumeLayout->addWidget(volumeLabel);
|
||||
volumeLayout->addWidget(m_volumeSlider);
|
||||
|
||||
QWidget *volumeWidget = new QWidget();
|
||||
volumeWidget->setLayout(volumeLayout);
|
||||
m_intelligenceCard->addContent(volumeWidget);
|
||||
|
||||
// 通话状态
|
||||
m_callStatusLabel = new QLabel("未连接");
|
||||
m_callStatusLabel->setObjectName("CallStatus");
|
||||
m_intelligenceCard->addContent(m_callStatusLabel);
|
||||
|
||||
m_mainLayout->addWidget(m_intelligenceCard);
|
||||
}
|
||||
|
||||
void RightFunctionPanel::setupEnemyStatsModule()
|
||||
{
|
||||
m_statsCard = new ModuleCard("敌情统计", "📊", this);
|
||||
|
||||
// 统计信息
|
||||
QVBoxLayout *statsLayout = new QVBoxLayout();
|
||||
|
||||
m_totalEnemiesLabel = new QLabel("已发现目标: 0");
|
||||
m_threatLevelLabel = new QLabel("威胁等级: 无");
|
||||
m_totalEnemiesLabel->setObjectName("StatLabel");
|
||||
m_threatLevelLabel->setObjectName("StatLabel");
|
||||
|
||||
statsLayout->addWidget(m_totalEnemiesLabel);
|
||||
statsLayout->addWidget(m_threatLevelLabel);
|
||||
|
||||
QWidget *statsWidget = new QWidget();
|
||||
statsWidget->setLayout(statsLayout);
|
||||
m_statsCard->addContent(statsWidget);
|
||||
|
||||
// 操作按钮
|
||||
QHBoxLayout *statsButtonLayout = new QHBoxLayout();
|
||||
m_refreshBtn = new QPushButton("刷新");
|
||||
m_aiAnalysisBtn = new QPushButton("AI分析");
|
||||
m_exportBtn = new QPushButton("导出报告");
|
||||
|
||||
m_refreshBtn->setObjectName("FunctionBtn");
|
||||
m_aiAnalysisBtn->setObjectName("FunctionBtn");
|
||||
m_exportBtn->setObjectName("FunctionBtn");
|
||||
|
||||
statsButtonLayout->addWidget(m_refreshBtn);
|
||||
statsButtonLayout->addWidget(m_aiAnalysisBtn);
|
||||
|
||||
connect(m_refreshBtn, &QPushButton::clicked, this, &RightFunctionPanel::onRefreshStats);
|
||||
connect(m_aiAnalysisBtn, &QPushButton::clicked, this, &RightFunctionPanel::onAIAnalysis);
|
||||
|
||||
QWidget *statsButtonWidget = new QWidget();
|
||||
statsButtonWidget->setLayout(statsButtonLayout);
|
||||
m_statsCard->addContent(statsButtonWidget);
|
||||
|
||||
// 导出按钮单独一行
|
||||
m_statsCard->addContent(m_exportBtn);
|
||||
|
||||
m_mainLayout->addWidget(m_statsCard);
|
||||
}
|
||||
|
||||
void RightFunctionPanel::applyStyles()
|
||||
{
|
||||
QString styles = R"(
|
||||
QWidget {
|
||||
font-family: "Microsoft YaHei", "SimHei", sans-serif;
|
||||
}
|
||||
|
||||
RightFunctionPanel {
|
||||
background-color: #2A3F47;
|
||||
border-left: 2px solid #546E7A;
|
||||
}
|
||||
|
||||
#PanelTitle {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
border-bottom: 1px solid #546E7A;
|
||||
padding-bottom: 8px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
#ModuleCard {
|
||||
background-color: #354A54;
|
||||
border: 1px solid #546E7A;
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
#ModuleCard:hover {
|
||||
border-color: #2E5D31;
|
||||
background-color: #4A6572;
|
||||
}
|
||||
|
||||
#ModuleTitle {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
#ModuleIcon {
|
||||
font-size: 16px;
|
||||
color: #2E5D31;
|
||||
}
|
||||
|
||||
#DeviceCard {
|
||||
background-color: #3D525E;
|
||||
border: 1px solid #546E7A;
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#DeviceCard:hover {
|
||||
background-color: #4A6572;
|
||||
border-color: #2E5D31;
|
||||
}
|
||||
|
||||
#DeviceName {
|
||||
font-size: 12px;
|
||||
color: #FFFFFF;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
#DeviceStatus {
|
||||
font-size: 10px;
|
||||
color: #78909C;
|
||||
}
|
||||
|
||||
#FunctionBtn {
|
||||
background-color: #2E5D31;
|
||||
color: #FFFFFF;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
padding: 8px 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
#FunctionBtn:hover {
|
||||
background-color: #245429;
|
||||
}
|
||||
|
||||
#FunctionBtn:pressed {
|
||||
background-color: #1a3d1d;
|
||||
}
|
||||
|
||||
#FunctionBtn:disabled {
|
||||
background-color: #78909C;
|
||||
}
|
||||
|
||||
#StatLabel {
|
||||
font-size: 12px;
|
||||
color: #B0BEC5;
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
#CallStatus {
|
||||
font-size: 11px;
|
||||
color: #78909C;
|
||||
font-style: italic;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
QSlider::groove:horizontal {
|
||||
border: 1px solid #546E7A;
|
||||
height: 4px;
|
||||
background: #3D525E;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal {
|
||||
background: #2E5D31;
|
||||
border: 1px solid #546E7A;
|
||||
width: 12px;
|
||||
margin: -4px 0;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal:hover {
|
||||
background: #245429;
|
||||
}
|
||||
)";
|
||||
|
||||
setStyleSheet(styles);
|
||||
}
|
||||
|
||||
// 槽函数实现
|
||||
void RightFunctionPanel::onDeviceSelected(const QString &deviceName)
|
||||
{
|
||||
m_selectedDevice = deviceName;
|
||||
|
||||
// 更新设备选择状态
|
||||
m_robotDogCard->setActive(deviceName.contains("机器狗"));
|
||||
m_droneCard->setActive(deviceName.contains("无人机"));
|
||||
|
||||
// 根据设备类型启用/禁用相应按钮
|
||||
bool isRobotDog = deviceName.contains("机器狗");
|
||||
m_mappingBtn->setEnabled(isRobotDog);
|
||||
m_navigationBtn->setEnabled(isRobotDog);
|
||||
m_photoBtn->setEnabled(!isRobotDog);
|
||||
m_recognitionBtn->setEnabled(!isRobotDog);
|
||||
}
|
||||
|
||||
void RightFunctionPanel::onMappingToggle()
|
||||
{
|
||||
static bool isMappingActive = false;
|
||||
isMappingActive = !isMappingActive;
|
||||
|
||||
m_mappingBtn->setText(isMappingActive ? "停止建图" : "自主建图");
|
||||
|
||||
if (isMappingActive) {
|
||||
emit startMapping();
|
||||
} else {
|
||||
emit stopMapping();
|
||||
}
|
||||
}
|
||||
|
||||
void RightFunctionPanel::onNavigationToggle()
|
||||
{
|
||||
static bool isNavigationActive = false;
|
||||
isNavigationActive = !isNavigationActive;
|
||||
|
||||
m_navigationBtn->setText(isNavigationActive ? "停止导航" : "导航避障");
|
||||
|
||||
if (isNavigationActive) {
|
||||
emit startNavigation();
|
||||
} else {
|
||||
emit stopNavigation();
|
||||
}
|
||||
}
|
||||
|
||||
void RightFunctionPanel::onPhotoTransmissionToggle()
|
||||
{
|
||||
static bool isTransmissionActive = false;
|
||||
isTransmissionActive = !isTransmissionActive;
|
||||
|
||||
m_photoBtn->setText(isTransmissionActive ? "停止传输" : "照片传输");
|
||||
|
||||
if (isTransmissionActive) {
|
||||
emit startPhotoTransmission();
|
||||
} else {
|
||||
emit stopPhotoTransmission();
|
||||
}
|
||||
}
|
||||
|
||||
void RightFunctionPanel::onPersonRecognitionToggle()
|
||||
{
|
||||
static bool isRecognitionActive = false;
|
||||
isRecognitionActive = !isRecognitionActive;
|
||||
|
||||
m_recognitionBtn->setText(isRecognitionActive ? "停止识别" : "人物识别");
|
||||
|
||||
if (isRecognitionActive) {
|
||||
emit startPersonRecognition();
|
||||
} else {
|
||||
emit stopPersonRecognition();
|
||||
}
|
||||
}
|
||||
|
||||
void RightFunctionPanel::onVoiceCallToggle()
|
||||
{
|
||||
m_isInCall = !m_isInCall;
|
||||
|
||||
m_voiceCallBtn->setText(m_isInCall ? "结束通话" : "开始通话");
|
||||
m_muteBtn->setEnabled(m_isInCall);
|
||||
m_callStatusLabel->setText(m_isInCall ? "通话中..." : "未连接");
|
||||
|
||||
if (m_isInCall) {
|
||||
emit startVoiceCall();
|
||||
} else {
|
||||
emit endVoiceCall();
|
||||
}
|
||||
}
|
||||
|
||||
void RightFunctionPanel::onRefreshStats()
|
||||
{
|
||||
emit refreshEnemyStats();
|
||||
|
||||
// 模拟刷新效果
|
||||
m_refreshBtn->setText("刷新中...");
|
||||
m_refreshBtn->setEnabled(false);
|
||||
|
||||
QTimer::singleShot(2000, [this]() {
|
||||
m_refreshBtn->setText("刷新");
|
||||
m_refreshBtn->setEnabled(true);
|
||||
});
|
||||
}
|
||||
|
||||
void RightFunctionPanel::onAIAnalysis()
|
||||
{
|
||||
emit requestAIAnalysis();
|
||||
|
||||
// 显示分析状态
|
||||
m_aiAnalysisBtn->setText("分析中...");
|
||||
m_aiAnalysisBtn->setEnabled(false);
|
||||
|
||||
QTimer::singleShot(3000, [this]() {
|
||||
m_aiAnalysisBtn->setText("AI分析");
|
||||
m_aiAnalysisBtn->setEnabled(true);
|
||||
});
|
||||
}
|
||||
|
||||
void RightFunctionPanel::updateEnemyStats(int totalEnemies, const QString &threatLevel)
|
||||
{
|
||||
m_totalEnemiesLabel->setText(QString("已发现目标: %1").arg(totalEnemies));
|
||||
m_threatLevelLabel->setText(QString("威胁等级: %1").arg(threatLevel));
|
||||
|
||||
// 根据威胁等级设置颜色
|
||||
if (threatLevel == "高") {
|
||||
m_threatLevelLabel->setStyleSheet("color: #DC143C;");
|
||||
} else if (threatLevel == "中") {
|
||||
m_threatLevelLabel->setStyleSheet("color: #FF8C00;");
|
||||
} else {
|
||||
m_threatLevelLabel->setStyleSheet("color: #4CAF50;");
|
||||
}
|
||||
}
|
||||
|
||||
void RightFunctionPanel::updateDeviceStatus(const QString &deviceName, bool online, int battery)
|
||||
{
|
||||
DeviceCard *deviceCard = nullptr;
|
||||
if (deviceName.contains("机器狗")) {
|
||||
deviceCard = m_robotDogCard;
|
||||
} else if (deviceName.contains("无人机")) {
|
||||
deviceCard = m_droneCard;
|
||||
}
|
||||
|
||||
if (deviceCard) {
|
||||
if (online) {
|
||||
deviceCard->setStatus(QString("在线 %1%").arg(battery), QColor("#4CAF50"));
|
||||
} else {
|
||||
deviceCard->setStatus("离线", QColor("#78909C"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "RightFunctionPanel.moc"
|
||||
@ -1,354 +0,0 @@
|
||||
/* ===============================================
|
||||
战场探索系统 - 军事主题样式表
|
||||
版本: 2.0 优化版
|
||||
=============================================== */
|
||||
|
||||
/* 全局字体和基础样式 */
|
||||
QWidget {
|
||||
font-family: "Microsoft YaHei", "SimHei", sans-serif;
|
||||
color: #ffffff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 主面板样式 */
|
||||
#rightFunctionPanel {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #0f1419, stop:1 #1a252f);
|
||||
border-left: 3px solid #00ff88;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
/* 面板标题 */
|
||||
#PanelTitle {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #00ff88, stop:1 #00c46a);
|
||||
color: #0f1419;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
padding: 16px 20px;
|
||||
border-radius: 10px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
border: 2px solid #00ff88;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
/* 模块卡片 */
|
||||
#ModuleCard {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #1e2832, stop:1 #2a3441);
|
||||
border-radius: 12px;
|
||||
border: 2px solid #3c4a59;
|
||||
border-left: 4px solid #00ff88;
|
||||
padding: 0px;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
#ModuleCard:hover {
|
||||
border-color: #00ff88;
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #243340, stop:1 #304050);
|
||||
}
|
||||
|
||||
/* 模块标题 */
|
||||
#ModuleTitle {
|
||||
color: #00ff88;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
|
||||
}
|
||||
|
||||
#ModuleIcon {
|
||||
color: #00ff88;
|
||||
font-size: 20px;
|
||||
text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
|
||||
}
|
||||
|
||||
/* 模块分隔线 */
|
||||
#ModuleSeparator {
|
||||
border: none;
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 transparent, stop:0.5 #3c4a59, stop:1 transparent);
|
||||
height: 1px;
|
||||
margin: 8px 0px;
|
||||
}
|
||||
|
||||
/* 设备选择器 */
|
||||
#device-selector {
|
||||
background: #2a3441;
|
||||
border: 1px solid #3c4a59;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/* 设备卡片 */
|
||||
#RightDeviceCard {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #2a3441, stop:1 #34404f);
|
||||
border-radius: 10px;
|
||||
border: 2px solid #3c4a59;
|
||||
padding: 12px;
|
||||
margin: 4px;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
#RightDeviceCard:hover {
|
||||
border-color: #00a8ff;
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #34404f, stop:1 #3e4a5f);
|
||||
}
|
||||
|
||||
#RightDeviceCard[active="true"] {
|
||||
border-color: #00ff88;
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 rgba(0, 255, 136, 0.1), stop:1 rgba(0, 255, 136, 0.05));
|
||||
box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
|
||||
}
|
||||
|
||||
#DeviceName {
|
||||
color: #ffffff;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#DeviceStatus {
|
||||
color: #a4b0be;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 功能按钮基础样式 */
|
||||
#FunctionBtn {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #2a3441, stop:1 #34404f);
|
||||
color: #ffffff;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
padding: 12px 16px;
|
||||
border-radius: 8px;
|
||||
border: 2px solid #3c4a59;
|
||||
margin: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#FunctionBtn:hover {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #34404f, stop:1 #3e4a5f);
|
||||
border-color: #00a8ff;
|
||||
}
|
||||
|
||||
#FunctionBtn:pressed {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #1e2a36, stop:1 #283341);
|
||||
}
|
||||
|
||||
/* 主要按钮样式 */
|
||||
#FunctionBtn[class="primary-large"] {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #00ff88, stop:1 #00c46a);
|
||||
color: #0f1419;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
border: 2px solid #00ff88;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="primary-large"]:hover {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #00c46a, stop:1 #009951);
|
||||
box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
|
||||
}
|
||||
|
||||
#FunctionBtn[class="primary-medium"] {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #00ff88, stop:1 #00c46a);
|
||||
color: #0f1419;
|
||||
font-weight: 700;
|
||||
border: 2px solid #00ff88;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="primary-medium"]:hover {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #00c46a, stop:1 #009951);
|
||||
box-shadow: 0 3px 12px rgba(0, 255, 136, 0.3);
|
||||
}
|
||||
|
||||
/* 次要按钮样式 */
|
||||
#FunctionBtn[class="secondary-medium"] {
|
||||
background: #2a3441;
|
||||
border: 2px solid #3c4a59;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="secondary-medium"]:hover {
|
||||
border-color: #00a8ff;
|
||||
background: #34404f;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="secondary-small"] {
|
||||
background: #2a3441;
|
||||
border: 2px solid #3c4a59;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="secondary-small"]:hover {
|
||||
border-color: #00a8ff;
|
||||
background: #34404f;
|
||||
}
|
||||
|
||||
/* 危险按钮样式 */
|
||||
#FunctionBtn[class="danger"] {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #ff3838, stop:1 #c44569);
|
||||
border: 2px solid #ff3838;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="danger"]:hover {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #e53e3e, stop:1 #b83b5e);
|
||||
box-shadow: 0 4px 15px rgba(255, 56, 56, 0.4);
|
||||
}
|
||||
|
||||
/* 加载状态按钮 */
|
||||
#FunctionBtn[class="loading"] {
|
||||
background: #34404f;
|
||||
border-color: #3c4a59;
|
||||
color: #a4b0be;
|
||||
}
|
||||
|
||||
#FunctionBtn:disabled {
|
||||
background: #1e2832;
|
||||
color: #556983;
|
||||
border-color: #2a3441;
|
||||
}
|
||||
|
||||
/* 统计显示区域 */
|
||||
#stats-display {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #2a3441, stop:1 #34404f);
|
||||
border-radius: 8px;
|
||||
border: 2px solid #3c4a59;
|
||||
border-left: 4px solid #ffa502;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
#stat-label {
|
||||
color: #a4b0be;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
#stat-value {
|
||||
color: #00ff88;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
|
||||
}
|
||||
|
||||
#threat-level {
|
||||
color: #ffa502;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
text-shadow: 0 0 5px rgba(255, 165, 2, 0.3);
|
||||
}
|
||||
|
||||
/* 通话状态 */
|
||||
#call-status {
|
||||
background: #2a3441;
|
||||
border: 2px solid #3c4a59;
|
||||
border-radius: 6px;
|
||||
padding: 12px 16px;
|
||||
color: #a4b0be;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
/* 音量控制 */
|
||||
#volume-label {
|
||||
color: #a4b0be;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#volume-percent {
|
||||
color: #00ff88;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* 音量滑块样式 */
|
||||
#volume-slider::groove:horizontal {
|
||||
border: 2px solid #3c4a59;
|
||||
height: 8px;
|
||||
background: #2a3441;
|
||||
border-radius: 4px;
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
#volume-slider::handle:horizontal {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #00ff88, stop:1 #00c46a);
|
||||
border: 2px solid #00ff88;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: -8px 0;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#volume-slider::handle:horizontal:hover {
|
||||
background: #00c46a;
|
||||
box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
|
||||
}
|
||||
|
||||
#volume-slider::sub-page:horizontal {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #00ff88, stop:1 #00a8ff);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* 动画效果 */
|
||||
#FunctionBtn, #RightDeviceCard, #ModuleCard {
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
/* 按钮按下效果 */
|
||||
#FunctionBtn:pressed {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
/* 设备卡片激活效果 */
|
||||
#RightDeviceCard[active="true"] {
|
||||
animation: glow-pulse 2s ease-in-out infinite alternate;
|
||||
}
|
||||
|
||||
/* 发光脉冲动画 */
|
||||
@keyframes glow-pulse {
|
||||
from {
|
||||
box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
|
||||
}
|
||||
to {
|
||||
box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
/* 加载状态旋转动画 */
|
||||
#FunctionBtn[class="loading"]::after {
|
||||
content: "";
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border: 2px solid transparent;
|
||||
border-top: 2px solid currentColor;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
display: inline-block;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
@ -1,326 +0,0 @@
|
||||
/* ===============================================
|
||||
战场探索系统 - 蓝色军事主题样式表
|
||||
版本: 2.1 蓝色配色版
|
||||
=============================================== */
|
||||
|
||||
/* 全局字体和基础样式 */
|
||||
QWidget {
|
||||
font-family: "Microsoft YaHei", "SimHei", sans-serif;
|
||||
color: #ffffff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 主面板样式 */
|
||||
#rightFunctionPanel {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #0f1419, stop:1 #1a252f);
|
||||
border-left: 3px solid #00a8ff;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
/* 面板标题 */
|
||||
#PanelTitle {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #00a8ff, stop:1 #0078d4);
|
||||
color: #ffffff;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
padding: 16px 20px;
|
||||
border-radius: 10px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
border: 2px solid #00a8ff;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
/* 模块卡片 */
|
||||
#ModuleCard {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #1e2832, stop:1 #2a3441);
|
||||
border-radius: 12px;
|
||||
border: 2px solid #3c4a59;
|
||||
border-left: 4px solid #00a8ff;
|
||||
padding: 0px;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
#ModuleCard:hover {
|
||||
border-color: #00a8ff;
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #243340, stop:1 #304050);
|
||||
}
|
||||
|
||||
/* 模块标题 */
|
||||
#ModuleTitle {
|
||||
color: #00a8ff;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
text-shadow: 0 0 5px rgba(0, 168, 255, 0.3);
|
||||
}
|
||||
|
||||
#ModuleIcon {
|
||||
color: #00a8ff;
|
||||
font-size: 20px;
|
||||
text-shadow: 0 0 8px rgba(0, 168, 255, 0.5);
|
||||
}
|
||||
|
||||
/* 模块分隔线 */
|
||||
#ModuleSeparator {
|
||||
border: none;
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 transparent, stop:0.5 #3c4a59, stop:1 transparent);
|
||||
height: 1px;
|
||||
margin: 8px 0px;
|
||||
}
|
||||
|
||||
/* 设备选择器 */
|
||||
#device-selector {
|
||||
background: #2a3441;
|
||||
border: 1px solid #3c4a59;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/* 设备卡片 */
|
||||
#RightDeviceCard {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #2a3441, stop:1 #34404f);
|
||||
border-radius: 10px;
|
||||
border: 2px solid #3c4a59;
|
||||
padding: 12px;
|
||||
margin: 4px;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
#RightDeviceCard:hover {
|
||||
border-color: #66d6ff;
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #34404f, stop:1 #3e4a5f);
|
||||
}
|
||||
|
||||
#RightDeviceCard[active="true"] {
|
||||
border-color: #00a8ff;
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 rgba(0, 168, 255, 0.1), stop:1 rgba(0, 168, 255, 0.05));
|
||||
box-shadow: 0 0 15px rgba(0, 168, 255, 0.3);
|
||||
}
|
||||
|
||||
#DeviceName {
|
||||
color: #ffffff;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#DeviceStatus {
|
||||
color: #a4b0be;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 功能按钮基础样式 */
|
||||
#FunctionBtn {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #2a3441, stop:1 #34404f);
|
||||
color: #ffffff;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
padding: 12px 16px;
|
||||
border-radius: 8px;
|
||||
border: 2px solid #3c4a59;
|
||||
margin: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#FunctionBtn:hover {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #34404f, stop:1 #3e4a5f);
|
||||
border-color: #66d6ff;
|
||||
}
|
||||
|
||||
#FunctionBtn:pressed {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #1e2a36, stop:1 #283341);
|
||||
}
|
||||
|
||||
/* 主要按钮样式 */
|
||||
#FunctionBtn[class="primary-large"] {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #00a8ff, stop:1 #0078d4);
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
border: 2px solid #00a8ff;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="primary-large"]:hover {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #0078d4, stop:1 #005a9e);
|
||||
box-shadow: 0 4px 15px rgba(0, 168, 255, 0.4);
|
||||
}
|
||||
|
||||
#FunctionBtn[class="primary-medium"] {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #00a8ff, stop:1 #0078d4);
|
||||
color: #ffffff;
|
||||
font-weight: 700;
|
||||
border: 2px solid #00a8ff;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="primary-medium"]:hover {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #0078d4, stop:1 #005a9e);
|
||||
box-shadow: 0 3px 12px rgba(0, 168, 255, 0.3);
|
||||
}
|
||||
|
||||
/* 次要按钮样式 */
|
||||
#FunctionBtn[class="secondary-medium"] {
|
||||
background: #2a3441;
|
||||
border: 2px solid #3c4a59;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="secondary-medium"]:hover {
|
||||
border-color: #66d6ff;
|
||||
background: #34404f;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="secondary-small"] {
|
||||
background: #2a3441;
|
||||
border: 2px solid #3c4a59;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="secondary-small"]:hover {
|
||||
border-color: #66d6ff;
|
||||
background: #34404f;
|
||||
}
|
||||
|
||||
/* 危险按钮样式 */
|
||||
#FunctionBtn[class="danger"] {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #ff3838, stop:1 #c44569);
|
||||
border: 2px solid #ff3838;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#FunctionBtn[class="danger"]:hover {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #e53e3e, stop:1 #b83b5e);
|
||||
box-shadow: 0 4px 15px rgba(255, 56, 56, 0.4);
|
||||
}
|
||||
|
||||
/* 加载状态按钮 */
|
||||
#FunctionBtn[class="loading"] {
|
||||
background: #34404f;
|
||||
border-color: #3c4a59;
|
||||
color: #a4b0be;
|
||||
}
|
||||
|
||||
#FunctionBtn:disabled {
|
||||
background: #1e2832;
|
||||
color: #556983;
|
||||
border-color: #2a3441;
|
||||
}
|
||||
|
||||
/* 统计显示区域 */
|
||||
#stats-display {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #2a3441, stop:1 #34404f);
|
||||
border-radius: 8px;
|
||||
border: 2px solid #3c4a59;
|
||||
border-left: 4px solid #00a8ff;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
#stat-label {
|
||||
color: #a4b0be;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
#stat-value {
|
||||
color: #00a8ff;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 0 8px rgba(0, 168, 255, 0.5);
|
||||
}
|
||||
|
||||
#threat-level {
|
||||
color: #ffa502;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
text-shadow: 0 0 5px rgba(255, 165, 2, 0.3);
|
||||
}
|
||||
|
||||
/* 通话状态 */
|
||||
#call-status {
|
||||
background: #2a3441;
|
||||
border: 2px solid #3c4a59;
|
||||
border-radius: 6px;
|
||||
padding: 12px 16px;
|
||||
color: #a4b0be;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
/* 音量控制 */
|
||||
#volume-label {
|
||||
color: #a4b0be;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#volume-percent {
|
||||
color: #00a8ff;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* 音量滑块样式 */
|
||||
#volume-slider::groove:horizontal {
|
||||
border: 2px solid #3c4a59;
|
||||
height: 8px;
|
||||
background: #2a3441;
|
||||
border-radius: 4px;
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
#volume-slider::handle:horizontal {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
|
||||
stop:0 #00a8ff, stop:1 #0078d4);
|
||||
border: 2px solid #00a8ff;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: -8px 0;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#volume-slider::handle:horizontal:hover {
|
||||
background: #0078d4;
|
||||
box-shadow: 0 0 8px rgba(0, 168, 255, 0.5);
|
||||
}
|
||||
|
||||
#volume-slider::sub-page:horizontal {
|
||||
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #00a8ff, stop:1 #66d6ff);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* 设备卡片激活效果 */
|
||||
#RightDeviceCard[active="true"] {
|
||||
animation: glow-pulse 2s ease-in-out infinite alternate;
|
||||
}
|
||||
|
||||
/* 发光脉冲动画 - 蓝色版 */
|
||||
@keyframes glow-pulse {
|
||||
from {
|
||||
box-shadow: 0 0 10px rgba(0, 168, 255, 0.3);
|
||||
}
|
||||
to {
|
||||
box-shadow: 0 0 20px rgba(0, 168, 255, 0.6);
|
||||
}
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
-- BattlefieldExplorationSystem 数据库设置脚本
|
||||
|
||||
-- 创建数据库
|
||||
CREATE DATABASE IF NOT EXISTS fly_land_database;
|
||||
USE fly_land_database;
|
||||
|
||||
-- 创建无人机表
|
||||
CREATE TABLE IF NOT EXISTS uavdatabase (
|
||||
id VARCHAR(50) PRIMARY KEY,
|
||||
state INT DEFAULT 0,
|
||||
ip VARCHAR(15) NOT NULL,
|
||||
port INT DEFAULT 8080,
|
||||
lon DOUBLE DEFAULT 0.0,
|
||||
lat DOUBLE DEFAULT 0.0
|
||||
);
|
||||
|
||||
-- 创建机器狗表
|
||||
CREATE TABLE IF NOT EXISTS dogdatabase (
|
||||
id VARCHAR(50) PRIMARY KEY,
|
||||
state INT DEFAULT 0,
|
||||
ip VARCHAR(15) NOT NULL,
|
||||
port INT DEFAULT 9090,
|
||||
lon DOUBLE DEFAULT 0.0,
|
||||
lat DOUBLE DEFAULT 0.0
|
||||
);
|
||||
|
||||
-- 插入测试数据 - 无人机
|
||||
INSERT INTO uavdatabase (id, state, ip, port, lon, lat) VALUES
|
||||
('UAV001', 1, '192.168.1.101', 8080, 116.40, 39.90),
|
||||
('UAV002', 2, '192.168.1.102', 8080, 116.42, 39.92),
|
||||
('UAV003', 0, '192.168.1.103', 8080, 116.44, 39.94)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
state = VALUES(state),
|
||||
ip = VALUES(ip),
|
||||
port = VALUES(port),
|
||||
lon = VALUES(lon),
|
||||
lat = VALUES(lat);
|
||||
|
||||
-- 插入测试数据 - 机器狗
|
||||
INSERT INTO dogdatabase (id, state, ip, port, lon, lat) VALUES
|
||||
('DOG001', 1, '192.168.1.201', 9090, 116.38, 39.88),
|
||||
('DOG002', 0, '192.168.1.202', 9090, 116.46, 39.86)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
state = VALUES(state),
|
||||
ip = VALUES(ip),
|
||||
port = VALUES(port),
|
||||
lon = VALUES(lon),
|
||||
lat = VALUES(lat);
|
||||
|
||||
-- 验证数据
|
||||
SELECT 'UAV Devices:' AS info;
|
||||
SELECT * FROM uavdatabase;
|
||||
|
||||
SELECT 'Dog Devices:' AS info;
|
||||
SELECT * FROM dogdatabase;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue