```
feat(protocol): Observation坐标字段可选化及协议v2扩展 - 将Observation中longitude/latitude/altitude_m/heading_deg改为Option类型, 支持无位置信息的观测数据 - 新增DeviceTelemetry结构体承载设备遥测扩展字段(serial, mac, model, rssi, speed, vertical_speed, pressure_altitude, geometric_altitude, height_agl, pilot_position等) - 新增LegacyObservation兼容结构体及From转换,保持旧接收器协议输入兼容 - PROTOCOL_VERSION从1升至2 - 新增coordinates()辅助方法统一提取有效坐标 - validate()适配Option类型,允许坐标字段同时缺失 - Store新增position_generation机制追踪位置可用性变化,确保合并帧间的 位置丢失仍能正确断开轨迹 - geofence-map-adapter过滤无效坐标避免渲染异常 - 新增appearance.css外观主题系统,支持blue/graphite/white三套配色 ```
This commit is contained in:
+18
-1
@@ -32,7 +32,7 @@ fn bound(db: &Connection, target: &str) -> Result<Option<String>> {
|
||||
pub fn resolve(store: &Store, target: &str) -> Result<Value> {
|
||||
validate(target)?;
|
||||
let binding = bound(&store.db, target)?;
|
||||
let automatic: Option<String> = if binding.is_none() {
|
||||
let automatic: Option<String> = if binding.is_none() && !target.starts_with("MAC-") {
|
||||
store
|
||||
.db
|
||||
.query_row(
|
||||
@@ -106,6 +106,23 @@ mod tests {
|
||||
serde_json::from_value(json!({"expectedRecordId":expected,"recordId":record})).unwrap()
|
||||
}
|
||||
#[test]
|
||||
fn mac_identity_never_automatically_matches_a_serial_record() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let mut store = Store::open(dir.path().into()).unwrap();
|
||||
let registered = store
|
||||
.register(json!({"serialNo":"MAC-AABBCCDDEEFF"}))
|
||||
.unwrap();
|
||||
let id = registered["record"]["id"].as_str().unwrap();
|
||||
assert_eq!(
|
||||
resolve(&store, "MAC-AABBCCDDEEFF").unwrap()["matchSource"],
|
||||
"none"
|
||||
);
|
||||
assert_eq!(
|
||||
save(&mut store, "MAC-AABBCCDDEEFF", change(None, Some(id))).unwrap()["matchSource"],
|
||||
"manual"
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn association_persists_is_exact_and_preserves_classification() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let mut s = Store::open(dir.path().into()).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user