feat: 完成 issue #21 点位字典 CSV schema 增加协议(protocol)维度
This commit is contained in:
@@ -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,
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user