285 lines
7.6 KiB
Plaintext
285 lines
7.6 KiB
Plaintext
{
|
|
"custom": {
|
|
"color": "#C2C2C2",
|
|
"priority": "No Active Alarms"
|
|
},
|
|
"params": {
|
|
"demoColor": -1,
|
|
"tagProps": [
|
|
"System/MCM01/VFD/UL14_1_VFD1",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value"
|
|
]
|
|
},
|
|
"propConfig": {
|
|
"custom.color": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "now(1000)"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\n import datetime\n state \u003d str(self.custom.state).strip().upper() # normalize input\n second \u003d datetime.datetime.now().second % 2 # 0 or 1 for blinking\n\n if state \u003d\u003d \"OK\":\n return \"#1fff1a\"\n elif state \u003d\u003d \"DISCONNECTED\":\n return \"#C2C2C2\"\n elif state \u003d\u003d \"FAULTED\":\n return \"#f9050d\" if second \u003d\u003d 0 else \"#1fff1a\"\n elif state \u003d\u003d \"FAULTED/DISCONNECTED\":\n return \"#f9050d\" if second \u003d\u003d 0 else \"#C2C2C2\"\n else:\n return \"#C2C2C2\"",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.priority": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"0": "{view.params.tagProps[0]}",
|
|
"fc": "{session.custom.fc}"
|
|
},
|
|
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Priority"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({value},0)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"fallback": null,
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 0,
|
|
"output": "No Active Alarms"
|
|
},
|
|
{
|
|
"input": 1,
|
|
"output": "High"
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": "Medium"
|
|
},
|
|
{
|
|
"input": 3,
|
|
"output": "Low"
|
|
},
|
|
{
|
|
"input": 4,
|
|
"output": "Diagnostic"
|
|
}
|
|
],
|
|
"outputType": "scalar",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.state": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"0": "{view.params.tagProps[0]}",
|
|
"fc": "{session.custom.fc}"
|
|
},
|
|
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Lenze"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "if(\r\n {view.params.demoColor} \u003e\u003d 0,\r\n {view.params.demoColor},\r\n coalesce({value}, 0)\r\n)\r\n",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"fallback": "UNKNOWN",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 0,
|
|
"output": "Closed"
|
|
},
|
|
{
|
|
"input": 50,
|
|
"output": "OK"
|
|
},
|
|
{
|
|
"input": 51,
|
|
"output": "DISCONNECTED"
|
|
},
|
|
{
|
|
"input": 52,
|
|
"output": "FAULTED"
|
|
},
|
|
{
|
|
"input": 53,
|
|
"output": "FAULTED/DISCONNECTED"
|
|
}
|
|
],
|
|
"outputType": "scalar",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
}
|
|
},
|
|
"params.demoColor": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.tagProps": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 26,
|
|
"width": 26
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "vfd_icon"
|
|
},
|
|
"position": {
|
|
"height": 1,
|
|
"width": 1
|
|
},
|
|
"propConfig": {
|
|
"props.elements[2].fill.paint": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.color"
|
|
},
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"elements": [
|
|
{
|
|
"id": "defs3",
|
|
"name": "defs3",
|
|
"type": "defs"
|
|
},
|
|
{
|
|
"d": "M 15.641997,3.2012871 C -6.406347,0.56989644 4.4216421,15.598399 4.4216421,19.03611 L 18.864497,5.1927068 Z",
|
|
"fill": {
|
|
"paint": "#c2c2c2"
|
|
},
|
|
"id": "path1",
|
|
"name": "path1",
|
|
"stroke": {
|
|
"width": "1.03379"
|
|
},
|
|
"type": "path"
|
|
},
|
|
{
|
|
"d": "M 19.35605,5.5008821 C 24.701245,10.402753 20.718148,17.901458 13.662088,22.359231 L 5.1469077,19.280293 Z",
|
|
"fill": {},
|
|
"id": "path2",
|
|
"name": "path2",
|
|
"stroke": {
|
|
"width": "1.31417"
|
|
},
|
|
"type": "path"
|
|
},
|
|
{
|
|
"cx": "12",
|
|
"cy": "12",
|
|
"fill": {
|
|
"paint": "transparent"
|
|
},
|
|
"id": "circle2",
|
|
"name": "circle2",
|
|
"r": "10",
|
|
"stroke": {
|
|
"paint": "#000",
|
|
"width": 2
|
|
},
|
|
"style": {
|
|
"classes": ""
|
|
},
|
|
"type": "circle"
|
|
},
|
|
{
|
|
"d": "M6,18 L18,6",
|
|
"fill": {
|
|
"paint": "transparent"
|
|
},
|
|
"id": "path3",
|
|
"name": "path3",
|
|
"stroke": {
|
|
"linecap": "round",
|
|
"paint": "#000000",
|
|
"width": "2"
|
|
},
|
|
"type": "path"
|
|
}
|
|
],
|
|
"preserveAspectRatio": "none",
|
|
"style": {
|
|
"borderRadius": "50%",
|
|
"boxShadow": "value",
|
|
"transition": "fill 0.5s ease-in-out"
|
|
},
|
|
"viewBox": "0 0 24 24"
|
|
},
|
|
"type": "ia.shapes.svg"
|
|
}
|
|
],
|
|
"events": {
|
|
"dom": {
|
|
"onClick": {
|
|
"config": {
|
|
"script": "\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-VFD\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps, \"tags\":tags_table_dataset})"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "VFD",
|
|
"tooltip": {
|
|
"enabled": true
|
|
}
|
|
},
|
|
"propConfig": {
|
|
"meta.tooltip.text": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if(\n {view.custom.state} !\u003d \"Closed\",\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"meta.visible": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "session.custom.alarm_filter.show_VFD"
|
|
},
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"mode": "percent",
|
|
"style": {
|
|
"cursor": "pointer"
|
|
}
|
|
},
|
|
"type": "ia.container.coord"
|
|
}
|
|
} |