503 lines
14 KiB
Plaintext
503 lines
14 KiB
Plaintext
{
|
|
"custom": {
|
|
"disconnected": false,
|
|
"plc": "value",
|
|
"priority": 0,
|
|
"priority_string": "No active alarms",
|
|
"searchId": "PLC01",
|
|
"state": 0,
|
|
"state_string": "Normal"
|
|
},
|
|
"params": {
|
|
"forceFaultStatus": null,
|
|
"forceRunningStatus": null,
|
|
"tagProps": [
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value",
|
|
"value"
|
|
]
|
|
},
|
|
"propConfig": {
|
|
"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.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": 1,
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 0,
|
|
"output": 0
|
|
}
|
|
],
|
|
"outputType": "scalar",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "property"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.priority_string": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "Unknown",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 1,
|
|
"output": "High"
|
|
},
|
|
{
|
|
"input": 0,
|
|
"output": "No active alarms"
|
|
}
|
|
],
|
|
"outputType": "scalar",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "property"
|
|
},
|
|
"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}/STATE"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"fallback": null,
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 1,
|
|
"output": 1
|
|
},
|
|
{
|
|
"input": 0,
|
|
"output": 0
|
|
}
|
|
],
|
|
"outputType": "scalar",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.state_string": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "case({view.custom.state},\r\n1, \"Active\",\r\n0, \"Normal\",\r\n\"Unknown\")"
|
|
},
|
|
"type": "expr"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"params.forceFaultStatus": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.forceRunningStatus": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.tagProps": {
|
|
"paramDirection": "inout",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 100,
|
|
"width": 10
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "PullChord_Line"
|
|
},
|
|
"position": {
|
|
"height": 1,
|
|
"width": 1
|
|
},
|
|
"propConfig": {
|
|
"props.elements[0].visibility": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "if(\r\n ({value} \u003d 0 || {value} \u003d 1 || !{parent.meta.visible}),\r\n \u0027hidden\u0027,\r\n \u0027visible\u0027\r\n)",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.elements[1].visibility": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "if(\r\n ({value} \u003d 0 || {value} \u003d 1 || !{parent.meta.visible}),\r\n \u0027hidden\u0027,\r\n \u0027visible\u0027\r\n)",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.elements[2].stroke.paint": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "#800000",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 1,
|
|
"output": "#FF0000"
|
|
},
|
|
{
|
|
"input": 0,
|
|
"output": "#000000"
|
|
}
|
|
],
|
|
"outputType": "color",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"props.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if({session.custom.colours.colour_impaired} \u003d True,\r\n{view.custom.state} + 100,\r\n{view.custom.state})"
|
|
},
|
|
"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": [
|
|
{
|
|
"d": "m 0.22819265,-0.5 c 0,33.992373 0,67.984747 0,101.97712",
|
|
"fill": {
|
|
"paint": "#FFFFFF"
|
|
},
|
|
"name": "path",
|
|
"stroke": {
|
|
"paint": "#000000",
|
|
"width": 1
|
|
},
|
|
"type": "path"
|
|
},
|
|
{
|
|
"d": "m 10.792046,-0.5 c 0,33.992373 0,67.984747 0,101.97712",
|
|
"fill": {
|
|
"paint": "#FFFFFF"
|
|
},
|
|
"name": "path",
|
|
"stroke": {
|
|
"paint": "#000000",
|
|
"width": 1
|
|
},
|
|
"type": "path"
|
|
},
|
|
{
|
|
"d": "m 5.5101192,-0.5 c 0,33.992373 0,67.984747 0,101.97712",
|
|
"fill": {
|
|
"paint": "#FFFFFF"
|
|
},
|
|
"name": "path",
|
|
"opacity": 1,
|
|
"stroke": {
|
|
"dasharray": "8, 8, 8",
|
|
"dashoffset": "\"20\"",
|
|
"key": "\"2.15848\"",
|
|
"miterlimit": "\"10\"",
|
|
"width": 2
|
|
},
|
|
"type": "path"
|
|
}
|
|
],
|
|
"preserveAspectRatio": "none",
|
|
"style": {},
|
|
"viewBox": "-0.5 -0.5 12 102"
|
|
},
|
|
"type": "ia.shapes.svg"
|
|
}
|
|
],
|
|
"events": {
|
|
"dom": {
|
|
"onClick": {
|
|
"config": {
|
|
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
},
|
|
"onDoubleClick": {
|
|
"config": {
|
|
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
|
|
},
|
|
"enabled": false,
|
|
"scope": "G",
|
|
"type": "script"
|
|
},
|
|
"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": {
|
|
"enabled": true,
|
|
"location": "top-left",
|
|
"style": {}
|
|
}
|
|
},
|
|
"propConfig": {
|
|
"meta.tooltip.style.backgroundColor": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "case({value},\r\n0,{session.custom.colours.state5},\r\n1,{session.custom.colours.state1},\r\n{session.custom.colours.fallback}\r\n)",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"meta.tooltip.style.classes": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "{view.custom.priority}"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"fallback": "Alarms-Styles/NoAlarm",
|
|
"inputType": "scalar",
|
|
"mappings": [
|
|
{
|
|
"input": 1,
|
|
"output": "Alarms-Styles/High"
|
|
}
|
|
],
|
|
"outputType": "style-list",
|
|
"type": "map"
|
|
}
|
|
],
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"meta.tooltip.style.color": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.state"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "if({session.custom.colours.colour_impaired},\r\n\t\u0027#000000\u0027,\r\n\tcase(\t{value},\r\n\t\t\t1,\u0027#000000\u0027,\r\n\t\t\t\u0027#FFFFFF\u0027)\r\n\t)",
|
|
"type": "expression"
|
|
}
|
|
],
|
|
"type": "property"
|
|
}
|
|
},
|
|
"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},\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}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
},
|
|
"meta.visible": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "session.custom.alarm_filter.show_safety"
|
|
},
|
|
"type": "property"
|
|
}
|
|
},
|
|
"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",
|
|
"overflow": "visible"
|
|
}
|
|
},
|
|
"type": "ia.container.coord"
|
|
}
|
|
} |