feat(realtime): 增加目标接收计数与频率计算支持
- 在 Target 结构体中新增 received_count 字段,用于跟踪每个目标在当前内存轨迹中的接收更新次数。 - 实现 ReceptionRate 结构体,计算目标更新频率,并在 State 中维护每个目标的接收率。 - 更新相关测试,确保接收计数和频率计算的准确性。 - 修改 Web UI 以显示目标的接收频率,提升用户体验。 - 升级协议版本至 4,确保后端、Worker 和前端的一致性。
This commit is contained in:
@@ -5,7 +5,7 @@ pub mod geofences;
|
||||
pub mod map_settings;
|
||||
pub mod target_lists;
|
||||
|
||||
pub const PROTOCOL_VERSION: u16 = 3;
|
||||
pub const PROTOCOL_VERSION: u16 = 4;
|
||||
pub const MAX_BATCH: usize = 4096;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
|
||||
@@ -70,6 +70,8 @@ pub struct Target {
|
||||
pub received_at_ms: u64,
|
||||
/// Changes on every position availability transition, even between coalesced frames.
|
||||
pub position_generation: u64,
|
||||
/// Accepted updates for this target since its current in-memory track began.
|
||||
pub received_count: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
|
||||
|
||||
Reference in New Issue
Block a user