Browse Source

Merge branch 'master' of http://47.94.100.119:3000/lpdev/common

舍得 11 months ago
parent
commit
c1c68d8ed5

+ 0 - 1
config/module.config.json

@@ -1,5 +1,4 @@
 {
-
     "name": "",
     "code": "",
     "model": "",

+ 93 - 36
config/module.definition.json

@@ -9,34 +9,34 @@
     ],
     "settings": [
         {
-            "name": "IPAddress",
+            "name": "ipAddress",
             "text": "IP地址",
             "dataType": "string",
             "readonly": false,
-            "inputType": "Text"
+            "inputType": "text"
         },
         {
-            "name": "Port",
+            "name": "port",
             "text": "端口",
             "dataType": "integer",
             "readonly": false,
-            "inputType": "Text"
+            "inputType": "text"
         },
         {
-            "name": "IdleTimeout",
+            "name": "idleTimeout",
             "text": "空闲超时时间(秒)",
             "dataType": "integer",
             "readonly": false,
-            "inputType": "Text"
+            "inputType": "text"
         },
         {
-            "name": "ByteOrder",
+            "name": "byteOrder",
             "text": "字节序",
             "dataType": "integer",
             "readonly": false,
-            "inputType": "DropDownList",
+            "inputType": "dropDownList",
             "dataSource": {
-                "props": {
+
                     "selected": 1,
                     "dataSource": "json",
                     "option": [
@@ -49,45 +49,45 @@
                             "value": 2
                         }
                     ]
-                }
+
             }
         },
         {
-            "name": "ByteOrder",
+            "name": "byteOrder",
             "text": "字节序",
             "dataType": "integer",
             "readonly": false,
-            "inputType": "DropDownList",
+            "inputType": "dropDownList",
             "dataSource": {
-                "props": {
+
                     "selected": 1,
                     "dataSource": "api",
                     "apiUrl": "http://xxx.xxx/xxx/xxx"
-                }
+
             }
         },
         {
             "name": "decodeMethod",
             "text": "解析方式",
-            "inputType": "Table",
+            "inputType": "table",
             "fields": [
                 {
-                    "name": "SerialNo",
+                    "name": "serialNo",
                     "text": "序号",
                     "dataType": "intgeger",
-                    "inputType": "Text"
+                    "inputType": "text"
                 },
                 {
-                    "name": "DataName",
+                    "name": "dataName",
                     "text": "字段",
                     "dataType": "string",
-                    "inputType": "Text"
+                    "inputType": "text"
                 },
                 {
-                    "name": "DataType",
+                    "name": "dataType",
                     "text": "数据类型",
                     "dataType": "string",
-                    "inputType": "DropDownList",
+                    "inputType": "dropDownList",
                     "dataSource": {
                         "props": {
                             "selected": 1,
@@ -106,27 +106,16 @@
                     }
                 },
                 {
-                    "name": "Offset",
+                    "name": "offset",
                     "text": "偏移量",
                     "dataType": "integer",
-                    "inputType": "Text"
+                    "inputType": "text"
                 },
                 {
-                    "name": "Length",
+                    "name": "length",
                     "text": "长度",
                     "dataType": "integer",
-                    "inputType": "Text"
-                },
-                {
-                    "name": "DataItem",
-                    "text": "设备属性",
-                    "dataType": "string",
-                    "type": "DropDownList",
-                    "props": {
-                        "selected": 1,
-                        "dataSource": "api",
-                        "apiUrl": "http://xxx.xxx/xxx/xxx"
-                    }
+                    "inputType": "text"
                 }
             ],
             "operations": [
@@ -152,6 +141,74 @@
                 "allowAdd": "true"
 
             }
+        },
+        {
+            "name": "instructions",
+            "text": "下发指令",
+            "inputType": "table",
+            "fields": [
+                {
+                    "name": "serialNo",
+                    "text": "序号",
+                    "dataType": "integer",
+                    "inputType": "text"
+                },
+                {
+                    "name": "commandName",
+                    "text": "命令名",
+                    "dataType": "string",
+                    "inputType": "text"
+                },
+                {
+                    "name": "commandCode",
+                    "text": "命令代码",
+                    "dataType": "string",
+                    "inputType": "text"
+                },
+                {
+                    "name": "dataType",
+                    "text": "数据类型",
+                    "dataType": "string",
+                    "inputType": "dropDownList",
+                    "dataSource": {
+                        "selected": 1,
+                        "dataSource": "json",
+                        "option": [
+                            {
+                                "label": "int16",
+                                "value": 1
+                            },
+                            {
+                                "label": "uInt16",
+                                "value": 2
+                            },
+                            {
+                                "label": "int32",
+                                "value": 3
+                            },
+                            {
+                                "label": "uInt32",
+                                "value": 4
+                            }
+                        ]
+                    }
+                },
+                {
+                    "name": "offset",
+                    "text": "偏移量",
+                    "dataType": "integer",
+                    "inputType": "text"
+                },
+                {
+                    "name": "length",
+                    "text": "长度",
+                    "dataType": "integer",
+                    "inputType": "text"
+                }
+            ],
+            "props": {
+                "allowAdd": "true"
+            }
         }
     ],
     "inputs": [

+ 92 - 0
config/node_info.json

@@ -0,0 +1,92 @@
+{
+    "id":"",
+    "name":"",
+    "code":"",
+    "model":"",
+    "type":"",
+    "serverId":"",
+    "description":"",
+    "moduleId":"Modbus over TCP A001",
+    "status":"",
+    "moduleConfig":{
+        "name": "",
+        "code": "",
+        "model": "",
+        "type": "",
+        "props": [
+            {"deviceId": ""}
+        ],
+        "settings": [
+            {
+                "name": "IPAddress",
+                "value": "127.0.0.1"
+            },
+            {
+                "name": "Port",
+                "value": "8080"
+            },
+            {
+                "name": "IdleTimeout",
+                "value": 60
+            },
+            {
+                "name": "ByteOrder",
+                "value": "ABCD"
+            },
+            {
+                "name": "DecodeMethod",
+                "value": {
+                    "Fields": [
+                        {
+                            "name": "SerialNo",
+                            "value": "123"
+                        },
+                        {
+                            "name": "DataName",
+                            "value": "Temperature"
+                        },
+                        {
+                            "name": "DataType",
+                            "value": "1"
+                        },
+                        {
+                            "name": "Offset",
+                            "value": "6"
+                        },
+                        {
+                            "name": "DataItem",
+                            "value": "XXDevice.Data1"
+                        }
+                    ]
+                }
+            }
+        ],
+        "inputs": [
+            "XXDevice.Data1",
+            "XXDevice.Data2"
+        ],
+        "args": [
+            {
+                "name": "x",
+                "value": 100
+            },
+            {
+                "name": "y",
+                "value": 200
+            }
+    
+        ],
+        "outputs": [
+            {
+                "name": "",
+                "code": "",
+                "display": "",
+                "description": ""
+            }
+        ],
+        "expression": ""
+    
+    }
+
+}
+

+ 1 - 1
config/device_info.json → config/node_info1.json

@@ -5,7 +5,7 @@
     "model":"",
     "type":"",
     "serverId":"",
-    "desciption":"",
+    "description":"",
     "moduleId":"",
     "status":"",
     "moduleConfig":{

+ 28 - 6
config/rediskeys.txt

@@ -1,6 +1,28 @@
-设备信息:
-类型:List
-key格式: 
-device_info:ServerId
-例:device_info:001
-内容:见device_info.json
+节点配置:
+数据类型:Hash
+设备、净化、算法、存储、传输到Redis Key格式:{前缀}:{ServerId}
+告警规则的Redis Key格式:{前缀}
+数据集合的字段名:节点标识(设备、净化方案、算法等等标识(Code))
+配置内容:参考:node_info.json
+
+1、设备信息:
+Redis Key前缀:device
+
+
+2、净化方案信息:
+Redis Key前缀:purify
+
+3、算法信息:compute
+
+4、存储信息: store
+
+5、传输信息: transfer
+
+6、告警规则:alarm_rules
+
+
+示例:
+采集服务C001的配置:
+key: device:C001
+读取全部设备配置Redis指令: HGETALL device:C001
+读取12345号设备的配置Redis指令:HGET device:C001 12345

+ 40 - 0
td/建表与主题.txt

@@ -0,0 +1,40 @@
+创建数据库: 
+create database lanpengdb duration 10 buffer 16 wal_level 1 PRECISION 'ns';
+
+
+
+
+
+临时方案(含已生效方案):
+不存储,为每个方案建立发布主题,供页面对比使用
+
+算法:
+
+告警:
+建立MySql告警表,并推送到mqtt,主题是AlarmData
+
+码流:
+前端
+
+
+采集数据表
+每个设备建立一个表。
+表名规则:data_{device_id}_{ver}
+列名:ts timestamp 必须有且必须名为ts
+      frame_no int 如果有则名为frame_no
+      其他列:各属性的code
+如果添加、删除、修改过属性,则升版本号新建表
+建发布主题
+
+净化、算法数据表
+每个方案或节点建立一个表。
+表名规则:data_{node_id}_{ver}
+列名:ts timestamp 必须有且必须名为ts
+      frame_no int 如果有则名为frame_no
+      其他列:各属性的code
+如果添加、删除、修改过属性,则升版本号新建表
+建发布主题
+
+
+
+