You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
515 lines
14 KiB
515 lines
14 KiB
@startuml 软件系统分析类图
|
|
title 基于空地协同的战场环境探索系统 - 软件系统分析类图
|
|
skinparam classAttributeIconSize 0
|
|
skinparam classFontSize 10
|
|
skinparam classFontStyle bold
|
|
skinparam packageStyle rectangle
|
|
skinparam packageFontSize 12
|
|
|
|
' 定义样式
|
|
skinparam class {
|
|
BackgroundColor<<Qt>> #E1F5FE
|
|
BackgroundColor<<ROS>> #F3E5F5
|
|
BackgroundColor<<AI>> #E8F5E8
|
|
BackgroundColor<<Database>> #FFF3E0
|
|
BackgroundColor<<Core>> #FCE4EC
|
|
}
|
|
|
|
package "用户界面层 (Qt Client)" <<Qt>> {
|
|
class MainWindow {
|
|
-mainWindowId: String
|
|
-windowTitle: String
|
|
-windowSize: QSize
|
|
+initializeUI()
|
|
+setupMenuBar()
|
|
+setupToolBar()
|
|
+setupStatusBar()
|
|
+handleMenuAction()
|
|
+updateStatus()
|
|
+closeEvent()
|
|
}
|
|
|
|
class UIInitializationManager {
|
|
-uiManagerId: String
|
|
-initializationStatus: String
|
|
+initializeAllComponents()
|
|
+setupDatabaseConnection()
|
|
+setupDeviceConnections()
|
|
+setupSignalSlots()
|
|
+validateInitialization()
|
|
+handleInitializationError()
|
|
}
|
|
|
|
package "UI组件 (Components)" {
|
|
class RightFunctionPanel {
|
|
-panelId: String
|
|
-panelType: String
|
|
-isVisible: boolean
|
|
+setupFunctionButtons()
|
|
+handleButtonClick()
|
|
+updatePanelContent()
|
|
+showPanel()
|
|
+hidePanel()
|
|
}
|
|
|
|
class DeviceListPanel {
|
|
-deviceListId: String
|
|
-deviceCount: int
|
|
-selectedDevice: String
|
|
+loadDeviceList()
|
|
+addDevice()
|
|
+removeDevice()
|
|
+selectDevice()
|
|
+updateDeviceStatus()
|
|
+refreshDeviceList()
|
|
}
|
|
|
|
class DeviceCard {
|
|
-deviceId: String
|
|
-deviceType: String
|
|
-deviceStatus: String
|
|
-deviceIcon: QIcon
|
|
+displayDeviceInfo()
|
|
+updateStatus()
|
|
+handleClick()
|
|
+showDetails()
|
|
}
|
|
|
|
class SystemLogPanel {
|
|
-logPanelId: String
|
|
-logLevel: String
|
|
-maxLogEntries: int
|
|
+addLogEntry()
|
|
+clearLogs()
|
|
+filterLogs()
|
|
+exportLogs()
|
|
+setLogLevel()
|
|
}
|
|
}
|
|
|
|
package "对话框 (Dialogs)" {
|
|
class RobotDogControlDialog {
|
|
-dialogId: String
|
|
-dogId: String
|
|
-controlMode: String
|
|
+setupControlInterface()
|
|
+sendMovementCommand()
|
|
+sendNavigationCommand()
|
|
+updateDogStatus()
|
|
+emergencyStop()
|
|
+closeDialog()
|
|
}
|
|
|
|
class DroneControlDialog {
|
|
-dialogId: String
|
|
-droneId: String
|
|
-flightMode: String
|
|
+setupFlightInterface()
|
|
+sendTakeoffCommand()
|
|
+sendLandingCommand()
|
|
+sendFlightCommand()
|
|
+updateDroneStatus()
|
|
+emergencyLanding()
|
|
}
|
|
|
|
class EnemyStatsDialog {
|
|
-dialogId: String
|
|
-enemyCount: int
|
|
-threatLevel: int
|
|
+loadEnemyData()
|
|
+displayStatistics()
|
|
+updateThreatLevel()
|
|
+exportReport()
|
|
+closeDialog()
|
|
}
|
|
|
|
class DeviceDialog {
|
|
-dialogId: String
|
|
-deviceId: String
|
|
-deviceType: String
|
|
+setupDeviceInterface()
|
|
+configureDevice()
|
|
+testDevice()
|
|
+updateDeviceInfo()
|
|
+saveConfiguration()
|
|
}
|
|
}
|
|
}
|
|
|
|
package "核心业务层 (Core Business)" <<Core>> {
|
|
package "数据库管理 (Database)" <<Database>> {
|
|
class DatabaseManager {
|
|
-dbManagerId: String
|
|
-connectionStatus: String
|
|
-dbConfig: DatabaseConfig
|
|
+connectToDatabase()
|
|
+disconnectFromDatabase()
|
|
+createTables()
|
|
+executeQuery()
|
|
+beginTransaction()
|
|
+commitTransaction()
|
|
+rollbackTransaction()
|
|
}
|
|
|
|
class DatabaseHelper {
|
|
-helperId: String
|
|
-queryBuilder: QueryBuilder
|
|
+buildSelectQuery()
|
|
+buildInsertQuery()
|
|
+buildUpdateQuery()
|
|
+buildDeleteQuery()
|
|
+executeQuery()
|
|
+handleQueryError()
|
|
}
|
|
|
|
class DatabaseConfig {
|
|
-configId: String
|
|
-host: String
|
|
-port: int
|
|
-databaseName: String
|
|
-username: String
|
|
-password: String
|
|
+loadFromFile()
|
|
+saveToFile()
|
|
+validateConfig()
|
|
+getConnectionString()
|
|
}
|
|
|
|
class EnemyDatabase {
|
|
-enemyDbId: String
|
|
-tableName: String
|
|
+insertEnemyTarget()
|
|
+updateEnemyTarget()
|
|
+deleteEnemyTarget()
|
|
+getEnemyTarget()
|
|
+getAllEnemyTargets()
|
|
+getEnemyTargetsByType()
|
|
+getEnemyTargetsByThreatLevel()
|
|
}
|
|
|
|
class DogDatabase {
|
|
-dogDbId: String
|
|
-tableName: String
|
|
+insertDogStatus()
|
|
+updateDogStatus()
|
|
+getDogStatus()
|
|
+getAllDogStatus()
|
|
+insertDogLocation()
|
|
+getDogLocationHistory()
|
|
}
|
|
|
|
class UAVDatabase {
|
|
-uavDbId: String
|
|
-tableName: String
|
|
+insertUAVStatus()
|
|
+updateUAVStatus()
|
|
+getUAVStatus()
|
|
+getAllUAVStatus()
|
|
+insertUAVFlightData()
|
|
+getUAVFlightTrajectory()
|
|
}
|
|
}
|
|
|
|
package "工具类 (Utils)" {
|
|
class ConfigManager {
|
|
-configManagerId: String
|
|
-configFile: String
|
|
-configData: QVariantMap
|
|
+loadConfiguration()
|
|
+saveConfiguration()
|
|
+getValue()
|
|
+setValue()
|
|
+validateConfiguration()
|
|
+reloadConfiguration()
|
|
}
|
|
|
|
class SystemLogger {
|
|
-loggerId: String
|
|
-logLevel: String
|
|
-logFile: String
|
|
+logInfo()
|
|
+logWarning()
|
|
+logError()
|
|
+logDebug()
|
|
+setLogLevel()
|
|
+setLogFile()
|
|
+rotateLogFile()
|
|
}
|
|
}
|
|
}
|
|
|
|
package "AI算法层 (AI Algorithms)" <<AI>> {
|
|
class YOLODetector {
|
|
-detectorId: String
|
|
-modelPath: String
|
|
-confidenceThreshold: double
|
|
-nmsThreshold: double
|
|
-modelLoaded: boolean
|
|
+loadModel()
|
|
+detectObjects()
|
|
+classifyTargets()
|
|
+updateModel()
|
|
+setConfidenceThreshold()
|
|
+setNMSThreshold()
|
|
+getDetectionResults()
|
|
}
|
|
|
|
class TargetClassifier {
|
|
-classifierId: String
|
|
-classifierType: String
|
|
-trainingData: QList<QImage>
|
|
+trainClassifier()
|
|
+classifyTarget()
|
|
+updateClassifier()
|
|
+getClassificationResults()
|
|
+validateClassification()
|
|
}
|
|
|
|
class SLAMProcessor {
|
|
-slamId: String
|
|
-slamType: String
|
|
-mapResolution: double
|
|
-currentPose: Pose
|
|
+processSensorData()
|
|
+buildMap()
|
|
+localizePosition()
|
|
+updateMap()
|
|
+getCurrentPose()
|
|
+getMapData()
|
|
}
|
|
|
|
class PathPlanner {
|
|
-plannerId: String
|
|
-algorithmType: String
|
|
-heuristicFunction: String
|
|
-obstacleMap: QImage
|
|
+planOptimalPath()
|
|
+avoidObstacles()
|
|
+optimizeRoute()
|
|
+replanPath()
|
|
+getPathData()
|
|
+validatePath()
|
|
}
|
|
|
|
class DataFusion {
|
|
-fusionId: String
|
|
-fusionAlgorithm: String
|
|
-weightMatrix: Matrix
|
|
-sensorData: QList<SensorData>
|
|
+fuseMultiSourceData()
|
|
+weightData()
|
|
+resolveConflicts()
|
|
+generateFusedMap()
|
|
+getFusionResults()
|
|
+updateFusionAlgorithm()
|
|
}
|
|
}
|
|
|
|
package "ROS机器人控制层 (ROS Control)" <<ROS>> {
|
|
package "Unitree机器狗控制" {
|
|
class UnitreeController {
|
|
-controllerId: String
|
|
-dogId: String
|
|
-connectionStatus: String
|
|
-currentState: DogState
|
|
+connectToDog()
|
|
+disconnectFromDog()
|
|
+sendMovementCommand()
|
|
+sendNavigationCommand()
|
|
+getDogStatus()
|
|
+emergencyStop()
|
|
}
|
|
|
|
class DogState {
|
|
-stateId: String
|
|
-batteryLevel: double
|
|
-currentPose: Pose
|
|
-movementStatus: String
|
|
-sensorData: SensorData
|
|
+updateState()
|
|
+getBatteryLevel()
|
|
+getCurrentPose()
|
|
+getMovementStatus()
|
|
}
|
|
|
|
class MovementCommand {
|
|
-commandId: String
|
|
-commandType: String
|
|
-targetPose: Pose
|
|
-speed: double
|
|
-timestamp: QDateTime
|
|
+executeCommand()
|
|
+validateCommand()
|
|
+getCommandStatus()
|
|
}
|
|
}
|
|
|
|
package "ROS消息定义" {
|
|
class HighCmd {
|
|
-mode: int
|
|
-gaitType: int
|
|
-speedLevel: int
|
|
-footRaiseHeight: float
|
|
-bodyHeight: float
|
|
+serialize()
|
|
+deserialize()
|
|
}
|
|
|
|
class HighState {
|
|
-mode: int
|
|
-gaitType: int
|
|
-footRaiseHeight: float
|
|
-bodyHeight: float
|
|
-position: Cartesian
|
|
+serialize()
|
|
+deserialize()
|
|
}
|
|
|
|
class IMU {
|
|
-quaternion: QVector4D
|
|
-gyroscope: QVector3D
|
|
-accelerometer: QVector3D
|
|
-timestamp: QDateTime
|
|
+getQuaternion()
|
|
+getGyroscope()
|
|
+getAccelerometer()
|
|
}
|
|
|
|
class MotorState {
|
|
-motorId: int
|
|
-position: float
|
|
-velocity: float
|
|
-torque: float
|
|
-temperature: float
|
|
+getPosition()
|
|
+getVelocity()
|
|
+getTorque()
|
|
}
|
|
}
|
|
}
|
|
|
|
package "通信层 (Communication)" {
|
|
class CommunicationManager {
|
|
-commManagerId: String
|
|
-connectionType: String
|
|
-connectionStatus: String
|
|
+establishConnection()
|
|
+closeConnection()
|
|
+sendMessage()
|
|
+receiveMessage()
|
|
+handleConnectionError()
|
|
+getConnectionStatus()
|
|
}
|
|
|
|
class NetworkProtocol {
|
|
-protocolId: String
|
|
-protocolType: String
|
|
-port: int
|
|
-timeout: int
|
|
+encodeMessage()
|
|
+decodeMessage()
|
|
+validateMessage()
|
|
+handleProtocolError()
|
|
}
|
|
|
|
class DataTransmission {
|
|
-transmissionId: String
|
|
-dataType: String
|
|
-compressionEnabled: boolean
|
|
-encryptionEnabled: boolean
|
|
+transmitData()
|
|
+receiveData()
|
|
+compressData()
|
|
+decompressData()
|
|
+encryptData()
|
|
+decryptData()
|
|
}
|
|
}
|
|
|
|
package "任务控制层 (Mission Control)" {
|
|
class MissionController {
|
|
-missionId: String
|
|
-missionType: String
|
|
-priority: int
|
|
-status: String
|
|
-startTime: QDateTime
|
|
+createMission()
|
|
+assignTasks()
|
|
+monitorProgress()
|
|
+handleEmergency()
|
|
+generateReport()
|
|
+abortMission()
|
|
}
|
|
|
|
class TaskScheduler {
|
|
-schedulerId: String
|
|
-taskQueue: QQueue<Task>
|
|
-schedulingAlgorithm: String
|
|
+addTask()
|
|
+removeTask()
|
|
+scheduleTasks()
|
|
+getNextTask()
|
|
+updateTaskStatus()
|
|
+optimizeSchedule()
|
|
}
|
|
|
|
class CoordinationController {
|
|
-coordinationId: String
|
|
-coordinationType: String
|
|
-deviceList: QList<Device>
|
|
+coordinatePlatforms()
|
|
+optimizeTaskAllocation()
|
|
+resolveConflicts()
|
|
+maintainFormation()
|
|
+getCoordinationStatus()
|
|
}
|
|
}
|
|
|
|
' 关系定义
|
|
MainWindow ||--o{ UIInitializationManager : 使用
|
|
MainWindow ||--o{ RightFunctionPanel : 包含
|
|
MainWindow ||--o{ DeviceListPanel : 包含
|
|
MainWindow ||--o{ SystemLogPanel : 包含
|
|
|
|
DeviceListPanel ||--o{ DeviceCard : 包含
|
|
MainWindow ||--o{ RobotDogControlDialog : 打开
|
|
MainWindow ||--o{ DroneControlDialog : 打开
|
|
MainWindow ||--o{ EnemyStatsDialog : 打开
|
|
MainWindow ||--o{ DeviceDialog : 打开
|
|
|
|
UIInitializationManager ||--o{ DatabaseManager : 初始化
|
|
UIInitializationManager ||--o{ ConfigManager : 配置
|
|
|
|
DatabaseManager ||--o{ DatabaseHelper : 使用
|
|
DatabaseManager ||--o{ DatabaseConfig : 配置
|
|
DatabaseManager ||--o{ EnemyDatabase : 管理
|
|
DatabaseManager ||--o{ DogDatabase : 管理
|
|
DatabaseManager ||--o{ UAVDatabase : 管理
|
|
|
|
RobotDogControlDialog ||--o{ UnitreeController : 控制
|
|
DroneControlDialog ||--o{ CommunicationManager : 通信
|
|
|
|
UnitreeController ||--o{ DogState : 监控
|
|
UnitreeController ||--o{ MovementCommand : 发送
|
|
UnitreeController ||--o{ HighCmd : 发送
|
|
UnitreeController ||--o{ HighState : 接收
|
|
UnitreeController ||--o{ IMU : 接收
|
|
UnitreeController ||--o{ MotorState : 接收
|
|
|
|
YOLODetector ||--o{ TargetClassifier : 使用
|
|
SLAMProcessor ||--o{ PathPlanner : 提供地图
|
|
DataFusion ||--o{ YOLODetector : 融合数据
|
|
DataFusion ||--o{ SLAMProcessor : 融合数据
|
|
|
|
MissionController ||--o{ TaskScheduler : 使用
|
|
MissionController ||--o{ CoordinationController : 使用
|
|
TaskScheduler ||--o{ UnitreeController : 调度
|
|
TaskScheduler ||--o{ CommunicationManager : 调度
|
|
|
|
CommunicationManager ||--o{ NetworkProtocol : 使用
|
|
CommunicationManager ||--o{ DataTransmission : 使用
|
|
|
|
SystemLogger ||--o{ MainWindow : 记录
|
|
ConfigManager ||--o{ MainWindow : 配置
|
|
|
|
@enduml |