{ "custom": { "color": "#000000", "priority": "No Active Alarms", "state": "TagError" }, "params": { "tagProps": [ "value", "value", "value", "value", "value", "value", "value", "value", "value", "value" ] }, "propConfig": { "custom.color": { "binding": { "config": { "fallbackDelay": 2.5, "mode": "indirect", "references": { "0": "{view.params.tagProps[0]}", "fc": "{session.custom.fc}" }, "tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/" }, "transforms": [ { "code": "\n data \u003d dict(value) if value else {}\n\n if data.get(\"Jam\"):\n return \"#FF8C00\"\n elif data.get(\"Full\"):\n return \"#0000FF\"\n elif data.get(\"Half_Full\"):\n return \"#FFFF00\"\n elif data.get(\"No_Container\"):\n return \"#D3D3D3\"\n elif data.get(\"Disabled\") \u003d\u003d False:\n return \"#CCFFCC\"\n else:\n return \"#000000\"", "type": "script" } ], "type": "tag" }, "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}/" }, "transforms": [ { "code": "\tdata \u003d dict(value) if value else {}\n\t\n\tif data.get(\"Jam\"):\n\t return \"High\"\n\telif data.get(\"Full\"):\n\t return \"Low\"\n\telif data.get(\"Half_Full\"):\n\t return \"Low\"\n\telif data.get(\"No_Container\"):\n\t return \"Low\"\n\telif data.get(\"Disabled\") \u003d\u003d False:\n\t return \"No Active Alarms\"\n\telse:\n\t return \"No Active Alarms\"\n\t\n\treturn \"No Active Alarms\"", "type": "script" } ], "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}/" }, "transforms": [ { "code": " data \u003d dict(value) if value else {}\n \n if value is None or data.get(\"_quality\") \u003d\u003d \"Bad\" or data.get(\"error\"):\n return \"TagError\"\n \n\tif data.get(\"Jam\"):\n\t return \"Jammed\"\n\telif data.get(\"Full\"):\n\t return \"Full\"\n\telif data.get(\"Half_Full\"):\n\t return \"Half Full\"\n\telif data.get(\"No_Container\"):\n\t return \"No Container\"\n\telif data.get(\"Disabled\") \u003d\u003d False:\n\t return \"Enabled\"\n\telse:\n\t return \"Inactive\" \n return \"Inactive\"", "type": "script" } ], "type": "tag" }, "persistent": true }, "params.tagProps": { "paramDirection": "inout", "persistent": true } }, "props": { "defaultSize": { "height": 20, "width": 29 } }, "root": { "children": [ { "meta": { "name": "RunningStatus" }, "position": { "grow": 1 }, "propConfig": { "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.color" }, "type": "property" } } }, "props": { "elements": [ { "d": "M 0 0 L 40 0 L 40 0 L 70 30 L 40 60 L 40 60 L 0 60 L 0 0 Z", "fill": {}, "name": "path", "stroke": { "paint": "#4c4c4c", "width": 3 }, "type": "path" } ], "style": { "overflow": "hidden" }, "viewBox": "-1.5 -1.5 73 63" }, "type": "ia.shapes.svg" } ], "events": { "dom": { "onClick": { "config": { "script": "\tsystem.perspective.openDock(\u0027Docked-East-CH\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})" }, "scope": "G", "type": "script" } } }, "meta": { "name": "root", "tooltip": { "enabled": true, "location": "top-left", "style": {} } }, "propConfig": { "meta.tooltip.style.classes": { "binding": { "config": { "expression": "{view.custom.priority}" }, "transforms": [ { "fallback": "Alarms-Styles/NoAlarm", "inputType": "scalar", "mappings": [ { "input": "High", "output": "Alarms-Styles/High" }, { "input": "Medium", "output": "Alarms-Styles/Medium" }, { "input": "Low", "output": "Alarms-Styles/Low" }, { "input": "Diagnostic", "output": "Alarms-Styles/Diagnostic" } ], "outputType": "style-list", "type": "map" } ], "type": "expr" } }, "meta.tooltip.text": { "binding": { "config": { "expression": "if(\n {view.custom.state} !\u003d \"TagError\",\n \"Source Id: \" + {view.params.tagProps[1]} + \", Priority: \" + {view.custom.priority} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n" }, "type": "expr" } } }, "props": { "justify": "center" }, "type": "ia.container.flex" } }