Explorar el Código

module config

yds hace 11 meses
commit
19a887f74f
Se han modificado 2 ficheros con 266 adiciones y 0 borrados
  1. 82 0
      config/module.config.json
  2. 184 0
      config/module.definition.json

+ 82 - 0
config/module.config.json

@@ -0,0 +1,82 @@
+{
+
+    "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": ""
+
+}

+ 184 - 0
config/module.definition.json

@@ -0,0 +1,184 @@
+{
+
+    "name": "",
+    "code": "",
+    "model": "",
+    "type": "",
+    "props": [
+        { "deviceId": "" }
+    ],
+    "settings": [
+        {
+            "name": "IPAddress",
+            "text": "IP地址",
+            "dataType": "string",
+            "readonly": false,
+            "inputType": "Text"
+        },
+        {
+            "name": "Port",
+            "text": "端口",
+            "dataType": "integer",
+            "readonly": false,
+            "inputType": {
+                "type": "Text"
+            }
+        },
+        {
+            "name": "IdleTimeout",
+            "text": "空闲超时时间(秒)",
+            "dataType": "integer",
+            "readonly": "false",
+            "inputType": "Text"
+        },
+        {
+            "name": "ByteOrder",
+            "text": "字节序",
+            "dataType": "integer",
+            "readonly": "false",
+            "inputType": "DropDownList",
+            "dataSource": {
+                "props": {
+                    "selected": 1,
+                    "dataSource": "json",
+                    "option": [
+                        {
+                            "label": "ABCD",
+                            "value": 1
+                        },
+                        {
+                            "label": "DBCA",
+                            "value": 2
+                        }
+                    ]
+                }
+            }
+        },
+        {
+            "name": "ByteOrder",
+            "text": "字节序",
+            "dataType": "integer",
+            "readonly": "false",
+            "inputType": "DropDownList",
+            "dataSource": {
+                "props": {
+                    "selected": 1,
+                    "dataSource": "api",
+                    "apiUrl": "http://xxx.xxx/xxx/xxx",
+                }
+            }
+        },
+        {
+            "name": "decodeMethod",
+            "text": "解析方式",
+            "inputType": "Table",
+            "fields": [
+                {
+                    "name": "SerialNo",
+                    "text": "序号",
+                    "dataType": "intgeger",
+                    "inputType": "Text"
+                },
+                {
+                    "name": "DataName",
+                    "text": "字段",
+                    "dataType": "string",
+                    "inputType": "Text"
+                },
+                {
+                    "name": "DataType",
+                    "text": "数据类型",
+                    "dataType": "string",
+                    "inputType": "DropDownList",
+                    "dataSource": {
+                        "props": {
+                            "selected": 1,
+                            "dataSource": "json",
+                            "option": [
+                                {
+                                    "label": "Int32",
+                                    "value": 1
+                                },
+                                {
+                                    "label": "UInt32",
+                                    "value": 2
+                                }
+                            ]
+                        }
+                    }
+                },
+                {
+                    "name": "Offset",
+                    "text": "偏移量",
+                    "dataType": "integer",
+                    "inputType": "Text"
+                },
+                {
+                    "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"
+                    }
+                }
+            ],
+            "operations": [
+                {
+                    "name": "MoveUp",
+                    "icon": "up"
+                },
+                {
+                    "name": "MoveUp",
+                    "icon": "down"
+                },
+
+                {
+                    "name": "Edit",
+                    "icon": "edit"
+                },
+                {
+                    "name": "Delete",
+                    "icon": "delete"
+                }
+            ],
+            "props": {
+                "allowAdd": "true"
+
+            }
+        }
+    ],
+    "inputs": [
+        "XXDevice.Data1",
+        "XXDevice.Data2"
+    ],
+    "args": [
+        {
+            "name": "x",
+            "value": 100
+        },
+        {
+            "name": "y",
+            "value": 200
+        }
+
+    ],
+    "outputs": [
+        {
+            "name": "",
+            "code": "",
+            "display": "", 
+            "description": ""
+        }
+    ],
+    "expression": ""
+
+}