From 6bb019cef372fd1fb330508918723b3eb1b63078 Mon Sep 17 00:00:00 2001 From: "gigi.mamaladze" Date: Tue, 27 May 2025 21:05:16 +0400 Subject: [PATCH] Deleted depracted views --- .../views/Custom-Views/Divert Arm/view.json | 814 ------------------ .../Custom-Views/Pull Chord Line/view.json | 496 ----------- 2 files changed, 1310 deletions(-) delete mode 100644 MTN6_SCADA/com.inductiveautomation.perspective/views/Custom-Views/Divert Arm/view.json delete mode 100644 MTN6_SCADA/com.inductiveautomation.perspective/views/Custom-Views/Pull Chord Line/view.json diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Custom-Views/Divert Arm/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Custom-Views/Divert Arm/view.json deleted file mode 100644 index 316ad2d..0000000 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Custom-Views/Divert Arm/view.json +++ /dev/null @@ -1,814 +0,0 @@ -{ - "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": false, - "searchId": "PLC01", - "show_error": false, - "show_running": true, - "state": 5, - "state_string": "Unknown", - "visible_status": false - }, - "params": { - "forceFaultStatus": null, - "forceRunningStatus": null, - "mirror": true, - "openDiverter": true, - "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} || {session.custom.alarm_filter.show_running},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic} || {session.custom.alarm_filter.show_running},\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": { - "binding": { - "config": { - "expression": "{view.custom.running_status} \u003d 3" - }, - "type": "expr" - }, - "persistent": true - }, - "custom.running_status": { - "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.forceRunningStatus},0)", - "type": "expression" - } - ], - "type": "tag" - } - }, - "custom.searchId": { - "binding": { - "config": { - "path": "session.custom.searchId" - }, - "type": "property" - }, - "persistent": true - }, - "custom.show_error": { - "binding": { - "config": { - "path": "view.custom.state" - }, - "transforms": [ - { - "expression": "case(\t{value},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm} || {view.custom.isMatch}\u003e0,\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic} || {view.custom.isMatch}\u003e0,\r\n\t\tFalse)", - "type": "expression" - } - ], - "type": "property" - }, - "persistent": true - }, - "custom.show_running": { - "binding": { - "config": { - "path": "view.custom.state" - }, - "transforms": [ - { - "expression": "case(\t{value},\r\n\t\t1, False,\r\n\t\t2, False,\r\n\t\t{session.custom.alarm_filter.show_running}\r\n\t\t)", - "type": "expression" - } - ], - "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 - }, - "custom.visible_status": { - "binding": { - "config": { - "expression": "{view.custom.state} !\u003d 5" - }, - "type": "expr" - }, - "persistent": true - }, - "params.forceFaultStatus": { - "paramDirection": "input", - "persistent": true - }, - "params.forceRunningStatus": { - "paramDirection": "input", - "persistent": true - }, - "params.mirror": { - "paramDirection": "input", - "persistent": true - }, - "params.openDiverter": { - "paramDirection": "input", - "persistent": true - }, - "params.tagProps": { - "paramDirection": "input", - "persistent": true - } - }, - "props": { - "defaultSize": { - "height": 1045, - "width": 1130 - } - }, - "root": { - "children": [ - { - "meta": { - "name": "OpenDiverterArm" - }, - "position": { - "grow": 1 - }, - "propConfig": { - "position.display": { - "binding": { - "config": { - "expression": "{view.params.openDiverter} \u0026\u0026 {view.params.mirror}" - }, - "type": "expr" - } - }, - "position.rotate.angle": { - "binding": { - "config": { - "path": "view.params.directionLeft" - }, - "transforms": [ - { - "expression": "if({value}, \u0027180deg\u0027, \u00270deg\u0027)", - "type": "expression" - } - ], - "type": "property" - } - }, - "props.elements[0].fill.paint": { - "binding": { - "config": { - "path": "view.custom.running_status" - }, - "transforms": [ - { - "expression": "case(\t{value}, \r\n\t\t1, {session.custom.colours.state0},\r\n\t\t2, {session.custom.colours.state0},\r\n\t\t3, {session.custom.colours.state5},\r\n\t\t\u0027#000000\u0027\r\n\t)\r\n\t\t\r\n", - "type": "expression" - } - ], - "type": "property" - } - } - }, - "props": { - "elements": [ - { - "d": "M 0,40 32.820217,3.3897904 c 2.588185,-2.76545766 5.724342,-0.1926117 3.552046,2.114172 L 8,40 Z", - "fill": {}, - "name": "path", - "stroke": { - "paint": "#4c4c4c", - "width": 1 - }, - "type": "path" - } - ], - "preserveAspectRatio": "xMidYMax", - "style": { - "overflow": "hidden" - }, - "viewBox": "0 1.3 38 46" - }, - "type": "ia.shapes.svg" - }, - { - "meta": { - "name": "ClosedDiverterArm" - }, - "position": { - "grow": 1 - }, - "propConfig": { - "position.display": { - "binding": { - "config": { - "expression": "!{view.params.openDiverter} \u0026\u0026 {view.params.mirror}" - }, - "type": "expr" - } - }, - "position.rotate.angle": { - "binding": { - "config": { - "path": "view.params.directionLeft" - }, - "transforms": [ - { - "expression": "if({value}, \u0027180deg\u0027, \u00270deg\u0027)", - "type": "expression" - } - ], - "type": "property" - } - }, - "props.elements[0].fill.paint": { - "binding": { - "config": { - "path": "view.custom.running_status" - }, - "transforms": [ - { - "expression": "case(\t{value}, \r\n\t\t1, {session.custom.colours.state0},\r\n\t\t2, {session.custom.colours.state0},\r\n\t\t3, {session.custom.colours.state5},\r\n\t\t\u0027#000000\u0027\r\n\t)\r\n\t\t\r\n", - "type": "expression" - } - ], - "type": "property" - } - } - }, - "props": { - "elements": [ - { - "d": "M 0 0 L 96 0 L 96 16 L 0 16 Z", - "fill": {}, - "name": "path", - "stroke": { - "paint": "#4c4c4c", - "width": 2 - }, - "type": "path" - } - ], - "preserveAspectRatio": "xMidYMax", - "style": { - "overflow": "hidden" - }, - "viewBox": "-1 0 98 17" - }, - "type": "ia.shapes.svg" - }, - { - "meta": { - "name": "OpenDiverterArmLeft" - }, - "position": { - "grow": 1 - }, - "propConfig": { - "position.display": { - "binding": { - "config": { - "expression": "{view.params.openDiverter} \u0026\u0026 !{view.params.mirror}" - }, - "type": "expr" - } - }, - "position.rotate.angle": { - "binding": { - "config": { - "path": "view.params.directionLeft" - }, - "transforms": [ - { - "expression": "if({value}, \u0027180deg\u0027, \u00270deg\u0027)", - "type": "expression" - } - ], - "type": "property" - } - }, - "props.elements[0].fill.paint": { - "binding": { - "config": { - "path": "view.custom.running_status" - }, - "transforms": [ - { - "expression": "case(\t{value}, \r\n\t\t1, {session.custom.colours.state0},\r\n\t\t2, {session.custom.colours.state0},\r\n\t\t3, {session.custom.colours.state5},\r\n\t\t\u0027#000000\u0027\r\n\t)\r\n\t\t\r\n", - "type": "expression" - } - ], - "type": "property" - } - } - }, - "props": { - "elements": [ - { - "d": "M 0,40 32.820217,3.3897904 c 2.588185,-2.76545766 5.724342,-0.1926117 3.552046,2.114172 L 8,40 Z", - "fill": {}, - "name": "path", - "stroke": { - "paint": "#4c4c4c", - "width": 1 - }, - "type": "path" - } - ], - "preserveAspectRatio": "xMidYMax", - "style": { - "overflow": "hidden", - "transform": "scaleX(-1)" - }, - "viewBox": "0 1.3 38 46" - }, - "type": "ia.shapes.svg" - }, - { - "meta": { - "name": "ClosedDiverterArmLeft" - }, - "position": { - "grow": 1 - }, - "propConfig": { - "position.display": { - "binding": { - "config": { - "expression": "!{view.params.openDiverter} \u0026\u0026 !{view.params.mirror}" - }, - "type": "expr" - } - }, - "position.rotate.angle": { - "binding": { - "config": { - "path": "view.params.directionLeft" - }, - "transforms": [ - { - "expression": "if({value}, \u0027180deg\u0027, \u00270deg\u0027)", - "type": "expression" - } - ], - "type": "property" - } - }, - "props.elements[0].fill.paint": { - "binding": { - "config": { - "path": "view.custom.running_status" - }, - "transforms": [ - { - "expression": "case(\t{value}, \r\n\t\t1, {session.custom.colours.state0},\r\n\t\t2, {session.custom.colours.state0},\r\n\t\t3, {session.custom.colours.state5},\r\n\t\t\u0027#000000\u0027\r\n\t)\r\n\t\t\r\n", - "type": "expression" - } - ], - "type": "property" - } - } - }, - "props": { - "elements": [ - { - "d": "M 0 0 L 96 0 L 96 16 L 0 16 Z", - "fill": {}, - "name": "path", - "stroke": { - "paint": "#4c4c4c", - "width": 2 - }, - "type": "path" - } - ], - "preserveAspectRatio": "xMidYMax", - "style": { - "overflow": "hidden", - "transform": "scaleX(-1)" - }, - "viewBox": "-1 0 98 17" - }, - "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.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" - } - ], - "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/Diagnostic" - }, - { - "input": 2, - "output": "Alarms-Styles/Low" - }, - { - "input": 3, - "output": "Alarms-Styles/Medium" - }, - { - "input": 4, - "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#FFFFFF\u0027,\r\n\t\t\t2,\u0027#000000\u0027,\r\n\t\t\t3,\u0027#000000\u0027,\r\n\t\t\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\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_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": { - "path": "view.custom.display_icon" - }, - "type": "property" - } - }, - "props.style.borderStyle": { - "binding": { - "config": { - "path": "view.custom.disconnected" - }, - "transforms": [ - { - "fallback": "", - "inputType": "scalar", - "mappings": [ - { - "input": true, - "output": "solid" - }, - { - "input": false, - "output": "none" - } - ], - "outputType": "scalar", - "type": "map" - } - ], - "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": { - "direction": "column", - "justify": "center", - "style": { - "borderColor": "#FF0000", - "borderWidth": "2px", - "cursor": "pointer" - } - }, - "type": "ia.container.flex" - } -} \ No newline at end of file diff --git a/MTN6_SCADA/com.inductiveautomation.perspective/views/Custom-Views/Pull Chord Line/view.json b/MTN6_SCADA/com.inductiveautomation.perspective/views/Custom-Views/Pull Chord Line/view.json deleted file mode 100644 index 28bc03a..0000000 --- a/MTN6_SCADA/com.inductiveautomation.perspective/views/Custom-Views/Pull Chord Line/view.json +++ /dev/null @@ -1,496 +0,0 @@ -{ - "custom": { - "alarm_message": null, - "covert_mode": false, - "disconnected": false, - "display_icon": false, - "error": false, - "isMatch": 0, - "plc": "value", - "priority": 0, - "priority_string": "Unknown", - "searchId": "PLC01", - "state": null - }, - "params": { - "forceFaultStatus": "value", - "forceRunningStatus": "value", - "tagProps": [ - "value", - "value", - "value", - "value", - "value", - "value", - "value", - "value", - "value", - "value" - ] - }, - "propConfig": { - "custom.alarm_message": { - "persistent": true - }, - "custom.covert_mode": { - "binding": { - "config": { - "path": "this.custom.state" - }, - "transforms": [ - { - "expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_safety},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_safety},\r\n\t\t4, {session.custom.alarm_filter.show_safety},\r\n\t\t5, {session.custom.alarm_filter.show_safety},\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.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 - }, - "params.forceFaultStatus": { - "paramDirection": "input", - "persistent": true - }, - "params.forceRunningStatus": { - "paramDirection": "input", - "persistent": true - }, - "params.tagProps": { - "paramDirection": "input", - "persistent": true - } - }, - "props": { - "defaultSize": { - "height": 10, - "width": 100 - } - }, - "root": { - "children": [ - { - "meta": { - "name": "PullChord_Line2" - }, - "position": { - "height": 1, - "width": 1 - }, - "propConfig": { - "props.elements[0].visibility": { - "binding": { - "config": { - "path": "view.custom.error" - }, - "transforms": [ - { - "expression": "if({value}, \u0027visible\u0027,\u0027hidden\u0027)", - "type": "expression" - } - ], - "type": "property" - } - }, - "props.elements[1].visibility": { - "binding": { - "config": { - "path": "view.custom.error" - }, - "transforms": [ - { - "expression": "if({value}, \u0027visible\u0027,\u0027hidden\u0027)", - "type": "expression" - } - ], - "type": "property" - } - }, - "props.elements[2].stroke.paint": { - "binding": { - "config": { - "path": "view.custom.state" - }, - "transforms": [ - { - "expression": "case({value},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state1},\r\n3,{session.custom.colours.state1},\r\n4,{session.custom.colours.state1},\r\n\u0027#000000\u0027\r\n)", - "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": [ - { - "d": "m -0.38931298,0.28431365 c 33.95623398,0 67.91246898,0 101.86870298,0", - "fill": { - "paint": "#FFFFFF" - }, - "name": "path", - "stroke": { - "paint": "#000000", - "width": 1 - }, - "type": "path" - }, - { - "d": "m -0.38931298,10.850587 c 33.95623398,0 67.91246898,0 101.86870298,0", - "fill": { - "paint": "#FFFFFF" - }, - "name": "path", - "stroke": { - "paint": "#000000", - "width": 1 - }, - "type": "path" - }, - { - "d": "m -0.38931298,5.5674501 c 33.95623398,0 67.91246898,0 101.86870298,0", - "fill": { - "paint": "#FFFFFF" - }, - "name": "path", - "opacity": 1, - "stroke": { - "dasharray": "0,0,0", - "dashoffset": "\"20\"", - "key": "\"2.15848\"", - "miterlimit": "\"10\"", - "width": 3 - }, - "type": "path" - } - ], - "preserveAspectRatio": "none", - "style": {}, - "viewBox": "-0.5 -0.5 102 12" - }, - "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})" - }, - "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": { - "backgroundColor": "#00CC00", - "classes": "Alarms-Styles/NoAlarm", - "color": "#FFFFFF" - } - } - }, - "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": { - "path": "view.custom.display_icon" - }, - "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" - } -} \ No newline at end of file