{ "custom": { "PLC": "MCM02", "device": "NSC1_1_PS1", "showTags": true, "state": "Offline", "view": "autStand/Equipment/PressureSensor" }, "params": { "name": "", "tagProps": [ "System/MCM02/PS/NSC1_1_PS1", "value", "value", "value", "value", "value", "value", "value", "value", "value" ], "tags": [] }, "propConfig": { "custom.PLC": { "binding": { "config": { "path": "view.params.tagProps[0]" }, "transforms": [ { "code": "\treturn value.split(\"/\")[1]", "type": "script" } ], "type": "property" }, "persistent": true }, "custom.device": { "binding": { "config": { "path": "view.params.tagProps[0]" }, "transforms": [ { "code": " name \u003d self.params.name\n if name!\u003d\"\":\n\t\treturn name\n return value.rsplit(\u0027/\u0027, 1)[-1]", "type": "script" } ], "type": "property" }, "onChange": { "enabled": null, "script": "\tname \u003d self.view.custom.device\n\t\n\t# Use a list of tuples to maintain order - longer matches first\n\tdevice_mapping \u003d [\n\t (\u0027PS\u0027, \u0027PressureSensor\u0027),\n\t \t \n\t # Encoder variations (check these first before \u0027EN\u0027)\n\t (\u0027ENSH\u0027, \u0027Encoder\u0027),\n\t (\u0027ENW\u0027, \u0027Encoder\u0027),\n\t (\u0027ENCODER\u0027, \u0027Encoder\u0027),\n\t \n\t # Photoeye variations\n\t (\u0027LRPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t \n\t # IO_Block variations\n\t (\u0027SIO\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIOM\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIO_\u0027, \u0027IO_Block\u0027),\n\t \n\t # Button variations (check after encoder)\n\t (\u0027EN\u0027, \u0027Chute_Button\u0027),\n\t (\u0027JR\u0027, \u0027Button\u0027),\n\t \n\t # Photoeye (shorter version after longer ones)\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027PE\u0027, \u0027Photoeye_Chute\u0027),\n\t \n\t # Other devices variations \n\t (\u0027DPM\u0027, \u0027DPM\u0027),\n\t (\u0027EPC\u0027, \u0027EPC\u0027),\n\t (\u0027MCM\u0027, \u0027MCM\u0027),\n\t (\u0027PRX\u0027, \u0027ProxSensor\u0027),\n\t (\u0027SS\u0027, \u0027SS_Button\u0027),\n\t (\u0027SOL\u0027, \u0027Solenoid\u0027),\n\t \n\t # Beacon Variations (single letters last)\n\t (\u0027B\u0027, \u0027Beacon\u0027),\n\t (\u0027G\u0027, \u0027Beacon\u0027),\n\t (\u0027R\u0027, \u0027Beacon\u0027),\n\t (\u0027H\u0027, \u0027Beacon\u0027),\n\t (\u0027A\u0027, \u0027Beacon\u0027),\n\t (\u0027S03\u0027, \u0027Scanner\u0027)\n\t\t\n\t]\n\t\n\tview \u003d \"\"\n\t\n\tfor key, value in device_mapping:\n\t if key in name:\n\t\t\tview \u003d value\n\t\t\tself.custom.view \u003d \"autStand/Equipment/\" + view\n\t\t\treturn \n\t\n\tself.custom.view \u003d \"autStand/Equipment/Camera\"" }, "persistent": true }, "custom.showTags": { "binding": { "config": { "expression": "len(trim({session.props.auth.user.userName})) \u003e 0 \u0026\u0026 lower({session.props.auth.user.userName}) !\u003d \"null\"" }, "type": "expr" }, "onChange": { "enabled": null, "script": "\ttabsComp \u003d self.getChild(\"root\").getChild(\"FlexContainer\").getChild(\"Main\").getChild(\"tabs\").props.tabs\n\ttabs \u003d list(tabsComp) # copy to modify\n\t\n\tif currentValue.value: # user logged in\n\t if \"Tags\" not in tabs:\n\t tabs.append(\"Tags\") # add the \"Tags\" tab\n\t self.getChild(\"root\").getChild(\"FlexContainer\").getChild(\"Main\").getChild(\"tabs\").props.tabs \u003d tabs\n\telse: # user logged out\n\t if \"Tags\" in tabs:\n\t tabs.remove(\"Tags\") # remove the \"Tags\" tab\n\t self.getChild(\"root\").getChild(\"FlexContainer\").getChild(\"Main\").getChild(\"tabs\").props.tabs \u003d tabs\n\t \n\t\n\t" }, "persistent": true }, "custom.state": { "persistent": true }, "custom.view": { "persistent": true }, "params.name": { "paramDirection": "input", "persistent": true }, "params.tagProps": { "onChange": { "enabled": null, "script": "\ttagPath \u003d currentValue.value[0].value #I know this looks ugly\t\t\t\n\tstatus \u003d autStand.devices.get_single_device_status(self, tagPath)\n\tself.view.custom.state \u003d status\n\n" }, "paramDirection": "input", "persistent": true }, "params.tags": { "paramDirection": "input", "persistent": true } }, "props": { "defaultSize": { "width": 600 } }, "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-Device\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 }, "props": { "style": { "overflow": "hidden" } }, "type": "ia.container.flex" }, { "children": [ { "children": [ { "children": [ { "meta": { "name": "Label" }, "position": { "basis": "32px", "display": false }, "propConfig": { "position.display": { "binding": { "config": { "expression": "if({../AlarmTable.props.params.length_of_table_data} \u003d 0, True, False)" }, "enabled": false, "type": "expr" } } }, "props": { "style": { "classes": "Labels/Label_1", "marginTop": 20 }, "text": "No Active Alarms" }, "type": "ia.display.label" }, { "meta": { "name": "AlarmStatusTable" }, "position": { "basis": "400px", "grow": 1 }, "propConfig": { "props.filters.active.text": { "binding": { "config": { "path": "view.params.tagProps[0]" }, "transforms": [ { "code": "\treturn value[1:]", "type": "script" } ], "type": "property" } } }, "props": { "columns": { "active": { "displayPath": { "enabled": false }, "priority": { "enabled": false }, "source": { "enabled": false }, "state": { "enabled": false } } }, "enableAcknowledge": false, "enableDetails": false, "enableShelve": false, "enableUnshelve": false, "filters": { "active": { "priorities": { "critical": false, "high": false, "low": false, "medium": false }, "states": { "clearUnacked": false } } }, "refreshRate": 500, "rowStyles": { "activeAcked": { "priorities": { "diagnostic": { "backgroundColor": "#579af1" }, "high": { "backgroundColor": "#fb615b" }, "low": { "backgroundColor": "#f8fa6e" }, "medium": { "backgroundColor": "#ee9b5c" } } }, "activeUnacked": { "base": { "color": "black" }, "priorities": { "critical": { "backgroundColor": "#7C2320" }, "diagnostic": { "backgroundColor": "#579af1" }, "high": { "backgroundColor": "#fb615b" }, "low": { "backgroundColor": "#f8fa6e" }, "medium": { "backgroundColor": "#ee9b5c" } } } }, "toolbar": { "enableActiveTab": false, "enableConfiguration": false, "enableFilter": false, "enableFilterResults": false, "enablePreFilters": false, "enableShelvedTab": false, "enabled": false, "toggleableFilter": false } }, "type": "ia.display.alarmstatustable" } ], "meta": { "name": "Active_tab" }, "props": { "direction": "column", "style": { "key": "value" } }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "Table" }, "position": { "basis": "400px", "grow": 1, "shrink": 0 }, "propConfig": { "props.data": { "binding": { "config": { "path": "view.params.tags" }, "type": "property" } } }, "props": { "columns": [ { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "Name", "filter": { "boolean": { "condition": "" }, "date": { "condition": "", "value": "" }, "enabled": false, "number": { "condition": "", "value": "" }, "string": { "condition": "", "value": "" }, "visible": "on-hover" }, "footer": { "align": "center", "justify": "left", "style": { "classes": "" }, "title": "" }, "header": { "align": "center", "justify": "center", "style": { "classes": "" }, "title": "Name" }, "justify": "center", "nullFormat": { "includeNullStrings": false, "nullFormatValue": "", "strict": false }, "number": "value", "numberFormat": "0,0.##", "progressBar": { "bar": { "color": "", "style": { "classes": "" } }, "max": 100, "min": 0, "track": { "color": "", "style": { "classes": "" } }, "value": { "enabled": true, "format": "0,0.##", "justify": "center", "style": { "classes": "" } } }, "render": "auto", "resizable": true, "sort": "none", "sortable": true, "strictWidth": false, "style": { "classes": "", "fontSize": "1vmin", "whiteSpace": "normal", "wordBreak": "break-all" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": 180 }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "OPC Path", "filter": { "boolean": { "condition": "" }, "date": { "condition": "", "value": "" }, "enabled": false, "number": { "condition": "", "value": "" }, "string": { "condition": "", "value": "" }, "visible": "on-hover" }, "footer": { "align": "center", "justify": "left", "style": { "classes": "" }, "title": "OPC Path" }, "header": { "align": "center", "justify": "center", "style": { "classes": "" }, "title": "OPC Path" }, "justify": "center", "nullFormat": { "includeNullStrings": false, "nullFormatValue": "", "strict": false }, "number": "value", "numberFormat": "0,0.##", "progressBar": { "bar": { "color": "", "style": { "classes": "" } }, "max": 100, "min": 0, "track": { "color": "", "style": { "classes": "" } }, "value": { "enabled": true, "format": "0,0.##", "justify": "center", "style": { "classes": "" } } }, "render": "auto", "resizable": true, "sort": "none", "sortable": true, "strictWidth": false, "style": { "classes": "", "fontSize": "1vmin", "whiteSpace": "normal", "wordBreak": "break-all" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": 310 }, { "align": "center", "boolean": "checkbox", "dateFormat": "MM/DD/YYYY", "editable": false, "field": "Value", "filter": { "boolean": { "condition": "" }, "date": { "condition": "", "value": "" }, "enabled": false, "number": { "condition": "", "value": "" }, "string": { "condition": "", "value": "" }, "visible": "on-hover" }, "footer": { "align": "center", "justify": "left", "style": { "classes": "" }, "title": "" }, "header": { "align": "center", "justify": "center", "style": { "classes": "" }, "title": "Value" }, "justify": "center", "nullFormat": { "includeNullStrings": false, "nullFormatValue": "", "strict": false }, "number": "value", "numberFormat": "0,0.##", "progressBar": { "bar": { "color": "", "style": { "classes": "" } }, "max": 100, "min": 0, "track": { "color": "", "style": { "classes": "" } }, "value": { "enabled": true, "format": "0,0.##", "justify": "center", "style": { "classes": "" } } }, "render": "auto", "resizable": true, "sort": "none", "sortable": true, "strictWidth": false, "style": { "classes": "", "fontSize": "1vmin" }, "toggleSwitch": { "color": { "selected": "", "unselected": "" } }, "viewParams": {}, "viewPath": "", "visible": true, "width": "" } ], "pager": { "bottom": false }, "selection": { "enableRowSelection": false }, "virtualized": false }, "type": "ia.display.table" } ], "meta": { "name": "Tags_tab" }, "position": { "tabIndex": 2 }, "props": { "alignItems": "flex-start", "justify": "space-evenly" }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "EmbeddedView" }, "position": { "height": 100, "width": 100, "x": 37.33, "y": 23 }, "propConfig": { "props.params.tagProps": { "binding": { "config": { "path": "view.params.tagProps" }, "type": "property" } }, "props.path": { "binding": { "config": { "path": "view.custom.view" }, "type": "property" } } }, "type": "ia.display.view" }, { "children": [ { "meta": { "name": "Label" }, "props": { "style": { "classes": "Text-Styles/Ariel-Bold-12pt", "fontSize": 25 }, "text": "Name:", "textStyle": {} }, "type": "ia.display.label" }, { "meta": { "name": "Label_0" }, "position": { "basis": "50px", "grow": 1 }, "propConfig": { "props.text": { "binding": { "config": { "path": "view.custom.device" }, "type": "property" } } }, "props": { "style": { "borderStyle": "solid", "classes": "Text-Styles/Ariel-Bold-12pt", "fontSize": 20, "marginLeft": 10, "textAlign": "center" } }, "type": "ia.display.label" } ], "meta": { "name": "FlexContainer" }, "position": { "height": 43, "width": 378, "x": 202, "y": 17.33 }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "Label" }, "props": { "style": { "classes": "Text-Styles/Ariel-Bold-12pt", "fontSize": 25 }, "text": "Status: " }, "type": "ia.display.label" }, { "meta": { "name": "Label_0" }, "position": { "basis": "50px", "grow": 1 }, "propConfig": { "props.text": { "binding": { "config": { "path": "view.custom.state" }, "type": "property" } } }, "props": { "style": { "borderStyle": "solid", "classes": "Text-Styles/Ariel-Bold-12pt", "fontSize": 20, "marginLeft": 10, "textAlign": "center" }, "textStyle": { "fontSize": 20, "textAlign": "center" } }, "type": "ia.display.label" } ], "meta": { "name": "FlexContainer_0" }, "position": { "height": 43, "width": 386, "x": 194, "y": 69.33 }, "type": "ia.container.flex" }, { "children": [ { "meta": { "name": "Label" }, "props": { "style": { "classes": "Text-Styles/Ariel-Bold-12pt", "fontSize": 25 }, "text": "Panel:" }, "type": "ia.display.label" }, { "meta": { "name": "Label_0" }, "position": { "basis": "50px", "grow": 1 }, "propConfig": { "props.text": { "binding": { "config": { "path": "view.custom.PLC" }, "type": "property" } } }, "props": { "style": { "borderStyle": "solid", "classes": "Text-Styles/Ariel-Bold-12pt", "fontSize": 20, "marginLeft": 10, "textAlign": "center" } }, "type": "ia.display.label" } ], "meta": { "name": "FlexContainer_1" }, "position": { "height": 43, "width": 376, "x": 204, "y": 121.49 }, "type": "ia.container.flex" } ], "meta": { "name": "Status_tab" }, "position": { "tabIndex": 1 }, "type": "ia.container.coord" } ], "meta": { "name": "tabs" }, "position": { "grow": 1 }, "props": { "currentTabIndex": 1, "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", "Status", "Tags" ] }, "type": "ia.container.tab" } ], "meta": { "name": "Main" }, "position": { "basis": "670px", "grow": 1 }, "props": { "style": { "border-top": "1px solid white", "gap": "" } }, "type": "ia.container.flex" } ], "meta": { "name": "FlexContainer" }, "position": { "basis": "800px", "grow": 1 }, "props": { "direction": "column" }, "type": "ia.container.flex" } ], "events": { "system": { "onShutdown": { "config": { "script": "\tself.view.params.name \u003d \"\"\n\tsystem.perspective.closeDock(\"Docked-East-Conv\")" }, "scope": "G", "type": "script" } } }, "meta": { "name": "root" }, "position": { "x": 130, "y": -133 }, "props": { "direction": "column", "style": { "classes": "Buttons/Button-Menu" } }, "type": "ia.container.flex" } }