{ "custom": { "PLC_list": null, "running_state": -1, "state": 5, "views_data": [] }, "params": { "tagProps": [ "PLC01/PS1-9/101SN01_ES", "value", "value", "value", "value", "value", "value", "value", "value", "value" ] }, "propConfig": { "custom.PLC_list": { "binding": { "config": { "fallbackDelay": 2.5, "mode": "indirect", "references": { "fc": "{session.custom.fc}" }, "tagPath": "[{fc}_SCADA_TAG_PROVIDER]Configuration/PLC" }, "transforms": [ { "code": "\tdevices \u003d system.util.jsonDecode(value)\n\tplcList \u003d []\n\tfor k in devices.keys():\n\t\tplcList.append(k)\n\t\t\n\treturn(sorted(set(plcList)))\n", "type": "script" } ], "type": "tag" }, "persistent": true }, "custom.running_state": { "binding": { "config": { "expression": "try(jsonGet({session.custom.state_messages},{this.custom.tag_path_to_lookup}),-1)\t\r\n" }, "transforms": [ { "expression": "if({value} !\u003d -1, try(jsonGet({value},\"state\"),4),{value})", "type": "expression" } ], "type": "expr" }, "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": "if(isNull({value}), 0, {value})", "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.views_data": { "binding": { "config": { "struct": { "equipment_id": "{view.params.tagProps[0]}" }, "waitOnAll": true }, "transforms": [ { "code": "\tproject_info \u003d system.perspective.getProjectInfo()\n\t#self.custom.views_data \u003d project_info\n\tviews \u003d project_info.get(\"views\")\n\t#equipment_id \u003d self.view.params.tagProps[0]\n\tviews_data \u003d [i for i in views if i[\"path\"].startswith(\"Custom-Views/\"+ value.equipment_id)]\n\t#self.custom.views_data \u003d views_data\n\t\n\treturn views_data", "type": "script" } ], "type": "expr-struct" }, "persistent": true }, "params.tagProps": { "paramDirection": "input", "persistent": true } }, "props": { "defaultSize": { "width": 400 } }, "root": { "children": [ { "children": [ { "children": [ { "meta": { "name": "Label" }, "position": { "grow": 1 }, "propConfig": { "props.text": { "binding": { "config": { "expression": "\u0027Source ID: \u0027 + {view.params.tagProps[0]}" }, "type": "expr" } } }, "props": { "style": { "color": "#FFFF", "fontFamily": "Arial", "fontSize": 14, "fontWeight": "bold", "paddingLeft": 10 } }, "type": "ia.display.label" }, { "events": { "dom": { "onClick": { "config": { "script": "\tsystem.perspective.closeDock(\u0027Docked-East\u0027)\n\tself.getSibling(\"tabs\").props.currentTabIndex \u003d 0" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Icon", "tooltip": { "enabled": true, "style": { "cursor": "pointer" }, "text": "Close faceplate" } }, "props": { "path": "material/close", "style": { "cursor": "pointer", "marginBottom": 5, "marginLeft": 5, "marginRight": 5, "marginTop": 5 } }, "type": "ia.display.icon" } ], "meta": { "name": "FlexContainer" }, "position": { "basis": "30px", "shrink": 0 }, "type": "ia.container.flex" }, { "children": [ { "children": [ { "meta": { "name": "Label" }, "position": { "basis": "200px" }, "propConfig": { "position.display": { "binding": { "config": { "path": "session.custom.command_auth.enabled" }, "type": "property" } }, "props.text": { "binding": { "config": { "expression": "\u0027Control Enabled Timeout: \\n\u0027 + ({session.custom.command_auth.timeout_sp} - {session.custom.command_auth.auth_timeout}) + \u0027 seconds\u0027" }, "type": "expr" } } }, "props": { "style": { "color": "#000000", "fontFamily": "Arial", "fontSize": 14, "fontWeight": "bold", "marginBottom": 5, "marginLeft": 5, "marginRight": 5, "marginTop": 5, "whiteSpace": "pre" }, "textStyle": { "textAlign": "center" } }, "type": "ia.display.label" }, { "events": { "component": { "onActionPerformed": { "config": { "script": "\tif self.session.custom.command_auth.enabled:\n\t\t\tself.session.custom.command_auth.enabled \u003d False\n\telse:\n\t\t#self.session.custom.command_auth.enabled \u003d True\n\t\tsystem.perspective.openPopup(\u0027command-auth\u0027, \u0027PopUp-Views/Command-Authenticate\u0027, showCloseIcon \u003d False, draggable \u003d False, modal \u003d True, overlayDismiss \u003d True)" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Button_0", "tooltip": { "enabled": true, "location": "bottom", "style": { "whiteSpace": "pre" } } }, "position": { "basis": "170px", "shrink": 0 }, "propConfig": { "meta.tooltip.text": { "binding": { "config": { "expression": "//if({this.props.enabled}, \u0027Re-Authenticate to Enable Command Controls\u0027, \u0027Insufficient Privileges - User Role Required: \u0027 + {session.custom.fc} + \u0027-rme-all\u0027)\r\nif({session.custom.command_auth.enabled},\u0027Click to Disable Controls.\u0027, \u0027Re-Authenticate to Enable Command Controls \\nUser Role Required: \u0027 + {session.custom.fc} + \u0027-rme-all\u0027)" }, "type": "expr" } }, "props.image.icon.path": { "binding": { "config": { "expression": "if({session.custom.command_auth.enabled},\u0027material/lock_open\u0027,\u0027material/lock\u0027)" }, "type": "expr" } }, "props.text": { "binding": { "config": { "expression": "if({session.custom.command_auth.enabled},\u0027Disable Controls\u0027,\u0027Enable Controls\u0027)" }, "type": "expr" } } }, "props": { "image": { "icon": {} }, "primary": false, "style": { "marginBottom": 5, "marginRight": 25, "marginTop": 5 } }, "type": "ia.input.button" } ], "meta": { "name": "FlexContainer" }, "position": { "basis": "50px" }, "props": { "justify": "flex-end" }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "EmbeddedView" }, "position": { "basis": "400px", "shrink": 0 }, "propConfig": { "props.params.value.tagProps[0]": { "binding": { "config": { "path": "view.params.tagProps[0]" }, "type": "property" } } }, "props": { "params": { "value": { "tagProps": [ null, "value", "value", "value", "value", "value", "value", "value", "value", "value" ] } }, "path": "Symbol-Views/Controller-Views/CommandControlActions" }, "type": "ia.display.view" } ], "meta": { "name": "FlexContainer_0" }, "position": { "basis": "50px" }, "type": "ia.container.flex" } ], "meta": { "name": "FlexContainer_0" }, "position": { "basis": "100px", "shrink": 0 }, "propConfig": { "position.display": { "binding": { "config": { "path": "view.params.tagProps[0]" }, "transforms": [ { "code": "\n\tplcList \u003d self.view.custom.PLC_list\n\n\tshowCommand \u003d False\n\n\tfor i in plcList:\n\t\tif value \u003d\u003d i:\n\t\t\tshowCommand \u003d True\n\n\treturn showCommand", "type": "script" } ], "type": "property" } } }, "props": { "direction": "column", "style": { "classes": "Buttons/Clear-Background" } }, "type": "ia.container.flex" }, { "children": [ { "children": [ { "children": [ { "meta": { "name": "Label" }, "position": { "basis": "32px" }, "propConfig": { "position.display": { "binding": { "config": { "expression": "if({../AlarmTable.props.params.length_of_table_data} \u003d 0, True, False)" }, "type": "expr" } } }, "props": { "style": { "classes": "Labels/Label_1", "marginTop": 20 }, "text": "No Active Alarms" }, "type": "ia.display.label" }, { "meta": { "name": "AlarmTable" }, "position": { "basis": "733px", "grow": 1 }, "propConfig": { "position.display": { "binding": { "config": { "expression": "if({this.props.params.length_of_table_data} \u003e 0, True, False)" }, "type": "expr" } }, "props.params.tagProps[0]": { "binding": { "config": { "path": "view.params.tagProps[0]" }, "type": "property" } } }, "props": { "params": { "alarm_states": [ "Shelved", "Active", "Not Active" ], "length_of_table_data": 0, "show_severity_column": true, "show_state_column": true, "table_type": "Docked-East", "tagProps": [ null ] }, "path": "Alarm-Views/AlarmTable" }, "type": "ia.display.view" } ], "meta": { "name": "Active_tab" }, "props": { "direction": "column" }, "type": "ia.container.flex" }, { "children": [ { "children": [ { "children": [ { "meta": { "name": "NameField" }, "position": { "basis": "50%", "grow": 1 }, "props": { "style": { "paddingLeft": 20 }, "text": "NAME" }, "type": "ia.display.label" }, { "meta": { "name": "DeviceName" }, "position": { "basis": "50%", "grow": 1 }, "propConfig": { "props.text": { "binding": { "config": { "path": "view.params.tagProps[0]" }, "type": "property" } } }, "props": { "style": { "backgroundColor": "#FFFFFF", "classes": "Text-Styles/Ariel-Bold-12pt", "paddingLeft": 10 } }, "type": "ia.display.label" } ], "meta": { "name": "Name" }, "position": { "basis": "35px" }, "props": { "style": { "classes": "PopUp-Styles/InfoLabel" } }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "NameField" }, "position": { "basis": "50%", "grow": 1 }, "props": { "style": { "paddingLeft": 20 }, "text": "PRIORITY" }, "type": "ia.display.label" }, { "meta": { "name": "Priority" }, "position": { "basis": "50%", "grow": 1 }, "propConfig": { "props.style.classes": { "binding": { "config": { "expression": "if({session.custom.colours.colour_impaired} \u003d False, {view.custom.state}, {view.custom.state} + 300) " }, "transforms": [ { "fallback": "State-Styles/Background-Fill/State0", "inputType": "scalar", "mappings": [ { "input": 1, "output": "State-Styles/Background-Fill/State1" }, { "input": 2, "output": "State-Styles/Background-Fill/State2" }, { "input": 3, "output": "State-Styles/Background-Fill/State3" }, { "input": 4, "output": "State-Styles/Background-Fill/State4" }, { "input": 5, "output": "State-Styles/Background-Fill/State5" }, { "input": 6, "output": "State-Styles/Background-Fill/State6" }, { "input": 0, "output": "State-Styles/Background-Fill/State0" }, { "input": 301, "output": "State-Styles/Alt-Background-Fill/State1" }, { "input": 302, "output": "State-Styles/Alt-Background-Fill/State2" }, { "input": 303, "output": "State-Styles/Alt-Background-Fill/State3" }, { "input": 304, "output": "State-Styles/Alt-Background-Fill/State4" }, { "input": 305, "output": "State-Styles/Alt-Background-Fill/State5" } ], "outputType": "style-list", "type": "map" } ], "type": "expr" } }, "props.tag_path_to_lookup": { "binding": { "config": { "expression": "\"[\\\"\" + {view.params.tagProps[0]} + \"\\\"]\"" }, "type": "expr" } }, "props.text": { "binding": { "config": { "expression": "{view.custom.state}" }, "transforms": [ { "fallback": "", "inputType": "scalar", "mappings": [ { "input": 0, "output": "Stopped" }, { "input": 1, "output": "High Priority" }, { "input": 2, "output": "Medium Priority" }, { "input": 3, "output": "Low Priority" }, { "input": 4, "output": "Diagnostic" }, { "input": 5, "output": "Healthy" } ], "outputType": "scalar", "type": "map" } ], "type": "expr" } } }, "props": { "style": { "paddingLeft": 10, "textAlign": "left" } }, "type": "ia.display.label" } ], "meta": { "name": "Priority" }, "position": { "basis": "35px" }, "props": { "style": { "classes": "PopUp-Styles/InfoLabel" } }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "NameField" }, "position": { "basis": "50%", "grow": 1 }, "props": { "style": { "paddingLeft": 20 }, "text": "RUNNING STATUS" }, "type": "ia.display.label" }, { "meta": { "name": "Priority" }, "position": { "basis": "50%", "grow": 1 }, "propConfig": { "props.style.classes": { "binding": { "config": { "expression": "if({session.custom.colours.colour_impaired},\r\n{view.custom.running_state} + 300, {view.custom.running_state})" }, "transforms": [ { "fallback": "State-Styles/Background-Fill/StateUnknown", "inputType": "scalar", "mappings": [ { "input": 1, "output": "State-Styles/Background-Fill/State1" }, { "input": 2, "output": "State-Styles/Background-Fill/State0" }, { "input": 3, "output": "State-Styles/Background-Fill/State5" }, { "input": 301, "output": "State-Styles/Background-Fill/State1" }, { "input": 302, "output": "State-Styles/Background-Fill/State0" }, { "input": 303, "output": "State-Styles/Alt-Background-Fill/State5" } ], "outputType": "style-list", "type": "map" } ], "type": "expr" } }, "props.tag_path_to_lookup": { "binding": { "config": { "expression": "\"[\\\"\" + {view.params.tagProps[0]} + \"\\\"]\"" }, "type": "expr" } }, "props.text": { "binding": { "config": { "expression": "{view.custom.running_state}" }, "transforms": [ { "fallback": "Unknown", "inputType": "scalar", "mappings": [ { "input": 1, "output": "Faulted" }, { "input": 2, "output": "Stopped" }, { "input": 3, "output": "Running" } ], "outputType": "scalar", "type": "map" } ], "type": "expr" } } }, "props": { "style": { "paddingLeft": 10, "textAlign": "left" } }, "type": "ia.display.label" } ], "meta": { "name": "Running Status" }, "position": { "basis": "35px" }, "propConfig": { "position.display": { "binding": { "config": { "expression": "{view.custom.running_state} \u003e -1" }, "type": "expr" } } }, "props": { "style": { "classes": "PopUp-Styles/InfoLabel" } }, "type": "ia.container.flex" } ], "meta": { "name": "FlexContainer_0" }, "position": { "basis": "100px" }, "props": { "direction": "column" }, "type": "ia.container.flex" } ], "meta": { "name": "Info_tab" }, "position": { "tabIndex": 1 }, "props": { "direction": "column" }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "Label" }, "position": { "basis": "32px" }, "propConfig": { "position.display": { "binding": { "config": { "expression": "len({../Views_list.props.data}) \u003d 0" }, "type": "expr" } } }, "props": { "style": { "classes": "Labels/Label_1", "marginTop": 20 }, "text": "No Configured Custom Views" }, "type": "ia.display.label" }, { "events": { "component": { "onRowDoubleClick": [ { "config": { "script": "\trow \u003d event.value\n\tcustom_view \u003d row.get(\"path\",\"none\")\n\tif custom_view !\u003d \"None\":\n\t\tequipment_id \u003d custom_view.split(\"/\")[1]\n\t\turl_to_navigate \u003d \"/CustomView/%s/\" % (equipment_id,)\n\t\tsystem.perspective.navigate(page \u003d url_to_navigate)\n\t\tsystem.perspective.sendMessage(\"plc-to-display\", payload \u003d {\"device\":\"none\",\"show_controls\":False,\"area\":\"none\"}, scope \u003d \"page\")\n\t\tsystem.perspective.closePopup(id\u003d \"StatusPopUP\")\n\t\tself.parent.parent.parent.getChild(\"tabs\").props.currentTabIndex \u003d 0\n\t\t\n\t" }, "scope": "G", "type": "script" }, { "config": { "draggable": true, "id": "W1H0Nole", "modal": false, "overlayDismiss": false, "resizable": true, "showCloseIcon": true, "title": "InfoPopUp", "type": "close", "viewPath": "PopUp-Views/Controller-Equipment/Information", "viewportBound": false }, "scope": "C", "type": "popup" } ] } }, "meta": { "name": "Views_list" }, "position": { "basis": "915px", "grow": 1 }, "propConfig": { "position.display": { "binding": { "config": { "expression": "len({this.props.data}) \u003e 0" }, "type": "expr" } }, "props.data": { "binding": { "config": { "path": "view.custom.views_data" }, "type": "property" } } }, "type": "ia.display.table" } ], "meta": { "name": "Views_tab" }, "position": { "tabIndex": 2 }, "props": { "direction": "column" }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "Label" }, "position": { "basis": "32px" }, "props": { "style": { "classes": "Labels/Label_1", "marginTop": 20 }, "text": "For Future Development" }, "type": "ia.display.label" } ], "meta": { "name": "OEE_tab" }, "position": { "tabIndex": 3 }, "props": { "direction": "column" }, "type": "ia.container.flex" } ], "meta": { "name": "tabs" }, "position": { "grow": 1 }, "props": { "menuType": "modern", "tabSize": { "width": 1000 }, "tabStyle": { "active": { "classes": "", "color": "#FFFFFF", "fontFamily": "Arial", "fontSize": 14, "fontWeight": "bold", "paddingLeft": 10 }, "inactive": { "classes": "", "color": "#B8B8B8", "fontFamily": "Arial", "fontSize": 14, "fontWeight": "bold", "paddingLeft": 10 } }, "tabs": [ "Alarms", "Info", "Views", "KPI\u0027s" ] }, "type": "ia.container.tab" } ], "meta": { "name": "FlexContainer_1" }, "position": { "basis": "670px", "grow": 1 }, "type": "ia.container.flex" } ], "meta": { "name": "FlexContainer" }, "position": { "basis": "800px", "grow": 1 }, "props": { "direction": "column" }, "type": "ia.container.flex" } ], "meta": { "name": "root" }, "props": { "direction": "column", "style": { "classes": "Buttons/Button-Menu" } }, "type": "ia.container.flex" } }