@startuml 数据模型类图 title 基于空地协同的战场环境探索系统 - 数据模型类图 skinparam classAttributeIconSize 0 skinparam classFontSize 10 skinparam classFontStyle bold skinparam packageStyle rectangle package "核心数据实体" { class Location { -locationId: String -x: double -y: double -z: double -timestamp: QDateTime +getCoordinates() +setCoordinates() +calculateDistance() +isValid() } class Pose { -poseId: String -position: Location -orientation: QQuaternion -timestamp: QDateTime +getPosition() +getOrientation() +setPose() +transformPose() } class SensorData { -sensorId: String -sensorType: String -dataType: String -rawData: QByteArray -processedData: QVariant -timestamp: QDateTime +getRawData() +getProcessedData() +processData() +validateData() } class Target { -targetId: String -targetType: String -location: Location -threatLevel: int -confidence: double -status: String -timestamp: QDateTime +updateLocation() +updateThreatLevel() +assessThreat() +isActive() } } package "设备数据模型" { class Device { -deviceId: String -deviceType: String -deviceName: String -status: String -connectionStatus: String -lastUpdate: QDateTime +getDeviceInfo() +updateStatus() +isConnected() +isOperational() } class RobotDog { -dogId: String -dogType: String -batteryLevel: double -currentPose: Pose -movementStatus: String -sensorData: QList -lastCommand: MovementCommand +getBatteryLevel() +getCurrentPose() +updateStatus() +sendCommand() +emergencyStop() } class UAV { -uavId: String -uavType: String -batteryLevel: double -altitude: double -currentPose: Pose -flightMode: String -sensorData: QList +getBatteryLevel() +getAltitude() +getCurrentPose() +updateFlightMode() +sendFlightCommand() } class MovementCommand { -commandId: String -deviceId: String -commandType: String -targetPose: Pose -speed: double -priority: int -timestamp: QDateTime -status: String +executeCommand() +validateCommand() +getCommandStatus() +cancelCommand() } } package "任务数据模型" { class Mission { -missionId: String -missionType: String -missionName: String -priority: int -status: String -startTime: QDateTime -endTime: QDateTime -assignedDevices: QList -tasks: QList +createMission() +assignDevices() +addTask() +updateStatus() +completeMission() } class Task { -taskId: String -missionId: String -taskType: String -taskName: String -priority: int -status: String -assignedDevice: String -startLocation: Location -endLocation: Location -parameters: QVariantMap +assignDevice() +updateStatus() +executeTask() +completeTask() } class TaskResult { -resultId: String -taskId: String -deviceId: String -resultType: String -resultData: QVariant -success: boolean -errorMessage: String -timestamp: QDateTime +setResult() +getResult() +isSuccess() +getErrorMessage() } } package "情报数据模型" { class IntelligenceData { -intelligenceId: String -dataType: String -source: String -content: QVariant -confidence: double -priority: int -timestamp: QDateTime -expiryTime: QDateTime +getContent() +setConfidence() +isExpired() +updatePriority() } class EnemyTarget { -targetId: String -targetType: String -location: Location -threatLevel: int -confidence: double -detectionTime: QDateTime -lastUpdate: QDateTime -status: String -attributes: QVariantMap +updateLocation() +updateThreatLevel() +setAttributes() +isActive() } class BattlefieldMap { -mapId: String -mapType: String -resolution: double -width: double -height: double -origin: Location -mapData: QImage -obstacles: QList -lastUpdate: QDateTime +getMapData() +addObstacle() +removeObstacle() +updateMap() +getObstacles() } class Obstacle { -obstacleId: String -obstacleType: String -location: Location -size: QVector3D -properties: QVariantMap -timestamp: QDateTime +getLocation() +getSize() +setProperties() +isBlocking() } } package "系统配置数据" { class SystemConfig { -configId: String -configType: String -configName: String -configValue: QVariant -description: String -lastModified: QDateTime +getValue() +setValue() +getDescription() +isValid() } class UserConfig { -userId: String -username: String -userRole: String -permissions: QList -preferences: QVariantMap -lastLogin: QDateTime +getPermissions() +setPreferences() +hasPermission() +updateLastLogin() } class DeviceConfig { -deviceId: String -configType: String -parameters: QVariantMap -lastModified: QDateTime +getParameters() +setParameters() +validateConfig() +applyConfig() } } package "日志和监控数据" { class SystemLog { -logId: String -logLevel: String -logSource: String -logMessage: String -timestamp: QDateTime -userId: String -deviceId: String +getLogInfo() +setLogLevel() +formatMessage() } class PerformanceMetrics { -metricId: String -metricType: String -metricName: String -metricValue: double -unit: String -timestamp: QDateTime -deviceId: String +getMetricValue() +setMetricValue() +getUnit() +isWithinRange() } class Alert { -alertId: String -alertType: String -alertLevel: String -alertMessage: String -source: String -timestamp: QDateTime -acknowledged: boolean -resolved: boolean +getAlertInfo() +acknowledgeAlert() +resolveAlert() +isActive() } } ' 关系定义 Location ||--o{ Pose : 组成 Location ||--o{ Target : 定位 Location ||--o{ RobotDog : 定位 Location ||--o{ UAV : 定位 Location ||--o{ Obstacle : 定位 Pose ||--o{ MovementCommand : 目标位置 Pose ||--o{ Task : 起始/结束位置 Device ||--o{ RobotDog : 继承 Device ||--o{ UAV : 继承 RobotDog ||--o{ MovementCommand : 执行 UAV ||--o{ MovementCommand : 执行 Mission ||--o{ Task : 包含 Task ||--o{ TaskResult : 产生 Task ||--o{ MovementCommand : 生成 IntelligenceData ||--o{ EnemyTarget : 包含 BattlefieldMap ||--o{ Obstacle : 包含 BattlefieldMap ||--o{ Location : 覆盖 SystemConfig ||--o{ DeviceConfig : 配置 UserConfig ||--o{ SystemLog : 记录 Device ||--o{ DeviceConfig : 配置 SystemLog ||--o{ PerformanceMetrics : 记录 SystemLog ||--o{ Alert : 生成 Device ||--o{ PerformanceMetrics : 监控 Device ||--o{ Alert : 产生 @enduml