feat: 完成 issue #21 点位字典 CSV schema 增加协议(protocol)维度

This commit is contained in:
2026-08-04 15:59:32 +08:00
parent 098125164d
commit cc7c7330cc
29 changed files with 131 additions and 27 deletions
+2
View File
@@ -26,6 +26,7 @@ class Point:
sample_rate: int
quality_code: bool = True
opc_node: Optional[str] = None
protocol: Optional[str] = None # 点位级协议覆盖;空 = 按 YAML device_prefixes 路由
row_number: int = 0 # CSV 行号(从 2 开始,表头为第 1 行),用于报错定位
@property
@@ -88,6 +89,7 @@ def load_point_dict_csv(path: str) -> PointDict:
sample_rate=sample_rate,
quality_code=_to_bool(row["qualityCode"]) if (row.get("qualityCode") or "").strip() else True,
opc_node=((row.get("opcNode") or "").strip() or None),
protocol=((row.get("protocol") or "").strip().lower() or None),
row_number=row_number,
)
)