{ "custom": {}, "params": { "enableTooltip": true, "label": null, "tagPath": "", "view": "" }, "propConfig": { "params.enableTooltip": { "paramDirection": "input", "persistent": true }, "params.label": { "paramDirection": "input", "persistent": true }, "params.tagPath": { "paramDirection": "input", "persistent": true }, "params.view": { "paramDirection": "input", "persistent": true } }, "props": { "defaultSize": { "height": 40, "width": 80 } }, "root": { "children": [ { "events": { "dom": { "onClick": { "config": { "script": "\tself.parent.openWindow()" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Status" }, "position": { "height": "100%", "width": "100%" }, "propConfig": { "props.style.backgroundColor": { "binding": { "config": { "fallbackDelay": 2.5, "mode": "indirect", "references": { "tagPath": "{view.params.tagPath}" }, "tagPath": "{tagPath}.jsonValues" }, "transforms": [ { "expression": "try(\r\n\tif(jsonGet({value}, \"Estop_Active\") \u0026\u0026 {[default]Gateway/ToggleTag},\r\n\t\t\"#F00\",\t\t// Estop\r\n\t\tif(jsonGet({value}, \"bStarted\"),\r\n\t\t\t\"#0F0\",\t// Running\r\n\t\t\t\"#AAA\"\t// Stopped\r\n\t\t)\r\n\t),\r\n\t\"#808080\" // Unknown\r\n)", "type": "expression" } ], "type": "tag" } } }, "props": { "style": { "borderColor": "#000", "borderStyle": "solid", "borderWidth": 1 } }, "type": "ia.display.label" }, { "events": { "dom": { "onClick": { "config": { "script": "\tself.parent.openWindow()" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Text" }, "position": { "height": "calc(100% - 10px)", "width": "calc(100% - 10px)", "x": 5, "y": 5 }, "propConfig": { "props.text": { "binding": { "config": { "fallbackDelay": 2.5, "mode": "indirect", "references": { "tagPath": "{view.params.tagPath}" }, "tagPath": "{tagPath}/Parameters.LabelFull" }, "transforms": [ { "expression": "coalesce({view.params.label}, {value}, \"Unknown\")", "type": "expression" } ], "type": "tag" } } }, "props": { "style": { "backgroundColor": "#FFF", "borderColor": "#000", "borderStyle": "solid", "borderWidth": 1, "fontSize": "12px", "fontWeight": "bold", "overflow": "hidden", "paddingLeft": "5px", "textOverflow": "ellipsis", "textTransform": "uppercase", "user-select": "none", "whiteSpace": "nowrap" } }, "type": "ia.display.label" }, { "events": { "dom": { "onClick": { "config": { "script": "\tself.parent.openWindow()" }, "scope": "G", "type": "script" } } }, "meta": { "name": "TooltipOverlay" }, "position": { "height": "100%", "width": "100%" }, "propConfig": { "meta.visible": { "binding": { "config": { "expression": "{view.params.enableTooltip} \u0026\u0026 {view.params.tagPath} !\u003d \"\"" }, "type": "expr" } }, "props.status.tooltip": { "binding": { "config": { "fallbackDelay": 2.5, "mode": "indirect", "references": { "tagPath": "{view.params.tagPath}" }, "tagPath": "{tagPath}/Graphics" }, "transforms": [ { "expression": "if(isGood({value}),\r\n\tjsonGet({value}, \"tooltip\"),\r\n\t\"Tooltip not configured\"\r\n)", "type": "expression" } ], "type": "tag" } } }, "props": { "status": {} }, "type": "dex.display.tooltipoverlay" } ], "events": { "dom": { "onMouseEnter": { "config": { "script": "\tself.session.custom.areaHover \u003d nav.getAreas(self.view.params.view)" }, "enabled": false, "scope": "G", "type": "script" }, "onMouseLeave": { "config": { "script": "\tself.session.custom.areaHover \u003d []" }, "enabled": false, "scope": "G", "type": "script" } } }, "meta": { "name": "root" }, "props": { "style": { "cursor": "pointer" } }, "scripts": { "customMethods": [ { "name": "openWindow", "params": [], "script": "\tview \u003d self.view.params.view\n\tif view in [\"\", None]:\n\t\tview \u003d \"Windows/Graphics/\"+self.getChild(\"Text\").props.text.replace(\" \", \"_\")\n\t# Open window:\n\twindow \u003d \"Windows/GraphicsWrapper\"\n\tparams \u003d {\"view\": view}\n\tsystem.perspective.navigate(\"/\")\n\tsystem.perspective.navigate(view\u003dwindow, params\u003dparams)" } ], "messageHandlers": [] }, "type": "ia.container.coord" } }