@luischen/promess
v1.1.1
Published
```bash npm install -g @luischen/promess ```
Downloads
1
Readme
程序安装
npm install -g @luischen/promess
程序运行
批量模式
luischen --dd D:\\temp\\db\\ --wd D:\\temp\\
实时模式
luischen --db D:\\temp\\curve.mdb --wd D:\\temp\\
参数说明
| 名称 | 说明 | | ---- | ------------------------------------------------- | | dd | 数据目录,程序监控数据目录,新增mdb文件则开始解析 | | db | 数据文件,需要完整目录如 D:\temp\curve.mdb | | wd | 工作目录,包含配置文件、临时文件和输出结果的目录 |
配置文件
配置在工作目录下,以mapping.json命名,主要配置数据字段和输出字段的对应关系。样例如下:
[
["AA001","CycleId","N"],
["AA002","ProgramName","S"],
["AA003","CycleDate","D"],
["AA004","ProgramID","N"],
["AA005","StationID","N"],
["AA006","StationName","S"],
["AA007","OK","N"],
["AB001","PartId1","S"],
["AB002","PartId2","S"],
["AB003","PartId3","S"],
["AB004","PartId4","S"],
["BA001","XmlCurves","X","毫米"],
["BA002","XmlCurves","X","千牛"],
["BA003","XmlCurves","X","s"],
["BA009","XmlCurves","X","千牛/毫米"]
]
每一行记录对应一个数采字段,而每一个数采字段包含4个配置:
- 0, AA001定义了输出的字段名称
- 1,CycleId 定义了数据源的字段名称和查询语句定义相关
- 2,N 定义了字段数据类型,目前支持{N(umber),S(tring),D(ate),X(ml)}
- 3,毫米 当字段数据类型为Xml时该字段用于定位当前字段在曲线中的位置
- 通过曲线字段SignalXUnit 匹配到数采项,并查找曲线二维数组中的第0项
- 通过曲线字段SignalYUnit 匹配到数采项,并查找曲线二维数组中的第1项