{ "custom": { "color": "#000", "modifiedTag": "System/MCM01/VFD/UL14_1_VFD1", "priority": "No Active Alarms" }, "params": { "demoColor": -1, "tagProps": [ "System/MCM01/VFD/UL14_1_VFD1/Drive", "value", "value", "value", "value", "value", "value", "value", "value", "value" ] }, "propConfig": { "custom.color": { "binding": { "config": { "expression": "now(1000)" }, "transforms": [ { "code": "\tstate \u003d str(self.custom.state).strip().upper() # normalize input\n\t\n\tif state \u003d\u003d \"OFFLINE\": \n\t\treturn \"#000\"\n\t\n\timport datetime\n\tsecond \u003d datetime.datetime.now().second % 2 # 0 or 1 for blinking\n\t\n\tif state \u003d\u003d \"OK\":\n\t return \"#1fff1a\"\n\telif state \u003d\u003d \"DISCONNECTED\":\n\t return \"#d3d3d3\"\n\telif state \u003d\u003d \"FAULTED\":\n\t return \"#f9050d\" if second \u003d\u003d 0 else \"#1fff1a\"\n\telif state \u003d\u003d \"FAULTED/DISCONNECTED\":\n\t return \"#f9050d\" if second \u003d\u003d 0 else \"#d3d3d3\"\n", "type": "script" } ], "type": "expr" }, "persistent": true }, "custom.modifiedTag": { "binding": { "config": { "path": "view.params.tagProps[0]" }, "transforms": [ { "code": "\tparts \u003d value.split(\"/\")\n\tif len(parts) \u003e 1:\n\t parts \u003d parts[:-1] # remove the last segment\n\treturn \"/\".join(parts)", "type": "script" } ], "type": "property" }, "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}, -1)\r\n)\r\n", "type": "expression" }, { "fallback": "Offline", "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": "\tsystem.perspective.closeDock(\u0027Docked-East-Device\u0027)\n\tsystem.perspective.closeDock(\u0027Docked-East-VFD\u0027)\n\tsystem.perspective.closeDock(\u0027Docked-East-Conv\u0027)\n\tsystem.perspective.print(\"im\")\n\t#create tags lists for the device\n\tprops \u003d self.view.custom.modifiedTag\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props, section \u003d \"vfd\")\n\tsystem.perspective.openDock(\u0027Docked-East-VFD\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps, \"tags\":tags_table_dataset})\n\tsystem.perspective.closeDock(\u0027Docked-East-Device\u0027)\n\t" }, "scope": "G", "type": "script" }, "onMouseEnter": { "config": { "draggable": false, "id": "LZ5nPg45{view.params.tagProps[0]}", "modal": false, "overlayDismiss": false, "position": { "relativeLocation": "top-right" }, "positionType": "relative", "resizable": false, "showCloseIcon": false, "type": "open", "viewParams": { "text": "{/VFD.meta.tooltip.text}" }, "viewPath": "autStand/Custom_Views/Tooltip", "viewportBound": false }, "scope": "C", "type": "popup" }, "onMouseLeave": { "config": { "draggable": true, "id": "LZ5nPg45{view.params.tagProps[0]}", "modal": false, "overlayDismiss": false, "position": { "relativeLocation": "top-right" }, "positionType": "relative", "resizable": true, "showCloseIcon": true, "type": "close", "viewPath": "autStand/Custom_Views/Tooltip", "viewportBound": false }, "scope": "C", "type": "popup" } } }, "meta": { "name": "VFD", "tooltip": { "enabled": true } }, "propConfig": { "meta.tooltip.text": { "binding": { "config": { "expression": "if(\n {view.custom.state} !\u003d \"Offline\",\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", "userSelect": "none" } }, "type": "ia.container.coord" } }