Files
tdEngine_mqtt_mock/model/wits.py
wsy182 6557479a2f refactor(config): 重构配置模块并优化应用依赖注入
- 将配置相关类移动到model模块
- 实现依赖注入容器管理各组件依赖关系
- 重构配置加载逻辑支持多层级键值查找
- 更新主应用入口支持命令行参数解析
- 统一日志输出格式替换原有打印语句
- 引入钻井实时数据模型简化数据处理
- 移除硬编码字段映射改用动态配置方式
- 优化数据库写入逻辑基于新的数据模型
2026-03-12 10:41:26 +08:00

103 lines
2.1 KiB
Python

from dataclasses import dataclass
@dataclass(frozen=True)
class WitsData:
ts: int
wellid: str
stknum: int
recid: int
seqid: int
actual_date: float
actual_time: float
actual_ts: int
actcod: int
actod_label: str
deptbitm: float
deptbitv: float
deptmeas: float
deptvert: float
blkpos: float
ropa: float
hkla: float
hklx: float
woba: float
wobx: float
torqa: float
torqx: float
rpma: int
sppa: float
chkp: float
spm1: int
spm2: int
spm3: int
tvolact: float
tvolcact: float
mfop: int
mfoa: float
mfia: float
mdoa: float
mdia: float
mtoa: float
mtia: float
mcoa: float
mcia: float
stkc: int
lagstks: int
deptretm: float
gasa: float
space1: float
space2: float
space3: float
space4: float
space5: float
WITS_FIELD_MAPPING = [
(1, "wellid", "string"),
(2, "stknum", "int"),
(3, "recid", "int"),
(4, "seqid", "int"),
(5, "actual_date", "float"),
(6, "actual_time", "float"),
(7, "actcod", "int"),
(8, "deptbitm", "float"),
(9, "deptbitv", "float"),
(10, "deptmeas", "float"),
(11, "deptvert", "float"),
(12, "blkpos", "float"),
(13, "ropa", "float"),
(14, "hkla", "float"),
(15, "hklx", "float"),
(16, "woba", "float"),
(17, "wobx", "float"),
(18, "torqa", "float"),
(19, "torqx", "float"),
(20, "rpma", "int"),
(21, "sppa", "float"),
(22, "chkp", "float"),
(23, "spm1", "int"),
(24, "spm2", "int"),
(25, "spm3", "int"),
(26, "tvolact", "float"),
(27, "tvolcact", "float"),
(28, "mfop", "int"),
(29, "mfoa", "float"),
(30, "mfia", "float"),
(31, "mdoa", "float"),
(32, "mdia", "float"),
(33, "mtoa", "float"),
(34, "mtia", "float"),
(35, "mcoa", "float"),
(36, "mcia", "float"),
(37, "stkc", "int"),
(38, "lagstks", "int"),
(39, "deptretm", "float"),
(40, "gasa", "float"),
(41, "space1", "float"),
(42, "space2", "float"),
(43, "space3", "float"),
(44, "space4", "float"),
(45, "space5", "float"),
]