449 lines
14 KiB
Plaintext
449 lines
14 KiB
Plaintext
{
|
|
"custom": {
|
|
"alarm_message": null,
|
|
"covert_mode": true,
|
|
"disconnected": false,
|
|
"display_icon": true,
|
|
"error": false,
|
|
"isMatch": 0,
|
|
"plc": "value",
|
|
"priority": 0,
|
|
"priority_string": "No active alarms",
|
|
"running_status": 0,
|
|
"searchId": "value",
|
|
"state": 5,
|
|
"state_string": "Unknown"
|
|
},
|
|
"params": {
|
|
"forceFaultStatus": null,
|
|
"forceRunningStatus": null,
|
|
"tagProps": [
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value"
|
|
]
|
|
},
|
|
"propConfig": {
|
|
"custom.alarm_message": {
|
|
"persistent": true
|
|
},
|
|
"custom.covert_mode": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.disconnected": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"fc": "{session.custom.fc}",
|
|
"plc": "{view.custom.plc}"
|
|
},
|
|
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "if(isNull({value}), False, {value})",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.display_icon": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.error": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.isMatch": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.plc": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.params.tagProps[0]"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "split({value}, \"/\")[0]",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.priority": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": 0,
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 1,
|
|
"output": 4
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": 3
|
|
},
|
|
{
|
|
"input": 3,
|
|
"output": 2
|
|
},
|
|
{
|
|
"input": 4,
|
|
"output": 1
|
|
}
|
|
],
|
|
"outputType": "scalar",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.priority_string": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.running_status": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "coalesce(try(jsonGet(jsonGet({session.custom.state_messages},{this.custom.tag_path_to_lookup}),\"state\"),null),{view.params.forceRunningStatus},0)"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.searchId": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "session.custom.searchId"
|
|
},
|
|
"type": "property"
|
|
},
|
|
"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}/ALARMST"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"fallback": null,
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 4,
|
|
"output": 1
|
|
},
|
|
{
|
|
"input": 3,
|
|
"output": 2
|
|
},
|
|
{
|
|
"input": 2,
|
|
"output": 3
|
|
},
|
|
{
|
|
"input": 1,
|
|
"output": 4
|
|
},
|
|
{
|
|
"input": 0,
|
|
"output": 5
|
|
}
|
|
],
|
|
"outputType": "scalar",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.state_string": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"params.forceFaultStatus": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.forceRunningStatus": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.tagProps": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 48,
|
|
"width": 48
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "RFID_0"
|
|
},
|
|
"position": {
|
|
"height": 1,
|
|
"width": 1
|
|
},
|
|
"propConfig": {
|
|
"props.elements[0].fill.paint": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 101,
|
|
"output": "State-Styles/State101"
|
|
},
|
|
{
|
|
"input": 102,
|
|
"output": "State-Styles/State102"
|
|
},
|
|
{
|
|
"input": 103,
|
|
"output": "State-Styles/State103"
|
|
},
|
|
{
|
|
"input": 104,
|
|
"output": "State-Styles/State104"
|
|
},
|
|
{
|
|
"input": 105,
|
|
"output": "State-Styles/State105"
|
|
},
|
|
{
|
|
"input": 106,
|
|
"output": "State-Styles/State106"
|
|
},
|
|
{
|
|
"input": 201,
|
|
"output": "State-Styles/State201"
|
|
},
|
|
{
|
|
"input": 202,
|
|
"output": "State-Styles/State202"
|
|
},
|
|
{
|
|
"input": 203,
|
|
"output": "State-Styles/State203"
|
|
},
|
|
{
|
|
"input": 204,
|
|
"output": "State-Styles/State204"
|
|
},
|
|
{
|
|
"input": 205,
|
|
"output": "State-Styles/State205"
|
|
}
|
|
],
|
|
"outputType": "style-list",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"elements": [
|
|
{
|
|
"elements": [
|
|
{
|
|
"d": "M6.35 0.2507 C4.0842 0.2507 1.9091 1.5163 0.3079 3.7675 L1.174 4.9681 C2.6039 2.9621 4.477 1.9591 6.35 1.9591 C8.223 1.9591 10.0961 2.9621 11.526 4.9681 L12.3921 3.7675 C10.7909 1.5163 8.6158 0.2507 6.35 0.2507 ZM6.35 3.6831 C4.7961 3.6831 3.2421 4.5117 2.0526 6.1688 L2.8834 7.4219 C3.7997 6.1213 5.0484 5.3909 6.35 5.3909 C7.6516 5.3909 8.9003 6.1213 9.8166 7.4219 L10.6474 6.1688 C9.4579 4.5117 7.9039 3.6831 6.35 3.6831 ZM6.35 7.1155 C5.4135 7.1155 4.477 7.617 3.762 8.6201 L4.6179 9.8557 C5.0761 9.2079 5.698 8.8427 6.35 8.8427 C7.002 8.8427 7.6239 9.2079 8.0821 9.8557 L8.938 8.6201 C8.223 7.617 7.2865 7.1155 6.35 7.1155 ZM6.35 10.5667 C6.0416 10.5667 5.7332 10.7299 5.4966 11.0563 L6.35 12.257 L7.2034 11.0563 C6.9668 10.7299 6.6584 10.5667 6.35 10.5667 Z",
|
|
"name": "path",
|
|
"stroke": {
|
|
"paint": "transparent"
|
|
},
|
|
"type": "path"
|
|
}
|
|
],
|
|
"fill": {
|
|
"opacity": 1
|
|
},
|
|
"name": "group",
|
|
"stroke": {
|
|
"opacity": "0.502",
|
|
"paint": "rgb(128,128,128)"
|
|
},
|
|
"type": "group"
|
|
}
|
|
],
|
|
"style": {},
|
|
"viewBox": "0 0 12.7 12.7"
|
|
},
|
|
"type": "ia.shapes.svg"
|
|
}
|
|
],
|
|
"events": {
|
|
"dom": {
|
|
"onMouseEnter": {
|
|
"config": {
|
|
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "root",
|
|
"tooltip": {}
|
|
},
|
|
"propConfig": {
|
|
"meta.tooltip.text": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if({view.custom.disconnected} \u003d False,\n\tif(isNull({view.custom.alarm_message}),\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"meta.visible": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{view.custom.display_icon}"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"props.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.disconnected"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "Disconnects/Device-Connected",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": true,
|
|
"output": "Disconnects/Device-Disconnected"
|
|
},
|
|
{
|
|
"input": false,
|
|
"output": "Disconnects/Device-Connected"
|
|
}
|
|
],
|
|
"outputType": "style-list",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"mode": "percent",
|
|
"style": {
|
|
"cursor": "pointer"
|
|
}
|
|
},
|
|
"type": "ia.container.coord"
|
|
}
|
|
} |