feat(realtime): 增加目标接收计数与频率计算支持
- 在 Target 结构体中新增 received_count 字段,用于跟踪每个目标在当前内存轨迹中的接收更新次数。 - 实现 ReceptionRate 结构体,计算目标更新频率,并在 State 中维护每个目标的接收率。 - 更新相关测试,确保接收计数和频率计算的准确性。 - 修改 Web UI 以显示目标的接收频率,提升用户体验。 - 升级协议版本至 4,确保后端、Worker 和前端的一致性。
This commit is contained in:
+5
-1
@@ -387,6 +387,7 @@ mod tests {
|
||||
position_generation: 0,
|
||||
observation: o,
|
||||
received_at_ms: time,
|
||||
received_count: 1,
|
||||
}],
|
||||
time,
|
||||
)
|
||||
@@ -561,6 +562,7 @@ mod tests {
|
||||
position_generation: 0,
|
||||
observation: observation(121.0, 5),
|
||||
received_at_ms: 1004,
|
||||
received_count: 1,
|
||||
}];
|
||||
assert_eq!(
|
||||
engine
|
||||
@@ -584,7 +586,8 @@ mod tests {
|
||||
sources: vec![],
|
||||
position_generation: 0,
|
||||
observation: observation(120.0, 6),
|
||||
received_at_ms: 1005
|
||||
received_at_ms: 1005,
|
||||
received_count: 1,
|
||||
}],
|
||||
1006
|
||||
)
|
||||
@@ -633,6 +636,7 @@ mod tests {
|
||||
position_generation: 0,
|
||||
observation: o.clone(),
|
||||
received_at_ms: 1000,
|
||||
received_count: 1,
|
||||
}];
|
||||
assert!(
|
||||
engine
|
||||
|
||||
Reference in New Issue
Block a user