{ "custom": {}, "params": { "deviceType": "beacon", "meta": { "name": "" }, "props": { "config": { "alwaysShowAll": true, "enableHighlight": true, "isClickable": false, "isRightOfSorter": false, "mirror": false, "originSide": "left", "paddleThickness": 10, "showLabel": true, "type": "belt" }, "status": { "color": "#aaa", "isExtended": true, "isManual": false, "isRetracted": false, "showAlways": true, "showLabel": "B", "tagPath": "", "tooltip": "" } }, "tabs": [ "Status", "Alarm History", "Devices", "Controls" ] }, "propConfig": { "params.deviceType": { "paramDirection": "input", "persistent": true }, "params.meta": { "paramDirection": "input", "persistent": true }, "params.meta.name": { "paramDirection": "input", "persistent": true }, "params.props": { "paramDirection": "input", "persistent": true }, "params.props.config": { "paramDirection": "input", "persistent": true }, "params.props.config.alwaysShowAll": { "paramDirection": "input", "persistent": true }, "params.props.config.isRightOfSorter": { "paramDirection": "input", "persistent": true }, "params.props.config.mirror": { "paramDirection": "input", "persistent": true }, "params.props.config.originSide": { "paramDirection": "input", "persistent": true }, "params.props.config.paddleThickness": { "paramDirection": "input", "persistent": true }, "params.props.config.showLabel": { "paramDirection": "input", "persistent": true }, "params.props.config.type": { "paramDirection": "input", "persistent": true }, "params.props.status": { "paramDirection": "input", "persistent": true }, "params.props.status.background": { "paramDirection": "input", "persistent": true }, "params.props.status.isExtended": { "paramDirection": "input", "persistent": true }, "params.props.status.isFaulted": { "paramDirection": "input", "persistent": true }, "params.props.status.isManual": { "paramDirection": "input", "persistent": true }, "params.props.status.isRetracted": { "paramDirection": "input", "persistent": true }, "params.props.status.showLabel": { "paramDirection": "input", "persistent": true }, "params.props.status.tooltip": { "paramDirection": "input", "persistent": true }, "params.tabs": { "paramDirection": "inout", "persistent": true }, "params.tabs[0]": { "paramDirection": "input", "persistent": true }, "params.tabs[1]": { "paramDirection": "input", "persistent": true }, "params.tabs[2]": { "paramDirection": "input", "persistent": true }, "params.tabs[3]": { "paramDirection": "input", "persistent": true } }, "props": { "defaultSize": { "height": 569 } }, "root": { "children": [ { "meta": { "name": "Label_0" }, "position": { "height": 35, "width": "100%" }, "propConfig": { "props.text": { "binding": { "config": { "path": "view.params.deviceType" }, "transforms": [ { "code": "\t# Handle special cases\n\tif(value \u003d\u003d \"eip\"):\n\t\tvalue \u003d \"Ethernet IP (EIP)\"\n\telif(value \u003d\u003d \"mcp\"):\n\t\tvalue \u003d \"Main Control Panel (MCP)\"\n\telif(value \u003d\u003d \"divertpaddle\"):\n\t\tvalue \u003d \"Divert Paddle\"\n\telif(value \u003d\u003d \"limitswitch\"):\n\t\tvalue \u003d \"Limit Switch\"\n\telif(value \u003d\u003d \"photoeye\"):\n\t\tvalue \u003d \"Photo Eye\"\n\telif(value \u003d\u003d \"pushbutton\"):\n\t\tvalue \u003d \"Push Button\"\n\telif(value.startswith(\"vfd\")):\n\t\tvalue \u003d \"Variable Frequency Drive (VFD)\"\n\telif(value \u003d\u003d \"chutedestination\"):\n\t\tvalue \u003d \"Chute Destination\"\n\telif(value \u003d\u003d \"hss_chute\"):\n\t\tvalue \u003d \"Chute Destination\"\n\telif(value \u003d\u003d \"spiralchute\"):\n\t\tvalue \u003d \"Spiral Chute\"\n\telif(value \u003d\u003d \"divchute\"):\n\t\tvalue \u003d \"Divert Chute\"\n\telif(value \u003d\u003d \"rrchute\"):\n\t\tvalue \u003d \"Round Robin Chute\"\n\telse:\n\t\t# Do proper caps for anything else\n\t\tvalue \u003d value.title()\n\treturn value", "type": "script" }, { "expression": "coalesce({value}, \"Unknown\")", "type": "expression" } ], "type": "property" } } }, "props": { "style": { "backgroundColor": "#1A4A5E", "borderColor": "#000", "borderStyle": "solid", "borderWidth": "1px", "color": "#FFF", "fontSize": "20px", "fontWeight": "bold", "paddingLeft": 5 } }, "type": "ia.display.label" }, { "meta": { "name": "TabContainer" }, "position": { "height": "calc(100% - 35px)", "width": "100%", "y": 35 }, "propConfig": { "custom.key": { "binding": { "config": { "path": "session.props.auth.user.roles" }, "transforms": [ { "code": "\troles \u003d [\"Administrator\", \"Developer\"]\n\treturn value !\u003d None and len(value) \u003e 0 and len([i for i in value if i in roles]) \u003e 0", "type": "script" } ], "type": "property" } }, "props.tabs": { "binding": { "config": { "struct": { "deviceType": "{view.params.deviceType}", "roles": "{session.props.auth.user.roles}", "tagPath": "try({view.params.props.status.tagPath}, \"\")" }, "waitOnAll": true }, "transforms": [ { "code": "\tcontrols \u003d [\"spiralchute\", \"divchute\", \"rrchute\", \"chutedestination\", \"hss_chute\"]\n\tdevices \u003d controls + [\"conveyor\", \"conveyorcurve\", \"gaylord\"]#, \"mcp\"]\n\troles \u003d [\"Administrator\", \"Developer\", \"Maintenance\"]\n\t\n\t# Add base tab:\n\ttabs \u003d [\"Status\" if value.deviceType not in controls else \"Controls\"]\n\t# Add alarm history tab:\n\tif value.deviceType not in [\"beacon\"]:\n\t\ttabs.append(\"Alarm History\")\n\t# Add fms:\n\tif value.tagPath not in [None, \"\"]:\n\t\ttag \u003d system.tag.getConfiguration(self.view.params.props.status.tagPath)[0]\n\t\tif \"typeId\" in tag and tag[\"typeId\"].endswith(\"_FMS\"):\n\t\t\ttabs.append(\"Flow Management\")\n\t# Add devices tab:\n\tif value.deviceType in devices:\n\t\ttabs.append(\"Devices\")\n\t# Add tags tab:\n\tif value.deviceType not in controls and value.roles !\u003d None and len([r for r in value.roles if r in roles]) \u003e 0:\n\t\ttabs.append(\"Tags\")\n\t\n\t# Return tabs:\n\treturn tabs", "type": "script" } ], "type": "expr-struct" } } }, "props": { "menuStyle": { "backgroundColor": "#225E77" }, "tabSize": { "height": 35, "width": 150 }, "tabStyle": { "active": { "backgroundColor": "#2D7D9F", "color": "#FFF", "fontWeight": "bold" }, "inactive": { "backgroundColor": "#389CC7", "color": "#FFF" } } }, "type": "ia.container.tab" }, { "meta": { "name": "EmbeddedView" }, "position": { "height": "calc(100% - 69px)", "width": "100%", "y": 69 }, "propConfig": { "props.params.deviceType": { "binding": { "config": { "path": "view.params.deviceType" }, "type": "property" } }, "props.params.meta": { "binding": { "config": { "path": "view.params.meta" }, "type": "property" } }, "props.params.props": { "binding": { "config": { "path": "view.params.props" }, "type": "property" } }, "props.path": { "binding": { "config": { "expression": "property(\"../TabContainer.props.tabs[\"+{../TabContainer.props.currentTabIndex}+\"]\")" }, "transforms": [ { "fallback": "\"Popups/Device/Statuses/\" + {view.params.deviceType}", "inputType": "scalar", "mappings": [ { "input": "Status", "output": "\"Popups/Device/Statuses/\" + {view.params.deviceType}" }, { "input": "Controls", "output": "\"Popups/Device/Controls/\" + {view.params.deviceType}" }, { "input": "Alarm History", "output": "\"Popups/Device/AlarmHistory\"" }, { "input": "Flow Management", "output": "\"Popups/Device/FlowManagement\"" }, { "input": "Devices", "output": "\"Popups/Device/Devices\"" }, { "input": "Tags", "output": "\"Popups/Device/Tags\"" } ], "outputType": "expression", "type": "map" } ], "type": "expr" } } }, "type": "ia.display.view" }, { "events": { "component": { "onActionPerformed": { "config": { "script": "\twindow \u003d \"Windows/GraphicsWrapper\"\n\tplctag \u003d self.view.params.props.status.tagPath.replace(\"[default]\", \"\").split(\"/\")[0]\n\tplctag \u003d \"[\"+plctag+\"]\"\n\tdevice \u003d utils.extractName(self.view.params.props.status)\n\tscreen \u003d alarms.resolveScreen(device, plctag)\n\tparams \u003d {\"view\": screen}\n\tsystem.perspective.navigate(\"/\")\n\tsystem.perspective.navigate(view\u003dwindow, params\u003dparams)\n\tsystem.perspective.closePopup(\"\")" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button_GoTo" }, "position": { "height": 25, "width": 80, "x": "calc(100% - 85px)", "y": 5 }, "props": { "style": { "classes": "Buttons/Grey" }, "text": "Go To" }, "type": "ia.input.button" }, { "events": { "component": { "onActionPerformed": { "config": { "script": "\tsystem.perspective.sendMessage(\"export-data\")" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button_Export" }, "position": { "height": 25, "width": 80, "x": "calc(100% - 170px)", "y": 5 }, "props": { "style": { "classes": "Buttons/Grey" }, "text": "Export" }, "type": "ia.input.button" } ], "meta": { "name": "root" }, "props": { "style": { "classes": "window" } }, "type": "ia.container.coord" } }