first commit
This commit is contained in:
290
unreal/Content/Blueprints/BP_DataFlow_Spec.md
Normal file
290
unreal/Content/Blueprints/BP_DataFlow_Spec.md
Normal file
@@ -0,0 +1,290 @@
|
||||
# BP_DataFlow 数据流向蓝图详细规格
|
||||
|
||||
## 蓝图信息
|
||||
|
||||
| 属性 | 值 |
|
||||
|------|-----|
|
||||
| 蓝图类型 | Actor |
|
||||
| 父类 | `Actor` |
|
||||
| 路径 | `Content/Blueprints/BP_DataFlow.uasset` |
|
||||
|
||||
## 组件列表
|
||||
|
||||
```
|
||||
BP_DataFlow
|
||||
├── SceneRoot (场景根)
|
||||
│ ├── SourceMarker (源点标记)
|
||||
│ │ └── StaticMesh: Sphere
|
||||
│ │ └── Material: M_DataFlow_Source
|
||||
│ ├── DestinationMarker (目标点标记)
|
||||
│ │ └── StaticMesh: Sphere
|
||||
│ │ └── Material: M_DataFlow_Destination
|
||||
│ ├── PathSpline (路径样条)
|
||||
│ │ └── SplineMeshComponent
|
||||
│ │ └── Material: M_DataFlow_Path
|
||||
│ └── FlowParticles (流向粒子)
|
||||
│ └── NiagaraComponent
|
||||
│ └── NS_DataFlow_Directional
|
||||
```
|
||||
|
||||
## 变量列表
|
||||
|
||||
| 变量名 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `FlowId` | String | `""` | 流向唯一标识 |
|
||||
| `SourceLocation` | GeographicPoint | - | 源位置 |
|
||||
| `DestinationLocation` | GeographicPoint | - | 目标位置 |
|
||||
| `DataRate` | Float | `1000.0` | 数据速率 (Gbps) |
|
||||
| `DataType` | EDataFlowType | `Internet` | 数据类型 |
|
||||
| `IsActive` | Boolean | `true` | 是否激活 |
|
||||
| `FlowColor` | LinearColor | (0.2, 0.6, 1.0, 1) | 流向颜色 |
|
||||
| `Duration` | Float | `3.0` | 粒子生命周期(秒) |
|
||||
|
||||
## 枚举定义
|
||||
|
||||
### EDataFlowType
|
||||
|
||||
| 枚举值 | 说明 | 颜色 |
|
||||
|--------|------|------|
|
||||
| `Internet` | 互联网流量 | 蓝色 |
|
||||
| `Backbone` | 骨干网 | 青色 |
|
||||
| `Cloud` | 云服务 | 紫色 |
|
||||
| `AI_Training` | AI 训练数据 | 橙色 |
|
||||
| `CDN` | CDN 分发 | 绿色 |
|
||||
|
||||
## 材质规格
|
||||
|
||||
### M_DataFlow_Source (源点)
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `BaseColor` | Vector3 | (0.2, 0.6, 1.0) | 蓝色 |
|
||||
| `EmissiveStrength` | Float | `10.0` | 自发光强度 |
|
||||
| `PulseSpeed` | Float | `2.0` | 脉冲速度 |
|
||||
| `Radius` | Float | `10000.0` | 脉冲半径 |
|
||||
|
||||
### M_DataFlow_Destination (目标点)
|
||||
|
||||
```
|
||||
与 M_DataFlow_Source 相同,但:
|
||||
├─ BaseColor: 稍暗
|
||||
└─ PulseSpeed: 稍慢
|
||||
```
|
||||
|
||||
### M_DataFlow_Path (路径线)
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `LineColor` | Vector4 | (0.2, 0.6, 1.0, 0.5) | 半透明蓝 |
|
||||
| `LineWidth` | Float | `100.0` | 线宽度 |
|
||||
| `FlowSpeed` | Float | `1.0` | 流动速度 |
|
||||
| `FlowIntensity` | Float | `0.8` | 流动强度 |
|
||||
|
||||
## 粒子系统 (NS_DataFlow_Directional)
|
||||
|
||||
### Niagara 参数
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `User.Color` | LinearColor | (0.2, 0.6, 1.0, 1.0) | 粒子颜色 |
|
||||
| `User.Speed` | Float | `100.0` | 粒子速度 |
|
||||
| `User.Lifetime` | Float | `3.0` | 粒子寿命 |
|
||||
| `User.Size` | Float | `50.0` | 粒子大小 |
|
||||
| `User.Density` | Float | `1.0` | 粒子密度 |
|
||||
|
||||
### 粒子行为
|
||||
|
||||
```
|
||||
1. 发射器类型: 沿样条路径
|
||||
2. 发射速率: DataRate / 100 (归一化)
|
||||
3. 粒子寿命: Duration
|
||||
4. 粒子速度: 路径长度 / Duration
|
||||
5. 颜色渐变:
|
||||
├─ 起点: 高亮度
|
||||
├─ 中点: 正常亮度
|
||||
└─ 终点: 渐隐
|
||||
```
|
||||
|
||||
## 函数
|
||||
|
||||
### Initialize (Struct FlowData)
|
||||
|
||||
```
|
||||
1. [解析] FlowData
|
||||
2. [设置] FlowId = FlowData["id"]
|
||||
3. [设置] SourceLocation = FlowData["source"]
|
||||
4. [设置] DestinationLocation = FlowData["destination"]
|
||||
5. [设置] DataRate = FlowData["data_rate"]
|
||||
6. [设置] DataType = FlowData["data_type"]
|
||||
7. [计算] PathPoints
|
||||
8. [调用] BuildPath()
|
||||
9. [调用] UpdateParticles()
|
||||
10. [调用] SetFlowColorByType()
|
||||
```
|
||||
|
||||
### BuildPath
|
||||
|
||||
```
|
||||
1. [计算] SourceUE = GeoUtils.LatLonToUE(SourceLocation)
|
||||
2. [计算] DestUE = GeoUtils.LatLonToUE(DestinationLocation)
|
||||
3. [设置] SourceMarker.SetRelativeLocation(SourceUE)
|
||||
4. [设置] DestinationMarker.SetRelativeLocation(DestUE)
|
||||
5. [计算] MidPoints (插值路径)
|
||||
6. [构建] SplineComponent from Source to Destination
|
||||
7. [设置] SplineMeshComponent.Start/End
|
||||
```
|
||||
|
||||
### UpdateParticles
|
||||
|
||||
```
|
||||
1. [计算] ParticleSpeed = PathLength / Duration
|
||||
2. [获取] NiagaraComponent
|
||||
3. [设置] User.Speed = ParticleSpeed
|
||||
4. [计算] EmissionRate = DataRate / 10
|
||||
5. [设置] User.EmissionRate = EmissionRate
|
||||
6. [调用] NiagaraComponent.Activate()
|
||||
```
|
||||
|
||||
### SetFlowColorByType
|
||||
|
||||
```
|
||||
1. [分支] DataType
|
||||
├─ "internet": [设置] FlowColor = (0.2, 0.6, 1.0, 1) 蓝色
|
||||
├─ "backbone": [设置] FlowColor = (0.0, 1.0, 1.0, 1) 青色
|
||||
├─ "cloud": [设置] FlowColor = (0.6, 0.2, 1.0, 1) 紫色
|
||||
├─ "ai_training": [设置] FlowColor = (1.0, 0.5, 0.0, 1) 橙色
|
||||
├─ "cdn": [设置] FlowColor = (0.2, 1.0, 0.4, 1) 绿色
|
||||
└─ [默认]: [设置] FlowColor = (0.5, 0.5, 0.5, 1) 灰色
|
||||
|
||||
2. [设置] Material.LineColor = FlowColor
|
||||
3. [设置] NiagaraComponent.User.Color = FlowColor
|
||||
```
|
||||
|
||||
## 数据格式
|
||||
|
||||
### 输入数据结构
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "flow_1",
|
||||
"source": {
|
||||
"latitude": 37.7749,
|
||||
"longitude": -122.4194,
|
||||
"name": "San Francisco"
|
||||
},
|
||||
"destination": {
|
||||
"latitude": 1.3521,
|
||||
"longitude": 103.8198,
|
||||
"name": "Singapore"
|
||||
},
|
||||
"data_rate": 5000.0,
|
||||
"data_type": "internet",
|
||||
"status": "active"
|
||||
}
|
||||
```
|
||||
|
||||
## 视觉效果规格
|
||||
|
||||
### 粒子外观
|
||||
|
||||
| 数据类型 | 粒子形状 | 颜色 | 尾迹 |
|
||||
|----------|----------|------|------|
|
||||
| Internet | 圆形光点 | 蓝色 | 短 |
|
||||
| Backbone | 方形光块 | 青色 | 中 |
|
||||
| Cloud | 菱形 | 紫色 | 长 |
|
||||
| AI_Training | 三角形 | 橙色 | 短 |
|
||||
| CDN | 六边形 | 绿色 | 无 |
|
||||
|
||||
### 带宽可视化
|
||||
|
||||
| 带宽范围 | 粒子密度 | 粒子大小 | 速度 |
|
||||
|----------|----------|----------|------|
|
||||
| > 10 Tbps | 高 | 大 | 快 |
|
||||
| 1-10 Tbps | 中 | 中 | 中 |
|
||||
| < 1 Tbps | 低 | 小 | 慢 |
|
||||
|
||||
## 交互效果
|
||||
|
||||
### 悬停效果
|
||||
|
||||
```
|
||||
1. [高亮] 路径线
|
||||
└─ LineWidth: 200 → 300
|
||||
2. [显示] Tooltip
|
||||
└─ 显示: 源、目标、数据速率、类型
|
||||
3. [暂停] 粒子 (可选)
|
||||
```
|
||||
|
||||
### 点击效果
|
||||
|
||||
```
|
||||
1. [聚焦] 相机到流向中心
|
||||
2. [显示] 详细信息面板
|
||||
3. [播放] Sound Effect
|
||||
```
|
||||
|
||||
## 性能优化
|
||||
|
||||
### 视距设置
|
||||
|
||||
```
|
||||
├─ 显示距离: 50000 km
|
||||
├─ 粒子剔除距离: 20000 km
|
||||
└─ 简化粒子距离: 10000 km
|
||||
```
|
||||
|
||||
### 批处理
|
||||
|
||||
```
|
||||
├─ 多个相近流向合并显示
|
||||
├─ 远距离流向使用简化的粒子
|
||||
└─ 禁用低优先级流向的粒子
|
||||
```
|
||||
|
||||
## 使用场景
|
||||
|
||||
### 场景 1: 全球互联网流量
|
||||
|
||||
```
|
||||
DataType: Internet
|
||||
├─ Source: 主要互联网交换中心
|
||||
├─ Destination: 其他地区
|
||||
└─ Visual: 蓝色粒子流
|
||||
```
|
||||
|
||||
### 场景 2: AI 训练数据传输
|
||||
|
||||
```
|
||||
DataType: AI_Training
|
||||
├─ Source: GPU 集群
|
||||
├─ Destination: 数据中心
|
||||
└─ Visual: 橙色高速粒子
|
||||
```
|
||||
|
||||
### 场景 3: CDN 内容分发
|
||||
|
||||
```
|
||||
DataType: CDN
|
||||
├─ Source: 源站
|
||||
├─ Destination: 边缘节点
|
||||
└─ Visual: 绿色扩散粒子
|
||||
```
|
||||
|
||||
## 后端数据映射
|
||||
|
||||
### API 响应格式
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "data_flow",
|
||||
"data": [
|
||||
{
|
||||
"id": "flow_1",
|
||||
"source": {"latitude": 37.77, "longitude": -122.41},
|
||||
"destination": {"latitude": 1.35, "longitude": 103.81},
|
||||
"data_rate": 5000.0,
|
||||
"data_type": "internet"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
287
unreal/Content/Blueprints/BP_DataPoint_Spec.md
Normal file
287
unreal/Content/Blueprints/BP_DataPoint_Spec.md
Normal file
@@ -0,0 +1,287 @@
|
||||
# BP_DataPoint 基类蓝图详细规格
|
||||
|
||||
## 蓝图信息
|
||||
|
||||
| 属性 | 值 |
|
||||
|------|-----|
|
||||
| 蓝图类型 | Actor |
|
||||
| 父类 | `Actor` |
|
||||
| 路径 | `Content/Blueprints/BP_DataPoint.uasset` |
|
||||
|
||||
## 组件列表
|
||||
|
||||
```
|
||||
BP_DataPoint
|
||||
├── SceneRoot (场景根)
|
||||
│ ├── StaticMesh (基础网格 - 球体)
|
||||
│ │ └── Material: M_DataPoint_Base
|
||||
│ ├── NiagaraComponent (粒子光晕)
|
||||
│ │ └── Niagara System: NS_DataPoint_Glow
|
||||
│ ├── WidgetComponent (3D 标签)
|
||||
│ │ └── User Widget: W_DataLabel
|
||||
│ └── SpringArm (弹簧臂 - 用于相机聚焦)
|
||||
│ └── CameraComponent
|
||||
```
|
||||
|
||||
## 变量列表
|
||||
|
||||
| 变量名 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `DataId` | String | `""` | 唯一标识 |
|
||||
| `Name` | String | `"Unknown"` | 显示名称 |
|
||||
| `Source` | String | `"unknown"` | 数据源 |
|
||||
| `DataType` | String | `"point"` | 数据类型 |
|
||||
| `Latitude` | Float | `0.0` | 纬度 |
|
||||
| `Longitude` | Float | `0.0` | 经度 |
|
||||
| `Altitude` | Float | `100000.0` | 高度 (厘米) |
|
||||
| `Country` | String | `""` | 国家 |
|
||||
| `City` | String | `""` | 城市 |
|
||||
| `Performance` | Float | `0.0` | 性能值 |
|
||||
| `Metadata` | JsonObject | `{}` | 元数据 |
|
||||
| `IsSelected` | Boolean | `false` | 是否选中 |
|
||||
| `IsHovered` | Boolean | `false` | 是否悬停 |
|
||||
| `BaseColor` | LinearColor | (1,1,1,1) | 基础颜色 |
|
||||
| `HighlightColor` | LinearColor | (0,1,1,1) | 高亮颜色 |
|
||||
|
||||
## 材质参数
|
||||
|
||||
### M_DataPoint_Base
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `BaseColor` | Vector3 | (1,0,0) | 基础颜色 |
|
||||
| `EmissiveStrength` | Float | `5.0` | 自发光强度 |
|
||||
| `PulseSpeed` | Float | `1.0` | 脉冲速度 |
|
||||
| `PulseIntensity` | Float | `0.5` | 脉冲强度 |
|
||||
| `FresnelPower` | Float | `2.0` | 菲涅尔边缘强度 |
|
||||
|
||||
### NS_DataPoint_Glow (Niagara 参数)
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `User.Color` | LinearColor | (1,0,0,1) | 粒子颜色 |
|
||||
| `User.Size` | Float | `1.0` | 粒子大小 |
|
||||
| `User.Lifetime` | Float | `1.5` | 粒子寿命 |
|
||||
|
||||
## 函数
|
||||
|
||||
### Initialize (String InId, String InName, Float InLat, Float InLon)
|
||||
|
||||
```
|
||||
1. [设置] DataId = InId
|
||||
2. [设置] Name = InName
|
||||
3. [设置] Latitude = InLat
|
||||
4. [设置] Longitude = InLon
|
||||
5. [调用] UpdatePosition()
|
||||
6. [调用] UpdateLabel()
|
||||
```
|
||||
|
||||
### UpdatePosition
|
||||
|
||||
```
|
||||
1. [创建] FGeographicPoint (Latitude, Longitude, Altitude)
|
||||
2. [调用] GeoUtils.LatLonToUEPosition(Point)
|
||||
└─ 返回: UELocation (Vector3)
|
||||
3. [设置] StaticMesh.SetRelativeLocation(UELocation)
|
||||
4. [设置] NiagaraComponent.SetRelativeLocation(UELocation)
|
||||
5. [设置] WidgetComponent.SetRelativeLocation(UELocation + (0,0,200))
|
||||
```
|
||||
|
||||
### UpdateData (Struct NewData)
|
||||
|
||||
```
|
||||
1. [解析] NewData
|
||||
2. [设置] DataId = NewData["id"]
|
||||
3. [设置] Name = NewData["name"]
|
||||
4. [设置] Latitude = NewData["location"]["latitude"]
|
||||
5. [设置] Longitude = NewData["location"]["longitude"]
|
||||
6. [可选] [设置] Performance = NewData["performance"]
|
||||
7. [可选] [设置] Country = NewData["country"]
|
||||
8. [调用] UpdatePosition()
|
||||
9. [调用] UpdateLabel()
|
||||
10. [调用] UpdateMaterial()
|
||||
```
|
||||
|
||||
### UpdateLabel
|
||||
|
||||
```
|
||||
1. [获取] W_DataLabel Widget Reference
|
||||
2. [设置] NameText = Name
|
||||
3. [设置] CountryText = Country
|
||||
4. [设置] PerformanceText = FormatPerformance(Performance)
|
||||
```
|
||||
|
||||
### UpdateMaterial
|
||||
|
||||
```
|
||||
1. [获取] StaticMesh.Material
|
||||
2. [分支] Source
|
||||
├─ "top500":
|
||||
│ └─ [设置] BaseColor = (1, 0.2, 0.2, 1) 红色
|
||||
├─ "epoch_ai_gpu":
|
||||
│ └─ [设置] BaseColor = (1, 0.5, 0, 1) 橙色
|
||||
├─ "huggingface_models":
|
||||
│ └─ [设置] BaseColor = (0.2, 0.5, 1, 1) 蓝色
|
||||
├─ "peeringdb_ixp":
|
||||
│ └─ [设置] BaseColor = (0, 1, 0.5, 1) 青色
|
||||
├─ "peeringdb_network":
|
||||
│ └─ [设置] BaseColor = (0.5, 0, 1, 1) 紫色
|
||||
└─ [默认]:
|
||||
└─ [设置] BaseColor = (1, 1, 1, 1) 白色
|
||||
```
|
||||
|
||||
### FormatPerformance (Float Value) → String
|
||||
|
||||
```
|
||||
1. [分支] Value >= 1000000
|
||||
├─ [是]: 返回 = FString::Printf(TEXT("%.1f EFLOPS"), Value / 1000000)
|
||||
└─ [否]: [分支] Value >= 1000
|
||||
├─ [是]: 返回 = FString::Printf(TEXT("%.1f PFLOPS"), Value / 1000)
|
||||
└─ [否]: 返回 = FString::Printf(TEXT("%.1f TFLOPS"), Value)
|
||||
```
|
||||
|
||||
## 事件
|
||||
|
||||
### OnBeginCursorOver
|
||||
|
||||
```
|
||||
1. [设置] IsHovered = true
|
||||
2. [调用] SetHighlight(true)
|
||||
3. [调用] PlayHoverEffect()
|
||||
```
|
||||
|
||||
### OnEndCursorOver
|
||||
|
||||
```
|
||||
1. [设置] IsHovered = false
|
||||
2. [分支] IsSelected == false
|
||||
└─ [调用] SetHighlight(false)
|
||||
```
|
||||
|
||||
### OnClicked
|
||||
|
||||
```
|
||||
1. [调用] SetSelected(true)
|
||||
2. [调用] BP_GlobeController.OnDataPointSelected(Self)
|
||||
3. [调用] PlayClickEffect()
|
||||
```
|
||||
|
||||
### SetHighlight (Boolean bHighlight)
|
||||
|
||||
```
|
||||
1. [获取] NiagaraComponent
|
||||
2. [分支] bHighlight == true
|
||||
├─ [设置] User.Color = HighlightColor
|
||||
└─ [否则]:
|
||||
├─ [设置] User.Color = BaseColor
|
||||
3. [调用] NiagaraComponent.Activate(bHighlight)
|
||||
```
|
||||
|
||||
### SetSelected (Boolean bSelected)
|
||||
|
||||
```
|
||||
1. [设置] IsSelected = bSelected
|
||||
2. [分支] bSelected == true
|
||||
├─ [设置] StaticMesh.Scale = (1.5, 1.5, 1.5)
|
||||
├─ [调用] SetHighlight(true)
|
||||
└─ [设置] SelectedRing.Visible = true
|
||||
└─ [否则]:
|
||||
├─ [设置] StaticMesh.Scale = (1.0, 1.0, 1.0)
|
||||
├─ [分支] IsHovered == true
|
||||
│ └─ [调用] SetHighlight(true)
|
||||
└─ [设置] SelectedRing.Visible = false
|
||||
```
|
||||
|
||||
### PlayHoverEffect
|
||||
|
||||
```
|
||||
1. [播放] Niagara Particle Burst
|
||||
└─ 粒子数量: 20
|
||||
```
|
||||
|
||||
### PlayClickEffect
|
||||
|
||||
```
|
||||
1. [播放] Sound Effect "DataPoint_Click"
|
||||
2. [播放] Timeline "PulseEffect"
|
||||
└─ 持续时间: 0.5秒
|
||||
```
|
||||
|
||||
## 事件调度器
|
||||
|
||||
| 事件调度器 | 参数 | 说明 |
|
||||
|------------|------|------|
|
||||
| `OnPointSelected` | BP_DataPoint | 点被选中 |
|
||||
| `OnPointHovered` | BP_DataPoint | 鼠标悬停 |
|
||||
| `OnPointClicked` | BP_DataPoint | 点击 |
|
||||
|
||||
## 数据格式
|
||||
|
||||
### 输入数据结构
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "top500_1",
|
||||
"name": "Frontier",
|
||||
"source": "top500",
|
||||
"data_type": "supercomputer",
|
||||
"location": {
|
||||
"latitude": 33.7756,
|
||||
"longitude": -84.3962,
|
||||
"altitude": 0
|
||||
},
|
||||
"country": "US",
|
||||
"city": "Atlanta",
|
||||
"performance": 1682.65,
|
||||
"metadata": {
|
||||
"cores": 8730112,
|
||||
"memory": "5.67 PB",
|
||||
"power": "29.0 MW"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 颜色编码
|
||||
|
||||
| 数据源 | 颜色 | RGB | 说明 |
|
||||
|--------|------|-----|------|
|
||||
| top500 | 🔴 红色 | (1.0, 0.2, 0.2) | TOP500 超算 |
|
||||
| epoch_ai_gpu | 🟠 橙色 | (1.0, 0.5, 0.0) | GPU 集群 |
|
||||
| huggingface_models | 🔵 蓝色 | (0.2, 0.5, 1.0) | HuggingFace 模型 |
|
||||
| peeringdb_ixp | 🩵 青色 | (0.0, 1.0, 0.8) | IXP 互联网交换中心 |
|
||||
| peeringdb_network | 🟣 紫色 | (0.6, 0.0, 1.0) | 网络运营商 |
|
||||
| peeringdb_facility | 🟤 棕色 | (0.6, 0.4, 0.2) | 数据中心 |
|
||||
| teleegeography_cables | 🟡 黄色 | (1.0, 0.8, 0.0) | 海底光缆 |
|
||||
|
||||
## 缩放比例
|
||||
|
||||
| 性能范围 | 缩放 | 说明 |
|
||||
|----------|------|------|
|
||||
| < 1 PFLOPS | 0.5x | 小型系统 |
|
||||
| 1-100 PFLOPS | 1.0x | 中型系统 |
|
||||
| 100-1000 PFLOPS | 1.5x | 大型系统 |
|
||||
| > 1 EFLOPS | 2.0x | 超大规模 |
|
||||
|
||||
## 粒子效果 (Niagara)
|
||||
|
||||
### NS_DataPoint_Glow
|
||||
|
||||
```
|
||||
发射器设置:
|
||||
├─ 发射器类型: 粒子系统
|
||||
├─ 发射模式: 循环
|
||||
├─ 发射速率: 30 粒子/秒
|
||||
├─ 粒子寿命: 1.5 秒
|
||||
└─ 粒子大小: 渐变 (小 → 大)
|
||||
|
||||
渲染设置:
|
||||
├─ 渲染组件: Niagara 粒子
|
||||
├─ 材质: M_Particle_Glow
|
||||
├─ 混合模式: Additive
|
||||
└─ 排序: 无
|
||||
|
||||
颜色渐变:
|
||||
├─ 0%: (1, 1, 1, 1)
|
||||
├─ 50%: (1, 1, 1, 0.8)
|
||||
└─ 100%: (1, 1, 1, 0)
|
||||
```
|
||||
301
unreal/Content/Blueprints/BP_GlobeController_Spec.md
Normal file
301
unreal/Content/Blueprints/BP_GlobeController_Spec.md
Normal file
@@ -0,0 +1,301 @@
|
||||
# BP_GlobeController 蓝图详细规格
|
||||
|
||||
## 蓝图信息
|
||||
|
||||
| 属性 | 值 |
|
||||
|------|-----|
|
||||
| 蓝图类型 | Actor |
|
||||
| 父类 | `CesiumGeoreference` |
|
||||
| 路径 | `Content/Blueprints/BP_GlobeController.uasset` |
|
||||
|
||||
## 组件列表
|
||||
|
||||
```
|
||||
BP_GlobeController
|
||||
├── CesiumGeoreference (场景根组件)
|
||||
│ └── Cesium3DTileset (地球地形)
|
||||
│ └── CesiumSunSky (太阳光照)
|
||||
│ └── BP_DataPointManager (数据点管理器)
|
||||
│ └── BP_CableManager (海缆管理器)
|
||||
│ └── BP_DataFlowManager (数据流管理器)
|
||||
└── CameraRig (相机支架)
|
||||
```
|
||||
|
||||
## 变量列表
|
||||
|
||||
| 变量名 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `API_URL` | String | `http://localhost:8000` | 后端 API 地址 |
|
||||
| `WS_URL` | String | `ws://localhost:8000/ws` | WebSocket 地址 |
|
||||
| `bAutoRotate` | Boolean | `true` | 自动旋转 |
|
||||
| `RotateSpeed` | Float | `0.5` | 旋转速度 |
|
||||
| `SelectedPoint` | BP_DataPoint (Weak) | `None` | 当前选中点 |
|
||||
| `AllDataPoints` | Map<String, BP_DataPoint> | `Empty` | 所有数据点映射 |
|
||||
| `UpdateInterval` | Float | `30.0` | 数据更新间隔(秒) |
|
||||
|
||||
## 事件
|
||||
|
||||
### Event BeginPlay
|
||||
|
||||
```
|
||||
1. [调用] InitializeCesium()
|
||||
└─ 设置 Cesium ion Token (从配置读取)
|
||||
|
||||
2. [调用] ConnectWebSocket()
|
||||
└─ 创建 WebSocket 连接
|
||||
└─ 绑定回调:
|
||||
├─ OnConnected: [调用] HandleConnected()
|
||||
├─ OnMessage: [调用] HandleMessage()
|
||||
└─ OnError: [调用] HandleError()
|
||||
|
||||
3. [设置] Timer by Event
|
||||
└─ 事件: UpdateAllData
|
||||
└─ 时间: UpdateInterval (30秒)
|
||||
```
|
||||
|
||||
### Event Tick
|
||||
|
||||
```
|
||||
1. [分支] bAutoRotate == true?
|
||||
├─ [是]: [调用] RotateGlobe(DeltaSeconds * RotateSpeed)
|
||||
└─ [否]: 跳过
|
||||
```
|
||||
|
||||
## 自定义事件
|
||||
|
||||
### InitializeCesium
|
||||
|
||||
```
|
||||
1. [获取] Get UCesiumRuntimeSettings (来自 Project Settings)
|
||||
2. [设置] Cesium ion Token
|
||||
3. [调用] RefreshTileset()
|
||||
```
|
||||
|
||||
### ConnectWebSocket
|
||||
|
||||
```
|
||||
1. [创建] WebSocket 对象 (WS_URL)
|
||||
2. [绑定] OnConnected → HandleConnected
|
||||
3. [绑定] OnMessage → HandleMessage
|
||||
4. [绑定] OnError → HandleError
|
||||
5. [调用] Connect()
|
||||
```
|
||||
|
||||
### HandleConnected
|
||||
|
||||
```
|
||||
1. [打印] "WebSocket Connected!" (绿色)
|
||||
2. [调用] RequestAllData()
|
||||
```
|
||||
|
||||
### HandleMessage (String Message)
|
||||
|
||||
```
|
||||
1. [解析] JSON Parse String → MessageData
|
||||
2. [获取] MessageData["type"] → Type
|
||||
|
||||
3. [分支] Type
|
||||
├─ "update":
|
||||
│ ├─ [获取] MessageData["data"] → Data
|
||||
│ ├─ [获取] Data["source"] → Source
|
||||
│ ├─ [获取] Data["action"] → Action
|
||||
│ └─ [调用] ProcessDataUpdate(Source, Action, Data)
|
||||
│
|
||||
├─ "alarm":
|
||||
│ └─ [调用] ShowAlarm(Data)
|
||||
│
|
||||
└─ [默认]:
|
||||
└─ [打印] "Unknown message type" (黄色)
|
||||
```
|
||||
|
||||
### ProcessDataUpdate (String Source, String Action, Struct Data)
|
||||
|
||||
```
|
||||
1. [分支] Source
|
||||
├─ "top500":
|
||||
│ └─ [调用] UpdateSupercomputer(Action, Data)
|
||||
│
|
||||
├─ "peeringdb_ixp":
|
||||
│ └─ [调用] UpdateIXPNode(Action, Data)
|
||||
│
|
||||
├─ "peeringdb_network":
|
||||
│ └─ [调用] UpdateNetworkNode(Action, Data)
|
||||
│
|
||||
├─ "telegeography_cables":
|
||||
│ └─ [调用] UpdateSubmarineCable(Action, Data)
|
||||
│
|
||||
└─ [默认]:
|
||||
└─ [打印] Unknown source (黄色)
|
||||
```
|
||||
|
||||
### UpdateSupercomputer (String Action, Struct Data)
|
||||
|
||||
```
|
||||
1. [获取] Data["id"] → PointId
|
||||
|
||||
2. [分支] Action
|
||||
├─ "add":
|
||||
│ ├─ [调用] BP_DataPointManager.CreateDataPoint(Data)
|
||||
│ │ └─ 返回: NewPoint
|
||||
│ ├─ [获取] NewPoint.Id → Key
|
||||
│ └─ [设置] AllDataPoints[Key] = NewPoint
|
||||
│
|
||||
├─ "update":
|
||||
│ ├─ [获取] AllDataPoints[PointId] → ExistingPoint
|
||||
│ ├─ [分支] ExistingPoint != None
|
||||
│ │ └─ [调用] ExistingPoint.UpdateData(Data)
|
||||
│ └─ [否则]:
|
||||
│ └─ [调用] UpdateSupercomputer("add", Data)
|
||||
│
|
||||
└─ "remove":
|
||||
├─ [获取] AllDataPoints[PointId] → ExistingPoint
|
||||
├─ [分支] ExistingPoint != None
|
||||
│ └─ [调用] ExistingPoint.Destroy()
|
||||
└─ [设置] AllDataPoints.Remove(PointId)
|
||||
```
|
||||
|
||||
### UpdateSubmarineCable (String Action, Struct Data)
|
||||
|
||||
```
|
||||
1. [获取] Data["id"] → CableId
|
||||
|
||||
2. [分支] Action
|
||||
├─ "add":
|
||||
│ ├─ [调用] BP_CableManager.CreateCable(Data)
|
||||
│ │ └─ 返回: NewCable
|
||||
│ ├─ [获取] NewCable.Id → Key
|
||||
│ └─ [设置] AllCables[Key] = NewCable
|
||||
│
|
||||
├─ "update":
|
||||
│ ├─ [获取] AllCables[CableId] → ExistingCable
|
||||
│ └─ [分支] ExistingCable != None
|
||||
│ └─ [调用] ExistingCable.UpdateData(Data)
|
||||
│
|
||||
└─ "remove":
|
||||
├─ [获取] AllCables[CableId] → ExistingCable
|
||||
├─ [分支] ExistingCable != None
|
||||
│ └─ [调用] ExistingCable.Destroy()
|
||||
└─ [设置] AllCables.Remove(CableId)
|
||||
```
|
||||
|
||||
### UpdateAllData
|
||||
|
||||
```
|
||||
1. [调用] HTTP Request (GET /api/v1/collected/summary)
|
||||
2. [解析] JSON Response
|
||||
3. [打印] "Data Updated: {Total} records"
|
||||
```
|
||||
|
||||
### RequestAllData
|
||||
|
||||
```
|
||||
1. [调用] HTTP Request (GET /api/v1/collected?limit=10000)
|
||||
2. [解析] JSON Response → DataArray
|
||||
3. [循环] For Each Data in DataArray
|
||||
├─ [获取] Data["source"] → Source
|
||||
└─ [调用] ProcessDataUpdate(Source, "add", Data)
|
||||
```
|
||||
|
||||
## 辅助函数
|
||||
|
||||
### RotateGlobe (Float Delta)
|
||||
|
||||
```
|
||||
1. [获取] Self.ActorRotation → CurrentRotation
|
||||
2. [计算] NewRotation = CurrentRotation + (0, Delta * 10, 0)
|
||||
3. [设置] Self.ActorRotation = NewRotation
|
||||
```
|
||||
|
||||
### FocusOnPoint (BP_DataPoint Target)
|
||||
|
||||
```
|
||||
1. [分支] Target != None
|
||||
├─ [获取] Target.Location → PointLocation
|
||||
├─ [获取] CameraRig.Camera → MainCamera
|
||||
├─ [获取] PointLocation.Latitude → Lat
|
||||
├─ [获取] PointLocation.Longitude → Lon
|
||||
├─ [调用] CesiumGeoreference.SetView(Lat, Lon, 500000)
|
||||
└─ [设置] SelectedPoint = Target
|
||||
```
|
||||
|
||||
### ShowAlarm (Struct AlarmData)
|
||||
|
||||
```
|
||||
1. [创建] Widget W_AlarmPanel
|
||||
2. [设置] W_AlarmPanel.Data = AlarmData
|
||||
3. [添加到视口] Add to Viewport
|
||||
4. [播放动画] W_AlarmPanel.FadeIn
|
||||
5. [设置计时器] 5秒后调用 HideAlarm()
|
||||
```
|
||||
|
||||
## 接口实现
|
||||
|
||||
### IWebSocketCallback
|
||||
|
||||
```
|
||||
OnConnected:
|
||||
└─ [调用] HandleConnected()
|
||||
|
||||
OnMessage (String Message):
|
||||
└─ [调用] HandleMessage(Message)
|
||||
|
||||
OnError (String Error):
|
||||
└─ [打印] "WebSocket Error: {Error}" (红色)
|
||||
|
||||
OnClosed (Int32 Code, String Reason):
|
||||
└─ [打印] "WebSocket Closed: {Code} - {Reason}" (黄色)
|
||||
└─ [设置计时器] 5秒后调用 Reconnect()
|
||||
```
|
||||
|
||||
## 事件调度器
|
||||
|
||||
| 事件调度器 | 参数 | 说明 |
|
||||
|------------|------|------|
|
||||
| `OnDataPointSelected` | BP_DataPoint | 数据点被选中 |
|
||||
| `OnAlarmReceived` | Struct AlarmData | 收到告警 |
|
||||
| `OnConnectionStatus` | Boolean | 连接状态变化 |
|
||||
|
||||
## 后端 API 对接
|
||||
|
||||
### HTTP 请求
|
||||
|
||||
| 操作 | 方法 | 端点 | 说明 |
|
||||
|------|------|------|------|
|
||||
| 获取汇总 | GET | `/api/v1/collected/summary` | 获取数据统计 |
|
||||
| 获取TOP500 | GET | `/api/v1/collected?source=top500` | 获取超算数据 |
|
||||
| 获取海缆 | GET | `/api/v1/collected?source=telegeography_cables` | 获取海缆数据 |
|
||||
| 获取全部 | GET | `/api/v1/collected?limit=10000` | 获取所有数据 |
|
||||
|
||||
### WebSocket 消息
|
||||
|
||||
**订阅:**
|
||||
```json
|
||||
{
|
||||
"action": "subscribe",
|
||||
"channels": ["updates", "alarms"]
|
||||
}
|
||||
```
|
||||
|
||||
**更新:**
|
||||
```json
|
||||
{
|
||||
"type": "update",
|
||||
"data": {
|
||||
"source": "top500",
|
||||
"action": "add",
|
||||
"payload": { ... }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**告警:**
|
||||
```json
|
||||
{
|
||||
"type": "alarm",
|
||||
"data": {
|
||||
"severity": "high",
|
||||
"message": "数据采集失败",
|
||||
"source": "peeringdb_ixp"
|
||||
}
|
||||
}
|
||||
```
|
||||
314
unreal/Content/Blueprints/BP_SubmarineCable_Spec.md
Normal file
314
unreal/Content/Blueprints/BP_SubmarineCable_Spec.md
Normal file
@@ -0,0 +1,314 @@
|
||||
# BP_SubmarineCable 海底光缆蓝图详细规格
|
||||
|
||||
## 蓝图信息
|
||||
|
||||
| 属性 | 值 |
|
||||
|------|-----|
|
||||
| 蓝图类型 | Actor |
|
||||
| 父类 | `Actor` |
|
||||
| 路径 | `Content/Blueprints/BP_SubmarineCable.uasset` |
|
||||
|
||||
## 组件列表
|
||||
|
||||
```
|
||||
BP_SubmarineCable
|
||||
├── SceneRoot (场景根)
|
||||
│ ├── SplineComponent (路径样条)
|
||||
│ │ └── [动态] 点数量根据路径数据动态创建
|
||||
│ ├── CableMesh (光缆几何体)
|
||||
│ │ └── SplineMeshComponent × N (多个样条网格)
|
||||
│ │ └── Material: M_Cable
|
||||
│ ├── FlowParticles (流向粒子)
|
||||
│ │ └── NiagaraComponent
|
||||
│ │ └── NS_DataFlow (粒子系统)
|
||||
│ └── EndPointMarkers (端点标记)
|
||||
│ ├── BP_DataPoint (起点标记)
|
||||
│ └── BP_DataPoint (终点标记)
|
||||
```
|
||||
|
||||
## 变量列表
|
||||
|
||||
| 变量名 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `CableId` | String | `""` | 光缆唯一标识 |
|
||||
| `Name` | String | `"Unknown Cable"` | 光缆名称 |
|
||||
| `CableType` | ESubmarineCableType | `Main` | 光缆类型 |
|
||||
| `Bandwidth` | Float | `1000.0` | 带宽 (Tbps) |
|
||||
| `Length` | Float | `0.0` | 长度 (公里) |
|
||||
| `Owner` | String | `""` | 运营商 |
|
||||
| `IsActive` | Boolean | `true` | 是否激活 |
|
||||
| `PathPoints` | Array<GeographicPoint> | `[]` | 路径点数组 |
|
||||
| `StartPoint` | GeographicPoint | - | 起点 |
|
||||
| `EndPoint` | GeographicPoint | - | 终点 |
|
||||
| `CableColor` | LinearColor | (1.0, 0.8, 0.0, 1) | 光缆颜色 |
|
||||
|
||||
## 枚举定义
|
||||
|
||||
### ESubmarineCableType
|
||||
|
||||
| 枚举值 | 说明 |
|
||||
|--------|------|
|
||||
| `Main` | 主干光缆 |
|
||||
| `Branch` | 分支光缆 |
|
||||
| `Regional` | 区域光缆 |
|
||||
| `Private` | 私有光缆 |
|
||||
|
||||
## 组件详情
|
||||
|
||||
### SplineComponent
|
||||
|
||||
```
|
||||
设置:
|
||||
├─ 闭合: false (光缆通常不闭合)
|
||||
├─ 插值: 曲线插值
|
||||
└─ 点数: PathPoints.Length
|
||||
```
|
||||
|
||||
### SplineMeshComponent (用于渲染)
|
||||
|
||||
```
|
||||
每个段创建一个 SplineMeshComponent:
|
||||
├─ StartLocation: 样条点[i] 的 UE 坐标
|
||||
├─ EndLocation: 样条点[i+1] 的 UE 坐标
|
||||
├─ StartTangent: 样条切线
|
||||
├─ EndTangent: 样条切线
|
||||
└─ Material: M_Cable
|
||||
```
|
||||
|
||||
## 材质规格
|
||||
|
||||
### M_Cable (光缆材质)
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `BaseColor` | Vector3 | (1.0, 0.8, 0.0) | 金黄色 |
|
||||
| `Metallic` | Float | `0.8` | 金属度 |
|
||||
| `Roughness` | Float | `0.3` | 粗糙度 |
|
||||
| `EmissiveStrength` | Float | `2.0` | 自发光强度 |
|
||||
| `PulseSpeed` | Float | `0.5` | 脉冲速度 |
|
||||
| `FlowDirection` | Float | `1.0` | 流向 (1=正向, -1=反向) |
|
||||
|
||||
### M_Cable_Inactive (非激活状态)
|
||||
|
||||
```
|
||||
基于 M_Cable:
|
||||
├─ EmissiveStrength: 0.2
|
||||
├─ Saturation: 0.3
|
||||
└─ Color: 灰色
|
||||
```
|
||||
|
||||
## 粒子效果 (NS_DataFlow)
|
||||
|
||||
### 粒子系统参数
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `User.FlowColor` | LinearColor | (1.0, 0.8, 0.0, 1) | 粒子颜色 |
|
||||
| `User.FlowSpeed` | Float | `100.0` | 粒子速度 |
|
||||
| `User.FlowDensity` | Float | `1.0` | 粒子密度 |
|
||||
| `User.FlowDirection` | Float | `1.0` | 流向 |
|
||||
|
||||
### 粒子行为
|
||||
|
||||
```
|
||||
1. 粒子沿样条路径移动
|
||||
2. 速度 = Bandwidth / 1000 (归一化)
|
||||
3. 颜色根据带宽变化:
|
||||
├─ > 1000 Tbps: 绿色 (繁忙)
|
||||
├─ 500-1000 Tbps: 青色 (正常)
|
||||
├─ 100-500 Tbps: 黄色 (空闲)
|
||||
└─ < 100 Tbps: 红色 (低负载)
|
||||
```
|
||||
|
||||
## 函数
|
||||
|
||||
### Initialize (Struct CableData)
|
||||
|
||||
```
|
||||
1. [解析] CableData
|
||||
2. [设置] CableId = CableData["id"]
|
||||
3. [设置] Name = CableData["name"]
|
||||
4. [设置] Bandwidth = CableData["bandwidth"]
|
||||
5. [设置] Length = CableData["length"]
|
||||
6. [设置] Owner = CableData["owner"]
|
||||
7. [获取] CableData["path"] → PathArray
|
||||
8. [设置] PathPoints = ConvertToGeoPoints(PathArray)
|
||||
9. [调用] BuildSpline()
|
||||
10. [调用] UpdateMaterial()
|
||||
```
|
||||
|
||||
### BuildSpline
|
||||
|
||||
```
|
||||
1. [清空] SplineComponent.Points
|
||||
2. [循环] For Each Point in PathPoints
|
||||
├─ [计算] UEPosition = GeoUtils.LatLonToUE(Point)
|
||||
└─ [添加] SplineComponent.AddSplinePoint(UEPosition)
|
||||
|
||||
3. [循环] For i = 0 to PathPoints.Length - 2
|
||||
├─ [创建] SplineMeshComponent
|
||||
├─ [设置] StartLocation = SplinePoint[i]
|
||||
├─ [设置] EndLocation = SplinePoint[i+1]
|
||||
├─ [设置] StartTangent = SplineTangent[i]
|
||||
├─ [设置] EndTangent = SplineTangent[i+1]
|
||||
└─ [添加] 到 CableMeshComponents 数组
|
||||
```
|
||||
|
||||
### UpdateMaterial
|
||||
|
||||
```
|
||||
1. [计算] FlowSpeed = Bandwidth / 1000 * 50
|
||||
2. [获取] NiagaraComponent
|
||||
3. [设置] User.FlowSpeed = FlowSpeed
|
||||
4. [分支] Bandwidth
|
||||
├─ > 1000: [设置] FlowColor = (0, 1, 0, 1) 绿色
|
||||
├─ 500-1000: [设置] FlowColor = (0, 1, 1, 1) 青色
|
||||
├─ 100-500: [设置] FlowColor = (1, 1, 0, 1) 黄色
|
||||
└─ < 100: [设置] FlowColor = (1, 0, 0, 1) 红色
|
||||
5. [设置] Material.FlowColor = FlowColor
|
||||
```
|
||||
|
||||
### UpdateData (Struct NewData)
|
||||
|
||||
```
|
||||
1. [设置] Bandwidth = NewData["bandwidth"]
|
||||
2. [设置] IsActive = NewData["is_active"]
|
||||
3. [调用] UpdateMaterial()
|
||||
4. [调用] UpdateParticles()
|
||||
```
|
||||
|
||||
### SetFlowDirection (Float Direction)
|
||||
|
||||
```
|
||||
1. [设置] Material.FlowDirection = Direction
|
||||
2. [设置] NiagaraComponent.FlowDirection = Direction
|
||||
3. [分支] Direction > 0
|
||||
├─ [是]: [设置] StartMarker.Icon = 起点图标
|
||||
└─ [否]: [设置] StartMarker.Icon = 终点图标
|
||||
```
|
||||
|
||||
## 事件
|
||||
|
||||
### OnBeginCursorOver
|
||||
|
||||
```
|
||||
1. [设置] CableMesh.OverlayMaterial = M_Highlight
|
||||
2. [设置] HighlightStrength = 0.3 → 1.0 (渐变)
|
||||
3. [创建/显示] Tooltip Widget
|
||||
└─ 显示: 名称、带宽、长度、运营商
|
||||
```
|
||||
|
||||
### OnEndCursorOver
|
||||
|
||||
```
|
||||
1. [设置] CableMesh.OverlayMaterial = nullptr
|
||||
2. [隐藏] Tooltip Widget
|
||||
```
|
||||
|
||||
### OnClicked
|
||||
|
||||
```
|
||||
1. [调用] FocusOnCable()
|
||||
2. [调用] ShowCableDetails()
|
||||
```
|
||||
|
||||
### FocusOnCable
|
||||
|
||||
```
|
||||
1. [获取] Self.Bounds → CableBounds
|
||||
2. [获取] CameraRig.Camera
|
||||
3. [计算] ViewLocation = CableBounds.Center + (0, 0, 500000)
|
||||
4. [调用] Camera.SetViewTargetWithBlend(ViewLocation)
|
||||
5. [播放] Timeline "FlyToTarget"
|
||||
```
|
||||
|
||||
## 数据格式
|
||||
|
||||
### 输入数据结构
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "cable_seamewe4",
|
||||
"name": "SEA-ME-WE 4",
|
||||
"source": "telegeography_cables",
|
||||
"data_type": "submarine_cable",
|
||||
"metadata": {
|
||||
"bandwidth": 2920.0,
|
||||
"length": 19650.0,
|
||||
"owner": "Telecom Italia",
|
||||
"cable_type": "Main",
|
||||
"is_active": true,
|
||||
"owners_list": [
|
||||
"Telecom Italia",
|
||||
"Orange",
|
||||
"Singtel",
|
||||
"MCI"
|
||||
],
|
||||
"rfs_date": "2005-12-15"
|
||||
},
|
||||
"path": [
|
||||
{"latitude": 1.3521, "longitude": 103.8198},
|
||||
{"latitude": 3.1390, "longitude": 101.6869},
|
||||
{"latitude": 5.4141, "longitude": 100.3297},
|
||||
{"latitude": 13.7563, "longitude": 100.5018},
|
||||
{"latitude": 21.4858, "longitude": 101.0400}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 带宽颜色编码
|
||||
|
||||
| 带宽范围 | 颜色 | RGB | 含义 |
|
||||
|----------|------|-----|------|
|
||||
| > 2000 Tbps | 🟢 亮绿 | (0.2, 1.0, 0.2) | 高负载/骨干 |
|
||||
| 1000-2000 Tbps | 🟢 绿色 | (0.4, 1.0, 0.4) | 繁忙 |
|
||||
| 500-1000 Tbps | 🔵 青色 | (0.2, 1.0, 1.0) | 正常 |
|
||||
| 100-500 Tbps | 🟡 黄色 | (1.0, 1.0, 0.2) | 空闲 |
|
||||
| < 100 Tbps | 🔴 红色 | (1.0, 0.3, 0.3) | 低负载 |
|
||||
|
||||
## 光缆类型图标
|
||||
|
||||
| 类型 | 图标 | 颜色 |
|
||||
|------|------|------|
|
||||
| Main | ⬛ 主干 | 金色 |
|
||||
| Branch | ┊ 分支 | 银色 |
|
||||
| Regional | ∿ 区域 | 铜色 |
|
||||
| Private | 🔒 私有 | 灰色 |
|
||||
|
||||
## 性能优化
|
||||
|
||||
### LOD 设置
|
||||
|
||||
```
|
||||
LOD0 (近距离):
|
||||
├─ 高精度网格
|
||||
├─ 完整纹理
|
||||
└─ 完整粒子
|
||||
|
||||
LOD1 (中距离):
|
||||
├─ 中精度网格
|
||||
├─ 半分辨率纹理
|
||||
└─ 简化粒子
|
||||
|
||||
LOD2 (远距离):
|
||||
├─ 低精度网格
|
||||
└─ 禁用粒子
|
||||
```
|
||||
|
||||
### 视锥剔除
|
||||
|
||||
```
|
||||
├─ 启用: true
|
||||
└─ 剔除距离: 50000 km
|
||||
```
|
||||
|
||||
## 知名海缆示例
|
||||
|
||||
| 名称 | 长度 | 带宽 | 起点 | 终点 |
|
||||
|------|------|------|------|------|
|
||||
| SEA-ME-WE 4 | 19,650 km | 2.92 Pbps | 新加坡 | 法国 |
|
||||
| SEA-ME-WE 5 | 20,000 km | 2.44 Pbps | 新加坡 | 法国 |
|
||||
| FASTER | 11,629 km | 6.08 Pbps | 日本 | 美国 |
|
||||
| Apollo | 13,000 km | 3.20 Pbps | 美国 | 法国 |
|
||||
| Pacific Light | 12,120 km | 2.88 Pbps | 香港 | 美国 |
|
||||
| Hainan to Singapore | 2,936 km | 6.0 Pbps | 海南 | 新加坡 |
|
||||
278
unreal/Content/Blueprints/BP_Supercomputer_Spec.md
Normal file
278
unreal/Content/Blueprints/BP_Supercomputer_Spec.md
Normal file
@@ -0,0 +1,278 @@
|
||||
# BP_Supercomputer TOP500 超算蓝图详细规格
|
||||
|
||||
## 蓝图信息
|
||||
|
||||
| 属性 | 值 |
|
||||
|------|-----|
|
||||
| 蓝图类型 | Actor (BP_DataPoint 子类) |
|
||||
| 父类 | `BP_DataPoint` |
|
||||
| 路径 | `Content/Blueprints/BP_Supercomputer.uasset` |
|
||||
|
||||
## 组件列表
|
||||
|
||||
```
|
||||
BP_Supercomputer (继承自 BP_DataPoint)
|
||||
├── [继承] SceneRoot
|
||||
│ ├── [继承] StaticMesh (球体)
|
||||
│ │ └── Material: M_Supercomputer (红色自发光)
|
||||
│ ├── [继承] NiagaraComponent (光环粒子)
|
||||
│ │ └── NS_Supercomputer_Glow (红色光环)
|
||||
│ ├── [继承] WidgetComponent (标签)
|
||||
│ │ └── User Widget: W_SupercomputerLabel
|
||||
│ ├── [新增] RingMesh (圆环网格)
|
||||
│ │ └── Material: M_Ring_Pulse (脉冲圆环)
|
||||
│ └── [新增] PerformanceText3D (3D 性能文字)
|
||||
│ └── Font: Default
|
||||
```
|
||||
|
||||
## 变量列表 (新增)
|
||||
|
||||
| 变量名 | 类型 | 默认值 | 说明 |
|
||||
|--------|------|--------|------|
|
||||
| `Rmax` | Float | `1682.65` | Rmax 值 (TFLOPS) |
|
||||
| `Rpeak` | Float | `2000.0` | Rpeak 值 (TFLOPS) |
|
||||
| `CoreCount` | Integer | `0` | CPU 核心数 |
|
||||
| `NodeCount` | Integer | `0` | 节点数 |
|
||||
| `Interconnect` | String | `"InfiniBand"` | 互联网络 |
|
||||
| `OperatingSystem` | String | `"Linux"` | 操作系统 |
|
||||
| `Vendor` | String | `"HPE"` | 厂商 |
|
||||
| `Model` | String | `"Expresso"` | 型号 |
|
||||
|
||||
## 函数覆盖 (Override)
|
||||
|
||||
### UpdateLabel (Override)
|
||||
|
||||
```
|
||||
1. [父调用] BP_DataPoint.UpdateLabel()
|
||||
|
||||
2. [获取] W_SupercomputerLabel Widget
|
||||
3. [设置] NameText = Name
|
||||
4. [设置] CountryText = Country
|
||||
5. [设置] PerformanceText = FormatPerformance(Rmax)
|
||||
6. [设置] CoreText = FormatNumber(CoreCount)
|
||||
7. [设置] VendorText = Vendor
|
||||
```
|
||||
|
||||
### UpdateMaterial (Override)
|
||||
|
||||
```
|
||||
1. [获取] StaticMesh.Material
|
||||
2. [设置] BaseColor = (1.0, 0.1, 0.1, 1) 红色
|
||||
3. [设置] EmissiveStrength = 3.0 + (Rmax / 100)
|
||||
4. [计算] PulseSpeed = 0.5 + (Rmax / 1000)
|
||||
5. [设置] PulseSpeed_Material = PulseSpeed
|
||||
```
|
||||
|
||||
### UpdateSize (Override)
|
||||
|
||||
```
|
||||
1. [计算] ScaleFactor = 0.5 + (Rmax / 500)
|
||||
├─ < 100 TFLOPS: 0.5x
|
||||
├─ 100-500 TFLOPS: 1.0x
|
||||
├─ 500-1000 TFLOPS: 1.5x
|
||||
└─ > 1000 TFLOPS: 2.0x
|
||||
|
||||
2. [设置] StaticMesh.SetWorldScale3D(ScaleFactor)
|
||||
```
|
||||
|
||||
## 材质规格
|
||||
|
||||
### M_Supercomputer
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `BaseColor` | Vector3 | (1.0, 0.1, 0.1) | 红色 |
|
||||
| `EmissiveColor` | Vector3 | (1.0, 0.0, 0.0) | 自发光颜色 |
|
||||
| `EmissiveStrength` | Float | `5.0` | 自发光强度 |
|
||||
| `PulseSpeed` | Float | `1.0` | 脉冲速度 |
|
||||
| `PulseIntensity` | Float | `0.3` | 脉冲强度 |
|
||||
| `FresnelPower` | Float | `2.5` | 菲涅尔效果 |
|
||||
|
||||
### M_Ring_Pulse
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `RingColor` | Vector4 | (1.0, 0.2, 0.2, 1.0) | 圆环颜色 |
|
||||
| `RingWidth` | Float | `0.02` | 圆环宽度 |
|
||||
| `PulseSpeed` | Float | `1.0` | 脉冲速度 |
|
||||
| `GlowIntensity` | Float | `10.0` | 发光强度 |
|
||||
|
||||
## 粒子效果 (Niagara)
|
||||
|
||||
### NS_Supercomputer_Glow
|
||||
|
||||
```
|
||||
发射器设置:
|
||||
├─ 发射器类型: 粒子系统
|
||||
├─ 发射模式: 循环
|
||||
├─ 发射速率: 20 粒子/秒
|
||||
├─ 粒子寿命: 2.0 秒
|
||||
└─ 粒子大小: 50 → 200 cm
|
||||
|
||||
颜色渐变:
|
||||
├─ 0%: (1.0, 0.1, 0.1, 0.8) 红色
|
||||
├─ 50%: (1.0, 0.1, 0.1, 0.4)
|
||||
└─ 100%: (1.0, 0.1, 0.1, 0.0)
|
||||
|
||||
渲染:
|
||||
├─ 材质: M_Particle_Glow_Additive
|
||||
└─ 混合模式: Additive
|
||||
```
|
||||
|
||||
## UI 标签 (W_SupercomputerLabel)
|
||||
|
||||
### 组件结构
|
||||
|
||||
```
|
||||
W_SupercomputerLabel
|
||||
├── CanvasPanel
|
||||
│ ├── Background (黑色半透明背景)
|
||||
│ │ └── Size: 300x150
|
||||
│ │ └── Opacity: 0.8
|
||||
│ ├── NameText (名称)
|
||||
│ │ └── Text: "Frontier"
|
||||
│ │ └── Color: 白色
|
||||
│ │ └── Font Size: 18
|
||||
│ ├── CountryText (国家)
|
||||
│ │ └── Text: "🇺🇸 United States"
|
||||
│ │ └── Color: 浅灰色
|
||||
│ │ └── Font Size: 14
|
||||
│ ├── PerformancePanel (性能面板)
|
||||
│ │ ├── RmaxLabel
|
||||
│ │ │ └── Text: "Rmax"
|
||||
│ │ │ └── Color: 浅灰色
|
||||
│ │ ├── RmaxValue
|
||||
│ │ │ └── Text: "1,682.65 TFLOPS"
|
||||
│ │ │ └── Color: 亮红色
|
||||
│ │ │ └── Font Size: 24
|
||||
│ │ │ └── Font Weight: Bold
|
||||
│ │ ├── RpeakLabel
|
||||
│ │ │ └── Text: "Rpeak"
|
||||
│ │ ├── RpeakValue
|
||||
│ │ │ └── Text: "2,000.00 TFLOPS"
|
||||
│ │ │ └── Color: 灰色
|
||||
│ │ └── Font Size: 12
|
||||
│ ├── SpecsPanel (规格面板)
|
||||
│ │ ├── CoresText
|
||||
│ │ │ └── Text: "8,730,112 Cores"
|
||||
│ │ ├── NodesText
|
||||
│ │ │ └── Text: "76,032 Nodes"
|
||||
│ │ ├── InterconnectText
|
||||
│ │ │ └── Text: "InfiniBand HDR"
|
||||
│ │ └── VendorText
|
||||
│ │ └── Text: "HPE"
|
||||
│ └── LineSeparator (分隔线)
|
||||
│ └── Color: 红色
|
||||
```
|
||||
|
||||
## 数据格式
|
||||
|
||||
### 输入数据结构
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "top500_1",
|
||||
"name": "Frontier",
|
||||
"source": "top500",
|
||||
"data_type": "supercomputer",
|
||||
"location": {
|
||||
"latitude": 33.7756,
|
||||
"longitude": -84.3962,
|
||||
"altitude": 0
|
||||
},
|
||||
"country": "US",
|
||||
"city": "Atlanta",
|
||||
"metadata": {
|
||||
"rmax": 1682.65,
|
||||
"rpeak": 2000.00,
|
||||
"cores": 8730112,
|
||||
"nodes": 76032,
|
||||
"interconnect": "InfiniBand HDR",
|
||||
"operating_system": "Linux",
|
||||
"vendor": "HPE",
|
||||
"model": "ExaScale"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 性能格式化函数
|
||||
|
||||
### FormatPerformance (Float TFLOPS) → String
|
||||
|
||||
```
|
||||
如果 TFLOPS >= 1000000:
|
||||
返回 = FString::Printf(TEXT("%.2f EFLOPS"), TFLOPS / 1000000)
|
||||
否则如果 TFLOPS >= 1000:
|
||||
返回 = FString::Printf(TEXT("%.2f PFLOPS"), TFLOPS / 1000)
|
||||
否则:
|
||||
返回 = FString::Printf(TEXT("%.2f TFLOPS"), TFLOPS)
|
||||
```
|
||||
|
||||
### FormatNumber (Integer) → String
|
||||
|
||||
```
|
||||
如果 Number >= 1000000:
|
||||
返回 = FString::Printf(TEXT("%dM"), Number / 1000000)
|
||||
否则如果 Number >= 1000:
|
||||
返回 = FString::Printf(TEXT("%dK"), Number / 1000)
|
||||
否则:
|
||||
返回 = FString::Printf(TEXT("%d"), Number)
|
||||
```
|
||||
|
||||
## TOP500 前 10 名 (测试数据)
|
||||
|
||||
| 排名 | 名称 | 位置 | Rmax (PFLOPS) | 国家 |
|
||||
|------|------|------|---------------|------|
|
||||
| 1 | Frontier | 美国 | 1,682.65 | 🇺🇸 |
|
||||
| 2 | Aurora | 美国 | 1,206.00 | 🇺🇸 |
|
||||
| 3 | Eagle | 美国 | 561.00 | 🇺🇸 |
|
||||
| 4 | MareNostrum5 | 西班牙 | 175.00 | 🇪🇸 |
|
||||
| 5 | LUMI | 芬兰 | 151.90 | 🇫🇮 |
|
||||
| 6 | Leonardo | 意大利 | 148.70 | 🇮🇹 |
|
||||
| 7 | Summit | 美国 | 148.60 | 🇺🇸 |
|
||||
| 8 | Sierra | 美国 | 119.40 | 🇺🇸 |
|
||||
| 9 | Sunway TaihuLight | 中国 | 93.01 | 🇨🇳 |
|
||||
| 10 | Tianhe-2A | 中国 | 61.44 | 🇨🇳 |
|
||||
|
||||
## 交互效果
|
||||
|
||||
### 悬停效果 (OnHover)
|
||||
|
||||
```
|
||||
1. [播放] Niagara Burst (红色粒子)
|
||||
└─ 粒子数量: 30
|
||||
2. [播放] Sound "Hover_Enter"
|
||||
3. [设置] RingMesh.Visible = true
|
||||
4. [播放] Timeline "RingExpand"
|
||||
└─ 持续时间: 0.3秒
|
||||
5. [设置] WidgetPanel.Opacity = 1.0
|
||||
```
|
||||
|
||||
### 点击效果 (OnClick)
|
||||
|
||||
```
|
||||
1. [播放] Sound "Select"
|
||||
2. [播放] Timeline "Pulse"
|
||||
└─ 持续时间: 0.5秒
|
||||
└─ 缩放变化: 1.0x → 1.3x → 1.0x
|
||||
3. [调用] FocusCamera()
|
||||
```
|
||||
|
||||
### 聚焦相机 (FocusCamera)
|
||||
|
||||
```
|
||||
1. [获取] Self.Location → PointLoc
|
||||
2. [获取] BP_GlobeController.Camera
|
||||
3. [计算] CameraOffset = (0, 0, 500000)
|
||||
4. [调用] Camera.SetViewTargetWithBlend(PointLoc + CameraOffset)
|
||||
5. [播放] Camera Shake "Focus"
|
||||
```
|
||||
|
||||
## 颜色方案
|
||||
|
||||
| 性能级别 | 颜色 | RGB | 圆环颜色 |
|
||||
|----------|------|-----|----------|
|
||||
| > 1 EFLOPS | 暗红色 | (0.8, 0, 0) | 脉冲红 |
|
||||
| 500T - 1E | 红色 | (1.0, 0.1, 0.1) | 脉冲橙 |
|
||||
| 100T - 500T | 橙色 | (1.0, 0.4, 0.1) | 脉冲黄 |
|
||||
| < 100T | 黄色 | (1.0, 0.7, 0.1) | 脉冲白 |
|
||||
Reference in New Issue
Block a user