ThreatSourceLibaray/docs/project/design.md

168 lines
6.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 威胁源仿真库设计文档
## 接口设计
### 核心接口继承关系
```mermaid
classDiagram
ISimulationElement <|-- ITarget
ISpectralCharacteristics <|-- ITarget
ISimulationElement <|.. SimulationElement
ISpectralCharacteristics <|.. SimulationElement
SimulationElement <|-- Tank
ITarget <|.. Tank
class ISimulationElement {
+string Id
+Vector3D Position
+Vector3D Velocity
+double Speed
+Orientation Orientation
+bool IsActive
+Update(deltaTime)
+Activate()
+Deactivate()
+GetStatus()
}
class ISpectralCharacteristics {
+double RadarCrossSection
+double InfraredRadiationIntensity
+double UltravioletRadiationIntensity
+double MillimeterWaveRadiationIntensity
}
class ITarget {
+string Type
+double MillimeterWaveRadiationTemperature
+double LaserReflectivity
+double Length
+double Width
+double Height
+double Health
}
```
### 设计说明
1. **接口分层**
- `ISimulationElement`: 定义所有仿真元素的基本行为,包括位置、运动状态和生命周期管理
- `ISpectralCharacteristics`: 定义实体的频谱特性,包括雷达散射截面积、红外辐射等
- `ITarget`: 继承上述两个接口,并添加目标特有的属性(尺寸、生命值等)
2. **实现层次**
- `SimulationElement`: 抽象基类,实现 `ISimulationElement``ISpectralCharacteristics` 的基本功能
- `Tank`: 继承 `SimulationElement` 并实现 `ITarget` 接口,获得基类功能的同时实现目标特有的属性和行为
3. **设计优势**
- 接口隔离:将不同职责的功能分散到不同接口中
- 代码复用:通用功能在 `SimulationElement` 中实现
- 扩展性:新的实体类型可以方便地接入系统
- 维护性:频谱特性的修改只需要关注 `ISpectralCharacteristics` 接口
## 干扰处理
```text
干扰处理架构
├── 干扰类型JammingType
│ ├── 红外干扰Infrared
│ ├── 毫米波干扰MillimeterWave
│ ├── 激光干扰Laser
│ ├── 射频干扰RadioFrequency
│ └── GPS干扰GPS
├── 干扰模式JammingMode
│ ├── 噪声干扰Noise
│ ├── 欺骗干扰Deception
│ ├── 阻塞干扰Blocking
│ └── 扫频干扰Sweep
├── 干扰事件JammingEvent
│ ├── 红外干扰事件InfraredJammingEvent
│ ├── 毫米波干扰事件MillimeterWaveJammingEvent
│ ├── 激光干扰事件LaserJammingEvent
│ └── 射频干扰事件RadioFrequencyJammingEvent
├── 干扰参数JammingParameters
│ ├── 干扰类型Type
│ ├── 干扰功率Power
│ ├── 干扰方向Direction
│ ├── 干扰源位置SourcePosition
│ ├── 干扰角度范围AngleRange
│ ├── 干扰频率Frequency
│ ├── 持续时间Duration
│ ├── 干扰模式Mode
│ └── 干扰开始时间StartTime
├── 干扰处理接口IJammable
│ ├── 支持的干扰类型SupportedJammingTypes
│ ├── 干扰状态IsJammed
│ ├── 应用干扰ApplyJamming
│ └── 清除干扰ClearJamming
├── 干扰处理基类JammingHandler
│ ├── 干扰状态IsJammed
│ ├── 当前干扰参数CurrentJamming
│ ├── 累积干扰时间_elapsedTime
│ ├── 更新干扰状态Update
│ ├── 处理干扰HandleJamming
│ ├── 清除干扰ClearJamming
│ ├── 干扰应用回调OnJammingApplied
│ └── 干扰清除回调OnJammingCleared
├── 可干扰组件JammableComponent
│ ├── 干扰处理器JammingProcessor
│ │ ├── 干扰阈值映射_jammingThresholds
│ │ ├── 设置干扰阈值SetJammingThreshold
│ │ ├── 检查干扰是否有效IsJammingEffective
│ │ │ ├── 距离衰减计算
│ │ │ ├── 角度因素计算
│ │ │ └── 与阈值比较
│ │ ├── 处理干扰HandleJamming
│ │ └── 清除干扰ClearJamming
│ │
│ ├── 支持的干扰类型SupportedJammingTypes
│ ├── 干扰状态IsJammed
│ ├── 位置提供委托_positionProvider
│ ├── 干扰应用事件_onJammingApplied
│ ├── 干扰清除事件_onJammingCleared
│ └── 加载干扰配置LoadJammingConfigFromThreshold
└── 干扰响应实现
├── 导引系统干扰响应
│ ├── 激光半主动导引系统LaserSemiActiveGuidanceSystem
│ │ ├── 激光干扰事件处理OnLaserJamming
│ │ ├── 干扰应用处理HandleJammingApplied
│ │ └── 干扰清除处理HandleJammingCleared
│ │
│ ├── 毫米波导引系统MillimeterWaveGuidanceSystem
│ │ ├── 毫米波干扰事件处理OnMillimeterWaveJamming
│ │ ├── 干扰应用处理HandleJammingApplied
│ │ └── 干扰清除处理HandleJammingCleared
│ │
│ ├── 红外成像导引系统InfraredImagingGuidanceSystem
│ │ ├── 红外干扰事件处理OnInfraredJamming
│ │ ├── 干扰应用处理HandleJammingApplied
│ │ └── 干扰清除处理HandleJammingCleared
│ │
│ └── 红外指令导引系统InfraredCommandGuidanceSystem
└── 指示器干扰响应
├── 激光指示器LaserDesignator
│ ├── 激光干扰事件处理OnLaserJamming
│ ├── 干扰应用处理HandleJammingApplied
│ └── 干扰清除处理HandleJammingCleared
├── 激光驾束仪LaserBeamRider
│ ├── 激光干扰事件处理OnLaserJamming
│ ├── 干扰应用处理HandleJammingApplied
│ └── 干扰清除处理HandleJammingCleared
└── 红外测角仪InfraredTracker
├── 红外干扰事件处理OnInfraredJamming
├── 干扰应用处理HandleJammingApplied
└── 干扰清除处理HandleJammingCleared
```