优化代码
This commit is contained in:
+4
-2
@@ -24,10 +24,12 @@ class SignalData:
|
||||
column: 列索引
|
||||
datalog: 数据日志列表
|
||||
"""
|
||||
signal_type: str | None = None
|
||||
# signal_type: str | None = None
|
||||
column: int = 0
|
||||
attributes: dict[str, str] = field(default_factory=dict)
|
||||
datalog: list[DataLog] = field(default_factory=list)
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
"""转换为字典格式
|
||||
|
||||
@@ -35,8 +37,8 @@ class SignalData:
|
||||
包含 signal_type、column、datalog 的字典
|
||||
"""
|
||||
return {
|
||||
"type": self.signal_type,
|
||||
"column": self.column,
|
||||
"attributes": self.attributes,
|
||||
"datalog": self.datalog
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user